:root {
  --bg: #100c1d;
  --panel: rgba(30, 24, 49, 0.82);
  --panel-strong: #211a37;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f8f5ff;
  --muted: #a9a2bd;
  --lime: #d8ff58;
  --purple: #8e5cff;
  --pink: #ff5db1;
  --cyan: #51e5ff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -20%, #3d256d 0, transparent 42%),
    linear-gradient(180deg, #151022 0%, var(--bg) 52%, #0c0914 100%);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
}

button {
  color: inherit;
}

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

.page-glow {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(110px);
  pointer-events: none;
}

.page-glow--one {
  top: 22%;
  left: -180px;
  background: var(--purple);
}

.page-glow--two {
  right: -200px;
  bottom: 5%;
  background: var(--pink);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1440px, calc(100% - 48px));
  min-height: 86px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  filter: drop-shadow(0 0 15px rgba(216, 255, 88, 0.22));
}

.brand__mark img {
  width: 100%;
  height: 100%;
}

.brand__name {
  display: flex;
  align-items: baseline;
  line-height: 1;
}

.brand strong,
.brand em {
  font-size: 1.05rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.brand strong {
  color: var(--lime);
}

.brand em {
  color: #f8f5ff;
}

.topbar__status {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar__right,
.topbar__tools {
  display: flex;
  align-items: center;
}

.topbar__right {
  gap: 14px;
}

.topbar__tools {
  gap: 7px;
}

.utility-control {
  display: inline-flex;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  align-items: center;
  gap: 7px;
  color: #d8d3e3;
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.68rem;
  font-weight: 800;
}

.language-control select {
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 900;
}

.language-control option {
  color: var(--text);
  background: #211a37;
}

.sound-toggle {
  cursor: pointer;
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease;
}

.sound-toggle:hover {
  border-color: rgba(216, 255, 88, 0.35);
  color: var(--lime);
}

.sound-toggle.is-muted {
  color: #766f83;
}

#sound-icon {
  display: grid;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  place-items: center;
  color: #181122;
  background: var(--lime);
  font-size: 0.7rem;
}

.sound-toggle.is-muted #sound-icon {
  color: #b3acbf;
  background: #453d51;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #59f68c;
  box-shadow: 0 0 12px #59f68c;
}

.status-pill {
  padding: 7px 10px;
  border: 1px solid rgba(216, 255, 88, 0.3);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(216, 255, 88, 0.07);
  font-size: 0.68rem;
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 28px auto 0;
}

.panel__kicker {
  margin: 0 0 9px;
  color: var(--lime);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.game-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-column {
  display: grid;
  gap: 16px;
}

.panel,
.lobby-roster,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel {
  padding: 18px;
}

.panel__heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel__heading {
  margin-bottom: 18px;
}

.panel__heading--compact {
  margin-bottom: 18px;
}

.panel h2,
.section-heading h2,
.race-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.step-badge,
.host-crown {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.72rem;
  font-weight: 900;
}

.host-crown {
  color: var(--lime);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #d8d3e3;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.field-row .field-label {
  margin: 0;
}

.field-hint {
  color: #777087;
  font-size: 0.67rem;
}

.text-input {
  width: 100%;
  min-height: 47px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(9, 7, 17, 0.55);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.text-input:focus {
  border-color: rgba(216, 255, 88, 0.65);
  box-shadow: 0 0 0 3px rgba(216, 255, 88, 0.08);
}

.pet-picker {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0 20px;
}

.pet-choice {
  position: relative;
  display: grid;
  min-height: 108px;
  padding: 7px 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.025);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.pet-choice:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-2px);
}

.pet-choice.is-selected {
  border-color: var(--pet-color);
  background: color-mix(in srgb, var(--pet-color) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pet-color) 35%, transparent);
}

.pet-choice:disabled {
  cursor: not-allowed;
  filter: grayscale(0.8);
  opacity: 0.34;
}

.pet-choice__icon {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.28));
}

