: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 { background: #000; border-color: #000; box-shadow: 0 0 0 2px #2a1a1a, 0 0 60px 10px rgba(224, 16, 47, 0.45), 0 18px 40px rgba(0, 0, 0, 0.7); }
.logo-card.cover .logo-art { object-fit: contain; }
.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; }

/* ---- store: mods chips + gold line (2026-09-27) ---- */
.fx-setting { margin-top: 0.6rem; }
.fxpick { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.35rem; }
.fxtog { font: 700 0.9rem var(--ui, system-ui); color: var(--muted); background: rgba(0,0,0,0.35); border: 2px solid rgba(255,255,255,0.15); border-radius: 99px; padding: 0.35rem 0.75rem; cursor: pointer; }
.fxtog.on { color: #0e2a06; background: #8cffa0; border-color: #8cffa0; }
.gold-earned { margin: 0.6rem 0 0; font-weight: 800; color: #ffd23f; font-size: 1.1rem; }
.muted.small { font-size: 0.85rem; }

/* ---------- multiplayer enemy picker ---------- */
.mob-picker { margin-top: 0.4rem; }
.mob-picker small { opacity: 0.8; }
.mob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.4rem; }
.mob-chip { display: flex; align-items: center; gap: 0.45rem; text-align: left; font: 600 0.92rem/1.15 var(--serif); color: var(--muted); background: #080506; border: 2px solid var(--card-line); border-radius: 12px; padding: 0.5rem 0.6rem; cursor: pointer; }
.mob-chip b { font-size: 1.2rem; }
.mob-chip.on { color: #fff; border-color: #ff2d55; background: linear-gradient(180deg, #3a0a12, #1a0508); box-shadow: 0 0 10px rgba(255, 45, 85, 0.35); }
.mob-chip:disabled { cursor: default; }
.mob-chip:disabled:not(.on) { opacity: 0.5; }
.small-note { font-size: 0.9rem; margin: 0.2rem 0 0; }
#mobPick[hidden] { display: none; }

/* ---------- 2026-10-02: combo meter, countdown, stars, awards ---------- */
#combo { position: absolute; left: 50%; top: calc(var(--safe-t) + 108px); transform: translateX(-50%) scale(.85); display: flex; flex-direction: column; align-items: center; pointer-events: none; opacity: 0; transition: opacity .25s, transform .25s; --hot: 0; --left: 1; }
#combo.on { opacity: 1; transform: translateX(-50%) scale(1); }
#combo.pop b { animation: comboPop .35s ease-out; }
#combo b { font: 400 clamp(2rem, 6vw, 3.2rem)/1 var(--gore); color: hsl(calc(50 - var(--hot) * 50), 100%, 60%); text-shadow: 0 3px 0 var(--ink), 0 0 calc(10px + var(--hot) * 26px) rgba(255, calc(200 - var(--hot) * 150), 40, .8); letter-spacing: .04em; }
#combo span { font: 400 .95rem/1 var(--metal); letter-spacing: .12em; text-transform: uppercase; color: var(--bone); text-shadow: 0 2px 0 var(--ink); margin-top: 2px; }
#combo i { display: block; width: 90px; height: 5px; margin-top: 5px; border-radius: 3px; background: linear-gradient(90deg, #ffd23f calc(var(--left) * 100%), rgba(255,255,255,.15) 0); box-shadow: 0 0 0 2px var(--ink); }
@keyframes comboPop { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }
#bigCount { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); font: 400 clamp(5rem, 22vw, 11rem)/1 var(--gore); color: #ffd23f; text-shadow: 0 6px 0 var(--ink), 0 0 40px rgba(255, 60, 60, .7); pointer-events: none; opacity: 0; z-index: 30; }
#bigCount.show { animation: bigCount .9s ease-out forwards; }
@keyframes bigCount { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }
.stars { display: flex; justify-content: center; gap: .4rem; margin: .2rem 0 .6rem; font-size: clamp(2.4rem, 9vw, 3.4rem); line-height: 1; }
.stars .star { color: #3a2a2a; text-shadow: 0 3px 0 var(--ink); }
.stars .star.on { color: #ffd23f; animation: starIn .45s cubic-bezier(.2, 1.6, .4, 1) both; text-shadow: 0 3px 0 var(--ink), 0 0 18px rgba(255, 210, 63, .8); }
@keyframes starIn { 0% { transform: scale(0) rotate(-40deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.award-tag { display: block; font: 600 .78rem/1.2 var(--serif); color: var(--amber); }
.best-pill .stars-total { color: #ffd23f; margin-left: .4rem; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { #combo.pop b, #bigCount.show, .stars .star.on { animation: none; } #bigCount.show { opacity: 1; } }

/* glossy splats on the screen glass (image made in js/liquid.js) */
.splat.img { border-radius: 0; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.splat.img::after { display: none; }
