:root {
  color-scheme: dark;
  --bg: #0f172a;
  --panel: rgba(15, 23, 42, 0.84);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --success: #22c55e;
  --danger: #f97316;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.36);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.22), transparent 30%),
    linear-gradient(180deg, #0f172a, #020617 65%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.landing-page,
.display-page,
.gun-page {
  display: flex;
  justify-content: center;
}

.landing-card,
.gun-shell {
  width: min(100%, 1280px);
}

.gun-page {
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.landing-card {
  margin: auto 1.25rem;
  padding: 2rem;
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.landing-copy {
  max-width: 40rem;
  color: var(--muted);
}

.app-version {
  margin: 0.2rem 0 0;
  font-size: 0.68rem;
  color: rgba(148, 163, 184, 0.9);
}

.screen-version {
  position: fixed;
  right: 0.65rem;
  bottom: max(0.4rem, calc(env(safe-area-inset-bottom) + 0.2rem));
  z-index: 10;
  font-size: 0.62rem;
  line-height: 1;
  color: rgba(148, 163, 184, 0.9);
  pointer-events: none;
}

.v2-display-page,
.v2-gun-page {
  background: #020617;
}

#v2-display-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.v2-gun-shell,
.v2-gun-join-screen,
.v2-gun-play-screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.v2-gun-join-screen {
  display: grid;
  padding:
    max(0.9rem, env(safe-area-inset-top))
    1rem
    max(1.2rem, calc(env(safe-area-inset-bottom) + 0.8rem));
}

#v2-join-camera-video,
#v2-join-scan-overlay,
#v2-preview-frame,
#v2-camera-video,
#v2-preview-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#v2-join-camera-video,
#v2-camera-video {
  object-fit: cover;
}

#v2-preview-frame {
  display: block;
  background: #000;
}

#v2-camera-video {
  opacity: 0;
  pointer-events: none;
}

#v2-join-scan-overlay,
#v2-preview-overlay {
  pointer-events: none;
}

.v2-gun-play-screen {
  background: linear-gradient(180deg, #020617, #000000 65%);
}

.gun-page.is-playing .v2-gun-play-screen {
  grid-template-rows: auto minmax(5.4rem, 1fr) auto auto;
  align-content: start;
}

.v2-gun-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  width: min(100%, 26rem);
}

.v2-gun-meta .status-pill {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.82rem;
}

.v2-gun-secondary-controls {
  width: 100%;
  justify-content: center;
}

@media (max-width: 430px), (max-height: 780px) {
  .v2-gun-play-screen .gun-fire-button {
    width: 5.15rem;
    height: 5.15rem;
    font-size: 1rem;
  }
}

.landing-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.primary-button,
.secondary-button,
.fire-button,
input {
  border: 0;
  border-radius: 999px;
  font: inherit;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #082f49;
  font-weight: 700;
}

.secondary-button {
  background: rgba(30, 41, 59, 0.88);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.gun-camera-retry-button {
  min-height: 2.75rem;
  padding: 0 1rem;
  white-space: nowrap;
}

.eyebrow,
.meta-label,
.field-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: var(--muted);
}

h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.display-waiting-card,
.gun-join-card {
  border: 1px solid var(--panel-border);
  border-radius: 1.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.display-waiting-card,
.gun-join-card {
  padding: 1.25rem;
}

.display-status-group,
.display-waiting-meta,
.room-form,
.status-row,
.gun-preview-meta {
  display: flex;
  align-items: center;
}

.display-status-group,
.room-form,
.gun-preview-meta {
  justify-content: space-between;
}

.display-status-group {
  gap: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--muted);
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: #64748b;
}

.status-dot.connected {
  background: var(--success);
}

.status-dot.connecting {
  background: #f59e0b;
}

.display-page {
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
}

.display-waiting-screen,
.display-game-screen {
  width: 100%;
  min-height: 100vh;
}

.display-waiting-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.display-waiting-card {
  width: min(100%, 56rem);
}

.display-waiting-meta {
  gap: 1rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}

.meta-card {
  display: grid;
  gap: 0.35rem;
  min-width: 8rem;
}

