:root {
  --bg-main: #090712;
  --bg-card: #131022;
  --bg-card-2: #1a1630;
  --bg-hover: #231d42;
  --border: rgba(139, 92, 246, 0.22);
  --border-strong: rgba(139, 92, 246, 0.48);
  --text-main: #f4f2ff;
  --text-muted: #9b95b8;
  --accent: #8b5cf6;
  --accent-bright: #a78bfa;
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --pink: #ec4899;
  --red: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background: radial-gradient(circle at 20% 0%, #1b1236 0%, var(--bg-main) 55%);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: transparent;
}

.hidden {
  display: none !important;
}

/* ============================================================================
   TOPBAR
   ============================================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(11, 8, 22, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

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

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #22c55e, #8b5cf6);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: -0.5px;
  color: #fff;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.45);
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.pill-live {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

.pill-offline {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse 1.6s infinite;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-ghost {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.btn-green {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #04130a;
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.35);
}

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

.btn-amber {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #1c1100;
}

.btn-pink {
  background: linear-gradient(135deg, #db2777, #ec4899);
  color: #fff;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.32);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

/* ============================================================================
   MAIN CONTAINER
   ============================================================================ */
.container {
  max-width: 1520px;
  margin: 0 auto;
  padding: 18px 20px 44px;
}

.event-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.event-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tag-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid var(--border-strong);
  color: var(--accent-bright);
  text-transform: none;
}

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

/* ============================================================================
   PLAYER COLUMN
   ============================================================================ */
.player-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.player-card.you-are-playing {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25), 0 18px 50px rgba(34, 197, 94, 0.15);
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #05040a;
  overflow: hidden;
  user-select: none;
}

#webrtc-video,
#spectator-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  border: none;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: radial-gradient(circle at center, #1b1436, #07050f);
  text-align: center;
  padding: 24px;
  z-index: 4;
}

.video-placeholder h3 {
  font-size: 20px;
  font-weight: 800;
}

.video-placeholder p {
  color: var(--text-muted);
  font-size: 13px;
  max-width: 440px;
  line-height: 1.5;
}

/* HUD Overlays */
.hud-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.hud-watermark {
  background: rgba(9, 7, 18, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.hud-playing-banner {
  background: rgba(22, 163, 74, 0.92);
  color: #031509;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.4px;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.6);
}

.hud-top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(11, 9, 22, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}

.hud-player-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
}

.hud-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.hud-player-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  max-width: 135px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-timer {
  font-size: 19px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #4ade80;
}

#controller-overlay-mount {
  width: 118px;
  height: 76px;
  flex-shrink: 0;
}

/* Floating Player Controls */
.player-controls-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.player-controls-group {
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  flex-wrap: wrap;
}

