/* ============================================================
   ANTRONAUTS: SEARCH-AND-FIND — STYLES
   You rarely need to edit this file!!
   All colours are driven by CSS variables set by config.js
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── HEADER ─────────────────────────────────────────── */
.header {
  position: relative;
  z-index: 10;
  background: var(--header);
  border-bottom: 3px solid var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 52px;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
}

.header-spacer {
  width: 90px;
}

.header-title {
  font-family: 'Lilita One', cursive;
  font-size: 1.45rem;
  color: var(--text-light);
  letter-spacing: 2px;
  text-align: left;
  white-space: nowrap;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.header-btn {
  background: rgba(0, 0, 0, 0.25);
  border: 1.5px solid var(--accent-dark);
  color: var(--accent-light);
  padding: 5px 14px;
  border-radius: 8px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.2s;
}

.header-btn:hover {
  background: rgba(0, 0, 0, 0.45);
}

/* ── MAIN LAYOUT ─────────────────────────────────────── */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── SCENE ───────────────────────────────────────────── */
.scene-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
  background: #000;
  border-radius: 0 0 70px 70px;
}

.scene-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}


/* ── PREVENT TEXT CURSOR & SELECTION ────────────────────── */
.header,
.header-title,
.scene-wrap,
.scene-img,
.sidebar,
.char-grid,
.char-cell,
.char-name,
.char-status,
.char-ring-wrap,
.char-portrait {
  user-select: none;
  -webkit-user-select: none;
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: 280px;
  min-width: 260px;
  background: var(--sidebar);
  border-left: 10px solid var(--accent-dark);
  border-right: 10px solid var(--accent-dark);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.35);
}

/* ── SIDEBAR HEADER ──────────────────────────────────── */
.char-key-header {
  padding: 10px 12px 7px;
  border-bottom: 2px solid var(--accent-dark);
  background: var(--header);
  flex-shrink: 0;
}

.char-key-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 4px;
}

.magnifier {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.char-key-title {
  font-family: 'Lilita One', cursive;
  font-size: 1.2rem;
  letter-spacing: 1px;
}

/* rainbow letters — cycles through 6 colours */
.char-key-title span:nth-child(6n+1) {
  color: #f87c7c;
}

.char-key-title span:nth-child(6n+2) {
  color: #f8a05a;
}

.char-key-title span:nth-child(6n+3) {
  color: #f5d44a;
}

.char-key-title span:nth-child(6n+4) {
  color: #7bdd7b;
}

.char-key-title span:nth-child(6n+5) {
  color: #5bc8f5;
}

.char-key-title span:nth-child(6n+6) {
  color: #c084fc;
}

.find-label {
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  font-weight: 800;
  text-transform: uppercase;
}

/* ── CHARACTER GRID ──────────────────────────────────── */
.char-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: repeat(2, 110px);
  justify-content: center;
  row-gap: 20px;
  column-gap: 18px;
  align-content: start;
}

.char-grid::-webkit-scrollbar {
  width: 4px;
}

.char-grid::-webkit-scrollbar-track {
  background: transparent;
}

.char-grid::-webkit-scrollbar-thumb {
  background: var(--accent-dark);
  border-radius: 2px;
}

/* ── CHARACTER CELL ──────────────────────────────────── */
.char-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  overflow: visible;
}

.char-ring-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  transition: transform 0.2s ease;
}

.char-ring-wrap:hover {
  transform: scale(1.15);
  cursor: default;
}

.char-ring-wrap svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.char-portrait {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #ffffff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
}

.char-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* number badge */
.char-num {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  z-index: 2;
}

