/* Digi's Time Quest — components on top of the shared Place Value Quest design system (css/game.css).
   Meaning colours: seconds = yellow (--c0), minutes = green (--c1), hours = blue (--c2), days = purple (--c3),
   weeks = orange (--c4), months = pink (--c5), years = cyan (--c6). Every coloured thing also has a text label. */

/* ---------- clock ---------- */
.clock { width: min(340px, 78vw); aspect-ratio: 1; flex: none; filter: drop-shadow(0 10px 18px rgba(0,0,0,.35)); }
.clock.small { width: 150px; }
.clock-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.clock-svg.interactive { cursor: grab; touch-action: none; border-radius: 50%; }
.clock-svg.interactive:active { cursor: grabbing; }
.clock-svg .mlabel { transition: opacity .3s; }
.clock-svg .hand.pointed line { animation: pointed 1s ease-in-out infinite; }
@keyframes pointed { 50% { stroke-width: 15; filter: drop-shadow(0 0 6px #fff); } }
.clock-svg .num-ring { transition: stroke .2s; }
.clock-setter { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.clock-controls { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cc-group { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 14px; background: rgba(0,0,0,.25); }
.cc-group .btn { min-width: 48px; font-size: 22px; }
.cc-group.hour .cc-l { color: var(--c2); } .cc-group.minute .cc-l { color: var(--c1); }
.cc-l { font-weight: 900; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.readout { font-family: var(--display); font-size: 30px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; justify-content: center; }
.readout .rw { font-family: var(--font); font-size: 18px; color: var(--muted); }
.dg-h { color: var(--c2); } .dg-m { color: var(--c1); } .dg-s { color: var(--c0); }

/* ---------- digital + words + trio ---------- */
.digital { font-family: var(--display); font-size: clamp(44px, 7vw, 68px); line-height: 1; padding: 10px 18px; border-radius: 16px; background: #0a0f28; border: 3px solid #2a377c; letter-spacing: 2px; box-shadow: inset 0 0 20px rgba(0,0,0,.6); }
.digital .colon { color: var(--muted); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.words-card { background: #fff; color: #1a1f3c; border-radius: 14px; padding: 10px 16px; font-size: 22px; font-weight: 900; text-align: center; }
.trio { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.trio-side { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.big-count { font-family: var(--display); font-size: clamp(24px, 4vw, 34px); text-align: center; min-height: 1.2em; }

/* ---------- timeline ---------- */
.timeline { width: 100%; max-width: 760px; display: flex; flex-direction: column; align-items: center; }
.timeline-svg { width: 100%; height: auto; overflow: visible; }
.tl-total { font-family: var(--display); font-size: 24px; color: var(--c1); min-height: 1.2em; text-align: center; }
.jumplog { font-family: var(--display); font-size: 20px; text-align: center; }
.jumpbtns { justify-content: center; }

/* ---------- stopwatch ---------- */
.stopwatch { display: flex; gap: 18px; align-items: center; justify-content: center; flex-wrap: wrap; }
.stopwatch-svg { width: min(220px, 55vw); }
.sw-read { font-family: var(--display); font-size: 48px; }
.sw-laps { display: flex; gap: 6px; flex-wrap: wrap; max-width: 220px; }
.lap { background: var(--c1); color: #062a17; border-radius: 10px; padding: 3px 8px; font-weight: 900; font-size: 14px; }

/* ---------- ladder ---------- */
.ladder { display: flex; flex-direction: column-reverse; gap: 6px; width: min(520px, 100%); }
.rung { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--u) 22%, #1d2862); border-left: 8px solid var(--u); transition: opacity .3s, transform .2s; }
.rung.hidden { opacity: 0; transform: translateX(-12px); }
.rung.on { outline: 3px solid #fff; }
.rname { font-family: var(--display); font-size: 21px; color: var(--u); }
.rrel { font-size: 16px; }

/* ---------- unit bar (60 blocks) ---------- */
.ubar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.ubar { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; width: min(560px, 100%); padding: 8px; border-radius: 14px; background: rgba(0,0,0,.25); transition: background .6s; }
.ubar .ucell { aspect-ratio: 1 / 1.3; border-radius: 4px; background: rgba(255,255,255,.08); transition: background .2s, transform .2s; }
.ubar { grid-template-columns: repeat(12, 1fr); }
.ubar .ucell.on { background: var(--u); transform: scale(1.04); }
.ubar.fused { background: var(--u2); }
.ubar.fused .ucell { background: transparent !important; }
.ucount { font-family: var(--display); font-size: 26px; }

/* ---------- events / day ---------- */
.events { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.ev { position: relative; display: flex; flex-direction: column; align-items: center; padding: 8px 10px; min-width: 84px; border-radius: 14px; background: var(--panel2); border: 1px solid var(--line); }
.ev-e { font-size: 34px; }
.ev-l { font-size: 14px; text-align: center; }
.ev-n { position: absolute; top: -8px; left: -8px; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #111; font-family: var(--display); display: grid; place-items: center; font-size: 14px; }
.ev-arrow { color: var(--muted); font-size: 20px; transition: opacity .3s; }
.daysky { position: relative; width: 100%; max-width: 760px; height: 140px; border-radius: 20px; background: linear-gradient(180deg, #2a4a9a, #1b2463); overflow: hidden; }
.daysky .sun { position: absolute; font-size: 38px; transform: translate(-50%, -50%); transition: left .7s, top .7s; left: 5%; top: 60%; }
.daytok { position: absolute; bottom: 4px; width: 56px; transition: left .7s; left: 3%; }

/* ---------- order / explain / multi / number ---------- */
.order { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.order-slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.oslot { min-width: 110px; min-height: 72px; border-radius: 14px; border: 3px dashed rgba(255,255,255,.3); background: rgba(0,0,0,.2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 8px; }
.oslot.filled { border-style: solid; border-color: var(--accent); background: rgba(255,200,61,.12); }
.oslot.bad { border-color: var(--warm); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.oslot .on { font-size: 11px; color: var(--muted); }
.oslot .ol { font-size: 12px; color: var(--accent); text-transform: uppercase; font-weight: 900; }
.oslot .ov { font-weight: 900; font-size: 16px; }
.oarrow { color: var(--muted); }
.order-tray, .ecards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.oitem.used, .ecard.used { opacity: .3; }
.small-note { font-size: 14px; text-align: center; }
.multi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: min(520px, 100%); }
.mchip { min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel2); color: #fff; font-weight: 900; font-size: 18px; cursor: pointer; }
.mchip.on { background: var(--accent); color: #2b1d00; border-color: #fff; }
.mchip.right { outline: 3px solid var(--good); }
@media (max-width: 560px) { .multi { grid-template-columns: repeat(4, 1fr); } }
.explain { display: flex; flex-direction: column; gap: 14px; align-items: center; width: 100%; }
.explain-eq { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.eslot { min-width: 150px; max-width: 220px; min-height: 64px; border-radius: 14px; border: 3px dashed rgba(255,255,255,.3); background: rgba(0,0,0,.2); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; padding: 6px 10px; }
.eslot.filled { border-style: solid; border-color: var(--good); background: rgba(61,220,151,.12); }
.eqop { font-family: var(--display); font-size: 26px; color: var(--muted); }
.eresult { font-family: var(--display); font-size: 22px; background: #fff; color: #1a1f3c; padding: 8px 14px; border-radius: 12px; }
.ecard { border-radius: 12px; padding: 10px 14px; background: var(--panel2); border: 2px solid var(--line); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; max-width: 260px; text-align: left; }
.npad { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.npad-disp { font-family: var(--display); font-size: 40px; min-width: 160px; text-align: center; padding: 4px 14px; border-radius: 12px; background: #0a0f28; border: 3px solid #2a377c; }
.npad-disp.empty { color: var(--muted); }
.npad-keys { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; }
.npk { height: 52px; border-radius: 12px; border: 0; background: var(--panel2); color: #fff; font-family: var(--display); font-size: 24px; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.3); }
.npk:active { transform: translateY(2px); box-shadow: none; }

/* ---------- picture choices (mini clocks) ---------- */
.choices.pictures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice.picture { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; }
.choice.picture .clock.small { width: min(150px, 26vw); }
.plabel { font-weight: 900; font-size: 15px; }

/* ---------- week ---------- */
.week { position: relative; width: 100%; max-width: 760px; padding-top: 58px; }
.week-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px; border-radius: 12px; background: color-mix(in srgb, var(--c3) 30%, #1d2862); border: 2px solid transparent; transition: opacity .3s, transform .2s; }
.day.weekend { background: color-mix(in srgb, var(--c4) 35%, #1d2862); }
.day.today { border-color: var(--accent); }
.day.hop { transform: translateY(-6px); }
.day .dn { font-family: var(--display); font-size: 20px; }
.day .tag { font-size: 11px; color: var(--accent); font-weight: 900; text-transform: uppercase; }
.hopper { position: absolute; top: 0; width: 52px; transform: translateX(-50%); transition: left .35s cubic-bezier(.3,1.6,.5,1); }
.ytt { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.ytt-c { display: flex; flex-direction: column; align-items: center; padding: 10px 16px; border-radius: 14px; background: var(--panel2); transition: opacity .3s; }
.ytt-c b { font-family: var(--display); font-weight: 400; color: var(--accent); font-size: 20px; }

/* ---------- calendar ---------- */
.calendar { width: min(440px, 100%); background: #fbf7ec; color: #1d2340; border-radius: 18px; padding: 12px; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.cal-head { display: flex; gap: 10px; align-items: baseline; padding: 4px 6px 10px; border-bottom: 4px solid var(--c5); margin-bottom: 8px; }
.cal-m { font-family: var(--display); font-size: 26px; color: #b0164a; }
.cal-y { font-weight: 900; color: #5a6080; }
.cal-n { margin-left: auto; font-size: 14px; font-weight: 900; color: #5a6080; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 900; color: #6a3fb0; padding: 2px 0; }
.cal-wd.we { color: #c25a10; }
.cal-d { text-align: center; padding: 6px 0; border-radius: 8px; background: #ece6d6; font-weight: 800; font-size: 15px; border: 0; color: inherit; }
.cal-d.we { background: #f6dcc6; }
.cal-d.hl { background: var(--accent); outline: 3px solid #1d2340; }
.calnav .calnow { font-family: var(--display); font-size: 20px; min-width: 170px; text-align: center; }
.mlengths { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; width: min(520px, 100%); height: 150px; }
.mlen { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 3px; }
.mbar { width: 100%; height: var(--hpct); min-height: 30px; background: var(--s); border-radius: 6px 6px 2px 2px; display: flex; justify-content: center; color: #1d2340; font-weight: 900; font-size: 13px; padding-top: 3px; }
.mlbl { font-size: 11px; color: var(--muted); }

/* ---------- year wheel + orbit ---------- */
.wheel { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wheel-svg { width: min(340px, 80vw); touch-action: none; cursor: grab; }
.wheel-label { font-size: 20px; display: flex; gap: 10px; align-items: center; }
.chainline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.chip.static { cursor: default; }
.chainline .arrow { color: var(--muted); }
.orbit { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.orbit-svg { width: min(460px, 100%); background: radial-gradient(circle at 50% 50%, #1b2463, #050816); border-radius: 20px; }
.orbit-side { display: flex; flex-direction: column; gap: 10px; max-width: 280px; }
.orbit-caption { font-size: 16px; }
.orbit-bars { display: flex; flex-direction: column; gap: 6px; }
.ob span { font-size: 13px; color: var(--muted); }
.obt { height: 12px; border-radius: 8px; background: rgba(255,255,255,.1); overflow: hidden; }
.obf { height: 100%; background: var(--accent); transition: width .2s; }
.obf.dayb { background: var(--c2); }
.note { font-size: 14px; color: var(--muted); background: rgba(0,0,0,.25); border-radius: 12px; padding: 10px 12px; }

/* ---------- Digi says ---------- */
.digi-says { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ds-row { display: flex; align-items: center; gap: 10px; }
.ds-digi { width: 76px; flex: none; animation: bob 2.4s ease-in-out infinite; }
.ds-bubble { background: #fff; color: #1a1f3c; border-radius: 18px 18px 18px 4px; padding: 10px 14px; font-size: 19px; font-weight: 800; max-width: 340px; }

/* ---------- many forms ---------- */
.many-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: 100%; }
.form { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: .15; transition: opacity .4s, transform .4s; transform: translateY(8px); }
.form.show { opacity: 1; transform: none; }
.form .fl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 900; }
.form .fv { display: flex; justify-content: center; width: 100%; }
.form .clock { width: 140px; }
.form .digital { font-size: 38px; }
.form .words-card { font-size: 17px; }
.form:nth-child(4) { grid-column: span 2; }
.fraction { font-family: var(--display); font-size: 20px; text-align: center; }

/* ---------- remedies ---------- */
.remedy-host { width: 100%; display: flex; flex-direction: column; align-items: center; }
.remedy { width: 100%; background: rgba(0,0,0,.25); border: 2px solid rgba(255,181,71,.5); border-radius: 18px; padding: 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.remedy-title { font-family: var(--display); color: var(--warm); font-size: 18px; }
.remedy-cap { font-size: 17px; text-align: center; min-height: 2.6em; }
.remedy-row { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.remedy-col { display: flex; flex-direction: column; gap: 6px; align-items: center; width: 100%; }
.remedy .clock { width: min(250px, 60vw); }
.remedy .clock.small { width: 130px; }

/* ---------- activities ---------- */
.tcol { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.inline-q { width: 100%; }
.input-host { width: 100%; display: flex; justify-content: center; }
.fbhost { width: 100%; display: flex; justify-content: center; }
.quiz-top { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.quiz-host { width: 100%; display: flex; flex-direction: column; align-items: center; }
.bins { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; width: 100%; max-width: 820px; }
.bin { border: 3px solid var(--u); background: color-mix(in srgb, var(--u) 15%, #1d2862); border-radius: 16px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; color: #fff; }
.bin-h { font-family: var(--display); font-size: 20px; color: var(--u); }
.bin-b { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.binitem { background: rgba(255,255,255,.12); border-radius: 8px; padding: 2px 6px; font-weight: 900; font-size: 15px; }
.dbars { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 8px; }
.dbar { display: grid; grid-template-columns: 1.4fr 2fr 70px; gap: 8px; align-items: center; font-size: 14px; }
.dtrack { height: 14px; background: rgba(0,0,0,.2); border-radius: 8px; overflow: hidden; }
.dfill { height: 100%; width: 0; background: var(--u); border-radius: 8px; transition: width 1.2s ease; }
.dbars.go .dfill { width: var(--w); }
.du { font-weight: 900; }
.qtable { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.qrow { display: grid; grid-template-columns: 90px 1fr 1.4fr; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--panel2); animation: pop .25s; }
.qrow.eqn { display: block; text-align: center; background: rgba(54,210,122,.15); }
.qf { font-family: var(--display); font-size: 22px; color: var(--c1); }
.qm { font-weight: 900; }
.runner { width: 60px; }
.questhead { display: flex; gap: 14px; align-items: center; width: 100%; flex-wrap: wrap; justify-content: center; }
.questpath { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; flex: 1; }
.qstation { display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--panel); border: 2px solid var(--line); min-width: 70px; font-size: 12px; }
.qstation .qs-i { font-size: 22px; }
.qstation.now { border-color: var(--accent); animation: bob 1.6s ease-in-out infinite; }
.qstation.done { background: rgba(61,220,151,.2); border-color: var(--good); }
.crystal { --fill: 0%; width: 70px; height: 100px; clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); background: rgba(255,255,255,.12); position: relative; flex: none; }
.crystal-fill { position: absolute; left: 0; right: 0; bottom: 0; height: var(--fill); background: linear-gradient(180deg, #9ff3f6, #19D3DA); transition: height .6s; }
.crystal.whole { animation: pulse-c 1.4s infinite; }
@keyframes pulse-c { 50% { filter: drop-shadow(0 0 18px #9ff3f6) brightness(1.3); } }

/* parent area extras */
.parent .group h3 { margin: 14px 0 6px; font-size: 18px; }
.insights { margin-top: 10px; padding: 10px 14px; border-radius: 12px; background: #eef6ff; }
.insights p { margin: 4px 0; font-weight: 800; }

/* ---------- desktop two-column + short laptop screens ---------- */
@media (min-width: 900px) {
  .split-main .clock { width: min(320px, 34vw, 52vh); }
  .split-main .clock.small { width: 140px; }
  .qcard-split .split-main .clock { width: min(300px, 30vw, 46vh); }
  .split-side .choices.pictures .clock.small { width: 110px; }
}
@media (min-width: 900px) and (max-height: 820px) {
  .clock { width: min(260px, 40vh); }
  .split-main .clock, .qcard-split .split-main .clock { width: min(260px, 42vh); }
  .clock.small, .choice.picture .clock.small { width: min(120px, 18vh); }
  .remedy .clock { width: min(190px, 30vh); }
  .digital { font-size: 44px; padding: 6px 14px; }
  .words-card { font-size: 18px; padding: 6px 12px; }
  .readout { font-size: 24px; }
  .cc-group .btn { min-height: 38px; min-width: 40px; padding: 4px 10px; }
  .daysky { height: 100px; }
  .ev { min-width: 70px; padding: 6px 8px; } .ev-e { font-size: 26px; }
  .calendar { padding: 8px; } .cal-d { padding: 3px 0; font-size: 13px; }
  .wheel-svg { width: min(280px, 46vh); }
  .orbit-svg { width: min(400px, 100%); }
  .stopwatch-svg { width: min(170px, 30vh); }
  .rung { padding: 4px 10px; } .rname { font-size: 18px; }
  .oslot { min-height: 58px; }
  .remedy-cap { font-size: 15px; min-height: 2.4em; }
  .form .clock { width: 110px; }
}
@media (max-width: 560px) {
  .rung { grid-template-columns: 80px 1fr; }
  .rrel { font-size: 14px; }
  .oslot { min-width: 84px; }
  .qrow { grid-template-columns: 70px 1fr; } .qrow .qw { grid-column: 1 / -1; }
  .dbar { grid-template-columns: 1fr 1fr; } .dbar .du { display: none; }
  .day .dn { font-size: 15px; }
  .form:nth-child(4) { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) { .hopper, .daysky .sun, .daytok, .dfill { transition: none; } }
/* keep the question counter / 🔊 button clear of the prompt */
@media (min-width: 900px) { .qcard-split .split-side { padding-top: 30px; } }
.split-main .clock.small, .remedy .clock.small { width: 140px; }
@media (min-width: 900px) and (max-height: 820px) {
  .split-main .clock.small, .remedy .clock.small { width: min(110px, 20vh); }
  .remedy { gap: 4px; padding: 6px 10px; }
  .remedy .timeline-svg { max-height: 26vh; }
}
a.btn { text-decoration: none; }
