:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d1117;
  --bg-surface: rgba(16, 21, 30, 0.78);
  --bg-surface-elevated: rgba(22, 29, 42, 0.92);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(16, 124, 16, 0.35);
  
  --xbox-green: #107C10;
  --xbox-neon: #00ff73;
  --xbox-cyan: #00d2d3;
  --xbox-amber: #ff9f1a;
  --xbox-red: #ff4757;
  
  --text-main: #f0f3f8;
  --text-muted: #8b949e;
  --text-dim: #484f58;

  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-neon: 0 0 25px rgba(0, 255, 115, 0.25);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient dynamic background lighting */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}

.ambient-glow.top-left {
  top: -10vw;
  left: -5vw;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, rgba(16, 124, 16, 0.5) 0%, rgba(0, 255, 115, 0) 70%);
}

.ambient-glow.bottom-right {
  bottom: -15vw;
  right: -10vw;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(0, 210, 211, 0.3) 0%, rgba(7, 9, 14, 0) 70%);
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 64px 32px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
}

/* Typography utilities */
.text-mono { font-family: var(--font-mono); }
.text-emerald { color: var(--xbox-neon); }
.text-amber { color: var(--xbox-amber); }
.font-bold { font-weight: 700; }

/* HUD Header */
.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
  gap: 16px;
}

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

