/* ==========================================
   Potly.Win - Space Arcade Theme
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --primary: #00E5FF;
  --primary-dark: #00B8D4;
  --primary-glow: rgba(0, 229, 255, 0.3);
  --accent: #FFD700;
  --accent-dark: #E8A520;
  --accent-glow: rgba(255, 215, 0, 0.25);
  --magenta: #E040A0;
  --magenta-glow: rgba(224, 64, 160, 0.3);
  --purple: #7B2FBE;
  --danger: #FF4444;
  --success: #00E676;
  --bg: #06060F;
  --bg-light: #0C0C1E;
  --bg-card: #0F0F24;
  --bg-card-hover: #14143A;
  --text: #E8EDF2;
  --text-muted: #6B7B8D;
  --border: #1A1A3E;
  --border-glow: #2A2A5E;
  --radius: 12px;
  --shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
  --font-pixel: 'Press Start 2P', monospace;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ==========================================
   ANIMATED SPACE BACKGROUND
   ========================================== */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(0,229,255,0.5) 50%, transparent 50%),
    radial-gradient(1px 1px at 40% 70%, rgba(224,64,160,0.4) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 60% 20%, rgba(123,47,190,0.5) 50%, transparent 50%),
    radial-gradient(1px 1px at 80% 50%, rgba(255,215,0,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 10% 80%, rgba(0,229,255,0.3) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 15%, rgba(224,64,160,0.4) 50%, transparent 50%),
    radial-gradient(1px 1px at 50% 90%, rgba(123,47,190,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 75% 85%, rgba(0,229,255,0.25) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 30% 50%, rgba(255,215,0,0.2) 50%, transparent 50%),
    radial-gradient(1px 1px at 15% 45%, rgba(224,64,160,0.3) 50%, transparent 50%),
    radial-gradient(1px 1px at 65% 55%, rgba(0,229,255,0.2) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 85% 75%, rgba(123,47,190,0.3) 50%, transparent 50%);
  pointer-events: none;
  animation: twinkle 8s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(600px circle at 20% 20%, rgba(123, 47, 190, 0.06), transparent 60%),
    radial-gradient(500px circle at 80% 70%, rgba(0, 229, 255, 0.04), transparent 60%),
    radial-gradient(400px circle at 50% 50%, rgba(224, 64, 160, 0.03), transparent 60%);
  pointer-events: none;
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* All visible content above the bg */
body > * {
  position: relative;
  z-index: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent);
}

/* ==========================================
   NAVIGATION
   ========================================== */

.nav {
  background: rgba(12, 12, 30, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-countdown-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-countdown-timer {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 2px;
}

.nav-brand-potly {
  background: linear-gradient(180deg, #FFFFFF 0%, #00E5FF 60%, #7B2FBE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-brand-win {
  background: linear-gradient(180deg, #FFFFFF 20%, #E040A0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.nav-user {
  color: var(--text-muted);
  font-size: 14px;
}

.nav-user strong {
  color: var(--primary);
  font-weight: 700;
}

/* Hamburger menu */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 20px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.nav-menu-items {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .nav-menu-items {
    display: none;
  }

  .nav-right.menu-open .nav-menu-items {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 200px;
    height: 200px;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 60px 16px 16px;
    gap: 8px;
    z-index: 1000;
  }
  
  .nav-right.menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 6, 15, 0.85);
    z-index: 999;
  }

  .nav-right.menu-open .hamburger {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1001;
  }

  .nav-right.menu-open .nav-menu-items .btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #000;
  box-shadow: 0 0 20px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--primary-glow), 0 4px 16px rgba(0,0,0,0.3);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #FFA000);
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-glow);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
  transform: translateY(-1px);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #CC0000);
  color: #FFF;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px;
}

.page-game {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
  padding-top: 24px;
}

/* ==========================================
   GAME AREA
   ========================================== */

.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-canvas-container {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.08), var(--shadow);
  position: relative;
  border: 1px solid var(--border);
}

#gameCanvas {
  display: block;
  cursor: pointer;
}

.game-controls {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
}

.game-controls span {
  color: var(--text-muted);
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s;
}

.card:hover {
  border-color: var(--border-glow);
}

.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 62, 0.3);
}

.card-header h3 {
  font-size: 11px;
  font-family: var(--font-pixel);
  font-weight: 400;
  color: var(--text);
  letter-spacing: 1px;
}

