/* ==========================================================================
   Activity Arcade — game surfaces
   One shell, five mechanics. Each activity sets --skill so its chrome carries
   the lab's domain colour.
   ========================================================================== */

.game-host {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 0 40px;
}

.game-frame {
  --skill: var(--reading);
  --skill-soft: #eceef8;
  position: relative;
  padding-bottom: 40px;
}
.game-frame[data-skill="Listening"] {
  --skill: #075568;
  --skill-soft: #e2f3f0;
}
.game-frame[data-skill="Reading"] {
  --skill: #2e4a94;
  --skill-soft: #eceef8;
}
.game-frame[data-skill="Speaking"] {
  --skill: #8a3a5c;
  --skill-soft: #f8ebf0;
}
.game-frame[data-skill="Writing"] {
  --skill: #9a4a26;
  --skill-soft: #fbefe3;
}

/* ----------------------------------------------------------------- game top */

.game-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0 16px;
}
.game-top .icon-btn {
  flex: 0 0 auto;
}

.game-id {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--skill-soft);
  color: var(--skill);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.skill-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.game-name {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-tools {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* ---------------------------------------------------------------------- hud */

.hud {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.hud-stat {
  display: grid;
  gap: 0;
  line-height: 1.1;
}
.hud-key {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
  color: var(--ink-3);
}
.hud-val {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.hud-val.is-bumped {
  animation: bump 0.34s var(--ease);
}
@keyframes bump {
  40% {
    transform: scale(1.16);
    color: var(--teal);
  }
}

.hud-combo {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.hud-combo .hud-val {
  color: var(--ink-3);
  transition: color 0.2s;
}
.hud-combo.is-hot .hud-val {
  color: var(--coral);
}
.hud-combo.is-hot {
  animation: combo-pulse 0.5s var(--ease);
}
@keyframes combo-pulse {
  35% {
    transform: translateY(-2px);
  }
}

.hud-progress {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  max-width: 320px;
}
.hud-bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: #eae5db;
  overflow: hidden;
}
.hud-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--skill), #2f9c8d);
  transition: width 0.5s var(--ease);
}
.hud-round {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------- stage */

.stage {
  position: relative;
  min-height: 320px;
  outline: none;
  padding-bottom: 140px;
}
.stage.is-entering > * {
  animation: stage-in 0.42s var(--ease);
}
@keyframes stage-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.prompt {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2px;
}
.prompt-kicker {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
  color: var(--skill);
}
.prompt-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.2vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--navy);
  margin: 6px 0 6px;
  outline: none;
}
.prompt-sub {
  font-size: 0.95rem;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 auto;
  line-height: 1.5;
}

.glyph {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 5px;
  flex: 0 0 auto;
}

.btn-listen {
  --btn-bg: var(--skill-soft);
  --btn-ink: var(--skill);
  border-color: transparent;
  box-shadow: none;
  flex: 0 0 auto;
}
.btn-listen:hover {
  background: var(--skill-soft);
  filter: brightness(0.97);
}

/* ------------------------------------------------------------- feedback sheet */

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  padding: 0 16px 16px;
  pointer-events: none;
}
.sheet[data-tone="good"] {
  --tone: #0f766e;
  --tone-soft: #e6f4f1;
}
.sheet[data-tone="partial"] {
  --tone: #a16207;
  --tone-soft: #fdf4e3;
}
.sheet[data-tone="bad"] {
  --tone: #b42318;
  --tone-soft: #fdeceb;
}

.fb {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-top: 4px solid var(--tone);
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(24, 34, 48, 0.12), var(--shadow-md);
  animation: sheet-up 0.42s var(--ease);
  backdrop-filter: blur(10px);
}
@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
}

