/* ENZOJUMPER — interface. Calm, botanical, editorial. */
:root {
  --bg: #0c1510;
  --ink: #0f1a13;
  --surface: rgba(16, 27, 20, .74);
  --surface-2: rgba(24, 39, 30, .88);
  --surface-solid: #142219;
  --line: rgba(232, 241, 228, .10);
  --line-2: rgba(232, 241, 228, .18);
  --text: #eef3ea;
  --text-2: #bccab9;
  --text-3: #8a9a8d;
  --accent: #b8dd86;
  --accent-2: #94c26a;
  --accent-ink: #172412;
  --amber: #e8c27e;
  --rose: #e9a8a4;
  --danger: #df7d70;
  --violet: #b9aee6;
  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Noto Sans', sans-serif;
  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .38), 0 2px 10px rgba(0, 0, 0, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --glass: blur(22px) saturate(140%);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 15px; overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; font-feature-settings: 'ss01', 'cv11'; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ico { display: block; flex: none; }
::selection { background: rgba(184, 221, 134, .35); }

#app { position: fixed; inset: 0; overflow: hidden; background: var(--bg); transform-origin: 50% 50%; transition: transform 1.6s var(--ease), border-radius 1.6s, box-shadow 1.6s; z-index: 1; }
#game, #game3d, #post { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 50% 45%, transparent 60%, rgba(5, 10, 7, .35) 100%); }
body.fxon #game, body.fxon #game3d { visibility: hidden !important; }
body:not(.fxon) #post { visibility: hidden; }

/* ───────── buttons ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: var(--r-sm); border: 1px solid transparent; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14.5px; letter-spacing: -.005em; cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s, opacity .2s; box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 18px rgba(0, 0, 0, .25); white-space: nowrap; }
.btn:hover { background: #c6e79a; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: rgba(255, 255, 255, .04); color: var(--text); border-color: var(--line-2); box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); border-color: rgba(232, 241, 228, .3); }
.btn.violet { background: rgba(185, 174, 230, .16); color: #e4ddff; border-color: rgba(185, 174, 230, .35); box-shadow: none; }
.btn.violet:hover { background: rgba(185, 174, 230, .24); }
.btn.warn { background: var(--amber); color: #2b1e08; }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(223, 125, 112, .45); box-shadow: none; }
.btn.danger:hover { background: rgba(223, 125, 112, .1); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); color: var(--text); cursor: pointer; transition: background .2s, border-color .2s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }

/* ───────── HUD ───────── */
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 10; transition: opacity .4s; }
.hud-left { position: absolute; top: 16px; left: 18px; display: flex; flex-direction: column; gap: 6px; }
.hud-right { position: absolute; top: 16px; right: 18px; display: flex; gap: 8px; align-items: center; pointer-events: auto; }
.hud-center { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
button.pill { cursor: pointer; transition: background .2s; }
button.pill:hover { background: var(--surface-2); }
.pill img { width: 15px; height: 15px; }
.pill b { font-weight: 600; }
.pill.level { gap: 8px; }
.pill.level .lv { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); font-weight: 600; }
.pill.level b { font-family: var(--display); font-weight: 500; font-size: 20px; }
.online .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(184, 221, 134, .18); }
.online.off .dot { background: var(--danger); box-shadow: none; }
.timer { padding-left: 4px; font-size: 12.5px; color: rgba(238, 243, 234, .7); font-variant-numeric: tabular-nums; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.timer.par-miss { color: var(--amber); }
.race-chip { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; border-radius: 14px; background: var(--surface); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid rgba(185, 174, 230, .3); font-size: 13.5px; box-shadow: var(--shadow); }
.meter { position: absolute; left: 18px; bottom: calc(18px + var(--safe-b)); width: 250px; height: 30px; border-radius: 10px; background: var(--surface); backdrop-filter: var(--glass); border: 1px solid var(--line); overflow: hidden; }
.meter i { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, rgba(232, 194, 126, .55), rgba(255, 236, 190, .7)); transition: width 1s; }
.meter span { position: relative; z-index: 1; display: block; font-size: 12px; padding: 7px 10px; font-weight: 600; white-space: nowrap; }
.combo { position: absolute; left: 50%; top: 96px; transform: translateX(-50%) scale(.8); font-family: var(--display); font-size: 30px; font-weight: 500; color: var(--text); opacity: 0; transition: transform .2s var(--ease), opacity .45s; white-space: nowrap; text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }
.combo.on { opacity: 1; transform: translateX(-50%) scale(1); }
.combo.big { color: var(--amber); }
#hud.fallen .hud-left, #hud.fallen .hud-right { transition: transform 1s cubic-bezier(.5, 0, .9, .4), opacity 1s; transform: translateY(110vh) rotate(14deg); opacity: 0; }

