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

:root {
  --bg:       #1a1a2e;
  --surface:  #16213e;
  --surface2: #0f3460;
  --accent:   #e94560;
  --accent2:  #a0c4ff;
  --text:     #eee;
  --muted:    #888;
  --border:   #2a2a4a;
  --correct:  #2ecc71;
  --font:     -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--text); }

/* ── Nav ── */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

.nav-back {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-back:hover { color: var(--text); }

/* ── Ad Slots ── */
.ad-slot {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 1rem auto;
}

.ad-rectangle {
  width: 300px;
  min-height: 250px;
  flex-shrink: 0;
}

.ad-mobile-banner {
  width: 100%;
  height: 60px;
  margin: 1rem 0;
  display: none;
}

/* ── Layout helpers ── */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-with-sidebar {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.page-main { flex: 1; min-width: 0; }
.page-sidebar { width: 300px; flex-shrink: 0; padding-top: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--accent2); border: 1px solid var(--accent2); }
.btn-ghost { background: none; color: var(--muted); border: 1px solid var(--border); }

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

/* ── Section spacing ── */
.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ── Mobile / Tablet ── */

/* Tablet (768px–1024px): sidebar collapses, ads reflow */
@media (max-width: 1024px) {
  .page-with-sidebar { flex-direction: column; }
  .page-sidebar {
    width: 100%;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
  }
  .page-sidebar > div { flex: 1; min-width: 280px; }
  /* Show rectangle ads inline at full width on tablet */
  .ad-rectangle {
    width: 100%;
    min-height: 100px;
  }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
  .ad-leaderboard { height: 60px; max-width: 100%; }
  .ad-mobile-banner { display: flex; }
  .nav-links { display: none; }
  .container { padding: 0 1rem; }
}

/* Tablet also shows in-content ads */
@media (max-width: 1024px) {
  .ad-mobile-banner { display: flex; }
}
