:root {
  --bg-deep: #050811;
  --bg-panel: rgba(13, 20, 38, 0.78);
  --border-glass: rgba(110, 175, 255, 0.22);
  --neon-cyan: #00e5ff;
  --neon-blue: #3b82f6;
  --neon-pink: #ff3b8b;
  --neon-green: #4ade80;
  --text-main: #f1f5f9;
  --text-dim: #94a3b8;
  --font-ui: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 229, 255, 0.12), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(59, 130, 246, 0.16), transparent 45%),
    var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-ui);
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hud-bar,
.stage-wrap {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

button,
input[type="range"] {
  touch-action: manipulation;
}
.hud-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--bg-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff, var(--neon-cyan));
  box-shadow: 0 0 16px var(--neon-cyan);
}

.hud-brand h1 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-2027 {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 229, 255, 0.4);
}

.subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  padding: 5px 11px;
  display: flex;
  flex-direction: column;
  min-width: 72px;
}

.stat-label {
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.stat-value.hp {
  color: var(--neon-pink);
}

.stat-value.ammo {
  color: #fbbf24;
}

.stat-value.shield {
  color: var(--neon-cyan);
}

.stat-value.mine {
  color: #fb923c;
}

.kill-feed {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.kill-item {
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(5, 8, 17, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-main);
}

.time-pill {
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.08);
  min-width: 88px;
}

.time-value {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.final-counter {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 112px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(8, 18, 38, 0.88);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(0, 229, 255, 0.65);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.25);
  pointer-events: none;
}

.final-counter.urgent {
  border-color: rgba(255, 59, 139, 0.8);
  box-shadow: 0 0 28px rgba(255, 59, 139, 0.35);
}

.fc-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
}

.final-counter.urgent .fc-label {
  color: #ff8ab8;
}

.fc-number {
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
}

.showdown-banner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.14) 0%, transparent 65%);
  animation: showdownPop 0.35s ease-out;
}

.showdown-title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ffffff;
  text-shadow: 0 0 28px rgba(0, 229, 255, 0.85), 0 0 56px rgba(255, 59, 139, 0.65);
}

.showdown-sub {
  margin-top: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(8, 18, 38, 0.82);
  border: 1px solid rgba(0, 229, 255, 0.45);
  color: var(--neon-cyan);
  font-size: 0.98rem;
  font-weight: 700;
}

@keyframes showdownPop {
  from { opacity: 0; transform: scale(1.25); }
  to { opacity: 1; transform: scale(1); }
}

.hud-actions {
  display: flex;
  gap: 8px;
}

.btn-glass {
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(0, 229, 255, 0.5);
}

.btn-glass.btn-danger:hover {
  border-color: rgba(255, 59, 139, 0.6);
  color: #ff8ab8;
}

/* Stage */
.stage-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.canvas-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  background: #070b14;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

/* Mobile Twin-Stick Touch Controls */
.touch-controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
  touch-action: none;
  z-index: 15;
}

.touch-zone-left {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
}

.touch-zone-right {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
}

.joy-base {
  position: absolute;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  margin-top: -48px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.12);
  border: 2px solid rgba(0, 229, 255, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.joy-base.aim {
  background: rgba(255, 59, 139, 0.12);
  border-color: rgba(255, 59, 139, 0.5);
}

.joy-knob {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.65);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.6);
}

.joy-knob.aim {
  background: rgba(255, 59, 139, 0.72);
  box-shadow: 0 0 14px rgba(255, 59, 139, 0.65);
}

.touch-action-btn {
  position: absolute;
  right: 16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(13, 21, 40, 0.78);
  color: #ffffff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
}

.touch-action-btn.shield-btn {
  bottom: 24px;
  right: 22px;
  width: 68px;
  height: 68px;
  font-size: 1.55rem;
  border-color: rgba(0, 229, 255, 0.75);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.25);
}

.touch-action-btn.shield-btn.active {
  background: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.7);
}

.touch-action-btn.mine-btn {
  bottom: 102px;
  right: 26px;
  width: 52px;
  height: 52px;
  font-size: 1.2rem;
  border-color: rgba(251, 146, 60, 0.7);
}

.touch-action-btn.dash-btn {
  bottom: 30px;
  right: 104px;
  width: 54px;
  height: 54px;
  font-size: 1.2rem;
  border-color: rgba(163, 230, 53, 0.7);
}