/* level intro */
.intro { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); z-index: 22; text-align: center; pointer-events: none; width: min(680px, 92vw); animation: intro 3.2s var(--ease) forwards; text-shadow: 0 2px 22px rgba(0, 0, 0, .55); }
.intro .in-ch { font-size: 11.5px; text-transform: uppercase; letter-spacing: .22em; color: var(--text-2); font-weight: 600; }
.intro .in-lv { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 7vw, 72px); line-height: 1.05; margin-top: 6px; letter-spacing: -.02em; }
.intro .in-place { font-size: 16px; color: var(--text-2); margin-top: 6px; }
.intro .in-tags { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.intro .in-tags span { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(12, 21, 16, .55); backdrop-filter: blur(10px); border: 1px solid var(--line-2); color: var(--text); text-shadow: none; }
@keyframes intro { 0% { opacity: 0; transform: translate(-50%, 14px); filter: blur(8px); } 16% { opacity: 1; transform: translate(-50%, 0); filter: blur(0); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }

/* ───────── toasts, news, popups ───────── */
.toast { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; gap: 12px; align-items: center; max-width: min(560px, 92vw); padding: 10px 16px 10px 10px; background: var(--surface-2); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); animation: drop .4s var(--ease); pointer-events: none; }
.toast .tp { width: 40px; height: 40px; flex: none; border-radius: 10px; background: rgba(255, 255, 255, .05); padding: 3px; }
.toast .tn { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.toast .tt { margin: 2px 0 0; font-size: 14.5px; line-height: 1.45; }
@keyframes drop { from { transform: translate(-50%, -14px); opacity: 0; } }
.news { position: absolute; right: 18px; top: 66px; z-index: 18; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none; }
.news div { background: var(--surface-2); backdrop-filter: var(--glass); border: 1px solid var(--line); padding: 8px 12px; border-radius: 12px; font-size: 13px; animation: slidein .4s var(--ease); max-width: 70vw; }
@keyframes slidein { from { transform: translateX(16px); opacity: 0; } }
.pops { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 25; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.pop { display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 12px; background: var(--surface-2); backdrop-filter: var(--glass); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow); animation: popin .45s var(--ease); }
.pop .pi { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: rgba(232, 194, 126, .16); color: var(--amber); font-size: 16px; }
.pop small { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); font-weight: 600; }
.pop b { font-size: 14.5px; font-weight: 600; }
@keyframes popin { from { transform: translateY(8px) scale(.97); opacity: 0; } }

/* ───────── dialogue ───────── */
.dialog { position: absolute; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translateX(-50%); z-index: 30; width: min(780px, 94vw); display: flex; gap: 16px; padding: 18px 20px 18px 18px; background: var(--surface-2); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow); cursor: pointer; animation: rise .45s var(--ease); }
@keyframes rise { from { transform: translate(-50%, 16px); opacity: 0; } }
.dportrait { width: 76px; height: 76px; flex: none; border-radius: 18px; background: radial-gradient(circle at 50% 35%, rgba(184, 221, 134, .18), rgba(255, 255, 255, .03) 70%); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.dportrait img { width: 64px; height: 64px; object-fit: contain; transition: transform .2s; }
.dportrait.speaking img { animation: talk .2s infinite alternate; }
@keyframes talk { to { transform: translateY(-1.5px) scale(1.02); } }
.dbody { flex: 1; min-width: 0; padding-top: 2px; }
.dname { font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; margin-bottom: 7px; }
.dtext { font-size: 18px; line-height: 1.55; min-height: 54px; overflow-wrap: anywhere; color: var(--text); }
.dtext.glyph { font-family: var(--display); font-size: 30px; letter-spacing: .12em; color: var(--amber); }
.dtext.foreign { font-style: italic; color: #d6e6f0; }
.dtext .lang-tag { display: inline-block; font-size: 11px; color: var(--text-3); margin-left: 6px; font-style: normal; text-transform: uppercase; letter-spacing: .1em; }
.dtext.moth { font-family: var(--display); font-style: italic; color: #ded6f6; }
.dchoices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dnext { position: absolute; right: 22px; bottom: 14px; width: 8px; height: 8px; border-right: 1.5px solid var(--text-2); border-bottom: 1.5px solid var(--text-2); transform: rotate(45deg); animation: bob .9s ease-in-out infinite alternate; font-size: 0; }
@keyframes bob { to { transform: translateY(3px) rotate(45deg); } }
.dskip { position: absolute; top: 12px; right: 14px; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text-3); cursor: pointer; font-size: 12px; }
.dskip:hover { color: var(--text); }

/* ───────── screens & panels ───────── */
#screens { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.screen { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; overflow: auto; pointer-events: auto; background: rgba(6, 11, 8, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadein .3s; }
@keyframes fadein { from { opacity: 0; } }
.panel { position: relative; width: min(720px, 100%); max-height: min(86vh, 100%); overflow: auto; padding: 28px 28px 24px; background: var(--surface-2); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; animation: panelin .4s var(--ease); }
@keyframes panelin { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.panel.wide { width: min(1000px, 100%); }
.panel.narrow { width: min(470px, 100%); }
.panel h2 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: -.015em; margin: 0 0 18px; padding-right: 44px; line-height: 1.15; }
.panel h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .16em; font-weight: 600; color: var(--text-3); margin: 22px 0 10px; }
.panel p { line-height: 1.6; color: var(--text-2); }
.panel .close { position: absolute; top: 20px; right: 20px; width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--text-2); cursor: pointer; font-size: 14px; transition: background .2s, color .2s; }
.panel .close:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 10px; }
.muted { color: var(--text-3) !important; }
.list { display: flex; flex-direction: column; gap: 6px; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .025); }
.item.on { border-color: rgba(184, 221, 134, .4); background: rgba(184, 221, 134, .06); }
.item .grow { flex: 1; min-width: 0; }
.item small { color: var(--text-3); display: block; font-size: 12px; }
input[type=text], input[type=number] { font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--text); outline: none; min-width: 0; transition: border-color .2s, box-shadow .2s; }
input:focus { border-color: rgba(184, 221, 134, .6); box-shadow: 0 0 0 4px rgba(184, 221, 134, .12); }
select { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25) !important; color: var(--text) !important; border: 1px solid var(--line-2) !important; }
input[type=range] { width: 100%; accent-color: var(--accent); }
label { color: var(--text-2); font-size: 14px; display: grid; gap: 8px; }
label.toggle { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--text); background: rgba(255, 255, 255, .02); transition: background .2s; }
label.toggle:hover { background: rgba(255, 255, 255, .04); }
label.toggle input { appearance: none; -webkit-appearance: none; width: 38px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, .15); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
label.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
label.toggle input:checked { background: var(--accent-2); }
label.toggle input:checked::after { transform: translateX(16px); }
kbd { font-family: var(--ui); font-size: 12px; padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: rgba(255, 255, 255, .04); white-space: nowrap; }

/* ───────── title ───────── */
.screen.title-screen { background: linear-gradient(90deg, rgba(8, 14, 10, .82) 0%, rgba(8, 14, 10, .55) 42%, rgba(8, 14, 10, .05) 100%); backdrop-filter: none; -webkit-backdrop-filter: none; place-items: center start; padding: clamp(24px, 7vw, 96px); }
.title-wrap { display: flex; flex-direction: column; gap: 22px; width: min(520px, 100%); animation: titlein .9s var(--ease); }
@keyframes titlein { from { opacity: 0; transform: translateY(14px); } }
.brand { display: flex; align-items: center; gap: 14px; }
.brand .mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(184, 221, 134, .14); color: var(--accent); border: 1px solid rgba(184, 221, 134, .25); }
.brand .over { font-size: 12px; text-transform: uppercase; letter-spacing: .24em; color: var(--text-2); font-weight: 600; }
.wordmark { font-family: var(--display); font-weight: 400; font-size: clamp(54px, 8vw, 92px); line-height: .95; letter-spacing: -.035em; margin: 0; }
.wordmark em { font-style: italic; color: var(--accent); }
.tagline { color: var(--text-2); font-size: 17px; line-height: 1.6; margin: 0; max-width: 440px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.cta .btn { padding: 14px 22px; font-size: 15.5px; border-radius: 14px; }
.navlist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.navlist button { display: flex; align-items: center; gap: 14px; padding: 14px 4px; background: none; border: none; border-bottom: 1px solid var(--line); color: var(--text); cursor: pointer; text-align: left; font-size: 16px; transition: padding .25s var(--ease), color .2s; }
.navlist button .ico { color: var(--text-3); transition: color .2s; }
.navlist button span { flex: 1; }
.navlist button small { color: var(--text-3); font-size: 13px; }
.navlist button .chev { opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .25s var(--ease); color: var(--text-3); }
.navlist button:hover { padding-left: 10px; }
.navlist button:hover .ico, .navlist button:hover .chev { color: var(--accent); }
.navlist button:hover .chev { opacity: 1; transform: none; }
.navlist button.live small { color: var(--violet); }
.iconbar { display: flex; gap: 6px; flex-wrap: wrap; }
.iconbar .ib { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, border-color .2s; position: relative; }
.iconbar .ib:hover { background: rgba(255, 255, 255, .08); color: var(--text); border-color: var(--line-2); }
.iconbar .ib small { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); background: var(--surface-solid); border: 1px solid var(--line-2); padding: 4px 8px; border-radius: 8px; font-size: 12px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; color: var(--text); }
.iconbar .ib:hover small { opacity: 1; }
.title-stats { position: absolute; right: clamp(20px, 4vw, 48px); bottom: calc(clamp(20px, 4vw, 40px) + var(--safe-b)); display: grid; grid-template-columns: repeat(2, auto); gap: 12px 28px; padding: 18px 22px; border-radius: 20px; background: var(--surface); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line); animation: titlein 1.1s var(--ease); }
.title-stats div { display: flex; flex-direction: column; gap: 2px; }
.title-stats b { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.title-stats small { color: var(--text-3); font-size: 12px; }
.title-stats .live b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 4px rgba(184, 221, 134, .18); }
.ver { position: absolute; bottom: calc(14px + var(--safe-b)); left: clamp(24px, 7vw, 96px); font-size: 12px; color: rgba(238, 243, 234, .35); }