.fb-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--tone-soft);
  color: var(--tone);
  font-size: 1.4rem;
  font-weight: 700;
}
.fb-eyebrow {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--tone);
}
.fb-title {
  font-family: var(--display);
  font-size: 1.2rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--navy);
  margin: 2px 0 0;
}
.fb-body {
  font-size: 0.92rem;
  color: var(--ink-2);
  margin-top: 2px;
}
.fb-body b {
  color: var(--navy);
}
.fb-why {
  margin-top: 8px;
  padding: 8px 11px;
  border-radius: 9px;
  background: #f7f5ef;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--ink-2);
}
.fb-why strong {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.fb-why b {
  color: var(--navy);
}
.fb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-points {
  position: absolute;
  top: -13px;
  right: 20px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--tone);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 10px -4px rgba(24, 34, 48, 0.4);
}
.fb-points.is-popping {
  animation: points-pop 0.5s var(--ease);
}
@keyframes points-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.12);
  }
}

/* ------------------------------------------------------------------ results */

.results {
  max-width: 660px;
  margin: 10px auto 0;
  text-align: center;
  padding: 8px 0 40px;
}
.res-kicker {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--teal);
}
.res-title {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--navy);
  margin-top: 6px;
}
.res-band {
  font-size: 0.84rem;
  color: var(--ink-3);
  margin-top: 4px;
}

.res-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 6px;
  font-size: 2.6rem;
  line-height: 1;
}
.res-star {
  color: #ddd5c6;
  transform: scale(0.9);
}
.res-star.is-on {
  color: var(--gold);
  animation: star-pop 0.5s var(--ease) backwards;
  animation-delay: calc(var(--i) * 120ms);
  text-shadow: 0 3px 10px rgba(180, 83, 9, 0.28);
}
@keyframes star-pop {
  from {
    transform: scale(0.2) rotate(-24deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.2) rotate(4deg);
  }
}

.res-score {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 4px 0 18px;
  position: relative;
}
.res-score strong {
  font-family: var(--display);
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  line-height: 1;
  font-weight: 600;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.res-score span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-3);
  margin-top: 4px;
}
.res-best {
  font-style: normal;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5c3a10;
  background: #f2e4c9;
  padding: 2px 8px;
  border-radius: 99px;
  margin-top: 6px;
}

.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--subtle);
  border-radius: 14px;
  padding: 14px 8px;
  margin-bottom: 22px;
}
.res-stat {
  display: grid;
  gap: 2px;
}
.res-stat + .res-stat {
  border-left: 1px solid var(--line-2);
}
.res-stat span {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--ink-3);
}
.res-stat strong {
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.res-level {
  text-align: left;
  margin-bottom: 20px;
}
.res-level-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.res-level-bar {
  height: 9px;
  border-radius: 99px;
  background: #eee9e0;
  overflow: hidden;
}
.res-level-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #2f9c8d);
  width: 0;
  transition: width 1s 0.3s var(--ease);
}
.res-levelup {
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--teal);
}

.res-review {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: #fcfbf8;
  margin-bottom: 22px;
}
.res-review h3 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.res-review ul {
  display: grid;
  gap: 5px;
}
.res-review li {
  position: relative;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.res-review li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--coral);
  font-weight: 700;
}
.res-clean {
  font-size: 0.88rem;
  color: var(--ink-2);
}

.res-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.res-band-hint {
  margin-top: 14px;
}
.res-band-hint .link-btn {
  font-size: 0.78rem;
  color: var(--ink-3);
}

/* ------------------------------------------------------------ grammar jungle */

.jungle {
  max-width: 760px;
  margin: 0 auto;
}

