/* Pattern Lab (Quest 2). Stream Quest "Neel aur Haldi, soft": indigo and turmeric on cotton white, Anek and Mukta.
   Fonts are self-hosted from /fonts (Latin only: the rupee sign falls back to the phone's own font). */
@font-face { font-family: "Anek Latin"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(/fonts/anek-latin-latin.woff2) format("woff2"); }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/mukta-400-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }
@font-face { font-family: "Mukta"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/mukta-600-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2122, U+2212; }

:root {
  --paper: #f7f7f3; --card: #ffffff; --ink: #252a48; --muted: #5e6382; --line: #e2e3ec;
  --indigo: #3a4699; --on-indigo: #ffffff; --indigo-soft: #eceefa;
  --haldi: #f2c14e; --haldi-ink: #8a5f00; --haldi-soft: #fbf2d8;
  --sindoor: #b5543f; --sindoor-soft: #f6e3dc; --good: #2f7a55; --good-soft: #e1f1e8;
  --lamp-off: #d9dbe8; --lamp-white: #fbfaf3; --lamp-gold: #f2c14e; --lamp-ring: #b9bdd6;
  --fig: #3a4699; --fig-fill: #3a4699;
  --scrim: rgba(37, 42, 72, .38);
  --shadow: 0 1px 2px rgba(37, 42, 72, .06), 0 18px 40px -22px rgba(37, 42, 72, .35);
  --font-display: "Anek Latin", system-ui, sans-serif;
  --font-body: "Mukta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #13152b; --card: #1b1e38; --ink: #e9eaf5; --muted: #a6aac6; --line: #2b2f4f;
  --indigo: #a5aef3; --on-indigo: #161a3d; --indigo-soft: #242956;
  --haldi: #f2c14e; --haldi-ink: #f2c14e; --haldi-soft: #352f1c;
  --sindoor: #f0a38f; --sindoor-soft: #3d2622; --good: #8fd3ad; --good-soft: #1d3329;
  --lamp-off: #2f3456; --lamp-white: #d9dcf0; --lamp-gold: #f2c14e; --lamp-ring: #4a5080;
  --fig: #b7bef5; --fig-fill: #b7bef5;
  --scrim: rgba(5, 6, 18, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .7);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --paper: #13152b; --card: #1b1e38; --ink: #e9eaf5; --muted: #a6aac6; --line: #2b2f4f;
  --indigo: #a5aef3; --on-indigo: #161a3d; --indigo-soft: #242956;
  --haldi: #f2c14e; --haldi-ink: #f2c14e; --haldi-soft: #352f1c;
  --sindoor: #f0a38f; --sindoor-soft: #3d2622; --good: #8fd3ad; --good-soft: #1d3329;
  --lamp-off: #2f3456; --lamp-white: #d9dcf0; --lamp-gold: #f2c14e; --lamp-ring: #4a5080;
  --fig: #b7bef5; --fig-fill: #b7bef5;
  --scrim: rgba(5, 6, 18, .6);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -22px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; text-wrap: balance; margin: 0; }