.touch-action-btn.mine-btn span {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fb923c;
  color: #050811;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wait-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(10, 15, 30, 0.86);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 59, 139, 0.45);
  font-size: 0.84rem;
  pointer-events: none;
}

.wait-banner strong {
  display: block;
  color: #ff7eb3;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.wait-banner span {
  color: var(--text-dim);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 12px var(--neon-pink);
  animation: pulse 1.2s infinite;
}

.pulse-dot.cyan {
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan);
}

.reveal-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  border-radius: 12px;
  background: rgba(8, 22, 42, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 229, 255, 0.55);
  font-size: 0.84rem;
  pointer-events: none;
}

.reveal-banner strong {
  display: block;
  color: var(--neon-cyan);
  font-size: 0.82rem;
  letter-spacing: 0.05em;
}

.reveal-banner span {
  color: var(--text-dim);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.round-banner {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 17, 0.68);
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  pointer-events: none;
}

.round-banner h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: var(--neon-cyan);
  text-shadow: 0 0 24px rgba(0, 229, 255, 0.5);
}

.round-banner p {
  margin: 0;
  color: var(--text-main);
  font-size: 1rem;
}

.controls-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
}

kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.76rem;
  color: var(--text-main);
}

/* Overlays & Cards */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 40;
}

.login-layout {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 920px;
  flex-wrap: wrap;
  margin: auto;
}

@media (max-width: 760px) {
  .app-shell {
    height: 100dvh;
    padding: 6px;
    gap: 6px;
    overflow: hidden;
  }

  .hud-bar {
    padding: 6px 8px;
    gap: 5px;
    border-radius: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .hud-brand {
    display: none;
  }

  .hud-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
  }

  #hud-map-pill {
    display: none;
  }

  .stat-pill {
    padding: 3px 4px;
    min-width: 0;
    border-radius: 7px;
    align-items: center;
    text-align: center;
  }

  .stat-label {
    font-size: 0.5rem;
    letter-spacing: 0.03em;
  }

  .stat-value {
    font-size: 0.74rem;
  }

  .time-pill {
    min-width: 0;
  }

  .time-value {
    font-size: 0.82rem;
  }

  .hud-actions {
    gap: 6px;
    justify-content: flex-end;
  }

  .hud-actions .btn-glass {
    padding: 4px 10px;
    font-size: 0.72rem;
  }

  .stage-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .canvas-frame {
    flex: 1;
    min-height: 0;
    border-radius: 12px;
  }

  #game-canvas {
    width: 100%;
    height: 100%;
  }

  .wait-banner {
    top: auto;
    bottom: 10px;
    left: 10px;
    transform: none;
    padding: 6px 10px;
    font-size: 0.7rem;
    max-width: calc(100% - 90px);
  }

  .final-counter {
    top: 8px;
    right: 124px;
    min-width: 74px;
    padding: 5px 8px;
  }

  .fc-number {
    font-size: 1.4rem;
  }

  .overlay {
    padding: 10px;
  }

  .glass-card {
    padding: 16px 14px;
  }

  .modal-top {
    flex-direction: column;
    gap: 10px;
  }

  .leaderboard-card {
    width: 100%;
    padding: 14px 10px;
  }

  .leaderboard-card h2 {
    font-size: 1.15rem;
  }

  .col-desktop,
  .lbl-full {
    display: none;
  }

  .lbl-short {
    display: inline;
  }

  table {
    font-size: 0.76rem;
  }

  th,
  td {
    padding: 7px 4px;
  }

  .table-wrap {
    overflow-x: hidden;
  }

  .login-layout {
    gap: 14px;
  }

  .guide-card {
    max-width: 460px;
  }
}

.lobby-card {
  width: min(980px, 96vw);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.lobby-col h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--neon-cyan);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.empty-rooms {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.waiting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--neon-cyan);
  font-size: 0.85rem;
  font-weight: 700;
}

  .hero-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.hero-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(59, 130, 246, 0.35));
  border: 1.5px solid rgba(0, 229, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.28);
  flex-shrink: 0;
}

.hero-title {
  margin: 0 !important;
  font-size: 2rem !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 15%, #00e5ff 60%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--neon-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.nick-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nick-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  opacity: 0.75;
  pointer-events: none;
}

.nick-input-wrap input[type="text"] {
  padding-left: 36px;
  padding-right: 44px;
  border-color: rgba(0, 229, 255, 0.28);
  background: rgba(5, 10, 22, 0.75);
  font-weight: 600;
}

.btn-random-name {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-random-name:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--neon-cyan);
}