/* ───────── specific screens ───────── */
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.chapter { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .02); }
.chapter h4 { margin: 0; font-family: var(--display); font-weight: 500; font-size: 17px; }
.chapter p { margin: 4px 0 12px; font-size: 13px; color: var(--text-3); }
.lvls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lvl { position: relative; padding: 9px 0; font-size: 13px; font-weight: 600; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--text); cursor: pointer; transition: background .2s, border-color .2s; font-variant-numeric: tabular-nums; }
.lvl:hover:not(:disabled) { background: rgba(255, 255, 255, .08); border-color: var(--line-2); }
.lvl.done { background: rgba(184, 221, 134, .1); border-color: rgba(184, 221, 134, .3); }
.lvl.story::after { content: ''; position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); }
.lvl .m { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: 10px; }
.lvl:disabled { opacity: .3; cursor: default; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.slot.live { border-color: rgba(185, 174, 230, .45); background: rgba(185, 174, 230, .06); }
.slot.lobby { border-color: rgba(232, 194, 126, .45); }
.slot .when { font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 54px; font-weight: 600; }
.slot.none { opacity: .45; }
.results { display: flex; flex-direction: column; gap: 6px; }
.result { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.result.me { border-color: rgba(184, 221, 134, .45); }
.result .rk { width: 30px; color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 600; }
.result .grow { flex: 1; }
.medals { display: flex; gap: 10px; justify-content: center; margin: 6px 0 16px; flex-wrap: wrap; }
.medal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px; border-radius: 16px; border: 1px solid var(--line); min-width: 96px; opacity: .3; transition: opacity .3s; }
.medal.on { opacity: 1; animation: popin .5s var(--ease) both; background: rgba(255, 255, 255, .03); }
.medal .mi { font-size: 26px; }
.medal small { font-size: 12px; color: var(--text-2); text-align: center; }
.medal.gold.on { border-color: rgba(232, 194, 126, .5); }
.medal.leaf.on, .medal.flaw.on { border-color: rgba(184, 221, 134, .4); }
.complete-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; text-align: center; }
.complete-stats div { padding: 14px 10px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.complete-stats b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; font-variant-numeric: tabular-nums; }
.complete-stats small { color: var(--text-3); font-size: 12px; }
.next-preview { margin-top: 14px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--text-2); }
.tracks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.track { text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: background .2s, border-color .2s; }
.track:hover { background: rgba(255, 255, 255, .06); }
.track.on { border-color: rgba(184, 221, 134, .5); background: rgba(184, 221, 134, .07); }
.track b { display: block; font-size: 14.5px; font-weight: 600; }
.track small { color: var(--text-3); font-size: 12px; }
.viz { display: flex; align-items: flex-end; gap: 3px; height: 44px; margin: 10px 0 16px; }
.viz i { flex: 1; background: var(--accent-2); border-radius: 2px; min-height: 2px; opacity: .8; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); transition: transform .15s; }
.swatch:hover { transform: scale(1.08); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.hats { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.hat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); cursor: pointer; transition: background .2s; }
.hat:hover { background: rgba(255, 255, 255, .06); }
.hat.on { border-color: rgba(184, 221, 134, .5); background: rgba(184, 221, 134, .07); }
.hat.locked { opacity: .5; }
.hat canvas { width: 70px; height: 70px; }
.hat small { font-size: 12px; color: var(--text-2); font-weight: 600; }
.preview { display: grid; place-items: center; border-radius: 18px; background: radial-gradient(circle at 50% 60%, rgba(184, 221, 134, .14), transparent 70%); padding: 8px; }
.achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.ach { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); opacity: .45; }
.ach.on { opacity: 1; border-color: rgba(232, 194, 126, .4); }
.ach b { display: block; font-size: 14px; font-weight: 600; }
.ach small { color: var(--text-3); font-size: 12.5px; }
.langs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.lang { padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); cursor: pointer; text-align: left; font-size: 14px; transition: background .2s; }
.lang:hover { background: rgba(255, 255, 255, .07); }
.lang.on { border-color: rgba(184, 221, 134, .55); background: rgba(184, 221, 134, .08); }
.emotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.emotes .btn { white-space: normal; text-align: center; }
.emotes .emoji { font-size: 22px; padding: 8px; }
.votes { display: flex; flex-direction: column; gap: 10px; }
.vote { position: relative; overflow: hidden; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .02); cursor: pointer; }
.vote:hover { background: rgba(255, 255, 255, .05); }
.vote.mine { border-color: rgba(232, 194, 126, .55); }
.vote .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(184, 221, 134, .1); transition: width 1s var(--ease); }
.vote b, .vote small, .vote span { position: relative; }
.vote b { display: block; font-family: var(--display); font-weight: 500; font-size: 19px; }
.vote small { color: var(--text-3); }
.vote span { float: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.code-box { font-size: 20px; letter-spacing: .14em; padding: 10px 16px; border-radius: 12px; border: 1px dashed var(--line-2); background: rgba(0, 0, 0, .2); user-select: all; -webkit-user-select: all; font-variant-numeric: tabular-nums; }
.rules { counter-reset: r; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rules li { counter-increment: r; position: relative; padding: 12px 14px 12px 50px; border-radius: 14px; background: rgba(255, 255, 255, .02); border: 1px solid var(--line); line-height: 1.5; color: var(--text); }
.rules li::before { content: counter(r); position: absolute; left: 14px; top: 11px; width: 24px; height: 24px; border-radius: 8px; background: rgba(184, 221, 134, .14); color: var(--accent); display: grid; place-items: center; font-size: 12.5px; font-weight: 700; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; align-items: center; color: var(--text-2); }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; }

/* ───────── touch ───────── */
.touch { position: absolute; left: 0; right: 0; bottom: calc(14px + var(--safe-b)); z-index: 15; display: flex; justify-content: space-between; padding: 0 16px; pointer-events: none; }
.touch button { pointer-events: auto; width: 70px; height: 70px; border-radius: 22px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(12, 21, 16, .6); color: rgba(255, 255, 255, .85); font-size: 20px; touch-action: none; /* no backdrop blur: it re-blurs the moving world under each button every frame */ display: grid; place-items: center; }
.touch button.on { background: rgba(184, 221, 134, .3); }
.touch .tleft, .touch .tright { display: flex; gap: 12px; align-items: flex-end; }
.touch .small { width: 50px; height: 50px; border-radius: 16px; }
.touch .jump { width: 88px; height: 88px; border-radius: 50%; }
body.in-title .touch { display: none; }

/* ───────── transitions & screen effects ───────── */
.fade { position: absolute; inset: 0; z-index: 60; pointer-events: none; }
.fade i { position: absolute; left: 50%; top: 50%; width: 260vmax; height: 260vmax; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 300vmax #0a120d; transition: width .55s cubic-bezier(.7, 0, .3, 1), height .55s cubic-bezier(.7, 0, .3, 1); }
.fade.on i { width: 0; height: 0; }
#fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
#fx > * { pointer-events: auto; }
#fx .crack-layer, #fx .shard-layer, #fx .flash, #fx .screenglow { pointer-events: none; position: fixed; inset: 0; width: 100%; height: 100%; }
.code-rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.flash { background: #fff; animation: flash .4s forwards; }
.flash.red { background: #ff3b4f; }
.flash.green { background: var(--accent); }
@keyframes flash { to { opacity: 0; } }
.screenglow { background: radial-gradient(ellipse at center, rgba(255, 255, 245, 0) 0%, rgba(240, 248, 236, .6) 72%, rgba(255, 255, 255, .9) 100%); animation: glow 4.2s ease-in-out forwards; }
@keyframes glow { 0% { opacity: 0; } 30%, 60% { opacity: 1; } 100% { opacity: 0; } }
#app.shaking { animation: shake .5s; }
@keyframes shake { 10%, 50%, 90% { transform: translate(var(--shake), calc(var(--shake) * -.5)); } 30%, 70% { transform: translate(calc(var(--shake) * -1), calc(var(--shake) * .5)); } }
body.glitching #hud { animation: jitter .12s steps(2) infinite; }
@keyframes jitter { 50% { transform: translate(2px, -1px); } }
body.inverted #game, body.inverted #game3d, body.inverted #post { filter: invert(1) hue-rotate(180deg); }
body.behind #game, body.behind #game3d, body.behind #post { filter: invert(1) hue-rotate(180deg) contrast(1.15); opacity: .72; z-index: 1; }
body.behind #app { background: #000; }
body.dimmed #game, body.dimmed #game3d, body.dimmed #post { filter: brightness(.35) saturate(.6); transition: filter 2s; }
body.mono #game, body.mono #game3d { filter: grayscale(1) sepia(.6) hue-rotate(50deg) saturate(1.6); }
body.shrunk { background: #6f9a6a; }
body.shrunk #app { transform: scale(.56) rotate(-1deg); border-radius: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 10px #1a1d1b; }
#outside { display: none; position: fixed; inset: 0; z-index: 0; background: linear-gradient(180deg, #a9d4ef 0%, #e2f1f7 38%, #8fbf7d 39%, #5b8e4b 100%); place-items: end center; }
body.shrunk #outside, body.lifted #outside { display: grid; }
#outside span { font-family: var(--display); font-style: italic; color: #24461c; font-size: 18px; margin-bottom: 22px; opacity: .7; }
body.lifted #app { transform: translateY(-110%); transition: transform 3.5s cubic-bezier(.6, 0, .2, 1); }
.fake-window { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(440px, 92vw); background: #ecefec; color: #111; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .6); font-family: system-ui, sans-serif; overflow: hidden; animation: popin .25s; }
.fw-title { display: flex; justify-content: space-between; padding: 9px 14px; background: linear-gradient(#f8f8f8, #e0e0e0); font-size: 13px; font-weight: 600; }
.fw-x { cursor: pointer; }
.fw-body { display: flex; gap: 14px; padding: 18px 16px; align-items: center; }
.fw-body p { margin: 0; font-size: 14px; }
.fw-body.list ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.fw-icon { width: 40px; height: 40px; border-radius: 50%; background: #f5c33b; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.fw-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; background: #f3f3f3; }
.fw-buttons button { padding: 6px 14px; border-radius: 7px; border: 1px solid #aaa; background: #fff; cursor: pointer; font-size: 13px; }
.boot-screen { position: fixed; inset: 0; background: #050806; color: #cfe7c2; font-family: ui-monospace, 'SF Mono', monospace; font-size: 14px; padding: 48px; display: flex; flex-direction: column; gap: 8px; transition: opacity .5s; }
.boot-screen.out { opacity: 0; }
.store-popup { position: fixed; right: 32px; top: 28%; width: 240px; padding: 20px; border-radius: 22px; background: linear-gradient(160deg, #fff3d6, #f2c37a); color: #3a2205; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); transform: translateX(140%) rotate(5deg); transition: transform .55s var(--ease); font-weight: 700; }
.store-popup.in { transform: translateX(0) rotate(-2deg); }
.store-badge { position: absolute; top: -10px; left: -10px; background: var(--danger); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 11px; transform: rotate(-8deg); letter-spacing: .08em; }
.store-title { font-family: var(--display); font-size: 19px; font-weight: 500; }
.store-art { font-size: 60px; line-height: 1.1; }
.store-price { font-size: 21px; }
.rest-stop { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 26px; align-items: center; justify-content: center; background: rgba(8, 14, 10, .82); backdrop-filter: blur(8px); }
.breath { width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(184, 221, 134, .35), rgba(184, 221, 134, .05)); border: 1px solid rgba(184, 221, 134, .5); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.55); } 50% { transform: scale(1.25); } }
.breath-label { font-family: var(--display); font-size: 26px; font-weight: 400; color: var(--text); }
.fake-win { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 230, 160, .3), rgba(0, 0, 0, .8)); font-family: var(--display); font-size: clamp(48px, 10vw, 120px); color: #ffe7a6; overflow: hidden; transition: filter 2s, opacity 2s; }
.fake-win.hollow { filter: grayscale(1) blur(2px); opacity: .5; }
.confetti { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall 2.6s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
.credits-roll { position: fixed; inset: 0; background: #0a120d; overflow: hidden; transition: opacity .7s; }
.credits-roll.out { opacity: 0; }
.credits-inner { position: absolute; left: 50%; transform: translateX(-50%); width: min(620px, 88vw); text-align: center; animation: roll 22s linear forwards; top: 100%; }
.credits-roll.fake .credits-inner { animation-duration: 7s; }
@keyframes roll { to { transform: translate(-50%, calc(-100% - 100vh)); } }
.credits-inner h1 { font-family: var(--display); font-weight: 400; font-size: 52px; letter-spacing: -.02em; }
.credits-inner h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--text-3); margin-top: 44px; font-weight: 600; }
.credits-inner p { font-size: 19px; line-height: 1.7; color: var(--text-2); margin: 18px 0; }
.credits-logo { width: 70%; opacity: .9; }
.credits-skip { position: absolute; bottom: 24px; right: 24px; }
.sun-button { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 20px; }
.sun-button .btn { font-size: 17px; padding: 16px 28px; background: #f6d79c; color: #3a2a0c; }
.sun-button p { max-width: 520px; font-size: 18px; line-height: 1.55; background: var(--surface-2); backdrop-filter: var(--glass); padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line-2); }

/* ───────── talking to someone ───────── */
.talk { position: absolute; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 35; width: min(720px, 95vw); max-height: min(64vh, 580px); display: flex; flex-direction: column; background: var(--surface-2); backdrop-filter: var(--glass); -webkit-backdrop-filter: var(--glass); border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow); animation: rise .45s var(--ease); overflow: hidden; }
.talk.done { border-color: rgba(233, 168, 164, .5); }
.tk-head { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.tk-portrait { width: 56px; height: 56px; border-radius: 16px; background: radial-gradient(circle at 50% 35%, rgba(184, 221, 134, .2), rgba(255, 255, 255, .03) 70%); border: 1px solid var(--line); display: grid; place-items: center; flex: none; transition: transform .3s var(--ease), background .4s; }
.tk-portrait img { width: 46px; height: 46px; object-fit: contain; }
.tk-portrait[data-mood=angry] { background: radial-gradient(circle, rgba(223, 125, 112, .3), transparent 70%); animation: jitter .14s steps(2) 6; }
.tk-portrait[data-mood=sad], .tk-portrait[data-mood=afraid] { transform: translateY(2px) scale(.96); filter: saturate(.7); }
.tk-portrait[data-mood=moved], .tk-portrait[data-mood=warm] { background: radial-gradient(circle, rgba(233, 168, 164, .3), transparent 70%); }
.tk-meta { flex: 1; min-width: 0; }
.tk-name { font-family: var(--display); font-weight: 500; font-size: 18px; }
.tk-trust { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); margin: 8px 0 4px; overflow: hidden; max-width: 260px; }
.tk-trust i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--rose), var(--amber), var(--accent)); transition: width .9s var(--ease); }
.tk-mood { color: var(--text-3); font-size: 12px; text-transform: lowercase; }
.tk-close { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; }
.tk-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; }
.tk-line { max-width: 82%; padding: 11px 15px; border-radius: 18px; font-size: 15.5px; line-height: 1.5; animation: popin .3s var(--ease); overflow-wrap: anywhere; }
.tk-line.them { align-self: flex-start; background: rgba(255, 255, 255, .06); border-bottom-left-radius: 6px; }
.tk-line.me { align-self: flex-end; background: rgba(184, 221, 134, .2); border-bottom-right-radius: 6px; }
.tk-line.sys { align-self: center; background: transparent; color: var(--rose); font-size: 13px; font-weight: 600; }
.tk-line.thinking { opacity: .55; animation: blink 1s ease-in-out infinite alternate; }
@keyframes blink { to { opacity: .2; } }
.tk-input { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.tk-input input { flex: 1; }
.tk-input button { width: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--text); cursor: pointer; display: grid; place-items: center; touch-action: none; }
.tk-input .tk-send { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tk-input .tk-mic.rec { background: rgba(223, 125, 112, .25); border-color: var(--danger); }

.noscript { position: fixed; inset: 0; display: grid; place-items: center; color: var(--text); font-family: var(--display); font-size: 20px; }

@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .hud-left { top: 10px; left: 10px; }
  .hud-right { top: 10px; right: 10px; gap: 6px; }
  .pill { height: 34px; padding: 0 11px; }
  .icon-btn { width: 34px; height: 34px; }
  .hud-center { top: 54px; }
  .dialog { bottom: calc(104px + var(--safe-b)); padding: 14px; gap: 12px; border-radius: 18px; }
  .dportrait { width: 54px; height: 54px; border-radius: 14px; }
  .dportrait img { width: 46px; height: 46px; }
  .dtext { font-size: 16px; }
  .panel { padding: 22px 18px; border-radius: 20px; }
  .panel h2 { font-size: 24px; }
  .toast { top: 56px; }
  .screen.title-screen { place-items: start; padding: 28px 22px; background: linear-gradient(180deg, rgba(8, 14, 10, .85), rgba(8, 14, 10, .55) 70%, rgba(8, 14, 10, .3)); }
  .title-stats { position: static; margin-top: 4px; grid-template-columns: repeat(2, 1fr); }
  .wordmark { font-size: 54px; }
  .tagline { font-size: 15px; }
  .talk { bottom: calc(96px + var(--safe-b)); max-height: 56vh; }
}
body.reduced *, body.reduced *::before, body.reduced *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
.intro .in-tags span.ti { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; }
.medal .mi { display: grid; place-items: center; height: 34px; color: var(--accent); }
.medal.flaw .mi { color: var(--amber); }

/* ─── cinematics ─────────────────────────────────────────────── */
#cine { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
#cine > * { pointer-events: auto; }
#cine > .speedlines, #cine > .attempt, #cine > .vhs, #cine > .winbar { pointer-events: none; }
#app::before, #app::after { content: ''; position: absolute; left: 0; right: 0; height: 0; background: #030504; z-index: 26; pointer-events: none; transition: height .9s var(--ease); }
#app::before { top: 0; }
#app::after { bottom: 0; }
body.cinema #app::before, body.cinema #app::after { height: 11vh; }
body.cinema #hud { opacity: 0; }
body.cinema .dialog { bottom: calc(1.5vh + var(--safe-b)); background: rgba(6, 10, 8, .55); border-color: transparent; box-shadow: none; }

.speedlines { position: absolute; inset: 0; width: 100%; height: 100%; fill: rgba(255, 255, 255, .85); mix-blend-mode: screen; animation: sl-in .12s ease-out; }
.speedlines.dark { fill: rgba(220, 255, 230, .55); }
.speedlines.out { opacity: 0; transition: opacity .25s; }
@keyframes sl-in { from { opacity: 0; transform: scale(1.3); } }

.cc { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 14px; padding: 0 24px; background: radial-gradient(90% 70% at 50% 50%, rgba(3, 6, 4, .35), rgba(3, 6, 4, .82)); animation: cc-bg 1s var(--ease); }
.cc-k { font: 600 12px/1 var(--ui); letter-spacing: .32em; text-transform: uppercase; color: var(--accent); opacity: 0; animation: cc-up .9s .2s var(--ease) forwards; }
.cc-t { margin: 0; font: 400 clamp(44px, 9vw, 120px)/.95 var(--display); letter-spacing: -.02em; color: #f4f8ef; text-shadow: 0 6px 60px rgba(184, 221, 134, .25); }
.cc-t span { display: inline-block; opacity: 0; filter: blur(14px); transform: translateY(28px) scale(1.1); animation: cc-word 1.2s calc(.45s + var(--i) * .16s) var(--ease) forwards; }
.cc-rule { width: 0; height: 1px; margin: 4px auto; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: cc-rule 1.4s .9s var(--ease) forwards; }
.cc-s { margin: 0; font: italic 300 clamp(17px, 2.2vw, 24px)/1.4 var(--display); color: var(--text-2); max-width: 36ch; justify-self: center; opacity: 0; animation: cc-up 1.2s 1.4s var(--ease) forwards; }
.cc.out, .prev.out { opacity: 0; transform: scale(1.04); filter: blur(6px); transition: all .6s var(--ease); }
@keyframes cc-bg { from { opacity: 0; } }
@keyframes cc-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes cc-word { to { opacity: 1; filter: none; transform: none; } }
@keyframes cc-rule { to { width: min(420px, 70vw); } }

.prev { position: absolute; inset: 0; display: grid; place-content: center; gap: 18px; padding: 0 24px; background: rgba(3, 6, 4, .78); animation: cc-bg .8s var(--ease); }
.prev .cc-k { text-align: left; }
.prev h2 { margin: 0; font: 400 clamp(30px, 5vw, 56px)/1 var(--display); opacity: 0; animation: cc-up 1s .3s var(--ease) forwards; }
.prev ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; max-width: 46ch; }
.prev li { font: 300 clamp(16px, 2vw, 20px)/1.45 var(--display); color: var(--text-2); padding-left: 18px; border-left: 2px solid rgba(184, 221, 134, .35); opacity: 0; animation: cc-up 1s calc(.9s + var(--i) * 1.5s) var(--ease) forwards; }

.letter { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(3, 6, 4, .66); backdrop-filter: blur(6px); animation: cc-bg .6s var(--ease); cursor: pointer; }
.lt-paper { position: relative; width: min(520px, 92vw); padding: 34px 36px 30px; color: #2b2a22; background: #f1ead8; background-image: radial-gradient(rgba(120, 100, 60, .12) 1px, transparent 1px), linear-gradient(180deg, #f6f0df, #e9dfc5); background-size: 5px 5px, 100% 100%; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 0 60px rgba(150, 120, 60, .18); transform: rotate(-1.4deg); animation: lt-in 1s var(--ease); }
.lt-paper::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 48%, rgba(0, 0, 0, .05) 50%, transparent 52%); pointer-events: none; }
.lt-k { display: flex; gap: 8px; align-items: center; font: 600 11px/1 var(--ui); letter-spacing: .24em; text-transform: uppercase; color: #6b6a4e; margin-bottom: 18px; }
.lt-paper p { margin: 0; font: italic 400 clamp(18px, 2.3vw, 22px)/1.55 var(--display); white-space: pre-line; clip-path: inset(0 0 100% 0); animation: lt-write 3.4s .5s steps(24) forwards; }
.lt-sign { margin-top: 20px; text-align: right; font: italic 500 20px/1 var(--display); color: #3d5a2a; opacity: 0; animation: cc-up 1s 3.6s var(--ease) forwards; }
.letter.out { opacity: 0; transition: opacity .5s; }
@keyframes lt-in { from { opacity: 0; transform: translateY(40px) rotate(4deg) scale(.94); } }
@keyframes lt-write { to { clip-path: inset(0 0 0 0); } }

body.frozen-frame #game, body.frozen-frame #game3d, body.frozen-frame #post { filter: sepia(.85) saturate(.65) contrast(1.2) brightness(.92); transform: scale(1.07) rotate(-1deg); transition: filter .2s, transform 7s cubic-bezier(.2, .7, .2, 1); }
#game, #game3d, #post { transition: filter .5s, transform .6s var(--ease); }
.freeze { position: absolute; inset: 0; pointer-events: auto; cursor: pointer; }
.freeze::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 2px, transparent 2px 4px); mix-blend-mode: multiply; }
.fz-line { position: absolute; left: 6vw; right: 6vw; top: 15vh; font: italic 400 clamp(22px, 3.4vw, 40px)/1.25 var(--display); color: #fff8e6; text-shadow: 0 4px 30px rgba(0, 0, 0, .7); animation: cc-up .8s var(--ease); max-width: 26ch; }
.fz-tbc { position: absolute; left: 4vw; bottom: 15vh; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 20px; background: #f2e7c9; color: #3a2d12; font: 700 clamp(16px, 2.2vw, 24px)/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; transform: translateX(-130%) skewX(-8deg); animation: tbc-in .5s .7s cubic-bezier(.2, 1.4, .3, 1) forwards; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
.fz-tbc svg { width: 64px; height: 22px; fill: #3a2d12; }
.fz-next { position: absolute; right: 5vw; bottom: 15vh; text-align: right; opacity: 0; animation: cc-up 1s 1.4s var(--ease) forwards; }
.fz-next small { display: block; font: 600 11px/1 var(--ui); letter-spacing: .28em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.fz-next b { font: 400 clamp(22px, 3vw, 36px)/1.1 var(--display); color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .7); }
.freeze.out { opacity: 0; transition: opacity .4s; }
@keyframes tbc-in { to { transform: none; } }

.attempt { position: absolute; left: 18px; top: 58px; font: 700 13px/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .12em; color: #ff6b6b; text-shadow: 2px 0 #0ff, -2px 0 #f0f; animation: att 1.1s steps(2) forwards; }
@keyframes att { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } }

.vhs { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px); }
.vhs b, .vhs i { position: absolute; top: 24px; font: 700 22px/1 ui-monospace, Menlo, monospace; color: #fff; text-shadow: 2px 2px #000; font-style: normal; }
.vhs b { left: 28px; } .vhs i { right: 28px; }

.fall { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(60% 60% at 50% 50%, #0d2216, #020403); }
.fall::after { content: var(--lv); position: absolute; left: 0; right: 0; bottom: 14vh; text-align: center; font: 300 clamp(40px, 9vw, 110px)/1 var(--display); color: rgba(238, 243, 234, .9); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fall-n span { position: absolute; top: 105%; font-family: var(--display); color: rgba(184, 221, 134, .5); animation: fall-n linear forwards; }
.fall-s { position: absolute; left: 50%; top: 46%; width: 92px; filter: drop-shadow(0 0 30px rgba(184, 221, 134, .6)); }
.fall-c { position: absolute; left: 0; right: 0; top: 13vh; text-align: center; font: italic 300 clamp(16px, 2vw, 22px)/1.4 var(--display); color: var(--text-2); padding: 0 24px; }
@keyframes fall-n { to { top: -20%; } }

body.windowed { background: #18221c radial-gradient(70% 70% at 30% 20%, #2c4a36, #0f1712); }
body.windowed #app { transform: scale(.62); border-radius: 12px; box-shadow: 0 40px 120px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .14); transition: transform .5s cubic-bezier(.3, 1.4, .4, 1), translate .12s; }
.winbar { position: absolute; left: 0; right: 0; top: 0; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: linear-gradient(#e9ece8, #cfd5cf); color: #222; font: 600 13px/1 var(--ui); z-index: 3; }
.winbar i { width: 12px; height: 12px; border-radius: 50%; background: #e0605a; } .winbar i:nth-child(2) { background: #e6b54a; } .winbar i:nth-child(3) { background: #62c454; }
.winbar span { margin-left: 10px; } .winbar em { margin-left: auto; font-style: normal; color: #a33; }

body.pulse #vignette { animation: pulse .9s ease-out; }
@keyframes pulse { 0% { box-shadow: inset 0 0 0 0 rgba(120, 10, 20, 0); } 18% { box-shadow: inset 0 0 160px 40px rgba(120, 10, 20, .45); } 100% { box-shadow: inset 0 0 0 0 rgba(120, 10, 20, 0); } }
body.void #game, body.void #game3d, body.void #post, body.void #hud, body.void #intro, body.void #touch { opacity: 0 !important; transition: opacity .3s; }
body.void #app { background: radial-gradient(70% 60% at 50% 45%, #0b1710, #010201); }
body.void .dialog { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.void .dportrait { opacity: .0; width: 0; margin-right: -16px; }
body.void .dtext { font: italic 400 clamp(19px, 2.4vw, 26px)/1.45 var(--display); color: #e9e2c8; }

/* ─── the Split: two owners, two games ───────────────────────── */
#edition { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.ed-badge { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 7px 14px; font-size: 12px; letter-spacing: .06em; white-space: nowrap; }
.ed-kpis { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: min(640px, 92vw); }
.ed-kpis span { display: grid; gap: 2px; padding: 6px 10px; background: #fff; border: 1px solid #d5dae3; border-radius: 4px; color: #1b2230; min-width: 84px; }
.ed-kpis small { font-size: 10px; color: #6b7487; text-transform: uppercase; letter-spacing: .06em; }
.ed-kpis b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ed-kpis .prem { display: flex; align-items: center; gap: 6px; background: #4f6bd8; color: #fff; border-color: #4f6bd8; font-weight: 700; font-size: 13px; }
.ed-rail { position: absolute; top: 0; bottom: 0; width: 320px; padding: 18px 16px; overflow: hidden; pointer-events: auto; }
.ed-b .ed-rail { right: 0; background: #eef1f6; border-left: 1px solid #d5dae3; color: #1b2230; display: flex; flex-direction: column; gap: 16px; }
.ed-b .house { display: grid; gap: 8px; }
.ed-b .house p { margin: 0; padding: 10px 12px; background: #fff; border: 1px solid #d5dae3; border-radius: 4px; font: 600 13px/1.35 Arial, Helvetica, sans-serif; }
.ed-b .house p::after { content: ' →'; color: #4f6bd8; }
.ed-rail small, .ed-multiplex small { display: block; font: 600 10px/1 Arial, Helvetica, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #6b7487; margin-bottom: 6px; }
.ed-b .ad { flex: 1; min-height: 280px; }
.ed-multiplex { margin-top: 22px; padding: 12px; background: #fff; border-radius: 6px; min-height: 120px; }
body.ed-railed.edition-b #game, body.ed-railed.edition-b #game3d, body.ed-railed.edition-b #post { width: auto; right: 320px; }
body.ed-railed.edition-w #game, body.ed-railed.edition-w #game3d, body.ed-railed.edition-w #post { width: auto; left: 280px; }
body.ed-railed.edition-b .hud-right { right: 336px; position: relative; }

body.edition-b { --display: Arial, Helvetica, sans-serif; --ui: Arial, Helvetica, sans-serif; --accent: #4f6bd8; --accent-ink: #fff; }
body.edition-b .ed-badge { background: #1b2230; color: #fff; border-radius: 3px; font-family: Arial, Helvetica, sans-serif; }
body.edition-b .ed-badge b { color: #9fb4ff; margin-right: 4px; }
body.edition-b .pill, body.edition-b .icon-btn { background: #fff; color: #1b2230; border: 1px solid #d5dae3; border-radius: 4px; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.edition-b .dialog { background: #fff; border: 1px solid #d5dae3; border-radius: 6px; box-shadow: 0 10px 30px rgba(20, 30, 60, .22); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.edition-b .dtext { color: #1b2230; font-family: Arial, Helvetica, sans-serif; }
body.edition-b .dnext, body.edition-b .dskip { color: #4f6bd8; }
body.edition-b .toast { background: #fff; color: #1b2230; border-radius: 4px; border-color: #d5dae3; }
body.edition-b .toast .tt { color: #1b2230; }
body.edition-b .intro { font-family: Arial, Helvetica, sans-serif; }

body.edition-w { --accent: #f2b36b; }
body.edition-w .ed-badge { background: #fff4dc; color: #2b2116; border: 2px solid #2b2116; border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; transform: translateX(-50%) rotate(-3deg); font: italic 600 14px/1 var(--display); box-shadow: 4px 4px 0 #e5484d; }
body.edition-w .ed-badge b { color: #e5484d; font-style: normal; margin-right: 4px; }
.ed-w .ed-rail { left: 0; width: 280px; background: #fff4dc; background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(80, 120, 200, .18) 27px 28px); border-right: 2px solid #2b2116; color: #2b2116; }
.ed-w .ed-rail h4 { margin: 6px 0 16px; font: italic 600 22px/1.1 var(--display); color: #e5484d; transform: rotate(-2deg); }
.ed-w .ed-rail p { margin: 0 0 16px; font: italic 400 17px/1.35 var(--display); transform: rotate(var(--r)); }
.ed-w .ed-rail p::before { content: '✎ '; color: #3b82f6; font-style: normal; }
body.edition-w .pill, body.edition-w .icon-btn { background: #fff4dc; color: #2b2116; border: 2px solid #2b2116; border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px; box-shadow: 3px 3px 0 #2b2116; }
body.edition-w .dialog { background: #fff8e8; border: 2.5px solid #2b2116; border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; box-shadow: 6px 6px 0 #2b2116; backdrop-filter: none; -webkit-backdrop-filter: none; transform: translateX(-50%) rotate(-.6deg); }
body.edition-w .dtext { color: #2b2116; font: italic 400 19px/1.45 var(--display); }
body.edition-w .toast { background: #fff8e8; color: #2b2116; border: 2px solid #2b2116; box-shadow: 4px 4px 0 #2b2116; }
body.edition-w .toast .tt { color: #2b2116; }
body.edition-b.cinema .dialog, body.edition-w.cinema .dialog { bottom: calc(12vh + var(--safe-b)); }

/* ─── account ───────────────────────────────────────────────── */
input { user-select: text; -webkit-user-select: text; }
input[type=password] { font-size: 16px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); color: var(--text); outline: none; min-width: 0; transition: border-color .2s, box-shadow .2s; }
.seg { display: flex; gap: 4px; padding: 4px; margin: 14px 0; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.seg button { flex: 1; padding: 9px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--surface-solid); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset; }
.acct-form { display: grid; gap: 12px; }
.acct-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.acct-form .btn { justify-self: end; margin-top: 4px; }
.acct-msg { min-height: 1.2em; margin: 0; color: var(--rose); font-size: 13px; }
.acct-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(184, 221, 134, .08); border: 1px solid rgba(184, 221, 134, .25); color: var(--accent); }
.acct-card b { display: block; color: var(--text); font-size: 16px; }
.acct-card small { color: var(--text-2); }
.linkish { display: inline-flex; gap: 6px; align-items: center; padding: 6px 2px; border: 0; background: none; color: var(--text-2); cursor: pointer; font-size: 13px; }
.linkish:hover { color: var(--text); }

/* ─── Bartholomew's Stall ───────────────────────────────────── */
.shop-head { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: rgba(232, 194, 126, .08); border: 1px solid rgba(232, 194, 126, .22); margin-bottom: 8px; }
.shop-head img { width: 52px; height: 52px; flex: none; }
.shop-say { margin: 0; flex: 1; font: italic 400 16px/1.4 var(--display); color: var(--text); }
.shop-purse { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-weight: 700; font-variant-numeric: tabular-nums; }
.seed-ico { width: 14px; height: 14px; vertical-align: -2px; }
.shop h3 { display: flex; gap: 8px; align-items: baseline; margin: 18px 0 8px; }
.shop h3 small { font-weight: 500; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .18); border: 1px solid var(--line); }
.item .ii { width: 48px; height: 48px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(184, 221, 134, .08); color: var(--accent); overflow: hidden; }
.item .ii canvas { width: 48px; height: 48px; }
.item .it { flex: 1; min-width: 0; display: grid; gap: 2px; }
.item .it small { color: var(--text-3); font-size: 12px; line-height: 1.35; }
.item .it .have { color: var(--accent); }
.item .ia { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.price { display: inline-flex; gap: 5px; align-items: center; font-variant-numeric: tabular-nums; }
.price.sale { color: #fff3c4; }
.price.short { opacity: .55; }
.ii[class*="trail-"] { position: relative; }
.ii[class*="trail-"] i { position: absolute; width: 10px; height: 10px; border-radius: 50%; left: calc(10px + var(--n, 0) * 12px); top: 19px; background: var(--accent); }
.ii[class*="trail-"] i:nth-child(1) { --n: 0; opacity: .35; transform: scale(.6); } .ii[class*="trail-"] i:nth-child(2) { --n: 1; opacity: .65; transform: scale(.8); } .ii[class*="trail-"] i:nth-child(3) { --n: 2; }
.trail-rainbow i { background: linear-gradient(90deg, #ff6b6b, #ffd166, #6bffb0, #6bb7ff) !important; }
.trail-ink i { background: #141414 !important; }
.trail-petals i { background: #ffb3c7 !important; border-radius: 60% 0 !important; }
.trail-pixel i { border-radius: 0 !important; }
.trail-hearts i { background: #ff6b8a !important; border-radius: 50% 50% 0 50% !important; transform: rotate(45deg) !important; }
.trail-sparkle i { background: #fffbd0 !important; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); border-radius: 0 !important; width: 14px !important; height: 14px !important; }
.trail-glitch i { background: #ff005a !important; border-radius: 0 !important; box-shadow: 3px 0 #00f0ff; height: 6px !important; }

/* ─── XP & quality of life ──────────────────────────────────── */
.xpline { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(184, 221, 134, .07); border: 1px solid rgba(184, 221, 134, .2); }
.xp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.xp-top b { color: var(--accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.xp-top span { color: var(--text-2); font-size: 13px; }
.xpbar { height: 8px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: var(--from); border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 12px rgba(184, 221, 134, .5); animation: xpfill 1.2s .4s var(--ease) forwards; }
@keyframes xpfill { to { width: var(--to); } }
.lvup { display: block; margin-top: 8px; color: #fff3c4; font-weight: 600; animation: cc-up .8s 1.2s var(--ease) both; }
.pb { font-weight: 700; margin-left: 4px; }
.pb.up { color: var(--accent); }
.pb.down { color: var(--rose); }
[data-share].ok { color: var(--accent); }
body.bigtext .dtext { font-size: 20px; line-height: 1.5; }
body.bigtext .toast .tt, body.bigtext .talk { font-size: 17px; }
body.no-timer #hud-timer { display: none; }
.acct-row { display: flex; width: 100%; gap: 12px; align-items: center; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .2); color: var(--text); cursor: pointer; text-align: left; }
.acct-row span { flex: 1; font-weight: 600; }
.rank-chip { display: inline-flex; gap: 10px; align-items: center; margin-top: 14px; padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line-2); font-size: 13px; color: var(--text-2); }
.rank-chip b { color: var(--text); }
.rank-chip .xpbar { width: 90px; height: 6px; }
.rank-chip .xpbar i { width: var(--to); animation: none; }
.journal-story { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.journal-story li { padding-left: 14px; border-left: 2px solid rgba(184, 221, 134, .3); }
.journal-story small { color: var(--accent); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.journal-story p { margin: 4px 0 0; font: 400 16px/1.45 var(--display); color: var(--text); }
.journal-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.jl { display: grid; gap: 4px; padding: 12px; border-radius: 12px; text-align: left; background: #f1ead8; color: #2b2a22; border: 0; cursor: pointer; transform: rotate(-.6deg); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.jl:nth-child(even) { transform: rotate(.7deg); }
.jl small { font-size: 11px; color: #6b6a4e; font-weight: 600; }
.jl span { font: italic 400 14px/1.35 var(--display); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.jl.missing { background: rgba(0, 0, 0, .25); color: var(--text-3); cursor: default; transform: none; box-shadow: none; border: 1px dashed var(--line-2); }
.jl.missing small { color: var(--text-3); }
.journal-stats { grid-template-columns: repeat(3, 1fr); }
body.cinema #app::after { content: attr(data-skip); display: flex; align-items: center; justify-content: flex-end; padding: 0 22px; font: 600 11px/1 var(--ui); letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .35); }
.panel .rank-chip { margin-top: 0; }
.rank-chip { align-self: flex-start; width: max-content; max-width: 100%; }
.rank-chip .xpbar { flex: none; width: 90px; }
