/*
 * WaterQuest — papercut water theme.
 * One visual language for every screen: warm cream sky, layered paper hills,
 * white cards with a dark navy outline and a hard offset shadow.
 */

:root {
  /* Papercut palette, matched to the NotebookLM video style */
  --ink: #1B2A4A;
  --ink-soft: #4A5C7A;
  --cream: #FDF3C7;
  --cream-2: #F7DFA0;
  --paper: #FFFFFF;
  --paper-2: #FFFDF5;
  --sky: #9BDCF7;
  --water: #2E7FB8;
  --water-2: #5FB4E0;
  --leaf: #8CBB6E;
  --leaf-2: #5E9E4F;
  --sun: #FFC94D;
  --sun-2: #FFB020;
  --correct: #43A047;
  --wrong: #E53935;
  --radius: 24px;
  --outline: 4px solid var(--ink);
  --hard-shadow: 0 12px 0 rgba(27, 42, 74, 0.16), 0 24px 44px rgba(60, 90, 130, 0.24);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Fredoka One', 'Baloo 2', 'Trebuchet MS', sans-serif;
  background: linear-gradient(180deg, #FDF3C7 0%, #FBE9A8 38%, #F7DFA0 62%, #F3D98F 100%);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============ SHARED PAPERCUT BACKGROUND ============ */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-sun {
  position: absolute;
  top: 5%;
  right: 8%;
  width: clamp(70px, 12vh, 128px);
  height: clamp(70px, 12vh, 128px);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #FFE082 0%, var(--sun) 55%, var(--sun-2) 100%);
  box-shadow: 0 0 0 14px rgba(255, 214, 102, 0.32), 0 0 0 30px rgba(255, 214, 102, 0.16), 0 14px 34px rgba(200, 140, 20, 0.26);
  animation: sun-breathe 5s ease-in-out infinite;
}
@keyframes sun-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Layered papercut clouds */
.bg-cloud {
  position: absolute;
  background: #FFFFFF;
  border-radius: 100px;
  box-shadow: 0 10px 0 rgba(150, 190, 225, 0.32), 0 18px 30px rgba(120, 160, 200, 0.2);
}
.bg-cloud::before,
.bg-cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.bg-cloud::before { width: 62%; height: 150%; left: 8%; bottom: 22%; }
.bg-cloud::after { width: 46%; height: 118%; right: 10%; bottom: 26%; }
.bg-cloud.c1 { width: clamp(110px, 19vh, 200px); height: clamp(32px, 5.5vh, 58px); top: 8%; left: 5%; animation: cloud-drift 26s linear infinite; }
.bg-cloud.c2 { width: clamp(80px, 13.5vh, 144px); height: clamp(24px, 4.2vh, 44px); top: 19%; left: 29%; opacity: 0.9; animation: cloud-drift 34s linear infinite reverse; }
.bg-cloud.c3 { width: clamp(62px, 10.5vh, 112px); height: clamp(20px, 3.4vh, 36px); top: 4%; left: 45%; opacity: 0.78; animation: cloud-drift 30s linear infinite; }
.bg-cloud.c4 { width: clamp(92px, 16vh, 168px); height: clamp(28px, 4.8vh, 50px); top: 14%; right: 3%; opacity: 0.88; animation: cloud-drift 40s linear infinite reverse; }
@keyframes cloud-drift {
  0% { transform: translateX(0); }
  50% { transform: translateX(36px); }
  100% { transform: translateX(0); }
}

/* Papercut land: hills, river, trees, boat */
.bg-land {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(150px, 34vh, 420px);
  min-height: 0;
}
.bg-land svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============ RAIN (home screen) ============ */
.home-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.raindrop {
  position: absolute;
  top: -40px;
  width: 9px;
  height: 9px;
  background: linear-gradient(180deg, #8FD8F5, var(--water));
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  opacity: 0.85;
  animation-name: rain-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes rain-fall {
  0% { transform: translateY(-40px) scaleY(1); opacity: 0; }
  8% { opacity: 0.9; }
  88% { opacity: 0.9; }
  100% { transform: translateY(102vh) scaleY(1.5); opacity: 0; }
}

/* ============ APP / SCENES ============ */
#app {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Every scene is hidden until the engine shows it. */
.scene {
  display: none;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Shared paper card look */
.board, .modal-box, .quiz-wrap, .result-hero, .home-card {
  background: var(--paper);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--hard-shadow);
}

.board {
  padding: clamp(14px, 2.2vh, 24px) clamp(16px, 2.4vw, 28px);
  width: 100%;
  max-width: min(720px, 92vw);
  text-align: center;
}

h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: clamp(17px, 2.6vh, 26px);
}

h3 {
  margin: 0 0 12px;
  color: var(--ink);
}

.muted {
  color: var(--ink-soft);
  margin: 6px 0;
}
.small { font-size: 14px; }

/* ============ HOME (splash + home merged) ============ */
#scene-title {
  overflow: hidden;
  align-items: center;
  padding: 20px;
}
.home-screen {
  position: relative;
  z-index: 3;
  text-align: center;
  animation: home-in 0.7s ease-out;
}
@keyframes home-in {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}
.home-card {
  display: inline-block;
  padding: clamp(16px, 2.4vh, 40px) clamp(24px, 4vw, 80px) clamp(14px, 2.2vh, 34px);
  max-width: min(760px, 92vw);
}
.home-logo {
  font-size: clamp(44px, 8vh, 120px);
  line-height: 1;
  animation: bubble-pulse 2.2s ease-in-out infinite;
  filter: drop-shadow(0 8px 18px rgba(30, 136, 229, 0.4));
}
.home-title {
  font-size: clamp(34px, 7vh, 104px);
  margin: 2px 0 0;
  color: var(--ink);
  letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(150, 190, 225, 0.5);
}
.home-sub {
  font-size: clamp(12px, 1.9vh, 28px);
  color: var(--water);
  letter-spacing: clamp(2px, 0.5vw, 8px);
  text-transform: uppercase;
  margin: 2px 0 0;
  font-weight: 700;
}
.home-tagline {
  color: var(--ink-soft);
  font-size: clamp(12px, 1.6vh, 22px);
  margin: clamp(8px, 1.4vh, 20px) 0 clamp(14px, 2.4vh, 36px);
}
.home-hint {
  margin: clamp(8px, 1.2vh, 16px) 0 0;
  font-size: clamp(11px, 1.4vh, 18px);
  color: var(--ink-soft);
  animation: hint-blink 1.8s ease-in-out infinite;
}
@keyframes hint-blink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* Big arcade-style play button */
.btn-play {
  display: block;
  margin: 0 auto;
  min-width: min(280px, 70vw);
  padding: clamp(12px, 2vh, 30px) clamp(28px, 5vw, 80px);
  font-family: inherit;
  font-size: clamp(20px, 3.4vh, 46px);
  font-weight: 800;
  letter-spacing: clamp(2px, 0.4vw, 6px);
  color: var(--ink);
  background: linear-gradient(180deg, #FFE082 0%, var(--sun) 45%, var(--sun-2) 100%);
  border: var(--outline);
  border-radius: 60px;
  cursor: pointer;
  box-shadow: 0 8px 0 #C88A00, 0 14px 26px rgba(120, 80, 0, 0.28);
  transition: transform 0.08s, box-shadow 0.08s;
  animation: play-glow 2.4s ease-in-out infinite;
}
.btn-play:hover { transform: translateY(-2px); box-shadow: 0 10px 0 #C88A00, 0 18px 32px rgba(120, 80, 0, 0.32); }
.btn-play:active { transform: translateY(6px); box-shadow: 0 2px 0 #C88A00, 0 6px 14px rgba(120, 80, 0, 0.24); }
@keyframes play-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.1); }
}

.btn-link {
  display: block;
  margin: 14px auto 0;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
  padding: 6px 10px;
}
.btn-link:hover { color: var(--ink); }

/* School identity + credit */
.school-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(155, 220, 247, 0.35), rgba(95, 180, 224, 0.28));
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: clamp(5px, 1vh, 8px) clamp(12px, 2vw, 20px);
  margin-bottom: clamp(6px, 1.2vh, 10px);
}
.school-name {
  font-size: clamp(12px, 1.7vh, 24px);
  font-weight: 800;
  letter-spacing: .4px;
  color: var(--ink);
}
.school-sub {
  font-size: clamp(9px, 1.2vh, 16px);
  letter-spacing: clamp(1px, 0.3vw, 3px);
  text-transform: uppercase;
  color: var(--water);
  margin-top: 2px;
}
.credit {
  margin-top: clamp(10px, 1.8vh, 24px);
  font-size: clamp(11px, 1.4vh, 19px);
  color: var(--ink-soft);
}
.credit strong { color: var(--ink); }
.small-credit {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: .3px;
  opacity: .8;
}
@keyframes bubble-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost {
  border: 3px solid var(--ink);
  border-radius: 50px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary {
  background: var(--water);
  color: #fff;
  box-shadow: 0 5px 0 rgba(27, 42, 74, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 5px 0 rgba(27, 42, 74, 0.2);
}
.btn-secondary:hover { background: #EAF6FD; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--ink-soft);
}

/* Module list */
.mod-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.mod-btn {
  background: var(--paper-2);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: clamp(9px, 1.6vh, 14px) 16px;
  font-family: inherit;
  font-size: clamp(13px, 2vh, 19px);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 5px 0 rgba(27, 42, 74, 0.16);
}
.mod-btn:hover {
  background: #EAF6FD;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(27, 42, 74, 0.2);
}

/* ============ VIDEO ============ */
#scene-video {
  flex-direction: column;
  gap: clamp(8px, 1.4vh, 16px);
  padding: clamp(8px, 1.6vh, 18px);
}
.video-stage {
  position: relative;
  width: 100%;
  max-width: min(1500px, 96vw);
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(5px, 1vh, 10px);
  background: var(--paper);
  border: var(--outline);
  border-radius: var(--radius);
  box-shadow: var(--hard-shadow);
}
#player {
  width: 100%;
  height: 100%;
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  border-radius: 14px;
  background: #0B1A2B;
  display: block;
}

