/* ═══════════════════════════════════════════════════════════
   GRAMMAR GAMES — SHARED STYLESHEET
   Used by: index.html, grammar-quiz.html, grammar-race-host.html,
            grammar-race-player.html, achievements.html
═══════════════════════════════════════════════════════════ */

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

/* ─── DESIGN TOKENS ─── */
:root {
  --primary:        #667eea;
  --secondary:      #764ba2;
  --gradient:       linear-gradient(135deg, #667eea, #764ba2);
  --gradient-light: linear-gradient(135deg, #e8ecff, #f3e8ff);
  --bg:             #f0f2ff;
  --surface:        #ffffff;
  --surface2:       #f8f9ff;
  --border:         #e2e6ff;
  --border-dark:    #c9d0f5;
  --text:           #2d3561;
  --muted:          #7a82b8;
  --success:        #28a745;
  --danger:         #e94560;
  --warning:        #f6a623;
  --shadow:         0 4px 24px rgba(102,126,234,0.12);
  --shadow-lg:      0 12px 48px rgba(102,126,234,0.2);
  --radius:         16px;
  --radius-sm:      10px;
}

/* ─── BASE ─── */
body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── NAVIGATION ─── */
.site-nav {
  background: var(--surface);
  border-bottom: 1.5px solid var(--border);
  position: sticky; top: 0; z-index: 9999;
  box-shadow: 0 2px 12px rgba(102,126,234,0.08);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 24px; height: 56px;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo {
  font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 17px;
  color: var(--primary); text-decoration: none;
  display: flex; align-items: center; gap: 7px;
  margin-right: 12px; white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 10px;
  font-family: 'Nunito', sans-serif; font-size: 13px; font-weight: 700;
  color: var(--muted); text-decoration: none;
  transition: all 0.15s; white-space: nowrap;
}
.nav-link:hover { background: var(--gradient-light); color: var(--primary); }
.nav-link.active {
  background: var(--gradient); color: #fff;
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}
.nav-hamburger {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: none; cursor: pointer;
  padding: 6px; margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--primary); border-radius: 2px;
  transition: all 0.2s;
}
.nav-mobile {
  display: none; flex-direction: column;
  padding: 8px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.nav-mobile a {
  padding: 11px 16px; border-radius: 10px;
  font-family: 'Nunito', sans-serif; font-weight: 700;
  color: var(--text); text-decoration: none; font-size: 14px;
  transition: background 0.15s;
}
.nav-mobile a:hover { background: var(--gradient-light); color: var(--primary); }
.nav-mobile.open { display: flex; }
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
}

/* ─── SHARED BUTTONS ─── */
.btn-primary {
  background: var(--gradient); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 12px 32px;
  font-family: 'Fredoka One', sans-serif; font-size: 16px;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(102,126,234,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(102,126,234,0.35); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #c0392b); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: 10px 22px;
  font-family: 'Fredoka One', sans-serif; font-size: 15px;
  cursor: pointer; transition: all 0.2s;
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(233,69,96,0.3); }
.btn-secondary {
  background: var(--surface); border: 1.5px solid var(--border); color: var(--primary);
  border-radius: var(--radius-sm); padding: 10px 22px;
  font-family: 'Fredoka One', sans-serif; font-size: 15px;
  cursor: pointer; transition: all 0.2s; font-weight: 700;
}
.btn-secondary:hover { background: var(--gradient-light); border-color: var(--primary); }

/* ─── SHARED FORM ELEMENTS ─── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-weight: 800; margin-bottom: 6px;
}
.form-input, .form-select {
  width: 100%; background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
  font-family: 'Nunito', sans-serif; font-size: 14px;
  color: var(--text); outline: none; transition: border-color 0.15s;
}
.form-input:focus, .form-select:focus { border-color: var(--primary); }

/* ─── SHARED CARD ─── */
.card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ─── SECTION TITLE ─── */
.section-title {
  font-family: 'Fredoka One', sans-serif; font-size: 18px;
  color: var(--primary); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}

/* ─── NAV SCRIPT (inline, included at bottom of every page) ─── */
/* See shared.js */
