/* ════════════════════════════════════════════════
   GAMES OF TYPING — Shell CSS
   Brand: Blue #3B82F6 + Emerald #10B981
   Font: Nunito (headings) + Noto Sans (body)
════════════════════════════════════════════════ */

:root {
  --blue:        #3B82F6;
  --blue-dark:   #1D4ED8;
  --blue-light:  #DBEAFE;
  --emerald:     #10B981;
  --emerald-dark:#059669;
  --gold:        #F59E0B;
  --red:         #EF4444;
  --bg:          #0F172A;
  --bg-card:     #1E293B;
  --bg-card2:    #273449;
  --text:        #F1F5F9;
  --text-muted:  #94A3B8;
  --border:      #334155;
  --radius:      16px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
}

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

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans', sans-serif;
  font-size: 15px;
  overflow: hidden;
}

/* ── SCREENS ─────────────────────────────────── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  overflow-y: auto;
}
.screen.active { display: flex; flex-direction: column; }

/* ── LOADING SCREEN ──────────────────────────── */
#screen-loading {
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, #1a3a6e 0%, #0F172A 70%);
}
.loading-inner { text-align: center; width: 320px; }
.loading-mascot {
  font-size: 72px;
  animation: float 2.5s ease-in-out infinite;
  display: block; margin-bottom: 16px;
}
.loading-title {
  font-family: 'Nunito', sans-serif;
  font-size: 32px; font-weight: 900;
  color: var(--blue); margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.loading-tip {
  color: var(--text-muted); font-size: 13px;
  margin-bottom: 24px; min-height: 20px;
}
.loading-bar-track {
  width: 100%; height: 8px;
  background: var(--border); border-radius: 99px; overflow: hidden;
}
.loading-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--emerald));
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ── LOGIN SCREEN ────────────────────────────── */
#screen-login {
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1a3a6e 0%, #0F172A 70%);
}

/* ── CENTER CARD (reusable) ──────────────────── */
.center-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 48px;
  max-width: 480px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
  align-items: center;
}
.center-card h2 {
  font-family: 'Nunito', sans-serif;
  font-size: 24px; font-weight: 800;
  color: var(--text);
}
.center-card p { color: var(--text-muted); line-height: 1.5; }
.hint { font-size: 12px; color: var(--text-muted); }
.mascot-large { font-size: 64px; }

/* ── TOP BAR ─────────────────────────────────── */
.top-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.site-logo {
  font-family: 'Nunito', sans-serif;
  font-size: 18px; font-weight: 900;
  color: var(--blue);
}
.top-bar-center { display: flex; gap: 12px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.stat-chip {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px 14px; font-size: 13px; font-weight: 600;
}
.username-badge {
  font-weight: 700; font-size: 14px; color: var(--text);
}
.plan-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.plan-badge.free    { background: var(--border); color: var(--text-muted); }
.plan-badge.india   { background: #FF670020; color: #FF6700; border: 1px solid #FF6700; }
.plan-badge.day     { background: #F59E0B20; color: var(--gold); border: 1px solid var(--gold); }
.plan-badge.monthly { background: #10B98120; color: var(--emerald); border: 1px solid var(--emerald); }

/* ── LANGUAGE BAR ────────────────────────────── */
.language-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.language-label { font-size: 13px; color: var(--text-muted); margin-right: 4px; }
.lang-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 5px 14px; font-size: 13px;
  cursor: pointer; transition: all 0.15s;
  font-family: 'Noto Sans', sans-serif;
}
.lang-btn:hover { border-color: var(--blue); color: var(--text); }
.lang-btn.active {
  background: var(--blue); border-color: var(--blue);
  color: white; font-weight: 700;
}

/* ── GAMES GRID ──────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column;
  gap: 12px; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.game-card.unlocked:hover {
  transform: translateY(-3px);
  border-color: var(--blue);
  box-shadow: 0 8px 32px rgba(59,130,246,0.2);
}
.game-card.locked {
  opacity: 0.55; cursor: default;
}
.game-card-icon { font-size: 40px; }
.game-card-info h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 16px; font-weight: 800;
  color: var(--text); margin-bottom: 4px;
}
.game-card-info p { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.game-card-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.stars { color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.levels-badge {
  font-size: 11px; color: var(--emerald);
  border: 1px solid var(--emerald);
  border-radius: 99px; padding: 2px 8px;
}
.lock-msg { font-size: 11px; color: var(--text-muted); }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 99px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: 14px;
  cursor: pointer; border: none;
  transition: all 0.15s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue); color: white;
  box-shadow: 0 2px 12px rgba(59,130,246,0.4);
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  font-size: 13px; padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text); }
.btn-play {
  background: linear-gradient(135deg, var(--emerald), var(--blue));
  color: white; width: 100%; margin-top: auto;
  box-shadow: 0 2px 12px rgba(16,185,129,0.3);
}
.btn-play:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-locked {
  background: var(--border); color: var(--text-muted);
  width: 100%; cursor: not-allowed; margin-top: auto;
}
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── UPGRADE SCREEN ──────────────────────────── */
#screen-upgrade {
  align-items: center; justify-content: center;
  background: rgba(15,23,42,0.96);
}
.upgrade-card { max-width: 640px; gap: 16px; }
.upgrade-icon { font-size: 56px; }
.upgrade-plans {
  display: flex; gap: 12px; width: 100%; margin: 8px 0;
}
.plan-option {
  flex: 1; background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px; text-align: center;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.plan-option.featured {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px var(--blue-light);
}
.plan-badge-top {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--blue); color: white;
  font-size: 11px; font-weight: 700;
  padding: 2px 12px; border-radius: 99px;
}
.plan-name { font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 15px; }
.plan-price { font-size: 24px; font-weight: 900; color: var(--blue); }
.plan-price span { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* ── GAME SCREEN ─────────────────────────────── */
#screen-game { background: var(--bg); }
.game-top-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(15,23,42,0.9);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 10;
}
.game-hud { display: flex; gap: 20px; }
.hud-item {
  font-family: 'Nunito', sans-serif;
  font-size: 15px; font-weight: 700;
}
#game-canvas-container {
  flex: 1; display: flex;
  align-items: center; justify-content: center;
  overflow: hidden;
}

/* ── LEVEL COMPLETE ──────────────────────────── */
#screen-level-complete {
  align-items: center; justify-content: center;
  background: rgba(15,23,42,0.95);
}
.results-card { max-width: 440px; gap: 16px; }
.stars-display { font-size: 40px; letter-spacing: 8px; color: var(--gold); }
.result-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; width: 100%;
}
.result-stat {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px; text-align: center;
}
.result-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.result-value {
  font-family: 'Nunito', sans-serif;
  font-size: 22px; font-weight: 900; color: var(--blue);
}
.result-buttons { display: flex; gap: 10px; }
.achievement-banner {
  background: #F59E0B20; border: 1px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 10px 16px; font-size: 13px;
  color: var(--gold); width: 100%; text-align: left;
}

/* ── OVERLAY ─────────────────────────────────── */
.overlay {
  position: absolute; inset: 0;
  background: rgba(15,23,42,0.9);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.overlay.hidden { display: none; }

/* ── ANIMATIONS ──────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-12px); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.active .center-card { animation: fadeIn 0.3s ease; }

/* ── MENU SCREEN LAYOUT ──────────────────────── */
#screen-menu {
  height: 100vh; overflow: hidden;
}