.xbox-orb-icon {
  width: 44px;
  height: 44px;
  color: var(--xbox-neon);
  filter: drop-shadow(0 0 12px rgba(0, 255, 115, 0.5));
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.xbox-orb-icon:hover {
  transform: scale(1.08) rotate(5deg);
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  line-height: 1.1;
}

.brand-text h1 span {
  color: var(--xbox-neon);
  text-shadow: 0 0 10px rgba(0, 255, 115, 0.4);
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0, 255, 115, 0.12);
  color: var(--xbox-neon);
  border: 1px solid rgba(0, 255, 115, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

.brand-text .subtitle {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Console Meta Bar */
.console-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  padding: 8px 18px;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.meta-value {
  font-size: 13px;
  color: #fff;
}

.meta-divider {
  width: 1px;
  height: 24px;
  background: var(--border-subtle);
}

.gamertag-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gt-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 14px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.status-indicator-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  white-space: nowrap;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

/* Online State */
.status-indicator-pill.online {
  background: rgba(0, 255, 115, 0.12);
  color: var(--xbox-neon);
  border: 1px solid rgba(0, 255, 115, 0.3);
}

.status-indicator-pill.online .pulse-dot {
  background: var(--xbox-neon);
  box-shadow: 0 0 10px var(--xbox-neon);
  animation: pulse-online 1.5s infinite;
}

/* Standby State */
.status-indicator-pill.standby {
  background: rgba(255, 159, 26, 0.12);
  color: var(--xbox-amber);
  border: 1px solid rgba(255, 159, 26, 0.3);
}

.status-indicator-pill.standby .pulse-dot {
  background: var(--xbox-amber);
  box-shadow: 0 0 8px var(--xbox-amber);
}

@keyframes pulse-online {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 115, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(0, 255, 115, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 115, 0); }
}

/* Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-btn {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #107C10 0%, #00ff73 100%);
  color: #051608;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(0, 255, 115, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 255, 115, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.btn-ghost:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-small {
  padding: 8px 14px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-subtle);
}

.btn-small:hover {
  background: rgba(0, 255, 115, 0.15);
  border-color: var(--xbox-neon);
}

/* HERO SECTION: Monolith & Active Cinema */
.hero-theater {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

/* Monolith Card */
.monolith-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.monolith-visual {
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 900px;
}

/* Stylized 3D Xbox Series X Tower */
.xbox-tower-3d {
  width: 90px;
  height: 175px;
  background: linear-gradient(135deg, #1b2028 0%, #0d1015 100%);
  border-radius: 6px;
  position: relative;
  box-shadow: 
    -12px 14px 28px rgba(0, 0, 0, 0.8),
    inset -1px 0 2px rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotateY(-18deg) rotateX(8deg);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.xbox-tower-3d:hover {
  transform: rotateY(-8deg) rotateX(4deg) translateY(-4px);
}

/* Top exhaust vent grid with breathing LED glow */
.tower-vent-glow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  background: radial-gradient(ellipse at center, rgba(0, 255, 115, 0.85) 0%, rgba(16, 124, 16, 0.4) 50%, transparent 80%);
  border-radius: 50%;
  filter: blur(4px);
  opacity: 0.3;
  transition: opacity 0.5s ease, filter 0.5s ease;
}

.xbox-tower-3d.online .tower-vent-glow {
  opacity: 1;
  filter: blur(5px);
  animation: vent-breath 3s ease-in-out infinite alternate;
}

@keyframes vent-breath {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.6; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 1; filter: blur(7px); }
}

.tower-disc-slot {
  position: absolute;
  bottom: 24px;
  left: 14px;
  width: 3px;
  height: 38px;
  background: #050608;
  border-radius: 1px;
  box-shadow: inset 0 0 2px #000;
}

.tower-power-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.xbox-tower-3d.online .tower-power-btn {
  background: #fff;
  box-shadow: 0 0 10px var(--xbox-neon);
}

.xbox-tower-3d.standby .tower-power-btn {
  background: var(--xbox-amber);
  box-shadow: 0 0 8px var(--xbox-amber);
}

.monolith-telemetry {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.telemetry-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  width: fit-content;
}

.telemetry-badge .state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
}

.telemetry-badge.online {
  background: rgba(0, 255, 115, 0.12);
  color: var(--xbox-neon);
  border: 1px solid rgba(0, 255, 115, 0.25);
}

.telemetry-badge.online .state-dot {
  background: var(--xbox-neon);
  box-shadow: 0 0 8px var(--xbox-neon);
}

.telemetry-badge.standby {
  background: rgba(255, 159, 26, 0.12);
  color: var(--xbox-amber);
  border: 1px solid rgba(255, 159, 26, 0.25);
}

.telemetry-badge.standby .state-dot {
  background: var(--xbox-amber);
}

.timer-subhead {
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.stopwatch-display {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}

.latency-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

/* Cinema Card */
.cinema-card {
  position: relative;
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 32px;
  box-shadow: var(--shadow-card);
}

.cinema-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('https://images.igdb.com/igdb/image/upload/t_1080p/scasb6.jpg');
  background-size: cover;
  background-position: center;
  filter: blur(4px) brightness(0.25);
  transform: scale(1.05);
  transition: background-image 0.6s ease;
}

.cinema-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(7, 9, 14, 0.94) 0%, rgba(7, 9, 14, 0.7) 50%, rgba(7, 9, 14, 0.88) 100%);
}

.cinema-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 32px;
  align-items: center;
  width: 100%;
}

.game-poster-wrapper {
  flex-shrink: 0;
  width: 155px;
  height: 215px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.3s ease;
}

.game-poster-wrapper:hover {
  transform: scale(1.03) translateY(-4px);
}

.game-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-info-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.pill-emerald {
  background: rgba(0, 255, 115, 0.15);
  color: var(--xbox-neon);
  border: 1px solid rgba(0, 255, 115, 0.35);
}

