:root {
  --bg: #0b0d12;
  --bg-deep: #080a0e;
  --panel: #14171d;
  --panel-solid: #14171d;
  --panel-2: #1b1f27;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f7f8ff;
  --muted: #9da3be;
  --muted-2: #727994;
  --lime: #a3e635;
  --lime-soft: rgba(163, 230, 53, 0.12);
  --violet: #8b5cf6;
  --violet-strong: #7c3aed;
  --violet-soft: rgba(139, 92, 246, 0.13);
  --cyan: #4de7ff;
  --pink: #ff50cb;
  --orange: #ff9a3c;
  --red: #ff5570;
  --green: #55e89f;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --header-h: 70px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: linear-gradient(180deg, #0f1117 0%, var(--bg) 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
label,
input[type="range"],
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
input:not(:disabled),
label:has(input:not(:disabled)) {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
canvas:focus-visible,
dialog:focus-visible {
  outline: 3px solid rgba(77, 231, 255, 0.8);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  color: #080a16;
  background: var(--lime);
  border-radius: 10px;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.ambient {
  position: fixed;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient__orb {
  display: none;
  position: absolute;
  width: 42vw;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.42;
  filter: blur(120px);
  animation: float-orb 18s ease-in-out infinite alternate;
}

.ambient__orb--one {
  top: -18%;
  right: -10%;
  background: rgba(119, 70, 255, 0.3);
}

.ambient__orb--two {
  bottom: -24%;
  left: -18%;
  background: rgba(53, 220, 196, 0.12);
  animation-delay: -8s;
}

.ambient__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
  opacity: .45;
}

@keyframes float-orb {
  to { transform: translate3d(5vw, 6vh, 0) scale(1.08); }
}

.app-header {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 48px));
  min-height: calc(var(--header-h) + var(--safe-top));
  margin: 0 auto;
  padding-top: var(--safe-top);
  border-bottom: 1px solid var(--line);
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 5px 0;
  border: 0;
  background: transparent;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--lime);
  border: 1px solid rgba(183, 255, 60, 0.3);
  border-radius: 13px;
  background: rgba(183, 255, 60, 0.07);
  box-shadow: inset 0 0 18px rgba(183, 255, 60, 0.08), 0 0 24px rgba(183, 255, 60, 0.05);
}

.brand-mark svg {
  width: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.brand-copy {
  display: grid;
  line-height: 0.86;
  text-align: left;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: 0.16em;
}

.brand-copy em {
  margin-top: 5px;
  color: var(--lime);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.56em;
}

.header-actions,
.hud-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.icon-button,
.hud-button,
.back-button,
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button:hover,
.hud-button:hover,
.back-button:hover,
.share-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
  transform: translateY(-1px);
}

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button .icon--sound-on,
.icon-button[aria-pressed="false"] .icon--sound-off {
  display: block;
}

.icon-button .icon--sound-off,
.icon-button[aria-pressed="false"] .icon--sound-on {
  display: none;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 25, 0.6);
  font-size: 12px;
  font-weight: 700;
}

.connection-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
}

.connection-pill[data-state="connecting"] .connection-pill__dot {
  background: var(--orange);
  box-shadow: 0 0 9px var(--orange);
  animation: pulse-dot 1s ease-in-out infinite;
}

.connection-pill[data-state="offline"] .connection-pill__dot,
.connection-pill[data-state="error"] .connection-pill__dot {
  background: var(--red);
  box-shadow: 0 0 9px var(--red);
}

@keyframes pulse-dot {
  50% { transform: scale(0.65); opacity: 0.5; }
}

.status-banner {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 10px 20px;
  color: #201509;
  background: var(--orange);
  font-size: 13px;
  font-weight: 750;
}

.status-banner .icon { width: 17px; }
.status-banner .text-button { color: inherit; text-decoration: underline; }

.view {
  position: relative;
  width: min(1400px, calc(100% - 48px));
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100dvh - var(--header-h));
  margin: 0 auto;
  opacity: 1;
  transform: none;
}

.view.is-active {
  opacity: 1;
  transform: none;
  animation: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(14px); }
}

.landing-view {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.72fr);
  align-items: center;
  gap: clamp(34px, 5vw, 86px);
  padding: 64px 0 46px;
}

.hero-shell {
  min-width: 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--lime);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 28px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.hero-copy h1,
.lobby-heading h1,
.results-card h1 {
  margin: 22px 0 19px;
  font-size: clamp(46px, 5.2vw, 76px);
  line-height: .98;
  letter-spacing: -0.045em;
}

.hero-copy h1 span {
  color: var(--lime);
  -webkit-text-stroke: 0;
  text-shadow: none;
}

.hero-lead {
  max-width: 630px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.6;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-proof span {
  padding: 9px 13px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  font-weight: 650;
}

.hero-proof strong { color: var(--text); }

.hero-art {
  display: none;
  position: relative;
  width: min(650px, 100%);
  aspect-ratio: 1.22;
  margin: 18px auto -12px;
}

.hero-art::before {
  content: "";
  position: absolute;
  inset: 12% 8%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 44% 56% 48% 52%;
  background: radial-gradient(circle at 54% 48%, rgba(21, 26, 50, 0.92), rgba(8, 10, 22, 0.5) 68%);
  box-shadow: inset 0 0 90px rgba(133, 78, 255, 0.09), 0 40px 90px rgba(0, 0, 0, 0.35);
  transform: rotate(-4deg);
}

.arena-orbit {
  position: absolute;
  inset: 14%;
  border: 1px dashed rgba(183, 255, 60, 0.14);
  border-radius: 50%;
  animation: orbit 32s linear infinite;
}

.arena-orbit--inner {
  inset: 25%;
  border-color: rgba(155, 108, 255, 0.2);
  animation-direction: reverse;
  animation-duration: 22s;
}

@keyframes orbit { to { transform: rotate(1turn); } }

.hero-curve {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.curve-path {
  fill: none;
  stroke-linecap: round;
  stroke-width: 7;
  filter: url(#curveGlow);
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
  animation: draw-curve 2.1s 200ms cubic-bezier(.34,.02,.24,1) forwards;
}

.curve-path--one { stroke: url(#curveOne); }
.curve-path--two { stroke: url(#curveTwo); animation-delay: 550ms; }
.curve-head { filter: url(#curveGlow); }
.curve-head--one { fill: var(--cyan); animation: head-in 400ms 2.1s both; }
.curve-head--two { fill: var(--pink); animation: head-in 400ms 2.45s both; }

@keyframes draw-curve { to { stroke-dashoffset: 0; } }
@keyframes head-in { from { transform: scale(0); transform-origin: center; } }

.power-gem {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(15, 17, 34, 0.82);
  box-shadow: 0 0 28px currentColor;
  font-size: 14px;
  font-weight: 900;
  transform: rotate(45deg);
  animation: gem-float 2.6s ease-in-out infinite alternate;
}

.power-gem--one { top: 23%; right: 17%; color: var(--lime); }
.power-gem--two { bottom: 20%; left: 20%; color: var(--violet); animation-delay: -1.3s; }
.power-gem::first-letter { transform: rotate(-45deg); }

@keyframes gem-float { to { translate: 0 -10px; rotate: 10deg; } }

.hero-badge {
  position: absolute;
  z-index: 4;
  right: 7%;
  bottom: 9%;
  display: grid;
  padding: 10px 15px;
  color: #10121d;
  border-radius: 8px;
  background: var(--lime);
  box-shadow: 0 0 35px rgba(183, 255, 60, 0.22);
  transform: rotate(-6deg);
  line-height: 1;
}

.hero-badge span { font-size: 9px; font-weight: 900; letter-spacing: 0.25em; }
.hero-badge strong { font-size: 20px; }

.entry-panel {
  position: relative;
  align-self: center;
}

.entry-panel::before {
  content: none;
  position: absolute;
  z-index: -1;
  inset: 32px -18px -18px;
  border-radius: var(--radius-xl);
  background: rgba(155, 108, 255, 0.06);
  filter: blur(2px);
}

.entry-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 0 14px 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(7, 9, 20, 0.82);
}

.entry-tab {
  min-height: 42px;
  padding: 8px 12px;
  color: var(--muted);
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease;
}

.entry-tab.is-active {
  color: var(--text);
  background: var(--panel-2);
  box-shadow: 0 5px 18px rgba(0,0,0,.22);
}

.entry-card,
.panel,
.dialog-card,
.modal-card,
.results-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: none;
}

.entry-card {
  display: none;
  padding: clamp(24px, 3.5vw, 38px);
  border-radius: var(--radius-xl);
}

.entry-card.is-active { display: block; }

.entry-card__heading,
.dialog-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 27px;
}

.step-number {
  display: none;
  flex: 0 0 auto;
  place-items: center;
  width: 45px;
  height: 45px;
  color: var(--lime);
  border: 1px solid rgba(183, 255, 60, 0.25);
  border-radius: 13px;
  background: var(--lime-soft);
  font-size: 12px;
  font-weight: 900;
}

.step-number--violet { color: #c9b4ff; border-color: rgba(155, 108, 255, 0.3); background: var(--violet-soft); }
.entry-card__heading h2, .dialog-heading h2 { margin: 0 0 5px; font-size: 22px; }
.entry-card__heading p { margin: 0; color: var(--muted); font-size: 13px; }

.field-label,
.color-picker legend,
.preset-picker legend {
  display: block;
  margin: 18px 0 8px;
  color: #c9cde0;
  font-size: 12px;
  font-weight: 750;
}

.input-wrap {
  position: relative;
}

.input-wrap .icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-wrap input,
.code-input input,
.settings-select,
.local-player-name {
  width: 100%;
  min-height: 50px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(5, 7, 16, 0.58);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrap input {
  padding: 0 15px 0 45px;
}

.input-wrap input::placeholder,
.code-input input::placeholder { color: #666d88; }

.input-wrap input:focus,
.code-input input:focus,
.settings-select:focus,
.local-player-name:focus {
  border-color: rgba(155, 108, 255, 0.7);
  background: rgba(10, 12, 26, 0.9);
  box-shadow: 0 0 0 4px rgba(155, 108, 255, 0.11);
  outline: 0;
}

.input-wrap input[aria-invalid="true"],
.code-input input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 85, 112, 0.11);
}

.color-picker,
.preset-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.color-options {
  display: flex;
  gap: 10px;
}

.color-choice {
  position: relative;
  display: block;
  flex: 1;
  aspect-ratio: 1.7;
  max-width: 52px;
  border-radius: 12px;
}

.color-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.color-choice span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: inherit;
  background: color-mix(in srgb, var(--choice) 16%, rgba(255,255,255,.025));
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.color-choice span::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--choice);
  box-shadow: 0 0 12px var(--choice);
}

.color-choice input:checked + span {
  border-color: var(--choice);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--choice) 45%, transparent), inset 0 0 16px color-mix(in srgb, var(--choice) 14%, transparent);
  transform: translateY(-2px);
}

.color-choice input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 3px; }

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 850;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 25px;
  color: #0a0c14;
  border: 0;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
  transform: none;
  filter: brightness(1.05);
}

.primary-button:active:not(:disabled),
.secondary-button:active:not(:disabled),
.danger-button:active:not(:disabled) { transform: translateY(0) scale(0.99); }

.primary-button:disabled,
.secondary-button:disabled { cursor: not-allowed; opacity: 0.42; filter: saturate(0.4); }

.primary-button--lime {
  background: var(--lime);
  box-shadow: none;
}

.primary-button--violet {
  color: white;
  background: var(--violet-strong);
  box-shadow: none;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.065);
}

.danger-button {
  color: white;
  border: 1px solid rgba(255, 85, 112, 0.36);
  background: rgba(255, 85, 112, 0.16);
}

.code-input {
  position: relative;
}

.code-input input {
  padding: 0 50px 0 18px;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.code-input__scan {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 20px;
  height: 20px;
  border: solid var(--muted-2);
  border-width: 2px 0;
  transform: translateY(-50%);
}

.code-input__scan::before,
.code-input__scan::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 6px;
  border: solid var(--muted-2);
}
.code-input__scan::before { left: 0; border-width: 0 0 0 2px; }
.code-input__scan::after { right: 0; border-width: 0 2px 0 0; }

.field-hint {
  display: block;
  margin: 7px 0 0;
  color: var(--muted-2);
  font-size: 11px;
}

.privacy-note {
  position: absolute;
  right: 0;
  bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted-2);
  font-size: 11px;
}
.privacy-note .icon { width: 14px; }

/* Lobby */
.lobby-view {
  padding: 30px 0 118px;
}

.lobby-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.back-button,
.share-button {
  gap: 8px;
  width: fit-content;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 750;
}

.share-button { justify-self: end; color: var(--lime); border-color: rgba(183,255,60,.17); }

.room-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.room-code {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  color: var(--text);
  border: 1px dashed rgba(183, 255, 60, 0.35);
  border-radius: 9px;
  background: var(--lime-soft);
}

.room-code strong {
  color: var(--lime);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 20px;
  letter-spacing: 0.17em;
}
.room-code .icon { width: 15px; }

.lobby-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin: 36px 0 24px;
}

