/* --- Mini-Games View --- */
.games-dashboard {
  display: none;
  grid-template-columns: 2fr 1.2fr;
  gap: 1.5rem;
}
.games-dashboard.active-game {
  display: grid !important;
}
.games-dashboard.hidden-game {
  display: none !important;
}

.game-window-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.game-canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16/9;
  background: #020308;
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--glow-cyan);
  box-sizing: border-box;
}

#container-stacker {
  aspect-ratio: 4/3 !important;
  max-width: 640px !important;
  max-height: 75vh;
  min-height: auto !important;
}

#container-skeet {
  aspect-ratio: 16/9 !important;
  max-width: 800px !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden !important;
}

canvas#game-canvas,
canvas#invaders-canvas,
canvas#drift-canvas,
canvas#stacker-canvas,
canvas#skeet-canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  display: block !important;
  box-sizing: border-box !important;
  object-fit: fill !important;
  padding: 0 !important;
  margin: 0 !important;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 9, 19, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem 1rem;
  box-sizing: border-box;
  overflow-y: auto;
  max-height: 100%;
  z-index: 2;
  transition: var(--transition-smooth);
}

.game-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.game-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.game-desc {
  color: var(--text-muted);
  max-width: 400px;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.btn-play-game {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  color: white;
  border: none;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--glow-purple);
  transition: var(--transition-smooth);
}

.btn-play-game:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px var(--color-secondary);
}

.game-controls-hint {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.key-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-glass);
  font-family: monospace;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-glass);
  transition: var(--transition-smooth);
  gap: 0.65rem;
  min-height: 52px;
}

.leaderboard-row.user-row {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid var(--border-cyan);
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* 🥇 Podium Glow & Styling for Top 3 Ranks */
.leaderboard-row.podium-row-1 {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.14) 0%, rgba(255, 170, 0, 0.03) 100%) !important;
  border: 1px solid rgba(255, 215, 0, 0.45) !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.14), inset 0 0 8px rgba(255, 215, 0, 0.05);
}
.leaderboard-row.podium-row-1 .leaderboard-score {
  color: #ffd700 !important;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}
.leaderboard-row.podium-row-1 .leaderboard-prize {
  color: #ffe600 !important;
  font-weight: 800;
  text-shadow: 0 0 6px rgba(255, 230, 0, 0.4);
}

.leaderboard-row.podium-row-2 {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.10) 0%, rgba(148, 163, 184, 0.02) 100%) !important;
  border: 1px solid rgba(226, 232, 240, 0.35) !important;
  box-shadow: 0 0 10px rgba(226, 232, 240, 0.08);
}
.leaderboard-row.podium-row-2 .leaderboard-score {
  color: #f1f5f9 !important;
  font-weight: 800;
}
.leaderboard-row.podium-row-2 .leaderboard-prize {
  color: #cbd5e1 !important;
  font-weight: 700;
}

.leaderboard-row.podium-row-3 {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.10) 0%, rgba(217, 119, 6, 0.02) 100%) !important;
  border: 1px solid rgba(249, 115, 22, 0.35) !important;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.08);
}
.leaderboard-row.podium-row-3 .leaderboard-score {
  color: #fb923c !important;
  font-weight: 800;
}
.leaderboard-row.podium-row-3 .leaderboard-prize {
  color: #fdba74 !important;
  font-weight: 700;
}

.leaderboard-rank {
  font-weight: 800;
  min-width: 36px;
  width: 36px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.leaderboard-rank.podium-rank {
  font-weight: 900;
  letter-spacing: -0.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.podium-rank-1 {
  color: #ffd700 !important;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}
.podium-rank-2 {
  color: #e2e8f0 !important;
  text-shadow: 0 0 8px rgba(226, 232, 240, 0.6);
}
.podium-rank-3 {
  color: #fb923c !important;
  text-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

/* 2-Line Layout Elements */
.leaderboard-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.leaderboard-info-top {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  line-height: 1.25;
}

.leaderboard-info-bottom {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  line-height: 1.15;
}

.leaderboard-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  min-width: 90px;
  gap: 2px;
  text-align: right;
}

.leaderboard-score {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--color-primary);
  white-space: nowrap;
  line-height: 1.25;
  margin-right: 0;
}

.leaderboard-score .score-unit {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.7;
  color: var(--text-dim);
  margin-left: 2px;
}

.leaderboard-prize {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
  line-height: 1.15;
}

/* Leaderboard Pagination Controls */
.leaderboard-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.25rem 0.2rem 0.25rem;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.leaderboard-pagination .lb-page-btn {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid var(--border-glass);
  color: var(--color-primary);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
}

.leaderboard-pagination .lb-page-btn:hover:not(:disabled) {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.leaderboard-pagination .lb-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.04);
}

.leaderboard-pagination .lb-page-info {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Pinned User Standing Row (When not on active page) */
.leaderboard-pinned-wrapper {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(0, 240, 255, 0.3);
  position: relative;
}

.leaderboard-pinned-header {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-accent);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.leaderboard-row.pinned-user-row {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.12), rgba(255, 0, 128, 0.06));
  border: 1px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

/* --- Fullscreen Mobile Game Canvas Mode --- */
body.game-fullscreen-open {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden !important;
  touch-action: none !important;
}

body.game-fullscreen-open .top-header,
body.game-fullscreen-open .bottom-nav,
body.game-fullscreen-open .sidebar,
body.game-fullscreen-open header,
body.game-fullscreen-open nav,
body.game-fullscreen-open .navbar {
  display: none !important;
}

/* Neutralize view-panel animation & transform containing blocks during fullscreen gameplay */
body.game-fullscreen-open .view-panel,
body.game-fullscreen-open #view-games,
body.game-fullscreen-open .games-dashboard {
  transform: none !important;
  animation: none !important;
}

.game-window-container.fullscreen-active,
.mobile-fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 99999999 !important;
  background: #020308 !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

/* Hide game top header buttons (Back to Grid, Fullscreen, Quit) in Fullscreen Mode */
.game-window-container.fullscreen-active .game-header-bar,
.mobile-fullscreen-active .game-header-bar {
  display: none !important;
}

/* Fullscreen mode layout for ALL active Arcade Game Panels */
.game-window-container.fullscreen-active #panel-game-arcade:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-arcade:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-invaders:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-invaders:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-drift:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-drift:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-stacker:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-stacker:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-skeet:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-skeet:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-defense:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-defense:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-runner:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-runner:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-q2048:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-q2048:not([style*="display: none"]):not([style*="display:none"]),
.game-window-container.fullscreen-active #panel-game-tetris:not([style*="display: none"]):not([style*="display:none"]),
.mobile-fullscreen-active #panel-game-tetris:not([style*="display: none"]):not([style*="display:none"]) {
  position: relative !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  touch-action: none !important;
}