.card-body {
  padding: 16px 18px;
}

/* ==========================================
   PRIZE POOL CARD
   ========================================== */

.prize-pool-amount {
  font-size: 38px;
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  padding: 12px 0;
  text-shadow: 0 0 30px var(--accent-glow);
  font-family: var(--font-body);
}

.prize-pool-amount small {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  font-weight: 400;
  margin-top: 4px;
  text-shadow: none;
  font-family: var(--font-pixel);
  letter-spacing: 0.5px;
}

.prize-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.prize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-light);
  border-radius: 8px;
  font-size: 14px;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.prize-row:hover {
  border-color: var(--border-glow);
}

.prize-row .place {
  font-weight: 700;
}

.prize-row .place.gold { color: #FFD700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
.prize-row .place.silver { color: #C0C0C0; text-shadow: 0 0 8px rgba(192, 192, 192, 0.3); }
.prize-row .place.bronze { color: #CD7F32; text-shadow: 0 0 8px rgba(205, 127, 50, 0.3); }

/* ==========================================
   YOUR STATS CARD
   ========================================== */
   
.stats-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-family: 'Press Start 2P', monospace;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.stats-tab.active {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

/* ==========================================
   LEADERBOARD CARD
   ========================================== */

.leaderboard-tabs {
  display: flex;
  gap: 0;
}

.lb-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 10px;
  font-family: var(--font-pixel);
  font-weight: 400;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  transition: all 0.25s;
  letter-spacing: 0.5px;
}

.lb-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.lb-tab:hover {
  color: var(--text);
}

.leaderboard-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

.leaderboard-list::-webkit-scrollbar {
  width: 4px;
}
.leaderboard-list::-webkit-scrollbar-thumb {
  background: var(--border-glow);
  border-radius: 2px;
}

.lb-entry {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  gap: 12px;
  border-bottom: 1px solid rgba(26, 26, 62, 0.5);
  font-size: 14px;
  transition: background 0.2s;
}

.lb-entry:last-child {
  border-bottom: none;
}

.lb-entry:hover {
  background: rgba(0, 229, 255, 0.03);
}

.lb-entry.me {
  background: rgba(0, 229, 255, 0.06);
  border-left: 2px solid var(--primary);
}

.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 700;
  color: var(--text-muted);
}

.lb-rank.top-1 { color: #FFD700; font-size: 16px; }
.lb-rank.top-2 { color: #C0C0C0; font-size: 15px; }
.lb-rank.top-3 { color: #CD7F32; font-size: 15px; }

.lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.lb-score {
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px var(--primary-glow);
}

.lb-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
  font-size: 10px;
  font-family: var(--font-pixel);
  letter-spacing: 0.5px;
}

/* ==========================================
   YOUR STATS CARD
   ========================================== */

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

.stat-item {
  text-align: center;
  padding: 14px 10px;
  background: var(--bg-light);
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: border-color 0.3s;
}

.stat-item:hover {
  border-color: var(--border-glow);
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 12px var(--primary-glow);
}

.stat-label {
  font-size: 8px;
  font-family: var(--font-pixel);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ==========================================
   MODAL (Auth)
   ========================================== */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.06), var(--shadow);
}

.modal h2 {
  font-family: var(--font-pixel);
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--primary);
  text-shadow: 0 0 16px var(--primary-glow);
  letter-spacing: 1px;
}

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

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

.form-group label {
  display: block;
  font-size: 9px;
  font-family: var(--font-pixel);
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: all 0.25s;
}

.form-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 16px var(--primary-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 4px;
  display: none;
}

.form-error.visible {
  display: block;
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-footer .btn {
  width: 100%;
}

.modal-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */
.toast-container {
  position: fixed;
  top: 74px;
  right: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  animation: slideIn 0.3s ease;
  max-width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
}
.toast-success {
  background: rgba(0, 230, 118, 0.9);
  color: #fff;
  border-color: rgba(0, 230, 118, 0.6);
}
.toast-error {
  background: rgba(255, 68, 68, 0.9);
  color: #fff;
  border-color: rgba(255, 68, 68, 0.6);
}
.toast-info {
  background: rgba(0, 229, 255, 0.9);
  color: #fff;
  border-color: rgba(0, 229, 255, 0.6);
}
.toast-activity {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #b0b8c8);
  border-color: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 400;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.toast-activity strong {
  color: var(--primary, #00e5ff);
  font-weight: 700;
}
.toast-warning {
  background: rgba(255, 170, 0, 0.9);
  color: #fff;
  border-color: rgba(255, 170, 0, 0.6);
}
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideInCenter {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(-50%); opacity: 1; }
}

/* ==========================================
   HOMEPAGE - HERO
   ========================================== */

.hero {
  text-align: center;
  padding: 56px 20px 24px;
}

.hero-logo {
  width: 380px;
  max-width: 90vw;
  margin: 0 auto 28px;
  display: block;
  filter: drop-shadow(0 0 40px rgba(0, 229, 255, 0.15)) drop-shadow(0 0 80px rgba(123, 47, 190, 0.1));
  animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero-tagline {
  font-family: var(--font-pixel);
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 14px;
  line-height: 1.8;
}

.hero-tagline .text-cyan {
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

.hero-tagline .text-gold {
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent-glow);
}

.hero p {
  color: var(--text-muted);
  font-size: 16px;
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-cta {
  margin-top: 28px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================
   HOMEPAGE - SECTION TITLES
   ========================================== */

.section-title {
  font-family: var(--font-pixel);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--text-muted);
  text-align: center;
  margin: 36px 0 20px;
  text-transform: uppercase;
}

/* ==========================================
   HOMEPAGE - GAMES GRID
   ========================================== */

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0 20px 40px;
  max-width: 960px;
  margin: 0 auto;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity 0.3s;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.04), rgba(123, 47, 190, 0.04));
  pointer-events: none;
  z-index: 1;
}

.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.08), 0 12px 40px rgba(0,0,0,0.4);
  border-color: var(--primary);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card-thumb {
  height: 160px;
  background: linear-gradient(135deg, #0A0A2E 0%, #1A0A3E 50%, #0A1A2E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  position: relative;
  overflow: hidden;
}

.game-card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 60%, var(--bg-card));
}

.game-card-body {
  padding: 18px;
  position: relative;
  z-index: 2;
}

.game-card-body h3 {
  font-family: var(--font-pixel);
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.game-card-body p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.game-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-card-prize {
  color: var(--accent);
  font-weight: 800;
  font-size: 16px;
  text-shadow: 0 0 12px var(--accent-glow);
}

.game-card-plays {
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-pixel);
  letter-spacing: 0.5px;
}

.game-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-pixel);
  font-size: 7px;
  background: rgba(0, 229, 255, 0.15);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
  border: 1px solid rgba(0, 229, 255, 0.2);
  z-index: 2;
}