.lobby-heading h1 {
  margin: 12px 0 7px;
  font-size: clamp(34px, 4vw, 48px);
}

.lobby-heading p {
  margin: 0;
  color: var(--muted);
}
.lobby-context { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.lobby-context p { margin: 0; }
.lobby-type-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.lobby-type-badge[data-kind="phone"] { color: var(--cyan); border-color: color-mix(in srgb,var(--cyan) 28%,transparent); background: color-mix(in srgb,var(--cyan) 7%,transparent); }
.lobby-type-badge[data-kind="personal"] { color: var(--lime); border-color: color-mix(in srgb,var(--lime) 25%,transparent); }

.ready-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}

.ready-meter svg { width: 48px; height: 48px; transform: rotate(-90deg); }
.ready-meter circle { fill: none; stroke-width: 5; }
.meter-track { stroke: rgba(255,255,255,.08); }
.meter-value { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: 132; transition: stroke-dashoffset 200ms ease; filter: none; }
.ready-meter > span { display: grid; grid-template-columns: auto auto; align-items: baseline; font-size: 18px; font-weight: 800; }
.ready-meter strong { color: var(--lime); font-size: 24px; }
.ready-meter small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(285px, .6fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.panel-heading--compact { margin-bottom: 14px; }
.panel-kicker { display: none; }
.panel-heading h2 { margin: 3px 0 0; font-size: 20px; }
.capacity-chip, .host-only-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  font-size: 10px;
  font-weight: 800;
}
.host-only-chip { color: #d8c9ff; border-color: rgba(155,108,255,.22); background: var(--violet-soft); }
.host-only-chip .icon { width: 13px; }

.player-list,
.results-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.player-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.027);
  animation: none;
}

.player-card.is-entering { animation: player-in 180ms ease both; }
@keyframes player-in { from { opacity: 0; transform: translateX(-8px); } }

.player-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--player-color);
  border: 1px solid color-mix(in srgb, var(--player-color) 45%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--player-color) 11%, rgba(255,255,255,.02));
  font-size: 15px;
  font-weight: 900;
  box-shadow: inset 0 0 16px color-mix(in srgb, var(--player-color) 8%, transparent);
}

