:root {
  --bg-primary: #0a0c12;
  --bg-secondary: #121622;
  --gold-primary: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.45);
  --cyan-primary: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.4);
  --green-correct: #10b981;
  --yellow-present: #f59e0b;
  --grey-absent: #334155;
  --glass-bg: rgba(18, 22, 34, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --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;
  overflow-x: hidden;
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ambient-bg-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
}

.glow-1 {
  width: 450px;
  height: 450px;
  background: var(--gold-primary);
  top: -100px;
  left: -100px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: var(--cyan-primary);
  bottom: -150px;
  right: -150px;
}

/* 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.85);
  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;
}

/* Container */
.game-container {
  position: relative;
  z-index: 10;
  margin: 66px auto 20px auto;
  max-width: 500px;
  width: 100%;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Header */
.game-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.main-title {
  font-family: 'Cinzel', serif;
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

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

.tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.stats-bar {
  display: flex;
  gap: 8px;
}

.stat-box {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 5px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  font-weight: 700;
}

.stat-val {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.hint-box {
  cursor: pointer;
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.4);
  transition: all 0.2s;
}

.hint-box:hover {
  background: rgba(6, 182, 212, 0.25);
}

/* Toast */
.toast-message {
  min-height: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold-primary);
  margin-bottom: 8px;
  text-align: center;
}

/* Grid */
.board-wrapper {
  margin-bottom: 16px;
}

.cipher-grid {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  padding: 6px;
}

.cipher-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.letter-cell {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
  transition: transform 0.2s, border-color 0.15s;
}

.letter-cell.active-input {
  border-color: var(--gold-primary);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
  transform: scale(1.05);
}

.letter-cell.correct {
  background: var(--green-correct);
  border-color: var(--green-correct);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.letter-cell.present {
  background: var(--yellow-present);
  border-color: var(--yellow-present);
  color: #000;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.letter-cell.absent {
  background: var(--grey-absent);
  border-color: var(--grey-absent);
  color: #64748b;
}

/* Keyboard */
.keyboard {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kb-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.kb-key {
  flex: 1;
  height: 46px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.1s;
}

.kb-key:active {
  transform: scale(0.95);
  background: rgba(245, 158, 11, 0.3);
}

.kb-action {
  flex: 1.5;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.kb-key.correct {
  background: var(--green-correct) !important;
  color: #fff;
}

.kb-key.present {
  background: var(--yellow-present) !important;
  color: #000;
}

.kb-key.absent {
  background: #1e293b !important;
  color: #475569 !important;
}

/* Overlays */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 9, 14, 0.85);
  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: 32px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

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

.secret-reveal-box {
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

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

.reveal-word {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 4px;
}

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

.final-stats strong { color: #fff; }

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

@media (max-width: 420px) {
  .letter-cell {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
  }
  .kb-key {
    height: 42px;
    font-size: 0.9rem;
  }
}

/* Auth Bar Start Styles */
.auth-bar-start {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  min-height: 40px;
}
.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: 38px;
  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: 7px 16px !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !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: 5px 12px !important;
  border-radius: 9999px !important;
  font-size: 0.85rem !important;
  font-weight: 800 !important;
}
.skibidi-logout-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  padding: 5px 12px !important;
  font-size: 0.78rem !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;
}