/* Cyber 2048: Responsive board wrapper scaling in fullscreen mode */
.game-window-container.fullscreen-active #panel-game-q2048 .q2048-board-wrapper,
.mobile-fullscreen-active #panel-game-q2048 .q2048-board-wrapper {
  max-width: min(calc(100vw - 20px), calc(100vh - 210px), 420px) !important;
  margin: auto !important;
  touch-action: none !important;
}

/* Ensure inactive game panels remain strictly hidden when in fullscreen */
.game-window-container.fullscreen-active [id^="panel-game-"][style*="display: none"],
.game-window-container.fullscreen-active [id^="panel-game-"][style*="display:none"],
.mobile-fullscreen-active [id^="panel-game-"][style*="display: none"],
.mobile-fullscreen-active [id^="panel-game-"][style*="display:none"] {
  display: none !important;
}

/* Standard 16:9 responsive bounds for Arcade Game Wrappers in Fullscreen Mode (Astro-Dodge, Cyber Invaders, Cyber Skeet, Cyber Defense) */
.game-window-container.fullscreen-active .game-canvas-wrapper,
.mobile-fullscreen-active .game-canvas-wrapper {
  position: relative !important;
  width: min(calc(100vw - 16px), calc((100vh - 140px) * (16 / 9))) !important;
  height: min(calc((100vw - 16px) * (9 / 16)), calc(100vh - 140px)) !important;
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100vh - 140px) !important;
  aspect-ratio: 16 / 9 !important;
  margin: auto !important;
  padding: 0 !important;
  display: block !important;
  box-sizing: border-box !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35) !important;
  border: 2px solid var(--color-primary) !important;
  overflow: hidden !important;
}

/* Cyber Stacker: Locked to authentic 4:3 fitted bounds in fullscreen mode */
.game-window-container.fullscreen-active #container-stacker,
.mobile-fullscreen-active #container-stacker {
  aspect-ratio: 4 / 3 !important;
  width: min(calc(100vw - 16px), calc((100vh - 140px) * (4 / 3))) !important;
  height: min(calc((100vw - 16px) * (3 / 4)), calc(100vh - 140px)) !important;
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100vh - 140px) !important;
  border-color: var(--color-warning) !important;
  box-shadow: 0 0 25px rgba(255, 170, 0, 0.35) !important;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.game-window-container.fullscreen-active #panel-game-stacker,
.mobile-fullscreen-active #panel-game-stacker {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Cyber Drift: Locked to authentic 16:10 fitted bounds in fullscreen mode */
.game-window-container.fullscreen-active #container-drift,
.mobile-fullscreen-active #container-drift,
.game-window-container.fullscreen-active #panel-game-drift .game-canvas-wrapper,
.mobile-fullscreen-active #panel-game-drift .game-canvas-wrapper {
  aspect-ratio: 16 / 10 !important;
  width: min(calc(100vw - 16px), calc((100vh - 140px) * (16 / 10))) !important;
  height: min(calc((100vw - 16px) * (10 / 16)), calc(100vh - 140px)) !important;
  max-width: calc(100vw - 16px) !important;
  max-height: calc(100vh - 140px) !important;
}

/* In fullscreen mode, all arcade canvases scale 100% to fill their wrapper with zero distortion */
.game-window-container.fullscreen-active .game-canvas-wrapper canvas,
.mobile-fullscreen-active .game-canvas-wrapper canvas,
#panel-game-arcade canvas#game-canvas,
#panel-game-invaders canvas#invaders-canvas,
#panel-game-drift canvas#drift-canvas,
#panel-game-stacker canvas#stacker-canvas,
#panel-game-skeet canvas#skeet-canvas,
#panel-game-defense canvas#defense-canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: none !important;
  display: block !important;
  box-sizing: border-box !important;
  object-fit: fill !important;
}

/* Unified Arcade Host Top HUD Bar (PLAN-021 Lite) */
.arcade-host-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
  width: 100%;
  max-width: 640px;
  padding: 0.5rem 0.75rem;
  background: rgba(6, 10, 22, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), inset 0 0 12px rgba(0, 240, 255, 0.05);
  box-sizing: border-box;
  flex-wrap: wrap;
}

.arcade-host-header-left,
.arcade-host-header-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.arcade-host-btn-back {
  padding: 0.42rem 0.75rem !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  white-space: nowrap;
}

.arcade-host-game-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.arcade-host-mult-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.36rem 0.68rem;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.16), rgba(0, 240, 255, 0.12));
  border: 1px solid rgba(255, 215, 0, 0.45);
  border-radius: 999px;
  color: #ffd700;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.arcade-host-mult-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.3);
}