.player-avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--panel-solid);
  border-radius: 50%;
  background: var(--green);
}
.player-card[data-connected="false"] .player-avatar::after { background: var(--muted-2); }
.player-info { min-width: 0; }
.player-info strong { display: flex; align-items: center; gap: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.player-info small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.host-tag, .device-tag, .team-tag { padding: 3px 6px; border-radius: 6px; font-size: 8px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.host-tag { color: #d7c6ff; background: var(--violet-soft); }
.device-tag { color: var(--muted); background: rgba(255,255,255,.055); }
.team-tag { color: var(--team-color, var(--cyan)); border: 1px solid color-mix(in srgb, var(--team-color, var(--cyan)) 30%, transparent); }
.ready-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.ready-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.ready-status.is-ready { color: var(--lime); }
.ready-status.is-ready::before { background: var(--lime); box-shadow: none; }
.remove-player { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; color: var(--muted); border: 1px solid transparent; border-radius: 8px; background: transparent; }
.remove-player:hover { color: var(--red); border-color: rgba(255,85,112,.2); background: rgba(255,85,112,.08); }

.waiting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 11px;
  padding: 14px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
}
.waiting-row strong, .waiting-row small { display: block; }
.waiting-row strong { font-size: 12px; }
.waiting-row small { margin-top: 3px; font-size: 10px; }
.waiting-pulse { flex: 0 0 auto; width: 9px; height: 9px; border: 0; border-radius: 50%; background: var(--violet); box-shadow: none; animation: none; }
@keyframes waiting { 80%,100% { box-shadow: 0 0 0 12px transparent; } }

.invite-panel { text-align: center; }
.invite-panel .panel-heading { text-align: left; }
.qr-frame {
  position: relative;
  width: min(230px, 100%);
  aspect-ratio: 1;
  margin: 8px auto 14px;
  padding: 13px;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 0 40px rgba(155,108,255,.13);
}
.qr-frame img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.qr-fallback { display: grid; place-content: center; gap: 8px; width: 100%; height: 100%; color: #151827; background: repeating-linear-gradient(45deg,#fff,#fff 9px,#f3f1fa 9px,#f3f1fa 18px); }
.qr-fallback strong { font-family: "Cascadia Mono", monospace; font-size: 30px; letter-spacing: .15em; }
.qr-fallback span { font-size: 10px; font-weight: 700; }
.qr-corner { position: absolute; z-index: 2; width: 24px; height: 24px; border-color: var(--lime); }
.qr-corner--tl { top: -5px; left: -5px; border-style: solid; border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.qr-corner--tr { top: -5px; right: -5px; border-style: solid; border-width: 3px 3px 0 0; border-radius: 0 6px 0 0; }
.qr-corner--bl { bottom: -5px; left: -5px; border-style: solid; border-width: 0 0 3px 3px; border-radius: 0 0 0 6px; }
.qr-corner--br { right: -5px; bottom: -5px; border-style: solid; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }
.invite-panel > p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.link-copy { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 38px; padding: 0 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: rgba(4,6,14,.52); font-size: 9px; }
.link-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-copy .icon { flex: 0 0 auto; width: 14px; }

.settings-panel { grid-column: 1 / -1; }
.display-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: -7px 0 20px; padding: 0; border: 0; }
.display-picker legend { grid-column: 1 / -1; margin-bottom: 1px; color: var(--muted); font-size: 9px; font-weight: 800; }
.display-button { display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 10px; min-height: 58px; padding: 9px 12px; color: var(--text); text-align: left; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.display-button .icon { width: 23px; color: var(--muted); }
.display-button strong,.display-button small { display: block; }
.display-button strong { font-size: 11px; }
.display-button small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.display-button.is-selected { border-color: rgba(77,231,255,.38); background: rgba(77,231,255,.065); }
.display-button.is-selected .icon { color: var(--cyan); }
.preset-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 20px; }
.preset-picker legend { grid-column: 1 / -1; margin-top: 0; }
.preset-picker button { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; padding: 10px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.preset-picker button > span { grid-row: 1 / 3; align-self: center; font-size: 19px; }
.preset-picker button strong { font-size: 11px; }
.preset-picker button small { color: var(--muted); font-size: 9px; }
.preset-picker button.is-selected { border-color: rgba(183,255,60,.35); background: var(--lime-soft); box-shadow: inset 0 0 20px rgba(183,255,60,.04); }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px; }
.range-setting, .toggle-setting { min-width: 0; padding: 11px 0; }
.range-setting > span, .toggle-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.range-setting strong, .toggle-setting strong { font-size: 12px; }
.range-setting output { color: var(--lime); font-size: 11px; font-weight: 800; }
.range-setting input { width: 100%; height: 4px; margin: 14px 0 0; appearance: none; border-radius: 999px; background: linear-gradient(90deg,var(--lime) var(--range-progress,50%),rgba(255,255,255,.11) var(--range-progress,50%)); }
.range-setting input::-webkit-slider-thumb { width: 17px; height: 17px; appearance: none; border: 3px solid var(--panel-solid); border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(183,255,60,.4); }
.range-setting input::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid var(--panel-solid); border-radius: 50%; background: var(--lime); box-shadow: 0 0 10px rgba(183,255,60,.4); }
.toggle-setting span > span, .toggle-setting > span { display: block; }
.toggle-setting small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.toggle-setting { position: relative; }
.toggle-setting input { position: absolute; opacity: 0; }
.toggle-setting i { position: relative; flex: 0 0 41px; width: 41px; height: 23px; border-radius: 99px; background: rgba(255,255,255,.12); transition: background 160ms ease; }
.toggle-setting i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #c7cad6; transition: transform 160ms ease, background 160ms ease; }
.toggle-setting input:checked + i { background: rgba(183,255,60,.3); }
.toggle-setting input:checked + i::after { background: var(--lime); transform: translateX(18px); box-shadow: 0 0 8px rgba(183,255,60,.5); }
.toggle-setting input:focus-visible + i { outline: 3px solid var(--cyan); outline-offset: 3px; }
.settings-panel[data-locked="true"] input, .settings-panel[data-locked="true"] button { pointer-events: none; }
.settings-panel[data-locked="true"] .settings-grid, .settings-panel[data-locked="true"] .preset-picker, .settings-panel[data-locked="true"] .display-picker { opacity: .58; }

.lobby-actionbar {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: max(14px, var(--safe-bottom));
  display: grid;
  grid-template-columns: minmax(180px,1fr) auto auto;
  align-items: center;
  gap: 11px;
  width: min(860px, calc(100% - 32px));
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-solid);
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
  backdrop-filter: none;
  transform: translateX(-50%);
}
.self-status { display: flex; align-items: center; gap: 9px; min-width: 0; padding-left: 10px; color: var(--muted); font-size: 11px; }
.self-status strong { color: var(--text); }
.self-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--player-color,var(--lime)); box-shadow: none; }
.lobby-actionbar .primary-button, .lobby-actionbar .secondary-button { width: auto; min-height: 48px; margin: 0; }
.ready-button { min-width: 155px; }
.ready-button__ready { display: none; }
.ready-button[aria-pressed="true"] { color: #10130d; border-color: var(--lime); background: var(--lime); }
.ready-button[aria-pressed="true"] .ready-button__idle { display: none; }
.ready-button[aria-pressed="true"] .ready-button__ready { display: inline; }
.start-button { min-width: 165px; }

/* Game */
body.is-playing { overflow: hidden; overscroll-behavior: none; }
body.is-playing .app-header { display: none; }
.game-view { width: 100%; height: 100vh; height: 100dvh; min-height: 0; margin: 0; padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left); background: #03040b; }
.game-shell { display: grid; grid-template-rows: 50px minmax(0,1fr); width: 100%; height: 100%; }
.game-hud--top { position: relative; z-index: 10; display: grid; grid-template-columns: minmax(82px,.35fr) minmax(0,2fr) minmax(120px,.35fr); align-items: center; gap: 10px; min-height: 50px; padding: 5px 14px; border-bottom: 1px solid var(--line); background: #0c0e13; }
.hud-round { display: flex; align-items: baseline; gap: 5px; }
.hud-round > span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0; }
.hud-round strong { color: var(--lime); font-size: 20px; }
.hud-round small { color: var(--muted); font-size: 11px; }
.hud-scoreboard { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.hud-player { position: relative; display: flex; align-items: center; gap: 7px; min-width: 88px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; background: #15181f; }
.hud-player.is-self { border-color: color-mix(in srgb,var(--player-color) 45%, transparent); background: color-mix(in srgb,var(--player-color) 8%, rgba(255,255,255,.025)); }
.hud-player.is-dead { opacity: .43; }
.hud-player__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--player-color); box-shadow: none; }
.hud-player__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.hud-player__score { margin-left: auto; font-size: 15px; font-weight: 900; }
.hud-player__crown { flex: 0 0 auto; margin-right: -2px; font-size: 13px; line-height: 1; }
.hud-player.rank-1 .hud-player__crown { color: #f5c143; }
.hud-player.rank-2 .hud-player__crown { color: #c2cbd9; }
.hud-player.rank-3 .hud-player__crown { color: #c77c49; }
.hud-player__effects { position: absolute; top: -7px; right: -5px; display: flex; gap: 3px; }
.effect-orb { display: grid; place-items: center; width: 20px; height: 20px; color: #fff; border: 1.5px solid var(--effect-color); border-radius: 6px; background: color-mix(in srgb,var(--effect-color) 14%,#0d1016); font-style: normal; }
.effect-orb__icon { width: 12px; height: 12px; overflow: visible; }
.latency-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 750; }
.latency-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px var(--green); }
.hud-button { width: 36px; height: 36px; border-radius: 10px; }
.hud-button .icon { width: 17px; }
.hud-actions { justify-self: end; }
.arena-wrap { position: relative; min-height: 0; overflow: hidden; background: #090b10; }
#gameCanvas { display: block; width: 100%; height: 100%; touch-action: none; background: #0b0d12; }
.arena-vignette { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.07); box-shadow: none; pointer-events: none; }
.countdown-overlay { position: absolute; z-index: 20; inset: 0; display: grid; place-content: center; justify-items: center; background: rgba(3,4,11,.48); backdrop-filter: blur(3px); }
.countdown-overlay span { color: var(--lime); font-size: clamp(110px,20vw,280px); font-weight: 950; line-height: .8; text-shadow: 0 0 65px rgba(183,255,60,.42); animation: countdown-pop 700ms cubic-bezier(.17,.84,.29,1) both; }
.countdown-overlay small { margin-top: 23px; font-size: 11px; font-weight: 900; letter-spacing: .25em; text-transform: uppercase; }
@keyframes countdown-pop { from { opacity: 0; transform: scale(1.4); } 35% { opacity: 1; } to { transform: scale(.88); } }
.round-banner { position: absolute; z-index: 20; top: 50%; left: 50%; display: grid; justify-items: center; width: min(520px,calc(100% - 30px)); padding: 22px; border: 1px solid var(--line-strong); border-radius: 18px; background: rgba(12,15,29,.9); box-shadow: var(--shadow); backdrop-filter: blur(20px); transform: translate(-50%,-50%); }
.round-banner span { color: var(--violet); font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.round-banner strong { margin-top: 6px; font-size: clamp(22px,4vw,38px); }
.spectator-hint { position: absolute; z-index: 12; bottom: 15px; left: 50%; padding: 8px 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; background: rgba(9,11,24,.78); font-size: 10px; transform: translateX(-50%); }
.desktop-controls-hint { display: none; }
.desktop-controls-hint span { display: flex; align-items: center; gap: 5px; }
.desktop-controls-hint i { color: var(--muted-2); font-size: 8px; font-style: normal; font-weight: 900; letter-spacing: .16em; }
kbd { display: grid; place-items: center; min-width: 27px; height: 25px; padding: 0 6px; color: var(--text); border: 1px solid var(--line-strong); border-bottom-width: 3px; border-radius: 6px; background: var(--panel-2); font-family: inherit; font-size: 10px; font-weight: 850; }

.phone-controller { display: none; }
body.is-playing[data-role="player"][data-display-mode="shared"] .game-shell { grid-template-rows: auto minmax(0,1fr); }
body.is-playing[data-role="player"][data-display-mode="shared"] .desktop-controls-hint { display: none; }
body.is-playing[data-role="player"][data-display-mode="shared"] .phone-controller { display: grid; grid-template-rows: auto minmax(0,1fr) auto auto; min-height: 0; background: #0b0d12; }
body.is-playing[data-role="player"][data-display-mode="shared"] .arena-wrap { display: none; }
.controller-status { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 14px; color: var(--muted); font-size: 11px; }
.controller-status > div { display: flex; align-items: center; gap: 8px; }
.controller-status strong { color: var(--text); }
.controller-player-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--player-color,var(--lime)); box-shadow: 0 0 8px var(--player-color,var(--lime)); }
.controller-round { padding: 5px 9px; border: 1px solid var(--line); border-radius: 99px; }
.steer-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; padding: 0 8px; }
.steer-zone { position: relative; display: grid; place-content: center; justify-items: center; gap: 2px; overflow: hidden; color: var(--zone-color); border: 1px solid color-mix(in srgb,var(--zone-color) 24%, transparent); border-radius: 23px; background: linear-gradient(145deg,color-mix(in srgb,var(--zone-color) 12%, #111427),#0b0d1c); touch-action: none; user-select: none; -webkit-user-select: none; }
.steer-zone::after { content: ""; position: absolute; inset: auto -40% -70% -40%; height: 100%; border-radius: 50%; background: var(--zone-color); opacity: .08; filter: blur(25px); }
.steer-zone--left { --zone-color: var(--cyan); }
.steer-zone--right { --zone-color: var(--pink); }
.steer-zone svg { width: min(24vw,100px); fill: none; stroke: currentColor; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 10px currentColor); }
.steer-zone strong { font-size: clamp(20px,6vw,34px); letter-spacing: .08em; }
.steer-zone small { color: var(--muted); font-size: 10px; }
.steer-zone.is-pressed { color: #0a0c14; border-color: var(--zone-color); background: var(--zone-color); box-shadow: 0 0 42px color-mix(in srgb,var(--zone-color) 34%, transparent); transform: scale(.985); }
.steer-zone.is-pressed svg { filter: none; }
.steer-zone.is-pressed small { color: rgba(0,0,0,.6); }
.controller-hint { margin: 8px 0 0; color: var(--muted-2); text-align: center; font-size: 9px; }

/* Results, modals and notices */
.results-view { display: grid; place-items: center; padding: 50px 0; overflow: hidden; }
.results-card { position: relative; z-index: 2; width: min(640px,100%); padding: 52px clamp(24px,6vw,68px) 38px; border-radius: var(--radius-xl); text-align: center; }
.winner-crown { position: relative; width: 88px; height: 62px; margin: -84px auto 18px; color: var(--lime); }
.winner-crown svg { width: 88px; fill: rgba(183,255,60,.13); stroke: var(--lime); stroke-width: 3; filter: drop-shadow(0 0 12px rgba(183,255,60,.5)); }
.winner-crown span { position: absolute; z-index: 2; top: -8px; left: 44%; animation: crown-star 1.7s ease-in-out infinite alternate; }
@keyframes crown-star { to { transform: scale(1.4) rotate(30deg); } }
.results-kicker { color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .23em; }
.results-card h1 { margin: 13px 0 8px; font-size: clamp(36px,6vw,57px); line-height: 1; }
.results-card > p { margin: 0 0 28px; color: var(--muted); font-size: 13px; }
.result-row { display: grid; grid-template-columns: 28px auto minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 54px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); text-align: left; }
.result-row:first-child { border-color: rgba(183,255,60,.26); background: var(--lime-soft); }
.result-rank { color: var(--muted); font-size: 12px; font-weight: 900; }
.result-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--player-color); box-shadow: 0 0 8px var(--player-color); }
.result-name { font-size: 13px; font-weight: 750; }
.result-score { color: var(--lime); font-size: 17px; font-weight: 900; }
.results-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 9px; margin-top: 25px; }
.results-actions .primary-button { margin: 0; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti-piece { position: absolute; top: -10%; width: 7px; height: 14px; background: var(--confetti-color); animation: confetti-fall var(--duration) linear var(--delay) infinite; }
@keyframes confetti-fall { to { translate: var(--drift) 120vh; rotate: 720deg; } }

.pause-overlay { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3,4,11,.75); backdrop-filter: blur(10px); }
.modal-card { width: min(390px,100%); padding: 36px; border-radius: var(--radius-xl); text-align: center; }
.pause-icon,.dialog-warning { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 15px; color: var(--lime); border: 1px solid rgba(183,255,60,.25); border-radius: 16px; background: var(--lime-soft); font-size: 23px; font-weight: 900; }
.modal-kicker { margin: 0; color: var(--violet); font-size: 9px; font-weight: 900; letter-spacing: .2em; }
.modal-card h2 { margin: 7px 0 8px; font-size: 34px; }
.modal-card > p:not(.modal-kicker) { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.modal-card .primary-button { margin: 0; }
.text-button { padding: 5px; color: var(--muted); border: 0; background: transparent; font-size: 11px; font-weight: 750; }
.text-button--danger { margin-top: 15px; color: var(--red); }

.app-dialog { width: calc(100% - 30px); max-width: 600px; max-height: calc(100dvh - 30px); padding: 0; color: var(--text); border: 0; border-radius: var(--radius-xl); background: transparent; overflow: visible; }
.app-dialog::backdrop { background: rgba(3,4,11,.76); backdrop-filter: blur(9px); }
.dialog-card { position: relative; max-height: calc(100dvh - 30px); padding: clamp(24px,5vw,40px); border-radius: var(--radius-xl); overflow-y: auto; }
.dialog-card--small { max-width: 420px; margin: auto; text-align: center; }
.dialog-close { position: absolute; top: 17px; right: 17px; display: grid; place-items: center; width: 36px; height: 36px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.035); }
.dialog-heading { margin-bottom: 24px; }
.dialog-heading .modal-kicker { margin-bottom: 4px; }
.how-list { display: grid; gap: 15px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.how-list li { display: grid; grid-template-columns: auto 1fr; gap: 13px; text-align: left; }
.how-list li > span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--lime); border: 1px solid rgba(183,255,60,.22); border-radius: 9px; background: var(--lime-soft); font-size: 11px; font-weight: 900; }
.how-list strong { display: block; margin: 1px 0 3px; font-size: 13px; }
.how-list p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.help-tip { display: flex; gap: 10px; margin: 24px 0 0; padding: 13px; color: #d8caff; border: 1px solid rgba(155,108,255,.18); border-radius: 11px; background: var(--violet-soft); }
.help-tip p { margin: 0; font-size: 10px; line-height: 1.5; }
.dialog-warning { color: var(--red); border-color: rgba(255,85,112,.25); background: rgba(255,85,112,.1); }
.dialog-card--small h2 { margin: 0 0 8px; }
.dialog-card--small > p { margin: 0 auto 23px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.toast-stack { position: fixed; z-index: 500; right: max(18px,var(--safe-right)); bottom: max(18px,var(--safe-bottom)); display: grid; gap: 8px; width: min(360px,calc(100% - 36px)); pointer-events: none; }
.app-toast { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: rgba(18,21,42,.95); box-shadow: 0 14px 40px rgba(0,0,0,.4); backdrop-filter: blur(16px); animation: toast-in 220ms ease both; pointer-events: auto; }
.app-toast[data-type="success"] { border-color: rgba(85,232,159,.3); }
.app-toast[data-type="error"] { border-color: rgba(255,85,112,.35); }
.app-toast__icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.07); font-size: 12px; }
.app-toast__copy strong,.app-toast__copy small { display: block; }
.app-toast__copy strong { font-size: 11px; }
.app-toast__copy small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.app-toast__close { padding: 4px; color: var(--muted); border: 0; background: transparent; }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } }
.noscript { position: fixed; z-index: 9999; inset: 0; display: grid; place-items: center; padding: 25px; color: white; background: #080a16; text-align: center; font-weight: 800; }

/* New room mode/local controls */
.mode-picker { display: grid; grid-template-columns: repeat(5,1fr); gap: 8px; margin-bottom: 20px; }
.mode-button { padding: 12px 9px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #11141a; }
.mode-button strong,.mode-button small { display: block; }
.mode-button strong { font-size: 11px; }
.mode-button small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.mode-button.is-selected { color: var(--lime); border-color: rgba(183,255,60,.5); background: rgba(183,255,60,.07); }
.local-player-tools { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.local-player-tools__head { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.local-player-tools__head div strong,.local-player-tools__head div small { display: block; }
.local-player-tools__head div strong { font-size: 12px; }
.local-player-tools__head div small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.mini-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 11px; color: var(--lime); border: 1px solid rgba(183,255,60,.22); border-radius: 9px; background: var(--lime-soft); font-size: 10px; font-weight: 800; }
.mini-button--violet { color: #d6c7ff; border-color: rgba(155,108,255,.25); background: var(--violet-soft); }
.local-player-form { display: grid; grid-template-columns: 1fr 150px auto; gap: 8px; margin-top: 10px; }
.local-player-name,.settings-select { min-height: 38px; padding: 0 10px; border-radius: 9px; font-size: 11px; }
.advanced-settings { margin-top: 17px; border-top: 1px solid var(--line); }
.advanced-settings summary { padding: 15px 0 2px; color: var(--muted); font-size: 10px; font-weight: 800; list-style: none; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary::after { content: "+"; float: right; color: var(--lime); font-size: 15px; }
.advanced-settings[open] summary::after { content: "–"; }
.advanced-settings__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px 24px; padding-top: 9px; }
.select-setting { display: grid; gap: 7px; }
.select-setting span { color: #c9cde0; font-size: 10px; font-weight: 750; }
.power-controls--auto { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; margin: 8px; padding: 8px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: #11141a; font-size: 10px; }
.power-controls--auto > span { color: var(--lime); font-size: 16px; }
.power-controls--auto strong { font-size: 10px; font-weight: 700; }
.controller-options { display: flex; align-items: center; gap: 8px; }
.controller-option-button { padding: 5px 8px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.03); font-size: 9px; }
.controller-option-button[aria-pressed="true"] { color: var(--lime); border-color: rgba(183,255,60,.25); }

@media (max-width: 1050px) {
  .landing-view { grid-template-columns: minmax(0,1fr) 390px; gap: 32px; }
  .hero-art { margin-top: 40px; }
  .settings-grid,.advanced-settings__grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 820px) {
  :root { --header-h: 68px; }
  .app-header,.view { width: min(100% - 28px,700px); }
  .landing-view { display: block; padding-top: 38px; }
  .hero-copy { text-align: center; }
  .eyebrow,.hero-proof { justify-content: center; }
  .hero-copy h1 { font-size: clamp(50px,14vw,82px); }
  .hero-lead { margin-inline: auto; }
  .hero-art { width: min(600px,100%); margin: 10px auto -10px; }
  .entry-panel { width: min(480px,100%); margin: 0 auto; }
  .privacy-note { position: static; justify-content: center; margin: 20px 0 5px; }
  .lobby-view { width: min(100% - 24px,700px); }
  .lobby-grid { grid-template-columns: 1fr; }
  .settings-panel { grid-column: auto; }
  .invite-panel { order: -1; }
  .qr-frame { width: 210px; }
  .lobby-actionbar { grid-template-columns: 1fr 1fr; }
  .self-status { grid-column: 1 / -1; justify-content: center; padding: 3px 0; }
  .mode-picker { grid-template-columns: repeat(2,1fr); }
  .local-player-form { grid-template-columns: 1fr 130px; }
  .local-player-form .mini-button { grid-column: 1 / -1; }
  .game-hud--top { grid-template-columns: auto 1fr auto; padding-inline: 9px; }
  .hud-player { min-width: 64px; padding: 6px; }
  .hud-player__name { display: none; }
  .latency-chip span { display: none; }
}

@media (pointer: coarse), (max-width: 680px) {
  body.is-playing[data-display-mode="personal"][data-device-kind="phone"] .game-shell,
  body.is-playing[data-display-mode="personal"][data-device-kind="tablet"] .game-shell,
  body.is-playing[data-role="host"][data-device-kind="phone"] .game-shell,
  body.is-playing[data-role="host"][data-device-kind="tablet"] .game-shell { grid-template-rows: auto minmax(150px,1fr) clamp(170px,34dvh,300px); }
  body.is-playing[data-display-mode="personal"][data-device-kind="phone"] .desktop-controls-hint,
  body.is-playing[data-display-mode="personal"][data-device-kind="tablet"] .desktop-controls-hint,
  body.is-playing[data-role="host"][data-device-kind="phone"] .desktop-controls-hint,
  body.is-playing[data-role="host"][data-device-kind="tablet"] .desktop-controls-hint { display: none; }
  body.is-playing[data-display-mode="personal"][data-device-kind="phone"] .phone-controller,
  body.is-playing[data-display-mode="personal"][data-device-kind="tablet"] .phone-controller,
  body.is-playing[data-role="host"][data-device-kind="phone"] .phone-controller,
  body.is-playing[data-role="host"][data-device-kind="tablet"] .phone-controller { display: grid; grid-template-rows: 34px minmax(0,1fr) auto; min-height: 0; border-top: 1px solid var(--line); background: #0b0d12; }
  body.is-playing[data-display-mode="personal"][data-device-kind="phone"] .arena-wrap,
  body.is-playing[data-display-mode="personal"][data-device-kind="tablet"] .arena-wrap,
  body.is-playing[data-role="host"][data-device-kind="phone"] .arena-wrap,
  body.is-playing[data-role="host"][data-device-kind="tablet"] .arena-wrap { display: block; }
  body.is-playing[data-display-mode="personal"] .phone-controller .controller-hint,
  body.is-playing[data-role="host"] .phone-controller .controller-hint { display: none; }
  body.is-playing[data-display-mode="personal"] .phone-controller .controller-status,
  body.is-playing[data-role="host"] .phone-controller .controller-status { min-height: 34px; }
  body.is-playing[data-display-mode="personal"] .phone-controller .steer-zone,
  body.is-playing[data-role="host"] .phone-controller .steer-zone { border-radius: 15px; }
  body.is-playing[data-display-mode="personal"] .phone-controller .steer-zone svg,
  body.is-playing[data-role="host"] .phone-controller .steer-zone svg { width: min(12vw,52px); }
  body.is-playing[data-display-mode="personal"] .phone-controller .steer-zone strong,
  body.is-playing[data-role="host"] .phone-controller .steer-zone strong { font-size: clamp(14px,4vw,20px); }
  .game-hud--top { min-height: 52px; }
  .hud-round > span,.hud-round small { display: none; }
  .hud-round strong { font-size: 18px; }
  .hud-button { width: 32px; height: 32px; }
  #fullscreenButton { display: none; }
}

@media (max-width: 600px) {
  .app-header { width: calc(100% - 24px); }
  .connection-pill { width: 34px; min-height: 34px; padding: 0; justify-content: center; }
  .connection-pill > span:last-child { display: none; }
  .brand-mark { width: 39px; height: 39px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy em { font-size: 8px; }
  .view { width: calc(100% - 24px); }
  .landing-view { padding-top: 30px; }
  .hero-copy h1 { margin-top: 18px; }
  .hero-lead { font-size: 15px; }
  .hero-art { aspect-ratio: 1.3; }
  .hero-proof { margin-top: 20px; }
  .entry-card { padding: 22px; border-radius: 22px; }
  .entry-card__heading { margin-bottom: 20px; }
  .color-options { gap: 7px; }
  .lobby-topbar { grid-template-columns: auto 1fr auto; }
  .back-button span,.share-button span { display: none; }
  .back-button,.share-button { width: 42px; padding: 0; }
  .room-identity { justify-self: center; }
  .room-identity > span { display: none; }
  .room-code strong { font-size: 17px; }
  .lobby-heading { align-items: center; margin-top: 34px; }
  .lobby-heading p { font-size: 12px; }
  .ready-meter { padding: 7px; }
  .ready-meter svg { width: 40px; height: 40px; }
  .ready-meter > span { display: none; }
  .panel { padding: 18px; }
  .preset-picker { grid-template-columns: 1fr; }
  .settings-grid,.advanced-settings__grid { grid-template-columns: 1fr; gap: 6px; }
  .lobby-actionbar { bottom: var(--safe-bottom); width: 100%; padding: 9px max(9px,var(--safe-right)) max(9px,var(--safe-bottom)) max(9px,var(--safe-left)); border-width: 1px 0 0; border-radius: 0; }
  .ready-button,.start-button { min-width: 0; padding-inline: 12px; font-size: 12px; }
  .results-card { border-radius: 23px; }
  .results-actions { grid-template-columns: 1fr; }
  .results-actions .secondary-button { min-height: 46px; }
  .dialog-card { padding: 25px 20px; }
  .lobby-view { padding-bottom: 140px; }
}

@media (max-height: 620px) and (pointer: coarse) {
  body.is-playing[data-role="player"][data-display-mode="shared"] .game-shell { grid-template-rows: 44px minmax(0,1fr); }
  body.is-playing[data-display-mode="personal"][data-device-kind="phone"] .game-shell,
  body.is-playing[data-display-mode="personal"][data-device-kind="tablet"] .game-shell,
  body.is-playing[data-role="host"][data-device-kind="phone"] .game-shell,
  body.is-playing[data-role="host"][data-device-kind="tablet"] .game-shell { grid-template-rows: 44px minmax(120px,1fr) minmax(132px,38dvh); }
  .game-hud--top { min-height: 44px; }
  .controller-status { min-height: 34px; }
  .controller-hint { display: none; }
  .steer-zone svg { width: 50px; }
  .steer-zone strong { font-size: 18px; }
}

/* Match setup, custom sound manager and post-game analysis */
.settings-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
}

.powerup-selector {
  margin-top: 18px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #101319;
}

.powerup-selector__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.powerup-selector__heading h3 {
  margin: 0;
  font-size: 15px;
}

.powerup-selector__heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.powerup-selector__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
}

.powerup-selector__actions .text-button {
  min-height: 31px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.025);
}

.powerup-preview-stage {
  display: grid;
  grid-template-columns: minmax(280px,480px) minmax(180px,1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 13px;
  background: #0a0d12;
  box-shadow: 0 12px 34px rgba(0,0,0,.2);
}

.powerup-preview-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 9px;
  background: #07090d;
}

.powerup-preview-stage__copy {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 6px 8px 6px 2px;
}

.powerup-preview-stage__icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--powerup-preview-color,var(--lime));
  border: 1px solid color-mix(in srgb,var(--powerup-preview-color,var(--lime)) 28%,var(--line));
  border-radius: 12px;
  background: color-mix(in srgb,var(--powerup-preview-color,var(--lime)) 10%,transparent);
}

.powerup-preview-stage__icon .power-icon { width: 25px; height: 25px; }
.powerup-preview-stage__text { min-width: 0; }
.powerup-preview-stage__text strong,
.powerup-preview-stage__text > span { display: block; }
.powerup-preview-stage__text strong { font-size: 14px; }
.powerup-preview-stage__text > span { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.powerup-category-buttons {
  display: flex;
  gap: 7px;
  margin-top: 15px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.powerup-category-buttons:empty,
.powerup-options:empty {
  display: none;
}

.powerup-category-buttons button,
.powerup-category-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #171b22;
  font-size: 10px;
  font-weight: 750;
}

.powerup-category-buttons button:hover,
.powerup-category-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.powerup-category-buttons button[aria-pressed="true"],
.powerup-category-buttons button.is-selected,
.powerup-category-button[aria-pressed="true"],
.powerup-category-button.is-selected {
  color: #dfffa7;
  border-color: rgba(163,230,53,.38);
  background: rgba(163,230,53,.1);
}

.powerup-category-button[data-partial="true"] {
  color: var(--text);
  border-color: rgba(163,230,53,.2);
}

.powerup-options {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin-top: 12px;
}

.powerup-option,
.powerup-options > label,
.powerup-options > [data-powerup-option] {
  position: relative;
  display: grid;
  grid-template-columns: auto auto minmax(0,1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
}

.powerup-option:hover,
.powerup-option:focus-within,
.powerup-options > label:hover,
.powerup-options > label:focus-within,
.powerup-options > [data-powerup-option]:hover {
  border-color: var(--line-strong);
  background: rgba(255,255,255,.045);
}

.powerup-option.is-previewing,
.powerup-options > [data-powerup-option].is-previewing {
  border-color: color-mix(in srgb,var(--powerup-color,var(--lime)) 58%,var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--powerup-color,var(--lime)) 24%,transparent);
}

.powerup-option:has(input:checked),
.powerup-options > label:has(input:checked),
.powerup-options > [data-powerup-option]:has(input:checked) {
  border-color: color-mix(in srgb,var(--powerup-color,var(--lime)) 40%,var(--line));
  background: color-mix(in srgb,var(--powerup-color,var(--lime)) 7%,#11141a);
}

.powerup-options input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--powerup-color,var(--lime));
}

.powerup-option__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--powerup-color,var(--lime));
  border-radius: 8px;
  background: color-mix(in srgb,var(--powerup-color,var(--lime)) 12%,transparent);
}