.pill-dark {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.pill-mono {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(0, 210, 211, 0.1);
  color: var(--xbox-cyan);
  border: 1px solid rgba(0, 210, 211, 0.25);
}

.active-game-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.game-session-stats {
  display: flex;
  gap: 24px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.session-stat-box {
  display: flex;
  flex-direction: column;
}

.stat-lbl {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.cinema-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* HUD STAT TILES */
.hud-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.hud-stat-card {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.hud-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.icon-emerald { background: rgba(0, 255, 115, 0.12); border: 1px solid rgba(0, 255, 115, 0.25); }
.icon-cyan { background: rgba(0, 210, 211, 0.12); border: 1px solid rgba(0, 210, 211, 0.25); }
.icon-amber { background: rgba(255, 159, 26, 0.12); border: 1px solid rgba(255, 159, 26, 0.25); }
.icon-fire { background: rgba(255, 71, 87, 0.12); border: 1px solid rgba(255, 71, 87, 0.25); }

.stat-data {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.stat-caption {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.stat-big-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 4px 0;
}

.stat-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin: 4px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--xbox-green), var(--xbox-neon));
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ANALYTICS LAYOUT */
.analytics-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.panel-card {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-title-group h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

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

.chart-legend {
  display: flex;
  gap: 12px;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.dot-emerald { background: var(--xbox-neon); box-shadow: 0 0 6px var(--xbox-neon); }

/* Interactive SVG Bar Chart */
.chart-container {
  height: 220px;
  width: 100%;
  position: relative;
}

.bar-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bar-col {
  transition: transform 0.2s ease;
  cursor: pointer;
}

.bar-col:hover .bar-rect {
  filter: brightness(1.25);
  stroke: #fff;
  stroke-width: 1px;
}

.bar-rect {
  rx: 4;
  fill: url(#bar-emerald-gradient);
  transition: height 0.6s ease, y 0.6s ease;
}

.bar-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
  text-anchor: middle;
}

.bar-val-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: #fff;
  font-weight: 600;
  text-anchor: middle;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bar-col:hover .bar-val-label {
  opacity: 1;
}

/* Game Distribution list in panel */
.donut-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 6px;
}

.dist-game-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dist-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.dist-title {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.dist-time {
  font-family: var(--font-mono);
  color: var(--xbox-neon);
}

.dist-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.dist-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #107C10, #00ff73);
  border-radius: 3px;
}

/* GAME VAULT SECTION */
.vault-section {
  margin-bottom: 28px;
}

.section-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.title-with-pill {
  display: flex;
  align-items: center;
  gap: 12px;
}

.title-with-pill h2, .section-title-bar h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.count-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.vault-filter-actions {
  display: flex;
  gap: 6px;
}

.filter-pill {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 34px;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-pill.active {
  background: rgba(0, 255, 115, 0.15);
  color: var(--xbox-neon);
  border-color: rgba(0, 255, 115, 0.35);
}

.game-vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}

.vault-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.vault-card:hover {
  transform: translateY(-6px);
  border-color: rgba(0, 255, 115, 0.35);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 255, 115, 0.15);
}

.vault-cover-wrap {
  width: 100%;
  height: 240px;
  position: relative;
  overflow: hidden;
}

.vault-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.vault-card:hover .vault-cover-img {
  transform: scale(1.05);
}

.vault-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(180deg, transparent 0%, rgba(7, 9, 14, 0.95) 100%);
}

.vault-time-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  color: var(--xbox-neon);
  border: 1px solid rgba(0, 255, 115, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
}

.vault-card-content {
  padding: 14px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vault-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* HISTORY TABLE */
.history-section {
  margin-bottom: 32px;
}

.history-table-wrapper {
  background: var(--bg-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-card);
}

.hud-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  min-width: 600px;
}

.hud-table th {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.35);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.hud-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  white-space: nowrap;
}

.hud-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.table-game-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.table-game-thumb {
  width: 32px;
  height: 42px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.hud-modal {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(0, 255, 115, 0.25);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), var(--shadow-neon);
  overflow: hidden;
  animation: modal-enter 0.25s ease forwards;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modal-enter {
  from { transform: scale(0.94) translateY(12px); }
  to { transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.modal-close:hover { color: #fff; }

.modal-body {
  padding: 24px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .col {
  flex: 1;
}

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

.hud-input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.hud-input:focus {
  border-color: var(--xbox-neon);
  box-shadow: 0 0 10px rgba(0, 255, 115, 0.25);
}

.form-hint {
  font-size: 11px;
  color: var(--text-dim);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.quick-pick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chip {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-chip:hover, .quick-chip:active {
  background: rgba(0, 255, 115, 0.15);
  border-color: var(--xbox-neon);
  color: #fff;
}

/* Toast Notification */
.toast-notification {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--xbox-neon);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), var(--shadow-neon);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2000;
  max-width: 90vw;
}

.toast-notification.show {
  transform: translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MOBILE & RESPONSIVE OPTIMIZATIONS
   ========================================================================== */

/* Tablet & Smaller Desktops */
@media (max-width: 1180px) {
  .hero-theater {
    grid-template-columns: 1fr;
  }

  .monolith-card {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 20px 24px;
  }

  .monolith-visual {
    height: 140px;
  }

  .xbox-tower-3d {
    width: 70px;
    height: 135px;
  }

  .monolith-telemetry {
    flex: 1;
  }

  .hud-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-layout {
    grid-template-columns: 1fr;
  }
}

/* Tablets & Mobile Landscape (<= 860px) */
@media (max-width: 860px) {
  .app-container {
    padding-top: 14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .hud-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 14px;
  }

  .brand-zone {
    justify-content: flex-start;
  }

  .console-meta-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px 14px;
  }

  .meta-divider {
    display: none;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .header-actions .hud-btn {
    width: 100%;
    min-height: 44px;
  }
}

/* Smartphone Portrait (<= 640px) */
@media (max-width: 640px) {
  .brand-text h1 {
    font-size: 22px;
  }

  .version-tag {
    display: none;
  }

  .brand-text .subtitle {
    font-size: 9px;
    letter-spacing: 1px;
  }

  .console-meta-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px;
  }

  .meta-label {
    font-size: 8.5px;
  }

  .meta-value {
    font-size: 12px;
  }

  /* Monolith Card on Mobile */
  .monolith-card {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
    gap: 16px;
  }

  .monolith-visual {
    height: 120px;
  }

  .xbox-tower-3d {
    width: 60px;
    height: 115px;
  }

  .monolith-telemetry {
    width: 100%;
    align-items: center;
  }

  .telemetry-badge {
    margin: 0 auto;
  }

  .stopwatch-display {
    font-size: 36px;
  }

  .latency-row {
    width: 100%;
    justify-content: space-around;
  }

  /* Cinema Card on Mobile */
  .cinema-card {
    padding: 20px 16px;
  }

  .cinema-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .game-poster-wrapper {
    width: 125px;
    height: 175px;
    margin: 0 auto;
  }

  .badge-row {
    justify-content: center;
  }

  .active-game-title {
    font-size: 26px;
  }

  .game-session-stats {
    justify-content: center;
    gap: 16px;
  }

  .session-stat-box {
    align-items: center;
  }

  .cinema-actions {
    flex-direction: column;
    width: 100%;
  }

  .cinema-actions .hud-btn {
    width: 100%;
    min-height: 44px;
  }

  /* HUD KPIs on Mobile */
  .hud-stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .hud-stat-card {
    padding: 14px 12px;
    gap: 10px;
  }

  .stat-icon-wrapper {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .stat-big-value {
    font-size: 19px;
  }

  .stat-caption {
    font-size: 9.5px;
  }

  .stat-footnote {
    font-size: 10px;
  }

  /* Vault on Mobile */
  .section-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .vault-filter-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .filter-pill {
    flex: 1;
    text-align: center;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .game-vault-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .vault-cover-wrap {
    height: 180px;
  }

  .vault-card-title {
    font-size: 14px;
  }

  .vault-card-content {
    padding: 10px 12px;
  }

  /* Toast position on phone */
  .toast-notification {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    text-align: center;
  }

  /* Form modal rows */
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}
