/* Ravan Dahan — UI */
:root {
  --bg: #07060f;
  --ink: #fff4de;
  --muted: #cbb796;
  --gold: #f5c451;
  --gold-2: #ffe29a;
  --saffron: #ff8a1f;
  --flame: #ff5a1f;
  --crimson: #c3172d;
  --green: #2fbf71;
  --panel: rgba(20, 11, 22, 0.62);
  --panel-solid: #170b17;
  --line: rgba(245, 196, 81, 0.28);
  --line-2: rgba(245, 196, 81, 0.12);
  --r: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --ui: 'Mukta', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Rozha One', 'Mukta', Georgia, serif;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--ui); overflow: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
input, select { font: inherit; }
.hidden { display: none !important; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; outline: none; }
body.aiming #scene { cursor: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border-radius: 999px; font-weight: 700; letter-spacing: 0.01em; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s; line-height: 1.1; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn .ico { font-size: 1.15em; }
.btn-primary { color: #2a0b02; background: linear-gradient(135deg, #ffd56a 0%, #ff9a2e 48%, #ff6a1f 100%); box-shadow: 0 8px 26px rgba(255, 120, 30, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-primary:hover { box-shadow: 0 10px 34px rgba(255, 140, 40, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6); transform: translateY(-1px); }
.btn-ghost { color: var(--ink); background: rgba(255, 238, 205, 0.06); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: rgba(255, 238, 205, 0.12); }
.btn-link { color: var(--muted); padding: 10px 12px; text-decoration: underline; text-underline-offset: 3px; }
.btn-big { padding: 16px 30px; font-size: 1.12rem; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-icon { width: 44px; height: 44px; padding: 0; }
.btn.busy { opacity: 0.7; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }

/* ---------- loader ---------- */
.screen { position: fixed; inset: 0; z-index: 30; }
#loader { display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(ellipse at 50% 60%, #2a0d16 0%, #07060f 65%); transition: opacity 0.7s ease; }
#loader.fade { opacity: 0; pointer-events: none; }
.loader-title { font-family: var(--display); font-size: clamp(42px, 9vw, 76px); background: linear-gradient(180deg, #fff2c4, #f5c451 50%, #ff8a1f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 18px rgba(255, 120, 30, 0.35)); }
.loader-bar { width: min(280px, 70vw); height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffcf5a, #ff6a1f); transition: width 0.25s ease; }
.loader-text { color: var(--muted); font-size: 0.95rem; }
#loader.error .loader-text { color: #ff9a8a; max-width: 80vw; text-align: center; }
.diya { position: relative; width: 84px; height: 84px; }
.diya .lamp { position: absolute; left: 6px; right: 6px; bottom: 6px; height: 30px; border-radius: 0 0 60px 60px / 0 0 40px 40px; background: linear-gradient(180deg, #c9632a, #7a2e0d); box-shadow: inset 0 6px 0 #e08a3c; }
.diya .flame { position: absolute; left: 50%; bottom: 32px; width: 18px; height: 34px; margin-left: -9px; border-radius: 50% 50% 50% 50% / 64% 64% 36% 36%; background: radial-gradient(ellipse at 50% 75%, #fff 0%, #ffe28a 30%, #ff9a2e 62%, rgba(255, 90, 31, 0) 100%); filter: drop-shadow(0 0 16px rgba(255, 150, 50, 0.9)); transform-origin: 50% 100%; animation: flicker 0.18s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scale(1, 1) rotate(-2deg); } to { transform: scale(0.94, 1.08) rotate(2deg); } }

/* ---------- landing ---------- */
#landing { display: grid; align-items: end; padding: calc(28px + var(--st)) 28px calc(40px + var(--sb)); pointer-events: none; background: linear-gradient(180deg, rgba(7, 6, 15, 0) 40%, rgba(7, 6, 15, 0.75) 78%, rgba(7, 6, 15, 0.92) 100%); }
.landing-inner { max-width: 760px; pointer-events: auto; animation: rise 1s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.kicker { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 138, 31, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 138, 31, 0.35); color: #ffc98a; font-weight: 600; font-size: 0.9rem; letter-spacing: 0.04em; text-transform: uppercase; }
.kicker .dot, .live { width: 8px; height: 8px; border-radius: 50%; background: #ff4b2b; box-shadow: 0 0 0 0 rgba(255, 75, 43, 0.7); animation: pulse 1.6s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(255, 75, 43, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 75, 43, 0); } }
.brand { margin: 14px 0 4px; line-height: 0.95; }
.brand .deva { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(64px, 12vw, 132px); background: linear-gradient(180deg, #fff6d6 0%, #ffd56a 38%, #ff8a1f 72%, #c3172d 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(255, 110, 30, 0.45)); }
.brand .latin { display: block; font-family: var(--ui); font-weight: 800; letter-spacing: 0.42em; text-transform: uppercase; font-size: clamp(13px, 1.8vw, 18px); color: var(--gold-2); margin-top: 6px; padding-left: 0.2em; }
.tagline { font-family: var(--display); font-size: clamp(22px, 3.2vw, 32px); margin: 14px 0 6px; color: #fff; }
.hero { color: #e9d9bd; font-size: clamp(15px, 1.7vw, 18px); max-width: 600px; margin: 0 0 22px; line-height: 1.5; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.stat { padding: 10px 16px; border-radius: 14px; background: var(--panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-2); min-width: 130px; }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; color: #fff; }
.stat span { font-size: 0.82rem; color: var(--muted); }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.lang-pill { position: fixed; top: calc(18px + var(--st)); right: calc(18px + var(--sr)); pointer-events: auto; padding: 8px 16px; border-radius: 999px; background: var(--panel); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; }

/* ---------- modal / card ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; background: rgba(5, 3, 10, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.35s ease; }
@keyframes fade { from { opacity: 0; } }
.card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 36px); overflow: auto; padding: 26px 26px 22px; border-radius: 22px; background: linear-gradient(180deg, rgba(40, 16, 30, 0.96), rgba(18, 9, 20, 0.97)); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); animation: pop 0.4s cubic-bezier(.2,.9,.3,1.2); }
.card.wide { width: min(860px, 100%); }
.card::before { content: ''; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.card h2 { font-family: var(--display); font-weight: 400; font-size: 1.9rem; margin: 6px 0 6px; color: var(--gold-2); }
.muted { color: var(--muted); margin: 0 0 16px; line-height: 1.5; }
.small { font-size: 0.85rem; }
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.row.between { justify-content: space-between; margin-top: 12px; }
.row.center { justify-content: center; }
.row.wrap { flex-wrap: wrap; }
.ob-dots { display: flex; gap: 6px; margin-bottom: 10px; }
.ob-dots i { height: 4px; flex: 1; border-radius: 4px; background: rgba(255, 255, 255, 0.1); transition: background 0.3s; }
.ob-dots i.on { background: linear-gradient(90deg, #ffd56a, #ff7a1f); }
.ob-step { display: none; }
.ob-step.on { display: block; animation: rise 0.45s ease; }
.field { display: grid; gap: 6px; margin: 12px 0; font-weight: 600; color: #f1dcb8; font-size: 0.92rem; }
.field input, .field select { width: 100%; padding: 13px 14px; border-radius: 12px; border: 0; color: #fff; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 1.02rem; user-select: text; -webkit-user-select: text; }
.field select option, .field select optgroup { background: #1d0f1d; color: #fff; }
.field input:focus, .field select:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); background: rgba(255, 255, 255, 0.1); }
.err { min-height: 22px; color: #ff9b85; font-weight: 600; font-size: 0.92rem; }
.story-card { padding: 18px; border-radius: 16px; background: radial-gradient(ellipse at 0% 0%, rgba(255, 138, 31, 0.14), transparent 60%), rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-2); min-height: 250px; animation: rise 0.4s ease; }
.story-ico { font-size: 2rem; }
.story-card h3 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin: 6px 0; color: #fff; }
.story-card p { margin: 0; line-height: 1.62; color: #ecdcc0; }
.story-dots { display: flex; gap: 6px; margin-top: 14px; }
.story-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.story-dots i.on { background: var(--gold); width: 20px; border-radius: 6px; }
.how { list-style: none; padding: 0; margin: 10px 0 8px; display: grid; gap: 10px; counter-reset: how; }
.how li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-2); line-height: 1.45; color: #f0e2c8; }
.how-ico { font-size: 1.4rem; line-height: 1; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#hud > * { pointer-events: auto; }
#hp-panel { position: absolute; top: calc(12px + var(--st)); left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 420px)); min-width: 300px; padding: 10px 16px 10px; border-radius: 18px; background: var(--panel); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); pointer-events: none !important; }
.hp-head { display: flex; justify-content: space-between; align-items: baseline; }
.hp-label { font-weight: 800; letter-spacing: 0.18em; font-size: 0.72rem; color: #ffc98a; }
#hp-pct { font-weight: 700; color: var(--gold-2); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.hp-num { display: flex; align-items: baseline; gap: 8px; margin: 2px 0 6px; }
.hp-num b { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 3vw, 32px); font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 18px rgba(255, 120, 40, 0.5); }
.hp-max { color: var(--muted); font-size: 0.85rem; }
.hp-bar { position: relative; height: 14px; border-radius: 8px; background: rgba(0, 0, 0, 0.45); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); overflow: visible; }
.hp-bar #hp-fill, .hp-bar #hp-ghost { position: absolute; inset: 0; border-radius: 8px; transform-origin: 0 50%; }
#hp-ghost { background: rgba(255, 245, 220, 0.55); }
#hp-fill { background: linear-gradient(90deg, #7a0b14 0%, #c3172d 30%, #ff5a1f 62%, #ffb23a 88%, #ffe28a 100%); box-shadow: 0 0 14px rgba(255, 90, 31, 0.6); overflow: hidden; }
#hp-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%); background-size: 200% 100%; animation: shimmer 2.6s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.hp-ticks { position: absolute; inset: 0; }
.hp-ticks i { position: absolute; top: 2px; bottom: 2px; width: 1px; background: rgba(0, 0, 0, 0.55); }
.mark { position: absolute; top: -7px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; display: grid; place-items: center; font-size: 0.62rem; font-weight: 800; color: #2a0b02; background: #ffd56a; box-shadow: 0 0 0 2px rgba(20, 10, 20, 0.9); }
.mark.done { background: #3b2a2a; color: #9c8a7a; text-decoration: line-through; }
#heads-row { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 8px; }
.head-pip { display: grid; justify-items: center; gap: 1px; color: var(--gold); transition: color 0.3s, opacity 0.3s, transform 0.3s; }
.head-pip svg { width: 20px; height: 20px; filter: drop-shadow(0 0 4px rgba(255, 180, 60, 0.5)); }
.head-pip em { font-style: normal; font-size: 0.6rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.head-pip.down { color: #5a4a40; opacity: 0.55; transform: translateY(2px); }
.head-pip.down svg { filter: none; }
.head-pip.down em { text-decoration: line-through; }

#me-card { position: absolute; top: calc(12px + var(--st)); left: calc(12px + var(--sl)); display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'av meta' 'a r'; gap: 6px 12px; padding: 12px 14px; border-radius: 18px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line-2); min-width: 190px; }
.avatar { grid-area: av; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; color: #2a0b02; background: linear-gradient(135deg, #ffe28a, #ff8a1f); }
.me-meta { grid-area: meta; display: grid; align-content: center; min-width: 0; }
.me-meta b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.me-meta span { color: var(--muted); font-size: 0.8rem; }
.me-stat { display: grid; }
.me-stat b { font-size: 1.2rem; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.me-stat span { font-size: 0.72rem; color: var(--muted); }
#me-arrows.bump { animation: bump 0.25s ease; }
@keyframes bump { 40% { transform: scale(1.18); color: #fff; } }

#tools { position: absolute; top: calc(12px + var(--st)); right: calc(12px + var(--sr)); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 340px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; background: var(--panel); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.tool { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 12px; background: var(--panel); backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; font-size: 0.95rem; transition: background 0.2s; }
.tool:hover, .tool.on { background: rgba(255, 138, 31, 0.25); }

#lb-panel { position: absolute; right: calc(12px + var(--sr)); top: calc(66px + var(--st)); width: 300px; max-height: calc(100vh - 300px); display: flex; flex-direction: column; padding: 10px; border-radius: 18px; background: var(--panel); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--line-2); }
.lb-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); }
.lb-tabs button { padding: 7px; border-radius: 9px; font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.lb-tabs button.on { background: rgba(255, 138, 31, 0.25); color: #fff; }
#lb-list { list-style: none; margin: 8px 0 0; padding: 0; overflow: auto; flex: 1; min-height: 0; }
#lb-list li, #v-top li, #v-states-list li { position: relative; display: grid; grid-template-columns: 28px 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; font-size: 0.9rem; }
#lb-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
#lb-list li.you { box-shadow: inset 0 0 0 1px var(--gold); background: rgba(245, 196, 81, 0.1); }
#lb-list li.empty { grid-template-columns: 1fr; color: var(--muted); text-align: center; }
#lb-list .rk, #v-top .rk, #v-states-list .rk { text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
#lb-list .nm, #v-top .nm, #v-states-list .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lb-list .st, #v-top .st, .feed .st, #feed .st { font-size: 0.68rem; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: #ffc98a; }
#lb-list b, #v-top b, #v-states-list b { font-variant-numeric: tabular-nums; color: var(--gold-2); }
#lb-list li.state-row { grid-template-columns: 28px 1fr auto; overflow: hidden; }
#lb-list li.state-row .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: linear-gradient(90deg, #ff8a1f, #ffd56a); border-radius: 2px; }
#lb-me { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(245, 196, 81, 0.12); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.88rem; }
#lb-me:empty { display: none; }
#lb-me .you-k { font-weight: 800; color: #2a0b02; background: var(--gold); padding: 1px 8px; border-radius: 6px; font-size: 0.72rem; }
#lb-me .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lb-me b { color: var(--gold-2); }

#feed { position: absolute; left: calc(12px + var(--sl)); bottom: calc(18px + var(--sb)); width: 300px; pointer-events: none !important; }
.feed-title { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #ffc98a; margin-bottom: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); }
#feed-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#feed-list li { display: flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; padding: 5px 10px; border-radius: 10px; background: rgba(12, 6, 14, 0.62); backdrop-filter: blur(6px); font-size: 0.86rem; box-shadow: inset 0 0 0 1px var(--line-2); }
#feed-list li:nth-child(n+4) { opacity: 0.6; }
#feed-list li:nth-child(n+6) { opacity: 0.3; }
#feed-list li.in { animation: feedIn 0.35s ease; }
@keyframes feedIn { from { opacity: 0; transform: translateX(-12px); } }
#feed-list b { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#feed-list .n { color: var(--gold-2); font-weight: 800; font-variant-numeric: tabular-nums; }

#fact { position: absolute; right: calc(12px + var(--sr)); bottom: calc(18px + var(--sb)); width: 300px; padding: 12px 14px; border-radius: 16px; background: var(--panel); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line-2); animation: rise 0.5s ease; pointer-events: none !important; }
.fact-k { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #ffc98a; }
#fact p { margin: 4px 0 0; line-height: 1.45; font-size: 0.9rem; color: #f0e2c8; }

#fire-zone { position: absolute; left: 50%; bottom: calc(16px + var(--sb)); transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; transition: opacity 0.3s; }
#fire-zone.dim { opacity: 0.35; }
#btn-fire { position: relative; width: 104px; height: 104px; border-radius: 50%; display: grid; place-content: center; justify-items: center; color: #2a0b02; background: radial-gradient(circle at 50% 35%, #fff1b8 0%, #ffc44a 35%, #ff7a1f 75%, #c3172d 100%); box-shadow: 0 10px 34px rgba(255, 100, 30, 0.55), 0 0 0 6px rgba(255, 180, 60, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.7); touch-action: none; transition: transform 0.08s ease, box-shadow 0.2s; }
#btn-fire.down { transform: scale(0.93); box-shadow: 0 4px 20px rgba(255, 100, 30, 0.7), 0 0 0 10px rgba(255, 180, 60, 0.18), inset 0 2px 0 rgba(255, 255, 255, 0.7); }
#btn-fire.charged { box-shadow: 0 0 40px rgba(255, 200, 80, 0.95), 0 0 0 12px rgba(255, 200, 80, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.7); }
#btn-fire svg { position: absolute; inset: -9px; width: calc(100% + 18px); height: calc(100% + 18px); transform: rotate(-90deg); pointer-events: none; }
#btn-fire .ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 4; }
#btn-fire .ring { fill: none; stroke: #fff4c4; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 339.3; stroke-dashoffset: 339.3; filter: drop-shadow(0 0 4px #ffcf5a); }
.fire-ico { font-size: 2rem; line-height: 1; }
.fire-lbl { font-weight: 800; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.fire-hint { font-size: 0.75rem; color: var(--muted); background: rgba(0, 0, 0, 0.35); padding: 3px 10px; border-radius: 999px; }

#combo { position: absolute; left: 50%; bottom: calc(150px + var(--sb)); transform: translateX(-50%); display: flex; align-items: baseline; gap: 6px; pointer-events: none !important; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
#combo b { font-family: var(--display); font-weight: 400; font-size: 2.2rem; color: var(--gold-2); }
#combo span { font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; color: #ffc98a; }
#combo.pop b { animation: comboPop 0.22s ease; }
#combo.hot b { color: #fff; text-shadow: 0 0 20px #ff6a1f, 0 0 40px #ff3b1f; }
@keyframes comboPop { 40% { transform: scale(1.3); } }

#demo-bar { position: absolute; left: 50%; top: calc(178px + var(--st)); transform: translateX(-50%); display: flex; gap: 8px; align-items: center; }
.demo-badge { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; padding: 5px 10px; border-radius: 999px; background: rgba(80, 160, 255, 0.18); box-shadow: inset 0 0 0 1px rgba(120, 180, 255, 0.4); color: #cfe3ff; text-transform: uppercase; }
#btn-back { position: absolute; left: 50%; bottom: calc(140px + var(--sb)); transform: translateX(-50%); }

/* ---------- overlays ---------- */
#coach { position: fixed; z-index: 25; left: 50%; bottom: calc(150px + var(--sb)); transform: translateX(-50%); padding: 10px 16px; border-radius: 14px; background: #ffe7a6; color: #2a0b02; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); animation: bob 1.4s ease-in-out infinite; pointer-events: none; text-align: center; max-width: 86vw; }
#coach::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: #ffe7a6; }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
#reticle { position: fixed; z-index: 15; left: -22px; top: -22px; width: 44px; height: 44px; pointer-events: none; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 236, 190, 0.9), 0 0 12px rgba(255, 160, 60, 0.6); transition: box-shadow 0.15s; }
#reticle::before, #reticle::after { content: ''; position: absolute; background: rgba(255, 236, 190, 0.9); }
#reticle::before { left: 50%; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; mask: linear-gradient(transparent 0 8px, #000 8px 16px, transparent 16px calc(100% - 16px), #000 calc(100% - 16px) calc(100% - 8px), transparent calc(100% - 8px)); -webkit-mask: linear-gradient(transparent 0 8px, #000 8px 16px, transparent 16px calc(100% - 16px), #000 calc(100% - 16px) calc(100% - 8px), transparent calc(100% - 8px)); }
#reticle::after { top: 50%; left: -8px; right: -8px; height: 2px; margin-top: -1px; mask: linear-gradient(90deg, transparent 0 8px, #000 8px 16px, transparent 16px calc(100% - 16px), #000 calc(100% - 16px) calc(100% - 8px), transparent calc(100% - 8px)); -webkit-mask: linear-gradient(90deg, transparent 0 8px, #000 8px 16px, transparent 16px calc(100% - 16px), #000 calc(100% - 16px) calc(100% - 8px), transparent calc(100% - 8px)); }
#reticle i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; }
#reticle.charged { box-shadow: inset 0 0 0 3px #ffd56a, 0 0 24px rgba(255, 200, 80, 0.95); }
#labels { position: fixed; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; }
.flabel { position: absolute; left: 0; top: 0; padding: 3px 9px; border-radius: 999px; background: rgba(20, 8, 10, 0.72); box-shadow: inset 0 0 0 1px rgba(255, 150, 60, 0.45); font-size: 0.78rem; font-weight: 700; white-space: nowrap; color: #ffe3b0; will-change: transform, opacity; }
#tooltip { position: fixed; z-index: 26; left: 0; top: 0; padding: 7px 12px; border-radius: 10px; background: rgba(12, 6, 14, 0.9); box-shadow: inset 0 0 0 1px var(--line); font-size: 0.85rem; font-weight: 600; pointer-events: none; white-space: nowrap; max-width: 90vw; }
#bubble { position: fixed; z-index: 14; left: 0; top: 0; max-width: 260px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: #fff3dc; color: #3a0a0a; font-weight: 600; font-size: 0.95rem; line-height: 1.35; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); pointer-events: none; transition: opacity 0.2s; }
#bubble b { display: block; font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crimson); }
#bubble.pop { animation: bubblePop 0.35s cubic-bezier(.2,.9,.3,1.4); }
@keyframes bubblePop { from { opacity: 0; scale: 0.7; } }
#banner { position: fixed; z-index: 27; left: 50%; top: 32%; transform: translate(-50%, -50%); display: flex; gap: 16px; align-items: center; width: min(620px, 92vw); padding: 18px 22px; border-radius: 20px; background: linear-gradient(135deg, rgba(120, 14, 24, 0.94), rgba(40, 8, 20, 0.96)); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 200, 90, 0.5); pointer-events: none; }
#banner.in { animation: bannerIn 0.6s cubic-bezier(.2,.9,.3,1.2); }
#banner.out { animation: bannerOut 0.6s ease both; }
@keyframes bannerIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.85); } }
@keyframes bannerOut { to { opacity: 0; transform: translate(-50%, -60%); } }
.b-ico { font-size: 2.6rem; filter: drop-shadow(0 0 14px rgba(255, 180, 60, 0.8)); }
.b-title { font-family: var(--display); font-size: 1.6rem; color: #fff; line-height: 1.1; }
.b-sub { font-weight: 800; color: var(--gold-2); margin-top: 3px; font-size: 1.05rem; }
.b-desc { color: #f0d9b8; font-size: 0.92rem; margin-top: 2px; }
#title-card { position: fixed; z-index: 28; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.35), transparent 60%); }
#title-card.in .tc-main { animation: tcIn 1.1s cubic-bezier(.2,.9,.3,1); }
#title-card.in .tc-sub { animation: tcIn 1.1s 0.25s cubic-bezier(.2,.9,.3,1); }
#title-card.out { animation: fadeOut 0.9s ease both; }
@keyframes tcIn { from { opacity: 0; transform: scale(1.25); filter: blur(10px); } }
@keyframes fadeOut { to { opacity: 0; } }
.tc-main { font-family: var(--display); font-size: clamp(54px, 10vw, 120px); line-height: 1.05; background: linear-gradient(180deg, #fff8e0 0%, #ffd56a 45%, #ff8a1f 80%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 40px rgba(255, 120, 30, 0.6)); padding: 0 0.1em; }
.tc-sub { font-weight: 800; font-size: clamp(16px, 2.4vw, 26px); letter-spacing: 0.06em; color: #fff3dc; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.9); margin-top: 6px; }
#toasts { position: fixed; z-index: 29; left: 50%; top: calc(200px + var(--st)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: min(480px, 92vw); }
.toast { padding: 10px 16px; border-radius: 14px; background: rgba(16, 8, 18, 0.9); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px var(--line); font-weight: 700; font-size: 0.92rem; text-align: center; animation: rise 0.35s ease; }
.toast.good { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 210, 100, 0.65); }
.toast.warn { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 110, 80, 0.7); color: #ffd2c4; }
.toast.out { opacity: 0; transform: translateY(-8px); transition: all 0.4s ease; }
#conn { position: fixed; z-index: 31; left: 50%; bottom: calc(132px + var(--sb)); transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 0.82rem; }
#conn.warn { background: rgba(160, 40, 20, 0.85); }
#conn.ok { background: rgba(30, 120, 60, 0.85); }

.drawer { position: fixed; z-index: 35; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); padding: calc(16px + var(--st)) 18px calc(16px + var(--sb)); overflow: auto; background: linear-gradient(180deg, rgba(36, 14, 28, 0.97), rgba(14, 7, 16, 0.98)); box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5), inset 1px 0 0 var(--line); animation: slideIn 0.35s ease; user-select: text; -webkit-user-select: text; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: calc(-16px - var(--st)); padding: 6px 0 10px; background: inherit; }
.drawer-head h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 0; color: var(--gold-2); }
.d-card { padding: 14px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-2); margin-bottom: 12px; }
.d-card h4 { margin: 0 0 6px; font-size: 1.05rem; color: #fff; }
.d-card p { margin: 0; line-height: 1.6; color: #ecdcc0; }
.vices, .facts { margin: 0; padding-left: 20px; line-height: 1.55; color: #ecdcc0; }
.vices b { color: var(--gold-2); }
.facts li { margin-bottom: 6px; }

/* ---------- victory ---------- */
#victory .card { text-align: center; }
.v-jai { font-family: var(--display); font-size: clamp(44px, 8vw, 74px); line-height: 1; background: linear-gradient(180deg, #fff8e0, #ffd56a 50%, #ff8a1f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 24px rgba(255, 120, 30, 0.55)); }
#victory h2 { margin-top: 8px; }
.v-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 12px; margin: 10px 0 14px; text-align: left; }
.v-hero { padding: 16px; border-radius: 16px; background: radial-gradient(ellipse at 20% 0%, rgba(255, 200, 90, 0.25), transparent 60%), rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line); }
.v-trophy { font-size: 2rem; }
.v-k { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #ffc98a; }
.v-name { font-family: var(--display); font-size: 1.7rem; color: #fff; line-height: 1.15; margin: 2px 0; word-break: break-word; }
.v-desc { color: var(--muted); font-size: 0.88rem; }
.v-totals { display: grid; gap: 8px; }
.v-totals div { padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.04); box-shadow: inset 0 0 0 1px var(--line-2); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.v-totals b { font-size: 1.25rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.v-totals span { color: var(--muted); font-size: 0.85rem; }
.v-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
.v-cols h4 { margin: 0 0 6px; color: #ffc98a; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; }
.v-cols ol { list-style: none; margin: 0; padding: 0; }
#v-states-list li { grid-template-columns: 28px 1fr auto; }
.v-me { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; align-items: baseline; margin: 14px 0; padding: 10px; border-radius: 14px; background: rgba(245, 196, 81, 0.1); box-shadow: inset 0 0 0 1px var(--line); }
.v-me:empty { display: none; }
.v-me b { color: var(--gold-2); font-size: 1.15rem; }
.v-me .rk { color: var(--muted); }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; padding: 30px; text-align: center; background: #07060f; color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  #hp-panel { width: min(520px, calc(100vw - 24px)); top: calc(70px + var(--st)); }
  #lb-panel { top: auto; bottom: calc(150px + var(--sb)); max-height: 40vh; display: none; }
  #lb-panel.open { display: flex; }
  #demo-bar { top: calc(238px + var(--st)); }
  #toasts { top: calc(260px + var(--st)); }
}
@media (min-width: 1101px) { #btn-lb { display: none; } }
@media (max-width: 720px) {
  #landing { padding: calc(20px + var(--st)) 18px calc(26px + var(--sb)); }
  .stats { gap: 8px; }
  .stat { min-width: 0; flex: 1; padding: 8px 10px; }
  .stat b { font-size: 1.05rem; }
  .stat span { font-size: 0.7rem; }
  .cta-row .btn { flex: 1; }
  #me-card { min-width: 0; padding: 8px 10px; grid-template-columns: auto auto auto; grid-template-areas: 'av a r'; gap: 8px; }
  .me-meta { display: none; }
  .avatar { width: 32px; height: 32px; font-size: 0.95rem; }
  .me-stat b { font-size: 1rem; }
  #tools { max-width: 60vw; gap: 4px; }
  .tool { min-width: 34px; height: 34px; padding: 0 8px; font-size: 0.85rem; }
  .chip { padding: 6px 10px; font-size: 0.78rem; }
  #hp-panel { top: calc(100px + var(--st)); padding: 8px 12px; min-width: 0; }
  #tools .tool[data-action="full"] { display: none; }
  .head-pip em { display: none; }
  .head-pip svg { width: 18px; height: 18px; }
  #feed { width: 62vw; bottom: calc(150px + var(--sb)); }
  #feed-list li:nth-child(n+4) { display: none; }
  #fact { display: none; }
  #lb-panel { left: calc(12px + var(--sl)); right: calc(12px + var(--sr)); width: auto; }
  #btn-fire { width: 96px; height: 96px; }
  .fire-hint { display: none; }
  #banner { top: 42%; padding: 14px 16px; }
  .b-title { font-size: 1.25rem; }
  .v-grid, .v-cols { grid-template-columns: 1fr; }
  #toasts { top: calc(268px + var(--st)); }
  #demo-bar { top: calc(244px + var(--st)); }
  .card { padding: 22px 18px 18px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #hp-panel { top: calc(8px + var(--st)); width: min(420px, 50vw); }
  #heads-row { display: none; }
  #me-card { top: auto; bottom: calc(10px + var(--sb)); }
  #feed { display: none; }
  #fire-zone { left: auto; right: calc(20px + var(--sr)); transform: none; }
  #btn-fire { width: 88px; height: 88px; }
  #lb-panel { bottom: calc(110px + var(--sb)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
