:root {
  color-scheme: dark;
  --bg: #0c0e14;
  --panel: rgba(25, 28, 39, 0.91);
  --panel-2: rgba(37, 41, 56, 0.9);
  --stroke: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --muted: #9da5bb;
  --pink: #ff4d8d;
  --pink-2: #ff7ab2;
  --cyan: #38d9ff;
  --yellow: #ffd43b;
  --green: #7cff6b;
  --red: #ff5b63;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-user-select: none; user-select: none; }
html, body { width: 100%; min-height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 77, 141, 0.16), transparent 28%),
    radial-gradient(circle at 82% 76%, rgba(56, 217, 255, 0.13), transparent 32%),
    linear-gradient(145deg, #0a0b10, #111521 54%, #0b0d13);
}
button, input { font: inherit; }
button { color: inherit; }
.noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .07; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}
#app { position: relative; width: 100vw; height: 100dvh; }
.screen { display: none; position: absolute; inset: 0; padding: 24px; overflow: auto; }
.screen--active { display: grid; }
.panel {
  border: 1px solid var(--stroke);
  background: linear-gradient(145deg, rgba(32, 36, 49, .94), rgba(19, 22, 31, .94));
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.06);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
}
.eyebrow { margin: 0 0 12px; font-size: 12px; letter-spacing: .2em; color: var(--cyan); font-weight: 900; }
.home-shell { width: min(1180px, 100%); margin: auto; display: grid; grid-template-columns: 1.18fr .82fr; align-items: center; gap: 72px; }
.brand-panel { position: relative; padding: 38px 0; }
@keyframes glitch {
  0%,89%,100% { transform: none; text-shadow: none; clip-path: none; }
  90% { transform: translateX(-3px) skewX(-2deg); text-shadow: 3px 0 var(--pink), -3px 0 var(--cyan); }
  91% { transform: translateX(3px) skewX(1deg); text-shadow: -2px 0 var(--pink), 2px 0 var(--cyan); clip-path: inset(10% 0 60% 0); }
  92% { transform: translateX(-2px); text-shadow: 2px 0 var(--cyan); clip-path: inset(55% 0 10% 0); }
  93% { transform: translateX(4px) skewX(-1deg); text-shadow: -3px 0 var(--pink), 3px 0 var(--cyan); clip-path: none; }
  94% { transform: translateX(-1px); text-shadow: 1px 0 var(--pink); }
  95%,99% { transform: none; text-shadow: none; }
  96% { transform: translateX(2px) skewX(2deg); text-shadow: -2px 0 var(--cyan); clip-path: inset(30% 0 40% 0); }
  97% { transform: translateX(-3px); text-shadow: 3px 0 var(--pink); clip-path: none; }
}
.brand-panel h1 { margin: 0; font-size: clamp(68px, 8vw, 126px); line-height: .79; letter-spacing: -.075em; font-weight: 1000; filter: drop-shadow(0 16px 0 rgba(0,0,0,.18)); animation: glitch 7s infinite; }
.brand-panel h1 span { color: var(--pink); -webkit-text-stroke: 2px rgba(255,255,255,.05); }
.brand-mark { position: absolute; right: 4%; top: -2%; width: 150px; height: 150px; transform: rotate(11deg); }
.brand-crown { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; font-size: 86px; color: var(--yellow); filter: drop-shadow(0 8px 0 #b16b00); }
.brand-splat { position: absolute; inset: 16px; background: var(--pink); border-radius: 36% 64% 58% 42% / 48% 37% 63% 52%; opacity: .24; animation: wobble 6s ease-in-out infinite; }
@keyframes wobble { 50% { transform: rotate(-12deg) scale(1.08); border-radius: 58% 42% 37% 63% / 44% 64% 36% 56%; } }
.lead { max-width: 680px; margin: 34px 0 28px; color: #c6cbda; font-size: 19px; line-height: 1.65; }
.lead-badges { display: flex; flex-direction: column; gap: 10px; margin: 28px 0 24px; }
@keyframes badge-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.lead-badge { display: inline-flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 14px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.07); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); color: #e8ecf7; font-size: 15px; font-weight: 700; opacity: 0; animation: badge-in .5s ease forwards; transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease; cursor: default; }
.lead-badge:hover { background: rgba(255,77,141,.18); border-color: rgba(255,77,141,.55); color: #fff; transform: translateX(6px); }
.lead-badge:nth-child(1) { animation-delay: .1s; }
.lead-badge:nth-child(2) { animation-delay: .25s; }
.lead-badge:nth-child(3) { animation-delay: .4s; }
.feature-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.feature-strip span { border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); padding: 9px 13px; border-radius: 999px; color: #cfd4e3; font-size: 12px; font-weight: 800; transition: background .18s ease, border-color .18s ease, transform .18s ease, color .18s ease; cursor: default; }
.feature-strip span:hover { background: rgba(255,77,141,.18); border-color: rgba(255,77,141,.55); color: #fff; transform: translateY(-2px); }
.entry-card { position: relative; overflow: visible; padding: 30px; background: rgba(15, 18, 28, 0.45); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); border: 1px solid rgba(255,255,255,.18); }
.entry-crown { position: absolute; top: -28px; right: -18px; width: 80px; height: 80px; display: grid; place-items: center; font-size: 48px; color: var(--yellow); filter: drop-shadow(0 0 18px rgba(255,212,59,.55)) drop-shadow(0 4px 8px rgba(0,0,0,.4)); transform: rotate(18deg); pointer-events: none; line-height: 1; }
.entry-crown-splat { position: absolute; inset: 8px; background: var(--pink); border-radius: 36% 64% 58% 42% / 48% 37% 63% 52%; opacity: .28; animation: wobble 6s ease-in-out infinite; animation-delay: -2s; }
.panel-kicker { color: var(--muted); letter-spacing: .16em; font-size: 11px; font-weight: 900; margin-bottom: 20px; }
.field-label { display: block; margin: 17px 0 8px; color: #c8cddd; font-size: 12px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.row-label { display: flex; justify-content: space-between; }
.row-label span:last-child { color: var(--pink-2); }
.text-input {
  width: 100%; height: 54px; padding: 0 17px; border-radius: 14px; border: 1px solid rgba(255,255,255,.13);
  color: #fff; background: rgba(8, 10, 16, .65); outline: none; transition: .2s ease;
}
.text-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(56,217,255,.11); }
.avatar-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 22px; }
.avatar-option { position: relative; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.04); cursor: pointer; transition: .18s ease; display: grid; place-items: center; padding: 6px; }
.avatar-option img { width: 100%; height: 100%; object-fit: contain; display: block; }
.avatar-option:hover { transform: translateY(-3px); background: rgba(255,255,255,.08); }
.avatar-option.is-selected { border-color: var(--pink); background: rgba(255,77,141,.18); box-shadow: 0 0 0 3px rgba(255,77,141,.1); }
.button { min-height: 48px; border: 0; border-radius: 14px; padding: 0 19px; font-weight: 950; letter-spacing: .055em; cursor: pointer; transition: transform .16s ease, filter .16s ease, opacity .16s ease; }
.button:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.1); }
.button:not(:disabled):active { transform: translateY(1px) scale(.99); }
.button:disabled { opacity: .38; cursor: not-allowed; }
.button--large { width: 100%; min-height: 56px; }
.button--small { min-height: 38px; padding: 0 13px; font-size: 11px; }
@keyframes btn-shine { 0%,100% { background-position: 200% center; } 50% { background-position: -200% center; } }
@keyframes btn-glow { 0%,100% { box-shadow: 0 10px 25px rgba(255,77,141,.24), inset 0 1px rgba(255,255,255,.45); } 50% { box-shadow: 0 10px 35px rgba(255,77,141,.55), 0 0 18px rgba(255,77,141,.35), inset 0 1px rgba(255,255,255,.45); } }
@keyframes crowns-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.button--primary { position: relative; overflow: hidden; color: #181019; background: linear-gradient(135deg, var(--pink), #ff8a66, var(--pink)); background-size: 200%; animation: btn-shine 3s ease infinite, btn-glow 3s ease infinite; box-shadow: 0 10px 25px rgba(255,77,141,.24), inset 0 1px rgba(255,255,255,.45); transition: background .28s ease, box-shadow .28s ease, transform .16s ease, filter .16s ease; }
.button--primary:not(:disabled):hover { background: linear-gradient(135deg, #f5c518, #ffdf60, #e6a800); background-size: 100%; box-shadow: 0 10px 30px rgba(255,212,59,.45), inset 0 1px rgba(255,255,255,.45); animation: none; filter: none; transform: translateY(-2px); }
.button--secondary { background: linear-gradient(135deg, #303648, #232735); border: 1px solid rgba(255,255,255,.14); }
.button--ghost { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.12); }
.button-icon { font-size: 19px; margin-right: 8px; }
.divider { display: flex; align-items: center; gap: 12px; color: #747c90; font-size: 10px; font-weight: 900; margin: 19px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.09); }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-input { text-transform: uppercase; font-size: 19px; font-weight: 1000; letter-spacing: .18em; }
.error-line { min-height: 20px; margin: 12px 0 0; color: #ff8b91; font-size: 12px; }
.connection-hint { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #747c91; font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.topbar { position: fixed; z-index: 5; inset: 0 0 auto; height: 36px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; background: rgba(10,12,18,.8); border-bottom: 1px solid rgba(255,255,255,.08); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.mini-brand { display: flex; align-items: center; gap: 5px; font-weight: 1000; letter-spacing: -.02em; font-size: 11px; }
.mini-brand span { color: var(--yellow); font-size: 14px; }
.topbar-actions { display: flex; gap: 4px; }
.icon-button { width: 24px; height: 24px; border: 1px solid rgba(255,255,255,.1); border-radius: 7px; background: rgba(255,255,255,.055); cursor: pointer; font-size: 11px; }
.icon-button--danger { color: #ff969b; font-size: 16px; line-height: 1; }
.lobby-layout { width: min(1240px, 100%); margin: auto; padding-top: 44px; display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.lobby-main, .lobby-side { padding: 26px; }
.lobby-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; }
.lobby-heading h2, .results-shell h2 { margin: 0; font-size: clamp(30px, 4vw, 52px); letter-spacing: -.055em; }
.room-code-card { min-width: 210px; padding: 14px 16px; background: #0e1118; border: 1px dashed rgba(255,255,255,.2); border-radius: 15px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; }
.room-code-card span { grid-column: 1 / -1; color: #72798c; font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.room-code-card strong { font-size: 26px; letter-spacing: .18em; color: var(--yellow); }
.copy-button { border: 0; background: transparent; color: var(--cyan); font-size: 9px; font-weight: 900; cursor: pointer; }
.invite-row { display: flex; align-items: center; gap: 14px; margin: 22px 0; padding: 11px 12px 11px 16px; border-radius: 13px; background: rgba(0,0,0,.18); color: #7f879b; font-size: 11px; }
.invite-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.lobby-players { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.player-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.035); border-radius: 12px; text-align: center; }
.player-card--empty { opacity: .36; border-style: dashed; justify-content: center; color: #7a8296; font-size: 10px; min-height: 72px; }
.player-avatar { position: relative; width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; font-size: 20px; background: color-mix(in srgb, var(--player-color) 20%, #161a24); border: 1px solid color-mix(in srgb, var(--player-color) 70%, transparent); overflow: hidden; }
.player-avatar img { width: 100%; height: 100%; object-fit: contain; display: block; }
.player-meta { min-width: 0; width: 100%; }
.player-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.player-meta span { color: #7d8599; font-size: 9px; }
.ready-badge { padding: 5px 8px; border-radius: 999px; font-size: 9px; font-weight: 900; background: rgba(124,255,107,.12); color: var(--green); }
@keyframes host-pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes ready-pulse { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
.player-card--host { position: relative; border-color: rgba(255,212,59,.6); background: rgba(255,212,59,.07); }
.player-card--host::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 1px rgba(255,212,59,.8), 0 0 18px rgba(255,212,59,.4); pointer-events: none; animation: host-pulse 2s ease-in-out infinite; }
.player-card--ready { position: relative; border-color: rgba(124,255,107,.6); background: rgba(124,255,107,.07); }
.player-card--ready::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 1px rgba(124,255,107,.8), 0 0 18px rgba(124,255,107,.4); pointer-events: none; animation: ready-pulse 2s ease-in-out infinite; }
.player-card--host-ready { position: relative; border-color: rgba(34,139,34,.7); background: rgba(34,139,34,.12); }
.player-card--host-ready::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 1px rgba(34,139,34,.9), 0 0 18px rgba(34,139,34,.45); pointer-events: none; animation: ready-pulse 2s ease-in-out infinite; }
.lobby-side { display: flex; flex-direction: column; }
.rules-card { flex: 1; }
.mode-visual { position: relative; width: 92px; height: 92px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 28px; font-size: 52px; background: radial-gradient(circle at 50% 30%, rgba(255,212,59,.25), transparent 62%), #12151e; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.mode-visual small { position: absolute; right: -8px; bottom: -7px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #171b25; border: 1px solid rgba(255,255,255,.12); font-size: 22px; transform: rotate(8deg); }
.rules-card h3 { text-align: center; margin: 6px 0; font-size: 25px; }
.rules-card p { color: #9ba3b6; line-height: 1.55; font-size: 13px; text-align: center; }
.rules-card ul { list-style: none; padding: 10px 0; margin: 0; display: grid; gap: 8px; }
.rules-card li { display: flex; justify-content: space-between; padding: 9px 11px; background: rgba(255,255,255,.04); border-radius: 10px; color: #9da4b7; font-size: 11px; }
.rules-card li strong { color: #fff; }
.chat-box { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.chat-messages { display: flex; flex-direction: column; gap: 5px; height: 160px; overflow-y: auto; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.07); scroll-behavior: smooth; }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.chat-msg { display: flex; gap: 6px; align-items: baseline; font-size: 12px; line-height: 1.4; animation: badge-in .2s ease both; }
.chat-msg-name { font-weight: 800; flex-shrink: 0; }
.chat-msg-text { color: #c8cedf; word-break: break-word; }
.chat-msg--system { color: #666d82; font-size: 11px; font-style: italic; }
.chat-input-row { display: flex; gap: 7px; }
.chat-input { flex: 1; min-width: 0; }
.lobby-controls { display: grid; gap: 9px; margin-top: 18px; }
.lobby-controls p { min-height: 18px; margin: 0; color: #7c8498; font-size: 10px; text-align: center; }
#home-screen, #lobby-screen { background: url("bg.png") center/cover no-repeat; }
.screen--game { padding: 0; overflow: hidden; background: #080a0f; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.game-hud { position: absolute; z-index: 4; pointer-events: none; }
.game-hud--top { top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 34px)); display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; }
.hud-pill, .event-banner { min-height: 52px; border: 1px solid rgba(255,255,255,.13); background: rgba(13,15,22,.83); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 15px; box-shadow: 0 15px 35px rgba(0,0,0,.26); }
.hud-pill { display: grid; place-items: center; padding: 6px 12px; }
.hud-pill strong { font-size: 18px; }
.hud-label { color: #737b90; font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.event-banner { display: grid; place-items: center; padding: 0 18px; text-align: center; font-weight: 900; font-size: 13px; }
.scoreboard { position: absolute; z-index: 4; top: 84px; right: 16px; width: 245px; padding: 13px; background: rgba(15,18,27,.82); pointer-events: none; }
.scoreboard-title { display: flex; justify-content: space-between; color: #858da1; font-size: 9px; font-weight: 900; letter-spacing: .12em; padding: 2px 4px 10px; }
.score-list { display: grid; gap: 5px; }
.score-row { display: grid; grid-template-columns: 21px 30px 1fr auto; align-items: center; gap: 7px; min-height: 38px; padding: 4px 7px; border-radius: 10px; background: rgba(255,255,255,.045); font-size: 11px; }
.score-row.is-me { outline: 1px solid var(--cyan); background: rgba(56,217,255,.08); }
.score-rank { color: #697085; font-weight: 900; }
.score-avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.08); overflow: hidden; }
.score-avatar img { width: 100%; height: 100%; object-fit: contain; }
.score-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.score-points { color: var(--yellow); font-weight: 1000; }
.controls-help { position: absolute; z-index: 4; left: 16px; bottom: 16px; display: flex; gap: 8px; pointer-events: none; }
.controls-help span { padding: 8px 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(13,15,22,.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-radius: 10px; color: #8d95a8; font-size: 9px; font-weight: 800; }
kbd { color: #fff; font-family: inherit; }
.emote-wheel { position: absolute; z-index: 5; right: 16px; bottom: 16px; display: flex; gap: 5px; padding: 6px; border: 1px solid rgba(255,255,255,.1); background: rgba(13,15,22,.74); border-radius: 14px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.emote-wheel button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: rgba(255,255,255,.06); cursor: pointer; font-size: 18px; }
.mobile-controls { display: none; position: absolute; z-index: 5; inset: auto 0 max(16px, env(safe-area-inset-bottom)); padding: 0 22px; justify-content: space-between; align-items: end; pointer-events: none; }
.joystick { width: 126px; height: 126px; border-radius: 50%; background: rgba(255,255,255,.075); border: 1px solid rgba(255,255,255,.13); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); pointer-events: auto; touch-action: none; }
.joystick-knob { position: absolute; width: 56px; height: 56px; margin: 34px; border-radius: 50%; background: rgba(255,255,255,.21); border: 1px solid rgba(255,255,255,.24); box-shadow: 0 8px 20px rgba(0,0,0,.2); transform: translate(0,0); }
@keyframes dash-pulse { 0%,100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.18); opacity: 0; } }
.dash-button { position: relative; width: 110px; height: 110px; border: 0; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 3px; background: conic-gradient(from 180deg, #ff4d8d, #ff8a66, #ffd43b, #ff4d8d); box-shadow: 0 0 0 3px rgba(255,77,141,.35), 0 16px 40px rgba(255,77,141,.45), inset 0 1px 0 rgba(255,255,255,.35); font-weight: 1000; font-size: 12px; letter-spacing: .08em; pointer-events: auto; touch-action: manipulation; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dash-button::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, rgba(255,255,255,.22), transparent 60%), linear-gradient(160deg, rgba(255,100,160,.9), rgba(255,100,60,.85)); }
.dash-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(255,77,141,.6); animation: dash-pulse 2s ease-out infinite; pointer-events: none; }
.dash-icon { position: relative; font-size: 32px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); line-height: 1; }
.dash-label { position: relative; font-size: 11px; letter-spacing: .14em; color: rgba(255,255,255,.95); text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.results-shell { width: min(900px, 100%); margin: auto; padding: 34px; }
.results-shell > .eyebrow, .results-shell > h2 { text-align: center; }
.podium { min-height: 250px; display: flex; align-items: end; justify-content: center; gap: 12px; margin: 30px 0 22px; }
.podium-slot { width: min(190px, 29%); text-align: center; }
.podium-avatar { width: 82px; height: 82px; margin: 0 auto -5px; display: grid; place-items: center; border: 4px solid var(--slot-color); border-radius: 23px; background: #151923; position: relative; z-index: 2; box-shadow: 0 12px 25px rgba(0,0,0,.25); overflow: hidden; }
.podium-avatar img { width: 80%; height: 80%; object-fit: contain; }
.podium-block { height: var(--slot-height); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 22px 8px 8px; border-radius: 14px 14px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--slot-color) 45%, #212633), #171b25); }
.podium-block strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-block span { color: var(--yellow); font-weight: 1000; }
.results-list { display: grid; gap: 7px; }
.result-row { display: grid; grid-template-columns: 34px 42px 1fr repeat(4, minmax(75px, auto)); align-items: center; gap: 10px; min-height: 52px; padding: 6px 13px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.035); border-radius: 13px; }
.result-row > span { color: #959daf; font-size: 10px; }
.result-row > strong { color: var(--yellow); }
.results-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; border: 1px solid rgba(255,255,255,.12); background: rgba(18,21,30,.92); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .24s ease; font-size: 12px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.icon-button.is-active { background: rgba(124,255,107,.2); border-color: rgba(124,255,107,.5); color: var(--green); }
.icon-button.is-muted { background: rgba(255,91,99,.15); border-color: rgba(255,91,99,.4); color: var(--red); }
@keyframes speak-pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.voice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); opacity: 0; flex-shrink: 0; transition: opacity .15s; will-change: opacity; }
.player-card.is-speaking .voice-dot { opacity: 1; box-shadow: 0 0 7px var(--green); animation: speak-pulse .7s ease-in-out infinite; }
.scoreboard-actions { display: flex; align-items: center; gap: 6px; }
.voice-game-btn { pointer-events: auto; width: 22px; height: 22px; font-size: 10px; }
.card-voice-btn { width: 100%; height: 24px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.06); cursor: pointer; font-size: 12px; transition: .14s ease; }
.card-voice-btn:hover { background: rgba(255,255,255,.12); }
.card-voice-btn.is-active { background: rgba(124,255,107,.18); border-color: rgba(124,255,107,.5); }
.card-voice-btn.is-muted  { background: rgba(255,91,99,.15);  border-color: rgba(255,91,99,.4); }
.lobby-settings { margin-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 14px; }
.setting-group { margin-bottom: 10px; }
.setting-label { font-size: 10px; font-weight: 900; color: var(--muted); letter-spacing: .12em; margin-bottom: 6px; }
.setting-options { display: flex; gap: 5px; }
.setting-btn { flex: 1; min-height: 32px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.04); color: var(--muted); font-size: 9px; font-weight: 900; cursor: pointer; letter-spacing: .06em; transition: .14s ease; }
.setting-btn:not(:disabled):hover { background: rgba(255,255,255,.09); color: var(--text); border-color: rgba(255,255,255,.22); }
.setting-btn:disabled { cursor: default; }
.setting-btn.is-active[data-setting="mapSize"][data-value="small"] { background: rgba(124,255,107,.15); border-color: rgba(124,255,107,.55); color: var(--green); }
.setting-btn.is-active[data-setting="mapSize"][data-value="normal"] { background: rgba(255,77,141,.15); border-color: rgba(255,77,141,.55); color: var(--pink); }
.setting-btn.is-active[data-setting="mapSize"][data-value="large"] { background: rgba(167,139,250,.15); border-color: rgba(167,139,250,.55); color: #a78bfa; }
.setting-btn.is-active[data-setting="difficulty"][data-value="easy"] { background: rgba(124,255,107,.15); border-color: rgba(124,255,107,.55); color: var(--green); }
.setting-btn.is-active[data-setting="difficulty"][data-value="normal"] { background: rgba(255,212,59,.15); border-color: rgba(255,212,59,.55); color: var(--yellow); }
.setting-btn.is-active[data-setting="difficulty"][data-value="hard"] { background: rgba(255,91,99,.15); border-color: rgba(255,91,99,.55); color: var(--red); }

@media (max-width: 900px) {
  html, body { overflow: auto; }
  #app { min-height: 100dvh; height: auto; }
  .screen { min-height: 100dvh; position: fixed; }
  .home-shell { grid-template-columns: 1fr; gap: 10px; padding: 30px 0; }
  .brand-panel { padding: 0; }
  .brand-panel h1 { font-size: clamp(58px, 18vw, 92px); }
  .brand-mark { width: 100px; height: 100px; right: 0; }
  .brand-crown { font-size: 58px; }
  .lead { margin: 22px 0; font-size: 15px; }
  .lobby-layout { grid-template-columns: 1fr; margin-top: 55px; padding-bottom: 25px; }
  .lobby-heading { flex-direction: column; }
  .room-code-card { width: 100%; }
  .scoreboard { width: 210px; top: 75px; right: 9px; }
}

@media (max-width: 640px), (pointer: coarse) {
  .screen { padding: 14px; }
  .entry-card { padding: 20px; }
  .brand-panel h1 { font-size: 57px; }
  .brand-mark { display: none; }
  .feature-strip span:nth-child(n+3) { display: none; }
  .avatar-picker { gap: 5px; }
  .avatar-option { border-radius: 10px; font-size: 23px; }
  .lobby-players { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lobby-main, .lobby-side { padding: 18px; }
  .invite-row { align-items: stretch; flex-direction: column; }
  .screen--game { padding: 0; }
  .game-hud--top { width: calc(100% - 14px); top: 7px; grid-template-columns: 72px 1fr 72px; gap: 5px; }
  .hud-pill, .event-banner { min-height: 44px; border-radius: 12px; }
  .hud-pill strong { font-size: 14px; }
  .event-banner { font-size: 10px; padding: 0 6px; }
  .scoreboard { top: 57px; width: 174px; right: 7px; padding: 8px; border-radius: 14px; }
  .score-row { grid-template-columns: 17px 24px 1fr auto; gap: 4px; min-height: 31px; padding: 3px 4px; font-size: 9px; }
  .score-avatar { width: 22px; height: 22px; font-size: 13px; }
  .score-list .score-row:nth-child(n+6) { display: none; }
  .controls-help, .emote-wheel { display: none; }
  .mobile-controls { display: flex; }
  .results-shell { padding: 20px 14px; }
  .podium { min-height: 205px; gap: 5px; }
  .podium-avatar { width: 58px; height: 58px; border-radius: 16px; font-size: 31px; }
  .podium-block { font-size: 10px; }
  .result-row { grid-template-columns: 24px 34px 1fr auto; }
  .result-row span:nth-last-child(-n+3) { display: none; }
  .results-actions { grid-template-columns: 1fr; }
}
