:root {
  --bg-primary: #07090e;
  --gold-primary: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.45);
  --cyan-primary: #06b6d4;
  --glass-bg: rgba(15, 20, 32, 0.75);
  --glass-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

html, body {
  width: 100%;
  max-width: 100vw;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Outfit', sans-serif;
  user-select: none;
  touch-action: none;
}

/* Nav */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  background: rgba(10, 12, 18, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-back-link:hover { color: #fff; }
.back-arrow { font-size: 1.4rem; line-height: 1; }
.nav-divider { color: var(--text-muted); opacity: 0.35; }

.game-badge {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--gold-primary);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 12px;
}

.nav-icon-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-primary);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 1.5px;
}

/* Canvas Container */
.canvas-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#gameCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* HUD Top */
.hud-top {
  position: absolute;
  top: 70px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 50;
}

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

.score-number {
  font-family: 'Cinzel', serif;
  font-size: 4.5rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.4);
  line-height: 1;
}

.score-label {
  font-size: 0.8rem;
  letter-spacing: 3px;
  color: var(--gold-primary);
  font-weight: 700;
  margin-top: 4px;
}

.best-display {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.best-number {
  color: #fff;
  font-weight: 800;
}

/* Combo Banner */
.combo-banner {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
  color: #000;
  padding: 6px 18px;
  border-radius: 20px;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 1px;
  box-shadow: 0 0 25px var(--gold-glow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 60;
}

.combo-banner.show {
  opacity: 1;
  transform: translateX(-50%) scale(1.1);
}

/* Screen Overlays */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 14, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 70;
}

.overlay-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 36px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.game-title {
  font-family: 'Cinzel', serif;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.highlight-gold {
  color: var(--gold-primary);
  text-shadow: 0 0 15px var(--gold-glow);
}

.game-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.instructions-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  text-align: left;
}

.play-btn {
  background: linear-gradient(135deg, var(--gold-primary) 0%, #d97706 100%);
  color: #000;
  border: none;
  padding: 15px 36px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--gold-glow);
  transition: all 0.25s;
  width: 100%;
}

.play-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.game-over-title {
  font-family: 'Cinzel', serif;
  color: #ef4444;
  font-size: 1.8rem;
  margin-bottom: 14px;
}

.final-score-box {
  margin-bottom: 16px;
}

.final-score-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.final-score-val {
  font-family: 'Cinzel', serif;
  font-size: 3.5rem;
  font-weight: 900;
  color: #fff;
}

.final-stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.final-stats strong {
  color: var(--gold-primary);
}

/* Auth Bar Start Styles */
.auth-bar-start {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
  min-height: 42px;
}
.auth-bar-start .skibidi-logged-out {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}
.auth-bar-start .skibidi-google-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  width: 100%;
}
.skibidi-google-custom-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 9999px !important;
  padding: 8px 18px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  width: auto !important;
  line-height: normal !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}
.skibidi-google-custom-btn:hover {
  background: #f3f4f6 !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
  transform: translateY(-1px) !important;
}
.skibidi-google-custom-btn:active {
  transform: translateY(1px) !important;
}
.skibidi-user-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(245, 158, 11, 0.18) !important;
  border: 1.5px solid #f59e0b !important;
  color: #fef08a !important;
  padding: 6px 14px !important;
  border-radius: 9999px !important;
  font-size: 0.9rem !important;
  font-weight: 800 !important;
}
.skibidi-logout-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  color: #fca5a5 !important;
  border: 1.5px solid #ef4444 !important;
  border-radius: 9999px !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}
.skibidi-logout-btn:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  color: #ffffff !important;
}