.btn-random-name:active {
  transform: scale(0.92);
}

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

.podium-slot {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.podium-slot.first {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(251, 191, 36, 0.12);
}

.podium-medal {
  font-size: 1.25rem;
}

.podium-name {
  font-weight: 800;
  font-size: 0.92rem;
  margin: 2px 0;
}

.podium-pts {
  font-size: 0.78rem;
  color: #fbbf24;
  font-weight: 700;
}

.guide-card {
  width: 100%;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.guide-card h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.guide-card h4 {
  margin: 0 0 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.guide-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-keys {
  color: var(--text-main);
  font-weight: 600;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.guide-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 16px 0;
}

.item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.item-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.76rem;
  white-space: nowrap;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 6px 8px;
}

.chip-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.chip-badge.ammo { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border: 1px solid #fbbf24; }
.chip-badge.shield { background: rgba(0, 229, 255, 0.2); color: #00e5ff; border: 1px solid #00e5ff; }
.chip-badge.heart { background: rgba(255, 59, 139, 0.22); color: #ff3b8b; border: 1px solid #ff3b8b; }
.chip-badge.mine { background: rgba(251, 146, 60, 0.2); color: #fb923c; border: 1px solid #fb923c; }
.chip-badge.speed { background: rgba(163, 230, 53, 0.2); color: #a3e635; border: 1px solid #a3e635; }
.chip-badge.crate { background: rgba(92, 58, 30, 0.55); color: #fbbf24; border: 1px solid #fbbf24; }

.guide-tip {
  margin: 0;
  padding: 12px 13px;
  border-radius: 12px;
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.24);
  font-size: 0.79rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.guide-tip-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neon-cyan);
  margin-bottom: 8px;
}

.rules-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rules-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 6px;
  align-items: start;
}

.glass-card {
  background: rgba(13, 21, 40, 0.92);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.login-card {
  width: 100%;
  max-width: 460px;
}

.lobby-card {
  width: min(980px, 96vw);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
}

.lobby-col h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: var(--neon-cyan);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.empty-rooms {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 0.85rem;
}

.waiting-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.members-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.member-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--neon-cyan);
  font-size: 0.85rem;
  font-weight: 700;
}

.leaderboard-card {
  width: min(1080px, 96vw);
  max-width: 1080px;
  max-height: 88vh;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--neon-cyan);
  margin-bottom: 6px;
}

.glass-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.card-desc {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: #cbd5e1;
}

.form-row input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 8, 17, 0.65);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-row input[type="text"]:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.18);
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.color-swatch {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: radial-gradient(circle at 35% 35%, #ffffff, var(--swatch) 55%, #000000 120%);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.color-swatch.active {
  transform: scale(1.14);
  border-color: #ffffff;
  box-shadow: 0 0 14px var(--swatch);
}

.skin-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.skin-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.skin-preview {
  width: 34px;
  height: 34px;
  display: block;
}

.skin-btn.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.14);
  color: #ffffff;
}

.range-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.range-header label {
  margin-bottom: 0;
}

.range-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--neon-cyan);
  cursor: pointer;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  cursor: pointer;
  font-family: inherit;
}

.mode-btn strong {
  display: block;
  font-size: 0.84rem;
}

.mode-btn span {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.mode-btn.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.1);
}

.error-msg {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 59, 139, 0.14);
  border: 1px solid rgba(255, 59, 139, 0.4);
  color: #ff9ec5;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.btn-neon {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #00e5ff, #2563eb);
  color: #030712;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 229, 255, 0.3);
  transition: transform 0.1s ease, filter 0.15s ease;
}

.btn-neon:hover {
  filter: brightness(1.08);
}

.btn-neon:active {
  transform: translateY(1px);
}

/* Table */
.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.points-legend {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.points-legend strong {
  color: var(--neon-cyan);
}

.points-cell {
  font-weight: 800;
  color: #fbbf24;
}

.hero-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.hero-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.22), rgba(59, 130, 246, 0.35));
  border: 1.5px solid rgba(0, 229, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.28);
  flex-shrink: 0;
}

.hero-title {
  margin: 0 !important;
  font-size: 2rem !important;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 15%, #00e5ff 60%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-tagline {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--neon-cyan);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.nick-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.nick-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  opacity: 0.75;
  pointer-events: none;
}

.nick-input-wrap input[type="text"] {
  padding-left: 36px;
  padding-right: 44px;
  border-color: rgba(0, 229, 255, 0.28);
  background: rgba(5, 10, 22, 0.75);
  font-weight: 600;
}