.meta-card strong {
  font-size: 1.35rem;
}

.qr-card {
  margin-left: auto;
  justify-items: center;
}

.display-pointer-button {
  pointer-events: auto;
  width: 100%;
  margin-top: 0.6rem;
  min-height: 2.3rem;
  padding: 0 0.95rem;
  font-size: 0.84rem;
}

.display-game-screen {
  position: fixed;
  inset: 0;
  display: none;
  background: #020617;
}

.display-page.is-playing .display-waiting-screen {
  display: none;
}

.display-page.is-playing .display-game-screen {
  display: block;
}

.display-game-hud {
  position: absolute;
  top: 4.35rem;
  left: 1rem;
  z-index: 2;
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  padding: 0.8rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.display-menu-button {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  min-height: 2.35rem;
  padding: 0 0.85rem;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.display-game-hud .status-pill,
.display-reset-button {
  min-width: 0;
}

.display-game-hud .status-pill {
  justify-content: flex-start;
}

.display-reset-button {
  margin-left: 0;
  background: rgba(15, 23, 42, 0.82);
}

.display-game-hud[hidden] {
  display: none;
}

.display-page.display-menu-open .display-menu-button {
  background: rgba(30, 41, 59, 0.92);
}

.display-status-group {
  gap: 0.75rem;
}

.display-canvas-screen,
#display-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
}

.display-sidebar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  width: min(20rem, 22vw);
  min-width: 13.75rem;
  display: grid;
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  overflow: hidden;
  pointer-events: none;
}

.display-sidebar-card {
  pointer-events: auto;
  min-height: 0;
  padding: 0.9rem;
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.display-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.display-player-heading,
.display-player-header,
.display-player-name,
.display-join-card {
  display: flex;
  align-items: center;
}

.display-player-heading,
.display-player-header {
  justify-content: space-between;
}

.display-player-name {
  gap: 0.55rem;
  min-width: 0;
}

.display-player-list {
  display: grid;
  flex: 1 1 auto;
  gap: 0.65rem;
  margin-top: 0.45rem;
  min-height: 0;
  overflow: auto;
}

.display-player-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.display-player-card {
  padding: 0.75rem;
  border-radius: 0.9rem;
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.display-player-score {
  color: var(--text);
}

.display-player-accuracy,
.display-player-empty {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.display-join-card {
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  gap: 0.7rem;
  text-align: center;
}

.display-join-meta {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
}

.display-join-actions {
  display: grid;
  width: 100%;
  gap: 0.55rem;
}

.display-local-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  padding: 0.05rem 0;
}

.display-local-status-label {
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  text-align: left;
}

.display-pointer-inline {
  width: auto;
  margin-top: 0;
  flex: 0 0 auto;
}

.preview-stage {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #020617;
}

#camera-video,
#preview-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#camera-video {
  object-fit: cover;
  z-index: 1;
}

#preview-overlay {
  pointer-events: none;
  z-index: 2;
}

.preview-reticle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.9rem;
  height: 2.9rem;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, 0.98);
  border-radius: 999px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.75),
    0 0 16px rgba(15, 23, 42, 0.55);
  pointer-events: none;
  z-index: 3;
}

.preview-reticle::before,
.preview-reticle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(255, 255, 255, 0.98);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.75);
}

.preview-reticle::before {
  width: 2px;
  height: 3.7rem;
}

.preview-reticle::after {
  width: 3.7rem;
  height: 2px;
}

.status-list {
  margin-top: 1rem;
}

.status-list {
  display: grid;
  gap: 0.75rem;
}

.status-row {
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
}

