/* Kurmavatar — interface. Ink navy, ivory type, gold used sparingly. Fonts are bundled (fonts/), nothing is fetched from elsewhere. */
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('fonts/inter.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
:root {
  --ink: #07111d; --ink2: #0e1d2e; --line: rgba(232, 206, 150, .24); --line2: rgba(244, 238, 225, .16);
  --gold: #e3c88e; --gold2: #cba25f; --ivory: #f4eee1; --sage: #b4c2c0; --muted: #8b9aa3; --hot: #ff5a4a; --aqua: #8fe9da;
  --serif: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --deva: 'Noto Serif Devanagari', 'Kohinoor Devanagari', 'Devanagari Sangam MN', 'Nirmala UI', Mangal, 'Noto Sans Devanagari', serif;
  --pad: clamp(18px, 4.4vw, 56px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--ink); color: var(--ivory); font-family: var(--sans); }
body { position: fixed; inset: 0; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
body.playing { cursor: crosshair; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
canvas#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 22px; align-items: center; justify-content: center; background: var(--ink); z-index: 30; transition: opacity .7s ease, visibility .7s; color: var(--gold); }
.loading svg { width: 54px; height: 54px; animation: pulse 1.8s ease-in-out infinite; }
.loading span { font-size: .72rem; letter-spacing: .42em; text-transform: uppercase; }
@keyframes pulse { 50% { opacity: .35; } }

/* a soft scrim behind type; stronger when a panel is open */
.scrim { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .5s ease; background: radial-gradient(ellipse at center, rgba(5, 12, 22, .5), rgba(5, 12, 22, .86)); }
body.is-home .scrim { opacity: 1; background: linear-gradient(90deg, rgba(5, 12, 22, .9) 0%, rgba(5, 12, 22, .62) 30%, rgba(5, 12, 22, .08) 60%, rgba(5, 12, 22, 0) 100%), linear-gradient(180deg, rgba(5, 12, 22, .55) 0%, rgba(5, 12, 22, 0) 18%, rgba(5, 12, 22, 0) 78%, rgba(5, 12, 22, .6) 100%); }
body.is-panel .scrim { opacity: 1; }
body.playing:not(.is-panel) .scrim { opacity: 1; background: linear-gradient(180deg, rgba(5, 12, 22, .58) 0, rgba(5, 12, 22, .28) 90px, rgba(5, 12, 22, 0) 190px), linear-gradient(0deg, rgba(5, 12, 22, .5) 0, rgba(5, 12, 22, 0) 150px); }

/* ---------- header ---------- */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 8; display: flex; align-items: center; gap: 28px; padding: max(18px, env(safe-area-inset-top)) max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left)); pointer-events: none; }
.top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--gold); text-align: left; transition: opacity .4s ease, visibility .4s; }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand span { font-family: var(--serif); font-weight: 400; font-size: 1.22rem; letter-spacing: .26em; color: var(--ivory); line-height: 1.15; }
.brand small { display: block; white-space: nowrap; font-family: var(--sans); font-size: .6rem; font-weight: 500; letter-spacing: .4em; color: var(--muted); margin-top: 5px; }
.nav { display: flex; gap: 30px; margin-left: auto; transition: opacity .4s ease, visibility .4s; }
.nav button, .link, .foot-link, .record { font-size: .86rem; color: var(--sage); letter-spacing: .01em; transition: color .2s ease; white-space: nowrap; }
.nav button i, .link i, .foot-link i, .record i { font-style: normal; display: inline-block; margin-left: 3px; opacity: .7; transition: transform .2s ease; }
.nav button:hover, .link:hover, .foot-link:hover, .record:hover { color: var(--ivory); }
.nav button:hover i, .link:hover i, .foot-link:hover i, .record:hover i { transform: translate(2px, -2px); }
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: 18px; }
body:not(.is-home) .nav { display: none; } body:not(.is-home) .top-actions { margin-left: auto; }
body.playing .brand, body.is-panel:not(.home) .brand { opacity: 0; visibility: hidden; position: absolute; }
.sound { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px 0 11px; border: 1px solid var(--line2); border-radius: 4px; color: var(--sage); font-size: .62rem; font-weight: 600; letter-spacing: .26em; background: rgba(7, 17, 29, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: color .2s, border-color .2s; }
.sound:hover { color: var(--ivory); border-color: var(--line); }
.install { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 11px; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); font-size: .62rem; font-weight: 600; letter-spacing: .26em; background: rgba(7, 17, 29, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: color .2s ease, border-color .2s ease, background .2s ease; white-space: nowrap; }
.install:hover { color: var(--ivory); border-color: var(--gold); }
.install svg { width: 17px; height: 17px; flex: none; }
.install.hidden, body:not(.is-home) .install, .install.in-hero { display: none; }
.steps { counter-reset: s; display: grid; gap: 0; margin-top: 4px; }
.steps > div { counter-increment: s; position: relative; padding: 13px 0 13px 44px; border-bottom: 1px solid var(--line2); color: var(--sage); }
.steps > div::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: 14px; font-size: .62rem; font-weight: 600; letter-spacing: .2em; color: var(--gold); }
.readmore { display: flex; flex-wrap: wrap; gap: 6px 28px; margin-top: 22px; }
.dialog-body .fine { font-size: .82rem; color: var(--muted); margin-top: 16px; }
.steps svg { width: 18px; height: 18px; vertical-align: -4px; margin: 0 2px; color: var(--ivory); }
.sound svg, .iconbtn svg { width: 19px; height: 19px; }
.sound .mute { display: none; } .sound.off .wave { display: none; } .sound.off .mute { display: block; } .sound.off { color: var(--muted); }
body:not(.is-home) .sound span { display: none; } body:not(.is-home) .sound { padding: 0; width: 40px; justify-content: center; }
.iconbtn { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line2); border-radius: 4px; color: var(--sage); background: rgba(7, 17, 29, .45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.iconbtn:hover { color: var(--ivory); border-color: var(--line); }
.iconbtn.hidden { display: none; }

/* ---------- shared type ---------- */
.eyebrow { font-size: .68rem; font-weight: 600; letter-spacing: .4em; text-transform: uppercase; color: var(--gold); }
.eyebrow .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); margin-right: 14px; vertical-align: middle; box-shadow: 0 0 12px var(--gold); }
h1, h2 { font-family: var(--serif); font-weight: 380; color: var(--ivory); letter-spacing: -.012em; font-variation-settings: 'opsz' 144; }
h1 em, h2 em { font-style: italic; color: var(--gold); font-weight: 340; }
.body { font-size: 1rem; line-height: 1.62; color: var(--sage); }
.deva { font-family: var(--deva); color: var(--gold); opacity: .8; font-size: 1.05rem; margin-top: 8px; }
.deva:empty, .src:empty, .goal:empty { display: none; }
.src { font-size: .62rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-top: 22px; }

