:root {
  --bg: #0c0708;
  --card: #120b0b;
  --card-line: #2b1d1d;
  --ember: #c2560c;
  --amber: #e0a040;
  --blood: #b3001b;
  --blood-hot: #e0102f;
  --blood-deep: #4a000a;
  --bone: #efe4cc;
  --muted: #a8968f;
  --ink: #050304;
  --neon-green: #7ed321;
  --neon-red: #ff2d55;
  --neon-cyan: #22d3ee;
  --neon-purple: #a855f7;
  --neon-amber: #f59e0b;
  --title: 'Cinzel Decorative', 'Cinzel', Georgia, serif;
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --gore: 'Creepster', 'Impact', sans-serif;
  --metal: 'Anton', 'Impact', 'Arial Narrow Bold', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: 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(--bg); color: var(--bone); font-family: var(--serif); font-size: 17px; }
body { touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; display: block; touch-action: none; }
button { font-family: inherit; }

/* ---------- buttons ---------- */
.btn {
  font: 700 0.95rem/1 var(--title); letter-spacing: 0.02em; color: var(--bone);
  background: var(--card); border: 2px solid var(--card-line); border-radius: 14px;
  padding: 0.9rem 1.2rem; cursor: pointer; transition: transform 80ms, border-color 120ms, box-shadow 120ms;
}
.btn:hover { border-color: #4a3030; }
.btn:active { transform: translateY(2px); }
.btn:focus-visible, .seg button:focus-visible, input:focus-visible, .card-btn:focus-visible, .best-pill:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: linear-gradient(180deg, #c8102e, #7a0012); border-color: #ff2d55; box-shadow: 0 0 18px rgba(255, 45, 85, 0.35); color: #fff; }
.btn.purple { background: #1a0f22; border-color: var(--neon-purple); box-shadow: 0 0 14px rgba(168, 85, 247, 0.3); }
.btn.ghost { background: transparent; }
.btn.small { font-size: 0.8rem; padding: 0.6rem 0.9rem; }

/* ---------- screens + panels ---------- */
.screen {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: calc(1rem + var(--safe-t)) calc(1rem + var(--safe-r)) calc(1rem + var(--safe-b)) calc(1rem + var(--safe-l));
  background: radial-gradient(ellipse 90% 55% at 50% 0%, rgba(110, 40, 6, 0.55), transparent 70%), rgba(10, 5, 6, 0.8);
  overflow-y: auto; touch-action: pan-y;
}
.panel {
  width: min(560px, 100%); max-height: 100%; overflow-y: auto;
  background: rgba(14, 8, 9, 0.96); border: 2px solid var(--card-line); border-radius: 20px;
  padding: 1.4rem 1.4rem 1.2rem; box-shadow: 0 0 60px rgba(194, 86, 12, 0.18), 0 20px 60px rgba(0, 0, 0, 0.7);
  touch-action: pan-y;
}
.panel.wide { width: min(780px, 100%); }
h2 { font: 900 1.9rem/1.1 var(--title); margin: 0 0 1rem; color: var(--bone); text-shadow: 0 0 18px rgba(224, 160, 64, 0.25); }
h3 { font: 700 1.05rem/1.2 var(--title); margin: 0 0 0.6rem; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.row { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.2rem; }

/* ---------- title / splash ---------- */
.title-screen {
  align-items: flex-start;
  background: radial-gradient(ellipse 85% 42% at 50% 16%, rgba(150, 62, 8, 0.85), rgba(40, 14, 8, 0.6) 55%, transparent 80%), rgba(12, 7, 8, 0.93);
}
.title-wrap { width: min(470px, 100%); margin: 0 auto; padding-top: 0.6rem; display: grid; justify-items: center; gap: 1.1rem; position: relative; z-index: 1; }
.logo-card {
  position: relative; width: min(78vw, 380px); aspect-ratio: 1; container-type: inline-size;
  border-radius: 12px; overflow: hidden; border: 3px solid #050304;
  box-shadow: 0 0 0 2px #3a3040, 0 0 50px 8px rgba(214, 100, 20, 0.5), 0 18px 40px rgba(0, 0, 0, 0.7);
}
.logo-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.logo-card.cover { aspect-ratio: 3 / 2; width: min(92vw, 470px); box-shadow: 0 0 0 2px #3a3040, 0 0 50px 8px rgba(255, 200, 60, 0.35), 0 18px 40px rgba(0, 0, 0, 0.7); }
.logo-card.cover .logo-art { object-fit: cover; }
.logo-top { position: absolute; top: 5.5%; left: 0; right: 0; display: grid; justify-items: center; line-height: 0.86; }
.dc-name, .dc-apps {
  font-family: var(--metal); text-transform: uppercase; letter-spacing: 0.01em;
  background: linear-gradient(95deg, #f1dccb 0%, #c9a58f 30%, #b79ab8 62%, #8e7ad0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0.5cqw 0 #1a0a0a) drop-shadow(0 0 0.35cqw #000);
}
.dc-name { font-size: 16.5cqw; transform: perspective(60cqw) rotateX(8deg) scaleY(1.08); }
.dc-apps { font-size: 10cqw; display: flex; align-items: center; gap: 2cqw; }
.bolt { display: block; width: 11cqw; height: 1.2cqw; background: linear-gradient(90deg, transparent, #e0102f 40%, #ff5a6a); transform: skewX(-30deg); box-shadow: 0 0 1.5cqw #e0102f; }
.bolt.r { transform: scaleX(-1) skewX(-30deg); }
.logo-dc {
  position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%);
  font: 400 9cqw/1 'UnifrakturMaguntia', 'Old English Text MT', serif; color: #120606;
  text-shadow: 0 0 0.6cqw rgba(255, 230, 200, 0.35);
}
.logo-game {
  position: absolute; left: 0; right: 0; bottom: 4.5%; text-align: center;
  font: 400 13.5cqw/0.9 var(--gore); color: var(--blood-hot); letter-spacing: 0.01em; transform: rotate(-3deg);
  text-shadow: 0 0.6cqw 0 #3a0006, 0 0 1.5cqw #000, 0 0 4cqw rgba(224, 16, 47, 0.55);
}
.logo-game span:first-child { font-size: 0.86em; }
.best-pill {
  display: flex; align-items: baseline; gap: 0.6rem; cursor: pointer;
  background: rgba(20, 10, 6, 0.85); color: var(--amber); border: 2px solid rgba(224, 160, 64, 0.6);
  border-radius: 999px; padding: 0.55rem 1.3rem; font-family: var(--serif);
}
.best-pill b { font: 900 1.5rem/1 var(--title); color: #ffcf6a; }
.pill-sub { font-size: 0.95rem; color: #d9a45a; }
.pill-ico svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: translateY(3px); }
.cards { width: 100%; display: grid; gap: 0.8rem; }
.card-btn {
  display: flex; align-items: center; gap: 1.1rem; width: 100%; text-align: left; cursor: pointer;
  background: rgba(14, 9, 9, 0.94); border: 2px solid var(--card-line); border-radius: 18px; padding: 0.95rem 1.1rem;
  color: var(--bone); transition: transform 90ms, border-color 150ms;
}
.card-btn:hover { border-color: #4a3030; }
.card-btn:active { transform: scale(0.985); }
.ico { flex: none; width: 3.5rem; height: 3.5rem; border-radius: 12px; border: 2px solid; display: grid; place-items: center; background: #080506; }
.ico svg { width: 1.8rem; height: 1.8rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.green { color: var(--neon-green); border-color: var(--neon-green); box-shadow: 0 0 12px rgba(126, 211, 33, 0.45), inset 0 0 8px rgba(126, 211, 33, 0.15); }
.ico.red { color: var(--neon-red); border-color: var(--neon-red); box-shadow: 0 0 12px rgba(255, 45, 85, 0.45), inset 0 0 8px rgba(255, 45, 85, 0.15); }
.ico.cyan { color: var(--neon-cyan); border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(34, 211, 238, 0.45), inset 0 0 8px rgba(34, 211, 238, 0.15); }
.ico.purple { color: var(--neon-purple); border-color: var(--neon-purple); box-shadow: 0 0 12px rgba(168, 85, 247, 0.45), inset 0 0 8px rgba(168, 85, 247, 0.15); }
.ico.amber { color: var(--neon-amber); border-color: var(--neon-amber); box-shadow: 0 0 12px rgba(245, 158, 11, 0.45), inset 0 0 8px rgba(245, 158, 11, 0.15); }
.card-txt { display: grid; gap: 0.25rem; min-width: 0; }
.card-title { font: 900 1.45rem/1.05 var(--title); color: #fff; }
.card-sub { font-size: 1.05rem; color: var(--muted); }
.brand-foot { margin: 0.2rem 0 1rem; color: var(--muted); font-size: 0.9rem; }

/* bats */
.bats { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.bat { position: absolute; width: 58px; filter: drop-shadow(0 0 6px rgba(255, 130, 30, 0.75)); animation: flap 0.35s ease-in-out infinite alternate, drift 18s linear infinite; }
.bat svg { width: 100%; display: block; fill: #8f8a92; }
.b1 { top: 6%; left: 70%; animation-duration: 0.32s, 22s; }
.b2 { top: 38%; left: 8%; width: 44px; animation-duration: 0.4s, 26s; animation-delay: 0s, -6s; }
.b3 { top: 52%; left: 84%; width: 50px; animation-delay: 0s, -12s; }
.b4 { top: 66%; left: 24%; width: 36px; animation-duration: 0.3s, 20s; animation-delay: 0s, -3s; }
.b5 { top: 80%; left: 60%; width: 48px; animation-delay: 0s, -9s; }
.b6 { top: 28%; left: 88%; width: 34px; animation-duration: 0.38s, 30s; animation-delay: 0s, -15s; }
.b7 { top: 90%; left: 6%; width: 40px; animation-delay: 0s, -4s; }
@keyframes flap { from { transform: scaleY(1) rotate(-8deg); } to { transform: scaleY(0.55) rotate(6deg); } }
@keyframes drift { 0% { translate: 0 0; } 25% { translate: -40px 30px; } 50% { translate: 10px 60px; } 75% { translate: 40px 20px; } 100% { translate: 0 0; } }

/* install sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0.55); padding: 1rem calc(1rem + var(--safe-r)) calc(1rem + var(--safe-b)) calc(1rem + var(--safe-l)); }
.sheet {
  width: min(520px, 100%); background: #140b0b; border: 2px solid var(--neon-amber); border-radius: 22px; padding: 1.2rem;
  display: grid; grid-template-columns: auto 1fr; gap: 0.9rem 1rem; box-shadow: 0 0 40px rgba(245, 158, 11, 0.3);
  animation: rise 220ms ease-out;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.sheet-icon { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 0 18px rgba(214, 100, 20, 0.6); }
.sheet-body h3 { font-size: 1.2rem; margin-bottom: 0.3rem; }
.sheet-body p { margin: 0; color: var(--muted); }
.ios-steps { margin: 0.6rem 0 0; padding-left: 1.2rem; color: var(--bone); line-height: 1.5; }
.share-ico { display: inline-block; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 0.25rem; font-size: 0.8em; }
.sheet-btns { grid-column: 1 / -1; display: flex; gap: 0.7rem; justify-content: flex-end; }

/* ---------- forms ---------- */
.field { display: grid; gap: 0.4rem; color: var(--muted); margin-bottom: 1rem; }
input {
  font: 600 1.1rem var(--serif); color: var(--bone); background: #080506; border: 2px solid var(--card-line);
  border-radius: 12px; padding: 0.7rem 0.9rem; width: 100%; user-select: text; -webkit-user-select: text;
}
.code-input { font: 900 1.6rem/1 var(--title); letter-spacing: 0.25em; text-align: center; text-transform: uppercase; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.card { background: #0e0808; border: 2px solid var(--card-line); border-radius: 16px; padding: 1rem; display: grid; gap: 0.7rem; align-content: start; }
.card p { margin: 0; }
.msg { min-height: 1.4em; margin: 0.9rem 0 0; color: var(--neon-green); }
.msg.bad { color: #ff6b81; }

/* ---------- settings ---------- */
.settings { display: grid; gap: 0.9rem; }
.setting { display: grid; gap: 0.35rem; }
.setting-label { color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 0.3rem; background: #080506; border-radius: 12px; padding: 0.3rem; border: 2px solid var(--card-line); }
.seg button { flex: 1 1 auto; font: 600 1rem var(--serif); color: var(--muted); background: transparent; border: 0; border-radius: 9px; padding: 0.5rem 0.6rem; cursor: pointer; }
.seg button.on { background: linear-gradient(180deg, #c8102e, #7a0012); color: #fff; box-shadow: 0 0 10px rgba(255, 45, 85, 0.4); }
.seg button:disabled { cursor: default; }
.seg button:disabled:not(.on) { opacity: 0.55; }
.settings.compact { gap: 0.6rem; }
.settings.compact .seg button { padding: 0.4rem 0.5rem; font-size: 0.92rem; }

/* ---------- how to ---------- */
.how p { margin: 0 0 0.7rem; }
.how b { color: var(--amber); font-weight: 700; }
.pu-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.pu-list li { display: flex; gap: 0.7rem; align-items: center; line-height: 1.3; }
.pu-ico { flex: none; width: 2.4rem; height: 2.4rem; border-radius: 10px; border: 2px solid; display: grid; place-items: center; font-size: 1.1rem; background: #080506; }

/* ---------- lobby ---------- */
.lobby-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.lobby-head p { margin: 0 0 0.2rem; }
.code { font: 900 2.8rem/1 var(--title); letter-spacing: 0.14em; color: var(--amber); text-shadow: 0 0 18px rgba(224, 160, 64, 0.45); }
.lobby-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.4rem; }
.players { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.players li, .podium li { display: flex; align-items: center; gap: 0.6rem; background: #0e0808; border: 1px solid var(--card-line); border-radius: 12px; padding: 0.55rem 0.75rem; }
.players i, .podium i, #scoreboard i { flex: none; width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--ink); }
.players span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players em { font-style: normal; font-size: 0.8rem; padding: 0.1rem 0.5rem; border-radius: 99px; background: var(--blood); }
.players em.you { background: #2b1d1d; }

/* ---------- results ---------- */
.stats { display: grid; gap: 0.5rem; margin: 0.5rem 0 0; }
.stats div { display: flex; justify-content: space-between; background: #0e0808; border: 1px solid var(--card-line); border-radius: 12px; padding: 0.65rem 0.9rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font: 700 1.05rem var(--title); }
.stats .hl { background: linear-gradient(180deg, #8a0014, #4a000a); border-color: var(--neon-red); }
.stats .hl dt { color: var(--bone); }
.podium { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.podium .place { font: 900 1.3rem/1 var(--title); width: 1.4rem; color: var(--amber); }
.podium .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium b { font: 900 1.2rem var(--title); min-width: 2ch; text-align: right; }
.podium li:first-child { background: #2a0a10; border-color: var(--neon-red); }
.podium li.me .nm::after { content: ' (you)'; color: var(--muted); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 0.45rem; pointer-events: none !important; }
.chip { font: 700 0.9rem/1 var(--title); background: rgba(12, 7, 8, 0.85); border: 2px solid var(--card-line); border-radius: 12px; padding: 0.55rem 0.75rem; white-space: nowrap; }
.chip.timer { font: 900 1.15rem/0.9 var(--title); min-width: 4.4rem; text-align: center; color: var(--amber); border-color: rgba(224, 160, 64, 0.5); }
.chip.timer.low { color: #fff; background: var(--blood); border-color: var(--neon-red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.menu-btn { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--card-line); background: rgba(12, 7, 8, 0.85); color: var(--bone); font: 700 0.9rem var(--serif); cursor: pointer; }
#effects { position: absolute; top: calc(64px + var(--safe-t)); left: calc(10px + var(--safe-l)); display: grid; gap: 0.35rem; pointer-events: none !important; }
.fx { display: flex; align-items: center; gap: 0.4rem; background: rgba(12, 7, 8, 0.85); border-radius: 10px; padding: 0.3rem 0.5rem; font: 700 0.85rem var(--serif); }
.fx span { font-size: 1rem; }
.fx .bar { width: 64px; height: 7px; background: #2b1d1d; border-radius: 4px; overflow: hidden; }
.fx .bar i { display: block; height: 100%; }
.fx.bad { background: rgba(120, 0, 20, 0.88); }
#scoreboard { position: absolute; top: calc(10px + var(--safe-t)); right: calc(10px + var(--safe-r)); margin: 0; padding: 0.4rem; list-style: none; background: rgba(12, 7, 8, 0.85); border: 2px solid var(--card-line); border-radius: 12px; min-width: 150px; max-width: 42vw; pointer-events: none !important; }
#scoreboard li { display: flex; align-items: center; gap: 0.4rem; font: 600 0.95rem var(--serif); padding: 0.15rem 0.3rem; border-radius: 7px; }
#scoreboard li b { font-family: var(--title); }
#scoreboard li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#scoreboard li.me { background: #2b1d1d; }
#minimap { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(14px + var(--safe-b)); width: 150px; height: 110px; border-radius: 12px; border: 2px solid var(--card-line); background: rgba(12, 7, 8, 0.7); pointer-events: none !important; }
#goreOverlay { position: absolute; inset: 0; pointer-events: none !important; overflow: hidden; }
.splat {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 45% 40%, rgba(200, 0, 25, 0.9) 0 35%, rgba(120, 0, 15, 0.8) 55%, transparent 70%);
  animation: splatfade 1.8s ease-in forwards;
}
.splat::after { content: ''; position: absolute; left: 44%; top: 60%; width: 12%; height: 90%; border-radius: 0 0 50% 50%; background: rgba(150, 0, 20, 0.85); animation: splatdrip 1.8s ease-in forwards; transform-origin: top; }
@keyframes splatfade { 0% { transform: scale(0.4); opacity: 1; } 12% { transform: scale(1); } 70% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes splatdrip { 0% { transform: scaleY(0); } 100% { transform: scaleY(1.6); } }

#beamBtn {
  position: absolute; right: calc(22px + var(--safe-r)); bottom: calc(24px + var(--safe-b));
  width: 118px; height: 118px; border-radius: 50%; cursor: pointer; touch-action: none;
  border: 5px solid #050304;
  background: radial-gradient(circle at 36% 30%, #ff7a86 0 12%, #e0102f 38%, #8a0014 78%);
  box-shadow: 0 9px 0 #3a0008, 0 9px 0 5px #050304, 0 0 26px rgba(255, 45, 85, 0.45), inset 0 -8px 0 rgba(0, 0, 0, 0.25);
  transition: transform 60ms, box-shadow 60ms;
}
#beamBtn span { font: 400 1.6rem/1 var(--gore); color: var(--bone); text-shadow: 0 3px 0 #050304; letter-spacing: 0.04em; pointer-events: none; }
#beamBtn.on { transform: translateY(7px); box-shadow: 0 2px 0 #3a0008, 0 2px 0 5px #050304, 0 0 0 10px rgba(140, 255, 160, 0.25), 0 0 40px 12px rgba(140, 255, 160, 0.45), inset 0 -4px 0 rgba(0, 0, 0, 0.25); }
#beamBtn.jammed { filter: grayscale(1) brightness(0.6); }

#toast {
  position: fixed; z-index: 45; left: 50%; top: calc(64px + var(--safe-t)); transform: translate(-50%, -12px);
  background: #140b0b; color: var(--bone); font: 700 1rem var(--serif); padding: 0.6rem 1rem; border-radius: 12px;
  border: 2px solid var(--amber); box-shadow: 0 0 18px rgba(224, 160, 64, 0.35); opacity: 0; pointer-events: none;
  transition: opacity 160ms, transform 160ms; max-width: calc(100vw - 2rem); text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- health bar ---------- */
#health {
  position: fixed; z-index: 12; top: calc(58px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.45rem; padding: 0.35rem 0.6rem 0.35rem 0.45rem;
  background: rgba(12, 7, 8, 0.85); border: 2px solid var(--card-line); border-radius: 12px; pointer-events: none;
}
.hp-heart { width: 20px; height: 20px; fill: #e0102f; filter: drop-shadow(0 0 5px rgba(255, 45, 85, 0.7)); flex: none; }
#hpBars { display: flex; gap: 4px; }
.hp-seg { position: relative; display: block; width: 22px; height: 14px; border-radius: 3px; background: #2a1014; border: 2px solid #050304; overflow: hidden; transform: skewX(-12deg); }
.hp-seg i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #ff5a6a, #c8102e 55%, #7a0012); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); transition: width 180ms; }
.hp-seg.ghost { background: transparent; border: 2px dashed rgba(255, 90, 106, 0.7); }
.hp-seg.arrive { animation: arrive 700ms ease-out; }
@keyframes arrive { 0% { transform: skewX(-12deg) scale(1.9); box-shadow: 0 0 18px 6px rgba(255, 60, 90, 0.9); } 100% { transform: skewX(-12deg) scale(1); box-shadow: none; } }
#health.low .hp-heart { animation: beat 0.6s infinite; }
#health.low { border-color: var(--neon-red); box-shadow: 0 0 14px rgba(255, 45, 85, 0.45); }
@keyframes beat { 50% { transform: scale(1.3); } }
#health.hit { animation: shake 260ms; }
@keyframes shake { 25% { transform: translateX(calc(-50% - 5px)); } 75% { transform: translateX(calc(-50% + 5px)); } }
#health.grow { animation: grow 600ms; }
@keyframes grow { 40% { transform: translateX(-50%) scale(1.15); box-shadow: 0 0 22px rgba(255, 60, 90, 0.8); } }
#hurtFlash { position: absolute; inset: 0; pointer-events: none !important; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(200, 0, 20, 0.55)); }
#hurtFlash.on { animation: hurt 380ms ease-out; }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- extra bar award ---------- */
.award {
  position: fixed; z-index: 50; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(340px, 86vw); text-align: center; padding: 1.4rem 1.2rem 1.3rem;
  background: rgba(16, 8, 9, 0.96); border: 2px solid var(--neon-red); border-radius: 20px;
  box-shadow: 0 0 50px rgba(255, 45, 85, 0.45), 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: awardIn 450ms cubic-bezier(.2, 1.4, .4, 1);
}
.award.out { animation: awardOut 500ms ease-in forwards; }
@keyframes awardIn { from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; } }
@keyframes awardOut { to { transform: translate(-50%, -40%) scale(0.9); opacity: 0; } }
.award-kicker { color: var(--amber); font: 600 1rem var(--serif); letter-spacing: 0.08em; text-transform: uppercase; }
.award-title { font: 900 1.7rem/1.1 var(--title); margin: 0.3rem 0 1rem; text-shadow: 0 0 18px rgba(255, 45, 85, 0.6); }
.award-slot { display: flex; justify-content: center; height: 36px; align-items: center; }
.hp-seg.big { width: 44px; height: 28px; box-shadow: 0 0 20px rgba(255, 45, 85, 0.8); animation: pulseBar 0.8s infinite; }
@keyframes pulseBar { 50% { box-shadow: 0 0 34px 6px rgba(255, 45, 85, 0.9); } }
.award-sub { color: var(--muted); margin-top: 0.9rem; }
.hp-seg.fly { position: fixed; left: 0; top: 0; z-index: 60; width: 22px; height: 14px; box-shadow: 0 0 16px 4px rgba(255, 60, 90, 0.9); pointer-events: none; will-change: transform; }
.hp-trail { position: fixed; z-index: 55; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #ffd0d6, #ff2d55 45%, transparent 70%); animation: trail 620ms ease-out forwards; }
@keyframes trail { to { transform: scale(0.2); opacity: 0; } }

/* ---------- level / threat banner ---------- */
#banner { position: fixed; z-index: 14; left: 50%; top: 34%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; opacity: 0; width: min(92vw, 560px); }
#banner.show { animation: bannerShow 3.4s ease forwards; }
@keyframes bannerShow { 0% { opacity: 0; transform: translate(-50%, -40%) scale(1.2); } 10% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -56%); } }
.banner-kicker { font: 600 1.05rem var(--serif); color: var(--amber); letter-spacing: 0.12em; text-transform: uppercase; }
.banner-title { font: 400 clamp(2rem, 9vw, 3.4rem)/1 var(--gore); color: var(--blood-hot); text-shadow: 0 4px 0 #3a0006, 0 0 20px rgba(0, 0, 0, 0.9); margin: 0.2rem 0; }
.banner-sub { font: 600 1.1rem var(--serif); color: var(--bone); text-shadow: 0 2px 6px #000; }
.warn { color: #ff8a8a; margin: 0.8rem 0 0; }

@media (max-width: 620px) {
  .split, .lobby-grid { grid-template-columns: 1fr; }
  .code { font-size: 2.3rem; }
  h2 { font-size: 1.6rem; }
  .card-title { font-size: 1.25rem; }
  .card-sub { font-size: 0.98rem; }
  .ico { width: 3.1rem; height: 3.1rem; }
  .chip { font-size: 0.78rem; padding: 0.45rem 0.55rem; }
  .chip.timer { font-size: 1rem; min-width: 3.8rem; }
  .hud-top { top: calc(62px + var(--safe-t)); }
  #effects { top: calc(146px + var(--safe-t)); }
  #health { top: calc(104px + var(--safe-t)); }
  .hp-seg { width: 18px; height: 13px; }
  #scoreboard { min-width: 120px; }
  #beamBtn { width: 104px; height: 104px; }
  #minimap { width: 120px; height: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  .bat, .chip.timer.low, .splat, .splat::after, .sheet, #health.low .hp-heart { animation: none !important; }
}

/* ---------- Dead Center Apps account + social ---------- */
.acct-chip { display: flex; align-items: center; justify-content: center; gap: 0.55rem; flex-wrap: wrap; margin: 0.9rem auto 0; padding: 0.5rem 0.9rem; max-width: 26rem;
  background: rgba(18, 11, 11, 0.85); border: 1px solid var(--card-line); border-radius: 999px; font: 600 0.95rem/1.2 var(--serif); color: var(--bone); }
.acct-chip img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--blood-hot); object-fit: cover; }
.acct-chip b { color: var(--amber); }
.acct-chip a { color: var(--amber); font-weight: 700; }
.acct-chip a.acct-link { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.brand-foot a { color: var(--muted); text-decoration: none; }
.brand-foot a:hover { color: var(--bone); text-decoration: underline; }
.lobby-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.add-friend { margin-left: auto; font: 700 0.75rem/1 var(--title); color: #d9fbc8; background: #10230b; border: 1px solid var(--neon-green); border-radius: 999px; padding: 0.45rem 0.7rem; cursor: pointer; }
.add-friend:hover { background: #1a3812; }
.add-friend[disabled] { opacity: 0.6; cursor: default; }
em.friend { margin-left: auto; font: 700 0.72rem/1 var(--title); font-style: normal; color: var(--neon-cyan); border: 1px solid rgba(34, 211, 238, 0.5); border-radius: 999px; padding: 0.35rem 0.6rem; }
.invite-panel { margin: 0.8rem 0; padding: 0.8rem; border: 1px solid var(--neon-purple); border-radius: 14px; background: #140c1a; }
.invite-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.invite-head h3 { margin: 0; }
.invite-list { max-height: 14rem; overflow-y: auto; display: grid; gap: 0.4rem; }
.invite-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.55rem; background: rgba(0, 0, 0, 0.35); border-radius: 10px; }
.invite-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #5c4a50; flex: none; }
.dot.on { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }
input[readonly] { opacity: 0.85; cursor: default; }

/* =====================================================================
   Cram-It! additions (same Dead Center Apps look as Cow Culling)
   ===================================================================== */
.logo-game.cram { font-size: 17cqw; color: #9dff3a; bottom: 5%;
  text-shadow: 0 0.6cqw 0 #173a02, 0 0 1.5cqw #000, 0 0 5cqw rgba(140, 255, 40, 0.55); transform: rotate(-4deg); }
.logo-game.cram span:first-child { font-size: 1em; }
.logo-tag { position: absolute; left: 0; right: 0; bottom: 25%; text-align: center; font: 600 4.6cqw/1 var(--serif); letter-spacing: 0.3em; text-transform: uppercase; color: #f1dccb; text-shadow: 0 0 1cqw #000, 0 0 2cqw #000; }
.ico.acid { color: #9dff3a; border-color: #9dff3a; box-shadow: 0 0 12px rgba(157, 255, 58, 0.45), inset 0 0 8px rgba(157, 255, 58, 0.15); }

/* fighter select */
.fighters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.fighter { display: grid; justify-items: center; gap: 0.35rem; padding: 0.7rem 0.4rem; background: #0e0808; border: 2px solid var(--card-line); border-radius: 16px; color: var(--bone); cursor: pointer; font-family: var(--serif); }
.fighter img { width: 64px; height: 64px; object-fit: contain; image-rendering: auto; }
.fighter b { font: 900 1.05rem/1 var(--title); }
.fighter small { color: var(--muted); font-size: 0.85rem; text-align: center; line-height: 1.25; }
.fighter .stat { display: flex; gap: 0.35rem; font-size: 0.8rem; color: var(--amber); }
.fighter.on { border-color: var(--neon-red); box-shadow: 0 0 16px rgba(255, 45, 85, 0.45); background: #1c0a0e; }
.hats { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.hat { width: 58px; height: 58px; border-radius: 14px; border: 2px solid var(--card-line); background: #0e0808; display: grid; place-items: center; cursor: pointer; color: var(--muted); font: 600 0.8rem var(--serif); }
.hat img { width: 44px; height: 44px; object-fit: contain; }
.hat.on { border-color: var(--neon-red); box-shadow: 0 0 12px rgba(255, 45, 85, 0.45); }
.loadout-line { display: flex; align-items: center; gap: 0.6rem; justify-content: center; color: var(--muted); font-size: 0.95rem; }
.loadout-line img { width: 30px; height: 30px; object-fit: contain; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; margin: 0.4rem 0 0.9rem; }
.keys kbd { font: 700 0.85rem var(--serif); background: #1d1212; border: 1px solid #3a2a2a; border-bottom-width: 3px; border-radius: 6px; padding: 0.15rem 0.45rem; white-space: nowrap; justify-self: start; }

/* HUD: status panel bottom-left */
#status { position: absolute; left: calc(10px + var(--safe-l)); bottom: calc(12px + var(--safe-b)); display: grid; gap: 0.35rem; min-width: 190px; padding: 0.5rem 0.6rem; background: rgba(12, 7, 8, 0.82); border: 2px solid var(--card-line); border-radius: 14px; pointer-events: none !important; }
.bar2 { position: relative; height: 13px; border-radius: 5px; background: #2a1014; border: 2px solid #050304; overflow: hidden; }
.bar2 i { position: absolute; inset: 0 auto 0 0; transition: width 150ms; }
.bar2.hp i { background: linear-gradient(180deg, #ff5a6a, #c8102e 55%, #7a0012); }
.bar2.sh { height: 8px; }
.bar2.sh i { background: linear-gradient(180deg, #9fe6ff, #2aa3e0); }
.bar2 span { position: absolute; inset: 0; display: grid; place-items: center; font: 700 0.62rem/1 var(--title); color: #fff; text-shadow: 0 1px 2px #000; }
.wrow { display: flex; align-items: center; gap: 0.5rem; font: 700 0.95rem/1 var(--title); }
.wrow img { height: 22px; max-width: 64px; object-fit: contain; }
.wrow .ammo { color: var(--amber); }
.wrow .nades { margin-left: auto; display: flex; align-items: center; gap: 0.2rem; }
.wrow .nades img { height: 18px; }
.wrow .reload { color: #ff6b81; font-size: 0.8rem; }
.chip.frogs { color: #9dff3a; border-color: rgba(157, 255, 58, 0.45); }
.chip.score b { color: var(--amber); }
#killfeed { position: absolute; right: calc(10px + var(--safe-r)); top: calc(10px + var(--safe-t)); display: grid; gap: 0.25rem; justify-items: end; pointer-events: none !important; max-width: 60vw; }
#killfeed div { font: 600 0.85rem/1.2 var(--serif); background: rgba(12, 7, 8, 0.82); border-radius: 8px; padding: 0.25rem 0.55rem; animation: kf 4s forwards; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#killfeed b { font-weight: 800; }
@keyframes kf { 0% { opacity: 0; transform: translateX(20px); } 6% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }
#scoreboard { top: auto; bottom: calc(12px + var(--safe-b)); }
#scoreboard li .fr { color: #9dff3a; font-size: 0.8rem; }
#scoreboard { min-width: 190px; }
#bigmsg { position: fixed; z-index: 13; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
#bigmsg .n { font: 400 clamp(4rem, 18vw, 8rem)/1 var(--gore); color: var(--blood-hot); text-shadow: 0 6px 0 #3a0006, 0 0 30px rgba(0, 0, 0, 0.9); }
#bigmsg .n.go { color: #9dff3a; text-shadow: 0 6px 0 #173a02, 0 0 30px rgba(0, 0, 0, 0.9); }
#bigmsg .s { font: 700 1.2rem var(--serif); color: var(--bone); text-shadow: 0 2px 8px #000; margin-top: 0.4rem; }
#bigmsg.pop .n { animation: popn 0.9s ease-out; }
@keyframes popn { 0% { transform: scale(2); opacity: 0; } 20% { transform: scale(1); opacity: 1; } 100% { opacity: 0.85; } }

/* touch controls */
#touch { position: absolute; inset: 0; pointer-events: none !important; }
#touch .zone { position: absolute; top: 25%; bottom: 0; pointer-events: auto; touch-action: none; }
#touch .zone.left { left: 0; width: 45%; }
#touch .zone.right { right: 0; width: 55%; }
.stick { position: absolute; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.22); background: rgba(12, 7, 8, 0.35); pointer-events: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffffff55, #ffffff22); border: 2px solid rgba(255, 255, 255, 0.4); }
.stick.aim { border-color: rgba(255, 45, 85, 0.45); }
.stick.aim i { background: radial-gradient(circle at 40% 35%, #ff7a86, #b3001b); border-color: #ff2d55; }
.stick.idle { opacity: 0.55; }
.tbtn { position: absolute; width: 66px; height: 66px; border-radius: 50%; border: 3px solid #050304; pointer-events: auto; touch-action: none; display: grid; place-items: center; cursor: pointer;
  font: 400 0.95rem/1 var(--gore); color: var(--bone); text-shadow: 0 2px 0 #000; box-shadow: 0 5px 0 #050304, 0 0 16px rgba(0, 0, 0, 0.5); }
.tbtn.jump { right: calc(172px + var(--safe-r)); bottom: calc(22px + var(--safe-b)); width: 84px; height: 84px; font-size: 1.2rem; background: radial-gradient(circle at 36% 30%, #b8ff7a, #4f9a14 60%, #1f4a04); }
.tbtn.nade { right: calc(190px + var(--safe-r)); bottom: calc(118px + var(--safe-b)); background: radial-gradient(circle at 36% 30%, #ffb07a, #c2560c 60%, #5a2604); }
.tbtn.knife { right: calc(116px + var(--safe-r)); bottom: calc(168px + var(--safe-b)); background: radial-gradient(circle at 36% 30%, #d0d0e0, #6a6a80 60%, #2a2a38); }
.tbtn:active, .tbtn.on { transform: translateY(4px); box-shadow: 0 1px 0 #050304; }
.tbtn small { font-size: 0.7rem; display: block; }
body.touch #status { bottom: auto; top: calc(62px + var(--safe-t)); min-width: 160px; }
body.touch #scoreboard { bottom: auto; top: calc(62px + var(--safe-t)); }
body.touch #killfeed { top: calc(10px + var(--safe-t)); right: calc(62px + var(--safe-r)); }
#emoteBtn { position: absolute; top: calc(10px + var(--safe-t)); left: calc(62px + var(--safe-l)); width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--card-line); background: rgba(12, 7, 8, 0.85); cursor: pointer; padding: 4px; }
#emoteBtn img { width: 100%; height: 100%; object-fit: contain; }
#emotes { position: absolute; top: calc(60px + var(--safe-t)); left: calc(62px + var(--safe-l)); display: flex; gap: 0.3rem; background: rgba(12, 7, 8, 0.9); border: 2px solid var(--card-line); border-radius: 12px; padding: 0.3rem; }
#emotes button { width: 48px; height: 48px; border: 0; background: transparent; cursor: pointer; }
#emotes img { width: 100%; height: 100%; object-fit: contain; }
#rotateHint { position: fixed; z-index: 30; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); background: rgba(12, 7, 8, 0.9); border: 2px solid var(--amber); border-radius: 12px; padding: 0.5rem 0.9rem; font: 600 0.95rem var(--serif); pointer-events: none; }
@media (orientation: landscape) { #rotateHint { display: none; } }
@media (max-width: 620px), (max-height: 480px) {
  #status { min-width: 150px; padding: 0.35rem 0.45rem; }
  .wrow { font-size: 0.8rem; }
  .tbtn { width: 58px; height: 58px; }
  .tbtn.jump { width: 74px; height: 74px; right: calc(160px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); }
  .tbtn.nade { right: calc(176px + var(--safe-r)); bottom: calc(100px + var(--safe-b)); }
  .tbtn.knife { right: calc(110px + var(--safe-r)); bottom: calc(150px + var(--safe-b)); }
  .fighter img { width: 48px; height: 48px; }
}
@media (max-height: 480px) { .hud-top { top: calc(8px + var(--safe-t)); } body.touch #status, body.touch #scoreboard { top: calc(56px + var(--safe-t)); } }
@media (max-width: 620px) and (orientation: portrait) { body.touch #status, body.touch #scoreboard { top: calc(112px + var(--safe-t)); } }
#rotateHint { bottom: auto; top: 46%; }

/* =====================================================================
   Cartoon gameplay HUD (menus keep the Dead Center Apps look)
   ===================================================================== */
#hud, #bigmsg, #banner, #rotateHint { --toon: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', sans-serif; --ink: #1b1b3a; }
#hud .chip { font: 400 1rem/1 var(--toon); letter-spacing: 0.02em; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 var(--ink); }
#hud .chip.timer { font: 400 1.25rem/0.9 var(--toon); color: var(--ink); background: #ffd23f; border-color: var(--ink); }
#hud .chip.timer.low { background: #ff4d8d; color: #fff; border-color: var(--ink); }
#hud .chip.frogs { background: #8cf05a; color: var(--ink); border-color: var(--ink); }
#hud .chip.score { background: #4dc3ff; }
#hud .chip.score b { color: var(--ink); }
#hud .menu-btn, #emoteBtn { background: #fff; border: 3px solid var(--ink); color: var(--ink); box-shadow: 0 4px 0 var(--ink); font-family: var(--toon); }
#emotes { background: #fff; border: 3px solid var(--ink); }
#status { background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); color: var(--ink); }
.bar2 { border: 2px solid var(--ink); background: #e8e3f5; border-radius: 7px; }
.bar2.hp i { background: linear-gradient(180deg, #7dff8f, #2fcf4a 60%, #1f9a36); }
.bar2.sh i { background: linear-gradient(180deg, #bff0ff, #33b5f0); }
.bar2 span { font: 400 0.7rem/1 var(--toon); text-shadow: 0 1px 0 var(--ink), 0 -1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.wrow { font: 400 1rem/1 var(--toon); color: var(--ink); }
.wrow .ammo { color: #e06a00; }
.wrow .reload { color: #e0206a; }
#scoreboard { background: #fff; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); color: var(--ink); }
#scoreboard li { font: 400 0.95rem var(--toon); }
#scoreboard li b { font-family: var(--toon); }
#scoreboard li.me { background: #ffe98a; }
#scoreboard li .fr { color: #1f9a36; }
#scoreboard i { border-color: var(--ink); }
#killfeed div { font: 400 0.85rem/1.2 var(--toon); background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; }
#killfeed b { font-weight: 400; -webkit-text-stroke: 0.5px var(--ink); }
#bigmsg .n { font: 400 clamp(4rem, 16vw, 7.5rem)/1 var(--toon); color: #ffd23f; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); }
#bigmsg .n.go { color: #8cf05a; text-shadow: 0 7px 0 var(--ink); }
#bigmsg .s { font: 400 1.3rem var(--toon); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
#banner .banner-kicker { font: 400 1.1rem var(--toon); color: #fff; letter-spacing: 0.08em; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
#banner .banner-title { font: 400 clamp(2.2rem, 9vw, 3.8rem)/1 var(--toon); color: #ff4d8d; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
#banner .banner-sub { font: 400 1.15rem var(--toon); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink); }
.tbtn { font-family: var(--toon); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); text-shadow: 0 2px 0 var(--ink); }
.tbtn.jump { background: radial-gradient(circle at 36% 30%, #c8ff9a, #5fd83a 60%, #2f9a1f); }
.tbtn.nade { background: radial-gradient(circle at 36% 30%, #ffd9a0, #ff9f1c 60%, #d86a00); }
.tbtn.knife { background: radial-gradient(circle at 36% 30%, #d8f2ff, #4dc3ff 60%, #1f7fc0); }
.stick { border-color: rgba(27, 27, 58, 0.45); background: rgba(255, 255, 255, 0.25); }
.stick i { background: radial-gradient(circle at 40% 35%, #ffffff, #d8d8f0); border: 3px solid var(--ink); }
.stick.aim { border-color: rgba(255, 77, 141, 0.6); }
.stick.aim i { background: radial-gradient(circle at 40% 35%, #ffb0cc, #ff4d8d); border-color: var(--ink); }
#rotateHint { font-family: var(--toon); background: #fff; color: var(--ink); border: 3px solid var(--ink); }
#hurtFlash { background: radial-gradient(ellipse at center, transparent 55%, rgba(255, 60, 120, 0.45)); }

/* ---------- touch cluster v2: fire stick with an arc of buttons ---------- */
#touch .zone.left { width: 50%; top: 20%; }
#fireStick { position: absolute; right: calc(24px + var(--safe-r)); bottom: calc(24px + var(--safe-b)); width: 128px; height: 128px; pointer-events: auto; touch-action: none; border-radius: 50%; }
#fireStick .ring { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle, rgba(255,255,255,0.35), rgba(255,77,141,0.25)); box-shadow: 0 5px 0 var(--ink); }
#fireStick i { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 38% 32%, #ffb0cc, #ff4d8d 55%, #d81b60); border: 4px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-style: normal; transition: transform 40ms; }
#fireStick i span { font: 400 1rem/1 var(--toon); color: #fff; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; text-shadow: 0 2px 0 var(--ink); }
#fireStick i b { font: 400 0.8rem/1 var(--toon); color: #fff6c8; text-shadow: 0 1px 0 var(--ink); margin-top: 2px; }
#fireStick.on .ring { background: radial-gradient(circle, rgba(255,255,255,0.5), rgba(255,77,141,0.45)); }
.tbtn { width: 58px; height: 58px; padding: 0; }
.tbtn img { width: 60%; height: 60%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 0 rgba(0,0,0,0.4)); }
.tbtn b { position: absolute; right: -4px; bottom: -4px; min-width: 22px; height: 22px; border-radius: 11px; background: #fff; color: var(--ink); border: 2px solid var(--ink); font: 400 0.75rem/18px var(--toon); text-shadow: none; }
.tbtn.jump { width: 72px; height: 72px; right: calc(171px + var(--safe-r)); bottom: calc(52px + var(--safe-b)); }
.tbtn.nade { right: calc(142px + var(--safe-r)); bottom: calc(142px + var(--safe-b)); }
.tbtn.knife { right: calc(59px + var(--safe-r)); bottom: calc(176px + var(--safe-b)); }
.tbtn.knife img { transform: rotate(-45deg); }
@media (max-width: 620px), (max-height: 480px) {
  #fireStick { width: 112px; height: 112px; right: calc(16px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); }
  #fireStick i { width: 66px; height: 66px; margin: -33px 0 0 -33px; }
  .tbtn { width: 52px; height: 52px; }
  .tbtn.jump { width: 64px; height: 64px; right: calc(148px + var(--safe-r)); bottom: calc(38px + var(--safe-b)); }
  .tbtn.nade { right: calc(124px + var(--safe-r)); bottom: calc(118px + var(--safe-b)); }
  .tbtn.knife { right: calc(46px + var(--safe-r)); bottom: calc(150px + var(--safe-b)); }
}
/* effects bar (big power-ups active on you) */
#fxbar { position: absolute; top: calc(62px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; gap: 0.4rem; pointer-events: none !important; }
.fxchip { font: 400 0.9rem/1 var(--toon); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 0.35rem 0.6rem; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
.fxchip b { font-weight: 400; background: #fff; border-radius: 8px; padding: 0 0.3rem; margin-left: 0.2rem; }
body.touch #fxbar { top: calc(58px + var(--safe-t)); }
/* fighter picker */
.fighters { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 38vh; overflow-y: auto; padding: 2px; }
.fighter { padding: 0.5rem 0.3rem; gap: 0.2rem; }
.fighter img { width: 56px; height: 56px; }
.fighter b { font-size: 0.95rem; }
.fighter small { font-size: 0.75rem; }
.fighter-info { display: flex; gap: 1rem; align-items: center; background: #0e0808; border: 2px solid var(--card-line); border-radius: 16px; padding: 0.8rem 1rem; margin-bottom: 0.8rem; }
.fighter-info > img { width: 88px; height: 88px; object-fit: contain; flex: none; }
.fighter-info h3 { margin: 0 0 0.2rem; font-size: 1.3rem; }
.fighter-info p { margin: 0.2rem 0; }
.sbars { display: grid; gap: 0.3rem; margin: 0.4rem 0; }
.sbar { display: grid; grid-template-columns: 4.2rem 1fr; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.sbar em { font-style: normal; }
.sbar i { display: block; height: 9px; background: #2b1d1d; border-radius: 5px; overflow: hidden; }
.sbar i b { display: block; height: 100%; background: linear-gradient(90deg, #ffd23f, #ff4d8d); border-radius: 5px; }
.wline { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; color: var(--amber); font-size: 0.95rem; }
.wline img { height: 22px; max-width: 60px; object-fit: contain; }
select.pick { font: 600 1.05rem var(--serif); color: var(--bone); background: #080506; border: 2px solid var(--card-line); border-radius: 12px; padding: 0.6rem 0.8rem; width: 100%; }
select.pick:disabled { opacity: 0.7; }
@media (max-width: 620px) { .fighter-info > img { width: 64px; height: 64px; } .fighters { max-height: 34vh; } }

/* =====================================================================
   Store, locker, gold and results
   ===================================================================== */
.coin { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -0.12em; flex: none;
  background: url(/play/assets/dca-coin-48.png) center / contain no-repeat; }
.coin.big { width: 1.35rem; height: 1.35rem; align-self: center; }
.price { display: inline-flex; align-items: center; gap: 0.3rem; font: 900 1rem/1 var(--title); color: #ffcf6a; }
.pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.gold-pill { border-color: rgba(255, 210, 63, 0.75); }
.gold-pill b { color: #ffd23f; }
.gold-pill.small { padding: 0.4rem 0.9rem; }
.gold-pill.small b { font-size: 1.2rem; }
.small { font-size: 0.9rem; }
.ok { color: var(--neon-green); margin: 0.2rem 0; }
.row.left { justify-content: flex-start; margin-top: 0.6rem; }

.store { display: flex; flex-direction: column; }
.store-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.store-head h2 { margin: 0; }
.store-top { display: flex; gap: 1rem; align-items: center; background: #0e0808; border: 2px solid var(--card-line); border-radius: 16px; padding: 0.6rem 0.9rem; margin-bottom: 0.7rem; }
#storePreview { flex: none; width: 130px; height: 152px; background: radial-gradient(ellipse at 50% 80%, rgba(255, 210, 63, 0.18), transparent 65%); border-radius: 12px; }
.store-sel { flex: 1; min-width: 0; }
.store-sel h3 { font-size: 1.25rem; margin: 0 0 0.2rem; }
.store-sel p { margin: 0.25rem 0; }
.store-sel .btn.confirm { background: linear-gradient(180deg, #ffd23f, #e09a00); color: #1b1b3a; }
.tabs { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; flex: none; }
.tabs::-webkit-scrollbar, .slotbar::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; font: 700 1rem/1 var(--title); color: var(--muted); background: #0e0808; border: 2px solid var(--card-line); border-radius: 12px; padding: 0.6rem 0.8rem; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: #fff; background: linear-gradient(180deg, #c8102e, #7a0012); border-color: var(--neon-red); }
.slotbar { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; margin-top: 0.5rem; flex: none; }
.slotbar button { flex: none; font: 600 0.95rem var(--serif); color: var(--muted); background: transparent; border: 2px solid var(--card-line); border-radius: 99px; padding: 0.35rem 0.8rem; cursor: pointer; }
.slotbar button small { opacity: 0.7; }
.slotbar button.on { color: #1b1b3a; background: #ffd23f; border-color: #ffd23f; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 0.55rem; margin-top: 0.7rem; max-height: 46vh; overflow-y: auto; padding: 2px; align-content: start; }
.store-grid .gh { grid-column: 1 / -1; margin: 0.4rem 0 0; font: 700 1rem var(--title); color: var(--amber); }
.store-grid p.gh { font: 400 0.9rem var(--serif); color: var(--muted); }
.sitem { position: relative; display: grid; justify-items: center; align-content: start; gap: 0.25rem; padding: 0.45rem 0.35rem 0.55rem; background: #0e0808; border: 2px solid var(--card-line); border-radius: 14px; color: var(--bone); cursor: pointer; font-family: var(--serif); text-align: center; }
.sitem canvas.thumb { width: 70px; height: 80px; }
.sitem b { font: 700 0.9rem/1.15 var(--title); }
.sitem small { color: var(--muted); font-size: 0.78rem; }
.sitem .was { color: var(--muted); font-size: 0.75rem; }
.sitem .bigico { font-size: 2.2rem; line-height: 1.2; min-height: 2.8rem; display: grid; place-items: center; letter-spacing: -0.1em; }
.sitem.pack .bigico { font-size: 1.45rem; white-space: nowrap; }
.sitem .tag { font: 700 0.75rem/1 var(--title); color: var(--muted); border: 1px solid var(--card-line); border-radius: 99px; padding: 0.25rem 0.55rem; }
.sitem .tag.on { color: #0e2a06; background: var(--neon-green); border-color: var(--neon-green); }
.sitem.owned { background: #10140c; }
.sitem.eq { border-color: var(--neon-green); box-shadow: 0 0 12px rgba(126, 211, 33, 0.35); }
.sitem.sel { border-color: #ffd23f; box-shadow: 0 0 16px rgba(255, 210, 63, 0.45); background: #1c1408; }
.sitem.fx { min-height: 128px; }
.fx-setting { margin-top: 0.9rem; }
.fxpick { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fxtog { font: 600 0.95rem var(--serif); color: var(--muted); background: #080506; border: 2px solid var(--card-line); border-radius: 99px; padding: 0.4rem 0.75rem; cursor: pointer; }
.fxtog.on { color: #fff; background: linear-gradient(180deg, #5a3ad8, #2c1a7a); border-color: var(--neon-purple); box-shadow: 0 0 10px rgba(168, 85, 247, 0.4); }
span.fxtog { cursor: default; }
.locker-mini { display: flex; gap: 0.9rem; align-items: center; background: #0e0808; border: 2px solid var(--card-line); border-radius: 16px; padding: 0.6rem 0.9rem; }
.locker-mini canvas { flex: none; width: 96px; height: 112px; }
.lm-body { flex: 1; min-width: 0; }
.lm-body h3 { margin: 0 0 0.35rem; }
.lm-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.lm-slot { font-size: 0.82rem; color: var(--muted); background: #080506; border: 1px solid var(--card-line); border-radius: 99px; padding: 0.2rem 0.55rem; }
.lm-slot em { font-style: normal; opacity: 0.7; margin-right: 0.3rem; }
.lm-slot.on { color: var(--bone); border-color: rgba(126, 211, 33, 0.6); }

/* final standings */
.results-wrap { overflow-x: auto; }
table.results { table-layout: fixed; width: 100%; border-collapse: separate; border-spacing: 0 4px; font-family: var(--serif); }
.results th { font: 700 0.8rem var(--title); color: var(--muted); text-align: center; padding: 0 0.35rem 0.1rem; }
.results td { background: #0e0808; text-align: center; padding: 0.45rem 0.4rem; border-top: 1px solid var(--card-line); border-bottom: 1px solid var(--card-line); white-space: nowrap; }
.results td:first-child { border-left: 1px solid var(--card-line); border-radius: 10px 0 0 10px; }
.results td:last-child { border-right: 1px solid var(--card-line); border-radius: 0 10px 10px 0; }
.results .l { text-align: left; }
.results .pl { font: 900 1.05rem/1 var(--title); color: var(--amber); width: 2rem; }
.results .who { display: flex; align-items: center; gap: 0.45rem; min-width: 0; }
.results col.c-pl { width: 2.3rem; } .results col.c-n { width: 3.2rem; } .results col.c-k { width: 2.4rem; } .results col.c-g { width: 4.2rem; }
.results .who i { flex: none; width: 0.85rem; height: 0.85rem; border-radius: 50%; border: 2px solid #050304; }
.results .nm { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.results td b { font: 900 1.05rem var(--title); }
.results td.gold { color: #ffd23f; font: 700 0.95rem var(--title); }
.results tr.win td { background: #2a1d06; border-color: #ffd23f; }
.results tr.me td { background: #2b1d1d; border-color: var(--neon-red); }
.results tr.me.win td { background: #3a2a06; }
.results tr.me .who::after { content: 'you'; flex: none; color: var(--muted); font-size: 0.75rem; }
.results .bt { flex: none; font-size: 0.75rem; }
.wtag { flex: none; font: 700 0.65rem/1 var(--title); color: #1b1b3a; background: #ffd23f; border-radius: 99px; padding: 0.15rem 0.4rem; vertical-align: 0.15em; }
.gold-earn { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.5rem; margin-top: 0.8rem; padding: 0.6rem 0.9rem; background: linear-gradient(180deg, #2a1d06, #1a1004); border: 2px solid #ffd23f; border-radius: 14px; font: 700 1.05rem var(--serif); color: #ffe7a0; }
.gold-earn .coin { width: 1.5rem; height: 1.5rem; }
.gold-earn b { font: 900 1.5rem/1 var(--title); color: #ffd23f; }
.gold-earn small { flex-basis: 100%; color: #d9b870; font-weight: 400; font-size: 0.85rem; }
#scr-dialog .panel { width: min(620px, 100%); }

/* =====================================================================
   Layout: in-match HUD for every screen shape
   ===================================================================== */
#rotateHint { display: none !important; }
#killfeed, body.touch #killfeed { left: 50%; right: auto; transform: translateX(-50%); top: calc(96px + var(--safe-t)); justify-items: center; max-width: min(92vw, 460px); }
#killfeed div:nth-child(n+4) { display: none; }
#fxbar, body.touch #fxbar { top: calc(62px + var(--safe-t)); }
#toast { top: calc(128px + var(--safe-t)); }

/* phones and small tablets held upright */
@media (orientation: portrait) and (max-width: 760px) {
  #hud .menu-btn, #emoteBtn { width: 40px; height: 40px; top: calc(8px + var(--safe-t)); }
  #hud .menu-btn { left: calc(8px + var(--safe-l)); }
  #emoteBtn { left: calc(54px + var(--safe-l)); }
  #emotes { top: calc(54px + var(--safe-t)); left: calc(54px + var(--safe-l)); }
  .hud-top, body.touch .hud-top { top: calc(8px + var(--safe-t)); left: calc(102px + var(--safe-l)); right: calc(8px + var(--safe-r)); transform: none; justify-content: flex-end; gap: 0.3rem; }
  #hud .chip { font-size: 0.85rem; padding: 0.45rem 0.5rem; border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
  #hud .chip.timer { font-size: 1.05rem; min-width: 3.5rem; }
  #status, body.touch #status { top: calc(58px + var(--safe-t)); bottom: auto; left: calc(8px + var(--safe-l)); min-width: 0; width: calc(50% - 12px); padding: 0.3rem 0.4rem; gap: 0.25rem; border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
  .wrow { font-size: 0.85rem; gap: 0.35rem; }
  .wrow img { height: 18px; max-width: 46px; }
  #scoreboard, body.touch #scoreboard { top: calc(58px + var(--safe-t)); bottom: auto; right: calc(8px + var(--safe-r)); min-width: 0; width: calc(50% - 12px); max-width: none; padding: 0.2rem; border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); }
  #scoreboard li { font-size: 0.8rem; padding: 0.08rem 0.25rem; gap: 0.3rem; }
  #scoreboard li .fr { font-size: 0.7rem; }
  #scoreboard i { width: 0.7rem; height: 0.7rem; }
  #fxbar, body.touch #fxbar { top: calc(132px + var(--safe-t)); max-width: 94vw; flex-wrap: wrap; justify-content: center; }
  .fxchip { font-size: 0.8rem; padding: 0.25rem 0.45rem; }
  #killfeed, body.touch #killfeed { top: calc(164px + var(--safe-t)); }
  #killfeed div { font-size: 0.75rem; }
  #toast { top: calc(200px + var(--safe-t)); }
  #banner { top: 36%; }
  #bigmsg { top: 40%; }
  #touch .zone.left { top: 35%; }
}

/* phones held sideways (short screens) */
@media (orientation: landscape) and (max-height: 500px) {
  #hud .menu-btn, #emoteBtn { width: 40px; height: 40px; top: calc(6px + var(--safe-t)); }
  #emoteBtn { left: calc(56px + var(--safe-l)); }
  #emotes { top: calc(52px + var(--safe-t)); left: calc(56px + var(--safe-l)); }
  .hud-top, body.touch .hud-top { top: calc(6px + var(--safe-t)); gap: 0.35rem; }
  #hud .chip { font-size: 0.9rem; padding: 0.45rem 0.55rem; box-shadow: 0 3px 0 var(--ink); }
  #hud .chip.timer { font-size: 1.1rem; }
  body.touch #status { top: calc(54px + var(--safe-t)); left: calc(6px + var(--safe-l)); min-width: 150px; padding: 0.3rem 0.4rem; gap: 0.25rem; }
  body.touch #scoreboard { top: calc(6px + var(--safe-t)); right: calc(6px + var(--safe-r)); min-width: 150px; max-width: 30vw; padding: 0.2rem; }
  #scoreboard li { font-size: 0.8rem; padding: 0.05rem 0.25rem; }
  #fxbar, body.touch #fxbar { top: calc(52px + var(--safe-t)); }
  #killfeed, body.touch #killfeed { top: calc(84px + var(--safe-t)); max-width: 44vw; }
  #killfeed div { font-size: 0.75rem; padding: 0.15rem 0.45rem; }
  #toast { top: calc(56px + var(--safe-t)); font-size: 0.9rem; }
  #banner { top: 30%; }
  .banner-title, #banner .banner-title { font-size: clamp(1.8rem, 7vh, 2.6rem); }
  #bigmsg .n { font-size: clamp(3rem, 20vh, 5rem); }
}

/* =====================================================================
   Layout: menus
   ===================================================================== */
@media (orientation: portrait) and (max-width: 620px) {
  .screen { padding: calc(0.6rem + var(--safe-t)) calc(0.6rem + var(--safe-r)) calc(0.6rem + var(--safe-b)) calc(0.6rem + var(--safe-l)); }
  .panel { padding: 1rem 0.9rem 0.9rem; border-radius: 16px; }
  .title-wrap { gap: 0.8rem; }
  .logo-card { width: min(72vw, 340px); }
  .best-pill { padding: 0.45rem 1rem; }
  .best-pill b { font-size: 1.3rem; }
  .pill-sub { font-size: 0.85rem; }
  .card-btn { padding: 0.75rem 0.9rem; gap: 0.9rem; border-radius: 16px; }
  .store-top { padding: 0.5rem 0.6rem; gap: 0.6rem; }
  #storePreview { width: 96px; height: 112px; }
  .store-sel h3 { font-size: 1.1rem; }
  .tabs button { font-size: 0.9rem; padding: 0.55rem 0.6rem; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.45rem; max-height: none; }
  .sitem canvas.thumb { width: 62px; height: 71px; }
  .results td { padding: 0.4rem 0.25rem; font-size: 0.9rem; }
  .results .who { gap: 0.3rem; }
  .results col.c-pl { width: 1.8rem; } .results col.c-n { width: 2.6rem; } .results col.c-k { width: 1.9rem; } .results col.c-g { width: 3.4rem; }
  .results td b, .results td.gold { font-size: 0.9rem; }
  .results .wtag span, .results tr.me .who::after, .results .bt { display: none; }
  .results td { padding: 0.4rem 0.2rem; }
  .results .pl { width: 1.6rem; }
  .results th { padding: 0 0.2rem; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .screen { padding: calc(0.4rem + var(--safe-t)) calc(0.6rem + var(--safe-r)) calc(0.4rem + var(--safe-b)) calc(0.6rem + var(--safe-l)); }
  .panel { padding: 0.8rem 1rem 0.7rem; border-radius: 16px; }
  h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
  .row { margin-top: 0.6rem; }
  .settings { gap: 0.5rem; }
  #soloSettings, #settingsList { grid-template-columns: 1fr 1fr; column-gap: 0.9rem; }
  .loadout-line { font-size: 0.85rem; }
  .seg button { padding: 0.35rem 0.5rem; font-size: 0.92rem; }
  /* title: logo on the left, menu on the right */
  .title-screen { align-items: flex-start; }
  .title-wrap { margin: auto; width: min(920px, 100%); grid-template-columns: auto minmax(0, 1fr); align-items: start; justify-items: stretch; gap: 0.6rem 1.2rem; padding-top: 0; }
  .title-wrap > .logo-card { grid-column: 1; grid-row: 1 / span 4; width: min(44vw, calc(100vh - 2rem - var(--safe-t) - var(--safe-b))); position: sticky; top: 0; }
  .title-wrap > .logo-card.cover { width: min(46vw, calc((100vh - 2rem - var(--safe-t) - var(--safe-b)) * 1.5)); }
  .title-wrap > :not(.logo-card) { grid-column: 2; }
  .pills { justify-content: flex-start; gap: 0.45rem; flex-wrap: nowrap; }
  .pills .best-pill { min-width: 0; }
  .pills .pill-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .best-pill { padding: 0.35rem 0.8rem; }
  .best-pill b { font-size: 1.15rem; }
  .pill-sub { font-size: 0.8rem; }
  .cards { grid-template-columns: 1fr 1fr; gap: 0.45rem; }
  .card-btn { padding: 0.5rem 0.6rem; gap: 0.6rem; border-radius: 14px; }
  .ico { width: 2.5rem; height: 2.5rem; border-radius: 10px; }
  .ico svg { width: 1.35rem; height: 1.35rem; }
  .card-title { font-size: 1.05rem; }
  .card-sub { font-size: 0.8rem; line-height: 1.2; }
  .acct-chip { margin: 0; justify-content: flex-start; font-size: 0.85rem; }
  .brand-foot { margin: 0; font-size: 0.8rem; }
  /* store: preview column on the left, catalogue on the right */
  .panel.store { width: min(980px, 100%); height: 100%; display: grid; grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto; column-gap: 0.9rem;
    grid-template-areas: "head tabs" "top slots" "top grid" "top grid" "top row"; }
  .store-head { grid-area: head; margin: 0; gap: 0.35rem; min-width: 0; }
  .store-head h2 { font-size: 1.15rem; }
  .store-pills { gap: 0.25rem; min-width: 0; }
  .store-pills .best-pill { padding: 0.2rem 0.45rem; }
  .store-pills .best-pill b { font-size: 0.95rem; }
  .store-pills .coin.big { width: 1rem; height: 1rem; }
  .store-top { grid-area: top; flex-direction: column; align-items: stretch; margin: 0; overflow-y: auto; }
  #storePreview { width: 100px; height: 117px; align-self: center; }
  .tabs { grid-area: tabs; align-self: center; }
  .tabs button { font-size: 0.88rem; padding: 0.45rem 0.55rem; }
  .slotbar { grid-area: slots; margin-top: 0.35rem; }
  .store-grid { grid-area: grid; max-height: none; min-height: 0; margin-top: 0.45rem; }
  .panel.store > .row { grid-area: row; margin-top: 0.4rem; }
  .sitem canvas.thumb { width: 56px; height: 64px; }
  .store-sel h3 { font-size: 1.05rem; }
  /* fighter + lobby + results */
  .fighter-info { padding: 0.5rem 0.7rem; margin-bottom: 0.5rem; }
  .fighter-info > img { width: 56px; height: 56px; }
  .fighters { max-height: 44vh; }
  .locker-mini canvas { width: 72px; height: 84px; }
  .lobby-grid { gap: 0.9rem; }
  .code { font-size: 2rem; }
  .results td { padding: 0.25rem 0.35rem; }
  .gold-earn { margin-top: 0.5rem; padding: 0.4rem 0.7rem; }
  #scr-dialog .panel { width: min(760px, 100%); }
}

/* ---- store v2: fighters, eggs, sales, themes (2026-09-27) ---- */
.store-pills { display: flex; gap: 0.4rem; align-items: center; }
.egg-pill { text-decoration: none; color: #ffb36b; }
.egg-pill b { color: #ffb36b; }
.store-banner { background: linear-gradient(90deg, #7a0012, #3a0610); border: 2px solid var(--neon-red); border-radius: 12px; padding: 0.45rem 0.8rem; margin-bottom: 0.6rem; font: 700 0.95rem var(--title); color: #fff; }
.sitem .fport { width: 64px; height: 72px; object-fit: contain; }
.sitem .swatch { width: 70px; height: 70px; border-radius: 12px; border: 2px solid var(--card-line); display: block; }
.sitem .swatch.classic { background: linear-gradient(180deg, #4fc3ff, #c9f1ff 55%, #3fcf55 56%, #1e6b2e 72%, #b6ff3b 73%); }
.sitem .lock { position: absolute; top: 0.3rem; right: 0.35rem; font-size: 0.95rem; }
.sitem .sale-tag, .sale-tag { position: absolute; top: 0.3rem; left: 0.3rem; background: #ff2d55; color: #fff; font: 800 0.7rem/1 var(--title); padding: 0.2rem 0.4rem; border-radius: 6px; }
.sale-tag.inline { position: static; display: inline-block; vertical-align: middle; }
.price.egg { color: #ffb36b; font-weight: 800; }
.btn.egg { background: linear-gradient(180deg, #ff9f4d, #d85a0a); color: #2a1000; border-color: #ffb36b; text-decoration: none; }
.fighter.locked { opacity: 0.78; }
.fighter.locked img { filter: grayscale(0.6) brightness(0.8); }
.fighter .lockp { color: #ffd23f; font-weight: 700; }

/* =====================================================================
   Compact icon HUD (2026-09-28): small symbols instead of words.
   The icon key lives on the How to play page.
   ===================================================================== */
.ic { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; line-height: 0; }
.ic svg, .ic img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ic.spin svg { animation: icspin 0.9s linear infinite; }
@keyframes icspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ic.spin svg { animation: none; } }

#hud .menu-btn, #hud #emoteBtn { width: 38px; height: 38px; border-radius: 11px; border-width: 2.5px; box-shadow: 0 3px 0 var(--ink); padding: 5px; display: grid; place-items: center; background: rgba(255,255,255,0.9); }
#hud .menu-btn .ic { width: 20px; height: 20px; }

/* time / frogs / points pill */
#hud .hud-top { display: flex; gap: 0; padding: 2px; border: 2.5px solid var(--ink); border-radius: 999px; background: rgba(255,255,255,0.9); box-shadow: 0 3px 0 var(--ink); }
#hud .hstat { display: flex; align-items: center; gap: 0.22rem; padding: 0.18rem 0.5rem 0.18rem 0.3rem; font: 400 1rem/1 var(--toon); color: var(--ink); border-radius: 999px; white-space: nowrap; }
#hud .hstat b { font-weight: 400; min-width: 1ch; }
#hud .hstat .ic { width: 1.35em; height: 1.35em; }
#hud .hstat.timer { background: #ffd23f; }
#hud .hstat.timer b { min-width: 2.6em; }
#hud .hstat.timer.low { background: #ff4d8d; color: #fff; animation: pulse 1s infinite; }
#hud .hstat[hidden] { display: none; }

/* health / gun strip */
#hud #status { display: flex; align-items: center; gap: 0.35rem; min-width: 0; width: auto; padding: 0.22rem 0.5rem 0.22rem 0.3rem; border-width: 2.5px; border-radius: 999px; background: rgba(255,255,255,0.9); box-shadow: 0 3px 0 var(--ink); font: 400 0.95rem/1 var(--toon); color: var(--ink); }
#hud #status .hp-ic { width: 1.35em; height: 1.35em; }
#hud #status .bars { display: grid; gap: 2px; width: 104px; flex: none; }
#hud #status .bar2 { height: 12px; border-width: 2px; border-radius: 6px; }
#hud #status .bar2.sh { height: 6px; border-width: 1.5px; }
#hud #status .bar2 span { font-size: 0.62rem; }
#hud #status .wicon { height: 20px; max-width: 48px; object-fit: contain; }
#hud #status .ammo, #hud #status .nades { display: flex; align-items: center; gap: 0.12rem; margin: 0; }
#hud #status .ammo b { font-weight: 400; color: #e06a00; }
#hud #status .nades img { height: 17px; }
#hud #status .nades b { font-weight: 400; }
#hud #status .reload .ic { width: 1.2em; height: 1.2em; }
body.touch #hud #status .ammo, body.touch #hud #status .nades { display: none; }

/* scoreboard */
#hud #scoreboard { min-width: 0; width: auto; max-width: 40vw; padding: 0.15rem; border-width: 2.5px; border-radius: 12px; background: rgba(255,255,255,0.86); box-shadow: 0 3px 0 var(--ink); }
#hud #scoreboard li { gap: 0.25rem; font: 400 0.82rem/1.15 var(--toon); padding: 0.06rem 0.3rem; border-radius: 7px; }
#hud #scoreboard li .nm { flex: 1; min-width: 0; max-width: 6.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hud #scoreboard li .fr { display: flex; align-items: center; gap: 1px; color: #1f9a36; font-size: 0.75rem; }
#hud #scoreboard li .fr .ic { width: 1.05em; height: 1.05em; }
#hud #scoreboard li .lead { width: 0.95em; height: 0.95em; }
#hud #scoreboard li b { margin-left: auto; min-width: 1.6em; text-align: right; }
#hud #scoreboard i { width: 0.65rem; height: 0.65rem; border-width: 1.5px; }

/* power-up timers: icon + seconds */
#hud #fxbar { gap: 0.3rem; }
#hud .fxchip { display: flex; align-items: center; gap: 0.2rem; font-size: 0.95rem; padding: 0.12rem 0.3rem; border-width: 2.5px; border-radius: 999px; box-shadow: 0 2px 0 var(--ink); }
#hud .fxchip b { margin: 0; padding: 0 0.3rem; }

/* kill feed: killer [how] victim */
#hud #killfeed div { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; padding: 0.12rem 0.45rem; border-width: 2px; background: rgba(255,255,255,0.88); }
#hud #killfeed .ic { width: 1.3em; height: 1.3em; }
#hud #killfeed .ic.kn img { transform: rotate(-45deg); }
#hud #killfeed .ic.wide { width: 1.9em; }
#hud #killfeed .kf-fr { display: flex; align-items: center; gap: 1px; color: #1f9a36; }

/* touch buttons: symbols instead of words */
#hud .tbtn.jump .ic { width: 58%; height: 58%; }
#hud #fireStick i { gap: 0; }
#hud #fireStick i .ic { width: 34px; height: 34px; margin: 0 auto; }
#hud #fireStick i .reload-ic { display: none; }
#hud #fireStick.reloading i .fire-ic { display: none; }
#hud #fireStick.reloading i .reload-ic { display: grid; }
#hud #fireStick i b { margin-top: 0; }

/* shorter banners and KO message */
#banner .banner-kicker { font-size: 0.85rem; }
#banner .banner-title { font-size: clamp(1.5rem, 6vw, 2.4rem); -webkit-text-stroke: 2px var(--ink); text-shadow: 0 4px 0 var(--ink); }
#banner .banner-sub { font-size: 0.9rem; }
#bigmsg .s { display: flex; align-items: center; justify-content: center; gap: 0.35rem; }
#bigmsg .s .ic { width: 1.2em; height: 1.2em; }
#toast { font-size: 0.9rem; }

/* ---- desktop / big screens: pill top-centre, strip bottom-left, board top-right ---- */
#hud .hud-top { top: calc(10px + var(--safe-t)); }
#hud #status { top: auto; bottom: calc(12px + var(--safe-b)); left: calc(10px + var(--safe-l)); }
#hud #scoreboard { top: calc(10px + var(--safe-t)); bottom: auto; right: calc(10px + var(--safe-r)); }
#hud #fxbar { top: calc(52px + var(--safe-t)); }
#hud #killfeed { top: calc(86px + var(--safe-t)); left: 50%; right: auto; transform: translateX(-50%); }

/* ---- any touch layout: strip moves up under the buttons ---- */
body.touch #hud #status { top: calc(56px + var(--safe-t)); bottom: auto; left: calc(8px + var(--safe-l)); }

/* ---- phone, portrait: row 1 = buttons + pill, row 2 = strip + board ---- */
@media (orientation: portrait) and (max-width: 760px) {
  #hud .menu-btn, #hud #emoteBtn { width: 34px; height: 34px; top: calc(8px + var(--safe-t)); }
  #hud .menu-btn { left: calc(8px + var(--safe-l)); }
  #hud #emoteBtn { left: calc(48px + var(--safe-l)); }
  #hud .hud-top, body.touch #hud .hud-top { top: calc(8px + var(--safe-t)); left: auto; right: calc(8px + var(--safe-r)); transform: none; }
  #hud .hstat { font-size: 0.92rem; padding: 0.16rem 0.4rem 0.16rem 0.25rem; }
  #hud #status, body.touch #hud #status { top: calc(50px + var(--safe-t)); left: calc(8px + var(--safe-l)); width: auto; max-width: 54vw; padding: 0.18rem 0.4rem 0.18rem 0.25rem; }
  #hud #status .bars { width: min(96px, 28vw); }
  #hud #scoreboard, body.touch #hud #scoreboard { top: calc(50px + var(--safe-t)); right: calc(8px + var(--safe-r)); width: auto; max-width: 42vw; }
  #hud #scoreboard li { font-size: 0.74rem; }
  #hud #scoreboard li .nm { max-width: 5.2em; }
  #hud #fxbar, body.touch #hud #fxbar { top: calc(88px + var(--safe-t)); left: calc(8px + var(--safe-l)); transform: none; justify-content: flex-start; max-width: 54vw; }
  #hud #killfeed, body.touch #hud #killfeed { top: calc(136px + var(--safe-t)); max-width: 92vw; }
  #toast { top: calc(168px + var(--safe-t)); }
}

/* ---- phone, landscape: everything in one slim top row ---- */
@media (orientation: landscape) and (max-height: 500px) {
  #hud .menu-btn, #hud #emoteBtn { width: 34px; height: 34px; top: calc(6px + var(--safe-t)); }
  #hud .menu-btn { left: calc(6px + var(--safe-l)); }
  #hud #emoteBtn { left: calc(46px + var(--safe-l)); }
  #hud .hud-top, body.touch #hud .hud-top { top: calc(6px + var(--safe-t)); }
  #hud #status, body.touch #hud #status { top: calc(6px + var(--safe-t)); bottom: auto; left: calc(88px + var(--safe-l)); }
  #hud #scoreboard, body.touch #hud #scoreboard { top: calc(6px + var(--safe-t)); right: calc(6px + var(--safe-r)); max-width: 26vw; }
  #hud #scoreboard li { font-size: 0.74rem; }
  #hud #fxbar, body.touch #hud #fxbar { top: calc(46px + var(--safe-t)); }
  #hud #killfeed, body.touch #hud #killfeed { top: calc(46px + var(--safe-t)); left: calc(88px + var(--safe-l)); transform: none; justify-items: start; max-width: 40vw; }
  #toast { top: calc(80px + var(--safe-t)); }
  #banner { top: 32%; }
}
#hud #scoreboard li > .ic, #hud #scoreboard li .fr, #hud #scoreboard li .fr .ic { flex: none; }
#hud #scoreboard li .nm { flex: 1 1 auto; }

/* =====================================================================
   How to play: tabs, numbered screenshot, icon key (2026-09-28)
   ===================================================================== */
.howto { --ink: #1b1b3a; }
.howto h2 { margin-bottom: 0.6rem; }
.howto h3 { margin: 1rem 0 0.5rem; color: var(--amber); }
.how-tabs { display: flex; gap: 0.35rem; overflow-x: auto; scrollbar-width: none; margin: 0 -0.2rem 0.9rem; padding: 0.2rem; position: sticky; top: -1.4rem; z-index: 2; background: rgba(14, 8, 9, 0.96); }
.how-tabs::-webkit-scrollbar { display: none; }
.how-tabs button { flex: none; font: 700 0.92rem/1 var(--title); color: var(--bone); background: #1d1212; border: 2px solid var(--card-line); border-radius: 999px; padding: 0.5rem 0.85rem; cursor: pointer; }
.how-tabs button[aria-selected="true"] { background: #ffd23f; color: var(--ink); border-color: #ffd23f; }
.how-lead { margin: 0 0 0.7rem; font-size: 0.92rem; }
.how-tip { font-size: 0.9rem; margin: 0.9rem 0 0; }
.how-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.6rem; }
.how-card { display: flex; gap: 0.7rem; align-items: flex-start; background: #1a1011; border: 2px solid var(--card-line); border-radius: 14px; padding: 0.7rem; }
.how-card > div > b { font: 700 1rem/1.2 var(--title); color: var(--bone); }
.how-card p { margin: 0.2rem 0 0; font-size: 0.88rem; line-height: 1.4; color: var(--muted); }
.how-card p b { color: var(--amber); }
.big-ic { flex: none; width: 52px; height: 52px; padding: 7px; border-radius: 14px; background: #fff6df; border: 3px solid var(--ink); box-shadow: 0 3px 0 #000; display: grid; }
.big-ic svg { width: 100%; height: 100%; }

.how-shot-wrap { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.how-shot { position: relative; margin: 0; border-radius: 16px; overflow: hidden; border: 3px solid var(--ink); box-shadow: 0 4px 0 #000; background: #000; }
.how-shot img { display: block; width: 100%; height: auto; }
.how-shot .spot { position: absolute; transform: translate(-50%, -50%); min-width: 20px; height: 20px; padding: 0 4px; border-radius: 10px; background: #ff4d8d; color: #fff; border: 2px solid var(--ink); font: 400 0.72rem/16px 'Lilita One', sans-serif; text-align: center; box-shadow: 0 2px 0 var(--ink); }
.how-shot.wide-shot { margin-top: 1rem; }
.how-shot figcaption { background: #1a1011; padding: 0.4rem 0.6rem; font-size: 0.85rem; }
.how-legend { margin: 0; padding: 0; list-style: none; counter-reset: lg; display: grid; gap: 0.35rem; }
.how-legend li { counter-increment: lg; display: flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; line-height: 1.25; }
.how-legend li::before { content: counter(lg); flex: none; min-width: 20px; height: 20px; border-radius: 10px; background: #ff4d8d; color: #fff; border: 2px solid var(--ink); font: 400 0.72rem/16px 'Lilita One', sans-serif; text-align: center; }
.how-legend .ic, .key-item span .ic { width: 1.3em; height: 1.3em; background: #fff6df; border-radius: 6px; padding: 1px; }

.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.45rem; }
.key-item { display: flex; align-items: center; gap: 0.65rem; background: #1a1011; border: 2px solid var(--card-line); border-radius: 12px; padding: 0.45rem 0.6rem; }
.key-item > div { display: grid; gap: 0.1rem; min-width: 0; }
.key-item b { font: 700 0.95rem/1.2 var(--title); color: var(--bone); }
.key-item > div > span { font-size: 0.82rem; line-height: 1.35; color: var(--muted); }
.key-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #fff6df; border: 2.5px solid var(--ink); box-shadow: 0 2px 0 #000; display: flex; align-items: center; justify-content: center; gap: 1px; padding: 5px; position: relative; }
.key-ic > .ic { width: 28px; height: 28px; background: none; padding: 0; }
.key-ic > .ic.wide { width: 34px; }
.key-ic > .ic.kn img { transform: rotate(-45deg); }
.key-ic small { font: 400 0.8rem/1 'Lilita One', sans-serif; color: var(--ink); }
.key-ic .dot { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--ink); }
.key-ic .emo { display: grid; place-items: center; font-size: 1.25rem; line-height: 1; width: 100%; height: 100%; border-radius: 8px; }
.key-ic .emo + .emo { width: 50%; }
.key-ic .emo:has(+ .emo) { width: 50%; }
.key-ic .emote-img { width: 30px; height: 30px; object-fit: contain; }

@media (max-width: 620px) {
  .how-shot-wrap { grid-template-columns: 1fr; }
  .how-shot:not(.wide-shot) { max-width: 300px; margin: 0 auto; }
  .how-tabs { top: -1rem; }
  .key-grid, .how-cards { grid-template-columns: 1fr; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .how-shot-wrap { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
  .how-tabs { top: -0.8rem; }
}
.how-tabs { flex-wrap: wrap; overflow: visible; }
.how-tabs button { padding: 0.45rem 0.75rem; font-size: 0.88rem; }