.powerup-option__copy {
  min-width: 0;
}

.powerup-option__copy strong,
.powerup-option__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.powerup-option__copy strong { font-size: 10px; }
.powerup-option__copy small { margin-top: 2px; color: var(--muted); font-size: 8px; }

.host-admin-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.host-admin-area > div strong,
.host-admin-area > div small {
  display: block;
}

.host-admin-area > div strong { font-size: 11px; }
.host-admin-area > div small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.host-admin-area .icon { width: 14px; }

.settings-panel[data-locked="true"] .powerup-selector,
.settings-panel[data-locked="true"] .host-admin-area {
  opacity: .58;
}

.settings-panel[data-locked="true"] .host-admin-area { display: none; }

.sound-admin-dialog { max-width: 760px; }
.sound-admin-card { min-height: 320px; }
.dialog-heading--admin { align-items: flex-start; padding-right: 38px; }
.dialog-heading--admin h2 { margin-bottom: 5px; }
.dialog-heading--admin p:last-child,
.sound-manager-heading p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.sound-admin-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #cdbfff;
  border: 1px solid rgba(139,92,246,.27);
  border-radius: 12px;
  background: var(--violet-soft);
}

.sound-admin-mark .icon { width: 20px; }
.sound-admin-login { max-width: 440px; margin: 0 auto; }
.sound-admin-login__fields { display: grid; }

.admin-input {
  width: 100%;
  min-height: 46px;
  margin: 7px 0 15px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #0f1218;
}

.admin-input:focus { border-color: rgba(139,92,246,.6); }
.sound-admin-login__fields .primary-button { margin-top: 5px; }
.form-error { margin: -5px 0 12px; color: #ff92a5; font-size: 10px; line-height: 1.4; }

.sound-manager-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-right: 42px;
}