.arcade-host-icon-btn {
  padding: 0.38rem 0.6rem !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  border-radius: 8px !important;
  min-width: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.arcade-host-icon-btn.is-muted {
  border-color: rgba(255, 0, 85, 0.5) !important;
  color: var(--color-danger) !important;
  background: rgba(255, 0, 85, 0.12) !important;
}

.arcade-host-btn-fs {
  padding: 0.42rem 0.75rem !important;
  font-size: 0.82rem !important;
  color: var(--color-accent) !important;
  border-color: var(--color-accent) !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  white-space: nowrap;
}

.arcade-host-btn-quit {
  background: rgba(255, 0, 85, 0.2) !important;
  color: #ff3377 !important;
  border: 1px solid rgba(255, 0, 85, 0.5) !important;
  padding: 0.38rem 0.65rem !important;
  font-size: 0.95rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  border-radius: 8px !important;
  cursor: pointer;
}

.arcade-host-btn-quit:hover {
  background: var(--color-danger) !important;
  color: #fff !important;
}

/* Floating Mute & X Close buttons in Fullscreen Mode */
.btn-fullscreen-close,
.btn-fullscreen-mute {
  display: none;
}

.fullscreen-active .btn-fullscreen-mute,
.mobile-fullscreen-active .btn-fullscreen-mute {
  display: flex !important;
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(54px + env(safe-area-inset-right, 0px)) !important;
  z-index: 100000000 !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: rgba(6, 12, 28, 0.92) !important;
  color: #00f0ff !important;
  border: 2px solid rgba(0, 240, 255, 0.7) !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.45) !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, background 0.2s ease;
}

.fullscreen-active .btn-fullscreen-mute.is-muted,
.mobile-fullscreen-active .btn-fullscreen-mute.is-muted {
  border-color: #ff0055 !important;
  color: #ff0055 !important;
}

.fullscreen-active .btn-fullscreen-close,
.mobile-fullscreen-active .btn-fullscreen-close {
  display: flex !important;
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  right: calc(10px + env(safe-area-inset-right, 0px)) !important;
  z-index: 100000000 !important;
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  background: #ff0055 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.8) !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn-fullscreen-close:active,
.btn-fullscreen-mute:active {
  transform: scale(0.9);
}

/* Translucent Cyberpunk Stats HUD Overlay in Fullscreen Mode (Stops cleanly before Mute & X close buttons) */
.game-window-container.fullscreen-active .game-stats-hud,
.mobile-fullscreen-active .game-stats-hud {
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  bottom: auto !important;
  left: calc(8px + env(safe-area-inset-left, 0px)) !important;
  right: calc(98px + env(safe-area-inset-right, 0px)) !important;
  width: auto !important;
  max-width: 580px !important;
  transform: none !important;
  z-index: 1000000 !important;
  background: rgba(3, 7, 18, 0.94) !important;
  border: 1px solid var(--color-primary) !important;
  border-radius: 10px !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.4) !important;
  padding: 0.35rem 0.6rem !important;
  display: flex !important;
  justify-content: space-around !important;
  align-items: center !important;
  font-size: 0.8rem !important;
}

/* Ensure skeet HUD and touchpad NEVER appear when skeet is hidden */
#panel-game-skeet[style*="display: none"] #skeet-hud,
#panel-game-skeet[style*="display:none"] #skeet-hud,
#panel-game-skeet[style*="display: none"] #skeet-touchpad,
#panel-game-skeet[style*="display:none"] #skeet-touchpad,
#panel-game-skeet[style*="display: none"] #skeet-overlay-start,
#panel-game-skeet[style*="display:none"] #skeet-overlay-start,
#skeet-hud[style*="display: none"],
#skeet-hud[style*="display:none"],
#skeet-touchpad[style*="display: none"],
#skeet-touchpad[style*="display:none"],
#skeet-overlay-start[style*="display: none"],
#skeet-overlay-start[style*="display:none"] {
  display: none !important;
}

/* Floating Steer / Action Controls in Fullscreen Mode for Cyber Drift */
.game-window-container.fullscreen-active #panel-game-drift:not([style*="display: none"]):not([style*="display:none"]) #drift-controls-hud,
.mobile-fullscreen-active #panel-game-drift:not([style*="display: none"]):not([style*="display:none"]) #drift-controls-hud {
  position: fixed !important;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 1000000 !important;
  width: calc(100% - 24px) !important;
  max-width: 640px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

#drift-controls-hud button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Floating Turret Selector Bar in Fullscreen / Mobile Mode for Cyber Defense */
#panel-game-defense #defense-turret-bar {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 800px;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.game-window-container.fullscreen-active #panel-game-defense:not([style*="display: none"]):not([style*="display:none"]) #defense-turret-bar,
.mobile-fullscreen-active #panel-game-defense:not([style*="display: none"]):not([style*="display:none"]) #defense-turret-bar,
body.game-fullscreen-open #panel-game-defense:not([style*="display: none"]):not([style*="display:none"]) #defense-turret-bar {
  position: fixed !important;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  top: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 10000000 !important;
  width: calc(100% - 16px) !important;
  max-width: 580px !important;
  margin: 0 !important;
  padding: 6px 8px !important;
  box-sizing: border-box !important;
  background: rgba(3, 7, 18, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(0, 240, 255, 0.3) !important;
  border-radius: 12px !important;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.35) !important;
  gap: 6px !important;
  pointer-events: auto !important;
}

/* Turret Selection Buttons */
.turret-select-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 4px !important;
  min-height: 48px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  user-select: none !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  pointer-events: auto !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}

.turret-select-btn * {
  pointer-events: none !important;
}

.turret-select-btn:active {
  transform: scale(0.95) !important;
}

.turret-select-btn .turret-btn-title {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.turret-select-btn .turret-btn-cost {
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.95;
  white-space: nowrap;
}

.turret-select-btn[data-turret-type="laser"] {
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #fff;
  background: rgba(0, 240, 255, 0.08);
}
.turret-select-btn[data-turret-type="laser"].active,
.turret-select-btn[data-turret-type="laser"]:hover {
  border-color: #00f0ff !important;
  background: rgba(0, 240, 255, 0.28) !important;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5) !important;
}
.turret-select-btn[data-turret-type="laser"] .turret-btn-cost {
  color: #00f0ff;
}