p { margin: 0; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
a { color: var(--indigo); }
:focus-visible { outline: 3px solid var(--haldi); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* The picture fills the whole window; the game itself is one phone-width column in the middle. */
.app { position: relative; height: 100dvh; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; background: var(--paper); }
@supports (height: 100dvh) { .app { min-height: 0; } }
.view { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 480px; margin: 0 auto; min-height: 0; outline: none; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pad { padding: max(14px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }

.topbar { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 6px max(14px, env(safe-area-inset-left, 0px)); }
.topbar .title { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; flex: 1; min-width: 0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px; background: color-mix(in srgb, var(--paper) 78%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.brand-mark { width: 20px; height: 20px; border-radius: 6px; background: var(--indigo); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--haldi); right: 3.5px; top: 3.5px; }
.count { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--indigo-soft); color: var(--indigo); }
.chip.haldi { background: var(--haldi-soft); color: var(--haldi-ink); }
.chip.good { background: var(--good-soft); color: var(--good); }
.chip.low { background: var(--sindoor-soft); color: var(--sindoor); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eyebrow { font-size: 12.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; color: var(--haldi-ink); }
.small { font-size: 13.5px; color: var(--muted); }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 13px 16px; font-weight: 600; font-size: 16px; cursor: pointer; background: var(--indigo); color: var(--on-indigo); text-align: center; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: var(--card); color: var(--indigo); border: 1px solid var(--line); }
.btn.haldi { background: var(--haldi); color: #2b2205; }
.btn:not(:disabled):active { transform: scale(.985); }
.link { background: none; border: 0; color: var(--indigo); font-weight: 600; cursor: pointer; padding: 10px 6px; font-size: 14.5px; }
.link:disabled { color: var(--muted); cursor: default; }
.stack { display: grid; gap: 8px; }

/* Lamps: one per core puzzle, gold when solved and soft white otherwise. The bonus round lights the skylight. */
.lamps-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.lamps { display: flex; gap: 7px; align-items: center; }
.lamp { width: 15px; height: 15px; border-radius: 50%; background: var(--lamp-off); box-shadow: inset 0 0 0 1.5px var(--lamp-ring); position: relative; flex: none; }
.lamp.white { background: var(--lamp-white); box-shadow: inset 0 0 0 1.5px var(--lamp-ring), 0 0 0 3px color-mix(in srgb, var(--lamp-white) 35%, transparent); }
.lamp.gold { background: var(--lamp-gold); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--haldi-ink) 45%, transparent), 0 0 10px 1px color-mix(in srgb, var(--lamp-gold) 70%, transparent); }
.lamp.now { box-shadow: inset 0 0 0 2px var(--indigo); }
.lamps .gap { width: 6px; }
.lamps.sky { gap: 10px; }
.lamps.sky .lamp { width: 12px; height: 12px; border-radius: 3px; transform: rotate(45deg); }
.motion .lamp.lit { animation: lampOn .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes lampOn { from { transform: scale(.3); } }
.motion .lamps.sky .lamp.lit { animation-name: skyOn; }
@keyframes skyOn { from { transform: rotate(45deg) scale(.3); } to { transform: rotate(45deg); } }
.lamps-row > .lamps, .lamps-row > .meta { background: color-mix(in srgb, var(--paper) 80%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-radius: 999px; }
.lamps-row > .lamps { padding: 7px 10px; }
.meta { font-size: 12.5px; line-height: 1.25; color: var(--muted); text-align: right; display: grid; min-width: 0; padding: 4px 12px; }
.meta > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 370px) { .lamps { gap: 5px; } .lamp { width: 13px; height: 13px; } .lamps.sky .lamp { width: 11px; height: 11px; } }
.meta b { color: var(--ink); font-weight: 600; }

/* Intro */
.hero { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: grid; gap: 12px; position: relative; overflow: hidden; flex: none; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: repeating-linear-gradient(90deg, var(--indigo) 0 10px, var(--haldi) 10px 14px, transparent 14px 20px); opacity: .85; }
.hero h1 { font-size: 2rem; }
.howto { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.howto li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 15px; }
.howto .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.howto .ic svg { width: 18px; height: 18px; }
.gut { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--indigo); }
.start-gap { flex: none; height: clamp(40px, calc(100dvh - 640px), 150px); }
.start-cta { position: sticky; bottom: calc(-1 * max(20px, env(safe-area-inset-bottom, 0px))); margin-top: auto; padding-top: 16px; padding-bottom: max(20px, env(safe-area-inset-bottom, 0px)); margin-bottom: calc(-1 * max(20px, env(safe-area-inset-bottom, 0px))); background: linear-gradient(180deg, transparent, var(--paper) 22px); display: grid; gap: 8px; }
.notice { font-size: 14.5px; background: var(--haldi-soft); color: var(--ink); border-radius: 14px; padding: 10px 12px; }

/* Puzzle */
.play { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 0 max(16px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.play-gap { flex: none; height: clamp(54px, calc(100dvh - 700px), 120px); }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 16px 16px 14px; display: grid; gap: 12px; flex: none; }
.pcard .tag { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.prompt { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.12rem, 4.6vw, 1.32rem); line-height: 1.25; letter-spacing: -0.01em; text-wrap: pretty; }
.prompt.seq { font-size: clamp(1.6rem, 8vw, 2rem); letter-spacing: .01em; text-align: center; font-variant-numeric: tabular-nums; padding: 6px 0; }
.figure { display: flex; justify-content: center; }
.figure .row { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: center; max-width: 100%; }
.figure .grid { display: grid; grid-template-columns: repeat(3, 62px); gap: 6px; }
.cell { width: 52px; height: 52px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; flex: 0 1 52px; min-width: 0; }
.figure .grid .cell { width: 62px; height: 62px; }
.cell svg { width: 78%; height: 78%; display: block; }
.cell.gap { border: 2px dashed var(--indigo); background: var(--indigo-soft); color: var(--indigo); font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.hintbox { font-size: 14.5px; background: var(--haldi-soft); border-radius: 12px; padding: 8px 12px; display: flex; gap: 8px; }
.hintbox b { color: var(--haldi-ink); }
.motion .hintbox { animation: up .25s ease both; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; flex: none; }
.tile { position: relative; min-height: 64px; border: 1.5px solid var(--line); background: var(--card); border-radius: 16px; padding: 10px 10px; display: grid; place-items: center; text-align: center; cursor: pointer; font-weight: 600; font-size: 1.02rem; line-height: 1.2; box-shadow: 0 1px 0 var(--line); }
.tile .k { position: absolute; left: 8px; top: 6px; font-size: 11px; color: var(--muted); font-weight: 600; }
.tile.glyph { min-height: 84px; }
.tile.glyph svg { width: 58px; height: 58px; }
.tile[aria-pressed="true"] { border-color: var(--indigo); background: var(--indigo-soft); box-shadow: 0 0 0 2px var(--indigo) inset; }
.tile:disabled { cursor: default; }
.tile.right { border-color: var(--good); background: var(--good-soft); box-shadow: 0 0 0 2px var(--good) inset; color: var(--ink); }
.tile.chosen { border-color: var(--sindoor); background: var(--sindoor-soft); }
.tile.dim { opacity: .5; }
.tile .mark { position: absolute; right: 7px; top: 6px; width: 18px; height: 18px; }
.actions { display: grid; gap: 4px; margin-top: auto; padding-top: 12px; flex: none; }
.actions .row { display: flex; justify-content: space-between; gap: 8px; }
/* Short screens: shrink the picture puzzles so Check stays in reach without scrolling */
@media (max-height: 820px) {
  .play-gap { height: 30px; }
  .pcard { gap: 10px; padding: 14px 14px 12px; }
  .figure .grid { grid-template-columns: repeat(3, 52px); }
  .figure .grid .cell { width: 52px; height: 52px; }
  .tiles { margin-top: 10px; }
  .tile.glyph { min-height: 68px; }
  .tile.glyph svg { width: 46px; height: 46px; }
}
@media (max-height: 680px) {
  .play-gap { height: 16px; }
  .figure .grid { grid-template-columns: repeat(3, 44px); gap: 5px; }
  .figure .grid .cell { width: 44px; height: 44px; border-radius: 10px; }
  .tile { min-height: 56px; }
  .tile.glyph { min-height: 58px; }
  .tile.glyph svg { width: 40px; height: 40px; }
}
.feedback { border-radius: 18px; padding: 14px; display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); margin-top: 12px; flex: none; }
.feedback h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.feedback h2 svg { width: 22px; height: 22px; flex: none; }
.feedback.good h2 { color: var(--good); }
.feedback.miss h2 { color: var(--sindoor); }
.feedback.skip h2 { color: var(--muted); }
.motion .feedback { animation: up .25s cubic-bezier(.3, .7, .4, 1) both; }

/* Overlays: leave sheet, round break, messages */
.overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: flex-end; background: var(--scrim); }
.motion .overlay { animation: fade .2s ease both; }
.sheet { width: 100%; max-width: 480px; align-self: center; background: var(--card); border-radius: 24px 24px 0 0; padding: 22px max(18px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 12px; border-top: 1px solid var(--line); }
.motion .sheet { animation: up .26s cubic-bezier(.3, .7, .4, 1) both; }
.sheet h2 { font-size: 1.4rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.toast { position: absolute; left: max(14px, calc(50% - 226px)); right: max(14px, calc(50% - 226px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 7; background: var(--ink); color: var(--paper); border-radius: 14px; padding: 11px 14px; font-size: 14.5px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.toast button { background: none; border: 0; color: var(--haldi); font-weight: 600; cursor: pointer; padding: 4px 6px; white-space: nowrap; flex: none; }
.motion .toast { animation: up .25s ease both; }
/* The round break reaches past the game column to both edges of the window, so its picture is as wide as the scene behind it. */
.break { position: absolute; inset: 0 calc(50% - 50vw); z-index: 4; display: flex; flex-direction: column; background: var(--g, var(--paper)); }
.break .preview { position: relative; flex: 1 1 auto; min-height: 160px; max-height: 300px; width: 100%; background: linear-gradient(180deg, var(--paper) 0%, var(--sk) 80%); overflow: hidden; }
.break .preview svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.next-tag { position: absolute; left: 50%; top: max(16px, env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); display: grid; gap: 2px; padding: 9px 16px 10px; border-radius: 16px; background: color-mix(in srgb, var(--card) 86%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: var(--shadow); text-align: center; }
.next-tag b { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.15; }
.next-tag span:last-child { font-size: 13.5px; color: var(--muted); }
.break-body { flex: none; align-self: center; width: 100%; max-width: 480px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 24px max(24px, env(safe-area-inset-bottom, 0px)); text-align: center; }
.big { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.1; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* The lab door, after the 8th puzzle */
.door { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: 0 max(18px, env(safe-area-inset-right, 0px)) max(20px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); text-align: center; overflow-y: auto; }
.door .panel { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 10px; }
.door .lamps { justify-content: center; }
.bonus-btn { display: grid; gap: 2px; }
.bonus-btn small { font-weight: 400; font-size: 13.5px; opacity: .85; }

/* Reading the puzzles */
.scoring { flex: 1; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px; text-align: center; }
.motion .scoring .lamp { animation: glow 1.1s ease-in-out infinite alternate; }
.scoring .lamp:nth-child(2) { animation-delay: .12s; } .scoring .lamp:nth-child(3) { animation-delay: .24s; } .scoring .lamp:nth-child(4) { animation-delay: .36s; }
.scoring .lamp:nth-child(5) { animation-delay: .48s; } .scoring .lamp:nth-child(6) { animation-delay: .6s; } .scoring .lamp:nth-child(7) { animation-delay: .72s; } .scoring .lamp:nth-child(8) { animation-delay: .84s; }
@keyframes glow { to { background: var(--lamp-gold); transform: scale(1.15); } }

/* Result */
.res { display: grid; gap: 14px; }
.res-gap { flex: none; height: 118px; }
.res-head { text-align: center; display: grid; gap: 8px; justify-items: center; }
.res-head .star { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--haldi-ink); }
.res-head h1 { font-size: 1.7rem; }
.level { width: 100%; display: grid; gap: 5px; }
.level-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.level-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.level-bar i { display: block; height: 100%; background: var(--haldi); border-radius: 99px; }
.top { background: var(--indigo); color: var(--on-indigo); border-radius: 22px; padding: 18px; display: grid; gap: 6px; text-align: center; position: relative; overflow: hidden; }
.top::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: repeating-linear-gradient(90deg, var(--haldi) 0 10px, transparent 10px 16px); }
.top .you { font-size: 14px; opacity: .85; }
.top .name { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; line-height: 1.05; }
.top .chip { justify-self: center; background: var(--haldi); color: #2b2205; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.box h3 { font-size: 1.08rem; }
.bands { display: grid; gap: 10px; }
details.band { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
details.band > summary { list-style: none; cursor: pointer; padding: 14px; display: grid; gap: 8px; }
details.band > summary::-webkit-details-marker { display: none; }
.band-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.band-top h3 { font-size: 1.2rem; }
.band .reads { font-size: 14.5px; color: var(--muted); }
.dots { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--lamp-ring); background: transparent; }
.dot.solved { background: var(--lamp-gold); border-color: color-mix(in srgb, var(--haldi-ink) 50%, transparent); }
.dot.hinted { background: linear-gradient(90deg, var(--lamp-gold) 50%, transparent 50%); border-color: color-mix(in srgb, var(--haldi-ink) 50%, transparent); }
.dot.bonus { border-radius: 3px; transform: rotate(45deg) scale(.9); }
.dots .key { font-size: 12.5px; color: var(--muted); margin-left: 4px; }
.open-hint { font-size: 13.5px; font-weight: 600; color: var(--indigo); }
details.band[open] .open-hint { display: none; }
.plist { display: grid; gap: 0; border-top: 1px solid var(--line); }
.pitem { padding: 12px 14px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.pitem:last-child { border-bottom: 0; }
.pitem .q { font-weight: 600; }
.pitem .figure { justify-content: flex-start; }
.pitem .cell { width: 36px; height: 36px; border-radius: 9px; flex-basis: 36px; }
.pitem .figure .grid { grid-template-columns: repeat(3, 40px); gap: 4px; }
.pitem .figure .grid .cell { width: 40px; height: 40px; }
.pitem .ans { display: grid; grid-template-columns: 92px 1fr; gap: 4px 8px; align-items: center; }
.pitem .ans em { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pitem .ans .g { display: inline-flex; align-items: center; gap: 6px; }
.pitem .ans .g svg { width: 26px; height: 26px; }
.pitem .why { color: var(--muted); }
.out { font-size: 12.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; justify-self: start; }
.out.solved { background: var(--good-soft); color: var(--good); }
.out.missed { background: var(--sindoor-soft); color: var(--sindoor); }
.out.skipped { background: var(--indigo-soft); color: var(--muted); }
.online { font-size: 14px; background: var(--indigo-soft); border-radius: 14px; padding: 10px 12px; display: grid; gap: 8px; }
.conf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.talk { font-size: 15px; border-left: 3px solid var(--haldi); padding: 2px 0 2px 12px; }
.feel { display: flex; gap: 6px; flex-wrap: wrap; }
.feel button { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; cursor: pointer; }
.feel button[aria-pressed="true"] { background: var(--indigo); color: var(--on-indigo); border-color: var(--indigo); }
.share-field { width: 100%; font: inherit; font-size: 13px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--paper); color: var(--ink); }
.foot { font-size: 12.5px; color: var(--muted); text-align: center; padding-top: 4px; }

/* Keep this result (adults only) */
.keep { border-color: color-mix(in srgb, var(--indigo) 30%, var(--line)); }
.keep:focus { outline: none; }
.btn.two { display: grid; gap: 2px; }
.btn.two small { font-weight: 400; font-size: 13.5px; opacity: .85; }
.btn.danger { background: var(--sindoor); color: var(--card); }
.field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; }
.field input { font: inherit; font-weight: 400; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--paper); color: var(--ink); width: 100%; min-width: 0; }
.field input:focus-visible { outline: 3px solid var(--haldi); outline-offset: 1px; }
.tick { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14.5px; cursor: pointer; }
.tick input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--indigo); }
.human:empty { display: none; }
.err { font-size: 14px; color: var(--sindoor); background: var(--sindoor-soft); border-radius: 10px; padding: 8px 10px; }
.linkish { background: none; border: 0; padding: 4px 0; color: var(--indigo); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Messages (offline, expired, wait) */
.msg { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px max(20px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); text-align: center; }
.msg h1 { font-size: 1.6rem; }

/* scenes:start */
:root { --art-h: #f2c14e; --art-hs: #f8dd98; --art-ss: #efc2b4; --art-sd: #d0674f; --art-in: #5b66b8; --art-cl: #ffffff; --art-bb: #3c5a4b; --art-chalk: #f4f1e6; --art-water: #5b66b8; --door-sk: #e5e3f6; --door-g: #f1efe6; --door-f: #dcd9ef; --door-m: #ecd9c2; --door-n: #8a6a4a; --door-l: #b5c8a0; --open-sk: #fbe7b4; --open-g: #f9f2df; --open-f: #f2e2b8; --open-m: #ecd9c2; --open-n: #9d7c47; --open-l: #a9c48f; --r1-sk: #fbeac6; --r1-g: #f4ead6; --r1-f: #ecd6ac; --r1-m: #dcc39d; --r1-n: #8f6d3f; --r1-l: #a9c48f; --r2-sk: #f8ceb8; --r2-g: #f5e3d6; --r2-f: #eec5af; --r2-m: #e6ad8e; --r2-n: #a65a43; --r2-l: #a8b98d; --bonus-sk: #d4d6f2; --bonus-g: #e3e4f5; --bonus-f: #c3c7ec; --bonus-m: #b2b8e3; --bonus-n: #6d77c0; --bonus-l: #a6b9a0; --result-sk: #fbe7b4; --result-g: #f9f2df; --result-f: #f2e2b8; --result-m: #e6d19e; --result-n: #9d7c47; --result-l: #a9c48f; --saved-sk: #d3d6f1; --saved-g: #e7e9f6; --saved-f: #c5cbec; --saved-m: #c9c4e4; --saved-n: #727cc4; --saved-l: #a9bd9a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --art-h: #f2c14e; --art-hs: #5f4d1f; --art-ss: #6a3b33; --art-sd: #e08a74; --art-in: #8d97e6; --art-cl: #2a3062; --art-bb: #22392f; --art-chalk: #e6e2d2; --art-water: #2c3780; --door-sk: #1f2148; --door-g: #1a1b30; --door-f: #272a55; --door-m: #3b3226; --door-n: #c9a27a; --door-l: #3d5b45; --open-sk: #3a3017; --open-g: #221e14; --open-f: #30291a; --open-m: #3f3520; --open-n: #c39f62; --open-l: #4d6b3f; --r1-sk: #372f1b; --r1-g: #211d14; --r1-f: #30291b; --r1-m: #4a3c27; --r1-n: #c9a46b; --r1-l: #4d6b3f; --r2-sk: #3a2230; --r2-g: #231820; --r2-f: #3a2530; --r2-m: #5a3428; --r2-n: #e09a80; --r2-l: #4a5e3e; --bonus-sk: #14173a; --bonus-g: #101330; --bonus-f: #1d2150; --bonus-m: #283068; --bonus-n: #8a93e0; --bonus-l: #33503d; --result-sk: #3a3017; --result-g: #221e14; --result-f: #30291a; --result-m: #3f3520; --result-n: #c39f62; --result-l: #4d6b3f; --saved-sk: #181c3f; --saved-g: #15182f; --saved-f: #222859; --saved-m: #2d346e; --saved-n: #7f88d8; --saved-l: #36523f; } }
:root[data-theme="dark"] { --art-h: #f2c14e; --art-hs: #5f4d1f; --art-ss: #6a3b33; --art-sd: #e08a74; --art-in: #8d97e6; --art-cl: #2a3062; --art-bb: #22392f; --art-chalk: #e6e2d2; --art-water: #2c3780; --door-sk: #1f2148; --door-g: #1a1b30; --door-f: #272a55; --door-m: #3b3226; --door-n: #c9a27a; --door-l: #3d5b45; --open-sk: #3a3017; --open-g: #221e14; --open-f: #30291a; --open-m: #3f3520; --open-n: #c39f62; --open-l: #4d6b3f; --r1-sk: #372f1b; --r1-g: #211d14; --r1-f: #30291b; --r1-m: #4a3c27; --r1-n: #c9a46b; --r1-l: #4d6b3f; --r2-sk: #3a2230; --r2-g: #231820; --r2-f: #3a2530; --r2-m: #5a3428; --r2-n: #e09a80; --r2-l: #4a5e3e; --bonus-sk: #14173a; --bonus-g: #101330; --bonus-f: #1d2150; --bonus-m: #283068; --bonus-n: #8a93e0; --bonus-l: #33503d; --result-sk: #3a3017; --result-g: #221e14; --result-f: #30291a; --result-m: #3f3520; --result-n: #c39f62; --result-l: #4d6b3f; --saved-sk: #181c3f; --saved-g: #15182f; --saved-f: #222859; --saved-m: #2d346e; --saved-n: #7f88d8; --saved-l: #36523f; }
.sc-door { --sk: var(--door-sk); --g: var(--door-g); --f: var(--door-f); --m: var(--door-m); --n: var(--door-n); --l: var(--door-l); }
.sc-open { --sk: var(--open-sk); --g: var(--open-g); --f: var(--open-f); --m: var(--open-m); --n: var(--open-n); --l: var(--open-l); }
.sc-r1 { --sk: var(--r1-sk); --g: var(--r1-g); --f: var(--r1-f); --m: var(--r1-m); --n: var(--r1-n); --l: var(--r1-l); }
.sc-r2 { --sk: var(--r2-sk); --g: var(--r2-g); --f: var(--r2-f); --m: var(--r2-m); --n: var(--r2-n); --l: var(--r2-l); }
.sc-bonus { --sk: var(--bonus-sk); --g: var(--bonus-g); --f: var(--bonus-f); --m: var(--bonus-m); --n: var(--bonus-n); --l: var(--bonus-l); }
.sc-result { --sk: var(--result-sk); --g: var(--result-g); --f: var(--result-f); --m: var(--result-m); --n: var(--result-n); --l: var(--result-l); }
.sc-saved { --sk: var(--saved-sk); --g: var(--saved-g); --f: var(--saved-f); --m: var(--saved-m); --n: var(--saved-n); --l: var(--saved-l); }
/* The scene layer sits behind every screen. --band is how far the picture (.sband) reaches down; the rest is ground. */
.scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.slot { position: absolute; inset: 0; background: var(--g); opacity: 0; }
.slot.on { opacity: 1; }
.motion .slot { transition: opacity .6s ease; }
.sband { position: absolute; left: 0; right: 0; top: 0; height: var(--band, 220px); background: linear-gradient(180deg, var(--paper) 0%, var(--sk) 78%); transform: translateY(calc(var(--sy, 0) * -1px)); }
.motion .sband { transform: translateY(calc(var(--sy, 0) * -.45px)); opacity: calc(1 - var(--sy, 0) / 360); transition: height .3s ease; }
.sband svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene.bar .sband svg { -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .1) 44px, #000 112px); mask-image: linear-gradient(180deg, rgba(0, 0, 0, .1) 44px, #000 112px); }
.start-cta { background: linear-gradient(180deg, transparent, var(--door-g) 22px); }
.door .panel, .msg { position: relative; }

svg .f { fill: var(--f); } svg .m { fill: var(--m); } svg .n { fill: var(--n); } svg .g { fill: var(--g); } svg .l { fill: var(--l); }
svg .h { fill: var(--art-h); } svg .hs { fill: var(--art-hs); } svg .ss { fill: var(--art-ss); } svg .sd { fill: var(--art-sd); } svg .in { fill: var(--art-in); }
svg .cd { fill: var(--card); } svg .pp { fill: var(--paper); } svg .cl { fill: var(--art-cl); opacity: .8; } svg .sp { fill: var(--art-h); }
svg .bb { fill: var(--art-bb); } svg .frond { fill: none; stroke: var(--l); stroke-width: 4; stroke-linecap: round; } svg .water { fill: var(--art-water); opacity: .8; }
svg .st { fill: none; stroke: var(--n); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
svg .st.thin { stroke-width: 1.3; }
svg .stf { fill: none; stroke: var(--n); stroke-width: 1.2; opacity: .5; }
svg .stc { fill: none; stroke: var(--art-h); stroke-width: 1; stroke-dasharray: 3 4; opacity: .9; }
svg .zig { fill: none; stroke: var(--n); stroke-width: 1.1; opacity: .7; stroke-linejoin: miter; }
svg .chalk { fill: var(--art-chalk); font-family: "Anek Latin", system-ui, sans-serif; font-weight: 600; font-size: 21px; letter-spacing: .5px; }
svg .chalkl { fill: none; stroke: var(--art-chalk); stroke-width: 1.6; stroke-linecap: round; opacity: .85; }
svg .conft { font-family: "Anek Latin", system-ui, sans-serif; font-weight: 700; font-size: 15px; }
svg .beam { opacity: .55; }
/* The lamps on the lab door and the skylight panes: off, soft white, or gold */
svg .lampd, svg .skyd { fill: var(--lamp-off); stroke: var(--n); stroke-width: 1; }
svg .lampd.white { fill: var(--lamp-white); }
svg .lampd.gold, svg .skyd.gold { fill: var(--lamp-gold); filter: drop-shadow(0 0 3px var(--lamp-gold)); }
.scene .p1, .scene .p2 { transition: transform .35s ease-out; }

@media (prefers-reduced-motion: no-preference) {
  svg .drift { animation: drift 6s ease-in-out infinite alternate; }
  svg .spin { animation: spin 12s linear infinite; }
  svg .spin-slower { animation: spin 90s linear infinite; }
  svg .sp { animation: twinkle 2.2s ease-in-out infinite alternate; }
  svg .sp.b2 { animation-delay: -1.1s; }
  svg .stc { animation: twinkle 3.4s ease-in-out infinite alternate; }
  svg .flame { animation: flicker 1.2s ease-in-out infinite alternate; }
  svg .fall { animation: fall 5s ease-in-out infinite alternate; }
  svg .glow { animation: twinkle 3s ease-in-out infinite alternate; }
  svg .bub { animation: bubble 2.4s ease-in infinite; }
  svg .bub.b2 { animation-delay: -.8s; } svg .bub.b3 { animation-delay: -1.6s; }
  svg .shimmer { animation: shimmer 3s ease-in-out infinite alternate; }
  svg .beam { animation: twinkle 2.6s ease-in-out infinite alternate; }
}
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(5px, -6px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes twinkle { from { opacity: 1; } to { opacity: .35; } }
@keyframes flicker { from { transform: scaleY(1); } to { transform: scaleY(.8); } }
@keyframes fall { from { transform: translateY(-4px); } to { transform: translateY(6px); } }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-34px); opacity: 0; } }
@keyframes shimmer { from { transform: scaleX(.8); opacity: .45; } to { transform: scaleX(1.15); opacity: .8; } }
/* scenes:end */

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
