/* Brainlag Learn kit: styles for learn-kit.js. Theme it by setting the --blk-* tokens on :root or any container
 * (each site maps them to its own palette; defaults are Brainlag's). Transform and opacity only for motion. */
:root {
  --blk-ink: #0e1c2c; --blk-ink-2: #33475b; --blk-face: #ffffff; --blk-edge: #cfc3ab;
  --blk-accent: #0d9aa7; --blk-accent-edge: #07646d; --blk-accent-ink: #04161c; --blk-accent-tint: #d7efef;
  --blk-ok: #0e6b3f; --blk-ok-fill: #20a067; --blk-ok-edge: #0b6a3f; --blk-ok-ink: #04210f; --blk-ok-bg: #dff2e7;
  --blk-bad: #c0332c; --blk-bad-fill: #ff8f86; --blk-bad-ink: #3a0d10; --blk-bad-bg: #fbe7e4;
  --blk-track: #e4d9c3; --blk-fill: #0d9aa7; --blk-combo: #b8640a;
  --blk-radius: 12px; --blk-lip: 4px;
}
:root[data-theme="dark"] {
  --blk-ink: #f2f6fb; --blk-ink-2: #c0cfdf; --blk-face: #1a3050; --blk-edge: #0a1626;
  --blk-accent-tint: #0b3943; --blk-ok: #45d69c; --blk-ok-bg: #0d3330; --blk-bad: #ff8f86; --blk-bad-bg: #3a1620;
  --blk-track: #1a3050; --blk-combo: #ffb44d;
}
.blk-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* keycap: a lip in the button's own darker shade; the face drops onto it when pressed, springs back on release */
.blk-key { --edge: var(--blk-edge); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px var(--blk-lip); border: 0; border-radius: var(--blk-radius); background: var(--blk-face); color: var(--blk-ink); box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 calc(-1 * var(--blk-lip)) 0 var(--edge); font-family: inherit; font-weight: 650; font-size: 17px; line-height: 1; cursor: pointer; transition: transform .09s cubic-bezier(.34,1.56,.64,1), box-shadow .09s cubic-bezier(.34,1.56,.64,1); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.blk-key:active { transform: translateY(calc(var(--blk-lip) - 1px)); box-shadow: inset 0 0 0 1.5px var(--edge), inset 0 -1px 0 var(--edge); transition-duration: 0s; }
.blk-key.is-ok { --edge: var(--blk-ok-edge); background: var(--blk-ok-fill); color: var(--blk-ok-ink); box-shadow: inset 0 calc(-1 * var(--blk-lip)) 0 var(--edge); }
.blk-key.is-ok:active { box-shadow: inset 0 -1px 0 var(--edge); }

/* answer tiles */
.blk-tile { --edge: var(--blk-edge); display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px calc(12px + var(--blk-lip)); border: 0; border-radius: var(--blk-radius); background: var(--blk-face); color: var(--blk-ink); box-shadow: inset 0 0 0 2px var(--edge), inset 0 calc(-1 * var(--blk-lip)) 0 var(--edge); font-family: inherit; font-weight: 600; font-size: 17px; line-height: 1.35; text-align: left; cursor: pointer; transition: transform .09s cubic-bezier(.34,1.56,.64,1), box-shadow .12s ease, background-color .12s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.blk-tile:active { transform: translateY(calc(var(--blk-lip) - 1px)); box-shadow: inset 0 0 0 2px var(--edge), inset 0 -1px 0 var(--edge); transition-duration: 0s; }
.blk-tile[aria-pressed="true"] { --edge: var(--blk-accent); background: var(--blk-accent-tint); }
.blk-tile.is-right { --edge: var(--blk-ok-fill); background: var(--blk-ok-bg); }
.blk-tile.is-wrong { --edge: var(--blk-bad); background: var(--blk-bad-bg); }
.blk-tile:disabled { cursor: default; }

/* the feedback sheet */
.blk-sheet { position: relative; z-index: 8; }
.blk-sheet-in { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.blk-sheet-mark { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 50%; }
.blk-sheet-mark svg { width: 24px; height: 24px; }
.blk-sheet-text { flex: 1 1 auto; min-width: 0; }
.blk-sheet-h { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 700; }
.blk-sheet-d { margin: 3px 0 0; font-size: 15px; line-height: 1.4; }
.blk-sheet-act { flex: none; }
.blk-sheet-go { min-width: 150px; }
.blk-sheet.is-ok { background: var(--blk-ok-bg); color: var(--blk-ok); }
.blk-sheet.is-no { background: var(--blk-bad-bg); color: var(--blk-bad); }
.blk-sheet.is-ok .blk-sheet-mark { background: var(--blk-ok-fill); color: var(--blk-ok-ink); }
.blk-sheet.is-no .blk-sheet-mark { background: var(--blk-bad-fill); color: var(--blk-bad-ink); }

/* progress bar: fill by transform, a bump, a sheen */
.blk-bar { position: relative; display: block; height: 14px; overflow: hidden; border-radius: 7px; background: var(--blk-track); }
.blk-bar-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--blk-fill); transform-origin: 0 50%; transform: scaleX(0); }
.blk-bar-fill::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.blk-bar-sheen { position: absolute; top: 0; bottom: 0; left: 0; width: 26px; background: rgba(255, 255, 255, .55); opacity: 0; pointer-events: none; }

/* combo counter: a drawn spark and "n in a row" */
.blk-combo { display: inline-flex; align-items: center; gap: 5px; color: var(--blk-combo); font-family: inherit; font-weight: 700; font-size: 15px; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; transform-origin: 50% 60%; }
.blk-combo svg { width: 18px; height: 18px; flex: none; }

/* confetti */
.blk-confetti { position: fixed; inset: 0; z-index: 400; overflow: hidden; pointer-events: none; contain: strict; }
.blk-cf { position: absolute; display: block; opacity: 0; will-change: transform, opacity; }
.blk-cf-r { width: 11px; height: 6px; border-radius: 2px; }
.blk-cf-d { width: 8px; height: 8px; border-radius: 50%; }
.blk-cf-s { width: 18px; height: 10px; }
.blk-cf-k { width: 12px; height: 12px; }
.blk-cf svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* the sound switch */
.blk-sound { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--blk-ink-2); cursor: pointer; }
.blk-sound svg { width: 22px; height: 22px; }
.blk-sound .blk-snd-on, .blk-sound.is-on .blk-snd-off { display: none; }
.blk-sound.is-on .blk-snd-on { display: inline; }
.blk-sound.is-on { color: var(--blk-accent); }