.turret-select-btn[data-turret-type="plasma"] {
  border: 1px solid rgba(255, 0, 255, 0.35);
  color: #fff;
  background: rgba(255, 0, 255, 0.08);
}
.turret-select-btn[data-turret-type="plasma"].active,
.turret-select-btn[data-turret-type="plasma"]:hover {
  border-color: #ff00ff !important;
  background: rgba(255, 0, 255, 0.28) !important;
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.5) !important;
}
.turret-select-btn[data-turret-type="plasma"] .turret-btn-cost {
  color: #ff00ff;
}

.turret-select-btn[data-turret-type="emp"] {
  border: 1px solid rgba(0, 255, 170, 0.35);
  color: #fff;
  background: rgba(0, 255, 170, 0.08);
}
.turret-select-btn[data-turret-type="emp"].active,
.turret-select-btn[data-turret-type="emp"]:hover {
  border-color: #00ffaa !important;
  background: rgba(0, 255, 170, 0.28) !important;
  box-shadow: 0 0 12px rgba(0, 255, 170, 0.5) !important;
}
.turret-select-btn[data-turret-type="emp"] .turret-btn-cost {
  color: #00ffaa;
}

.turret-select-btn[data-turret-type="railgun"] {
  border: 1px solid rgba(255, 170, 0, 0.35);
  color: #fff;
  background: rgba(255, 170, 0, 0.08);
}
.turret-select-btn[data-turret-type="railgun"].active,
.turret-select-btn[data-turret-type="railgun"]:hover {
  border-color: #ffaa00 !important;
  background: rgba(255, 170, 0, 0.28) !important;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.5) !important;
}
.turret-select-btn[data-turret-type="railgun"] .turret-btn-cost {
  color: #ffaa00;
}

/* Force legacy canvas overlay to hide so PolySpace Hangar canvas is 100% visible */
#space-hangar-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mobile Screen Bounds & Overflow Shield (<=768px) */
@media (max-width: 768px) {
  .games-dashboard.active-game {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .game-window-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .game-canvas-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    box-sizing: border-box !important;
  }

  #container-stacker,
  #container-skeet,
  #container-invaders {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
  }

  .game-header-bar,
  .game-stats-hud,
  #drift-controls-hud,
  #stacker-controls-hud,
  #defense-turret-bar {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Astro-Dodge Unified Action Row (Side-by-side single row) */
#astro-dodge-btn-group {
  display: flex !important;
  gap: 0.5rem !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  width: 100% !important;
  max-width: 420px !important;
  margin: 0.35rem 0 !important;
}

#astro-dodge-btn-group #btn-start-game {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  padding: 0.65rem 0.5rem !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

#astro-dodge-btn-group #btn-open-hangar {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  white-space: nowrap !important;
  padding: 0.65rem 0.5rem !important;
  font-size: 0.82rem !important;
  font-weight: 800 !important;
  border-radius: 8px !important;
  min-height: 42px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
}

/* --- Cyber Mines (5x5 Grid) --- */
.mines-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 0.5rem;
  box-sizing: border-box;
}

.mines-tile {
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, #0d152a, #070b16);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  font-size: 1.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 0;
}

.mines-tile:not(.disabled):hover {
  transform: translateY(-2px) scale(1.03);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(0, 240, 255, 0.2);
  background: linear-gradient(145deg, #152244, #0b1326);
}

.mines-tile:not(.disabled):active {
  transform: translateY(1px) scale(0.97);
}

.mines-tile.disabled {
  cursor: default;
  opacity: 0.85;
}

.mines-tile.revealing {
  animation: pulse-revealing 0.6s infinite alternate;
}

@keyframes pulse-revealing {
  0% { border-color: var(--color-primary); box-shadow: 0 0 8px rgba(0, 240, 255, 0.3); }
  100% { border-color: var(--color-secondary); box-shadow: 0 0 18px rgba(189, 0, 255, 0.6); }
}

.mines-tile.tile-gem {
  background: radial-gradient(circle, rgba(0, 255, 135, 0.2) 0%, rgba(0, 240, 255, 0.1) 60%, #06111e 100%) !important;
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 16px rgba(0, 255, 135, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.3) !important;
  transform: scale(1.02);
  animation: gem-pop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes gem-pop {
  0% { transform: scale(0.7); opacity: 0.5; }
  70% { transform: scale(1.12); }
  100% { transform: scale(1.02); opacity: 1; }
}

.mines-tile.tile-mine.tile-detonated {
  background: radial-gradient(circle, rgba(255, 0, 85, 0.6) 0%, rgba(255, 50, 0, 0.3) 60%, #1a030a 100%) !important;
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.8), inset 0 0 15px rgba(255, 0, 85, 0.5) !important;
  animation: mine-detonate 0.5s ease-out;
}

@keyframes mine-detonate {
  0% { transform: scale(0.6); filter: brightness(2); }
  50% { transform: scale(1.2); filter: brightness(1.5); }
  100% { transform: scale(1); filter: brightness(1); }
}

.mines-tile.tile-dormant-mine {
  background: rgba(255, 183, 0, 0.08) !important;
  border-color: rgba(255, 183, 0, 0.3) !important;
  opacity: 0.6;
}

.mines-board-shake {
  animation: board-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes board-shake {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(3px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.mines-pill-btn {
  padding: 0.35rem 0.75rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-cyan);
  border-radius: 20px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mines-pill-btn:hover:not(.locked) {
  border-color: var(--color-primary);
  color: #fff;
  background: rgba(0, 240, 255, 0.1);
}

.mines-pill-btn.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #000;
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.mines-pill-btn.locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-mines-cashout {
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary)) !important;
  color: #050a14 !important;
  animation: pulse-cashout 1.2s infinite alternate;
}

@keyframes pulse-cashout {
  0% { box-shadow: 0 0 15px rgba(0, 255, 135, 0.4); }
  100% { box-shadow: 0 0 30px rgba(0, 255, 135, 0.8), 0 0 15px rgba(0, 240, 255, 0.5); }
}

/* --- Earn Top Banner Grid (Top 3 Weekly on Left, Relics on Right) --- */
.earn-top-banner-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.85rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .earn-top-banner-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.weekly-champions-container {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.78) 0%, rgba(6, 9, 19, 0.9) 100%);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.earn-relics-banner {
  background: linear-gradient(135deg, rgba(255, 170, 0, 0.12), rgba(255, 0, 85, 0.08));
  border: 1px solid rgba(255, 170, 0, 0.35);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.08);
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.weekly-champions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.weekly-champions-title {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.champions-live-badge {
  background: rgba(0, 240, 255, 0.15);
  color: var(--color-primary);
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-size: 0.6rem;
  font-weight: 900;
  padding: 0.1rem 0.4rem;
  border-radius: 12px;
  animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 5px rgba(0, 240, 255, 0.3); }
  50% { opacity: 1; box-shadow: 0 0 10px rgba(0, 240, 255, 0.7); }
}

.btn-grandprix-rules {
  background: rgba(0, 240, 255, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-grandprix-rules:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--color-primary);
}

.btn-grandprix-standing {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.14), rgba(0, 240, 255, 0.14));
  color: #00ff87;
  border: 1px solid rgba(0, 255, 135, 0.35);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-grandprix-standing:hover {
  background: linear-gradient(135deg, rgba(0, 255, 135, 0.26), rgba(0, 240, 255, 0.26));
  border-color: #00ff87;
  box-shadow: 0 0 10px rgba(0, 255, 135, 0.35);
}

.modal-my-weekly-standing-content {
  max-width: 580px;
  width: 94%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.4rem;
  background: radial-gradient(circle at top center, #0f192e 0%, #060913 100%);
  border: 1.5px solid var(--color-primary);
  border-radius: 16px;
  text-align: left;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.25);
  position: relative;
  pointer-events: auto;
  overflow: hidden;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .modal-my-weekly-standing-content {
    padding: 1.1rem 0.65rem !important;
    width: 96% !important;
    max-height: 94vh !important;
  }
}

.standing-rows-container {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 275px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 3px;
  box-sizing: border-box;
}

.standing-rows-container::-webkit-scrollbar {
  width: 4px;
}
.standing-rows-container::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.35);
  border-radius: 4px;
}
.standing-rows-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