/* Countdown 3-2-1-GO overlay */
.countdown {
  position: absolute;
  inset: 10px;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(11, 26, 43, 0.86);
  border-radius: 14px;
  z-index: 5;
}
.countdown.show { display: flex; }
.countdown-note {
  font-size: clamp(15px, 3.4vh, 30px);
  font-weight: 800;
  color: #B3E5FC;
  letter-spacing: 1px;
  margin: 0 0 6px;
  text-align: center;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.7);
  animation: note-in 0.6s ease-out;
}
@keyframes note-in {
  0% { opacity: 0; transform: translateY(-14px); }
  100% { opacity: 1; transform: translateY(0); }
}
.countdown-num {
  font-size: clamp(80px, 24vh, 200px);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 50px rgba(77, 208, 225, 0.95), 0 10px 0 rgba(0, 60, 130, 0.65);
  animation: count-pop 0.9s ease-out;
}
.countdown-num.go {
  font-size: clamp(60px, 18vh, 150px);
  color: var(--sun);
  letter-spacing: 8px;
  text-shadow: 0 0 60px rgba(255, 213, 79, 1), 0 10px 0 rgba(200, 120, 0, 0.65);
}
@keyframes count-pop {
  0% { transform: scale(2.4); opacity: 0; }
  30% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.95; }
}