.jungle-sentence {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 4px 6px;
  margin-top: 22px;
  padding: 30px 22px;
  border-radius: 20px;
  border: 1px solid #dbe7da;
  background:
    radial-gradient(220px 120px at 4% 0%, rgba(90, 148, 129, 0.18), transparent 70%),
    radial-gradient(220px 120px at 100% 100%, rgba(194, 86, 47, 0.12), transparent 70%),
    linear-gradient(180deg, #f6faf5, #ffffff);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.jungle-sentence::before,
.jungle-sentence::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50% 50% 50% 0;
  background: rgba(90, 148, 129, 0.12);
  transform: rotate(18deg);
}
.jungle-sentence::before {
  left: -34px;
  top: -42px;
}
.jungle-sentence::after {
  right: -30px;
  bottom: -48px;
  background: rgba(194, 86, 47, 0.1);
  transform: rotate(-140deg);
}

.sword {
  position: relative;
  z-index: 1;
  border: 1px solid transparent;
  border-bottom: 2px dashed #b9cdb6;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px 8px 4px 4px;
  padding: 3px 8px 5px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s, border-color 0.16s,
    transform 0.16s;
}
.sword:hover:not(:disabled) {
  background: #fff;
  border-color: var(--teal);
  transform: translateY(-1px);
}
.sword:disabled {
  cursor: default;
}
.sword.is-broken {
  background: #fdeceb;
  color: #b42318;
  border-bottom-color: #b42318;
  box-shadow: inset 0 -2px 0 rgba(180, 35, 24, 0.15);
}
.sword.is-wrong {
  animation: shake 0.4s var(--ease);
  background: #f6f2ea;
  color: var(--ink-3);
}
.sword.is-hint {
  background: #fffbeb;
  border-color: #d97706;
  border-style: dashed;
}

.fix-panel {
  margin-top: 18px;
  text-align: center;
  animation: rise 0.34s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.fix-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.option-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.option-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 18px 0 8px;
  border-radius: 12px;
  border: 2px solid var(--line-2);
  background: #fff;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
  box-shadow: var(--shadow-sm);
}
.option-chip:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateY(-2px);
}
.option-chip .key {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--subtle);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-3);
}
.option-chip.is-correct {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.option-chip.is-correct .key {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.option-chip.is-wrong {
  background: #fdeceb;
  border-color: #b42318;
  color: #b42318;
  animation: shake 0.4s var(--ease);
}

.helper-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}
.helper-note {
  font-size: 0.8rem;
  color: var(--coral);
  font-weight: 700;
}

/* ------------------------------------------------------------- vocab quest */

.quest {
  max-width: 780px;
  margin: 0 auto;
}

.quest-trail {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}
.q-node {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  background: #fff;
  display: grid;
  place-items: center;
  transition: all 0.3s var(--ease);
}
.q-node i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}
.q-node.is-done {
  border-color: var(--teal);
  background: var(--teal);
}
.q-node.is-done i {
  background: #fff;
}
.q-node.is-now {
  border-color: var(--teal);
  box-shadow: 0 0 0 5px rgba(15, 118, 110, 0.14);
  transform: scale(1.08);
}
.q-node.is-now i {
  background: var(--teal);
}
.q-link {
  width: 30px;
  height: 2px;
  background: var(--line);
}

.quest-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.quest-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--skill), #e2b14a);
}
.quest-top {
  text-align: center;
  border-bottom: 1px dashed var(--line-2);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.quest-word {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--navy);
  margin: 6px 0 2px;
  outline: none;
}
.quest-pos {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--ink-3);
}

.quest-prompt {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.quest-sentence {
  font-family: var(--display);
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--subtle);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.quest-sentence span {
  color: var(--skill);
  letter-spacing: 0.05em;
  font-weight: 600;
}

.quest-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quest-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  padding: 14px 14px;
  border-radius: 13px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  font-size: 0.93rem;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.quest-option:hover:not(:disabled) {
  border-color: var(--skill);
  background: var(--skill-soft);
  transform: translateY(-1px);
}
.quest-option .key {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--subtle);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-3);
}
.quest-option.is-correct {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.quest-option.is-correct .key {
  background: var(--teal);
  color: #fff;
}
.quest-option.is-wrong {
  border-color: #b42318;
  background: #fdeceb;
  animation: shake 0.4s var(--ease);
}

.gloss-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.gloss {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--kit-ink, #6b3f2a);
  background: #fbf3ec;
  border-left: 3px solid var(--coral);
  border-radius: 0 8px 8px 0;
  padding: 8px 12px;
  animation: rise 0.3s var(--ease);
}

/* ----------------------------------------------------------- story detective */

.case {
  max-width: 940px;
  margin: 0 auto;
}
.case-head {
  margin-bottom: 20px;
}
.case-stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--skill);
  background: var(--skill-soft);
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid rgba(46, 74, 148, 0.18);
}
.case-question {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  color: var(--navy);
  margin: 10px 0 4px;
  outline: none;
}
.case-task {
  font-size: 0.93rem;
  color: var(--ink-2);
}