/* the primary action: a flat gold bar with its arrow in a box */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 58px; padding: 0 8px 0 24px; border-radius: 4px; text-align: left; color: #151b22; font-weight: 600; font-size: 1rem; letter-spacing: .005em; background: linear-gradient(90deg, #f1dfb3, #d4ae6d); box-shadow: 0 0 0 1px rgba(255, 244, 214, .5) inset, 0 14px 40px rgba(0, 0, 0, .35); transition: filter .2s ease, transform .15s ease; }
.cta i { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(21, 27, 34, .28); border-radius: 3px; transition: transform .2s ease; }
.cta i svg { width: 20px; height: 20px; }
.cta:hover { filter: brightness(1.07); } .cta:hover i { transform: translateX(3px); } .cta:active { transform: translateY(1px); }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; margin-top: 22px; }
.link.quiet { color: var(--muted); font-size: .8rem; }
.link.hidden { display: none; }

/* ---------- screens and panels ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 6; padding: max(74px, calc(env(safe-area-inset-top) + 64px)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); transition: opacity .45s ease, visibility .45s; }
.screen.hidden { transition-duration: .18s; }
.screen.dialog { z-index: 9; background: rgba(5, 12, 22, .72); padding-top: max(22px, env(safe-area-inset-top)); }
.panel { position: relative; width: min(600px, 100%); max-height: 100%; overflow: auto; text-align: center; padding: clamp(26px, 5vh, 48px) clamp(22px, 5vw, 56px) 0; border-radius: 10px; border: 1px solid var(--line2); background: linear-gradient(180deg, rgba(20, 40, 62, .93), rgba(8, 18, 31, .95)); box-shadow: 0 30px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .03) inset; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); animation: rise .55s cubic-bezier(.2, .8, .2, 1) both; scrollbar-width: thin; scrollbar-color: rgba(232, 206, 150, .3) transparent; }
.panel::after { content: ''; display: block; height: clamp(22px, 4vh, 38px); }   /* the space under the last line, kept inside the scrolling content so a pinned button sits flush with the panel's foot */
.panel.narrow { width: min(520px, 100%); } .panel.wide { width: min(860px, 100%); text-align: left; padding-top: clamp(30px, 5vh, 46px); }
.panel.again, .screen.hidden .panel { animation: none; }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.mark { width: 46px; height: 46px; color: var(--gold); margin-bottom: 22px; }
.panel h2 { font-size: clamp(1.9rem, 5.2vw, 3rem); line-height: 1.06; margin-top: 16px; }
.panel .body { margin-top: 18px; }
.panel .cta { margin-top: 28px; position: sticky; bottom: 0; z-index: 2; box-shadow: 0 0 0 1px rgba(255, 244, 214, .5) inset, 0 -12px 16px 0 rgba(9, 19, 33, .8); }
.pips { display: flex; justify-content: center; gap: 5px; margin-top: 14px; }
.pips i { width: 16px; height: 2px; background: rgba(244, 238, 225, .16); border-radius: 1px; }
.pips i.done { background: var(--gold2); } .pips i.cur { background: var(--ivory); box-shadow: 0 0 8px rgba(244, 238, 225, .8); }
.goal { margin-top: 18px; padding: 13px 16px; font-size: .9rem; line-height: 1.5; color: var(--ivory); border: 1px solid var(--line); border-radius: 4px; background: rgba(227, 200, 142, .06); text-align: left; }
.goal b { display: block; font-size: .6rem; font-weight: 600; letter-spacing: .34em; color: var(--gold); margin-bottom: 5px; }
.how { margin-top: 12px; padding: 13px 16px; font-size: .86rem; line-height: 1.55; color: var(--sage); border: 1px solid var(--line2); border-radius: 4px; text-align: left; }
.how.hidden { display: none; }
.close { position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--sage); border-radius: 4px; }
.close:hover { color: var(--ivory); } .close svg { width: 20px; height: 20px; }