.ctrl-chip {
  background: rgba(11, 9, 22, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctrl-chip:hover {
  background: rgba(139, 92, 246, 0.42);
}

.ctrl-chip.active {
  background: rgba(34, 197, 94, 0.25);
  border-color: rgba(34, 197, 94, 0.65);
  color: #86efac;
}

/* Ready Check Overlay */
.ready-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  background: rgba(7, 5, 16, 0.86);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 20px;
}

.ready-overlay h2 {
  font-size: 28px;
  font-weight: 900;
  color: #4ade80;
}

.ready-countdown {
  font-size: 46px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
}

/* Touch Gamepad Overlay */
.touch-pad {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  touch-action: none;
  user-select: none;
}

.touch-shoulder-row {
  position: absolute;
  top: 52px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.touch-shoulder-group {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.touch-bottom-left {
  position: absolute;
  left: 18px;
  bottom: 58px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  pointer-events: auto;
}

.touch-bottom-right {
  position: absolute;
  right: 18px;
  bottom: 58px;
  pointer-events: auto;
}

.touch-center-row {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.tbtn {
  background: rgba(15, 12, 32, 0.68);
  border: 2px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-weight: 800;
  display: grid;
  place-items: center;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.06s, background 0.06s;
}

.tbtn.pressed {
  background: rgba(139, 92, 246, 0.85);
  border-color: #fff;
  transform: scale(0.93);
}

.tbtn-pill {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
}

.dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
}

.dpad-grid .tbtn {
  border-radius: 10px;
  font-size: 16px;
}

.abxy-grid {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 4px;
}

.abxy-grid .tbtn {
  border-radius: 50%;
  font-size: 16px;
}

.tbtn-a { border-color: rgba(34, 197, 94, 0.8); color: #86efac; }
.tbtn-b { border-color: rgba(239, 68, 68, 0.8); color: #fca5a5; }
.tbtn-x { border-color: rgba(59, 130, 246, 0.8); color: #93c5fd; }
.tbtn-y { border-color: rgba(234, 179, 8, 0.8); color: #fde047; }

.stick-zone {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: rgba(15, 12, 32, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.25);
  position: relative;
  touch-action: none;
}

.stick-knob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.85);
  border: 2px solid #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Player Footer Info Bar */
.player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(10, 8, 20, 0.9);
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.footer-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.footer-metric span {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.footer-metric strong {
  font-size: 14px;
  font-weight: 800;
}

/* ============================================================================
   SIDEBAR (FILA + CHAT + CONTROLES)
   ============================================================================ */
.sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.queue-banner {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(236, 72, 153, 0.12));
  border-bottom: 1px solid var(--border);
}

.queue-banner-pos {
  font-size: 17px;
  font-weight: 900;
}

.queue-banner-est {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px 12px;
  background: rgba(9, 7, 18, 0.55);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.tab-btn.active {
  background: var(--bg-card-2);
  color: #fff;
  border: 1px solid var(--border-strong);
}

.tab-panel {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
}

.priority-box {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.11), rgba(245, 158, 11, 0.04));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.priority-box-title {
  font-size: 13px;
  font-weight: 800;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
}

.priority-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tier-chip {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 8px;
  padding: 7px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}

.tier-chip span:last-child {
  color: #fbbf24;
}

.queue-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.queue-filter-btn {
  padding: 7px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.queue-filter-btn.active {
  background: rgba(139, 92, 246, 0.25);
  border-color: var(--accent);
  color: #fff;
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 235px;
  overflow-y: auto;
  padding-right: 4px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-card-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.queue-item.is-me {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.queue-item-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.queue-pos {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: rgba(139, 92, 246, 0.22);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.queue-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Chat */
.chat-messages {
  height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.chat-msg {
  font-size: 13px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 9px;
  padding: 7px 10px;
  word-break: break-word;
}

.chat-msg.system {
  background: rgba(139, 92, 246, 0.14);
  border-left: 3px solid var(--accent);
  color: #ddd6fe;
  font-size: 12px;
}

.chat-author {
  font-weight: 800;
  margin-right: 6px;
  color: var(--accent-bright);
}

.chat-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  margin-right: 5px;
  text-transform: uppercase;
}

.chat-badge.playing { background: var(--green); color: #04130a; }
.chat-badge.vip { background: var(--amber); color: #1c1100; }
.chat-badge.admin { background: var(--pink); color: #fff; }
.chat-badge.pix { background: #ec4899; color: #fff; }

.chat-form {
  display: flex;
  gap: 8px;
}

.input {
  width: 100%;
  background: rgba(8, 6, 16, 0.85);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: #fff;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
}

/* ============================================================================
   COMMUNITY STATS SECTION (RODAPÉ ESTILO PRINT)
   ============================================================================ */
.community-section {
  margin-top: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.community-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.community-head h2 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.4px;
}

.community-head p {
  font-size: 13px;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(5, 1fr);
  gap: 12px;
}

.stat-card {
  background: var(--bg-card-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.stat-card.featured {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(34, 197, 94, 0.1));
  border-color: var(--border-strong);
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value {
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.stat-card.featured .stat-value {
  font-size: 38px;
  color: #4ade80;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================================
   MODALS
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 4, 12, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal {
  width: 100%;
  max-width: 470px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal.modal-wide {
  max-width: 680px;
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 800;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  cursor: pointer;
}

.qr-box {
  background: #fff;
  padding: 14px;
  border-radius: 14px;
  align-self: center;
  display: grid;
  place-items: center;
}

.qr-code-text {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  text-align: center;
  color: var(--accent-bright);
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card-2);
  border: 1px solid var(--border-strong);
  color: #fff;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.2s ease;
}

.toast.ok { border-color: var(--green); }
.toast.err { border-color: var(--red); }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.keymap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 12px;
}

.keymap-row {
  display: flex;
  justify-content: space-between;
  background: var(--bg-card-2);
  padding: 6px 9px;
  border-radius: 8px;
}

.kbd {
  background: #090712;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: monospace;
  font-weight: 700;
  color: var(--accent-bright);
}

/* ============================================================================
   RESPONSIVE (TABLET / MOBILE / TV)
   ============================================================================ */
@media (max-width: 1100px) {
  .stage-grid {
    grid-template-columns: 1fr;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-card.featured {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 14px;
  }
  .container {
    padding: 12px 10px 30px;
  }
  .hud-top-right {
    padding: 6px 8px;
    gap: 8px;
  }
  #controller-overlay-mount {
    width: 82px;
    height: 54px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}