.case-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(230px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.passage {
  background:
    repeating-linear-gradient(180deg, #ffffff 0 31px, #eef1f7 31px 32px),
    #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-sm);
}
.passage-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--ink-3);
  background: #fff;
  display: inline-block;
  padding-right: 8px;
  margin-bottom: 6px;
}

.passage-line,
.clue {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: start;
  gap: 8px;
  width: 100%;
  font-size: 0.98rem;
  line-height: 32px;
  color: var(--ink);
  text-align: left;
}
.passage-line {
  grid-template-columns: 22px 1fr;
}

.line-no {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: #97a1b0;
  line-height: 32px;
}

.clue {
  border: 0;
  background: transparent;
  padding: 0 4px;
  margin: 0 -4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s var(--ease), box-shadow 0.16s;
}
.clue:hover:not(:disabled) {
  background: rgba(46, 74, 148, 0.07);
}
.clue:disabled {
  cursor: default;
}
.pin-mark {
  opacity: 0;
  color: var(--skill);
  font-size: 1rem;
  transition: opacity 0.16s;
}
.clue:hover .pin-mark {
  opacity: 0.5;
}
.clue.is-picked {
  background: #edf1fb;
  box-shadow: inset 0 0 0 2px #2e4a94;
}
.clue.is-picked .pin-mark {
  opacity: 1;
}
.clue.is-proof {
  background: #e8f5f0;
  box-shadow: inset 0 0 0 2px var(--teal);
}
.clue.is-proof .pin-mark {
  opacity: 1;
  color: var(--teal);
}
.clue.is-miss {
  background: #fdeceb;
  box-shadow: inset 0 0 0 2px #f0a9a3;
  text-decoration: line-through;
  text-decoration-color: #d98b85;
}
.clue.is-missing {
  background: #fffbeb;
  box-shadow: inset 0 0 0 2px #e0b45a;
}
.clue-flag {
  font-family: var(--font);
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 99px;
  padding: 1px 7px;
  align-self: center;
}
.passage-line.is-clue {
  font-weight: 700;
}

.board {
  position: sticky;
  top: 16px;
  background: #fbfaf6;
  border: 1.5px dashed #c9d2e4;
  border-radius: 18px;
  padding: 16px;
}
.board h3 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.board h3 span {
  font-family: var(--mono);
  letter-spacing: 0;
  color: var(--skill);
}
.pins {
  display: grid;
  gap: 8px;
  min-height: 60px;
}
.pins-empty {
  font-size: 0.8rem;
  color: #97a1b0;
  font-style: italic;
}
.pin {
  position: relative;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 6px;
  background: #fffdf5;
  border-left: 3px solid var(--skill);
  border-radius: 2px 8px 8px 2px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--ink-2);
  box-shadow: 0 2px 6px rgba(24, 34, 48, 0.08);
  transform: rotate(-0.5deg);
  animation: rise 0.3s var(--ease);
}
.pin:nth-child(even) {
  transform: rotate(0.6deg);
}
.pin span {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--skill);
}
.board .btn {
  width: 100%;
  margin-top: 12px;
  min-height: 40px;
  font-size: 0.84rem;
}
.board-note {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--ink-3);
  line-height: 1.35;
}
.board-static {
  border-style: solid;
  border-color: #d5dce6;
}