.room-form {
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0 1rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.fire-button {
  background: linear-gradient(135deg, #fb7185, #f97316);
  color: white;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 18px 40px rgba(249, 115, 22, 0.28);
}

.fire-button:disabled {
  opacity: 0.45;
  box-shadow: none;
}

.shot-feedback {
  min-height: 1.5rem;
  margin: 1rem 0 0;
  color: var(--muted);
}

.gun-join-screen,
.gun-play-screen {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.gun-join-screen {
  display: grid;
  grid-template-areas:
    "preview"
    "status"
    "feedback"
    "bottom";
  grid-template-rows: auto auto auto auto;
  align-content: start;
  gap: 0.9rem;
  padding:
    max(1rem, env(safe-area-inset-top))
    1rem
    max(3.2rem, calc(env(safe-area-inset-bottom) + 2.2rem));
}

.gun-join-card {
  width: min(100%, 32rem);
  text-align: center;
}

.gun-join-scanner-stage {
  grid-area: preview;
}

#join-camera-video,
#join-scan-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#join-camera-video {
  object-fit: cover;
}

#join-scan-overlay {
  pointer-events: none;
}

.gun-join-status,
.gun-join-feedback {
  margin-top: 1rem;
}

.gun-join-statusbar {
  grid-area: status;
}

.gun-join-hint {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.gun-play-screen {
  position: fixed;
  inset: 0;
  display: none;
  padding:
    max(1rem, env(safe-area-inset-top))
    1rem
    max(2.25rem, calc(env(safe-area-inset-bottom) + 1.5rem));
  background: linear-gradient(180deg, #020617, #000000 65%);
}

.gun-play-feedback {
  margin: 0;
  text-align: center;
  font-size: 0.85rem;
  min-height: 1.5rem;
}

.gun-join-feedback {
  grid-area: feedback;
}

.gun-page.is-playing .gun-join-screen {
  display: none;
}

.gun-page.is-playing .gun-play-screen {
  display: grid;
  grid-template-areas:
    "preview"
    "fire"
    "bottom"
    "status";
  grid-template-rows: 1fr auto auto auto;
  align-content: stretch;
  gap: 0.55rem;
}

.gun-play-status {
  grid-area: status;
  display: block;
  min-height: 0;
  margin-top: auto;
}

.gun-play-status .status-pill {
  padding: 0 0.8rem;
}

.gun-debug-pill {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  overflow: hidden;
  font-size: 0.82rem;
  gap: 0.4rem;
}

#aim-label {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gun-debug-room,
#play-shot-feedback {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gun-debug-room {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #cbd5e1;
  flex: 0 0 auto;
}

.gun-debug-separator {
  color: rgba(148, 163, 184, 0.7);
}

#play-shot-feedback {
  color: #cbd5e1;
  max-width: 34%;
  text-align: right;
}

.gun-preview-stage {
  grid-area: preview;
  align-self: center;
  width: min(100%, calc(100dvh - 16rem));
  max-width: calc(100dvh - 16rem);
  justify-self: center;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow);
}

.gun-fire-slot {
  grid-area: fire;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(5.4rem, 14vh, 7.4rem);
}

.gun-bottom-bar {
  grid-area: bottom;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.gun-join-bottom-bar {
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.55rem;
}

.gun-room-input {
  width: min(16rem, calc(100vw - 8.5rem));
  max-width: 100%;
}

.gun-join-button {
  min-width: 5rem;
  min-height: 2.4rem;
  padding: 0 0.9rem;
  font-size: 0.9rem;
}

.gun-join-bottom-bar .gun-room-input {
  width: min(12rem, calc(100vw - 7.8rem));
  min-height: 2.4rem;
  padding: 0 0.8rem;
  font-size: 0.9rem;
}

.gun-live-controls {
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  align-self: end;
}

.gun-secondary-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.gun-small-pill {
  min-height: 2rem;
  padding: 0 0.7rem;
  font-size: 0.78rem;
  gap: 0.5rem;
}

.gun-auto-pill,
.gun-voice-pill {
  gap: 0.7rem;
  cursor: pointer;
}

.gun-auto-pill input,
.gun-voice-pill input {
  width: 1.1rem;
  height: 1.1rem;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}

.gun-voice-status {
  min-width: 5.4rem;
  justify-content: center;
}

.gun-fire-button {
  width: 6.4rem;
  height: 6.4rem;
  min-height: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow:
    0 18px 40px rgba(249, 115, 22, 0.28),
    0 0 0 6px rgba(255, 255, 255, 0.06);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition:
    transform 90ms ease,
    box-shadow 90ms ease,
    filter 90ms ease;
}

.gun-fire-button.is-firing,
.gun-fire-button:active {
  transform: translateY(2px) scale(0.96);
  box-shadow:
    0 8px 18px rgba(249, 115, 22, 0.26),
    inset 0 4px 14px rgba(255, 255, 255, 0.22),
    0 0 0 4px rgba(255, 255, 255, 0.08);
  filter: saturate(1.12) brightness(1.06);
}

.gun-exit-button {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.84);
  color: var(--text);
  min-width: 4.8rem;
}