.sound-manager-heading h2 { margin: 4px 0 5px; }
.sound-manager-heading .text-button { flex: 0 0 auto; color: #d2c5ff; }
.sound-admin-status { min-height: 18px; margin: 13px 0 8px; color: var(--muted); font-size: 10px; }
.sound-admin-status:empty { min-height: 0; margin: 8px 0 0; }

.sound-rows {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sound-row {
  display: grid;
  grid-template-columns: minmax(130px,1fr) minmax(180px,1.3fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #101319;
}

.sound-row__copy { min-width: 0; }
.sound-row__copy strong,
.sound-row__copy small { display: block; }
.sound-row__copy strong { font-size: 11px; }
.sound-row__copy small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.sound-row__file,
.sound-row input[type="file"] {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
}

.sound-row input[type="file"]::file-selector-button {
  min-height: 31px;
  margin-right: 8px;
  padding: 0 9px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-weight: 750;
}

.sound-row__actions { display: flex; align-items: center; gap: 6px; }
.sound-row__actions button { min-height: 34px; }
.sound-row audio { width: min(220px,100%); height: 32px; }

.results-view {
  place-items: start center;
  padding: 54px 18px;
  overflow: auto;
}

.results-card {
  width: min(1180px,100%);
  padding: 48px clamp(18px,3.2vw,42px) 32px;
}

.results-card .winner-crown { display: none; }
.results-card h1 { overflow-wrap: anywhere; font-size: clamp(32px,5vw,46px); text-wrap: balance; }
.results-card > p { margin-bottom: 22px; }
.results-podium {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: end;
  gap: 10px;
  width: min(720px,100%);
  min-height: 0;
  margin: 0 auto 28px;
}

.results-podium:empty { display: none; }

.results-podium :is(.podium-place,.podium-card) {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  padding: 33px 12px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11141a;
  text-align: center;
}

.results-podium :is(.podium-place,.podium-card)::before {
  content: "♛";
  position: absolute;
  top: 8px;
  font-size: 18px;
}

.results-podium :is(.podium-place,.podium-card)[data-rank="1"] {
  order: 2;
  min-height: 142px;
  border-color: rgba(245,193,67,.46);
  background: linear-gradient(180deg,rgba(245,193,67,.12),#11141a 62%);
}

.results-podium :is(.podium-place,.podium-card)[data-rank="2"] {
  order: 1;
  min-height: 122px;
  border-color: rgba(194,203,217,.35);
  background: linear-gradient(180deg,rgba(194,203,217,.08),#11141a 62%);
}

.results-podium :is(.podium-place,.podium-card)[data-rank="3"] {
  order: 3;
  min-height: 110px;
  border-color: rgba(199,124,73,.4);
  background: linear-gradient(180deg,rgba(199,124,73,.1),#11141a 62%);
}

.results-podium :is(.podium-place,.podium-card)[data-rank="1"]::before { color: #f5c143; }
.results-podium :is(.podium-place,.podium-card)[data-rank="2"]::before { color: #c2cbd9; }
.results-podium :is(.podium-place,.podium-card)[data-rank="3"]::before { color: #c77c49; }
.podium-player-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--player-color); }
.podium-player-rank { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.podium-player-name { width: 100%; overflow: hidden; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.podium-player-score { color: var(--muted); font-size: 10px; }
.podium-player-score strong { color: var(--text); font-size: 18px; }

.results-content {
  display: grid;
  grid-template-columns: minmax(250px,.72fr) minmax(0,1.55fr);
  align-items: start;
  gap: 18px;
  text-align: left;
}

.results-ranking,
.results-analytics {
  min-width: 0;
}

.results-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}

.results-section-heading span {
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .14em;
}

.results-section-heading h2 { margin: 3px 0 0; font-size: 17px; }
.results-ranking { position: sticky; top: 0; }
.results-list { gap: 7px; }
.result-row { min-height: 50px; }
.result-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-score { white-space: nowrap; }
.result-row:nth-child(1) { border-color: rgba(245,193,67,.37); background: rgba(245,193,67,.07); }
.result-row:nth-child(2) { border-color: rgba(194,203,217,.27); background: rgba(194,203,217,.045); }
.result-row:nth-child(3) { border-color: rgba(199,124,73,.3); background: rgba(199,124,73,.055); }
.result-row:nth-child(1) .result-rank { color: #f5c143; font-size: 0; }
.result-row:nth-child(2) .result-rank { color: #c2cbd9; font-size: 0; }
.result-row:nth-child(3) .result-rank { color: #c77c49; font-size: 0; }
.result-row:nth-child(-n+3) .result-rank::before { content: "♛"; font-size: 16px; }

.match-stat-cards {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.match-stat-cards:empty { display: none; }

.match-stat-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #101319;
}

.match-stat-card strong,
.match-stat-card span { display: block; }
.match-stat-card strong { overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.match-stat-card span { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.35; text-transform: uppercase; }

.result-chart-card {
  margin-top: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101319;
}

.result-chart-card__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.result-chart-card__heading strong,
.result-chart-card__heading small { display: block; }
.result-chart-card__heading strong { font-size: 11px; }
.result-chart-card__heading small { margin-top: 3px; color: var(--muted); font-size: 8px; }

.chart-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  background: #0b0e13;
}

.chart-frame--score { aspect-ratio: 2.8 / 1; }
.chart-frame--arena { aspect-ratio: 16 / 9; }
.chart-frame canvas { display: block; width: 100%; height: 100%; }
.chart-frame--arena canvas { background: #0b0d12; }

.elimination-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 8px;
}

.elimination-legend:empty { display: none; }
.elimination-legend span { display: inline-flex; align-items: center; gap: 5px; }
.elimination-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--legend-color,var(--lime)); }

.elimination-causes {
  display: grid;
  gap: 8px;
}

.elimination-causes:empty { display: none; }
.elimination-cause { display: grid; grid-template-columns: minmax(90px,.65fr) minmax(100px,1fr) auto; align-items: center; gap: 9px; font-size: 9px; }
.elimination-cause__name { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.elimination-cause__bar { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.elimination-cause__bar i { display: block; width: var(--cause-percent,0%); height: 100%; border-radius: inherit; background: var(--cause-color,var(--violet)); }
.elimination-cause__value { min-width: 26px; text-align: right; font-weight: 850; }

.results-actions {
  width: min(620px,100%);
  margin: 25px auto 0;
}

@media (max-width: 980px) {
  .powerup-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .results-card { width: min(760px,100%); }
  .results-content { grid-template-columns: 1fr; }
  .results-ranking { position: static; }
  .match-stat-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .powerup-selector { padding: 14px; }
  .powerup-selector__heading { display: grid; }
  .powerup-selector__actions { width: 100%; }
  .powerup-selector__actions .text-button { flex: 1; }
  .powerup-preview-stage { grid-template-columns: 1fr; }
  .powerup-preview-stage__copy { padding: 2px 3px 3px; }
  .powerup-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .host-admin-area { align-items: flex-start; }
  .results-view { padding: 44px 10px 20px; }
  .results-card { padding: 43px 14px 22px; border-radius: 16px; }
  .results-card h1 { font-size: clamp(30px,9vw,44px); }
  .results-podium { gap: 6px; }
  .results-podium :is(.podium-place,.podium-card) { padding-inline: 7px; }
  .results-podium :is(.podium-place,.podium-card)[data-rank="1"] { min-height: 128px; }
  .results-podium :is(.podium-place,.podium-card)[data-rank="2"] { min-height: 112px; }
  .results-podium :is(.podium-place,.podium-card)[data-rank="3"] { min-height: 102px; }
  .podium-player-name { font-size: 10px; }
  .result-chart-card { padding: 10px; }
  .chart-frame--score { aspect-ratio: 1.8 / 1; }
  .elimination-cause { grid-template-columns: minmax(75px,.7fr) minmax(80px,1fr) auto; }
  .sound-admin-card { padding: 25px 17px; }
  .dialog-heading--admin { display: grid; gap: 10px; }
  .sound-admin-mark { width: 38px; height: 38px; }
  .sound-manager-heading { display: grid; gap: 9px; }
  .sound-row { grid-template-columns: 1fr; gap: 8px; }
  .sound-row__actions { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .powerup-options { grid-template-columns: 1fr; }
  .host-admin-area { display: grid; }
  .host-admin-area .mini-button { width: 100%; }
  .match-stat-cards { grid-template-columns: 1fr 1fr; }
  .match-stat-card { padding: 10px; }
  .match-stat-card strong { font-size: 17px; }
  .results-card h1 { font-size: clamp(27px,8.5vw,34px); line-height: 1.05; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .color-choice span::before,.player-avatar::after,.connection-pill__dot,.self-dot,.hud-player__dot { forced-color-adjust: none; }
}

/* 1.5: calmer, glassy interface around a live game backdrop */
:root {
  --bg: #090b10;
  --bg-deep: #05070a;
  --panel: rgba(17, 20, 27, .78);
  --panel-solid: #12151c;
  --panel-2: rgba(255, 255, 255, .065);
  --line: rgba(255, 255, 255, .105);
  --line-strong: rgba(255, 255, 255, .2);
  --text: #f6f7f9;
  --muted: #a5aab4;
  --muted-2: #777e8b;
  --lime: #b7ef5a;
  --violet: #9a7cff;
  --violet-strong: #8264ea;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
}

body {
  background: var(--bg-deep);
  font-weight: 450;
}

main { position: relative; z-index: 1; }

.live-backdrop {
  position: fixed;
  z-index: 0;
  inset: -18px;
  overflow: hidden;
  background: #05070a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}

body[data-view="landing"] .live-backdrop { opacity: 1; }

.live-backdrop canvas {
  width: 100%;
  height: 100%;
  filter: blur(4px) saturate(.82) brightness(.68);
  transform: scale(1.035);
}

.live-backdrop__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 45%, rgba(5, 7, 10, .22), rgba(5, 7, 10, .58) 52%, rgba(5, 7, 10, .84)),
    linear-gradient(90deg, rgba(5, 7, 10, .32), rgba(5, 7, 10, .52));
}

.app-header {
  position: relative;
  z-index: 50;
  width: min(1180px, calc(100% - 40px));
  border-bottom: 0;
}

body[data-view="landing"] .app-header {
  background: rgba(6, 8, 11, .24);
  backdrop-filter: blur(18px) saturate(1.15);
}

.brand-button { gap: 9px; }
.brand-mark {
  width: 48px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand-mark svg { width: 46px; height: 40px; overflow: visible; stroke-width: 2.8; }
.brand-mark .brand-trail { fill: none; stroke-linecap: round; }
.brand-mark .brand-trail--one { stroke: var(--lime); }
.brand-mark .brand-trail--two { stroke: var(--violet); }
.brand-mark .brand-head--one { fill: var(--lime); stroke: none; }
.brand-mark .brand-head--two { fill: var(--violet); stroke: none; }
.brand-mark .brand-impact { fill: rgba(255,255,255,.92); stroke: none; transform-origin: center; }
.brand-copy { display: flex; gap: 4px; align-items: baseline; line-height: 1; }
.brand-copy strong { font-size: 17px; letter-spacing: -.01em; text-transform: none; }
.brand-copy em { margin: 0; color: var(--muted); font-size: 17px; font-weight: 650; letter-spacing: -.01em; text-transform: none; }

.connection-pill {
  min-height: auto;
  padding: 0 5px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-weight: 600;
}

.icon-button,
.hud-button,
.back-button,
.share-button { background: rgba(8, 10, 14, .42); backdrop-filter: blur(14px); }

.landing-view {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 430px);
  gap: clamp(40px, 7vw, 110px);
  width: min(1180px, calc(100% - 40px));
  padding: clamp(58px, 9vh, 110px) 0 44px;
}

.hero-copy { max-width: 700px; }
.hero-copy h1 {
  max-width: 680px;
  margin: 0 0 22px;
  font-size: clamp(58px, 8.6vw, 118px);
  font-weight: 720;
  line-height: .88;
  letter-spacing: -.067em;
  text-wrap: balance;
}
.hero-lead {
  max-width: 560px;
  color: rgba(246, 247, 249, .72);
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.55;
}

.entry-panel {
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 26px;
  background: rgba(12, 15, 20, .62);
  box-shadow: 0 34px 100px rgba(0,0,0,.44), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(28px) saturate(1.25);
}
.entry-tabs {
  gap: 3px;
  margin: 0;
  padding: 4px;
  border: 0;
  border-radius: 16px;
  background: rgba(255,255,255,.045);
}
.entry-tab { border-radius: 12px; font-weight: 650; }
.entry-tab.is-active { background: rgba(255,255,255,.105); box-shadow: 0 6px 22px rgba(0,0,0,.18); }
.entry-card {
  padding: 24px 22px 22px;
  border: 0 !important;
  border-radius: 18px;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.entry-card__heading { margin-bottom: 16px; }
.entry-card__heading h2 { font-size: 21px; font-weight: 700; letter-spacing: -.025em; }
.entry-card__heading p { font-size: 13px; }
.privacy-note {
  grid-column: 2;
  margin: -22px 10px 0;
  color: rgba(255,255,255,.52);
  font-size: 12px;
  text-align: center;
}
.privacy-note .icon { display: none; }

.entry-card,
.panel,
.dialog-card,
.modal-card,
.results-card {
  border-color: rgba(255,255,255,.11);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.16);
}

.panel-kicker,
.settings-label,
.results-kicker { display: none; }
.modal-kicker { letter-spacing: .04em; text-transform: none; }
.host-tag,
.device-tag,
.team-tag,
.ready-status,
.capacity-chip,
.host-only-chip,
.latency-chip {
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
}
.host-only-chip { color: var(--muted); }
.host-only-chip .icon { display: none; }
.latency-chip,
.power-controls--auto { display: none !important; }

.primary-button,
.secondary-button,
.danger-button,
.mini-button { border-radius: 12px; }
.primary-button--lime { box-shadow: 0 12px 34px rgba(183,239,90,.13); }
.primary-button--violet { box-shadow: 0 12px 34px rgba(154,124,255,.12); }
.mode-button,
.preset-picker button,
.powerup-category-buttons button { border-radius: 13px; }

.sound-test-stage {
  position: sticky;
  z-index: 4;
  top: -1px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, .55fr);
  gap: 14px;
  align-items: center;
  margin: 12px 0 18px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(8,10,14,.9);
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  backdrop-filter: blur(18px);
}
.sound-test-stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 11px;
  background: #07090d;
}
.sound-test-stage__copy { min-width: 0; }
.sound-test-stage__copy strong,
.sound-test-stage__copy span { display: block; }
.sound-test-stage__copy strong { margin-bottom: 5px; font-size: 15px; }
.sound-test-stage__copy span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.sound-row__actions { flex-wrap: wrap; }
.sound-record-button.is-recording { color: #fff; border-color: rgba(255,85,112,.55); background: rgba(255,85,112,.18); }
.sound-row.is-recording { border-color: rgba(255,85,112,.38); }
.sound-row.is-testing { border-color: rgba(183,239,90,.38); background: rgba(183,239,90,.035); }

.seo-intro {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px,.72fr) minmax(0,1.28fr);
  gap: clamp(22px,4vw,52px);
  align-items: center;
  margin-top: clamp(-52px,-4vw,-24px);
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 19px;
  background: rgba(10,12,17,.48);
  backdrop-filter: blur(20px) saturate(1.14);
}
.seo-intro__heading h2 { margin: 0 0 6px; font-size: clamp(16px,1.5vw,20px); font-weight: 680; letter-spacing: -.02em; }
.seo-intro__heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.seo-intro__items { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.seo-intro__items article { min-width: 0; padding: 3px 16px; border-left: 1px solid var(--line); }
.seo-intro__items strong,.seo-intro__items span { display: block; }
.seo-intro__items strong { margin-bottom: 4px; font-size: 11px; }
.seo-intro__items span { color: var(--muted); font-size: 9px; line-height: 1.48; }

@media (max-width: 860px) {
  .landing-view {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 34px;
    width: min(560px, calc(100% - 28px));
    padding: 44px 0 34px;
  }
  .hero-copy { text-align: center; }
  .hero-copy h1 { margin-inline: auto; font-size: clamp(54px, 14vw, 86px); }
  .hero-lead { margin-inline: auto; }
  .privacy-note { grid-column: 1; margin-top: -18px; }
  .seo-intro { grid-column: 1; grid-template-columns: 1fr; margin-top: -10px; text-align: left; }
}

@media (max-width: 680px) {
  .app-header { width: calc(100% - 24px); }
  .brand-copy strong,.brand-copy em { font-size: 14px; }
  .connection-pill > span:last-child { display: none; }
  .landing-view { min-height: calc(100dvh - var(--header-h)); padding-top: 24px; }
  .hero-copy h1 { margin-bottom: 16px; }
  .hero-lead { font-size: 16px; }
  .entry-panel { border-radius: 22px; }
  .entry-card { padding: 20px 15px 16px; }
  .seo-intro { gap: 16px; padding: 16px; border-radius: 16px; }
  .seo-intro__items { grid-template-columns: 1fr; }
  .seo-intro__items article { padding: 9px 0; border-top: 1px solid var(--line); border-left: 0; }
  .sound-test-stage { position: relative; grid-template-columns: 1fr; }
}

/* Public rooms */
.entry-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-label--optional { display: flex; align-items: baseline; justify-content: space-between; }
.field-label--optional span { color: var(--muted-2); font-size: 9px; font-weight: 600; }
.input-wrap--plain input { padding-left: 15px; }

.visibility-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}
.visibility-picker legend { grid-column: 1 / -1; margin: 0 0 1px; color: #c9cde0; font-size: 12px; font-weight: 750; }
.visibility-picker label { position: relative; min-width: 0; cursor: pointer; }
.visibility-picker input { position: absolute; opacity: 0; pointer-events: none; }
.visibility-picker label > span {
  display: block;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.025);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.visibility-picker strong,.visibility-picker small { display: block; }
.visibility-picker strong { font-size: 11px; }
.visibility-picker small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.visibility-picker input:checked + span { border-color: rgba(183,239,90,.38); background: rgba(183,239,90,.07); }
.visibility-picker input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.visibility-picker label:active > span { transform: scale(.985); }

.room-browser { min-height: 395px; }
.room-browser__heading { justify-content: space-between; }
.room-browser__refresh {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.035);
}
.room-browser__refresh .icon { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.room-browser__refresh:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.room-browser__refresh.is-loading .icon { animation: room-browser-spin .8s linear infinite; }
@keyframes room-browser-spin { to { transform: rotate(1turn); } }

.room-browser__state {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 26px 16px;
  text-align: center;
}
.room-browser__state[hidden] { display: none; }
.room-browser__state strong { margin-top: 14px; font-size: 13px; }
.room-browser__state small { max-width: 250px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.room-browser__state .text-button { margin-top: 13px; }
.room-browser__spinner { width: 25px; height: 25px; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--lime); border-radius: 50%; animation: room-browser-spin .8s linear infinite; }
.room-browser__state[data-state="empty"] .room-browser__spinner,
.room-browser__state[data-state="error"] .room-browser__spinner { animation: none; border: 0; }
.room-browser__state[data-state="empty"] .room-browser__spinner::before { content: ""; display: block; width: 25px; height: 17px; border: 1px solid rgba(255,255,255,.24); border-radius: 6px; }
.room-browser__state[data-state="error"] .room-browser__spinner::before { content: "!"; display: grid; place-items: center; width: 25px; height: 25px; color: var(--red); border: 1px solid rgba(255,85,112,.35); border-radius: 50%; font-size: 11px; font-weight: 800; }

.room-browser__list { display: grid; gap: 7px; max-height: 305px; margin: 0; padding: 0; overflow: auto; list-style: none; scrollbar-width: thin; }
.room-browser__list[hidden] { display: none; }
.room-browser__room { min-width: 0; }
.room-browser__room button {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 66px;
  padding: 11px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.025);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.room-browser__room button:hover:not(:disabled) { border-color: rgba(183,239,90,.28); background: rgba(183,239,90,.045); }
.room-browser__room button:active:not(:disabled) { transform: scale(.99); }
.room-browser__room button:disabled { cursor: default; opacity: .52; }
.room-browser__copy { min-width: 0; }
.room-browser__copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.room-browser__meta { display: flex; gap: 7px; align-items: center; min-width: 0; margin-top: 5px; color: var(--muted); font-size: 9px; }
.room-browser__meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-browser__players { color: #d5d8e3; font-size: 10px; font-weight: 750; white-space: nowrap; }
.room-browser__arrow { width: 15px; color: var(--muted); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.room-browser__note { margin: 12px 2px 0; color: var(--muted-2); font-size: 9px; text-align: center; }

.room-discovery {
  display: grid;
  gap: 12px;
  margin-top: 17px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.room-discovery__heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.room-discovery__heading strong,.room-discovery__heading small { display: block; }
.room-discovery__heading strong { font-size: 11px; }
.room-discovery__heading small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.room-discovery__toggle { position: relative; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 750; cursor: pointer; }
.room-discovery__toggle input { position: absolute; opacity: 0; }
.room-discovery__toggle i { position: relative; width: 35px; height: 20px; border-radius: 99px; background: rgba(255,255,255,.12); transition: background 160ms ease; }
.room-discovery__toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #c7cad6; transition: transform 160ms ease, background 160ms ease; }
.room-discovery__toggle input:checked + i { background: rgba(183,239,90,.28); }
.room-discovery__toggle input:checked + i::after { background: var(--lime); transform: translateX(15px); }
.room-discovery__toggle input:focus-visible + i { outline: 3px solid var(--cyan); outline-offset: 2px; }
.room-discovery__name { display: grid; grid-template-columns: auto minmax(150px,280px); gap: 12px; align-items: center; color: var(--muted); font-size: 9px; }
.room-discovery__name input { width: 100%; min-height: 36px; padding: 0 10px; color: var(--text); border: 1px solid var(--line); border-radius: 9px; background: rgba(5,7,16,.58); font-size: 10px; }
.room-discovery__name input:focus { border-color: rgba(155,108,255,.7); outline: 0; box-shadow: 0 0 0 3px rgba(155,108,255,.1); }
.room-discovery__status { color: var(--muted-2); font-size: 8px; }
.room-discovery__status[data-state="saving"] { color: var(--muted); }
.room-discovery__status[data-state="saved"] { color: var(--lime); }
.room-discovery__status[data-state="error"] { color: var(--red); }
.settings-panel[data-locked="true"] .room-discovery { display: none; }

@media (max-width: 680px) {
  .room-browser { min-height: 370px; }
  .room-browser__room button { grid-template-columns: minmax(0,1fr) auto; }
  .room-browser__arrow { display: none; }
  .room-discovery__heading { align-items: flex-start; }
  .room-discovery__name { grid-template-columns: 1fr; gap: 6px; }
  .room-discovery__name input { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .live-backdrop canvas { filter: blur(7px) saturate(.55) brightness(.5); }
  .room-browser__spinner,.room-browser__refresh.is-loading .icon { animation: none; }
}

/* Curve Royale v2 — public platform */
.primary-nav {
  position: absolute;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateX(-50%);
}
.primary-nav__item,
.profile-chip {
  min-height: 40px;
  color: rgba(247,248,255,.72);
  border: 1px solid transparent;
  background: transparent;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.primary-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 680;
}
.primary-nav__item .icon { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-nav__item:hover,
.profile-chip:hover { color: #fff; border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.055); }
.primary-nav__item--ranked { color: #d8ff8e; }
.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 9px 4px 5px;
  border-radius: 13px;
}
.profile-chip__avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  color: #0b0d12;
  border-radius: 9px;
  background: linear-gradient(145deg,var(--lime),#71d63d);
  font-size: 11px;
  font-weight: 850;
  background-position: center;
  background-size: cover;
}
.profile-chip__copy { display: grid; min-width: 62px; text-align: left; line-height: 1.1; }
.profile-chip__copy small { color: var(--muted); font-size: 8px; font-weight: 650; }
.profile-chip__copy strong { margin-top: 2px; color: #fff; font-size: 10px; }

.landing-view { align-items: start; }
.hero-shell { align-self: center; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: rgba(255,255,255,.6);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero-eyebrow i,
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 14px rgba(163,230,53,.8);
}
.hero-cta-row { display: flex; gap: 10px; align-items: stretch; margin-top: 30px; }
.hero-ranked-button,
.hero-casual-button {
  display: flex;
  align-items: center;
  min-height: 62px;
  border-radius: 15px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.hero-ranked-button {
  gap: 11px;
  min-width: min(310px,100%);
  padding: 9px 13px 9px 9px;
  color: #0a0d0c;
  border: 1px solid rgba(205,255,119,.75);
  background: linear-gradient(135deg,#baf05e,#92dc42);
  box-shadow: 0 14px 42px rgba(163,230,53,.16);
}
.hero-ranked-button__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; background: rgba(10,13,12,.1); }
.hero-ranked-button__icon .icon,.hero-ranked-button__arrow { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-ranked-button > span:nth-child(2) { display: grid; min-width: 0; flex: 1; }
.hero-ranked-button strong,.hero-casual-button strong { font-size: 13px; }
.hero-ranked-button small,.hero-casual-button small { margin-top: 3px; font-size: 9px; font-weight: 620; }
.hero-ranked-button__arrow { width: 16px; }
.hero-casual-button { display: grid; padding: 10px 15px; color: #fff; border: 1px solid rgba(255,255,255,.14); background: rgba(9,11,15,.48); backdrop-filter: blur(18px); }
.hero-casual-button small { color: var(--muted); }
.hero-ranked-button:hover,.hero-casual-button:hover { transform: translateY(-2px); }
.hero-ranked-button:hover { box-shadow: 0 18px 55px rgba(163,230,53,.24); }
.hero-casual-button:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.07); }
.hero-live-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; color: rgba(255,255,255,.5); font-size: 9px; }
.hero-live-row span { display: inline-flex; align-items: center; gap: 5px; }
.hero-live-row strong { color: rgba(255,255,255,.82); }
.hero-live-row .live-dot { width: 5px; height: 5px; }

.season-card {
  display: grid;
  width: min(360px,100%);
  gap: 11px;
  margin-top: 28px;
  padding: 15px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 17px;
  background: linear-gradient(135deg,rgba(14,17,23,.72),rgba(10,12,17,.46));
  box-shadow: inset 0 1px rgba(255,255,255,.035);
  backdrop-filter: blur(22px);
}
.season-card__label,.profile-kicker,.dialog-kicker { color: var(--muted); font-size: 8px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.season-card__rank { display: flex; align-items: center; gap: 11px; }
.season-card__rank > div { display: grid; }
.season-card__rank strong { font-size: 14px; }
.season-card__rank small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.season-card__progress,.ranked-result__progress { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.09); }
.season-card__progress i,.ranked-result__progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--lime),var(--cyan)); transition: width 500ms ease; }
.season-card .text-button { justify-self: start; padding: 0; color: rgba(255,255,255,.72); font-size: 9px; }

.rank-emblem {
  --rank-color: #7c8497;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 46px;
  color: #090b10;
  clip-path: polygon(50% 0,92% 18%,88% 72%,50% 100%,12% 72%,8% 18%);
  background: linear-gradient(145deg,color-mix(in srgb,var(--rank-color),white 26%),var(--rank-color));
  filter: drop-shadow(0 8px 14px color-mix(in srgb,var(--rank-color),transparent 72%));
  font-size: 11px;
  font-weight: 900;
}
.rank-emblem[data-rank="bronze"],.rank-road [data-rank="bronze"] { --rank-color:#b97745; }
.rank-emblem[data-rank="silver"],.rank-road [data-rank="silver"] { --rank-color:#bbc5d6; }
.rank-emblem[data-rank="gold"],.rank-road [data-rank="gold"] { --rank-color:#f1c75b; }
.rank-emblem[data-rank="platinum"],.rank-road [data-rank="platinum"] { --rank-color:#70e0d1; }
.rank-emblem[data-rank="diamond"],.rank-road [data-rank="diamond"] { --rank-color:#62a9ff; }
.rank-emblem[data-rank="master"],.rank-road [data-rank="master"] { --rank-color:#b57aff; }
.rank-emblem[data-rank="royal"],.rank-road [data-rank="royal"] { --rank-color:#ff5dcc; }

.leaderboard-preview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  gap: 22px;
  align-items: center;
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 19px;
  background: rgba(8,10,14,.58);
  backdrop-filter: blur(22px) saturate(1.15);
}
.leaderboard-preview__heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.leaderboard-preview__heading span { color: var(--lime); font-size: 8px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.leaderboard-preview__heading h2 { margin: 4px 0 0; font-size: 18px; letter-spacing: -.03em; }
.leaderboard-preview__heading .text-button { display: none; }
.leaderboard-preview__list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.leaderboard-preview__list li:not(.leaderboard-skeleton) { display: grid; grid-template-columns: 26px 32px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 52px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.leaderboard-preview__list .leaderboard-position { color: var(--muted); font-size: 10px; font-weight: 800; text-align: center; }
.leaderboard-preview__list li:nth-child(1) .leaderboard-position { color:#f1c75b; }
.leaderboard-avatar { display: grid; place-items: center; width: 30px; height: 30px; overflow: hidden; border-radius: 9px; background: rgba(255,255,255,.1); background-position:center; background-size:cover; font-size: 9px; font-weight: 800; }
.leaderboard-player { min-width: 0; }
.leaderboard-player strong,.leaderboard-player small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-player strong { font-size: 10px; }
.leaderboard-player small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.leaderboard-points { color: var(--lime); font-size: 9px; font-weight: 800; white-space: nowrap; }
.leaderboard-skeleton { height: 52px; border-radius: 12px; background: linear-gradient(100deg,rgba(255,255,255,.03) 25%,rgba(255,255,255,.075) 45%,rgba(255,255,255,.03) 65%); background-size: 220% 100%; animation: leaderboard-shimmer 1.5s ease infinite; }
@keyframes leaderboard-shimmer { to { background-position: -120% 0; } }
.seo-intro { margin-top: 0; }

.voice-lobby { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.voice-lobby__head,.voice-lobby__controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.voice-lobby__head strong,.voice-lobby__head small { display: block; }
.voice-lobby__head strong { font-size: 10px; }
.voice-lobby__head small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.voice-join-button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 0 10px; color: var(--text); border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.04); font-size: 9px; font-weight: 750; }
.voice-join-button[aria-pressed="true"] { color: #dfffaa; border-color: rgba(163,230,53,.3); background: rgba(163,230,53,.08); }
.voice-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); }
.voice-join-button[aria-pressed="true"] .voice-dot { background: var(--lime); box-shadow: 0 0 9px var(--lime); }
.voice-lobby__controls { justify-content: flex-start; }
.voice-lobby__controls > span { margin-left: auto; color: var(--muted); font-size: 8px; }
.mini-button--danger { color: #ff9aac; border-color: rgba(255,85,112,.2); }
.voice-participants { display: flex; flex-wrap: wrap; gap: 6px; }
.voice-participant { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 3px 7px 3px 4px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); font-size: 8px; }
.voice-participant button { padding: 0; color: var(--muted); border: 0; background: transparent; font-size: 8px; }

.player-moderation { display: flex; gap: 4px; margin-left: auto; }
.player-moderation button { display: grid; place-items: center; width: 25px; height: 25px; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); }
.player-moderation button:hover { color: #fff; background: rgba(255,255,255,.08); }
.player-moderation button[data-action="kick"],.player-moderation button[data-action="ban"] { color: #ff9aac; }
.player-moderation .icon { width: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap:round; stroke-linejoin:round; }

.social-dock { position: fixed; z-index: 120; right: max(18px,var(--safe-right)); bottom: max(18px,var(--safe-bottom)); }
.social-dock__toggle { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; color: #fff; border: 1px solid rgba(255,255,255,.15); border-radius: 13px; background: rgba(13,16,22,.88); box-shadow: 0 16px 44px rgba(0,0,0,.42); backdrop-filter: blur(20px); font-size: 10px; font-weight: 750; }
.social-dock__toggle .icon { width: 15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linejoin:round; }
.social-dock__toggle i { position:absolute; top:-6px; right:-6px; display:grid; place-items:center; min-width:18px; height:18px; padding:0 4px; color:#0a0d0c; border-radius:99px; background:var(--lime); font-size:8px; font-style:normal; font-weight:900; }
.chat-panel { position:absolute; right:0; bottom:52px; display:grid; grid-template-rows:auto minmax(150px,310px) auto; width:min(360px,calc(100vw - 28px)); overflow:hidden; border:1px solid rgba(255,255,255,.13); border-radius:18px; background:rgba(12,15,20,.96); box-shadow:0 24px 80px rgba(0,0,0,.5); backdrop-filter:blur(26px); }
.chat-panel__head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px 14px; border-bottom:1px solid var(--line); }
.chat-panel__head strong,.chat-panel__head small { display:block; }
.chat-panel__head strong { font-size:11px; }
.chat-panel__head small { margin-top:2px; color:var(--muted); font-size:8px; }
.chat-panel__head .icon-button { width:30px; height:30px; border-radius:9px; }
.chat-messages { display:flex; flex-direction:column; gap:9px; margin:0; padding:13px 14px; overflow:auto; list-style:none; }
.chat-message { display:grid; grid-template-columns:28px minmax(0,1fr); gap:8px; }
.chat-message__avatar { display:grid; place-items:center; width:28px; height:28px; overflow:hidden; border-radius:8px; background:rgba(255,255,255,.08); background-position:center; background-size:cover; font-size:8px; font-weight:800; }
.chat-message__body { min-width:0; }
.chat-message__meta { display:flex; align-items:baseline; gap:6px; }
.chat-message__meta strong { overflow:hidden; color:rgba(255,255,255,.88); font-size:9px; text-overflow:ellipsis; white-space:nowrap; }
.chat-message__meta time { color:var(--muted-2); font-size:7px; }
.chat-message p { margin:3px 0 0; color:rgba(255,255,255,.72); font-size:10px; line-height:1.45; overflow-wrap:anywhere; }
.chat-muted-notice { margin:0; padding:8px 12px; color:#ffb1be; border-top:1px solid rgba(255,85,112,.16); background:rgba(255,85,112,.05); font-size:8px; }
.chat-composer { display:grid; grid-template-columns:minmax(0,1fr) 38px; gap:7px; padding:10px; border-top:1px solid var(--line); }
.chat-composer input { min-width:0; height:38px; padding:0 11px; color:#fff; border:1px solid var(--line); border-radius:10px; background:rgba(4,6,9,.62); font-size:10px; }
.chat-composer input:focus { border-color:rgba(163,230,53,.4); outline:0; }
.chat-composer button { display:grid; place-items:center; color:#0a0d0c; border:0; border-radius:10px; background:var(--lime); }
.chat-composer button .icon { width:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

.app-footer { position:relative; z-index:10; display:flex; align-items:center; justify-content:space-between; width:min(1180px,calc(100% - 40px)); min-height:52px; margin:0 auto; color:rgba(255,255,255,.38); border-top:1px solid rgba(255,255,255,.07); font-size:8px; }
.app-footer nav { display:flex; gap:14px; }
.app-footer button { padding:0; color:inherit; border:0; background:transparent; font-size:inherit; }
.app-footer button:hover { color:rgba(255,255,255,.75); }
body:not([data-view="landing"]) .app-footer { display:none; }

.profile-dialog,.leaderboard-dialog,.sound-admin-dialog { max-width:min(980px,calc(100vw - 24px)); }
.profile-card,.leaderboard-card { width:min(900px,calc(100vw - 28px)); max-height:min(850px,calc(100dvh - 32px)); overflow:auto; }
.profile-heading { display:flex; align-items:flex-start; gap:13px; }
.profile-heading__mark,.sound-admin-mark { display:grid; flex:0 0 auto; place-items:center; width:44px; height:44px; color:#0a0d0c; border-radius:13px; background:linear-gradient(145deg,var(--lime),#71d63d); font-size:11px; font-weight:900; }
.profile-auth-tabs,.leaderboard-tabs,.admin-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; margin:20px 0 16px; padding:4px; border-radius:13px; background:rgba(255,255,255,.045); }
.profile-auth-tabs button,.leaderboard-tabs button,.admin-tabs button { min-height:37px; color:var(--muted); border:0; border-radius:10px; background:transparent; font-size:10px; font-weight:750; }
.profile-auth-tabs button.is-active,.leaderboard-tabs button.is-active,.admin-tabs button.is-active { color:#fff; background:rgba(255,255,255,.1); box-shadow:0 7px 20px rgba(0,0,0,.18); }
.profile-auth-form { display:grid; max-width:430px; margin:0 auto; }
.profile-auth-form .primary-button { margin-top:12px; }
.profile-identity { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:15px; align-items:center; padding-right:35px; }
.profile-avatar-editor { position:relative; width:74px; height:74px; }
.profile-avatar-large,.profile-avatar-editor img { display:grid; place-items:center; width:74px; height:74px; object-fit:cover; color:#0a0d0c; border-radius:22px; background:linear-gradient(145deg,var(--lime),#71d63d); font-size:20px; font-weight:900; }
.profile-avatar-upload { position:absolute; right:-4px; bottom:-4px; display:grid; place-items:center; width:29px; height:29px; color:#fff; border:3px solid var(--panel); border-radius:10px; background:var(--violet); }
.profile-avatar-upload .icon { width:14px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.profile-identity h2 { margin:3px 0 8px; font-size:25px; letter-spacing:-.035em; }
.profile-rank-line { display:flex; align-items:center; gap:8px; }
.profile-rank-line .rank-emblem { width:28px; height:31px; font-size:7px; }
.profile-rank-line strong { font-size:10px; }
.profile-rank-line small { color:var(--muted); font-size:8px; }
.profile-stat-grid,.admin-metric-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:22px 0; }
.profile-stat-grid article,.admin-metric-grid article { display:grid; gap:5px; min-height:80px; padding:13px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.025); }
.profile-stat-grid span,.admin-metric-grid span { color:var(--muted); font-size:8px; }
.profile-stat-grid strong,.admin-metric-grid strong { align-self:end; font-size:22px; letter-spacing:-.03em; }
.admin-metric-grid small { color:var(--muted-2); font-size:7px; }
.profile-content-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.profile-content-grid > section { min-width:0; padding:14px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.018); }
.profile-section-heading span { color:var(--muted); font-size:7px; font-weight:750; letter-spacing:.1em; text-transform:uppercase; }
.profile-section-heading h3 { margin:4px 0 12px; font-size:14px; }
.match-history,.replay-library { display:grid; gap:7px; max-height:260px; margin:0; padding:0; overflow:auto; list-style:none; }
.match-history-item,.replay-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:9px; align-items:center; min-height:48px; padding:8px 9px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.022); }
.match-history-item__result { display:grid; place-items:center; width:28px; height:28px; border-radius:8px; font-size:9px; font-weight:900; }
.match-history-item__result.is-win { color:#dfffaa; background:rgba(163,230,53,.11); }
.match-history-item__result.is-loss { color:#ffafbc; background:rgba(255,85,112,.1); }
.match-history-item strong,.match-history-item small,.replay-item strong,.replay-item small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.match-history-item strong,.replay-item strong { font-size:9px; }
.match-history-item small,.replay-item small { margin-top:3px; color:var(--muted); font-size:7px; }
.match-history-item__delta { font-size:8px; font-weight:850; }
.match-history-item__delta.is-positive { color:var(--lime); }
.match-history-item__delta.is-negative { color:#ff8da1; }
.replay-item button { padding:5px 8px; color:#fff; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.04); font-size:8px; }
.empty-state { padding:22px 10px; color:var(--muted); font-size:9px; text-align:center; }
.profile-data-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:15px; padding-top:13px; border-top:1px solid var(--line); }
.profile-data-actions .secondary-button { width:auto; min-height:38px; padding-inline:13px; }

.leaderboard-tabs { grid-template-columns:repeat(3,minmax(0,1fr)); }
.leaderboard-season-row { display:flex; justify-content:space-between; gap:12px; margin:0 4px 10px; color:var(--muted); font-size:8px; }
.global-leaderboard { display:grid; gap:7px; max-height:480px; margin:0; padding:0; overflow:auto; list-style:none; }
.global-leaderboard li { display:grid; grid-template-columns:36px 40px minmax(0,1fr) auto auto; gap:10px; align-items:center; min-height:59px; padding:8px 11px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.022); }
.global-leaderboard li[data-position="1"] { border-color:rgba(241,199,91,.3); background:linear-gradient(90deg,rgba(241,199,91,.08),rgba(255,255,255,.02)); }
.global-leaderboard li[data-position="2"] { border-color:rgba(187,197,214,.22); }
.global-leaderboard li[data-position="3"] { border-color:rgba(185,119,69,.24); }
.global-leaderboard .leaderboard-position { color:var(--muted); font-size:11px; font-weight:900; text-align:center; }
.global-leaderboard li[data-position="1"] .leaderboard-position { color:#f1c75b; }
.global-leaderboard .rank-emblem { width:31px; height:34px; font-size:7px; }
.leaderboard-record { color:var(--muted); font-size:8px; }
.rank-road { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; margin-top:16px; }
.rank-road span { padding:8px 3px; color:var(--rank-color); border-top:2px solid var(--rank-color); background:color-mix(in srgb,var(--rank-color),transparent 93%); font-size:7px; font-weight:800; text-align:center; }

.matchmaking-dialog { max-width:520px; }
.matchmaking-card { width:min(470px,calc(100vw - 28px)); text-align:center; }
.matchmaking-orbit { position:relative; display:grid; place-items:center; width:138px; height:138px; margin:0 auto 18px; border:1px solid rgba(163,230,53,.12); border-radius:50%; }
.matchmaking-orbit::before,.matchmaking-orbit::after { content:""; position:absolute; border:1px solid rgba(139,92,246,.14); border-radius:50%; }
.matchmaking-orbit::before { inset:13px; }.matchmaking-orbit::after { inset:28px; }
.matchmaking-orbit > i { position:absolute; inset:0; border:2px solid transparent; border-top-color:var(--lime); border-right-color:rgba(163,230,53,.2); border-radius:50%; animation:matchmaking-spin 1.8s linear infinite; }
.matchmaking-orbit > i:nth-child(2) { inset:13px; border-top-color:var(--violet); border-right-color:transparent; animation-direction:reverse; animation-duration:2.7s; }
@keyframes matchmaking-spin { to { transform:rotate(1turn); } }
.matchmaking-card h2 { margin:8px 0 7px; font-size:28px; letter-spacing:-.04em; }
.matchmaking-card > p { margin:0; color:var(--muted); font-size:11px; }
.matchmaking-meta { display:grid; grid-template-columns:repeat(3,1fr); gap:7px; margin:21px 0 15px; }
.matchmaking-meta span { display:grid; gap:4px; padding:10px 5px; border:1px solid var(--line); border-radius:11px; background:rgba(255,255,255,.025); }
.matchmaking-meta small { color:var(--muted); font-size:7px; }.matchmaking-meta strong { font-size:10px; }
.matchmaking-pulse { height:3px; margin:0 0 20px; overflow:hidden; border-radius:99px; background:rgba(255,255,255,.08); }
.matchmaking-pulse i { display:block; width:30%; height:100%; border-radius:inherit; background:linear-gradient(90deg,transparent,var(--lime),transparent); animation:matchmaking-pulse 1.4s ease-in-out infinite; }
@keyframes matchmaking-pulse { from { transform:translateX(-100%); } to { transform:translateX(430%); } }
.matchmaking-card .secondary-button { width:100%; }
.matchmaking-note { display:block; margin-top:12px; color:var(--muted-2); font-size:7px; }

.replay-card { width:min(920px,calc(100vw - 28px)); }
.replay-stage { position:relative; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:#07090d; }
.replay-stage canvas { display:block; width:100%; aspect-ratio:16/9; }
.replay-play-button { position:absolute; inset:50% auto auto 50%; display:grid; place-items:center; width:54px; height:54px; color:#0a0d0c; border:0; border-radius:50%; background:rgba(183,239,90,.92); box-shadow:0 12px 40px rgba(0,0,0,.35); transform:translate(-50%,-50%); }
.replay-play-button .icon { width:20px; fill:currentColor; stroke:none; }
.replay-controls { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:center; margin-top:10px; color:var(--muted); font-size:8px; }
.replay-controls input { width:100%; accent-color:var(--lime); }

.privacy-card { width:min(720px,calc(100vw - 28px)); }
.privacy-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:18px 0; }
.privacy-grid article { padding:13px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.022); }
.privacy-grid strong { font-size:10px; }.privacy-grid p { margin:5px 0 0; color:var(--muted); font-size:9px; line-height:1.55; }
.privacy-card > p { color:var(--muted); font-size:9px; }

.sound-admin-dialog { max-width:min(1120px,calc(100vw - 24px)); }
.sound-admin-card { width:min(1060px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); overflow:auto; }
.admin-tabs { max-width:340px; }
.admin-metric-grid { margin-top:15px; }
.admin-chart-card,.admin-insight-grid > article { padding:14px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.02); }
.admin-chart-card > div strong,.admin-chart-card > div small,.admin-insight-grid > article > div strong,.admin-insight-grid > article > div small { display:block; }
.admin-chart-card > div strong,.admin-insight-grid > article > div strong { font-size:10px; }
.admin-chart-card > div small,.admin-insight-grid > article > div small { margin-top:3px; color:var(--muted); font-size:8px; }
.admin-chart-card canvas { display:block; width:100%; height:auto; max-height:250px; margin-top:10px; }
.admin-insight-grid { display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:8px; }
.admin-insight-grid ol { display:grid; gap:6px; margin:12px 0 0; padding:0; list-style:none; }
.admin-insight-grid li,.admin-health-row { display:flex; justify-content:space-between; gap:10px; color:var(--muted); font-size:8px; }
.admin-device-bars { display:grid; gap:8px; margin-top:12px; }
.admin-device-row { display:grid; grid-template-columns:52px minmax(0,1fr) 28px; gap:7px; align-items:center; color:var(--muted); font-size:8px; }
.admin-device-row i { height:5px; border-radius:99px; background:linear-gradient(90deg,var(--violet),var(--cyan)); }
.admin-insight-grid dl { display:grid; gap:8px; margin:12px 0 0; }
.admin-sounds-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; margin:13px 0 8px; }
.admin-sounds-heading strong,.admin-sounds-heading small { display:block; }
.admin-sounds-heading strong { font-size:11px; }.admin-sounds-heading small { margin-top:3px; color:var(--muted); font-size:8px; }
.danger-button--compact { width:auto; min-height:34px; padding:0 11px; font-size:8px; }
.sound-reset-button { color:#ffacb9 !important; border-color:rgba(255,85,112,.18) !important; }

.ranked-result { display:grid; grid-template-columns:auto minmax(120px,.4fr) minmax(180px,1fr); gap:13px; align-items:center; max-width:560px; margin:18px auto 0; padding:12px 14px; border:1px solid rgba(163,230,53,.16); border-radius:14px; background:rgba(163,230,53,.04); text-align:left; }
.ranked-result .rank-emblem { width:34px; height:38px; font-size:8px; }
.ranked-result > div:nth-child(2) { display:grid; }
.ranked-result small { color:var(--muted); font-size:7px; }.ranked-result strong { font-size:11px; }.ranked-result span { margin-top:2px; color:var(--lime); font-size:8px; font-weight:800; }
.results-actions { grid-template-columns:1.2fr 1fr auto; }
.results-replay-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding-inline:13px; }
.results-replay-button .icon { width:14px; fill:none; stroke:currentColor; stroke-width:1.8; }

@media (max-width: 1080px) {
  .primary-nav { position:static; margin-left:auto; transform:none; }
  .header-actions { margin-left:4px; }
  .landing-view { grid-template-columns:minmax(0,1fr) minmax(330px,420px); gap:36px; }
  .hero-copy h1 { font-size:clamp(58px,9vw,92px); }
  .leaderboard-preview { grid-template-columns:180px minmax(0,1fr); }
}

@media (max-width: 860px) {
  .app-header { flex-wrap:nowrap; }
  .primary-nav__item span,.profile-chip__copy { display:none; }
  .primary-nav__item { width:38px; padding:0; justify-content:center; }
  .profile-chip { padding-right:5px; }
  .landing-view { display:grid; grid-template-columns:1fr; align-content:start; width:min(610px,calc(100% - 28px)); padding-top:38px; }
  .hero-shell,.entry-panel,.leaderboard-preview,.seo-intro { grid-column:1; }
  .hero-copy { text-align:left; }
  .hero-copy h1 { margin-inline:0; }
  .hero-lead { margin-inline:0; }
  .season-card { width:100%; }
  .leaderboard-preview { grid-template-columns:1fr; }
  .leaderboard-preview__heading .text-button { display:inline-flex; }
  .leaderboard-preview__list { grid-template-columns:1fr; }
  .leaderboard-preview__list li:nth-child(n+4) { display:none; }
  .profile-content-grid,.admin-insight-grid { grid-template-columns:1fr; }
  .profile-stat-grid,.admin-metric-grid { grid-template-columns:1fr 1fr; }
  .results-actions { grid-template-columns:1fr; }
}

@media (max-width: 620px) {
  .app-header { width:calc(100% - 20px); }
  .brand-mark { width:40px; }.brand-mark svg { width:40px; }
  .brand-copy strong,.brand-copy em { font-size:14px; }
  .primary-nav { gap:0; }
  .primary-nav__item { width:34px; }
  .profile-chip__avatar { width:28px; height:28px; }
  .header-actions { gap:4px; }
  .connection-pill { display:none; }
  .hero-eyebrow { margin-bottom:14px; }
  .hero-copy h1 { font-size:clamp(54px,18vw,82px); }
  .hero-cta-row { display:grid; }
  .hero-ranked-button,.hero-casual-button { width:100%; }
  .hero-casual-button { min-height:52px; }
  .hero-live-row { gap:11px; }
  .leaderboard-preview { padding:15px; }
  .social-dock { right:10px; bottom:max(10px,var(--safe-bottom)); }
  .chat-panel { width:calc(100vw - 20px); max-height:70dvh; }
  .profile-card,.leaderboard-card,.sound-admin-card { padding:24px 15px; border-radius:17px; }
  .profile-identity { grid-template-columns:auto minmax(0,1fr); padding-right:28px; }
  .profile-identity > .text-button { grid-column:1/-1; justify-self:start; }
  .profile-avatar-editor,.profile-avatar-large,.profile-avatar-editor img { width:60px; height:60px; border-radius:18px; }
  .profile-stat-grid,.admin-metric-grid { gap:6px; }
  .profile-stat-grid article,.admin-metric-grid article { min-height:70px; padding:10px; }
  .profile-content-grid { grid-template-columns:1fr; }
  .global-leaderboard li { grid-template-columns:28px 32px minmax(0,1fr) auto; gap:7px; }
  .global-leaderboard .leaderboard-record { display:none; }
  .rank-road { grid-template-columns:repeat(4,1fr); }
  .matchmaking-meta { grid-template-columns:1fr 1fr; }
  .matchmaking-meta span:last-child { display:none; }
  .privacy-grid { grid-template-columns:1fr; }
  .app-footer { width:calc(100% - 24px); }
  .voice-lobby__head { align-items:flex-start; }
  .ranked-result { grid-template-columns:auto 1fr; }
  .ranked-result__progress { grid-column:1/-1; }
}

@media (prefers-reduced-motion: reduce) {
  .matchmaking-orbit > i,.matchmaking-pulse i,.leaderboard-skeleton { animation:none; }
}

/* Public-launch readability and touch-target pass. */
.profile-chip__copy small { font-size:10px; }
.profile-chip__copy strong { font-size:12px; }
.hero-ranked-button small,.hero-casual-button small,.hero-live-row,.season-card__rank small,.season-card .text-button { font-size:11px; }
.season-card__label,.profile-kicker,.dialog-kicker,.leaderboard-preview__heading span { font-size:10px; }
.leaderboard-player strong { font-size:12px; }
.leaderboard-player small,.leaderboard-points,.leaderboard-record,.leaderboard-season-row { font-size:10px; }
.voice-lobby__head strong { font-size:12px; }
.voice-lobby__head small,.voice-lobby__controls > span,.voice-participant,.voice-participant button { font-size:10px; }
.voice-join-button,.mini-button { min-height:40px; font-size:11px; }
.social-dock__toggle { min-height:44px; font-size:12px; }
.chat-panel__head small,.chat-message__meta time,.chat-muted-notice { font-size:10px; }
.chat-message__meta strong,.chat-message p,.chat-composer input { font-size:12px; }
.chat-composer input { height:44px; }
.profile-auth-tabs button,.leaderboard-tabs button,.admin-tabs button { min-height:44px; font-size:12px; }
.profile-rank-line strong,.profile-stat-grid strong,.admin-metric-grid strong { font-size:12px; }
.profile-rank-line small,.profile-stat-grid span,.admin-metric-grid span,.admin-metric-grid small,.profile-section-heading span { font-size:10px; }
.match-history-item,.replay-item { min-height:54px; }
.match-history-item strong,.replay-item strong { font-size:11px; }
.match-history-item small,.replay-item small,.match-history-item__delta,.replay-item button,.empty-state { font-size:10px; }
.replay-item button,.danger-button--compact { min-height:40px; }
.rank-road span,.matchmaking-meta small,.matchmaking-note,.ranked-result small { font-size:10px; }
.matchmaking-meta strong,.ranked-result strong { font-size:12px; }
.replay-controls,.ranked-result span { font-size:10px; }
.privacy-grid strong,.privacy-card > p { font-size:12px; }
.privacy-grid p { font-size:11px; }
.admin-chart-card > div strong,.admin-insight-grid > article > div strong,.admin-sounds-heading strong { font-size:12px; }
.admin-chart-card > div small,.admin-insight-grid > article > div small,.admin-insight-grid li,.admin-health-row,.admin-device-row,.admin-sounds-heading small,.danger-button--compact { font-size:10px; }
.app-footer { min-height:60px; font-size:11px; }
.app-footer button { min-height:44px; }

@media (max-width: 620px) {
  .primary-nav__item,
  .profile-chip,
  .header-actions .icon-button {
    min-width: 44px;
    min-height: 44px;
  }
  .primary-nav__item { width: 44px; }
  .profile-chip { justify-content: center; padding: 4px; }
}

@media (max-width: 380px) {
  .brand-copy { display: none; }
}