.game-card.coming-soon {
  opacity: 0.4;
  cursor: default;
}

.game-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.game-card.coming-soon::before {
  display: none;
}

/* ==========================================
   HOW IT WORKS SECTION
   ========================================== */

.how-it-works {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 20px 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.how-step {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.3s;
}

.how-step:hover {
  border-color: var(--border-glow);
}

.how-step-icon {
  font-size: 36px;
  margin-bottom: 14px;
  display: block;
}

.how-step-title {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 10px;
  color: var(--primary);
  text-shadow: 0 0 10px var(--primary-glow);
}

.how-step-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (max-width: 768px) {
  .ad-arrow-text {
    text-align: center !important;
  }
  .ad-arrow-text span {
    padding-right: 0 !important;
  }
}

/* ==========================================
   SITE FOOTER
   ========================================== */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 20px 24px;
  margin-top: 40px;
}

.footer-content-grid {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.footer-col .footer-brand {
  font-family: var(--font-pixel);
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.footer-about {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-col-title {
  font-family: var(--font-pixel);
  font-size: 9px;
  color: var(--text);
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s;
  text-decoration: none;
}

.footer-socials a:hover {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
  transform: translateY(-2px);
}

.footer-bottom {
  max-width: 960px;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
}

@media (max-width: 768px) {
  .footer-content-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .footer-content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ==========================================
   SCORE POPUP (in-game)
   ========================================== */

.score-popup {
  display: none;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 14px 24px;
  text-align: center;
  z-index: 10;
  box-shadow: 0 0 30px var(--primary-glow), var(--shadow);
}

.score-popup.visible {
  display: block;
  animation: slideInCenter 0.3s ease;
}

.score-popup .rank-info {
  font-size: 11px;
  font-family: var(--font-pixel);
  color: var(--accent);
  font-weight: 400;
  text-shadow: 0 0 10px var(--accent-glow);
  letter-spacing: 0.5px;
}

/* ==========================================
   PIXEL PARTICLE CANVAS
   ========================================== */

#pixelParticles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  margin-top: 40px;
}
.footer-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer-brand {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--primary);
}
.footer-links {
  display: flex;
  gap: 24px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-copy {
  color: var(--text-muted);
  font-size: 11px;
}

/* ==========================================
   SHARE BUTTON (in score popup)
   ========================================== */

.share-score-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 18px;
  font-family: var(--font-pixel);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--primary);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}

.share-score-btn:hover {
  background: rgba(0, 229, 255, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.2);
}

.share-score-btn:active {
  transform: scale(0.96);
}

.share-score-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================
   SHARE MODAL (desktop fallback)
   ========================================== */

.share-modal-overlay {
  display: flex;
  position: fixed;
  inset: 0;
  background: rgba(6, 3, 24, 0.0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, backdrop-filter 0.3s;
  pointer-events: none;
}

.share-modal-overlay.active {
  opacity: 1;
  background: rgba(6, 3, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.share-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 20px;
  width: 380px;
  max-width: 92vw;
  transform: translateY(20px) scale(0.96);
  transition: transform 0.25s ease;
  box-shadow: 0 0 60px rgba(0, 229, 255, 0.08), 0 20px 60px rgba(0, 0, 0, 0.6);
  position: relative;
}

.share-modal-overlay.active .share-modal {
  transform: translateY(0) scale(1);
}

.share-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.share-modal-close:hover {
  color: var(--text-primary);
}

.share-modal-preview {
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.share-modal-preview img {
  width: 100%;
  height: auto;
  display: block;
}

.share-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-primary);
  background: var(--bg-light);
}

.share-btn:hover {
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.04);
}

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

.share-btn-x {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.share-btn-x:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.share-btn-download {
  color: var(--primary);
  border-color: rgba(0, 229, 255, 0.2);
}

.share-btn-download:hover {
  border-color: var(--primary);
  background: rgba(0, 229, 255, 0.06);
}

.share-btn-copy {
  color: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .share-modal {
    width: 92vw;
    padding: 16px;
  }

  .share-score-btn {
    font-size: 8px;
    padding: 7px 14px;
  }
}

/* ==========================================
   MOBILE RESPONSIVE - Potly.Win
   ========================================== */

/* ---- Tablet (768px and below) ---- */
@media (max-width: 768px) {

  /* Nav */
  .nav {
    padding: 0 12px;
    height: 48px;
  }

  .nav-brand {
    font-size: 12px;
  }

  .nav-right {
    gap: 6px;
  }

  .nav-countdown {
    display: none;
  }

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

  /* Container */
  .container {
    padding: 8px;
  }

  /* Hero */
  .hero {
    padding: 24px 16px 20px;
  }

  .hero-logo {
    width: 220px;
  }

  .hero-tagline {
    font-size: 10px;
  }

  .hero p {
    font-size: 13px;
    padding: 0 8px;
  }

  .hero-cta {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .hero-cta .btn {
    width: 80%;
    max-width: 280px;
  }

  /* How It Works */
  .how-it-works {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 16px 24px;
  }

  .how-step {
    padding: 16px;
  }

  .how-step-icon {
    font-size: 28px;
  }

  /* Games Grid */
  .games-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px 32px;
  }

  .game-card-thumb {
    height: 160px;
  }

  /* Section Titles */
  .section-title {
    font-size: 14px;
  }

  /* Game Page Layout */
  .page-game {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 12px;
  }

  /* Game Canvas - Full Width */
  .game-wrapper {
    width: 100%;
  }

  .game-canvas-container {
    width: 100%;
    max-width: 100%;
  }

  #gameCanvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    display: block;
  }

  /* Game Controls */
  .game-controls {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
  }

  /* Score Popup */
.score-popup {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 16px);
    max-width: 300px;
    font-size: 13px;
  }

  /* Sidebar Cards */
  .sidebar {
    gap: 12px;
  }

  .card {
    margin: 0;
  }

  .card-header h3 {
    font-size: 13px;
  }

  /* Prize Pool */
  .prize-pool-amount {
    font-size: 28px;
  }
}