.gun-exit-button:hover {
  background: rgba(30, 41, 59, 0.96);
}

.gun-fire-button.is-pressed {
  transform: scale(0.96);
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.18),
    0 10px 24px rgba(248, 113, 113, 0.28);
}

.gun-play-screen,
.gun-play-status,
.gun-live-controls,
.gun-secondary-controls,
.gun-live-controls button,
.gun-live-controls label {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

@media (max-width: 900px) {
  .qr-card {
    margin-left: 0;
  }

  .display-game-hud {
    max-width: calc(100vw - 2rem);
  }

  .display-sidebar {
    width: min(15.5rem, calc(100vw - 2rem));
    min-width: 0;
  }

  .gun-play-status {
    min-height: 0;
  }

  .gun-preview-stage {
    width: 100%;
    max-width: min(100%, calc(100dvh - 14rem));
  }

  .gun-fire-slot {
    min-height: clamp(4.8rem, 11vh, 6.4rem);
  }

  .gun-debug-pill {
    font-size: 0.74rem;
    gap: 0.3rem;
  }

  #play-shot-feedback {
    max-width: 26%;
  }

  .gun-room-input {
    width: 100%;
  }

  .gun-join-bottom-bar {
    flex-wrap: nowrap;
  }

  .gun-join-bottom-bar .gun-room-input {
    width: min(10.75rem, calc(100vw - 7rem));
  }

  .gun-secondary-controls {
    width: 100%;
  }

  .gun-small-pill {
    flex: 1 1 auto;
    justify-content: center;
  }
}

@media (max-width: 430px), (max-height: 780px) {
  .gun-play-screen {
    padding:
      max(0.7rem, env(safe-area-inset-top))
      0.75rem
      max(1.4rem, calc(env(safe-area-inset-bottom) + 0.95rem));
    gap: 0.55rem;
  }

  .gun-preview-stage {
    max-width: min(100%, calc(100dvh - 13.5rem));
  }

  .gun-fire-slot {
    min-height: clamp(4.2rem, 9vh, 5.6rem);
  }

  .gun-live-controls {
    gap: 0.45rem;
  }

  .gun-fire-button {
    width: 5.5rem;
    height: 5.5rem;
    font-size: 1.05rem;
  }

  .gun-small-pill {
    min-height: 1.85rem;
    padding: 0 0.62rem;
    font-size: 0.74rem;
  }

  .gun-debug-pill {
    font-size: 0.72rem;
    gap: 0.25rem;
    padding: 0 0.65rem;
  }

  #play-shot-feedback {
    max-width: 22%;
  }
}

.display-arcade-layout {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.14), transparent 28%),
    radial-gradient(circle at bottom, rgba(34, 211, 238, 0.12), transparent 24%),
    linear-gradient(180deg, #020617 0%, #020b17 46%, #01040d 100%);
}

