/* ==========================================================================
   Spy the AI — styles
   Conference palette: navy / teal / coral / gold
   ========================================================================== */
:root {
  --navy:    #14365c;
  --navy-2:  #1a4170;
  --navy-3:  #0f2b4a;
  --teal:    #5cc9be;
  --teal-d:  #04342c;
  --coral:   #f0997b;
  --coral-d: #4a1b0c;
  --gold:    #ffd166;
  --ink:     #ffffff;
  --soft:    #cfe3f2;
  --muted:   #9ec9e8;
  --good:    #4cd28a;
  --bad:     #ff6b6b;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--navy);
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
}

/* ---- shared bits -------------------------------------------------------- */
.topwrap { padding-bottom: 6px; }
.topbar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; font-weight: bold; color: var(--teal);
  letter-spacing: .3px;
}
.topsub { text-align: center; font-size: 11px; color: #6f9bc0; margin-top: 1px; }
.footbar {
  margin-top: auto;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: #6f9bc0; padding-top: 14px; text-align: center;
}
.screen { flex: 1; display: flex; flex-direction: column; }
.center { justify-content: center; align-items: center; text-align: center; }
.hidden { display: none !important; }

.cat-img {
  width: 120px; height: 120px; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}
.cat-ring {
  width: 132px; height: 132px; border-radius: 50%;
  background: var(--navy-2); border: 4px solid var(--coral);
  display: flex; align-items: center; justify-content: center; margin: 4px auto;
  position: relative;
}

h1.title { font-size: 40px; margin: 8px 0 2px; color: var(--ink); letter-spacing: .5px; }
.tagline  { font-size: 16px; color: var(--coral); margin: 0 0 10px; font-weight: bold; }
.lead     { font-size: 15px; color: var(--soft); line-height: 1.55; max-width: 340px; margin: 0 auto 18px; }

button {
  font-family: inherit; cursor: pointer; border: none; border-radius: 12px;
  font-size: 16px; font-weight: bold; padding: 13px 18px; width: 100%;
  transition: transform .06s ease, filter .15s ease;
}
button:active { transform: scale(.97); }
.btn-primary   { background: var(--coral); color: var(--coral-d); }
.btn-teal      { background: var(--teal);  color: var(--teal-d); }
.btn-ghost     { background: var(--navy-2); color: var(--soft); border: 1px solid #2c557e; }
.btn-row { display: flex; gap: 10px; }
.btn-row button { width: 100%; }
.linkish { background: none; color: var(--muted); font-weight: normal; font-size: 13px; text-decoration: underline; padding: 8px; }

/* ---- level select ------------------------------------------------------- */
.level-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--navy-2); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 12px; border: 2px solid transparent; text-align: left; width: 100%;
}
.level-card:active { transform: scale(.98); }
.level-card .badge-ring {
  width: 56px; height: 56px; min-width: 56px; border-radius: 50%;
  background: var(--navy-3); display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--teal); overflow: hidden;
}
.level-card.kitten .badge-ring { border-color: var(--teal); }
.level-card.cat .badge-ring    { border-color: var(--coral); }
.level-card.lion .badge-ring   { border-color: var(--gold); }
.level-card .badge-ring img { width: 46px; height: 46px; object-fit: contain; }
.level-card h3 { margin: 0; font-size: 17px; color: var(--ink); }
.level-card p  { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

/* ---- gameplay HUD ------------------------------------------------------- */
.hud {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; color: var(--soft); margin-bottom: 8px;
}
.hud .score { color: var(--gold); font-weight: bold; }
.hud .lives i { font-size: 18px; }
.progress-track { height: 6px; background: var(--navy-3); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.progress-fill  { height: 100%; background: var(--teal); width: 0%; transition: width .3s ease; }

.clue {
  background: var(--teal); color: var(--teal-d);
  border-radius: 12px; padding: 14px 16px; font-size: 16px; line-height: 1.4;
  margin-bottom: 12px; min-height: 64px; display: flex; align-items: center;
}
.clue b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }

/* Spy mode arena */
.spyhint { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.arena {
  position: relative; height: clamp(320px, 56vh, 480px);
  background: var(--navy-3); border-radius: 14px; overflow: hidden;
}
/* each answer rides down as a little mouse — tap the one that matches */
.fall {
  position: absolute; top: 0; left: 0; width: auto;
  background: var(--coral); color: var(--coral-d);
  font-size: 18px; font-weight: bold; padding: 13px 22px; border-radius: 22px;
  white-space: nowrap; cursor: pointer; border: none;
  box-shadow: 0 5px 14px rgba(0,0,0,.35); will-change: transform;
}
.fall .mword { position: relative; z-index: 1; }
/* two round ears on top (the mouse's head end) */
.fall::before, .fall::after {
  content: ""; position: absolute; top: -11px; width: 19px; height: 19px;
  border-radius: 50%; background: inherit;
}
.fall::before { left: 16px; }
.fall::after  { left: 40px; }
/* curly tail on the trailing side */
.fall .tail {
  position: absolute; right: -13px; top: 50%; width: 15px; height: 15px;
  border: 3px solid currentColor; border-top-color: transparent; border-left-color: transparent;
  border-radius: 50%; transform: translateY(-50%) rotate(40deg);
}
.fall.hit  { background: var(--good); color: #04321f; }
.fall.miss { background: var(--bad);  color: #3a0000; }

/* start-screen settings */
.settings { width: 100%; margin-top: 6px; }
.seg-label { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 6px; }
.seg { display: flex; gap: 6px; }
.seg button {
  background: var(--navy-2); color: var(--soft); border: 1px solid #2c557e;
  font-size: 14px; padding: 9px 0; border-radius: 10px; font-weight: bold;
}
.seg button.on { background: var(--teal); color: var(--teal-d); border-color: var(--teal); }
.moderow { display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 16px; font-size: 13px; color: var(--muted); }

/* word list */
.gloss-group h3 { color: var(--teal); font-size: 13px; text-transform: uppercase;
  letter-spacing: .5px; margin: 18px 0 8px; }
.gloss-item { background: var(--navy-2); border: 1px solid #2c557e; border-radius: 10px;
  padding: 10px 13px; margin-bottom: 8px; }
.gloss-item .t { color: var(--ink); font-weight: bold; font-size: 15px; }
.gloss-item .d { color: var(--soft); font-size: 13px; margin-top: 2px; line-height: 1.45; }

/* Classic mode */
.choices { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.choice {
  background: var(--navy-2); color: var(--ink); border: 2px solid #2c557e;
  text-align: left; font-size: 16px;
}
.choice.correct { background: var(--good); color: #04321f; border-color: var(--good); }
.choice.wrong   { background: var(--bad);  color: #3a0000; border-color: var(--bad); }
.choice:disabled { opacity: 1; cursor: default; }

.flash {
  text-align: center; font-size: 15px; font-weight: bold; min-height: 22px;
  margin-top: 10px; color: var(--gold);
}

/* ---- results ------------------------------------------------------------ */
.result-ring {
  width: 150px; height: 150px; border-radius: 50%;
  background: var(--navy-2); border: 5px solid var(--gold);
  display: flex; align-items: center; justify-content: center; margin: 6px auto 10px;
}
.result-ring img { width: 124px; height: 124px; object-fit: contain; }
.rank-name { font-size: 30px; margin: 6px 0 2px; }
.rank-stats { font-size: 19px; color: var(--teal); margin: 6px 0 14px; font-weight: bold; }
.stars { color: var(--gold); font-size: 26px; letter-spacing: 4px; margin-bottom: 6px; }
.encourage { font-size: 17px; color: var(--soft); max-width: 360px; margin: 0 auto 20px; line-height: 1.6; }

.badge-cap { font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 8px; }

/* QR to the blog at the bottom of the results screen */
.end-qr { margin: 20px 0 4px; }
.end-qr img { width: 150px; height: 150px; background: #fff; border-radius: 12px;
  padding: 8px; display: block; margin: 0 auto; }
.end-qr-url { font-size: 14px; color: var(--coral); font-weight: bold; margin-top: 8px; }

/* ---- resources mini-list (used on results) ------------------------------ */
.mini-res { background: var(--navy-2); border: 1px solid #2c557e; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px; text-align: left; }
.mini-res a { color: var(--teal); font-weight: bold; text-decoration: none; }
.mini-res p { margin: 0; font-size: 12px; color: var(--soft); line-height: 1.5; }

@media (max-width: 380px) {
  h1.title { font-size: 34px; }
  .cat-img { width: 104px; height: 104px; }
}