/* the streak flame (v1.3): size it with width or font-size (1em wide by default); states .is-lit, .is-out, .is-frozen.
   Layers: -o outer, -s flank, -m middle, -b teal hot base, -c core, -hi highlight, -line the navy outline on top,
   -spark the ember, -frost the rest-day crystals. The idle flicker is SMIL inside the SVG (learn-kit.js adds it only
   while lit and motion is allowed). Size tiers come from a container query: at 30px or less the outline is heavier and
   the small details drop out, so it reads at 16 and 24px. */
:root {
  --blk-fl-line: #15365a; --blk-fl-o: #ff7a3d; --blk-fl-s: #f0602e; --blk-fl-m: #ffc23d; --blk-fl-c: #fff2cc; --blk-fl-b: #3fe0c5; --blk-fl-spark: #ffc23d;
  --blk-fl-out-o: #c3ccd4; --blk-fl-out-s: #b2bcc6; --blk-fl-out-m: #dde3e8; --blk-fl-out-c: #f2f5f7;
  --blk-fl-ice-o: #9cc9ec; --blk-fl-ice-s: #86b9e2; --blk-fl-ice-m: #cfe8fa; --blk-fl-ice-c: #ffffff;
}
:root[data-theme="dark"] { --blk-fl-out-o: #7d8b99; --blk-fl-out-s: #6e7c8a; --blk-fl-out-m: #a3afbb; --blk-fl-out-c: #d0d8e0; }
.blk-flame { position: relative; display: inline-block; width: 1em; aspect-ratio: 120 / 140; line-height: 0; vertical-align: -.18em; container-type: inline-size; }
.blk-flame svg { display: block; width: 100%; height: 100%; overflow: visible; }
.blk-fl-o { fill: var(--blk-fl-o); transition: fill .22s; }
.blk-fl-s { fill: var(--blk-fl-s); transition: fill .22s; }
.blk-fl-m { fill: var(--blk-fl-m); transition: fill .22s; }
.blk-fl-b { fill: var(--blk-fl-b); transition: fill .22s; }
.blk-fl-c { fill: var(--blk-fl-c); transition: fill .22s; }
.blk-fl-hi { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .7; }
.blk-fl-line { fill: none; stroke: var(--blk-fl-line); stroke-width: 4.5; stroke-linejoin: round; }
.blk-fl-spark { display: none; fill: var(--blk-fl-spark); stroke: var(--blk-fl-line); stroke-width: 2.6; stroke-linejoin: round; }
.blk-fl-frost { display: none; fill: #fff; stroke: var(--blk-fl-line); stroke-width: 2.2; stroke-linejoin: round; }
.blk-flame.is-lit .blk-fl-spark { display: inline; }
.blk-flame.is-out .blk-fl-o, .blk-flame.is-out .blk-fl-b { fill: var(--blk-fl-out-o); }
.blk-flame.is-out .blk-fl-s { fill: var(--blk-fl-out-s); }
.blk-flame.is-out .blk-fl-m { fill: var(--blk-fl-out-m); }
.blk-flame.is-out .blk-fl-c { fill: var(--blk-fl-out-c); }
.blk-flame.is-frozen .blk-fl-o, .blk-flame.is-frozen .blk-fl-b { fill: var(--blk-fl-ice-o); }
.blk-flame.is-frozen .blk-fl-s { fill: var(--blk-fl-ice-s); }
.blk-flame.is-frozen .blk-fl-m { fill: var(--blk-fl-ice-m); }
.blk-flame.is-frozen .blk-fl-c { fill: var(--blk-fl-ice-c); }
.blk-flame.is-frozen .blk-fl-frost { display: inline; }
@container (max-width: 64px) { .blk-fl-line { stroke-width: 6.5; } .blk-fl-spark { stroke-width: 3.6; } }
@container (max-width: 30px) {
  .blk-fl-line { stroke-width: 11; }
  .blk-fl-s, .blk-fl-b, .blk-fl-hi, .blk-flame:is(.is-lit, .is-out, .is-frozen) :is(.blk-fl-spark, .blk-fl-frost) { display: none; }
}
/* the rest-day crystals twinkle (opacity only) */
.blk-flame.is-frozen:not(.is-still) .blk-fl-frost path { animation: blkFrost 2.4s ease-in-out infinite alternate; }
.blk-flame.is-frozen:not(.is-still) .blk-fl-frost path:nth-child(2) { animation-delay: -.8s; }
.blk-flame.is-frozen:not(.is-still) .blk-fl-frost path:nth-child(3) { animation-delay: -1.6s; }
@keyframes blkFrost { from { opacity: .35; } to { opacity: 1; } }
.blk-fl-ring { position: absolute; left: 50%; top: 58%; width: 120%; aspect-ratio: 1; margin: -60% 0 0 -60%; border-radius: 50%; border: 4px solid var(--blk-fl-m); opacity: 0; pointer-events: none; }
.blk-fl-ember { position: absolute; left: 50%; top: 60%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--blk-fl-o); box-shadow: 0 0 0 1.5px var(--blk-fl-line); opacity: 0; pointer-events: none; }
.blk-fl-ember.is-gold { background: var(--blk-fl-m); width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; }

@media (prefers-reduced-motion: reduce) {
  .blk-confetti { display: none; }
  .blk-key, .blk-tile { transition: none; }
  .blk-flame .blk-fl-frost path { animation: none !important; }
}
html[data-motion="off"] .blk-flame .blk-fl-frost path { animation: none !important; }

/* controls are for tapping, not selecting: no text selection, no long-press callout, no grey tap flash */
.blk-key, .blk-tile, .blk-sheet, .blk-combo, .blk-sound, .blk-bar, .blk-flame { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