.standing-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.5rem 0.65rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  transition: all 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
}

.standing-breakdown-row:hover {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
}

.standing-breakdown-row.is-ranked {
  border-color: rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.03);
}

.standing-breakdown-row.is-ranked:hover {
  border-color: var(--color-primary);
  background: rgba(0, 240, 255, 0.1);
}

.standing-col-game {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.standing-game-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.standing-game-meta {
  min-width: 0;
  overflow: hidden;
}

.standing-game-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.standing-opportunity-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.75));
  animation: pulse-opportunity 2.2s infinite ease-in-out;
  cursor: help;
  flex-shrink: 0;
  padding: 0 1px;
}

@keyframes pulse-opportunity {
  0%, 100% { transform: scale(1); opacity: 0.85; filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.6)); }
  50% { transform: scale(1.22); opacity: 1; filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.95)); }
}

.standing-game-pool {
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.standing-col-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 48px;
}

.standing-score-val {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.standing-col-payout {
  text-align: right;
  flex-shrink: 0;
  min-width: 72px;
}

.standing-payout-val {
  font-size: 0.82rem;
  font-weight: 900;
  color: #00ff87;
  text-shadow: 0 0 8px rgba(0, 255, 135, 0.35);
  white-space: nowrap;
}

.standing-sub-payout {
  font-size: 0.6rem;
  color: #ffaa00;
  font-weight: 700;
  white-space: nowrap;
}

.standing-gp-only {
  font-size: 0.75rem;
  font-weight: 800;
  color: #ffaa00;
  white-space: nowrap;
}

.standing-payout-zero {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.weekly-champions-podium {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.podium-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  transition: all 0.18s ease;
  cursor: pointer;
  text-decoration: none;
}

.podium-row:hover {
  filter: brightness(1.2);
  transform: translateX(2px);
}

.podium-row.rank-1 {
  background: rgba(255, 170, 0, 0.09);
  border: 1px solid rgba(255, 170, 0, 0.28);
}

.podium-row.rank-2 {
  background: rgba(0, 240, 255, 0.07);
  border: 1px solid rgba(0, 240, 255, 0.22);
}

.podium-row.rank-3 {
  background: rgba(255, 119, 0, 0.07);
  border: 1px solid rgba(255, 119, 0, 0.22);
}

.podium-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-rank-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.podium-player-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-row.rank-1 .podium-player-name {
  color: #ffe066;
}

.podium-row.rank-2 .podium-player-name {
  color: #b3f5ff;
}

.podium-row.rank-3 .podium-player-name {
  color: #ffd1a4;
}

.podium-row-pts {
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.podium-row.rank-1 .podium-row-pts {
  color: #ffaa00;
  text-shadow: 0 0 6px rgba(255, 170, 0, 0.4);
}

.podium-row.rank-2 .podium-row-pts {
  color: #00f0ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.podium-row.rank-3 .podium-row-pts {
  color: #ff9933;
  text-shadow: 0 0 6px rgba(255, 153, 51, 0.4);
}

.podium-empty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  font-size: 0.78rem;
}

/* Shimmer Loading State */
.podium-loading-shimmer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.shimmer-card {
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer-swipe 1.5s infinite;
}

@keyframes shimmer-swipe {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================================================
   CYBER RUNNER & CYBER 2048 MINI-GAMES (PLAN-013)
   ========================================================================== */

/* Cyber Runner Controls HUD */
#runner-controls-hud {
  display: none;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 640px;
  margin-top: 10px;
}

#runner-controls-hud button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.game-window-container.fullscreen-active #panel-game-runner:not([style*="display: none"]):not([style*="display:none"]) #runner-controls-hud,
.mobile-fullscreen-active #panel-game-runner:not([style*="display: none"]):not([style*="display:none"]) #runner-controls-hud {
  position: fixed !important;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 1000000 !important;
  width: calc(100% - 24px) !important;
  max-width: 640px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   CYBER 2048 QUANTUM MATRIX PUZZLE
   ========================================================================== */

#panel-game-q2048 {
  width: 100%;
  display: none;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.q2048-board-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: rgba(10, 4, 20, 0.95);
  border: 2px solid var(--color-primary);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
  box-sizing: border-box;
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
}

.q2048-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 10px;
  aspect-ratio: 1 / 1;
  width: 100%;
  touch-action: none;
}

