:root {
  --primary: #60A5FA;
  --secondary: #5FA8D3;
  --accent: #B3EFCB;
  --dark: #0D1B2A;
  --light: #EAEAEA;
  --text-muted: #DDE2E9;
  --bg-primary: #0D1B2A;
  --bg-secondary: rgba(13, 27, 42, 0.5);
  --bg-tertiary: rgba(13, 27, 42, 0.3);
  --text-primary: #EAEAEA;
  --text-secondary: #94a3b8;
  --border-color: rgba(148, 163, 184, 0.2);
  --nav-bg: rgba(13, 27, 42, 0.95);
  --card-bg: rgba(13, 27, 42, 0.55);
  --shadow: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] {
  --primary: #4361EE;
  --secondary: #0284C7;
  --accent: #10B981;
  --dark: #FFFFFF;
  --light: #1E293B;
  --text-muted: #6B7280;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --text-primary: #111827;
  --text-secondary: #374151;
  --border-color: #D1D5DB;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --card-bg: #FFFFFF;
  --shadow: rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  padding-top: 56px;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container.narrow {
  max-width: 900px;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  padding: 0.85rem 0;
}

.nav-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.nav-content {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.nav-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: nowrap;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 0.45rem 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  transition: width 0.3s ease;
}

[data-theme="light"] .nav-links a::after {
  background: var(--primary);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

.theme-toggle {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px var(--shadow);
}

.theme-toggle i {
  font-size: 0.9rem;
}

.theme-toggle:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.subpage-main {
  padding: 0.75rem 0 3rem;
}

.page-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.page-eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.page-title {
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  margin: 0.25rem 0;
  font-weight: 700;
}

.page-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0.5rem auto 0;
}

.content-card {
  background: var(--card-bg);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

[data-theme="light"] .content-card {
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.08);
}

.content-card + .content-card {
  margin-top: 1rem;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  min-height: 44px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(96, 165, 250, 0.35);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(90deg, #34d399, #059669);
}

.stacked {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.game-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.info-banner {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.stat-pill {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-weight: 600;
}

textarea,
input[type="text"],
input[type="number"] {
  width: 100%;
  border-radius: 0.85rem;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  font-family: inherit;
  resize: vertical;
  transition: border 0.2s ease, background 0.2s ease;
}

textarea:focus,
input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(96, 165, 250, 0.08);
}

.results-panel {
  border-radius: 0.85rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.results-panel:empty {
  display: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chip-btn {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.chip-btn:hover {
  background: rgba(96, 165, 250, 0.15);
  transform: translateY(-1px);
}

.note {
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 768px) {
  body {
    padding-top: 64px;
  }

  .content-card {
    padding: 1.25rem;
  }

  .btn {
    width: 100%;
  }
}