.pet-choice__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-choice__name {
  overflow: hidden;
  width: 100%;
  color: #c8c2d3;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-choice__taken {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 3px 5px;
  border-radius: 5px;
  color: #181122;
  background: var(--lime);
  font-size: 0.44rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.button {
  display: inline-flex;
  min-height: 48px;
  padding: 0 17px;
  border: 0;
  border-radius: 13px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  transition:
    transform 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}

.button:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-2px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.button--wide {
  width: 100%;
}

.button--primary {
  color: #171122;
  background: linear-gradient(135deg, var(--lime), #97f5a5);
  box-shadow: 0 10px 24px rgba(216, 255, 88, 0.13);
}

.button--secondary {
  color: var(--text);
  background: linear-gradient(135deg, #8a56ff, #6d48d1);
}

.button--start {
  position: relative;
  overflow: hidden;
  min-height: 68px;
  border: 1px solid rgba(238, 255, 176, 0.8);
  color: #151021;
  background: linear-gradient(120deg, #e5ff70, #a8ff8a 55%, #68f4c4);
  box-shadow:
    0 16px 34px rgba(183, 255, 91, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.button--start::after {
  position: absolute;
  top: -60%;
  left: -35%;
  width: 28%;
  height: 220%;
  background: rgba(255, 255, 255, 0.36);
  content: "";
  transform: rotate(18deg);
  transition: left 420ms ease;
}

.button--start:hover:not(:disabled)::after {
  left: 115%;
}

.button--start:not(:disabled) {
  animation: start-glow 1.8s ease-in-out infinite;
}

.button--start:disabled {
  border-color: rgba(255, 255, 255, 0.12);
  color: #8c8597;
  background: #332c40;
  box-shadow: none;
  opacity: 1;
}

.start-button__icon {
  display: grid;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  place-items: center;
  color: var(--lime);
  background: #181122;
  font-size: 0.7rem;
  box-shadow: 0 5px 12px rgba(21, 16, 33, 0.25);
}

@keyframes start-glow {
  50% {
    box-shadow:
      0 17px 42px rgba(183, 255, 91, 0.36),
      0 0 0 4px rgba(216, 255, 88, 0.07);
  }
}

.button--ghost {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.ticket-panel {
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(142, 92, 255, 0.25), transparent 42%),
    var(--panel-strong);
}

.ticket-panel__top {
  display: flex;
  gap: 14px;
  align-items: center;
}

.ticket-panel__top h2 {
  font-size: 1.1rem;
}

.ticket-panel__top p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.ticket-avatar {
  display: grid;
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--pet-color) 70%, white);
  border-radius: 18px;
  place-items: center;
  background: color-mix(in srgb, var(--pet-color) 25%, #171122);
  font-size: 2rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.ticket-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px -22px;
  padding: 13px 22px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
}

.ticket-code strong {
  color: var(--lime);
  font-size: 0.78rem;
}

.host-panel {
  order: -1;
  border-color: rgba(216, 255, 88, 0.2);
  background:
    radial-gradient(circle at 100% 0, rgba(216, 255, 88, 0.09), transparent 40%),
    var(--panel);
}

.host-heading {
  margin-bottom: 13px;
}

.compact-settings .field-label {
  margin-bottom: 6px;
  font-size: 0.64rem;
}

.compact-settings__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.compact-settings__row .text-input,
.compact-settings__row .button {
  min-height: 42px;
}

.compact-settings__row .button {
  padding: 0 11px;
  font-size: 0.62rem;
}

.start-zone {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.start-zone__status {
  display: block;
  margin-bottom: 7px;
  color: #8d859a;
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.start-zone__status.is-ready {
  color: var(--lime);
}

.toggle-row {
  position: relative;
  display: flex;
  min-height: 58px;
  margin-bottom: 15px;
  padding: 10px 0;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  font-size: 0.77rem;
}

.toggle-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.65rem;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle {
  position: relative;
  width: 43px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #40394f;
  transition: background 160ms ease;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 160ms ease;
}

.toggle-row input:checked + .toggle {
  background: var(--lime);
}

.toggle-row input:checked + .toggle::after {
  transform: translateX(19px);
}

.race-column {
  min-width: 0;
}

.race-toolbar {
  display: flex;
  min-height: 82px;
  padding: 0 4px 16px;
  align-items: center;
  justify-content: space-between;
}

.race-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.arena-theme-picker {
  display: flex;
  min-width: 160px;
  padding: 7px 9px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.arena-theme-picker span {
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.arena-theme-picker select {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
}

.arena-theme-picker option {
  color: var(--text);
  background: #211a37;
}

.players-needed {
  display: flex;
  align-items: baseline;
  color: var(--lime);
}

.players-needed span {
  font-size: 2.4rem;
  font-weight: 950;
  letter-spacing: -0.08em;
}

.players-needed small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.race-arena {
  --arena-shell: #4b3379;
  --arena-border: rgba(255, 255, 255, 0.16);
  --sky-start: #7c62ca;
  --sky-end: #bf73c9;
  --sky-glow: #ee9bd9;
  --horizon: #2c1d4b;
  --track-start: #4f3b70;
  --track-end: #392a54;
  --track-grid: rgba(255, 255, 255, 0.08);
  --cloud-color: rgba(255, 255, 255, 0.2);
  --sign-bg: #d8ff58;
  --sign-ink: #2b1d45;
  position: relative;
  overflow: hidden;
  min-height: 510px;
  border: 1px solid var(--arena-border);
  border-radius: 28px;
  background: var(--arena-shell);
  box-shadow: var(--shadow);
  transition: background 300ms ease, border-color 300ms ease;
}

.race-arena[data-theme="sunset"] {
  --arena-shell: #7a3148;
  --arena-border: rgba(255, 190, 113, 0.35);
  --sky-start: #ff8b5d;
  --sky-end: #d64f87;
  --sky-glow: #ffd36a;
  --horizon: #602b55;
  --track-start: #6d3658;
  --track-end: #3e233f;
  --track-grid: rgba(255, 207, 146, 0.13);
  --cloud-color: rgba(255, 226, 195, 0.25);
  --sign-bg: #ffd166;
  --sign-ink: #51243f;
}

.race-arena[data-theme="ocean"] {
  --arena-shell: #14507a;
  --arena-border: rgba(81, 229, 255, 0.32);
  --sky-start: #3e9ddd;
  --sky-end: #56dfd0;
  --sky-glow: #b8fff4;
  --horizon: #174d72;
  --track-start: #236386;
  --track-end: #153c61;
  --track-grid: rgba(151, 247, 255, 0.13);
  --cloud-color: rgba(225, 255, 255, 0.28);
  --sign-bg: #69f2df;
  --sign-ink: #123d5c;
}

.race-arena[data-theme="forest"] {
  --arena-shell: #24533d;
  --arena-border: rgba(123, 241, 144, 0.3);
  --sky-start: #58a66a;
  --sky-end: #9bcf6b;
  --sky-glow: #e7f89b;
  --horizon: #214c38;
  --track-start: #385e49;
  --track-end: #213d32;
  --track-grid: rgba(196, 255, 181, 0.11);
  --cloud-color: rgba(241, 255, 220, 0.22);
  --sign-bg: #c9f56d;
  --sign-ink: #193b2d;
}

.race-arena[data-theme="lava"] {
  --arena-shell: #4d171b;
  --arena-border: rgba(255, 104, 56, 0.38);
  --sky-start: #7f1d24;
  --sky-end: #e94b2f;
  --sky-glow: #ffb02e;
  --horizon: #35141d;
  --track-start: #4e2428;
  --track-end: #21151b;
  --track-grid: rgba(255, 119, 61, 0.16);
  --cloud-color: rgba(55, 23, 27, 0.32);
  --sign-bg: #ff7b32;
  --sign-ink: #34151b;
}

.race-arena[data-theme="ice"] {
  --arena-shell: #5685a4;
  --arena-border: rgba(224, 250, 255, 0.55);
  --sky-start: #8cccec;
  --sky-end: #d9f5ff;
  --sky-glow: #ffffff;
  --horizon: #5083aa;
  --track-start: #658ba8;
  --track-end: #3f6687;
  --track-grid: rgba(240, 253, 255, 0.22);
  --cloud-color: rgba(255, 255, 255, 0.42);
  --sign-bg: #d8fbff;
  --sign-ink: #315875;
}

.race-arena[data-theme="candy"] {
  --arena-shell: #9b4e8a;
  --arena-border: rgba(255, 190, 239, 0.42);
  --sky-start: #ef83ca;
  --sky-end: #87dff0;
  --sky-glow: #fff0a8;
  --horizon: #814a91;
  --track-start: #a25b98;
  --track-end: #694978;
  --track-grid: rgba(255, 235, 251, 0.16);
  --cloud-color: rgba(255, 244, 252, 0.35);
  --sign-bg: #fff08d;
  --sign-ink: #70436f;
}

.race-arena[data-theme="space"] {
  --arena-shell: #15143f;
  --arena-border: rgba(125, 115, 255, 0.4);
  --sky-start: #15153d;
  --sky-end: #56328b;
  --sky-glow: #bd71ff;
  --horizon: #11112f;
  --track-start: #27234e;
  --track-end: #131329;
  --track-grid: rgba(126, 173, 255, 0.15);
  --cloud-color: rgba(162, 139, 255, 0.18);
  --sign-bg: #8ef6ff;
  --sign-ink: #21204b;
}

.race-arena[data-theme="desert"] {
  --arena-shell: #8a5b36;
  --arena-border: rgba(255, 211, 132, 0.4);
  --sky-start: #e6a154;
  --sky-end: #f3cd83;
  --sky-glow: #fff0ad;
  --horizon: #815235;
  --track-start: #8e6748;
  --track-end: #60442f;
  --track-grid: rgba(255, 225, 174, 0.14);
  --cloud-color: rgba(255, 237, 202, 0.27);
  --sign-bg: #ffd56a;
  --sign-ink: #5d3c29;
}

.race-arena[data-theme="midnight"] {
  --arena-shell: #101a34;
  --arena-border: rgba(81, 229, 255, 0.26);
  --sky-start: #10172d;
  --sky-end: #223f72;
  --sky-glow: #4d8cff;
  --horizon: #0a1226;
  --track-start: #1e3153;
  --track-end: #101c35;
  --track-grid: rgba(81, 229, 255, 0.13);
  --cloud-color: rgba(126, 163, 219, 0.16);
  --sign-bg: #51e5ff;
  --sign-ink: #13223e;
}


/* Fallback puternic pentru sincronizare live tema: merge si daca browserul nu aplica imediat data-theme pe arena. */
html[data-arena-theme="sunset"] .race-arena {
  --arena-shell: #7a3148;
  --arena-border: rgba(255, 190, 113, 0.35);
  --sky-start: #ff8b5d;
  --sky-end: #d64f87;
  --sky-glow: #ffd36a;
  --horizon: #602b55;
  --track-start: #6d3658;
  --track-end: #3e233f;
  --track-grid: rgba(255, 207, 146, 0.13);
  --cloud-color: rgba(255, 226, 195, 0.25);
  --sign-bg: #ffd166;
  --sign-ink: #51243f;
}

html[data-arena-theme="ocean"] .race-arena {
  --arena-shell: #14507a;
  --arena-border: rgba(81, 229, 255, 0.32);
  --sky-start: #3e9ddd;
  --sky-end: #56dfd0;
  --sky-glow: #b8fff4;
  --horizon: #174d72;
  --track-start: #236386;
  --track-end: #153c61;
  --track-grid: rgba(151, 247, 255, 0.13);
  --cloud-color: rgba(225, 255, 255, 0.28);
  --sign-bg: #69f2df;
  --sign-ink: #123d5c;
}

html[data-arena-theme="forest"] .race-arena {
  --arena-shell: #24533d;
  --arena-border: rgba(123, 241, 144, 0.3);
  --sky-start: #58a66a;
  --sky-end: #9bcf6b;
  --sky-glow: #e7f89b;
  --horizon: #214c38;
  --track-start: #385e49;
  --track-end: #213d32;
  --track-grid: rgba(196, 255, 181, 0.11);
  --cloud-color: rgba(241, 255, 220, 0.22);
  --sign-bg: #c9f56d;
  --sign-ink: #193b2d;
}

html[data-arena-theme="lava"] .race-arena {
  --arena-shell: #4d171b;
  --arena-border: rgba(255, 104, 56, 0.38);
  --sky-start: #7f1d24;
  --sky-end: #e94b2f;
  --sky-glow: #ffb02e;
  --horizon: #35141d;
  --track-start: #4e2428;
  --track-end: #21151b;
  --track-grid: rgba(255, 119, 61, 0.16);
  --cloud-color: rgba(55, 23, 27, 0.32);
  --sign-bg: #ff7b32;
  --sign-ink: #34151b;
}

html[data-arena-theme="ice"] .race-arena {
  --arena-shell: #5685a4;
  --arena-border: rgba(224, 250, 255, 0.55);
  --sky-start: #8cccec;
  --sky-end: #d9f5ff;
  --sky-glow: #ffffff;
  --horizon: #5083aa;
  --track-start: #658ba8;
  --track-end: #3f6687;
  --track-grid: rgba(240, 253, 255, 0.22);
  --cloud-color: rgba(255, 255, 255, 0.42);
  --sign-bg: #d8fbff;
  --sign-ink: #315875;
}

html[data-arena-theme="candy"] .race-arena {
  --arena-shell: #9b4e8a;
  --arena-border: rgba(255, 190, 239, 0.42);
  --sky-start: #ef83ca;
  --sky-end: #87dff0;
  --sky-glow: #fff0a8;
  --horizon: #814a91;
  --track-start: #a25b98;
  --track-end: #694978;
  --track-grid: rgba(255, 235, 251, 0.16);
  --cloud-color: rgba(255, 244, 252, 0.35);
  --sign-bg: #fff08d;
  --sign-ink: #70436f;
}

html[data-arena-theme="space"] .race-arena {
  --arena-shell: #15143f;
  --arena-border: rgba(125, 115, 255, 0.4);
  --sky-start: #15153d;
  --sky-end: #56328b;
  --sky-glow: #bd71ff;
  --horizon: #11112f;
  --track-start: #27234e;
  --track-end: #131329;
  --track-grid: rgba(126, 173, 255, 0.15);
  --cloud-color: rgba(162, 139, 255, 0.18);
  --sign-bg: #8ef6ff;
  --sign-ink: #21204b;
}

html[data-arena-theme="desert"] .race-arena {
  --arena-shell: #8a5b36;
  --arena-border: rgba(255, 211, 132, 0.4);
  --sky-start: #e6a154;
  --sky-end: #f3cd83;
  --sky-glow: #fff0ad;
  --horizon: #815235;
  --track-start: #8e6748;
  --track-end: #60442f;
  --track-grid: rgba(255, 225, 174, 0.14);
  --cloud-color: rgba(255, 237, 202, 0.27);
  --sign-bg: #ffd56a;
  --sign-ink: #5d3c29;
}

html[data-arena-theme="midnight"] .race-arena {
  --arena-shell: #101a34;
  --arena-border: rgba(81, 229, 255, 0.26);
  --sky-start: #10172d;
  --sky-end: #223f72;
  --sky-glow: #4d8cff;
  --horizon: #0a1226;
  --track-start: #1e3153;
  --track-end: #101c35;
  --track-grid: rgba(81, 229, 255, 0.13);
  --cloud-color: rgba(126, 163, 219, 0.16);
  --sign-bg: #51e5ff;
  --sign-ink: #13223e;
}

.arena-sky {
  position: relative;
  overflow: hidden;
  height: 145px;
  border-bottom: 4px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(43, 24, 92, 0.1), rgba(65, 35, 111, 0.55)),
    radial-gradient(circle at 72% 10%, var(--sky-glow) 0, transparent 23%),
    linear-gradient(135deg, var(--sky-start), var(--sky-end));
  transition: background 300ms ease;
}

.arena-sky::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 54px;
  background:
    linear-gradient(150deg, transparent 20%, var(--horizon) 21% 43%, transparent 44%)
      0 0 / 180px 100% repeat-x;
  content: "";
  opacity: 0.65;
}

.cloud {
  position: absolute;
  width: 110px;
  height: 25px;
  border-radius: 999px;
  background: var(--cloud-color);
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  position: absolute;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.cloud::before {
  top: -20px;
  left: 21px;
  width: 45px;
  height: 45px;
}

.cloud::after {
  top: -13px;
  right: 16px;
  width: 34px;
  height: 34px;
}

.cloud--one {
  top: 42px;
  left: 9%;
}

.cloud--two {
  top: 31px;
  right: 8%;
  transform: scale(0.72);
}

.arena-sign {
  position: absolute;
  z-index: 2;
  top: 27px;
  left: 50%;
  display: flex;
  width: 116px;
  height: 65px;
  border: 4px solid var(--sign-ink);
  border-radius: 9px;
  align-items: center;
  justify-content: center;
  color: var(--sign-ink);
  background: var(--sign-bg);
  box-shadow: 0 9px 0 color-mix(in srgb, var(--sign-ink) 65%, transparent);
  flex-direction: column;
  transform: translateX(-50%) rotate(-2deg);
}

.arena-sign::before,
.arena-sign::after {
  position: absolute;
  top: -36px;
  width: 4px;
  height: 36px;
  background: var(--sign-ink);
  content: "";
}

.arena-sign::before {
  left: 21px;
}

.arena-sign::after {
  right: 21px;
}

.arena-sign span {
  font-size: 1.2rem;
  font-weight: 1000;
  letter-spacing: 0.05em;
}

.arena-sign strong {
  font-size: 0.55rem;
  letter-spacing: 0.15em;
}

.track {
  --finish-inset: 86px;
  position: relative;
  min-height: 365px;
  padding: 13px 18px 18px;
  background:
    linear-gradient(90deg, transparent 95%, var(--track-grid) 95%)
      0 0 / 72px 100%,
    linear-gradient(180deg, var(--track-start), var(--track-end));
  transition: background 300ms ease;
}

.track::after {
  position: absolute;
  z-index: 1;
  top: 0;
  right: var(--finish-inset);
  bottom: 0;
  width: 15px;
  background:
    linear-gradient(45deg, #fff 25%, #241936 25% 50%, #fff 50% 75%, #241936 75%)
      0 0 / 14px 14px;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.28);
  content: "";
}

.race-lane {
  position: relative;
  height: 49px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.17);
}

.race-lane:last-child {
  border-bottom: 0;
}

.lane-number {
  position: absolute;
  top: 50%;
  left: 0;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.65rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.runner {
  --runner-x: 0px;
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 30px;
  display: flex;
  min-width: 82px;
  height: 39px;
  padding: 5px 9px 5px 5px;
  border: 2px solid color-mix(in srgb, var(--pet-color) 75%, white);
  border-radius: 14px 18px 18px 14px;
  align-items: center;
  gap: 7px;
  background: color-mix(in srgb, var(--pet-color) 40%, #171122);
  box-shadow:
    -12px 0 22px color-mix(in srgb, var(--pet-color) 23%, transparent),
    0 8px 16px rgba(0, 0, 0, 0.23);
  transform: translate3d(var(--runner-x), -50%, 0);
  will-change: transform;
}

.runner.is-racing .runner__icon {
  animation: runner-bob 420ms ease-in-out infinite alternate;
}

.runner__icon {
  display: grid;
  width: 42px;
  height: 31px;
  flex: 0 0 auto;
  border-radius: 9px;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
}

.runner__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.runner__copy {
  max-width: 100px;
  overflow: hidden;
}

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

.runner__copy strong {
  color: #fff;
  font-size: 0.66rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.runner__copy small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.48rem;
}

@keyframes runner-bob {
  from {
    transform: translateY(-1px) rotate(-1deg);
  }
  to {
    transform: translateY(2px) rotate(1deg);
  }
}

.track__empty {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  flex-direction: column;
}

.track__empty-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border: 1px solid rgba(216, 255, 88, 0.3);
  border-radius: 18px;
  place-items: center;
  color: var(--lime);
  background: rgba(216, 255, 88, 0.08);
  font-size: 1.5rem;
}

.track__empty strong {
  font-size: 0.9rem;
}

.track__empty p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.72rem;
}

.countdown {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 8, 24, 0.66);
  backdrop-filter: blur(8px);
  flex-direction: column;
}

.countdown span {
  color: var(--lime);
  font-size: clamp(6rem, 15vw, 11rem);
  font-weight: 1000;
  line-height: 0.82;
  text-shadow: 0 0 45px rgba(216, 255, 88, 0.35);
  animation: countdown-pop 800ms ease infinite;
}

.countdown small {
  margin-top: 24px;
  font-weight: 900;
  letter-spacing: 0.26em;
}

@keyframes countdown-pop {
  0% {
    opacity: 0;
    transform: scale(1.5);
  }
  30%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.prize-strip {
  display: flex;
  min-height: 96px;
  margin-top: 15px;
  padding: 18px 22px;
  border: 1px solid rgba(216, 255, 88, 0.22);
  border-radius: 19px;
  align-items: center;
  justify-content: space-between;
  background:
    linear-gradient(100deg, rgba(216, 255, 88, 0.1), transparent 45%),
    rgba(27, 22, 43, 0.86);
}

.prize-strip__label span,
.prize-strip__label strong {
  display: block;
}

.prize-strip__label span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.prize-strip__label strong {
  margin-top: 4px;
  color: var(--lime);
  font-size: 1.25rem;
  font-weight: 950;
}

.prize-formula {
  display: flex;
  gap: 9px;
  align-items: center;
}

.prize-formula > span {
  color: #6f687c;
  font-weight: 900;
}

.prize-token {
  display: grid;
  min-height: 37px;
  padding: 0 12px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.58rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.prize-token--winner {
  border-style: solid;
  border-color: rgba(216, 255, 88, 0.28);
  color: var(--lime);
}

.prize-token--organizer {
  border-color: rgba(255, 95, 122, 0.3);
  color: #ff8fa3;
  background: rgba(255, 95, 122, 0.06);
}

.lobby-roster,
.history-panel {
  margin-top: 16px;
  padding: 22px;
}

.section-heading {
  align-items: center;
  margin-bottom: 17px;
}

.section-heading > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.roster-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.roster-actions > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
}

.clear-all-button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 95, 122, 0.28);
  border-radius: 8px;
  cursor: pointer;
  color: #ff9aae;
  background: rgba(255, 95, 122, 0.07);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.clear-all-button:hover {
  border-color: rgba(255, 95, 122, 0.55);
  background: rgba(255, 95, 122, 0.15);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.roster-card {
  display: flex;
  min-width: 0;
  min-height: 64px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.roster-card__icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  border-radius: 12px;
  place-items: center;
  background: color-mix(in srgb, var(--pet-color) 25%, #171122);
}

.roster-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.roster-card__copy {
  min-width: 0;
  flex: 1;
}

.roster-card strong,
.roster-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-card strong {
  font-size: 0.73rem;
}

.roster-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.58rem;
}

.roster-card--empty {
  justify-content: center;
  border-style: dashed;
  color: #696176;
  font-size: 0.65rem;
}

.roster-card__remove {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid rgba(255, 95, 122, 0.24);
  border-radius: 8px;
  place-items: center;
  cursor: pointer;
  color: #ff8fa3;
  background: rgba(255, 95, 122, 0.08);
  font-size: 1rem;
  line-height: 1;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.roster-card__remove:hover {
  border-color: rgba(255, 95, 122, 0.55);
  background: rgba(255, 95, 122, 0.16);
}

.history-panel {
  margin-bottom: 38px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-item {
  display: flex;
  min-height: 48px;
  padding: 7px 10px;
  border-radius: 12px;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.025);
}

.history-item__icon {
  display: grid;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  place-items: center;
  background: color-mix(in srgb, var(--pet-color) 25%, #171122);
}

.history-item__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.history-item strong {
  flex: 1;
  font-size: 0.72rem;
}

.history-item span:last-child {
  color: var(--muted);
  font-size: 0.58rem;
}

.empty-copy {
  margin: 4px 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.result-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  overflow-y: auto;
  background: rgba(7, 5, 13, 0.78);
  backdrop-filter: blur(15px);
}

.result-card {
  position: relative;
  overflow: hidden;
  width: min(620px, 100%);
  padding: 38px;
  border: 1px solid rgba(216, 255, 88, 0.32);
  border-radius: 30px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(216, 255, 88, 0.13), transparent 38%),
    #1e182e;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
  animation: result-in 420ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.result-card::before {
  position: absolute;
  top: -110px;
  left: 50%;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(216, 255, 88, 0.15);
  border-radius: 50%;
  content: "";
  transform: translateX(-50%);
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.96);
  }
}

.result-card__kicker {
  margin: 0 0 20px;
  color: var(--lime);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.19em;
}

.result-winner-icon {
  display: grid;
  width: 94px;
  height: 94px;
  margin: 0 auto 16px;
  border: 3px solid color-mix(in srgb, var(--pet-color) 70%, white);
  border-radius: 28px;
  place-items: center;
  background: color-mix(in srgb, var(--pet-color) 28%, #171122);
  box-shadow: 0 15px 35px color-mix(in srgb, var(--pet-color) 20%, transparent);
  transform: rotate(-3deg);
}

.result-winner-icon img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.result-card h2 {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.result-card > p:not(.result-card__kicker, .result-waiting) {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.result-divider {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 27px 0 17px;
}

.result-divider span {
  height: 1px;
  flex: 1;
  background: var(--line);
}

.result-divider strong {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
}

.result-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.result-prize {
  min-width: 0;
  padding: 13px 7px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.result-prize:first-child {
  border-color: rgba(216, 255, 88, 0.32);
  background: rgba(216, 255, 88, 0.06);
}

.result-prize__image,
.result-prize strong,
.result-prize small {
  display: block;
}

.result-organizer-pet {
  display: flex;
  min-height: 66px;
  margin-bottom: 22px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 95, 122, 0.24);
  border-radius: 14px;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: rgba(255, 95, 122, 0.055);
}

.result-organizer-pet__image {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 11px;
  place-items: center;
  background: color-mix(in srgb, var(--pet-color) 20%, #171122);
}

.result-organizer-pet__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-organizer-pet span,
.result-organizer-pet strong,
.result-organizer-pet small {
  display: block;
}

.result-organizer-pet span {
  color: #ff8fa3;
  font-size: 0.52rem;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.result-organizer-pet strong {
  margin-top: 3px;
  font-size: 0.69rem;
}

.result-organizer-pet small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.54rem;
}

.result-prize__image {
  width: 76px;
  height: 66px;
  margin: 0 auto;
}

.result-prize__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-prize strong {
  overflow: hidden;
  margin-top: 7px;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-prize small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.51rem;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.result-waiting {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  opacity: 0;
  color: var(--text);
  background: #2c2440;
  box-shadow: var(--shadow);
  font-size: 0.76rem;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-color: rgba(255, 85, 122, 0.4);
  background: #402133;
}

.confetti-layer {
  position: fixed;
  z-index: 60;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -20px;
  width: 9px;
  height: 16px;
  border-radius: 2px;
  animation: confetti-fall 2.8s linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}

footer {
  padding: 10px 24px 28px;
  color: #625b6d;
  font-size: 0.66rem;
  text-align: center;
}

footer a {
  color: #8b8299;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .game-layout {
    grid-template-columns: 285px minmax(0, 1fr);
  }

  .roster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .runner__copy {
    max-width: 72px;
  }
}

@media (max-width: 820px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .host-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .topbar,
  .app-shell {
    width: min(100% - 28px, 1440px);
  }

  .topbar {
    min-height: 70px;
  }

  .race-toolbar {
    gap: 12px;
    align-items: flex-end;
  }

  .race-toolbar__actions {
    gap: 8px;
  }

  .arena-theme-picker {
    min-width: 118px;
    padding-left: 9px;
  }

  .arena-theme-picker span {
    display: none;
  }

  .arena-theme-picker select {
    width: 100%;
    font-size: 0.6rem;
  }

  .brand {
    gap: 7px;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
  }

  .brand strong,
  .brand em {
    font-size: 0.76rem;
  }

  .topbar__right {
    gap: 7px;
  }

  .topbar__tools {
    gap: 5px;
  }

  .utility-control {
    min-height: 33px;
    padding: 0 8px;
  }

  #sound-label {
    display: none;
  }

  .topbar__status #online-count,
  .live-dot {
    display: none;
  }

  .side-column {
    grid-template-columns: 1fr;
  }

  .host-panel {
    grid-column: auto;
  }

  .race-arena {
    min-height: 480px;
    border-radius: 22px;
  }

  .arena-sky {
    height: 118px;
  }

  .track {
    --finish-inset: 54px;
    min-height: 362px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .runner {
    min-width: 92px;
    padding-right: 5px;
  }

  .runner__copy {
    display: block;
    max-width: 62px;
  }

  .runner__copy small {
    display: none;
  }

  .prize-strip {
    gap: 15px;
    align-items: flex-start;
    flex-direction: column;
  }

  .prize-formula {
    width: 100%;
  }

  .prize-token {
    padding: 0 8px;
    flex: 1;
    font-size: 0.48rem;
  }

  .roster-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    gap: 12px;
    align-items: flex-start;
  }

  .roster-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .result-card {
    padding: 30px 20px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .topbar__status {
    display: none;
  }

  .brand strong,
  .brand em {
    font-size: 0.72rem;
  }

  .race-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .race-toolbar__actions {
    width: 100%;
    justify-content: space-between;
  }
}

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

/* Overlay mode for TikTok / OBS: open /overlay?room=ROOM_ID */
html[data-view="overlay"] body {
  background: transparent;
  overflow: hidden;
}

html[data-view="overlay"] .topbar,
html[data-view="overlay"] .hero,
html[data-view="overlay"] .side-column,
html[data-view="overlay"] .prize-strip,
html[data-view="overlay"] .lobby-roster,
html[data-view="overlay"] .history-panel,
html[data-view="overlay"] footer,
html[data-view="overlay"] .toast,
html[data-view="overlay"] .sound-toggle,
html[data-view="overlay"] .language-picker {
  display: none !important;
}

html[data-view="overlay"] main {
  padding: 0;
  min-height: 100vh;
}

html[data-view="overlay"] .game-layout {
  display: block;
  width: 100vw;
  min-height: 100vh;
}

html[data-view="overlay"] .race-column {
  width: 100vw;
  min-height: 100vh;
}

html[data-view="overlay"] .app-shell {
  width: 100vw;
  margin: 0;
}

html[data-view="overlay"] .race-toolbar {
  display: none !important;
}

html[data-view="overlay"] .race-arena {
  min-height: 100vh;
  border-radius: 0;
  border: 0;
}

html[data-view="overlay"] .result-overlay {
  background: transparent;
}

.session-links {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.session-links__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-links__head small {
  opacity: 0.72;
  font-size: 0.68rem;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
}

.copy-input {
  min-width: 0;
  font-size: 0.76rem;
}

.copy-button {
  white-space: nowrap;
  padding-inline: 0.85rem;
}

@media (max-width: 640px) {
  .copy-row {
    grid-template-columns: 1fr;
  }
}


.live-sessions-panel {
  margin-top: 1rem;
}

.watch-by-id-form {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.live-sessions-list {
  display: grid;
  gap: 0.65rem;
}

.live-session-card {
  width: 100%;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.live-session-card:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 255, 88, 0.35);
  background: rgba(216, 255, 88, 0.07);
}

.live-session-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.live-session-card strong {
  overflow: hidden;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-session-card em {
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  color: var(--lime);
  background: rgba(216, 255, 88, 0.09);
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.live-session-card small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.spectator-exit-button {
  margin-bottom: 12px;
}

.live-session-card.is-current {
  pointer-events: none;
  opacity: 0.75;
}

.live-session-id { display: block; margin-top: 3px; opacity: 0.7; font-size: 0.72rem; }
.session-name-row { margin-bottom: 10px; }

.history-item--detailed {
  align-items: flex-start;
  padding: 10px;
}

.history-item__body {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.history-item__body small {
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.25;
}

.history-item--detailed > span:last-child {
  margin-left: auto;
  white-space: nowrap;
}