@keyframes q2048-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.q2048-shake {
  animation: q2048-shake 0.18s ease-in-out;
}

.q2048-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-family: 'Inter', -apple-system, sans-serif;
  font-weight: 900;
  font-size: 1.85rem;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

@keyframes q2048-appear {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.q2048-tile-new {
  animation: q2048-appear 150ms cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

@keyframes q2048-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

.q2048-tile-merged {
  animation: q2048-pop 180ms ease-in-out;
}

.q2048-combo-badge {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.95), rgba(112, 0, 255, 0.95));
  border: 2px solid #00f0ff;
  border-radius: 20px;
  padding: 0.45rem 1.25rem;
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 1px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.7), 0 0 10px rgba(255, 0, 127, 0.8);
  pointer-events: none;
  z-index: 20;
  animation: q2048-combo-float 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  white-space: nowrap;
}

@keyframes q2048-combo-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.6);
  }
  25% {
    opacity: 1;
    transform: translate(-50%, -45%) scale(1.15);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -60%) scale(1.0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -85%) scale(0.9);
  }
}

.q2048-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size, 6px);
  height: var(--size, 6px);
  border-radius: 50%;
  background: var(--color, #00f0ff);
  box-shadow: 0 0 10px var(--color, #00f0ff);
  pointer-events: none;
  z-index: 25;
  transform: translate(-50%, -50%);
  animation: q2048-particle-burst 0.75s ease-out forwards;
}

@keyframes q2048-particle-burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2);
  }
}

@keyframes q2048-milestone-flash {
  0% { box-shadow: 0 0 45px rgba(0, 240, 255, 0.9), inset 0 0 25px rgba(255, 0, 127, 0.6); }
  100% { box-shadow: 0 0 25px rgba(0, 240, 255, 0.25); }
}

.q2048-milestone-flash {
  animation: q2048-milestone-flash 0.6s ease-out;
}

.q2048-tile-empty {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.q2048-coin-cell {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.28) 0%, rgba(255, 140, 0, 0.12) 75%) !important;
  border: 2px solid #ffd700 !important;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.65), inset 0 0 12px rgba(255, 215, 0, 0.35) !important;
  animation: q2048-coin-pulse 1.1s ease-in-out infinite alternate !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer;
}

@keyframes q2048-coin-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 12px rgba(255, 215, 0, 0.5); }
  100% { transform: scale(1.02); box-shadow: 0 0 26px rgba(255, 215, 0, 0.9); }
}

.q2048-tile-2 {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.q2048-tile-4 {
  background: rgba(0, 212, 255, 0.25);
  color: #70ffff;
  border: 1px solid #00d4ff;
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.35);
}

.q2048-tile-8 {
  background: rgba(112, 0, 255, 0.3);
  color: #d199ff;
  border: 1px solid #7000ff;
  box-shadow: 0 0 16px rgba(112, 0, 255, 0.45);
}

.q2048-tile-16 {
  background: rgba(168, 85, 247, 0.35);
  color: #f3e8ff;
  border: 1px solid #c084fc;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.5);
}

.q2048-tile-32 {
  background: rgba(255, 0, 127, 0.35);
  color: #ff99cc;
  border: 1px solid #ff007f;
  box-shadow: 0 0 20px rgba(255, 0, 127, 0.55);
}

.q2048-tile-64 {
  background: rgba(255, 45, 120, 0.45);
  color: #fff;
  border: 1px solid #ff2d78;
  box-shadow: 0 0 22px rgba(255, 45, 120, 0.65);
}

.q2048-tile-128 {
  background: rgba(255, 170, 0, 0.45);
  color: #fff;
  border: 1px solid #ffaa00;
  box-shadow: 0 0 25px rgba(255, 170, 0, 0.7);
}

.q2048-tile-256 {
  background: rgba(255, 215, 0, 0.55);
  color: #fff;
  border: 2px solid #ffd700;
  box-shadow: 0 0 28px rgba(255, 215, 0, 0.85);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.q2048-tile-512 {
  background: rgba(0, 255, 136, 0.55);
  color: #fff;
  border: 2px solid #00ff88;
  box-shadow: 0 0 30px rgba(0, 255, 136, 0.85);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.q2048-tile-1024 {
  background: rgba(0, 255, 204, 0.65);
  color: #fff;
  border: 2px solid #00ffcc;
  box-shadow: 0 0 35px rgba(0, 255, 204, 0.95);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.9);
}

.q2048-tile-2048 {
  background: linear-gradient(135deg, #ff007f, #00f0ff, #ffd700);
  background-size: 300% 300%;
  animation: q2048-rainbow 3s ease infinite;
  color: #fff;
  border: 2px solid #ffffff;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
}

.q2048-tile-4096 {
  background: linear-gradient(135deg, #7000ff, #ff0055, #00f0ff);
  background-size: 300% 300%;
  animation: q2048-rainbow 2s ease infinite;
  color: #fff;
  border: 2px solid #ffffff;
  box-shadow: 0 0 45px rgba(255, 0, 127, 1);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
}

@keyframes q2048-rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ==========================================================================
   CYBER 2048 MOBILE CONTROLS & HUD
   ========================================================================== */

#q2048-controls-hud {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 290px;
  margin-top: 0.35rem;
}

#q2048-controls-hud .q2048-dpad-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  width: 100%;
}

.q2048-dpad-btn {
  width: 80px;
  height: 46px;
  font-size: 1.3rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  transition: transform 0.08s ease, background-color 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
}

.q2048-dpad-btn:active {
  transform: scale(0.93);
  background: rgba(0, 240, 255, 0.25) !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5) !important;
}