.verdict-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin: 20px 0 10px;
}
.verdicts {
  display: grid;
  gap: 9px;
}
.verdict {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
}
.verdict:hover:not(:disabled) {
  border-color: var(--skill);
  background: var(--skill-soft);
  transform: translateX(2px);
}
.verdict .key {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--subtle);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-3);
}
.verdict.is-correct {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.verdict.is-correct .key {
  background: var(--teal);
  color: #fff;
}
.verdict.is-wrong {
  border-color: #b42318;
  background: #fdeceb;
  animation: shake 0.4s var(--ease);
}

/* ------------------------------------------------------------ sound studio */

.studio {
  max-width: 780px;
  margin: 0 auto;
}
.studio-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.studio-head .prompt-title {
  text-align: left;
  margin-bottom: 0;
}
.studio-head .prompt-kicker {
  text-align: left;
}

.mixer {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 18px;
}
.track {
  flex: 1;
  max-width: 170px;
  min-width: 62px;
  min-height: 116px;
  border-radius: 14px;
  border: 2px dashed #c7d3dc;
  background: #f6f8fa;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}
.track-empty {
  font-family: var(--display);
  font-size: 1.3rem;
  color: #b6c2cc;
}
.track.is-filled {
  border-style: solid;
  border-color: var(--teal);
  background: linear-gradient(180deg, #ffffff, #f0f8f6);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.track-syl {
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  font-weight: 600;
  color: var(--navy);
  padding: 10px;
  text-align: center;
  word-break: break-word;
}
.track-wave {
  position: absolute;
  inset: auto 0 0;
  height: 22px;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(15, 118, 110, 0.35) 0 2px,
    transparent 2px 6px
  );
  -webkit-mask: linear-gradient(180deg, transparent, #000);
  mask: linear-gradient(180deg, transparent, #000);
  animation: wave 1.6s linear infinite;
}
@keyframes wave {
  to {
    background-position: 12px 0;
  }
}

.bank {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
}
.syl-chip {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  background: #fff;
  border: 2px solid var(--line-2);
  border-radius: 11px;
  padding: 9px 18px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), border-color 0.16s, opacity 0.16s;
}
.syl-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--teal);
}
.syl-chip.is-used {
  opacity: 0.22;
  pointer-events: none;
  transform: scale(0.96);
}

.studio-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}
.studio-tools .btn {
  margin-left: auto;
}
.studio-tools .link-btn {
  font-size: 0.8rem;
}

.stress {
  margin-top: 24px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #cfe4e0;
  background: linear-gradient(180deg, #f1f9f7, #fff);
  text-align: center;
  animation: rise 0.35s var(--ease);
}
.stress-q {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 12px;
}
.stress-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.stress-btn {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 11px;
  border: 2px solid var(--line-2);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
  transition: transform 0.16s var(--ease), border-color 0.16s, background 0.16s;
}
.stress-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--teal);
}
.stress-btn.is-correct {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.stress-btn.is-wrong {
  background: #fdeceb;
  border-color: #b42318;
  color: #b42318;
  animation: shake 0.4s var(--ease);
}

.studio-note {
  margin-top: 14px;
  min-height: 22px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* -------------------------------------------------------------- echo canyon */

.echo {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  text-align: center;
  overflow-x: clip;
}
.echo-rings {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 420px;
  height: 220px;
  pointer-events: none;
  z-index: -1;
}
.echo-rings i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(138, 58, 92, 0.16);
  animation: ring-pulse 5s ease-out infinite;
}
.echo-rings i:nth-child(2) {
  animation-delay: 1.6s;
}
.echo-rings i:nth-child(3) {
  animation-delay: 3.2s;
}
@keyframes ring-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

.echo-head {
  margin-bottom: 20px;
}
.echo-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.45;
  color: var(--navy);
  outline: none;
}
.echo-line span {
  white-space: nowrap;
}
.chunk-div {
  font-style: normal;
  font-family: var(--font);
  font-size: 1rem;
  color: var(--speaking);
  opacity: 0.55;
  transform: translateY(-2px);
}

