/* Sticker-style cards with thick ink outlines on a daytime sky. */
:root {
  --sky: #C9ECFF; --sky2: #EAF8FF; --paper: #FFFDF5; --ink: #1F2A5C; --soft: #5B6594;
  --sun: #FFD23F; --coral: #FF6B6B; --mint: #3DDC97; --blue: #3A86FF; --grape: #9B5DE5; --lock: #E4E8F4;
  --display: "Baloo 2", "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Avenir Next", "Segoe UI", sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: linear-gradient(var(--sky), var(--sky2)) fixed; }
body {
  margin: 0; color: var(--ink); font: 600 17px/1.45 var(--body);
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
           max(32px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  -webkit-user-select: none; user-select: none;
}
.wrap, .screen { display: flex; flex-direction: column; gap: 20px; }
.wrap { max-width: 860px; margin: 0 auto; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
[hidden] { display: none !important; }

/* header */
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { font: 800 30px/1 var(--display); display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.logo svg { width: 52px; height: 52px; flex: none; }
.total { margin-left: auto; background: var(--paper); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 16px; font: 800 20px var(--display); }

/* buttons */
.btn {
  font: 800 20px/1.1 var(--display); color: var(--ink); background: var(--paper); border: 3px solid var(--ink);
  border-radius: 18px; padding: 12px 20px; box-shadow: 0 5px 0 var(--ink); cursor: pointer;
  transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 4px solid var(--grape); outline-offset: 3px; }
.btn:disabled { cursor: default; }
.btn.small { font-size: 17px; padding: 8px 14px; border-radius: 14px; }
.btn.sun { background: var(--sun); }
.btn.mint { background: var(--mint); }
.btn.on { background: var(--blue); color: var(--paper); }

/* home */
.hello { display: flex; align-items: center; gap: 14px; }
.hello svg { width: 84px; height: 84px; flex: none; animation: bob 2.4s ease-in-out infinite; }
.bubble { position: relative; background: var(--paper); border: 3px solid var(--ink); border-radius: 20px; padding: 12px 18px; font: 800 22px/1.2 var(--display); min-width: 0; }
.bubble::before { content: ""; position: absolute; left: -11px; top: 50%; width: 16px; height: 16px; background: var(--paper); border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateY(-50%) rotate(45deg); }
@keyframes bob { 50% { transform: translateY(-6px) rotate(4deg); } }

.tabs { display: flex; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.topic { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; min-height: 150px; }
.topic .ico { font-size: 40px; line-height: 1; }
.topic .name { font-size: 21px; }
.topic .strand { font: 600 13px var(--body); color: var(--soft); }
.topic .tag { margin-top: auto; font: 800 14px var(--body); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 10px; background: var(--sun); }
.topic:disabled { background: var(--lock); box-shadow: 0 5px 0 var(--soft); border-color: var(--soft); color: var(--soft); }
.topic:disabled .ico { filter: grayscale(1); opacity: .6; }
.topic:disabled .tag { background: transparent; border-color: var(--soft); }

/* topic screen */
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bar h2 { font-size: 30px; }
.chip { font: 800 15px var(--body); background: var(--grape); color: var(--paper); border-radius: 999px; padding: 3px 12px; }
.skills { display: flex; flex-direction: column; gap: 14px; }
.skill { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; background: var(--paper); border: 3px solid var(--ink); border-radius: 22px; padding: 14px 16px; box-shadow: 0 5px 0 var(--ink); }
.skill .num { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; font: 800 22px var(--display); background: var(--sun); }
.skill .txt { flex: 1 1 200px; min-width: 0; }
.skill h3 { font-size: 22px; }
.skill .moe { font-size: 13px; color: var(--soft); }
.skill .games { display: flex; gap: 10px; flex-wrap: wrap; }
.skill.locked { background: var(--lock); border-color: var(--soft); box-shadow: 0 5px 0 var(--soft); color: var(--soft); }
.skill.locked .num { background: transparent; border-color: var(--soft); }
.stars { letter-spacing: 1px; font-size: 15px; display: block; }
.stars i, .big i { font-style: normal; opacity: .22; }

/* where a question came from: PC = primary school, KS = KC Space */
.src { display: inline-block; margin-left: 6px; font: 800 12px/1 var(--body); letter-spacing: .04em; padding: 3px 7px; border: 2px solid var(--ink); border-radius: 8px; color: var(--ink); vertical-align: middle; }
.src-PC { background: var(--mint); }
.src-KS { background: var(--coral); }

/* play screen */
.play { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.play .bar { align-self: stretch; }
.dots { display: flex; gap: 8px; margin-left: auto; }
.dots i { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); }
.dots i.ok { background: var(--mint); }
.dots i.meh { background: var(--sun); }
.prompt { font-size: 28px; }
.prompt b { color: var(--coral); }
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; align-self: stretch; }
.answers { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.answers .btn { min-width: 130px; font-size: 24px; }
.answers .btn.no { background: var(--lock); color: var(--soft); animation: shake .35s; }
.answers .btn.yes { background: var(--mint); }
.answers .btn.shake { animation: shake .35s; }
.readout { font: 800 44px/1 var(--display); font-variant-numeric: tabular-nums; }
.say { min-height: 1.5em; font: 800 20px var(--display); }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.result .big { font-size: 64px; line-height: 1; }

/* clock */
.clockbox { width: min(100%, 320px); }
.clockbox.small { width: min(100%, 200px); }
.scene { font-size: 84px; line-height: 1.1; }
.pair { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 100%; }
.pair > div:not(.arrow) { flex: 0 1 200px; min-width: 0; }
.pair .arrow { font-size: 30px; }
.pair .cap { font: 800 17px var(--display); }
.clock { width: 100%; height: auto; display: block; }
.clock.drag { touch-action: none; cursor: grab; }
.clock text { font-family: var(--display); font-weight: 800; text-anchor: middle; dominant-baseline: central; }
.legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; font: 800 15px var(--body); }
.legend span::before { content: ""; display: inline-block; width: 22px; height: 7px; border-radius: 4px; margin-right: 6px; vertical-align: middle; background: var(--c); }

/* confetti layer */
#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#fx span { position: absolute; width: 12px; height: 12px; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  .hello svg, .answers .btn.no, .answers .btn.shake { animation: none; }
}