/* Lanjut ke kuis button under the video */
.btn-lanjut-kuis {
  flex: 0 0 auto;
  align-self: center;
  padding: clamp(9px, 1.6vh, 15px) clamp(22px, 3.6vw, 42px);
  font-family: inherit;
  font-size: clamp(13px, 2.2vh, 21px);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink);
  background: linear-gradient(180deg, #FFE082 0%, var(--sun) 50%, var(--sun-2) 100%);
  border: var(--outline);
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 6px 0 #C88A00, 0 10px 22px rgba(120, 80, 0, 0.26);
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-lanjut-kuis:hover { transform: translateY(-2px); }
.btn-lanjut-kuis:active { transform: translateY(4px); box-shadow: 0 2px 0 #C88A00; }
.btn-lanjut-kuis .key-hint {
  font-size: clamp(10px, 1.5vh, 14px);
  font-weight: 600;
  opacity: 0.7;
}

/* ============ QUIZ ============ */
#scene-game {
  padding: 20px;
}
.quiz-wrap {
  width: 100%;
  max-width: min(1500px, 94vw);
  padding: clamp(14px, 2.2vh, 40px) clamp(16px, 2.4vw, 48px) clamp(12px, 2vh, 34px);
  max-height: 96vh;
  max-height: 96dvh;
  overflow-y: auto;
}
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.q-no {
  font-size: clamp(14px, 1.9vh, 19px);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 1px;
}
.timer {
  font-size: clamp(17px, 2.5vh, 25px);
  font-weight: 900;
  color: #fff;
  background: var(--water);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: clamp(2px, 0.5vh, 4px) clamp(12px, 1.6vw, 18px);
  min-width: clamp(58px, 7vw, 82px);
  text-align: center;
  transition: background 0.2s, transform 0.2s;
}
.timer.warn {
  background: var(--wrong);
  animation: timer-pulse 0.9s ease-in-out infinite;
}
@keyframes timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}
.timer-track {
  height: 10px;
  background: #E7F1F8;
  border: 2px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  margin: 12px 0 20px;
}
.timer-fill {
  height: 100%;
  width: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--sky), var(--water));
  transition: width 1s linear, background 0.3s;
}
.timer-fill.warn { background: linear-gradient(90deg, #FF8A65, var(--wrong)); }

.q-text {
  font-size: clamp(15px, 2.5vh, 40px);
  line-height: 1.4;
  margin: 0 0 clamp(10px, 1.8vh, 32px);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

/* Joystick-style answer layout: up on top, down below, left/right on sides */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: clamp(8px, 1.4vh, 14px);
  margin-bottom: clamp(8px, 1.4vh, 16px);
  align-items: stretch;
}
/* A = up (top, spans middle column) */
.opt-btn[data-index="0"] { grid-column: 2; grid-row: 1; }
/* C = left */
.opt-btn[data-index="2"] { grid-column: 1; grid-row: 2; }
/* center hub */
.opt-center {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(24px, 4vh, 70px);
  background: radial-gradient(circle, rgba(155, 220, 247, 0.4), rgba(95, 180, 224, 0.16));
  border: 3px dashed rgba(27, 42, 74, 0.35);
  border-radius: 20px;
  min-height: clamp(56px, 9vh, 150px);
  animation: bubble-pulse 2.4s ease-in-out infinite;
}
/* D = right */
.opt-btn[data-index="3"] { grid-column: 3; grid-row: 2; }
/* B = down (bottom, spans middle column) */
.opt-btn[data-index="1"] { grid-column: 2; grid-row: 3; }

.opt-btn {
  position: relative;
  background: var(--paper-2);
  border: 3px solid var(--ink);
  border-radius: 18px;
  color: var(--ink);
  font-family: inherit;
  font-size: clamp(12px, 1.8vh, 28px);
  font-weight: 700;
  padding: clamp(8px, 1.4vh, 22px);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.8vh, 12px);
  min-height: clamp(56px, 9vh, 150px);
  transition: all 0.12s;
  box-shadow: 0 5px 0 rgba(27, 42, 74, 0.18);
}
.opt-btn:hover {
  background: #EAF6FD;
  transform: translateY(-2px);
  box-shadow: 0 7px 0 rgba(27, 42, 74, 0.22);
}
.opt-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(27, 42, 74, 0.2); }