.echo-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.echo-live {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  animation: rise 0.3s var(--ease);
}
.echo-meter {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 56px;
  overflow: hidden;
}
.echo-meter i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #dba3b9, var(--speaking));
  transition: height 0.08s linear;
}
.echo-timer {
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--speaking);
  font-variant-numeric: tabular-nums;
  min-width: 58px;
}
.btn-stop {
  --btn-bg: #b42318;
  min-height: 40px;
  animation: rec-pulse 1.6s ease-in-out infinite;
}
@keyframes rec-pulse {
  50% {
    box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.16);
  }
}

.echo-review {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  animation: rise 0.34s var(--ease);
}
.echo-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: var(--skill-soft);
  border-radius: 12px;
  padding: 14px;
}
.echo-time {
  display: grid;
  gap: 2px;
  text-align: center;
}
.echo-time span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--ink-3);
}
.echo-time strong {
  font-family: var(--display);
  font-size: 1.7rem;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.echo-vs {
  color: var(--ink-3);
  font-size: 1.2rem;
}
.echo-playback {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}
.echo-playback span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--ink-3);
}
.echo-playback audio {
  width: 100%;
  height: 38px;
}
.echo-rhythm {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin: 16px 0 8px;
  text-align: center;
}
.echo-rate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.rate-btn {
  display: grid;
  gap: 2px;
  place-items: center;
  padding: 12px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.16s;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-2);
}
.rate-btn b {
  font-size: 1.15rem;
  color: var(--skill);
}
.rate-btn:hover:not(:disabled) {
  border-color: var(--skill);
  background: var(--skill-soft);
  transform: translateY(-2px);
}
.echo-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--ink-3);
  min-height: 20px;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 860px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
  .board {
    position: static;
  }
  .pin {
    transform: none;
  }
}

@media (max-width: 720px) {
  .game-host {
    padding-top: 4px;
  }
  .game-name {
    font-size: 1.35rem;
  }
  .hud {
    gap: 12px;
    padding: 8px 12px;
  }
  .hud-progress {
    max-width: none;
  }
  .hud-round {
    display: none;
  }
  .stage {
    padding-bottom: 190px;
  }
  .sheet {
    padding: 0 10px 10px;
  }
  .fb {
    grid-template-columns: 40px 1fr;
    gap: 10px 12px;
    padding: 14px;
  }
  .fb-mark {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
  .fb-actions {
    grid-column: 1 / -1;
  }
  .fb-actions .btn {
    flex: 1;
  }
  .fb-title {
    font-size: 1.05rem;
  }
  .fb-why {
    font-size: 0.8rem;
  }
  .quest-card {
    padding: 22px 18px;
  }
  .quest-options {
    grid-template-columns: 1fr;
  }
  .passage {
    padding: 14px 12px 16px;
  }
  .echo-line {
    padding: 22px 16px;
    gap: 4px 8px;
  }
  .echo-live {
    grid-template-columns: 1fr auto;
  }
  .echo-meter {
    grid-column: 1 / -1;
    order: -1;
    height: 44px;
  }
  .res-actions .btn {
    flex: 1 1 100%;
  }
  .res-stars {
    font-size: 2.2rem;
  }
  .mixer {
    gap: 7px;
  }
  .track {
    min-height: 96px;
    min-width: 54px;
  }
  .syl-chip {
    padding: 8px 14px;
  }
  .studio-tools {
    flex-wrap: wrap;
  }
  .studio-tools .btn {
    flex: 1 1 100%;
    order: 3;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .echo-rings i,
  .track-wave,
  .btn-stop {
    animation: none;
  }
}