/* found checkmark */
.char-check {
  position: absolute;
  bottom: 2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4caf50;
  border: 2px solid var(--sidebar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: white;
  z-index: 2;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.3s, transform 0.3s;
}

.char-cell.found .char-check {
  opacity: 1;
  transform: scale(1);
}

/* status pill */
.char-status {
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
}

.char-status.not-found {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
}

.char-status.is-found {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid #4caf50;
  color: #7ee87e;
}

.char-name {
  font-size: 0.78rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  line-height: 1.25;
  max-width: 70px;
  word-break: break-word;
  white-space: pre-line;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.char-cell.found .char-name {
  opacity: 0.5;
}

/* ── FOOTER ──────────────────────────────────────────── */
.footer {
  background: var(--header);
  border-top: 2px solid var(--accent-dark);
  display: flex;
  align-items: center;
  padding: 6px 10px;
  gap: 8px;
  flex-shrink: 0;
}

.progress-pill {
  flex: 1;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--accent);
  border-radius: 30px;
  padding: 4px 12px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.78rem;
  color: var(--accent-light);
  letter-spacing: 1px;
}

.hint-btn {
  background: #4caf50;
  border: none;
  border-radius: 30px;
  padding: 6px 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.78rem;
  color: white;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.hint-btn:hover {
  background: #43a047;
  transform: scale(1.03);
}

.hint-btn:active {
  transform: scale(0.97);
}

.hint-btn:disabled {
  background: #555;
  cursor: default;
  transform: none;
}

/* ── CLICK RIPPLE ────────────────────────────────────── */
.ripple {
  position: absolute;
  border: 3px solid var(--accent);
  border-radius: 50%;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple-anim 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 20;
}

.ripple.miss {
  border-color: #e05050;
}

@keyframes ripple-anim {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 0;
  }
}

/* ── FOUND MARKER ────────────────────────────────────── */
.found-marker {
  position: absolute;
  width: 48px;
  height: 48px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pop-in 0.3s ease-out;
  z-index: 10;
  background: rgba(225, 178, 15, 0.15);
  box-shadow: 0 0 16px rgba(225, 178, 15, 0.55);
}

/* ── DWELL RING ──────────────────────────────────────── */
/* z-index: 60 — sits ABOVE the loupe (z-index: 50) so it's always visible */
.dwell-ring {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: none;
  z-index: 60;
  border: 3px solid #f5d44a;
  box-shadow: 0 0 12px rgba(245, 212, 74, 0.6);
  animation: dwell-shrink linear forwards;
}

@keyframes dwell-shrink {
  0% {
    transform: translate(-50%, -50%) scale(1.8);
    opacity: 1;
    border-color: #f5d44a;
  }

  70% {
    border-color: #4caf50;
  }

  100% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0.8;
    border-color: #4caf50;
  }
}

/* ── MAGNIFIER LOUPE ─────────────────────────────────── */
.loupe {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 3px solid #f5d44a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  display: none;
  z-index: 50;
  background-repeat: no-repeat;
  cursor: none;
}

/* centre crosshair */
.loupe::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 213, 74, 0.7);
}

@keyframes pop-in {
  0% {
    transform: translate(-50%, -50%) scale(0);
  }

  70% {
    transform: translate(-50%, -50%) scale(1.25);
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ── HINT SPOTLIGHT ──────────────────────────────────── */
.hint-spot {
  position: absolute;
  border: 4px solid #2196f3;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 0 24px rgba(33, 150, 243, 0.7);
  animation: hint-pulse 1.5s ease-in-out 3 forwards;
}

@keyframes hint-pulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.6;
  }
}

/* ── TOAST ───────────────────────────────────────────── */
.toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  padding: 8px 24px;
  border-radius: 30px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.hit {
  background: #1a1a1a;
  color: #f5d44a;
  border: 2px solid #f5d44a;
}

.toast.miss {
  background: #c0392b;
  color: white;
}

.toast.hint {
  background: #2196f3;
  color: white;
}

/* ── WIN OVERLAY ─────────────────────────────────────── */
.win-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 8, 2, 0.88);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.win-overlay.show {
  display: flex;
}

.win-box {
  background: var(--header);
  border: 4px solid var(--accent);
  border-radius: 20px;
  padding: 44px 52px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 0 60px rgba(225, 178, 15, 0.25);
}

.win-stars {
  font-size: 2.4rem;
  letter-spacing: 4px;
  margin-bottom: 12px;
}

.win-title {
  font-family: 'Lilita One', cursive;
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.win-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-bottom: 26px;
}

.win-btn {
  background: var(--accent);
  color: #3a1a00;
  /* ← fixed from broken "var#3a1a00" */
  border: none;
  padding: 11px 34px;
  border-radius: 30px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 1px;
  transition: background 0.15s, transform 0.1s;
}

.win-btn:hover {
  background: var(--accent-light);
  transform: scale(1.04);
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 640px) {
  .main {
    flex-direction: column;
  }

  .scene-wrap {
    height: 45vh;
    flex: none;
  }

  .sidebar {
    width: 100%;
    min-width: unset;
    border-left: none;
    border-top: 3px solid var(--accent-dark);
    max-height: 320px;
  }

  .char-grid {
    grid-template-columns: repeat(2, 110px);
  }

  .header-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }
}