:root {
  --navy: #0e1a2b;
  --navy2: #172a47;
  --navy3: #223a5f;
  --card: rgba(15, 27, 47, 0.93);
  --line: rgba(160, 190, 230, 0.22);
  --text: #f4f8ff;
  --muted: #b3c4dd;
  --yellow: #ffd23f;
  --yellow-ink: #3a2c00;
  --red: #eb2828;
  --red-dark: #9e1414;
  --pink: #ff4d6d;
  --green: #5fd38d;
  --teal: #78cdbe;
  --font-display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--navy); color: var(--text); font-family: var(--font-body); font-size: 16px; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#underwater { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(40,140,240,.35), rgba(20,90,200,.7)); opacity: 0; transition: opacity .2s; z-index: 5; }
#underwater.on { opacity: 1; }
#hurt { position: fixed; inset: 0; pointer-events: none; z-index: 6; opacity: 0; background: radial-gradient(ellipse at center, rgba(255,0,0,0) 45%, rgba(255,30,30,.55)); }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 70; opacity: 0; }
kbd { font-family: var(--font-body); font-weight: 800; font-size: .8em; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: 6px; padding: 0 6px; background: rgba(255,255,255,.12); margin-inline: 1px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; margin: 6px 0 0; }

/* ---------- buttons ---------- */
.btn { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text); background: var(--navy3); border: 0; border-bottom: 5px solid #101f38; border-radius: 16px; padding: 12px 18px; cursor: pointer; min-height: 48px; transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(3px); border-bottom-width: 2px; }
.btn.big { font-size: 1.25rem; padding: 14px 22px; min-height: 56px; width: 100%; }
.btn.small { font-size: .95rem; padding: 8px 14px; min-height: 40px; border-bottom-width: 4px; }
.btn.primary { background: var(--yellow); color: var(--yellow-ink); border-bottom-color: #c79a00; }
.btn.danger { background: #7a2430; border-bottom-color: #4a121b; }
.btn.ghost { background: rgba(255,255,255,.08); border-bottom-color: rgba(0,0,0,.25); }
.btn-col { display: grid; gap: 10px; margin-top: 14px; }
.btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.icon-btn { display: inline-flex; align-items: center; gap: 4px; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 14px; border: 0; background: rgba(14,26,43,.78); color: var(--text); cursor: pointer; font: 800 .95rem var(--font-body); pointer-events: auto; backdrop-filter: blur(4px); border: 1px solid var(--line); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: rgba(34,58,95,.9); }
.icon-btn.off svg { opacity: .45; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 40; overflow-y: auto; overflow-x: hidden; padding: calc(var(--sat) + 14px) calc(var(--sar) + 14px) calc(var(--sab) + 14px) calc(var(--sal) + 14px); }
.title { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, rgba(14,26,43,.1), rgba(14,26,43,.62)); }
.title-inner { width: min(100%, 480px); display: grid; gap: 14px; justify-items: center; margin-block: auto; }
.modal { display: grid; place-items: center; background: rgba(8, 14, 26, .72); backdrop-filter: blur(4px); z-index: 80; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.45); }
.menu-card { width: 100%; }
.logo { display: grid; justify-items: center; line-height: .92; text-align: center; font-weight: 700; text-shadow: 0 5px 0 #0a1424, 0 10px 22px rgba(0,0,0,.45); animation: logoBob 3.2s ease-in-out infinite; margin: 0; }
.logo span { display: block; }
.l1 { font-size: clamp(1.7rem, 7vw, 2.4rem); color: #fff; letter-spacing: .02em; }
.l2 { font-size: clamp(3.6rem, 17vw, 5.8rem); letter-spacing: .01em; }
.l2 .red { color: #ff3b30; -webkit-text-stroke: 3px #7a0c0c; paint-order: stroke fill; text-shadow: 0 6px 0 #7a0c0c, 0 12px 26px rgba(255,40,30,.5); display: inline-block; animation: pulseRed 1.6s ease-in-out infinite; }
.l3 { font-size: clamp(1.7rem, 8vw, 2.6rem); color: var(--yellow); }
@keyframes logoBob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@keyframes pulseRed { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.foot { font-size: .95rem; }
.foot a { color: var(--muted); text-decoration-color: var(--teal); text-underline-offset: 4px; font-weight: 700; padding: 8px; display: inline-block; }
.foot a:hover { color: #fff; }

.field-label { font-family: var(--font-display); font-weight: 600; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 8px 0 5px; display: block; }
.input { width: 100%; font: 700 1.2rem var(--font-display); color: #fff; background: #0a1424; border: 2px solid var(--navy3); border-radius: 14px; padding: 12px 14px; min-height: 52px; }
.input:focus { border-color: var(--yellow); outline: none; }
.room-note { margin: 0 0 6px; padding: 8px 12px; background: rgba(120,205,190,.14); border: 1px solid rgba(120,205,190,.4); border-radius: 12px; font-weight: 800; color: var(--teal); text-align: center; }
.look-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; margin-top: 4px; }
.avatar-preview { height: 190px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px dashed var(--line); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 34px; height: 34px; border-radius: 10px; border: 3px solid rgba(255,255,255,.25); cursor: pointer; padding: 0; transition: transform .1s; }
.sw:hover { transform: scale(1.1); }
.sw[aria-checked="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--yellow); transform: scale(1.08); }
.trails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tr { display: flex; align-items: center; gap: 6px; font: 700 .8rem var(--font-body); color: var(--text); background: rgba(255,255,255,.08); border: 2px solid transparent; border-radius: 12px; padding: 6px 8px; cursor: pointer; text-align: left; min-height: 40px; }
.tr i { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid rgba(255,255,255,.4); }
.tr small { display: block; font-weight: 700; color: var(--muted); font-size: .72rem; }
.tr[aria-checked="true"] { border-color: var(--yellow); background: rgba(255,210,63,.14); }
.tr.locked { opacity: .55; cursor: not-allowed; }
.tr.rainbow i { background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); }
.invite-h { font-size: 1.5rem; text-align: center; }
.invite-box { margin: 12px 0; padding: 12px; border-radius: 12px; background: #0a1424; border: 1px solid var(--line); overflow-wrap: anywhere; font-size: .95rem; -webkit-user-select: all; user-select: all; }
.invite-box code { font-family: var(--font-body); font-weight: 800; color: var(--teal); }
.room-code { text-align: center; font: 700 2.6rem var(--font-display); letter-spacing: .25em; color: var(--yellow); }

.how-card { width: min(100%, 520px); max-height: 100%; overflow-y: auto; }
.how-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 12px; }
.how-list li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: start; }
.how-list p { margin: 2px 0 0; color: var(--muted); line-height: 1.4; }
.how-list b { font-family: var(--font-display); font-size: 1.1rem; }
.how-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--navy3); font-size: 1.7rem; }
.how-ico.red { background: #6b1a1a; } .how-ico.gold { background: #6b5410; }
.pause-card { width: min(100%, 380px); }
.pause-card h2 { text-align: center; font-size: 1.7rem; }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.hud-top { position: absolute; left: calc(var(--sal) + 10px); right: calc(var(--sar) + 10px); top: calc(var(--sat) + 8px); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "tl pill tr"; gap: 8px; align-items: start; }
.hud-tl { grid-area: tl; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.hud-tr { grid-area: tr; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.pill { grid-area: pill; justify-self: center; display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 8px; min-height: 58px; border-radius: 999px; background: rgba(14,26,43,.86); border: 2px solid var(--line); backdrop-filter: blur(4px); max-width: 92vw; transition: border-color .2s, background .2s; }
.pill.danger { border-color: #ff4d4d; background: rgba(90,10,16,.9); animation: pillPulse .5s ease-in-out infinite; }
.pill.event { border-color: var(--yellow); }
.ring { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: rgba(255,255,255,.14); }
.ring-fg { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.pill.danger .ring-fg { stroke: #ff4d4d; }
.pill-text { display: grid; line-height: 1.05; min-width: 0; }
.pill-text b { font: 700 1.25rem var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-text small { font: 700 .78rem var(--font-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-text small:empty { display: none; }
.pill-num { font: 700 1.9rem var(--font-display); min-width: 1.4ch; text-align: right; font-variant-numeric: tabular-nums; }
.pill-num:empty { display: none; }
@keyframes pillPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(14,26,43,.82); border: 1px solid var(--line); font: 700 .92rem var(--font-display); white-space: nowrap; }
.badge .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); }
.coins { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px 0 10px; border-radius: 14px; background: rgba(14,26,43,.82); border: 1px solid var(--line); font: 700 1.2rem var(--font-display); }
.coins.bump { animation: bump .45s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.3) rotate(-4deg); } 100% { transform: scale(1); } }
.coin-ico { width: 22px; height: 22px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff3a0, #ffc828 55%, #c78d00); box-shadow: inset 0 0 0 2px #b27d00; }
.coin-float { position: absolute; right: 6px; top: 100%; font: 700 1.3rem var(--font-display); color: var(--yellow); text-shadow: 0 2px 0 #000; opacity: 0; pointer-events: none; }
.coin-float.go { animation: floatUp 1.2s ease-out; }
@keyframes floatUp { 0% { opacity: 1; transform: translateY(0) scale(.8); } 20% { transform: translateY(8px) scale(1.2); } 100% { opacity: 0; transform: translateY(40px) scale(1); } }

.hpbar { position: absolute; left: 50%; top: calc(var(--sat) + 76px); transform: translateX(-50%); width: min(300px, 70vw); height: 26px; border-radius: 999px; background: rgba(14,26,43,.85); border: 2px solid var(--line); overflow: hidden; }
.hp-fill { position: absolute; inset: 0; width: 100%; background: linear-gradient(#7ee8a0, #3cbd6c); transition: width .2s, background .2s; transform-origin: left; }
.hp-fill.low { background: linear-gradient(#ff8080, #e02020); }
.hpbar span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 .8rem var(--font-display); letter-spacing: .1em; text-shadow: 0 1px 2px #000; }

.banner { position: absolute; left: 0; right: 0; top: 24%; display: grid; place-items: center; text-align: center; padding: 0 14px; pointer-events: none; }
.banner .b { font: 700 clamp(2rem, 9vw, 4.6rem) var(--font-display); line-height: 1; color: #fff; text-shadow: 0 5px 0 #0a1424, 0 0 30px rgba(0,0,0,.5); -webkit-text-stroke: 2px rgba(0,0,0,.5); paint-order: stroke fill; animation: bannerPop var(--dur, 2.4s) cubic-bezier(.2,.9,.3,1.2) forwards; transform-origin: center; max-width: 100%; text-wrap: balance; }
.banner .b.red { color: #ff5a4a; }
.banner .b.gold { color: var(--yellow); }
@keyframes bannerPop { 0% { transform: scale(.3) rotate(-4deg); opacity: 0; } 10% { transform: scale(1.18) rotate(2deg); opacity: 1; } 18% { transform: scale(1) rotate(0); } 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1) translateY(-14px); opacity: 0; } }
.hint { position: absolute; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 140px); max-width: 90vw; padding: 8px 14px; border-radius: 14px; background: rgba(14,26,43,.85); border: 1px solid var(--line); font-weight: 800; text-align: center; pointer-events: auto; }

.panel { position: absolute; right: calc(var(--sar) + 10px); top: calc(var(--sat) + 62px); width: min(300px, calc(100vw - 20px)); max-height: calc(100% - var(--sat) - var(--sab) - 80px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; pointer-events: auto; }
.panel h2 { font-size: 1.05rem; margin: 4px 0 6px; display: flex; justify-content: space-between; }
.panel h2 small { color: var(--muted); font-family: var(--font-body); font-weight: 800; }
.plist, .lblist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.plist li, .lblist li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; background: rgba(255,255,255,.06); font-weight: 800; font-size: .95rem; min-width: 0; }
.plist li.you { background: rgba(255,210,63,.18); }
.plist li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist li.dead .nm { opacity: .5; text-decoration: line-through; }
.mk { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); }
.mk.alive { background: var(--green); } .mk.dead { background: #ff4d6d; border-radius: 3px; transform: rotate(45deg); }
.chipbot { font: 800 .65rem var(--font-body); background: var(--yellow); color: var(--yellow-ink); border-radius: 6px; padding: 1px 5px; }
.lblist li b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lblist li span { color: var(--yellow); }
.lblist li i { font-style: normal; color: var(--muted); width: 1.4em; }

.results { position: absolute; left: 50%; top: calc(var(--sat) + 150px); transform: translateX(-50%); width: min(360px, calc(100vw - 24px)); background: var(--card); border: 2px solid var(--yellow); border-radius: 22px; padding: 16px 18px; text-align: center; pointer-events: auto; animation: resultsIn .5s cubic-bezier(.2,.9,.3,1.3); box-shadow: 0 16px 50px rgba(0,0,0,.5); }
.results.lost { border-color: #ff6b81; }
.results h2 { font-size: 1.9rem; color: var(--yellow); }
.results.lost h2 { color: #ff8da0; }
.results p { margin: 4px 0 8px; }
.results .x { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 1.3rem; cursor: pointer; }
.res-lines { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; text-align: left; }
.res-lines li { display: flex; justify-content: space-between; font-weight: 800; padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.06); }
.res-total { display: flex; gap: 8px; align-items: center; justify-content: center; font: 700 1.8rem var(--font-display); margin-top: 6px; }
.res-total span:last-child { font-size: 1rem; color: var(--muted); }
.unlock { margin-top: 10px; padding: 10px; border-radius: 14px; background: linear-gradient(90deg, #ffd23f, #ff9bf0); color: #2b1a00; font: 700 1.15rem var(--font-display); animation: pulseRed 1s ease-in-out infinite; }
@keyframes resultsIn { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }

.spectate { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--sab) + 18px); display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 18px; background: rgba(14,26,43,.88); border: 1px solid var(--line); font: 700 1.1rem var(--font-display); pointer-events: auto; max-width: 94vw; }
.spectate span { min-width: 0; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.press { position: absolute; left: 50%; bottom: calc(var(--sab) + 96px); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; padding: 14px 34px 12px; border: 0; border-bottom: 8px solid var(--red-dark); border-radius: 26px; background: radial-gradient(ellipse at 40% 25%, #ff8a8a, #eb2828 45%, #b01414); color: #fff; font: 700 clamp(1.5rem, 6vw, 2.1rem) var(--font-display); cursor: pointer; pointer-events: auto; box-shadow: 0 0 0 4px rgba(255,255,255,.2), 0 0 40px rgba(255,40,40,.7); animation: pressPulse .8s ease-in-out infinite; z-index: 30; min-width: 190px; text-shadow: 0 3px 0 rgba(0,0,0,.35); }
.press:active { border-bottom-width: 2px; transform: translateX(-50%) translateY(6px); }
.press kbd { font-size: .8rem; }
.press-top { line-height: 1; }
body.coarse .press kbd { display: none; }
@keyframes pressPulse { 0%,100% { box-shadow: 0 0 0 4px rgba(255,255,255,.2), 0 0 30px rgba(255,40,40,.6); } 50% { box-shadow: 0 0 0 8px rgba(255,255,255,.3), 0 0 60px rgba(255,40,40,.95); } }

.emotes { position: absolute; left: calc(var(--sal) + 12px); bottom: calc(var(--sab) + 14px); display: flex; gap: 6px; pointer-events: auto; }
.emotes button { position: relative; width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: rgba(14,26,43,.78); font-size: 1.5rem; cursor: pointer; padding: 0; }
.emotes button:hover { background: rgba(34,58,95,.95); }
.emotes kbd { position: absolute; right: 2px; bottom: 0; font-size: .6rem; padding: 0 3px; border-bottom-width: 2px; }
body.coarse .emotes { display: none; left: auto; right: calc(var(--sar) + 14px); bottom: calc(var(--sab) + 212px); flex-direction: column; }
body.coarse .emotes.open { display: flex; }
body.coarse .emotes kbd { display: none; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--sat) + 150px); display: grid; gap: 6px; justify-items: center; pointer-events: none; z-index: 90; width: min(92vw, 360px); }
.toast { padding: 8px 16px; border-radius: 999px; background: rgba(14,26,43,.9); border: 1px solid var(--line); font-weight: 800; animation: toastIn .25s ease-out, toastOut .4s ease-in 2.6s forwards; max-width: 100%; text-align: center; }
.toast.bad { border-color: #ff6b81; }
@keyframes toastIn { from { transform: translateY(-10px); opacity: 0; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
.reconnect { position: fixed; left: 50%; top: calc(var(--sat) + 70px); transform: translateX(-50%); padding: 10px 20px; border-radius: 999px; background: #7a2430; border: 2px solid #ff6b81; font: 700 1.1rem var(--font-display); z-index: 95; animation: pillPulse 1s ease-in-out infinite; }

/* ---------- touch controls ---------- */
.touch { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.stick-zone { position: absolute; left: 0; bottom: 0; width: 50%; height: 48%; pointer-events: auto; touch-action: none; }
.stick-base { position: absolute; left: calc(var(--sal) + 26px); bottom: calc(var(--sab) + 28px); width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); border: 3px solid rgba(255,255,255,.35); transition: opacity .2s; }
.stick-base.idle { opacity: .6; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,.7); box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.t-btn { position: absolute; pointer-events: auto; touch-action: none; border: 0; color: #fff; font: 700 1rem var(--font-display); border-radius: 50%; cursor: pointer; }
.t-jump { right: calc(var(--sar) + 24px); bottom: calc(var(--sab) + 34px); width: 96px; height: 96px; background: radial-gradient(circle at 35% 30%, #6fd9ff, #2a8cf0); border-bottom: 6px solid #1a5cb0; letter-spacing: .06em; }
.t-jump:active { transform: translateY(4px); border-bottom-width: 2px; }
.t-emote { right: calc(var(--sar) + 36px); bottom: calc(var(--sab) + 146px); width: 56px; height: 56px; font-size: 1.7rem; background: rgba(14,26,43,.8); border: 2px solid var(--line); }
body.coarse .press { bottom: calc(var(--sab) + 172px); }
body.coarse .spectate { bottom: calc(var(--sab) + 30px); }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .hud-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tl tr" "pill pill"; row-gap: 6px; }
  .hpbar { top: calc(var(--sat) + 118px); }
  .hint { top: calc(var(--sat) + 150px); }
  .toasts, .results { top: calc(var(--sat) + 190px); }
  .pill-text b { font-size: 1.12rem; }
  .coins { height: 40px; font-size: 1.05rem; padding: 0 10px 0 8px; }
  .icon-btn { min-width: 40px; height: 40px; padding: 0 8px; }
  .badge { font-size: .8rem; padding: 4px 9px; }
  .banner { top: 30%; }
  .panel { top: calc(var(--sat) + 110px); }
}
@media (max-height: 560px) and (orientation: landscape) {
  .hud-top { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "tl pill tr"; }
  .pill { min-height: 48px; } .ring { width: 36px; height: 36px; }
  .look-row { grid-template-columns: 90px minmax(0, 1fr); } .avatar-preview { height: 140px; }
  .title-inner { margin-block: 0; }
  .results { top: calc(var(--sat) + 70px); transform: translateX(-50%) scale(.85); }
  .stick-zone { height: 62%; }
  .press { bottom: calc(var(--sab) + 20px); }
  body.coarse .press { bottom: calc(var(--sab) + 20px); }
}
@media (max-width: 400px) {
  .look-row { grid-template-columns: 96px minmax(0, 1fr); }
  .sw { width: 30px; height: 30px; }
  .btn.big { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .banner .b { animation: bannerFade var(--dur, 2.4s) linear forwards !important; animation-duration: var(--dur, 2.4s) !important; }
  .logo { animation: none !important; }
}
@keyframes bannerFade { 0%, 90% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- name picker, idle card, misc ---------- */
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; background: #0e1a2b; color: #fff; font: 700 20px sans-serif; text-align: center; padding: 24px; }
.center { text-align: center; }
.name-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 2px; }
.name-head .field-label { margin: 4px 0; }
.name-live { font: 700 1.15rem var(--font-display); color: var(--yellow); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-pick { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 58px 48px; gap: 6px; }
.input.sel, .input.num { font-size: 1rem; padding: 8px 8px; min-height: 48px; }
.input.num { text-align: center; padding-inline: 4px; }
.dice { min-width: 48px; height: 48px; font-size: 1.4rem; padding: 0; }
.name-note { margin: 4px 0 0; }
.hint .btn { margin-left: 6px; }
@media (max-width: 400px) { .name-pick { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px 44px; } .dice { min-width: 44px; } }