.display-canvas-shell {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.display-canvas-stage {
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.display-marker-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.display-holo-panel {
  position: absolute;
  z-index: 4;
  border: 1px solid rgba(148, 255, 248, 0.18);
  background:
    linear-gradient(180deg, rgba(5, 12, 26, 0.82), rgba(2, 6, 23, 0.62)),
    rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(14px);
  box-shadow:
    0 20px 50px rgba(2, 6, 23, 0.5),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition:
    opacity 180ms ease,
    transform 220ms ease,
    filter 180ms ease;
}

.display-top-panel {
  top: clamp(4.75rem, 10vh, 6rem);
  left: 1rem;
  right: 18rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 1.2rem;
}

.display-brand-stack {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.display-top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.display-panel-title {
  margin: 0;
  font-size: clamp(2rem, 2.8vw, 3rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f8fdff;
  text-shadow: 0 0 18px rgba(34, 211, 238, 0.2);
}

.display-panel-copy {
  margin: 0;
  max-width: 34rem;
  color: #c3d9e9;
}

.display-audio-button {
  min-height: 2.35rem;
  padding: 0 0.95rem;
  background: rgba(8, 17, 34, 0.82);
  border-color: rgba(148, 255, 248, 0.2);
}

.display-connection-pill,
.display-room-chip {
  border: 1px solid rgba(148, 255, 248, 0.14);
  background: rgba(5, 12, 26, 0.82);
  color: #dffcff;
}

.display-player-ribbon {
  left: 1rem;
  right: 18rem;
  bottom: clamp(4.75rem, 10vh, 6rem);
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 1.2rem;
}

.display-ribbon-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.display-player-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0;
  overflow: visible;
}

.player-card {
  display: grid;
  gap: 0.18rem;
  min-width: 11rem;
  padding: 0.7rem 0.9rem;
  border-radius: 1rem;
  background: rgba(4, 12, 24, 0.7);
  border: 1px solid rgba(148, 255, 248, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.player-card strong {
  color: #f8fdff;
  letter-spacing: 0.04em;
}

.player-card span {
  font-size: 0.78rem;
  line-height: 1.25;
  color: #9ec5d9;
}

.player-card.active {
  border-color: rgba(34, 211, 238, 0.62);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.2),
    0 0 22px rgba(34, 211, 238, 0.16);
}

.player-card.winner {
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.16),
    0 0 24px rgba(250, 204, 21, 0.14);
}

.display-sidebar {
  right: 1rem;
  top: 50%;
  width: 16rem;
  height: min(21rem, 54vh);
  position: absolute;
  z-index: 4;
  display: block;
  padding: 0;
  pointer-events: none;
  transform: translateY(-50%);
}

.display-page:not(.display-shell-visible) .display-top-panel,
.display-page:not(.display-shell-visible) .display-player-ribbon,
.display-page:not(.display-shell-visible) .display-sidebar {
  opacity: 0;
  pointer-events: none;
  filter: blur(8px);
}

.display-page:not(.display-shell-visible) .display-top-panel {
  transform: translateY(-1.5rem);
}

.display-page:not(.display-shell-visible) .display-player-ribbon {
  transform: translateY(1.5rem);
}

.display-page:not(.display-shell-visible) .display-sidebar {
  transform: translateY(-50%) translateX(1.5rem);
}

.display-join-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  display: grid;
  align-content: end;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 1.2rem;
  text-align: center;
  pointer-events: auto;
}

.display-join-actions {
  display: grid;
  gap: 0.55rem;
}

.display-join-core {
  display: grid;
  gap: 0.65rem;
  justify-items: center;
}

.display-join-dock canvas {
  width: 124px;
  height: 124px;
}

.display-join-meta {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
}

.display-join-copy {
  color: #c3d9e9;
  font-size: 0.82rem;
}

.display-local-status {
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 1180px) {
  .display-top-panel,
  .display-player-ribbon {
    right: 15rem;
  }

  .display-sidebar {
    width: 13rem;
  }
}

@media (max-width: 900px) {
  .display-top-panel {
    top: 1rem;
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .display-player-ribbon {
    bottom: 13.75rem;
    right: 1rem;
  }

  .display-sidebar {
    top: auto;
    left: 1rem;
    right: 1rem;
    width: auto;
    height: auto;
    bottom: 1rem;
    transform: none;
  }

  .display-page:not(.display-shell-visible) .display-sidebar {
    transform: translateY(1rem);
  }

  .display-join-core {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .display-top-panel,
  .display-player-ribbon,
  .display-sidebar {
    left: 0.75rem;
    right: 0.75rem;
  }

  .display-panel-title {
    font-size: 1.5rem;
  }

  .player-card {
    min-width: min(100%, 9.8rem);
  }
}