.q2048-action-bar {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  width: 100%;
  max-width: 440px;
  margin-top: 0.25rem;
}

.q2048-action-btn {
  padding: 0.45rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

/* Dedicated Mobile Touch Optimization (Slightly Bigger Buttons on Mobile) */
@media (max-width: 768px), (pointer: coarse) {
  #q2048-controls-hud {
    max-width: 320px;
    gap: 0.55rem;
    margin-top: 0.5rem;
  }

  #q2048-controls-hud .q2048-dpad-row {
    gap: 0.55rem;
  }

  .q2048-dpad-btn {
    width: 88px;
    height: 54px;
    min-height: 50px;
    font-size: 1.45rem;
    border-radius: 10px;
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.07);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .q2048-dpad-btn:active {
    transform: scale(0.92);
    background: rgba(0, 240, 255, 0.35) !important;
  }

  .q2048-action-bar {
    gap: 0.85rem;
    margin-top: 0.4rem;
  }

  .q2048-action-btn {
    padding: 0.65rem 1.35rem !important;
    font-size: 0.92rem !important;
    min-height: 46px;
    border-radius: 9px;
  }

  .q2048-start-btn,
  .q2048-restart-btn {
    padding: 0.95rem 2.4rem !important;
    font-size: 1.15rem !important;
    min-height: 50px;
  }

  .q2048-lobby-btn {
    padding: 0.95rem 1.5rem !important;
    min-height: 50px;
  }
}

@media (max-width: 380px) {
  .q2048-dpad-btn {
    width: 78px;
    height: 50px;
    font-size: 1.35rem;
  }
  .q2048-action-btn {
    padding: 0.55rem 1rem !important;
    font-size: 0.85rem !important;
  }
}

/* ==========================================================================
   CYBER TETRIS NEON FALLING MATRIX (PLAN-014)
   ========================================================================== */

#panel-game-tetris {
  animation: fadeIn 0.25s ease-in-out;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.tetris-layout-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: relative;
  max-width: 100%;
  box-sizing: border-box;
}

.tetris-board-wrapper {
  position: relative;
  border: 2px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  overflow: hidden;
  background: #060a17;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 0, 0, 0.8);
  flex-shrink: 0;
}

.tetris-side-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 80px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.tetris-side-col > div {
  width: 100%;
  box-sizing: border-box;
}

/* Floating Neon Badges for Cyber Tetris */
.tetris-floating-badge {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.4rem 1rem;
  border-radius: 16px;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-align: center;
  pointer-events: none;
  z-index: 5;
  white-space: nowrap;
  animation: tetris-badge-float 0.85s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes tetris-badge-float {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.65);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -45%) scale(1.15);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -65%) scale(1.0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -95%) scale(0.85);
  }
}

.tetris-badge-single {
  background: rgba(0, 240, 255, 0.25);
  border: 1.5px solid #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.6);
}

.tetris-badge-double {
  background: rgba(41, 121, 255, 0.3);
  border: 1.5px solid #2979ff;
  color: #70a5ff;
  box-shadow: 0 0 18px rgba(41, 121, 255, 0.7);
}

.tetris-badge-triple {
  background: rgba(213, 0, 249, 0.35);
  border: 2px solid #d500f9;
  color: #ff80ff;
  box-shadow: 0 0 20px rgba(213, 0, 249, 0.8);
}

.tetris-badge-tetris {
  background: linear-gradient(135deg, rgba(213, 0, 249, 0.95), rgba(0, 240, 255, 0.95));
  border: 2px solid #fff;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 30px rgba(213, 0, 249, 0.9), 0 0 15px rgba(0, 240, 255, 0.8);
}

.tetris-badge-b2b {
  background: linear-gradient(135deg, rgba(255, 145, 0, 0.95), rgba(255, 23, 68, 0.95));
  border: 2px solid #ffd700;
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 0 30px rgba(255, 145, 0, 0.9), 0 0 15px rgba(255, 23, 68, 0.8);
}

.tetris-badge-combo {
  background: linear-gradient(135deg, rgba(255, 214, 0, 0.95), rgba(255, 145, 0, 0.95));
  border: 2px solid #fff;
  color: #000;
  font-weight: 900;
  font-size: 1.1rem;
  box-shadow: 0 0 20px rgba(255, 214, 0, 0.8);
}

.tetris-badge-perfect {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.95), rgba(0, 230, 118, 0.95));
  border: 2px solid #fff;
  color: #000;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.95), 0 0 20px rgba(0, 230, 118, 0.9);
}

.tetris-badge-coin {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 140, 0, 0.95));
  border: 2px solid #fff;
  color: #000;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.95), 0 0 15px rgba(255, 140, 0, 0.8);
}

.tetris-badge-level {
  background: rgba(10, 15, 30, 0.95);
  border: 2px solid #00f0ff;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.7);
}

#tetris-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

#tetris-hold-canvas,
#tetris-next-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Dedicated Mobile Touch Controls HUD */
#tetris-controls-hud {
  display: none;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin-top: 10px;
}

#tetris-controls-hud button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

@media (max-width: 768px), (pointer: coarse) {
  #tetris-controls-hud {
    display: flex;
  }
}

.game-window-container.fullscreen-active #panel-game-tetris:not([style*="display: none"]):not([style*="display:none"]) #tetris-controls-hud,
.mobile-fullscreen-active #panel-game-tetris:not([style*="display: none"]):not([style*="display:none"]) #tetris-controls-hud {
  position: fixed !important;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 1000000 !important;
  width: calc(100% - 24px) !important;
  max-width: 440px !important;
  padding: 0 8px !important;
  box-sizing: border-box !important;
}

@media (max-width: 480px) {
  .tetris-layout-container {
    gap: 8px !important;
    padding: 0 4px !important;
  }
  .tetris-side-col {
    width: 76px !important;
    gap: 5px !important;
  }
  .tetris-side-col > div {
    width: 100% !important;
    padding: 4px !important;
    box-sizing: border-box !important;
  }
  #tetris-hold-canvas {
    width: 68px !important;
    height: 68px !important;
  }
  #tetris-next-canvas {
    width: 68px !important;
    height: 170px !important;
  }
}





