/* Hoppitree: Math Summit game styles. Prefix every class with the game id. */

/* ---------- shared by the three Math Summit games ---------- */
.numberline-stage, .clock-stage, .coins-stage { gap: clamp(8px, 1.8vh, 18px); padding: clamp(10px, 2vh, 18px); }
.numberline-stage { background: linear-gradient(180deg, rgba(232, 250, 248, .85), rgba(196, 236, 240, .7)); }
.clock-stage { background: linear-gradient(180deg, rgba(240, 236, 255, .85), rgba(214, 208, 250, .7)); }
.coins-stage { background: linear-gradient(180deg, rgba(255, 250, 236, .96), rgba(255, 238, 204, .92)); }
.numberline-note, .clock-note, .coins-note { display: flex; align-items: center; gap: 16px; max-width: min(760px, 96%); background: #fff; border-left: 8px solid #3BC14A; border-radius: 18px; padding: 12px 18px; box-shadow: 0 10px 22px rgba(29, 43, 83, .16); }
.numberline-note p, .clock-note p, .coins-note p { flex: 1; margin: 0; font-size: clamp(17px, 2.2vw, 22px); font-weight: 500; line-height: 1.35; color: var(--ink); }
.numberline-note .btn, .clock-note .btn, .coins-note .btn { --c: #2E9E48; flex-shrink: 0; min-height: 64px; }
.numberline-hint, .clock-hint, .coins-hint { margin: 0; min-height: 1.35em; font-size: clamp(16px, 2vw, 20px); font-weight: 500; color: var(--ink-soft); text-align: center; }
.numberline-area, .clock-area, .coins-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(8px, 1.4vh, 14px); max-width: 100%; }
.choices.numberline-opts, .choices.clock-opts, .choices.coins-opts { gap: clamp(10px, 2vw, 22px); }
.choices.numberline-opts .choice, .choices.clock-opts .choice, .choices.coins-opts .choice { min-width: clamp(92px, 14vw, 150px); min-height: clamp(76px, 12vh, 116px); padding: 10px 14px; }
.choices.numberline-opts .choice:hover, .choices.clock-opts .choice:hover, .choices.coins-opts .choice:hover { transform: translateY(-4px); }
.choices.numberline-opts .big-num, .choices.coins-opts .big-num { font-size: clamp(32px, 5.4vh, 52px); }

/* ---------- Number Line Hop ---------- */
.numberline-eq { background: #fff; border-radius: 16px; padding: 4px 26px; font-size: clamp(30px, 5.6vh, 52px); font-weight: 700; color: var(--ink); box-shadow: 0 8px 18px rgba(29, 43, 83, .14); letter-spacing: .04em; }
.numberline-line { position: relative; flex-shrink: 0; width: min(100%, 1040px); max-height: 44vh; }
.numberline-draw, .numberline-draw svg { display: block; width: 100%; height: 100%; }
.numberline-axis { stroke: #1D2B53; stroke-width: 5; stroke-linecap: round; }
.numberline-tip, .numberline-dot { fill: #1D2B53; }
.numberline-tick { stroke: #1D2B53; stroke-width: 3; stroke-linecap: round; }
.numberline-num { fill: #4A5785; font-weight: 600; text-anchor: middle; }
.numberline-num.five { fill: #1D2B53; font-weight: 700; }
.numberline-num.here { fill: #0B7F8E; font-weight: 700; }
.numberline-ten { fill: #FFD23F; }
.numberline-arc { fill: none; stroke: #12A3B5; stroke-width: 4.5; stroke-linecap: round; }
.numberline-arc.back { stroke: #E8590C; }
.numberline-jump { fill: #0B7F8E; font-weight: 700; text-anchor: middle; }
.numberline-jump.back { fill: #C2410C; }
.numberline-hop { position: absolute; left: 0; width: 7.4%; min-width: 40px; transform: translateX(-50%); transition: left .32s cubic-bezier(.3, .1, .3, 1); pointer-events: none; line-height: 0; }
.numberline-hop .clu { width: 100%; height: auto; animation: none; }
.numberline-hop.jump .clu { animation: numberline-jump .34s ease-out; }
.numberline-area { min-height: clamp(110px, 19vh, 160px); }
.numberline-ctl { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(8px, 1.4vw, 14px); }
.numberline-btn { min-width: 76px; min-height: 66px; padding: 6px 14px; border: 0; border-radius: 18px; background: #12A3B5; color: #fff; font: 700 clamp(24px, 3.4vh, 30px) var(--font); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), 0 8px 16px rgba(29, 43, 83, .16); cursor: pointer; }
.numberline-btn.back { background: #E8590C; }
.numberline-btn:active { transform: translateY(3px); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18); }
.numberline-check, .clock-check, .coins-pay { --c: #2E9E48; min-height: 64px; }
.numberline-reset { --c: #7A86A8; min-height: 64px; }
@keyframes numberline-jump { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-46%) scale(1.04, .96); } }

/* ---------- Clock Tower ---------- */
.clock-top { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 1.2vh, 12px); }
.clock-face { display: block; flex-shrink: 0; width: clamp(180px, min(38vh, 62vw), 400px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 12px 16px rgba(29, 43, 83, .22)); }
.clock-face.clock-drag { touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.clock-face.clock-mini { width: clamp(92px, min(19vh, 25vw), 170px); filter: none; }
.clock-rim { fill: #4B3FB8; }
.clock-face.done .clock-rim { fill: #2E9E48; }
.clock-dial { fill: #fff; }
.clock-tick { stroke: #9AA5C4; stroke-width: 1.4; }
.clock-tick.five { stroke: #1D2B53; stroke-width: 3; }
.clock-num { fill: #1D2B53; font-size: 20px; font-weight: 700; text-anchor: middle; }
.clock-hh line { stroke: #1D2B53; stroke-width: 9; stroke-linecap: round; }
.clock-mh line { stroke: #E8573A; stroke-width: 5.5; stroke-linecap: round; }
.clock-cap { fill: #1D2B53; }
.clock-face.grab-h .clock-hh line, .clock-face.grab-m .clock-mh line { filter: drop-shadow(0 0 4px #FFD23F) drop-shadow(0 0 2px #FFB000); }
.clock-face.grab-h, .clock-face.grab-m { cursor: grabbing; }
.clock-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: clamp(14px, 1.9vh, 17px); font-weight: 600; }
.clock-legend span { background: #fff; border-radius: 999px; padding: 3px 12px; border: 2px solid currentColor; }
.clock-legend .h { color: #1D2B53; }
.clock-legend .m { color: #C2412A; }
.clock-area { min-width: min(100%, 300px); }
.clock-card { background: #fff; border-radius: 18px; padding: 6px 28px 8px; text-align: center; box-shadow: 0 8px 18px rgba(29, 43, 83, .14); border-bottom: 6px solid #D9D3FA; }
.clock-card small, .clock-pair small { display: block; font-size: clamp(15px, 2vh, 18px); font-weight: 600; color: var(--ink-soft); }
.clock-card b, .clock-card { font-size: clamp(34px, 6.4vh, 60px); font-weight: 700; color: #4B3FB8; line-height: 1.1; font-variant-numeric: tabular-nums; }
.clock-digital { font-size: clamp(26px, 4.6vh, 42px); font-weight: 700; color: #4B3FB8; white-space: nowrap; }
.choices.clock-picks .choice { padding: 8px; min-width: 0; }
.clock-pair { display: flex; gap: clamp(16px, 6vw, 70px); }
.clock-pair div { display: flex; flex-direction: column; align-items: center; gap: 4px; background: rgba(255, 255, 255, .8); border-radius: 18px; padding: 8px 14px; }
.clock-pair .clock-mini { width: clamp(110px, min(24vh, 32vw), 210px); }
.clock-pair b { font-size: clamp(22px, 3.4vh, 30px); color: #4B3FB8; }
.clock-scene { font-size: clamp(36px, 6vh, 56px); line-height: 1; }
@media (min-width: 900px) and (orientation: landscape) {
  .clock-stage { flex-direction: row; gap: clamp(24px, 6vw, 90px); }
  .clock-face { width: clamp(220px, min(50vh, 34vw), 420px); }
  .clock-area { flex: 0 1 460px; }
}

/* ---------- Coin Shop ---------- */
.coins-stage { --m0: clamp(2.5px, .45vmin, 3.6px); --mm: var(--m0); }
.coins-coin { display: block; flex-shrink: 0; width: calc(var(--d) * var(--mm)); height: calc(var(--d) * var(--mm)); filter: drop-shadow(0 3px 3px rgba(29, 43, 83, .28)); }
.coins-region { position: absolute; top: 8px; right: 10px; z-index: 3; min-height: 40px; padding: 4px 14px; border: 2px solid #D8C9A6; border-radius: 999px; background: rgba(255, 255, 255, .88); color: var(--ink-soft); font: 500 14px var(--font); cursor: pointer; }
.coins-region b { color: var(--ink); }
.coins-top { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(10px, 2vw, 26px); max-width: 100%; }
.coins-pile { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(5px, 1vw, 12px); max-width: 680px; }
.coins-pile.big { --mm: calc(var(--m0) * 1.9); }
.coins-pile.mini { --mm: calc(var(--m0) * .74); gap: 4px; max-width: 250px; }
.coins-pile.count { --mm: calc(var(--m0) * 1.15); background: rgba(255, 255, 255, .6); border-radius: 22px; padding: clamp(8px, 1.6vh, 16px); }
.coins-pile.count .coins-coin { cursor: pointer; transition: opacity .2s, transform .2s; }
.coins-pile.count .coins-coin.counted { opacity: .45; transform: scale(.9); }
.coins-total { flex-basis: 100%; align-self: center; text-align: center; font-size: clamp(18px, 2.6vh, 24px); font-weight: 700; color: #8A5200; }
.coins-item { display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff; border-radius: 20px; padding: 8px 18px 10px; box-shadow: 0 8px 18px rgba(29, 43, 83, .14); }
.coins-toy { font-size: clamp(44px, 8.5vh, 84px); line-height: 1.1; }
.coins-tag { background: #FFD23F; border-radius: 6px 14px 14px 6px; padding: 1px 14px; font-size: clamp(22px, 3.4vh, 30px); font-weight: 700; color: #1D2B53; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .12); }
.coins-paybox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: min(300px, 80vw); min-height: clamp(84px, 14vh, 130px); padding: 8px 12px; border: 3px dashed #D9B66B; border-radius: 18px; background: rgba(255, 255, 255, .62); }
.coins-paybox small { font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.coins-paid { border: 0; background: none; padding: 2px; cursor: pointer; }
.coins-tray { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(6px, 1.2vw, 14px); }
.coins-give { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 76px; min-height: 76px; padding: 6px 10px; border: 0; border-radius: 16px; background: #fff; box-shadow: inset 0 -5px 0 #EADFC4, 0 6px 14px rgba(29, 43, 83, .14); cursor: pointer; font: 600 clamp(14px, 1.9vh, 17px) var(--font); color: var(--ink); }
.coins-give:active { transform: translateY(3px); }
.coins-word { font-size: clamp(21px, 3.3vh, 30px); font-weight: 700; color: var(--ink); }
.choices.coins-opts .coins-coin { --mm: calc(var(--m0) * 1.25); }
.choices.coins-opts .coins-pile.mini .coins-coin { --mm: calc(var(--m0) * .74); }
.choices.coins-opts .choice { max-width: 46%; }

@media (max-width: 600px) {
  .numberline-note, .clock-note, .coins-note { flex-direction: column; gap: 8px; padding: 10px 14px; }
  .numberline-hop { width: 11%; }
  .numberline-btn { min-width: 66px; }
  .coins-region { top: 4px; right: 6px; }
  .coins-stage { padding-top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .numberline-hop { transition: none; }
  .numberline-hop.jump .clu { animation: none; }
}