/* results */
.rankrow { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 14px; }
.rank { font-family: var(--serif); font-size: clamp(2.8rem, 9vw, 4.2rem); line-height: 1; font-weight: 400; }
.rank.rS { color: var(--gold); text-shadow: 0 0 34px rgba(227, 200, 142, .7); } .rank.rA { color: #d7f3e6; } .rank.rB { color: #a9cfe6; } .rank.rC { color: var(--muted); }
.newbest { font-size: .62rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #151b22; background: var(--gold); padding: 6px 10px 6px 12px; border-radius: 2px; }
.newbest.hidden { display: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 16px 14px; margin-top: 20px; padding: 18px 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.stats div { display: flex; flex-direction: column; gap: 5px; }
.stats span { font-size: .62rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); }
.stats b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; color: var(--ivory); font-variant-numeric: tabular-nums; }
.stats div.wide { grid-column: 1 / -1; } .stats div.wide b { font-size: 1.05rem; color: var(--gold); }

/* ---------- home ---------- */
.home { --fp: calc(max(20px, env(safe-area-inset-bottom)) + 170px); align-items: flex-start; justify-content: flex-start; padding-bottom: var(--fp); overflow: hidden auto; overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: rgba(244, 238, 225, .18) transparent; padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); pointer-events: auto; }
.home > * { pointer-events: auto; }
.hero { width: min(720px, 100%); flex: none; min-height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.hero-actions, .hero-links, .notes { align-self: stretch; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.9rem); line-height: 1.04; margin-top: 24px; text-shadow: 0 2px 40px rgba(5, 12, 22, .7); }
.lede { font-size: clamp(.98rem, 1.5vw, 1.12rem); line-height: 1.6; color: var(--sage); margin-top: 24px; max-width: 30em; }
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 34px; }
.hero-actions .cta { width: auto; min-width: min(330px, 100%); }
.hero #btn-new { display: block; margin-top: 14px; }
.hero #btn-new.hidden { display: none; }
.notes { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 26px; font-size: .6rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.notes b { color: var(--gold2); font-weight: 400; }
.hero-links { display: none; gap: 8px 22px; flex-wrap: wrap; margin-top: 22px; }
/* the journey in three lines, above the foot of the page */
.strip { position: absolute; left: max(var(--pad), env(safe-area-inset-left)); right: max(var(--pad), env(safe-area-inset-right)); bottom: calc(max(20px, env(safe-area-inset-bottom)) + 57px); display: grid; grid-template-columns: repeat(3, 1fr); padding: 22px 0 24px; border-top: 1px solid var(--line2); background: linear-gradient(90deg, rgba(5, 12, 22, .5), rgba(5, 12, 22, .22)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.step { display: flex; align-items: center; gap: 18px; padding: 2px 26px 2px 30px; border-left: 1px solid var(--line2); min-width: 0; }
.step:first-child { border-left: 0; padding-left: 18px; }
.step .num { align-self: flex-start; font-size: .62rem; font-weight: 500; letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.step svg { width: 30px; height: 30px; flex: none; color: var(--gold); }
.step h2 { font-size: 1.22rem; font-weight: 400; letter-spacing: 0; line-height: 1.2; font-variation-settings: 'opsz' 36; }
.step p { font-size: .84rem; line-height: 1.45; color: var(--sage); margin-top: 5px; }
/* his name, set beside him on the water */
.callout { position: fixed; left: 0; top: 0; z-index: -1; display: flex; align-items: flex-start; gap: 14px; color: var(--gold); pointer-events: none; opacity: 0; transition: opacity .6s ease; text-shadow: 0 2px 10px rgba(5, 12, 22, .9); will-change: transform; }
body.is-home .callout.on { opacity: .92; }
.callout i { position: relative; width: 64px; height: 1px; margin-top: .62em; background: linear-gradient(90deg, transparent, var(--gold)); flex: none; }
.callout i::after { content: ''; position: absolute; right: -4px; top: -3.5px; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); }
.callout span { font-family: var(--serif); font-size: 1.02rem; letter-spacing: .3em; line-height: 1.2; max-width: 200px; }
.callout small { display: block; font-family: var(--sans); font-size: .62rem; font-weight: 600; letter-spacing: .28em; line-height: 1.9; text-transform: uppercase; color: var(--sage); margin-top: 7px; }
.callout b { display: block; font-weight: inherit; } .callout em { display: none; font-style: normal; }
.callout.under b { display: inline; } .callout.under em { display: inline; }
.callout.under { flex-direction: column; align-items: center; gap: 0; text-align: center; } .callout.under i { display: none; } .callout.under span { font-size: .86rem; max-width: none; white-space: nowrap; } .callout.under small { margin-top: 5px; font-size: .62rem; letter-spacing: .2em; line-height: 1.5; color: var(--ivory); opacity: .8; }
/* below the first screen: the game and the story in words */
.more { position: relative; z-index: 1; flex: none; align-self: stretch; margin: var(--fp) 0 calc(-1 * var(--fp)); padding: 0 0 max(28px, env(safe-area-inset-bottom)); background: var(--ink); box-shadow: 0 0 0 100vw var(--ink); clip-path: inset(0 -100vw); color: var(--sage); font-size: 1rem; line-height: 1.65; }
.more-row { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 28px clamp(36px, 6vw, 96px); padding: clamp(40px, 6vw, 76px) 0; border-top: 1px solid var(--line2); }
.more-row > header { align-self: start; position: sticky; top: 96px; }
.more-row .eyebrow { font-size: .66rem; }
.more h2 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.16; margin-top: 14px; font-variation-settings: 'opsz' 72; text-wrap: balance; }
.more-row > header p:not(.eyebrow) { margin-top: 16px; font-size: .92rem; line-height: 1.55; }
.more a { color: var(--gold); text-decoration: underline; text-decoration-color: rgba(227, 200, 142, .4); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.more a:hover { color: var(--ivory); }
.more-text { columns: 3 24em; column-gap: clamp(32px, 4vw, 64px); max-width: 108em; font-size: 1.04rem; color: var(--sage); }
.more-text p { break-inside: avoid; margin-bottom: 16px; }
.more-text p:first-child { color: var(--ivory); }
.more-faq { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(280px, 30%), 1fr)); gap: 30px clamp(28px, 4vw, 56px); }
.more-faq dt { font-family: var(--serif); color: var(--ivory); font-size: 1.14rem; line-height: 1.3; padding-top: 16px; border-top: 1px solid var(--line); }
.more-faq dd { font-size: .94rem; margin-top: 8px; }
.more-chapters { list-style: none; counter-reset: c; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.more-chapters li { counter-increment: c; }
.more-chapters a { display: block; position: relative; height: 100%; padding: 16px 16px 16px 54px; border: 1px solid var(--line2); border-radius: 6px; text-decoration: none; background: rgba(244, 238, 225, .02); transition: border-color .2s ease, background .2s ease; }
.more-chapters a:hover, .more-beings a:hover { border-color: var(--line); background: rgba(244, 238, 225, .05); }
.more-chapters a::before { content: counter(c, decimal-leading-zero); position: absolute; left: 18px; top: 19px; font-size: .66rem; font-weight: 600; letter-spacing: .2em; color: var(--gold); }
.more-chapters strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.12rem; line-height: 1.25; color: var(--ivory); }
.more-chapters span { display: block; font-size: .84rem; line-height: 1.5; color: var(--muted); margin-top: 5px; }
.more-beings { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 206px), 1fr)); gap: 10px 12px; }
.more-beings span { min-width: 0; overflow-wrap: anywhere; }
.more-beings a { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px 8px 10px; border: 1px solid var(--line2); border-radius: 6px; text-decoration: none; color: var(--ivory); font-family: var(--serif); font-size: 1.02rem; line-height: 1.2; background: rgba(244, 238, 225, .02); transition: border-color .2s ease, background .2s ease; }
.more-beings img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.more-links { list-style: none; columns: 3 300px; column-gap: clamp(28px, 4vw, 56px); }
.more-links li { break-inside: avoid; border-bottom: 1px solid var(--line2); }
.more-links a { display: block; padding: 12px 0; text-decoration: none; color: var(--sage); font-size: .95rem; line-height: 1.4; }
.more-end { display: flex; flex-wrap: wrap; gap: 0 30px; padding-top: 18px; border-top: 1px solid var(--line2); }
.more-end a { color: var(--muted); text-decoration: none; font-size: .86rem; padding: 12px 0; }
@media (max-width: 900px) { .more-row { grid-template-columns: 1fr; gap: 22px; padding: 40px 0; } .more-row > header { position: static; } }
/* the label beside him belongs to the first screen only */
body.is-home.scrolled .callout, body.is-home.scrolled .callout.on { opacity: 0; }
/* once the page is scrolled, the header gets a ground of its own */
.top { transition: background .25s ease, padding .25s ease; }
body.is-home.scrolled .top { background: rgba(7, 17, 29, .9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding-bottom: 12px; box-shadow: 0 1px 0 var(--line2); }
.home-foot { position: absolute; left: max(var(--pad), env(safe-area-inset-left)); right: max(var(--pad), env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line2); }
a.foot-link, a.link { text-decoration: none; }
.foot-link, .record { font-size: .62rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.record b { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; letter-spacing: .04em; color: var(--ivory); margin: 0 6px 0 10px; font-variant-numeric: tabular-nums; vertical-align: -2px; }
.record .star { color: var(--gold); margin-right: 6px; }

/* ---------- dialogs: how to play, the legend, beings and treasures, chapters ---------- */
.dialog-body { margin-top: 22px; color: var(--sage); font-size: .95rem; line-height: 1.62; }
.dialog-body p + p { margin-top: 12px; }
.dialog-body h3 { font-size: .62rem; font-weight: 600; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); margin: 26px 0 10px; padding-top: 18px; border-top: 1px solid var(--line2); }
.dialog-body h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.dialog-body b { color: var(--ivory); font-weight: 600; }
.keys { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 0; }
.keys > div { padding: 10px 0; border-bottom: 1px solid var(--line2); }
.keys > div:nth-child(odd) { color: var(--ivory); font-weight: 500; padding-right: 14px; }
kbd { display: inline-block; font-family: var(--sans); font-size: .74rem; font-weight: 600; color: var(--ivory); padding: 2px 7px; margin: 0 2px; border: 1px solid var(--line); border-radius: 3px; background: rgba(244, 238, 225, .05); }
.legend-row { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.legend-row i { flex: none; width: 34px; display: grid; place-items: center; font-style: normal; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.entry { padding: 18px; border: 1px solid var(--line2); border-radius: 6px; background: rgba(244, 238, 225, .025); min-height: 150px; }
.entry .thumb { width: 96px; height: 96px; margin-bottom: 14px; display: grid; place-items: center; }
.entry .thumb img { max-width: 96px; max-height: 96px; display: block; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .45)); }
.entry.locked .thumb img { filter: brightness(0) invert(1); opacity: .2; }
.entry small { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.entry strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.25rem; color: var(--ivory); margin: 5px 0 7px; }
.entry p { font-size: .84rem; line-height: 1.5; }
.entry.locked strong { color: var(--sage); } .entry.locked p, .entry.locked small { opacity: .7; }
.records { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.records div { padding: 14px 16px; border: 1px solid var(--line2); border-radius: 6px; }
.records span { display: block; font-size: .62rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.records b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; color: var(--ivory); margin-top: 6px; font-variant-numeric: tabular-nums; }
.chrow { display: grid; grid-template-columns: 34px 1fr auto auto; align-items: center; gap: 14px; width: 100%; padding: 13px 4px; border-bottom: 1px solid var(--line2); text-align: left; color: var(--sage); }
.chrow .n { font-family: var(--serif); font-size: 1.05rem; color: var(--gold); }
.chrow .t { font-family: var(--serif); font-size: 1.1rem; color: var(--ivory); }
.chrow .t small { display: block; font-family: var(--sans); font-size: .74rem; color: var(--muted); margin-top: 2px; }
.chrow .r { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.chrow .r b { font-family: var(--serif); font-weight: 400; font-size: 1.1rem; color: var(--gold); margin-right: 8px; }
.chrow .go { font-size: .8rem; color: var(--ivory); }
button.chrow:hover { background: rgba(244, 238, 225, .04); } button.chrow:hover .go { color: var(--gold); }
.chrow.locked { opacity: .45; }
.note { font-size: .8rem; color: var(--muted); margin-top: 16px; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 4; transition: opacity .35s ease, visibility .35s; text-shadow: 0 1px 8px rgba(0, 0, 0, .85); }
.prog { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: rgba(255, 255, 255, .08); }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--aqua), var(--gold)); box-shadow: 0 0 10px var(--gold); }
.hud-tl { position: absolute; left: max(18px, env(safe-area-inset-left)); top: max(16px, env(safe-area-inset-top)); max-width: calc(100vw - 150px); }
.hud-ch { font-size: .6rem; font-weight: 600; letter-spacing: .36em; color: var(--gold); }
.hud-name { font-family: var(--serif); font-size: clamp(1rem, 2.4vw, 1.35rem); color: var(--ivory); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-row { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.hud-score { font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.1rem); font-variant-numeric: tabular-nums; color: var(--ivory); }
.hud-best { font-size: .62rem; font-weight: 600; letter-spacing: .28em; color: var(--muted); margin-top: 1px; }
.bossbar { position: absolute; left: 50%; top: max(18px, env(safe-area-inset-top)); width: min(480px, 42vw); transform: translate(-50%, -14px); opacity: 0; transition: opacity .4s ease, transform .4s ease; text-align: center; padding: 9px 14px 8px; border-radius: 4px; background: rgba(5, 12, 22, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.bossbar.show { opacity: 1; transform: translate(-50%, 0); }
.boss-name { font-family: var(--serif); font-size: clamp(.95rem, 2.2vw, 1.25rem); letter-spacing: .3em; margin-right: -.3em; color: #ffd0c4; }
.boss-name.long { font-size: clamp(.66rem, 1.6vw, .95rem); letter-spacing: .16em; margin-right: -.16em; white-space: nowrap; }
.boss-track { height: 6px; margin: 8px 0 6px; border-radius: 1px; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 120, 100, .5); overflow: hidden; }
.boss-track i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff3a3a, #ff9a5a); box-shadow: 0 0 14px #ff5a4a; transition: width .12s linear; }
.boss-sub { font-size: .6rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--sage); }
.bossbar.goal .boss-name { color: var(--gold); } .bossbar.goal .boss-track { border-color: var(--line); } .bossbar.goal .boss-track i { background: linear-gradient(90deg, var(--aqua), var(--gold)); box-shadow: 0 0 14px var(--gold); }
.hud-goal { position: absolute; left: 50%; top: max(22px, env(safe-area-inset-top)); transform: translateX(-50%); font-size: .62rem; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--sage); white-space: nowrap; transition: opacity .3s ease; }
.hud-goal:empty { opacity: 0; }
.hud-bl { position: absolute; left: max(18px, env(safe-area-inset-left)); bottom: max(20px, env(safe-area-inset-bottom)); }
.hud-lab { font-size: .62rem; font-weight: 600; letter-spacing: .32em; color: var(--muted); margin-bottom: 6px; }
.hud-lab.dim { margin: 5px 0 0; }
.hp { display: flex; gap: 6px; }
.shell { width: 20px; height: 18px; background: linear-gradient(160deg, #e6fff0, #49c9a0 55%, #0f7460); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); filter: drop-shadow(0 0 6px rgba(120, 255, 210, .8)); transition: all .25s ease; }
.shell.off { background: rgba(255, 255, 255, .16); filter: none; transform: scale(.78); }
.dash { width: 110px; height: 3px; margin-top: 10px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.dash i { display: block; height: 100%; background: var(--aqua); box-shadow: 0 0 8px var(--aqua); }
.sp-track { height: 5px; border-radius: 1px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); overflow: hidden; }
.sp-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold2), #f6e7c0); }
.sp-label { font-size: .56rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-top: 7px; }

.banner { position: fixed; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; z-index: 5; opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .7s cubic-bezier(.2, .8, .2, 1); text-shadow: 0 2px 30px rgba(0, 0, 0, .9); padding: 0 16px; }
.banner.show { opacity: 1; transform: none; }
.banner-k { font-size: .7rem; font-weight: 600; letter-spacing: .5em; text-transform: uppercase; color: var(--gold); }
.banner-t { font-family: var(--serif); font-weight: 360; font-size: clamp(2rem, 7vw, 4.6rem); letter-spacing: .01em; color: var(--ivory); line-height: 1.1; margin-top: 10px; font-variation-settings: 'opsz' 144; }
.banner-s { font-family: var(--deva); font-size: clamp(1rem, 3vw, 1.5rem); color: var(--gold); opacity: .85; margin-top: 6px; }
.banner.warn .banner-k { color: #fff; background: var(--hot); display: inline-block; padding: 4px 12px 4px 18px; animation: pulse .5s linear infinite; }
.banner.warn .banner-t { color: #ffd6cc; text-shadow: 0 0 40px rgba(255, 60, 40, .8), 0 2px 24px #000; }
.banner.gold .banner-t { color: #f6e7c0; text-shadow: 0 0 40px rgba(227, 200, 142, .7), 0 2px 24px #000; }
.tip { position: fixed; left: 50%; top: max(96px, calc(env(safe-area-inset-top) + 86px)); transform: translate(-50%, 10px); z-index: 5; pointer-events: none; max-width: min(520px, calc(100vw - 36px)); padding: 12px 18px; font-size: .9rem; line-height: 1.4; text-align: center; color: var(--ivory); border: 1px solid var(--line); border-radius: 4px; background: rgba(7, 17, 29, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .4s ease, transform .4s ease; }
.tip.show { opacity: 1; transform: translate(-50%, 0); }
.tip b { color: var(--gold); font-weight: 600; }

.floaters { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }
.floater { position: absolute; transform: translate(-50%, -50%); font-weight: 700; font-size: .9rem; color: #fff3c0; text-shadow: 0 1px 6px #000, 0 0 12px rgba(255, 190, 80, .7); white-space: nowrap; animation: floatUp .95s ease-out both; }
.floater.hot { color: #ffb060; font-size: 1.1rem; }
.floater.gold { color: #f6e7c0; font-size: 1.05rem; letter-spacing: .2em; }
.floater.green { color: #a8ffd8; letter-spacing: .16em; }
.floater.warn { color: #ff9a8a; font-size: 1.25rem; letter-spacing: .3em; }
.floater.big { font-family: var(--serif); font-weight: 400; font-size: clamp(1.3rem, 4vw, 2rem); letter-spacing: .04em; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -170%) scale(1); } }

.touch { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); display: flex; gap: 14px; align-items: flex-end; z-index: 5; }
.tbtn { width: 68px; height: 68px; border-radius: 50%; font-size: 1.9rem; color: var(--aqua); background: rgba(7, 17, 29, .5); border: 1px solid rgba(143, 233, 218, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); touch-action: none; font-family: 'Segoe UI Symbol', 'Apple Symbols', sans-serif; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--ink); z-index: 40; }

/* ---------- narrow and short screens ---------- */
@media (max-width: 1280px) { .sound span { display: none; } .sound { padding: 0; width: 40px; justify-content: center; } }
@media (max-width: 1100px) {
  .nav { display: none; } .hero-links { display: flex; } .top-actions { margin-left: auto; }
  .brand span { font-size: 1rem; } .brand svg { width: 36px; height: 36px; } .brand small { font-size: .6rem; letter-spacing: .2em; }
}
@media (max-width: 620px) {
  body.is-home .scrim { background: linear-gradient(180deg, rgba(5, 12, 22, .6) 0%, rgba(5, 12, 22, 0) 16%); }
  /* a phone: the page scrolls. He swims in the window at the top; the words ride on a dark sheet that slides up over the water */
  .home { --fp: 0px; scrollbar-width: none; }
  .home::-webkit-scrollbar { display: none; }
  .hero { position: relative; z-index: 0; display: block; min-height: 0; padding-top: 30svh; padding-bottom: 14px; }
  .hero::before { content: ''; position: absolute; z-index: -1; left: -100vw; right: -100vw; top: 0; bottom: 0; background: linear-gradient(180deg, rgba(5, 12, 22, 0) calc(30svh - 26px), rgba(5, 12, 22, .82) calc(30svh + 10px), rgba(5, 12, 22, .96) calc(30svh + 190px)); }
  .home-foot { position: relative; z-index: 1; align-self: stretch; flex: none; order: 2; left: auto; right: auto; bottom: auto; margin: 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); background: rgba(5, 12, 22, .96); box-shadow: 0 0 0 100vw rgba(5, 12, 22, .96); clip-path: inset(0 -100vw); }
  .strip { position: relative; z-index: 1; align-self: stretch; flex: none; order: 3; left: auto; right: auto; bottom: auto; display: block; padding: 0 0 max(26px, env(safe-area-inset-bottom)); background: rgba(5, 12, 22, .96); box-shadow: 0 0 0 100vw rgba(5, 12, 22, .96); clip-path: inset(0 -100vw); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .more { order: 4; }
  .step, .step:first-child { border-left: 0; border-top: 1px solid var(--line2); padding: 18px 2px; gap: 16px; } .step:first-child { border-top: 0; } .step h2 { font-size: 1.1rem; }
  .hero h1 { margin-top: 16px; } .lede { margin-top: 14px; font-size: .92rem; } .hero-actions { margin-top: 20px; }
  .notes { margin-top: 16px; } .hero-links { margin-top: 14px; } .foot-link { display: none; } .home-foot { justify-content: flex-start; }
  .sound span { display: none; } .sound { padding: 0; width: 40px; justify-content: center; }
  .install.in-top { display: none; } .install.in-hero:not(.hidden) { display: flex; margin-left: auto; font-size: .66rem; height: 44px; padding: 0 16px 0 12px; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 14px; } .hero-actions .cta { flex: 1 0 100%; }
  .bossbar { width: 60vw; top: max(110px, calc(env(safe-area-inset-top) + 100px)); } .hud-goal { top: max(112px, calc(env(safe-area-inset-top) + 102px)); font-size: .64rem; letter-spacing: .2em; }
    .stats { grid-template-columns: repeat(2, 1fr); } .records { grid-template-columns: 1fr; } .keys { grid-template-columns: 96px 1fr; } .chrow { grid-template-columns: 26px 1fr auto; } .chrow .go { display: none; }
  .tip { top: max(186px, calc(env(safe-area-inset-top) + 176px)); font-size: .86rem; padding: 10px 14px; }
}
@media (max-height: 760px) and (min-width: 621px) { .step p { display: none; } .strip { padding: 16px 0 18px; } .home { --fp: calc(max(20px, env(safe-area-inset-bottom)) + 130px); } .hero h1 { font-size: clamp(2.2rem, 4.6vw, 4rem); margin-top: 18px; } .lede { margin-top: 16px; } .hero-actions { margin-top: 24px; } .notes { margin-top: 18px; } }
@media (orientation: portrait) and (min-width: 621px) { .home { --fp: calc(max(20px, env(safe-area-inset-bottom)) + 210px); } .hero { justify-content: flex-end; } }
/* not enough height for the words and the strip together: the words win */
@media (max-height: 640px) and (min-width: 621px), (max-height: 720px) and (min-width: 621px) and (max-width: 1100px) { .strip { display: none; } .home { --fp: calc(max(20px, env(safe-area-inset-bottom)) + 64px); } }
@media (max-width: 1000px) and (min-width: 621px) { .step svg { display: none; } .step { padding-left: 18px; padding-right: 12px; gap: 12px; } .step h2 { font-size: 1.05rem; } .step p { font-size: .78rem; } }
@media (max-height: 560px) {
  .strip, .callout { display: none; } .home { --fp: calc(max(22px, env(safe-area-inset-bottom)) + 44px); }
  .tip { top: 82px; max-width: calc(100vw - 300px); font-size: .8rem; padding: 7px 12px; }
  .screen { padding-top: max(16px, env(safe-area-inset-top)); }
  .hero h1 { font-size: clamp(1.8rem, 9vh, 3rem); margin-top: 10px; } .lede { display: none; } .hero-actions { margin-top: 16px; } .notes { margin-top: 12px; } .hero-links { margin-top: 10px; }
  .panel { width: min(820px, 100%); padding: 16px 28px; } .panel h2 { font-size: 1.5rem; margin-top: 8px; } .mark, .deva { display: none; } .panel .body { margin-top: 8px; font-size: .88rem; line-height: 1.45; }
  .panel .cta { margin-top: 14px; min-height: 46px; } .cta i { width: 34px; height: 34px; } .links { margin-top: 12px; } .goal, .how { margin-top: 8px; padding: 8px 12px; font-size: .82rem; } .src { margin-top: 10px; }
  .rank { font-size: 2.2rem; } .stats { margin-top: 10px; padding: 10px 0; gap: 8px; } .banner { top: 22%; }
}
@media (prefers-reduced-motion: reduce) { .panel, .loading svg { animation: none; } }
a.cta { text-decoration: none; } a.cta i { font-style: normal; }


.rank.word { font-size: clamp(1.7rem, 5vw, 2.4rem); letter-spacing: .01em; }
.chrow .r b { font-size: .92rem; }
@media (pointer: coarse) {
  .link, .foot-link, .record, .nav button { min-height: 44px; display: inline-flex; align-items: center; gap: .32em; }
  .links { margin-top: 8px; gap: 0 26px; } .hero-links { gap: 0 22px; } .hero #btn-new { display: inline-flex; margin-top: 2px; } .hero #btn-new.hidden { display: none; }
  .home-foot { padding-top: 4px; }
}
@media (pointer: coarse) and (max-width: 620px) { .foot-link { display: none; } .hero-links { margin-top: 4px; gap: 0 16px; } .hero-links .link { font-size: .8rem; } .notes { margin-top: 10px; } .home-foot { padding-top: 2px; padding-bottom: max(8px, env(safe-area-inset-bottom)); } }