/* Arrow badge: up / down / left / right */
.opt-arrow {
  width: clamp(26px, 4vh, 62px);
  height: clamp(26px, 4vh, 62px);
  border-radius: 12px;
  background: var(--water);
  border: 2px solid var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(14px, 2.2vh, 34px);
  line-height: 1;
  flex-shrink: 0;
}
.opt-btn.correct {
  background: #C8E6C9;
  border-color: var(--correct);
  box-shadow: 0 5px 0 rgba(67, 160, 71, 0.4);
  animation: correct-pop 0.4s;
}
.opt-btn.correct .opt-arrow { background: var(--correct); }
.opt-btn.wrong {
  background: #FFCDD2;
  border-color: var(--wrong);
  box-shadow: 0 5px 0 rgba(229, 57, 53, 0.4);
  animation: wrong-shake 0.4s;
}
.opt-btn.wrong .opt-arrow { background: var(--wrong); }
@keyframes correct-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.quiz-hint {
  text-align: center;
  color: var(--ink-soft);
  font-size: clamp(10px, 1.4vh, 14px);
  margin: 0;
}

/* ============ RESULT ============ */
#scene-result {
  padding: clamp(10px, 2vh, 20px);
}
.result-wrap {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: min(1000px, 92vw);
  text-align: center;
  animation: home-in 0.6s ease-out;
}
.result-hero {
  padding: clamp(14px, 2.2vh, 24px) clamp(16px, 2.4vw, 28px) clamp(12px, 2vh, 22px);
}
.result-icon {
  font-size: clamp(34px, 6vh, 60px);
  line-height: 1;
  animation: bubble-pulse 1.8s ease-in-out infinite;
}
.result-eyebrow {
  margin: 6px 0 0;
  font-size: clamp(9px, 1.3vh, 12px);
  letter-spacing: clamp(2px, 0.5vw, 4px);
  color: var(--water);
  font-weight: 700;
}
.result-score-big {
  font-size: clamp(48px, 11vh, 150px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  margin: 4px 0 0;
  text-shadow: 0 5px 0 rgba(150, 190, 225, 0.55);
}
.result-total {
  font-size: clamp(20px, 4.5vh, 62px);
  color: var(--ink-soft);
  font-weight: 700;
}
.result-bar {
  height: clamp(9px, 1.6vh, 14px);
  background: #E7F1F8;
  border: 2px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  margin: clamp(8px, 1.4vh, 14px) auto clamp(10px, 1.6vh, 16px);
  max-width: min(400px, 80%);
}
.result-bar-fill {
  height: 100%;
  width: 0;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--sky), var(--sun));
  transition: width 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.rank-label {
  font-size: clamp(18px, 3.6vh, 54px);
  font-weight: 900;
  color: var(--water);
  margin: 0;
  letter-spacing: 1px;
}
.rank-sub {
  color: var(--ink-soft);
  font-size: clamp(11px, 1.7vh, 26px);
  margin: 6px 0 0;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(8px, 1.4vh, 14px);
  margin: clamp(10px, 1.6vh, 16px) 0 clamp(12px, 2vh, 20px);
}
.stat-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  padding: clamp(7px, 1.2vh, 12px) 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 6px 0 rgba(27, 42, 74, 0.16);
}
.stat-num {
  font-size: clamp(18px, 3.4vh, 54px);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.1;
}
.stat-label {
  font-size: clamp(9px, 1.3vh, 20px);
  letter-spacing: clamp(0.5px, 0.2vw, 2.5px);
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
}
.stat-correct .stat-num { color: var(--correct); }
.stat-wrong .stat-num { color: var(--wrong); }
.stat-pct .stat-num { color: var(--water); }

.result-play {
  min-width: min(260px, 66vw);
  font-size: clamp(17px, 2.8vh, 26px);
  padding: clamp(10px, 1.8vh, 16px) clamp(24px, 4vw, 46px);
}
#scene-result .small-credit {
  display: inline-block;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: 5px 16px;
  margin-top: 16px;
  opacity: 1;
}

/* ============ REMAP MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(27, 42, 74, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 24px;
}
.modal-box {
  padding: 26px;
  width: 100%;
  max-width: 520px;
  text-align: center;
}
.modal-box h3 { margin-bottom: 16px; }
.remap-keys {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}
.remap-key {
  background: var(--paper-2);
  border: 3px dashed var(--ink);
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
  font-size: 19px;
  font-weight: bold;
  cursor: pointer;
  color: var(--ink);
}
.remap-key:hover { background: #EAF6FD; }
.remap-key .remap-desc { font-size: 13px; color: var(--ink-soft); display: block; margin-top: 4px; }
.remap-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 600px) {
  .board { padding: 18px 14px; }
  .home-card { padding: 20px 22px; }
  .home-title { font-size: 44px; }
  .opt-btn { font-size: 16px; padding: 12px; }
  .q-text { font-size: 20px; }
  .result-score-big { font-size: 68px; }
}