/* ============================================================
   DAILY CYBER GAMES HUB (PLAN-020): WORDLE & SUDOKU STYLES
   ============================================================ */

/* Wordle Container & Grid */
.wordle-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.wordle-grid {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 5 / 6;
  margin: 0 auto;
  touch-action: manipulation;
  overscroll-behavior: none;
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.wordle-tile {
  aspect-ratio: 1 / 1;
  border: 2px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  background: rgba(8, 14, 28, 0.7);
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.05);
  transition: transform 0.12s ease, border-color 0.12s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  will-change: transform;
}

.wordle-tile.pop {
  transform: scale(1.1) translateZ(0);
  border-color: var(--color-primary);
}

.wordle-tile.green {
  background: linear-gradient(135deg, #00c853, #009624);
  border-color: #00e676;
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
  animation: flipTile 0.3s ease forwards;
}

.wordle-tile.yellow {
  background: linear-gradient(135deg, #ffd600, #ff9100);
  border-color: #ffea00;
  box-shadow: 0 0 15px rgba(255, 214, 0, 0.5);
  color: #000;
  animation: flipTile 0.3s ease forwards;
}

.wordle-tile.gray {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  animation: flipTile 0.3s ease forwards;
}

@keyframes flipTile {
  0% { transform: rotateX(0deg) translateZ(0); }
  50% { transform: rotateX(90deg) translateZ(0); }
  100% { transform: rotateX(0deg) translateZ(0); }
}

/* Wordle Keyboard - Mobile Ultra-Fast Response */
.wordle-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 480px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.wordle-kb-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  touch-action: manipulation;
}

.wordle-key {
  height: 48px;
  min-width: 30px;
  flex: 1;
  background: rgba(18, 26, 46, 0.9);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.06s ease, background-color 0.1s ease;
  will-change: transform;
}

.wordle-key:active {
  transform: translateY(2px) scale(0.96);
  background: var(--color-primary);
  color: #000;
}

.wordle-key.wide {
  flex: 1.5;
  font-size: 0.78rem;
  background: rgba(30, 42, 70, 0.9);
}

@media (max-width: 480px) {
  .wordle-container {
    gap: 0.75rem;
  }
  .wordle-grid {
    max-width: 280px;
    gap: 6px;
  }
  .wordle-row {
    gap: 6px;
  }
  .wordle-tile {
    font-size: 1.35rem;
    border-radius: 6px;
  }
  .wordle-keyboard {
    gap: 5px;
  }
  .wordle-kb-row {
    gap: 3px;
  }
  .wordle-key {
    height: 44px;
    min-width: 25px;
    font-size: 0.85rem;
    border-radius: 5px;
  }
  .wordle-key.wide {
    flex: 1.45;
    font-size: 0.7rem;
  }
}

.wordle-key.green {
  background: #00c853 !important;
  color: #fff !important;
  border-color: #00e676 !important;
}

.wordle-key.yellow {
  background: #ffab00 !important;
  color: #000 !important;
  border-color: #ffd600 !important;
}

.wordle-key.gray {
  background: rgba(255, 255, 255, 0.05) !important;
  color: rgba(255, 255, 255, 0.25) !important;
  border-color: transparent !important;
}

/* Sudoku 9x9 Board */
.sudoku-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  background: rgba(6, 10, 22, 0.95);
  border: 3px solid #00f0ff;
  border-radius: 8px;
  box-shadow: 0 0 25px rgba(0, 240, 255, 0.25);
  margin: 0 auto;
  user-select: none;
  overflow: hidden;
}

.sudoku-cell {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  position: relative;
  transition: background 0.12s ease;
}

/* 3x3 Box Bold Section Dividers */
.sudoku-cell:nth-child(3n) {
  border-right: 3px solid #00f0ff;
}
.sudoku-cell:nth-child(9n) {
  border-right: none;
}
.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
  border-bottom: 3px solid #00f0ff;
}
.sudoku-cell:nth-child(n+73):nth-child(-n+81) {
  border-bottom: none;
}

.sudoku-cell.clue {
  color: var(--color-primary);
  font-weight: 900;
  cursor: default;
}

.sudoku-cell.selected {
  background: rgba(0, 240, 255, 0.3) !important;
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.6);
}

.sudoku-cell.crosshair {
  background: rgba(0, 240, 255, 0.08);
}

.sudoku-cell.same-num {
  background: rgba(255, 170, 0, 0.2);
}

.sudoku-cell.error {
  color: var(--color-danger) !important;
  background: rgba(255, 0, 85, 0.25) !important;
  animation: shakeCell 0.3s ease;
}

@keyframes shakeCell {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* Sudoku Pencil Notes (Mini 3x3 inside cell) */
.sudoku-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  padding: 2px;
  box-sizing: border-box;
}

.sudoku-note-num {
  font-size: 0.55rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

/* Sudoku Controls & Keypad */
.sudoku-controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 420px;
  gap: 8px;
}

.sudoku-ctrl-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background: rgba(18, 26, 46, 0.85);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.sudoku-ctrl-btn.active {
  background: var(--color-accent);
  color: #000;
  border-color: var(--color-accent);
}

.sudoku-keypad {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 420px;
}

.sudoku-key {
  aspect-ratio: 1 / 1;
  background: rgba(18, 26, 46, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.1s ease;
  user-select: none;
}

.sudoku-key-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 2px;
}

.sudoku-key.completed {
  opacity: 0.45;
  border-color: rgba(0, 230, 118, 0.4);
  background: rgba(0, 230, 118, 0.08);
}

.sudoku-key.active {
  border-color: #ffaa00 !important;
  background: rgba(255, 170, 0, 0.22) !important;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.45);
  color: #ffaa00 !important;
}

.sudoku-key:active {
  transform: scale(0.92);
  background: var(--color-primary);
  color: #000;
}
