:root {
  color-scheme: light;
  --lime: #78ac13;
  --light: #d5fb91;
  --ink: #20300a;
  --deep: #192d00;
  --panel: #fff;
  --stage-gap: clamp(10px, 1.2vw, 28px);
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: #172800;
  height: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100%;
  background: #172800;
  color: var(--ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 16px;
  overflow-x: hidden;
}

button, a, input { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 4px solid #ffc93c; outline-offset: 5px; }
button:disabled { cursor: default; }
button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.site-header {
  height: clamp(62px, 4.3vw, 86px);
  background: var(--lime);
  color: white;
  border-bottom: 1px solid #5b8a08;
}

.site-header-inner {
  width: 100%;
  max-width: 3840px;
  height: 100%;
  margin: auto;
  padding: 0 clamp(16px, 2.2vw, 48px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 28px);
}

.brand { color: white; text-decoration: none; font-size: clamp(26px, 2.1vw, 38px); font-weight: 700; letter-spacing: -1.5px; white-space: nowrap; }
.brand > span:last-child { font-weight: 400; color: #ebffc6; }
.brand-mark { display: inline-flex; width: 31px; height: 31px; align-items: center; justify-content: center; flex: none; letter-spacing: 0; margin-right: 3px; color: currentColor; }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.site-context { margin-left: clamp(4px, 1.4vw, 24px); font-size: clamp(10px, .8vw, 14px); font-weight: bold; letter-spacing: 1.5px; color: #f0ffcf; white-space: nowrap; }
.site-context > span { padding: 0 7px; }

.header-user-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: clamp(34px, 2.6vw, 40px);
  padding: 0 14px 0 12px;
  background: rgba(22, 45, 2, 0.42);
  border: 1.5px solid rgba(213, 251, 145, 0.65);
  border-radius: 20px;
  color: #f0ffcf;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  flex: none;
  max-width: min(240px, 32vw);
}
.header-user-box:hover,
.header-user-box:focus-within {
  background: rgba(16, 36, 1, 0.7);
  border-color: #d5fb91;
  box-shadow: 0 0 14px rgba(180, 255, 80, 0.38);
}
.header-user-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 16px;
  height: 16px;
  color: #d5fb91;
}
.header-user-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.header-player-input {
  border: none;
  outline: none;
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: clamp(12px, 0.9vw, 14px);
  font-weight: 700;
  letter-spacing: 0.5px;
  width: 100%;
  min-width: 70px;
  max-width: 160px;
  padding: 0;
  text-overflow: ellipsis;
}
.header-player-input::placeholder {
  color: rgba(220, 250, 180, 0.6);
  font-weight: 500;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: clamp(8px, 1vw, 18px); }
.help-link { border: 0; color: white; background: transparent; display: flex; align-items: center; gap: 9px; font-weight: bold; font-size: clamp(13px, .9vw, 16px); white-space: nowrap; }
.help-link > span { display: inline-flex; width: 22px; height: 22px; border: 1.5px solid white; align-items: center; justify-content: center; border-radius: 50%; }
.header-icon-button { width: 42px; height: 42px; border: 1px solid #d5fa9180; border-radius: 8px; background: #4f850b66; color: white; display: flex; align-items: center; justify-content: center; }
.header-icon-button:hover { background: #3f7109; }

.page {
  min-height: calc(100vh - clamp(62px, 4.3vw, 86px));
  min-height: calc(100dvh - clamp(62px, 4.3vw, 86px));
  padding: clamp(12px, 1.8vw, 36px) clamp(10px, 2vw, 48px) 20px;
  background: #172800;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.split-stage {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--stage-gap);
  align-items: stretch;
  flex: 1 1 auto;
}

.game-board {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(7px, .55vw, 13px);
  border: 1px solid #5c9217;
  box-shadow: 0 8px 26px #10250040;
  background: var(--deep);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

.hud {
  position: relative;
  min-height: clamp(60px, 4.5vw, 90px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  background: linear-gradient(110deg, #79a811, #619e0c 66%, #83ae19);
  padding: 6px clamp(6px, .65vw, 14px);
  gap: clamp(6px, .8vw, 16px);
  color: white;
  z-index: 5;
  border-bottom: 3px solid #476b11;
}

.hud h1 { min-width: 0; margin: 0; font-size: clamp(14px, 1.25vw, 25px); line-height: 1.2; font-weight: 500; text-align: center; text-shadow: 0 1px 2px #30450055; letter-spacing: .2px; }
.hud h1 span { display: inline; }
.hud-stat { min-width: clamp(50px, 4.5vw, 78px); border-radius: 8px; border: 1px solid #547b11; background: #5c8c1438; box-shadow: inset 0 0 8px #385e1033; padding: 3px 7px; text-align: center; flex: none; }
.stat-label { display: block; font-size: clamp(8px, .55vw, 11px); line-height: 12px; font-weight: bold; letter-spacing: .7px; }
.stat-value { font-size: clamp(18px, 1.45vw, 28px); display: flex; gap: 5px; justify-content: center; align-items: center; line-height: 26px; }
.stat-value b { font-weight: 700; }
.heart { font-size: clamp(22px, 1.7vw, 31px); line-height: 24px; }
.score-icon { font-size: clamp(18px, 1.35vw, 25px); }

.pond { position: relative; aspect-ratio: 1.96; overflow: hidden; background: #26c8ee; container-type: inline-size; }
.pond-current {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.pond-current::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 200%;
  background-image: url('assets/water.png');
  background-repeat: repeat-y;
  background-size: 100% 50%;
  animation: water-flow-down 20s linear infinite;
  will-change: transform;
}
.water-overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, #02839b08, #26dbff00 65%, #09aed016); }
.pond-shockwave {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: repeating-radial-gradient(circle at var(--sx, 50%) var(--sy, 90%),
    rgba(255,255,255,0.75) 0px,
    rgba(255,255,255,0.75) 2px,
    transparent 3px,
    transparent 24px);
  background-position: var(--sx, 50%) var(--sy, 90%);
  background-repeat: no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
}
.pond-shockwave.active {
  animation: shockwave-pulse 0.9s ease-out forwards;
}
.pond-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: rgba(160, 20, 10, 0.4);
  opacity: 0;
}
.pond-flash.wrong-flash { animation: wrong-flash-out 0.45s ease-out forwards; }
.life-lost-heart {
  position: absolute;
  z-index: 7;
  font-size: 28px;
  color: #ff4d4d;
  pointer-events: none;
  animation: life-lost-float 0.8s ease-out forwards;
}
.floating-score {
  position: absolute;
  z-index: 7;
  font-weight: 800;
  font-size: clamp(16px, 1.6vw, 24px);
  color: #fff59d;
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  pointer-events: none;
  animation: floating-score-up 0.9s ease-out forwards;
}
.decor-pad { position: absolute; width: 21%; height: auto; pointer-events: none; opacity: .93; filter: brightness(.72); transform: translate(-50%, -50%); z-index: 3; }
.decor-1 { left: 8%; top: 38%; rotate: -17deg; }
.decor-2 { left: 90%; top: 37%; rotate: 16deg; }
.decor-3 { left: 30%; top: 2%; rotate: 29deg; }
.decor-4 { left: 70%; top: 2%; rotate: -18deg; }
.decor-center { left: 26%; top: 18%; width: 16%; rotate: -8deg; filter: brightness(.72); }

.question-box {
  position: absolute;
  z-index: 5;
  left: 10px;
  right: 10px;
  top: 10px;
  min-height: 84px;
  height: clamp(86px, 17.5%, 138px);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 0 #4b6b2455, 0 6px 16px #12280033;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 23px 18px 10px;
}
.question-counter {
  position: absolute;
  top: 4px;
  left: 6px;
  border-radius: 9px;
  padding: 3px 8px;
  background: #274308;
  color: white;
  font-size: 11px;
  line-height: 12px;
  font-weight: bold;
}
.question-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5cqw, 22px);
}
.question-illustration {
  flex: none;
  width: clamp(75px, 11cqw, 130px);
  height: 100%;
  max-height: 105px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7faee;
  border: 1.5px solid #bddfa0;
  border-radius: 8px;
  padding: 2px 4px;
  box-shadow: inset 0 0 6px #78ac1318;
}
.question-illustration svg.geom-svg {
  width: 100%;
  height: 100%;
  max-height: 98px;
  display: block;
}
.question-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.question-box h2 {
  margin: 0;
  width: 100%;
  font-size: clamp(15px, 1.4vw, 26px);
  line-height: 1.35;
  text-align: center;
  font-weight: 700;
  color: #2c332b;
}

/* KaTeX formatting in questions, answer pads, and dialogs */
.katex {
  font-size: 1.08em;
  font-family: "KaTeX_SansSerif", "Trebuchet MS", Arial, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.katex-display {
  margin: 0.25em 0;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.katex .mathnormal {
  font-family: "KaTeX_SansSerif", "Trebuchet MS", Arial, sans-serif;
  font-style: italic;
}
.katex .mord.text,
.katex .mathrm,
.katex .textrm {
  font-family: "Trebuchet MS", "KaTeX_SansSerif", Arial, sans-serif;
}
.katex .mbin,
.katex .mrel {
  font-weight: 600;
}
.katex .frac-line {
  border-bottom-width: 1.5px;
}

/* Question text KaTeX: blend seamlessly with heading font weight and color */
.question-box h2 .katex {
  font-size: 1.04em;
  font-weight: 700;
}
.question-box h2 .katex .mathnormal,
.question-box h2 .katex .mord,
.question-box h2 .katex .mbin,
.question-box h2 .katex .mrel,
.question-box h2 .katex .text {
  font-weight: 700;
}

/* Answer pad KaTeX: prominent, bold, and readable on lily pad */
.answer-text .katex {
  font-size: clamp(15px, 2.7cqw, 36px);
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}
.answer-text.long-answer .katex {
  font-size: clamp(12.5px, 2.1cqw, 26px);
}
.answer-text .katex-html {
  white-space: nowrap;
  max-width: 100%;
}
.answer-text .katex .mathnormal,
.answer-text .katex .mord,
.answer-text .katex .mbin,
.answer-text .katex .mrel,
.answer-text .katex .text {
  font-weight: 800;
}

/* Report dialog / explanation KaTeX: clear and substantial equation styling */
.report-item h3 .katex {
  font-weight: 700;
}
.report-item h3 .katex .mathnormal,
.report-item h3 .katex .mord,
.report-item h3 .katex .mbin,
.report-item h3 .katex .mrel,
.report-item h3 .katex .text {
  font-weight: 700;
}
.report-item p .katex {
  font-weight: 600;
}
.report-item p .katex .mathnormal,
.report-item p .katex .mord,
.report-item p .katex .mbin,
.report-item p .katex .mrel,
.report-item p .katex .text {
  font-weight: 600;
}

.answer-field { position: absolute; inset: 0; }
.answer-pad { position: absolute; width: 17%; height: 20%; background: transparent; border: 0; color: #fff; padding: 0; transform: translate(-50%, -50%); z-index: 3; outline-offset: -3px; transition: filter .18s; display: flex; align-items: center; justify-content: center; isolation: isolate; }
.answer-pad img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: -1; filter: brightness(.71); transition: filter .2s, transform .18s; }
.answer-pad:hover:not(:disabled) img { filter: brightness(.95); transform: scale(1.045); }
.answer-pad:focus-visible { outline: 0; }
.answer-pad:focus-visible img { filter: brightness(1) drop-shadow(0 0 7px #ffe564); }
.pad-a { left: 24%; top: 45%; }
.pad-b { left: 76%; top: 45%; }
.pad-c { left: 24%; top: 70%; }
.pad-d { left: 76%; top: 70%; }
.answer-letter { position: absolute; left: 50%; top: 1%; transform: translate(-50%, -50%); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #83bb20; border: 1px solid #c9ee8866; border-radius: 50%; font-size: 23px; font-weight: bold; color: #fff; text-shadow: 0 1px 1px #2f4a19; }
.answer-text { max-width: 86%; padding: 4px 6px 11px; white-space: pre-line; font-size: clamp(15px, 2.8cqw, 35px); font-weight: 700; line-height: 1.15; text-shadow: 0 2px 2px #0005; overflow-wrap: break-word; }
.answer-text.long-answer { font-size: clamp(12.5px, 2.1cqw, 26px); line-height: 1.18; padding-top: 5px; }
.answer-symbol { position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%); font-size: 24px; }
.answer-pad.correct img { filter: brightness(1.18) drop-shadow(0 0 6px #d4ff38); }
.answer-pad.correct .answer-letter { background: #d1ff74; color: #35590c; }
.answer-pad.incorrect img { filter: brightness(.6) sepia(1) saturate(5) hue-rotate(320deg); }
.answer-pad.landed img {
  animation: leaf-press 0.75s cubic-bezier(.25,.6,.35,1) forwards;
  transform-origin: 50% 60%;
}
.answer-pad:not(.selected).muted { opacity: .72; }
.home-pad { position: absolute; left: 50%; top: 90%; width: 20%; height: 22%; transform: translate(-50%, -50%); filter: brightness(.65); z-index: 3; }
.frog { position: absolute; left: 50%; top: 92%; width: 12%; height: 25%; transform: translate(-50%, -55%); pointer-events: none; z-index: 4; transform-origin: center center; }
.frog > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 7px 3px #16310050); }
.frog.idle > img { animation: breathe 2.8s ease-in-out infinite; }
.frog.sink > img { animation: sink .55s ease-in both; }

.game-controls { position: absolute; bottom: 13px; left: 14px; right: 13px; display: flex; justify-content: space-between; align-items: center; z-index: 9; pointer-events: none; }
.game-controls > * { pointer-events: auto; }
.control-actions { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.icon-button { width: 49px; height: 49px; border: 1px solid #bdde73; box-shadow: 0 3px 0 #51823650; border-radius: 7px; background: #e1ffa3; color: #344e0f; display: flex; align-items: center; justify-content: center; transition: background .2s, transform .2s; }
.icon-button:hover { background: #f0ffc8; transform: translateY(-1px); }
.time-group { display: flex; align-items: center; pointer-events: none; }
.countdown { position: relative; width: 84px; height: 84px; z-index: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #fffdf0; color: #252c25; }
.countdown svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 8; }
.timer-track { stroke: #95bd48; }
.timer-progress { stroke: #d7fb9a; stroke-dasharray: 213.63; stroke-dashoffset: 0; transition: stroke .2s, stroke-dashoffset .1s linear; }
.countdown > span { font-size: 31px; font-weight: bold; }
.countdown.urgent .timer-track { stroke: #bd4d26; }
.countdown.urgent .timer-progress { stroke: #ffe38b; }
.countdown.urgent > span { color: #a63622; }
.countdown.urgent { animation: urgent-pulse 0.85s ease-in-out infinite; }
.elapsed { margin-left: -12px; padding: 5px 22px 5px 24px; min-width: 116px; text-align: center; background: #ffffe9; border: 4px solid #97be4d; border-radius: 0 28px 28px 0; color: #243020; font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }

.feedback { position: absolute; z-index: 7; bottom: 10px; left: 50%; transform: translateX(-50%); background: #244900f2; color: #f2ffc6; border: 1px solid #bbdb70; border-radius: 12px; padding: 8px 17px; text-align: center; font-weight: 700; font-size: 16px; min-width: 190px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.feedback.visible { opacity: 1; }
.feedback.error { background: #67351b; color: #fff8e8; border-color: #eec598; }

.start-screen, .result-screen {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  text-align: center;
  color: white;
  padding: clamp(10px, 2.2cqh, 22px) 16px clamp(14px, 2.8cqh, 28px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(213, 251, 145, 0.4) transparent;
}
@media (min-height: 560px) {
  .start-screen::before, .result-screen::before {
    content: '';
    margin-top: auto;
    flex: none;
  }
  .start-screen::after, .result-screen::after {
    content: '';
    margin-bottom: auto;
    flex: none;
  }
}
.start-screen { background: radial-gradient(ellipse at 50% 20%, #244b0040, #173400db 83%); }
.start-mascot { position: relative; width: min(120px, 13cqw); height: min(80px, 8.5cqw); flex: none; margin-bottom: 0; }
.start-leaf { position: absolute; width: 100%; height: 100%; bottom: -12%; left: 0; filter: brightness(.8); }
.start-frog { position: absolute; width: 78%; height: 130%; object-fit: contain; left: 11%; bottom: 0; filter: drop-shadow(0 7px 4px #132f0070); animation: breathe 3s ease-in-out infinite; }
.eyebrow { color: #e2ff8e; margin: 4px 0 8px; font-size: clamp(10px, .8vw, 13px); font-weight: bold; letter-spacing: 2px; }
.primary-button { min-height: 44px; display: inline-flex; justify-content: center; align-items: center; gap: 10px; border: 0; border-radius: 30px; background: #d3fa8e; color: #25390b; font-size: 18px; font-weight: bold; padding: 11px 32px; box-shadow: 0 4px 0 #476f16; transition: background .15s, transform .15s; }
.primary-button:hover { background: #e4ffb2; transform: translateY(-2px); }
.primary-button:active { transform: translateY(2px); box-shadow: 0 1px 0 #476f16; }
.start-screen .primary-button { min-width: min(270px, 90%); }
.start-details { margin: 8px 0 0; color: #e6f2cf; font-size: clamp(11px, .75vw, 13px); }
.start-details > span { padding: 0 5px; color: #bbdd83; }

.shape-picker { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: clamp(6px, 1.8cqh, 16px); margin-bottom: 8px; }
.shape-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 72px;
  padding: 8px 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.12);
  color: #eafccb;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 0 #132b00;
  transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.shape-option .shape-icon { width: 52px; height: 44px; display: block; }
.shape-option .shape-icon svg { width: 100%; height: 100%; display: block; }
.shape-option:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.shape-option.active { background: #eaffb0; color: #1f3403; border-color: #ffffff; box-shadow: 0 3px 0 #476f16; }

.level-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(560px, 100%); margin: 2px 0 13px; }
.level-option { min-height: 55px; padding: 8px 12px; border: 1px solid #9fcb62; border-radius: 10px; background: #365d0ed9; color: #f5ffdc; box-shadow: 0 2px 0 #132b00; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: background .15s, transform .15s, border-color .15s; }
.level-option:hover { background: #527d1bd9; transform: translateY(-1px); }
.level-option.active { background: #d5fa8e; color: #25390b; border-color: #f0ffc8; box-shadow: 0 3px 0 #476f16; }
.level-option strong { font-size: 15px; line-height: 1.1; }
.level-option small { font-size: 11px; line-height: 1.1; opacity: .86; }
.level-option.active small { opacity: .72; }

/* Input Nama Pemain pada Start Screen */
.player-name-card {
  width: min(340px, 94%);
  margin: 2px auto 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.player-name-label {
  font-size: 13px;
  font-weight: 700;
  color: #e5fbb4;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.player-name-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #d5fb91;
}
.player-name-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}
.player-name-input-wrapper {
  position: relative;
  width: 100%;
}
.player-name-input {
  width: 100%;
  height: 42px;
  padding: 8px 18px;
  border: 2px solid #9ece55;
  border-radius: 22px;
  background: rgba(18, 42, 2, 0.74);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
  box-shadow: 0 3px 0 #132b00, inset 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.15s;
}
.player-name-input::placeholder {
  color: rgba(220, 250, 180, 0.55);
  font-weight: 500;
  font-size: 14px;
}
.player-name-input:focus {
  border-color: #f2ffc8;
  background: rgba(18, 42, 2, 0.92);
  box-shadow: 0 3px 0 #132b00, 0 0 16px rgba(180, 255, 80, 0.5);
  transform: translateY(-1px);
}

/* Hitungan Mundur Mulai Bermain (Countdown 3, 2, 1, Mulai!) */
.start-countdown {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  pointer-events: auto;
  background: #000000;
  opacity: 1;
  transition: opacity 0.35s ease-out;
}
.start-countdown[hidden] {
  display: none !important;
}
.start-countdown.fade-out {
  opacity: 0;
  pointer-events: none;
}

.countdown-backdrop {
  position: absolute;
  inset: 0;
  background: #000000;
  pointer-events: auto;
}

.countdown-burst {
  position: absolute;
  width: min(450px, 80cqw);
  height: min(450px, 80cqw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(160, 255, 60, 0.45) 0%, rgba(95, 230, 45, 0.2) 45%, rgba(0, 0, 0, 0) 72%);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.35);
}
.countdown-burst.pulse {
  animation: countdownBurstPulse 0.82s cubic-bezier(0.12, 0.8, 0.25, 1) forwards;
}

.countdown-ripple {
  position: absolute;
  width: min(220px, 40cqw);
  height: min(220px, 40cqw);
  border-radius: 50%;
  border: 4px solid rgba(220, 255, 150, 0.9);
  box-shadow: 0 0 30px rgba(160, 255, 60, 0.8), inset 0 0 16px rgba(220, 255, 150, 0.5);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.3);
}
.countdown-ripple.expand {
  animation: countdownRippleExpand 0.82s cubic-bezier(0.1, 0.75, 0.2, 1) forwards;
}

.countdown-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform, opacity;
}

.countdown-img {
  display: block;
  height: clamp(140px, 30cqw, 240px);
  width: auto;
  max-width: 84cqw;
  object-fit: contain;
  filter: drop-shadow(0 0 25px rgba(160, 255, 70, 0.6)) drop-shadow(0 15px 30px rgba(0, 0, 0, 0.9));
  user-select: none;
  -webkit-user-drag: none;
}

.countdown-img.is-mulai {
  height: clamp(80px, 16cqw, 140px);
  max-width: 88cqw;
  filter: drop-shadow(0 0 35px rgba(175, 255, 80, 0.75)) drop-shadow(0 15px 30px rgba(0, 0, 0, 0.9));
}

.countdown-stage.animate-pop {
  animation: countdownPop 0.82s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
}

.countdown-stage.animate-mulai {
  animation: countdownMulaiPop 0.85s cubic-bezier(0.18, 0.9, 0.28, 1) forwards;
}

@keyframes countdownBurstPulse {
  0% {
    transform: scale(0.3) rotate(0deg);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.15) rotate(20deg);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.55) rotate(40deg);
    opacity: 0;
  }
}

@keyframes countdownRippleExpand {
  0% {
    transform: scale(0.25);
    opacity: 0.95;
    border-width: 6px;
  }
  40% {
    opacity: 0.8;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
    border-width: 1px;
  }
}

@keyframes countdownPop {
  0% {
    transform: scale(0.18) rotate(-10deg);
    opacity: 0;
  }
  38% {
    transform: scale(1.18) rotate(3deg);
    opacity: 1;
  }
  56% {
    transform: scale(0.96) rotate(-1.5deg);
    opacity: 1;
  }
  75% {
    transform: scale(1.02) rotate(0deg);
    opacity: 1;
  }
  90% {
    transform: scale(1.01) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(1.32) rotate(3deg);
    opacity: 0;
    filter: drop-shadow(0 0 45px rgba(180, 255, 90, 0.95)) blur(1px);
  }
}

@keyframes countdownMulaiPop {
  0% {
    transform: scale(0.15) translateY(28px);
    opacity: 0;
  }
  40% {
    transform: scale(1.24) translateY(-8px);
    opacity: 1;
    filter: drop-shadow(0 0 35px rgba(180, 255, 90, 0.85));
  }
  58% {
    transform: scale(0.96) translateY(2px);
    opacity: 1;
  }
  75% {
    transform: scale(1.04) translateY(-2px);
    opacity: 1;
  }
  88% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
  100% {
    transform: scale(1.3) translateY(-12px);
    opacity: 0;
    filter: drop-shadow(0 0 50px rgba(190, 255, 100, 0.95)) blur(2px);
  }
}

.result-screen { background: radial-gradient(ellipse at center top, #466e12e8, #1e3600f5 78%); padding: 20px; }
.result-screen h2 { font-size: clamp(28px, 6cqw, 71px); margin: 0; letter-spacing: 2px; font-weight: 800; }
.result-screen h2:focus { outline: none; }
.result-player { margin: 8px 0 2px; }
.result-player-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(213, 251, 145, 0.45);
  padding: 4px 14px;
  border-radius: 16px;
  font-size: 15px;
  color: #e8fbb5;
}
.result-player-badge b { color: #ffffff; }
.result-screen > p { font-size: clamp(14px, 1.8cqw, 21px); margin: 10px 0 4px; color: #f5ffdc; }
.trophy { font-size: clamp(50px, 9cqw, 111px); line-height: 1.2; margin: 4px 0; }
.result-stats { width: min(560px, 82%); display: flex; justify-content: space-around; gap: 20px; padding: 10px 0 19px; }
.result-stats > div { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.result-stats span { font-size: 12px; letter-spacing: 2px; color: #d8eeb9; }
.result-stats b { font-size: clamp(23px, 3.5cqw, 44px); font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-score-detail { font-size: clamp(10px, 1.2cqw, 12px); color: #cde6a5; font-weight: 500; letter-spacing: 0.3px; line-height: 1.2; }
.result-score-detail[hidden] { display: none !important; }
.result-actions { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.result-actions .primary-button { min-width: 245px; }
.secondary-button { background: transparent; color: #f3ffcf; border: 1px solid #b8d68a; border-radius: 30px; padding: 12px 24px; min-height: 48px; font-size: 16px; }
.secondary-button:hover { background: #d4ffa512; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; left: var(--x); top: -30px; width: 9px; height: 18px; background: var(--c); animation: confetti var(--d) var(--delay) ease-in infinite; rotate: var(--r); border-radius: 2px; }

.game-footer { width: 100%; max-width: 3840px; margin: auto auto 0; padding: 14px 5px; display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 14px; color: #d9e9bf; text-align: center; }
.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13.5px;
  color: #d9e9bf;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.heart-sway {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  transform-origin: 50% 90%;
  animation: heartSway 1.8s ease-in-out infinite;
  margin: 0 4px;
}
.heart-icon {
  width: 17px;
  height: 17px;
  display: block;
  filter: drop-shadow(0 0 5px rgba(255, 46, 77, 0.7));
}
.credit-author {
  color: #ebffba;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(213, 251, 145, 0.5);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s, text-shadow 0.15s;
}
.credit-author:hover {
  color: #ffffff;
  text-decoration-color: #d5fb91;
  text-shadow: 0 0 8px rgba(213, 251, 145, 0.7);
}
.footer-credit:hover .heart-sway {
  animation: heartSwayFaster 0.75s ease-in-out infinite;
}

@keyframes heartSway {
  0% {
    transform: rotate(0deg) scale(1);
  }
  15% {
    transform: rotate(-15deg) scale(1.18);
  }
  32% {
    transform: rotate(14deg) scale(1.22);
  }
  48% {
    transform: rotate(-10deg) scale(1.14);
  }
  64% {
    transform: rotate(8deg) scale(1.08);
  }
  80% {
    transform: rotate(-4deg) scale(1.03);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

@keyframes heartSwayFaster {
  0% {
    transform: rotate(0deg) scale(1.05);
  }
  25% {
    transform: rotate(-18deg) scale(1.3);
  }
  50% {
    transform: rotate(16deg) scale(1.3);
  }
  75% {
    transform: rotate(-12deg) scale(1.2);
  }
  100% {
    transform: rotate(0deg) scale(1.05);
  }
}

.accessibility-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#split-stage:fullscreen { width: 100vw; height: 100vh; max-width: none; padding: clamp(10px, 1.4vw, 28px); background: #172800; align-content: stretch; grid-template-rows: minmax(0, 1fr); }
#split-stage:fullscreen .game-board { box-shadow: 0 8px 32px #06100099; }

dialog { border: 1px solid #bfd29e; border-radius: 19px; background: #fbfff3; color: #253711; max-width: 480px; width: calc(100% - 32px); padding: 26px; box-shadow: 0 16px 60px #0a250060; max-height: 88dvh; overflow: auto; }
dialog::backdrop { background: #081b00a3; backdrop-filter: blur(4px); }
.dialog-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 25px; margin: 0; }
.close-button { border: 0; background: #e6f0d6; color: #3d5620; width: 35px; height: 35px; border-radius: 50%; font-size: 27px; line-height: 1; flex: none; }
.dialog-note { color: #5a6b44; font-size: 15px; line-height: 1.6; }
.sound-row { display: flex; align-items: center; gap: 12px; padding: 18px 0 28px; font-weight: bold; }
.sound-row input { margin-left: auto; position: relative; width: 48px; height: 28px; opacity: 0; z-index: 2; cursor: pointer; }
.switch { width: 48px; height: 28px; margin-left: -60px; background: #b6c5a0; border-radius: 18px; position: relative; pointer-events: none; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform .15s; }
.sound-row input:checked + .switch { background: #77a827; }
.sound-row input:checked + .switch::after { transform: translateX(20px); }
.sound-row input:focus-visible + .switch { outline: 3px solid #354c14; outline-offset: 4px; }
dialog .primary-button { width: 100%; font-size: 17px; }
dialog .secondary-button { width: 100%; font-size: 16px; }
#settings-home-button {
  margin-top: 10px;
  width: 100%;
  background: #edf8d7;
  color: #264307;
  border: 1.5px solid #8ebd3b;
  font-weight: bold;
}
#settings-home-button:hover {
  background: #dbf2b7;
}
.text-button { display: block; margin: 21px auto 0; border: 0; background: none; color: #785135; text-decoration: underline; font-size: 14px; }
.instructions { padding-left: 24px; line-height: 1.65; font-size: 16px; }
.instructions li { padding-left: 5px; margin-bottom: 12px; }
.report-dialog { max-width: 780px; }
.report-summary-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-around;
  align-items: center;
  background: #edf6df;
  border: 1.5px solid #bddfa0;
  border-radius: 12px;
  padding: 10px 16px;
  margin: 10px 0 14px;
}
.report-summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: #48681e;
  font-weight: 700;
}
.report-summary-stat b {
  font-size: 18px;
  color: #1b2e04;
  font-variant-numeric: tabular-nums;
}
.report-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
}
.report-summary-badge.passed {
  background: #d4f895;
  color: #274906;
  border: 1px solid #92cb3e;
}
.report-summary-badge.failed {
  background: #fde2d4;
  color: #923215;
  border: 1px solid #f29b7a;
}

.report-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.report-filter-btn {
  border: 1.5px solid #a8cf68;
  background: #f4fae6;
  color: #2d4c0b;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.report-filter-btn:hover {
  background: #e2f5c4;
  transform: translateY(-1px);
}
.report-filter-btn.active {
  background: #5d9313;
  color: #ffffff;
  border-color: #49790a;
  box-shadow: 0 2px 4px rgba(35, 60, 5, 0.25);
}

.report-item { border-top: 1px solid #d7e2c7; padding: 18px 0 12px; }
.report-item[hidden] { display: none !important; }
.report-item-inner { display: flex; gap: 16px; align-items: flex-start; }
.report-illustration { flex: none; width: 110px; height: 95px; background: #f8fbef; border: 1px solid #c4df9e; border-radius: 8px; padding: 4px; box-shadow: 0 2px 6px #00000010; }
.report-illustration svg.geom-svg { width: 100%; height: 100%; display: block; }
.report-body { flex: 1 1 auto; min-width: 0; }
.report-item h3 { font-size: 16px; line-height: 1.45; margin: 0 0 8px; }
.report-item p { margin: 5px 0; font-size: 15px; line-height: 1.5; }
.report-item .explanation { color: #3b5025; padding: 9px 12px; background: #edf4e2; border-radius: 7px; }
.report-status { font-size: 12px; display: inline-block; vertical-align: middle; padding: 3px 7px; border-radius: 4px; margin-right: 5px; background: #e2f2c7; color: #3d6621; }
.report-status.wrong { background: #fbe3d6; color: #963b21; }
.report-status.unanswered { background: #e7e9e2; color: #637057; }

@keyframes urgent-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.02, .98); } }
@keyframes frog-body-leap { 0%, 100% { transform: scale(1); } 16% { transform: scale(.92, .94); } 38% { transform: scale(1, .87); } 55% { transform: scale(1.06, .88); } 75% { transform: scale(1.02, .95); } }
@keyframes frog-front-leg-stretch { 0%, 100% { transform: var(--leg-rest); } 15% { transform: var(--leg-rest); } 43% { transform: var(--leg-stretch); } 66% { transform: var(--leg-stretch); } 86% { transform: var(--leg-rest); } }
@keyframes frog-back-leg-stretch { 0%, 100% { transform: var(--leg-rest); } 12% { transform: var(--leg-rest); } 47% { transform: var(--leg-stretch); } 68% { transform: var(--leg-stretch); } 88% { transform: var(--leg-rest); } }
@keyframes sink { to { opacity: 0; transform: translateY(30px) scale(.6); } }
@keyframes confetti { 0% { transform: translateY(-5px) rotate(0); opacity: 1; } 100% { transform: translateY(700px) rotate(500deg); opacity: .1; } }
@keyframes shockwave-pulse {
  0%   { background-size: 6% 6%; opacity: 0; }
  14%  { opacity: 1; }
  60%  { opacity: 0.6; }
  100% { background-size: 260% 260%; opacity: 0; }
}
@keyframes wrong-flash-out {
  0% { opacity: .6; }
  100% { opacity: 0; }
}
@keyframes life-lost-float {
  0% { opacity: 1; transform: translate(-50%, -50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-46px) scale(1.3); }
}
@keyframes floating-score-up {
  0% { opacity: 1; transform: translate(-50%, -50%) translateY(0); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-60px); }
}
@keyframes leaf-press {
  0%   { transform: translateY(0%) rotate(0deg) scale(1, 1); }
  15%  { transform: translateY(7%) rotate(-3.5deg) scale(0.93, 0.88); }
  35%  { transform: translateY(3%) rotate(2.5deg) scale(1.04, 0.97); }
  55%  { transform: translateY(-2.5%) rotate(-1.8deg) scale(0.98, 1.03); }
  75%  { transform: translateY(1.2%) rotate(1deg) scale(1.01, 0.99); }
  100% { transform: translateY(0%) rotate(0deg) scale(1, 1); }
}
@keyframes water-flow-down {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0%); }
}

@media (min-width: 981px) {
  .page { height: calc(100dvh - clamp(62px, 4.3vw, 86px)); min-height: 0; display: flex; flex-direction: column; }
  .split-stage { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .game-board { height: 100%; display: flex; flex-direction: column; }
  .pond { flex: 1 1 auto; min-height: 0; aspect-ratio: auto; }
  .game-footer { flex: none; }
}

@media (min-width: 981px) and (max-height: 760px) {
  .page { padding-top: 10px; padding-bottom: 10px; }
  .game-footer { padding-top: 8px; padding-bottom: 4px; }
}

@media (max-width: 1100px) {
  .hud h1 { font-size: clamp(14px, 1.8vw, 22px); }
  .hud h1 span { display: block; font-size: .72em; padding-top: 3px; }
}

@media (max-width: 980px) {
  .page {
    padding: 12px 10px 14px;
    background: #172800;
    min-height: calc(100vh - clamp(52px, 4.3vw, 86px));
    min-height: calc(100dvh - clamp(52px, 4.3vw, 86px));
    height: calc(100vh - clamp(52px, 4.3vw, 86px));
    height: calc(100dvh - clamp(52px, 4.3vw, 86px));
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }
  .split-stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
  }
  .game-board {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
  }
  .pond {
    flex: 1 1 auto;
    min-height: 420px;
    aspect-ratio: auto;
  }
  .game-footer {
    flex: none;
    flex-direction: column;
    gap: 6px;
    text-align: center;
    margin-top: auto;
  }
  .start-screen { padding-bottom: 37px; }
  .start-mascot { width: 142px; height: 106px; }
  .start-leaf { width: 142px; height: 91px; bottom: -14px; }
  .start-frog { width: 110px; height: 121px; left: 16px; }
  .eyebrow { font-size: 11px; margin-top: 7px; margin-bottom: 10px; }
  .start-details { margin-top: 12px; font-size: 12px; }
  .shape-picker { gap: 6px; margin-top: clamp(10px, 2cqh, 16px); margin-bottom: 10px; }
  .shape-option { min-width: 60px; padding: 6px 10px; font-size: 12px; }
  .shape-option .shape-icon { width: 44px; height: 38px; display: block; }
  .level-picker { gap: 6px; margin: 1px 0 10px; }
  .level-option { min-height: 49px; padding: 6px 8px; }
  .level-option strong { font-size: 13px; }
  .level-option small { font-size: 10px; }
  .answer-pad { width: 32%; height: 18%; }
  .pad-a { left: 22%; top: 52%; }
  .pad-b { left: 78%; top: 52%; }
  .pad-c { left: 22%; top: 76%; }
  .pad-d { left: 78%; top: 76%; }
  .home-pad { width: 34%; height: 20%; top: 90%; }
  .frog { width: 14%; top: 92%; height: 23%; }
  .game-controls { left: 9px; right: 9px; bottom: 9px; gap: 6px; }
  .countdown { width: 63px; height: 63px; }
  .countdown > span { font-size: 24px; }
  .elapsed { font-size: 18px; min-width: 95px; padding: 4px 13px 4px 20px; }
  .icon-button { width: 39px; height: 39px; }
  .icon-button svg { width: 21px; height: 21px; }
  .feedback { font-size: 13px; bottom: 75px; padding: 7px 12px; min-width: 160px; }
}

@media (max-width: 768px) {
  .site-context { display: none; }
  .header-user-box { max-width: 170px; }
}

/* ==========================================================================
   MOBILE SMARTPHONE OPTIMIZATIONS (Portrait: <= 680px)
   ========================================================================== */
@media (max-width: 680px) {
  .site-header {
    height: 52px;
  }
  .site-header-inner {
    padding: 0 10px;
    gap: 8px;
  }
  .brand {
    font-size: 21px;
    letter-spacing: -1px;
  }
  .brand-mark {
    width: 25px;
    height: 25px;
    margin-right: 2px;
  }
  .header-user-box {
    max-width: 125px;
    height: 33px;
    padding: 0 8px 0 7px;
    gap: 5px;
  }
  .header-user-icon {
    width: 14px;
    height: 14px;
  }
  .header-player-input {
    font-size: 11.5px;
    min-width: 50px;
    max-width: 100px;
  }
  .header-actions {
    gap: 6px;
  }
  .help-link {
    font-size: 0;
    gap: 0;
    padding: 0;
  }
  .help-link > span {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 8px;
    background: #4f850b66;
    border: 1px solid #d5fa9180;
  }
  .header-icon-button {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }
  .header-icon-button svg {
    width: 19px;
    height: 19px;
  }

  .page {
    padding: 6px 6px 4px;
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
    height: calc(100vh - 52px);
    height: calc(100dvh - 52px);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .split-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
  }
  .game-board {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    width: 100%;
    height: 100%;
  }

  /* HUD */
  .hud {
    min-height: 50px;
    padding: 4px 6px;
    gap: 4px;
  }
  .hud h1 {
    font-size: clamp(12px, 3.3vw, 15px);
    line-height: 1.15;
  }
  .hud h1 span {
    display: block;
    font-size: 0.76em;
    font-weight: 400;
    opacity: 0.92;
    padding-top: 1px;
  }
  .hud-stat {
    min-width: 44px;
    padding: 2px 4px;
    border-radius: 6px;
  }
  .stat-label {
    font-size: 7.5px;
    line-height: 9px;
  }
  .stat-value {
    font-size: 15px;
    line-height: 18px;
    gap: 2px;
  }
  .heart {
    font-size: 16px;
    line-height: 16px;
  }
  .score-icon {
    font-size: 13px;
  }

  /* POND */
  .pond {
    flex: 1 1 auto;
    min-height: 400px;
    aspect-ratio: auto;
    width: 100%;
    border-radius: 0 0 10px 10px;
  }

  /* Question box */
  .question-box {
    left: 8px;
    right: 8px;
    top: 8px;
    height: auto;
    min-height: 76px;
    max-height: 29%;
    padding: 20px 10px 8px;
    border-radius: 9px;
    overflow: hidden;
  }
  .question-counter {
    top: 3px;
    left: 6px;
    font-size: 9.5px;
    padding: 2px 6px;
    line-height: 11px;
    border-radius: 6px;
  }
  .question-content {
    gap: 8px;
    overflow-y: auto;
    max-height: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .question-illustration {
    width: clamp(55px, 16cqw, 75px);
    height: clamp(50px, 14cqw, 68px);
    max-height: 68px;
    padding: 2px;
    border-radius: 6px;
  }
  .question-illustration svg.geom-svg {
    max-height: 64px;
  }
  .question-body {
    max-height: 100%;
    overflow-y: auto;
  }
  .question-box h2 {
    font-size: clamp(12.5px, 3.6cqw, 15.5px);
    line-height: 1.25;
    word-break: normal;
    overflow-wrap: break-word;
  }
  .question-box h2 .katex {
    font-size: 1.02em;
  }

  /* Answer pads */
  .answer-pad {
    width: 36%;
    height: 16%;
    max-width: 150px;
    max-height: 88px;
  }
  .pad-a { left: 24%; top: 41%; }
  .pad-b { left: 76%; top: 41%; }
  .pad-c { left: 24%; top: 63%; }
  .pad-d { left: 76%; top: 63%; }
  .answer-letter {
    width: 26px;
    height: 26px;
    font-size: 16px;
    top: 0%;
  }
  .answer-text {
    font-size: clamp(13px, 3.8cqw, 17px);
    max-width: 90%;
    padding: 2px 3px 5px;
    line-height: 1.15;
  }
  .answer-text.long-answer {
    font-size: clamp(11px, 3.1cqw, 14px);
    line-height: 1.15;
    max-width: 92%;
  }
  .answer-text .katex {
    font-size: clamp(13px, 3.7cqw, 17px);
  }
  .answer-text.long-answer .katex {
    font-size: clamp(11px, 3cqw, 14px);
  }

  /* Home pad & Frog */
  .home-pad {
    left: 50%;
    top: 84%;
    width: 30%;
    height: 15%;
    max-width: 125px;
    max-height: 78px;
  }
  .frog {
    left: 50%;
    top: 85%;
    width: 17%;
    height: 16%;
    max-width: 70px;
  }

  /* Game Controls */
  .game-controls {
    bottom: 8px;
    left: 8px;
    right: 8px;
    gap: 4px;
    justify-content: space-between;
    align-items: flex-end;
  }
  .countdown {
    width: 46px;
    height: 46px;
  }
  .countdown > span {
    font-size: 19px;
  }
  .elapsed {
    font-size: 13.5px;
    min-width: 64px;
    padding: 2px 8px 2px 14px;
    margin-left: -10px;
    border-width: 2.5px;
  }
  .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .icon-button svg {
    width: 19px;
    height: 19px;
  }
  .feedback {
    bottom: 60px;
    font-size: 12.5px;
    padding: 5px 12px;
    max-width: 88%;
  }

  /* Decorative water pads */
  .decor-pad {
    width: 26%;
    opacity: 0.45;
  }
  .decor-1 { left: 2%; top: 35%; }
  .decor-2 { left: 98%; top: 35%; }
  .decor-3 { left: 30%; top: 1%; }
  .decor-4 { left: 70%; top: 1%; }
  .decor-center { left: 16%; top: 15%; width: 18%; }

  /* Start Screen */
  .start-screen {
    padding: 10px 8px 14px;
    justify-content: center;
  }
  .start-screen::before, .result-screen::before,
  .start-screen::after, .result-screen::after {
    display: none;
  }
  .start-mascot {
    width: clamp(80px, 20cqw, 105px);
    height: clamp(54px, 14cqw, 70px);
    margin-bottom: 2px;
  }
  .start-leaf {
    width: 100%;
    height: 100%;
    bottom: -10%;
  }
  .start-frog {
    width: 78%;
    height: 125%;
    left: 11%;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1.5px;
    margin: 2px 0 4px;
  }
  .shape-picker {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: 100%;
    max-width: 360px;
    gap: 4px;
    margin: 4px 0 8px;
  }
  .shape-option {
    min-width: 0;
    padding: 4px 2px;
    border-radius: 8px;
    font-size: 11px;
    gap: 2px;
  }
  .shape-option .shape-icon {
    width: 32px;
    height: 28px;
  }
  .level-picker {
    width: 100%;
    max-width: 360px;
    gap: 4px;
    margin: 0 0 8px;
  }
  .level-option {
    min-height: 42px;
    padding: 4px 4px;
    border-radius: 8px;
  }
  .level-option strong {
    font-size: 12px;
  }
  .level-option small {
    font-size: 9px;
  }
  .player-name-card {
    width: min(290px, 92%);
    margin: 0 auto 8px;
    gap: 4px;
  }
  .player-name-label {
    font-size: 11.5px;
    gap: 4px;
  }
  .player-name-input {
    height: 36px;
    font-size: 13px;
    padding: 6px 14px;
  }
  .start-screen .primary-button {
    min-width: min(230px, 85%);
    min-height: 42px;
    font-size: 15px;
    padding: 8px 20px;
  }
  .start-details {
    font-size: 11px;
    margin-top: 6px;
  }

  /* Result Screen */
  .result-screen {
    padding: 12px 8px;
    justify-content: center;
  }
  .result-screen h2 {
    font-size: clamp(24px, 6.5cqw, 34px);
    letter-spacing: 1px;
  }
  .result-player {
    margin: 4px 0 2px;
  }
  .result-player-badge {
    font-size: 12px;
    padding: 2px 10px;
  }
  .result-screen > p {
    font-size: 13px;
    margin: 3px 0;
  }
  .trophy {
    font-size: clamp(40px, 11cqw, 58px);
    margin: 2px 0;
  }
  .result-stats {
    width: 96%;
    gap: 4px;
    padding: 4px 0 10px;
  }
  .result-stats span {
    font-size: 9.5px;
    letter-spacing: 1px;
  }
  .result-stats b {
    font-size: clamp(17px, 5cqw, 24px);
  }
  .result-score-detail {
    font-size: 9.5px;
  }
  .result-actions {
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .result-actions .primary-button,
  .result-actions .secondary-button {
    width: min(230px, 85%);
    min-width: 0;
    min-height: 40px;
    font-size: 14px;
    padding: 8px 16px;
  }

  /* Countdown 3-2-1 Mulai */
  .countdown-img {
    height: clamp(90px, 28cqw, 150px);
  }
  .countdown-img.is-mulai {
    height: clamp(55px, 17cqw, 95px);
  }

  /* Dialogs */
  dialog {
    width: calc(100% - 16px);
    max-width: none;
    max-height: 90dvh;
    padding: 16px 12px;
    border-radius: 14px;
    margin: auto;
  }
  .dialog-heading h2 {
    font-size: 19px;
  }
  .close-button {
    width: 30px;
    height: 30px;
    font-size: 22px;
  }
  .dialog-note {
    font-size: 13px;
  }
  .instructions {
    padding-left: 18px;
    font-size: 13.5px;
  }
  .instructions li {
    margin-bottom: 8px;
  }
  .report-summary-card {
    gap: 6px;
    padding: 6px 10px;
    margin: 6px 0 10px;
  }
  .report-summary-stat {
    font-size: 10px;
  }
  .report-summary-stat b {
    font-size: 15px;
  }
  .report-summary-badge {
    font-size: 11px;
    padding: 3px 8px;
  }
  .report-filters {
    gap: 5px;
    margin-bottom: 10px;
  }
  .report-filter-btn {
    padding: 4px 10px;
    font-size: 11.5px;
  }
  .report-item {
    padding: 12px 0 8px;
  }
  .report-item-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .report-illustration {
    width: 105px;
    height: 85px;
  }
  .report-body {
    width: 100%;
  }
  .report-item h3 {
    font-size: 14.5px;
  }
  .report-item p {
    font-size: 13.5px;
  }
  .report-item .explanation {
    font-size: 13px;
    padding: 8px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .report-item .explanation .katex-display {
    overflow-x: auto;
    max-width: 100%;
  }

  .game-footer {
    flex: none;
    padding: 4px 4px 6px;
    margin-top: auto;
    font-size: 11.5px;
  }
  .footer-credit {
    font-size: 11.5px;
  }
}

/* ==========================================================================
   EXTRA COMPACT MOBILE (<= 380px, e.g. iPhone SE, Galaxy A01)
   ========================================================================== */
@media (max-width: 380px) {
  .site-header-inner {
    padding: 0 6px;
    gap: 4px;
  }
  .brand {
    font-size: 18px;
  }
  .header-user-box {
    max-width: 105px;
    padding: 0 6px 0 5px;
  }
  .header-player-input {
    font-size: 11px;
    max-width: 75px;
  }
  .help-link > span,
  .header-icon-button {
    width: 30px;
    height: 30px;
  }

  .hud {
    min-height: 46px;
    padding: 3px 4px;
    gap: 3px;
  }
  .hud-stat {
    min-width: 38px;
    padding: 2px 3px;
  }
  .stat-value {
    font-size: 13.5px;
  }

  .question-box h2 {
    font-size: clamp(11.5px, 3.4cqw, 14px);
  }
  .answer-text {
    font-size: clamp(12px, 3.5cqw, 15px);
  }
  .answer-text.long-answer {
    font-size: clamp(10.5px, 2.9cqw, 13px);
  }
  .shape-option {
    font-size: 10px;
  }
  .shape-option .shape-icon {
    width: 28px;
    height: 24px;
  }
}

/* ==========================================================================
   MOBILE LANDSCAPE (Height <= 520px)
   ========================================================================== */
@media (max-height: 520px) and (orientation: landscape) {
  .site-header {
    height: 40px;
  }
  .site-header-inner {
    padding: 0 10px;
    gap: 8px;
  }
  .brand {
    font-size: 19px;
  }
  .brand-mark {
    width: 22px;
    height: 22px;
  }
  .header-user-box {
    height: 28px;
    max-width: 130px;
  }
  .page {
    padding: 4px 8px;
    min-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
  }
  .split-stage {
    flex: 1 1 auto;
    min-height: 0;
  }
  .game-board {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  .hud {
    min-height: 38px;
    padding: 2px 8px;
  }
  .hud h1 {
    font-size: 12.5px;
  }
  .hud-stat {
    min-width: 40px;
    padding: 1px 4px;
  }
  .stat-label {
    font-size: 7px;
  }
  .stat-value {
    font-size: 14px;
    line-height: 16px;
  }
  .pond {
    flex: 1 1 auto;
    min-height: 0;
    aspect-ratio: auto;
    max-height: calc(100dvh - 86px);
  }
  .question-box {
    top: 5px;
    left: 6px;
    right: 6px;
    height: clamp(52px, 22%, 70px);
    min-height: 48px;
    padding: 14px 10px 4px;
  }
  .question-counter {
    top: 2px;
    left: 5px;
    font-size: 8.5px;
    padding: 1px 5px;
  }
  .question-box h2 {
    font-size: clamp(11.5px, 1.8vw, 14.5px);
  }
  .question-illustration {
    width: 58px;
    height: 46px;
  }
  .answer-pad {
    width: 20%;
    height: 24%;
  }
  .pad-a { left: 24%; top: 48%; }
  .pad-b { left: 76%; top: 48%; }
  .pad-c { left: 24%; top: 76%; }
  .pad-d { left: 76%; top: 76%; }
  .home-pad {
    left: 50%;
    top: 90%;
    width: 20%;
    height: 22%;
  }
  .frog {
    left: 50%;
    top: 91%;
    width: 11%;
    height: 24%;
  }
  .game-controls {
    bottom: 5px;
    left: 8px;
    right: 8px;
  }
  .countdown {
    width: 40px;
    height: 40px;
  }
  .countdown > span {
    font-size: 16px;
  }
  .elapsed {
    font-size: 12.5px;
    min-width: 58px;
    padding: 2px 6px 2px 12px;
  }
  .icon-button {
    width: 32px;
    height: 32px;
  }
  .game-footer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition: none !important; }
  .pond-flash, .pond-shockwave, .life-lost-heart, .floating-score, .countdown-burst, .countdown-ripple { display: none !important; animation: none !important; }
  .pond-current::before { animation: none !important; }
  .countdown-stage.animate-pop, .countdown-stage.animate-mulai { animation: none !important; }
}