.btn-random-name {
  position: absolute;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn-random-name:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--neon-cyan);
}

.btn-random-name:active {
  transform: scale(0.92);
}

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

.podium-slot {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.podium-slot.first {
  border-color: rgba(251, 191, 36, 0.65);
  background: rgba(251, 191, 36, 0.12);
}

.podium-medal {
  font-size: 1.25rem;
}

.podium-name {
  font-weight: 800;
  font-size: 0.92rem;
  margin: 2px 0;
}

.podium-pts {
  font-size: 0.78rem;
  color: #fbbf24;
  font-weight: 700;
}

.table-wrap {
  overflow-y: auto;
  overflow-x: hidden;
}

.lbl-short {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.status-alive {
  background: rgba(74, 222, 128, 0.15);
  color: var(--neon-green);
}

.status-wait {
  background: rgba(255, 59, 139, 0.15);
  color: #ff8ab8;
}

tr.row-me {
  background: rgba(0, 229, 255, 0.13);
  box-shadow: inset 3px 0 0 var(--neon-cyan);
}

.me-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: var(--neon-cyan);
  color: #030712;
  vertical-align: middle;
}

.hof-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.hof-tab {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hof-tab:hover {
  border-color: rgba(0, 229, 255, 0.45);
  color: var(--text-main);
}

.hof-tab.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 229, 255, 0.15);
  color: #ffffff;
}

.pwa-banner {
  margin-bottom: 16px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(59, 130, 246, 0.12));
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.1);
}

.pwa-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pwa-banner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.82rem;
}

.pwa-badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
}

.pwa-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pwa {
  padding: 7px 12px;
  border-radius: 9px;
  border: none;
  background: linear-gradient(135deg, #00e5ff, #3b82f6);
  color: #030712;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn-pwa:hover {
  filter: brightness(1.1);
}

.btn-pwa-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-pwa-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.pwa-hint {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: #bae6fd;
  line-height: 1.4;
}

.aim-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(0, 229, 255, 0.07);
  font-size: 0.8rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.aim-toggle input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--neon-cyan);
  cursor: pointer;
  flex-shrink: 0;
}

/* Automatische Hochkant- / Querformat-Erkennung für iPad, Tablet & Handy */
@media (max-width: 1180px), (max-height: 850px), (pointer: coarse) {
  html,
  body {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    padding: 6px;
    gap: 6px;
    overflow: hidden;
  }

  .stage-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .canvas-frame {
    flex: 1;
    min-height: 0;
  }

  #game-canvas {
    width: 100%;
    height: 100%;
  }
}

@media (orientation: landscape) and (max-height: 860px), (orientation: landscape) and (pointer: coarse) {
  .app-shell {
    padding: 6px 10px;
    gap: 6px;
  }

  .hud-bar {
    padding: 5px 10px;
    gap: 8px;
    border-radius: 12px;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
  }

  .hud-brand,
  #hud-map-pill {
    display: none;
  }

  .hud-stats {
    display: flex;
    flex: 1;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .stat-pill {
    padding: 3px 7px;
    min-width: 0;
    border-radius: 8px;
    align-items: center;
    text-align: center;
    flex: 1;
  }

  .stat-label {
    font-size: 0.52rem;
  }

  .stat-value {
    font-size: 0.78rem;
  }

  .time-value {
    font-size: 0.88rem;
  }

  .hud-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .hud-actions .btn-glass {
    padding: 5px 10px;
    font-size: 0.74rem;
  }

  .overlay {
    padding: 10px;
    justify-content: flex-start;
  }

  .login-layout {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 12px;
    margin: 0 auto;
  }

  .login-card,
  .guide-card {
    max-width: 48%;
    padding: 16px;
  }

  .lobby-card,
  .leaderboard-card {
    max-height: 94dvh;
    overflow-y: auto;
    padding: 14px;
  }
}

@media (orientation: portrait) and (max-width: 1024px) {
  .hud-bar {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .hud-brand,
  #hud-map-pill {
    display: none;
  }

  .hud-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
  }

  .stat-pill {
    padding: 3px 4px;
    min-width: 0;
    border-radius: 7px;
    align-items: center;
    text-align: center;
  }

  .stat-label {
    font-size: 0.5rem;
  }

  .stat-value {
    font-size: 0.74rem;
  }

  .login-layout {
    flex-direction: column;
    align-items: center;
  }
}
