/* ═══════════════════════════════════════════════════════════
   OGameX Tools — Global Stylesheet v3
   Dark/Light mode · Space animated bg · Community · No API
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

/* ─────────────────────────────────────────────
   DARK MODE (default)
───────────────────────────────────────────── */
:root,
[data-theme="dark"] {
  --bg-page:       #060810;
  --bg-deep:       #0b0e1c;
  --bg-surface:    #111628;
  --bg-raised:     #17203a;
  --bg-card:       #1c2840;
  --bg-card-hover: #222f4d;
  --bg-input:      #141e34;

  --border-dim:    rgba(100,140,230,0.10);
  --border-soft:   rgba(100,140,230,0.22);
  --border-glow:   rgba(100,140,230,0.42);

  --text-1: #e8f0ff;
  --text-2: rgba(232,240,255,0.60);
  --text-3: rgba(232,240,255,0.35);

  --blue:        #4d84e8;
  --blue-light:  #7aaeff;
  --blue-pale:   rgba(77,132,232,0.10);
  --blue-glow:   rgba(77,132,232,0.18);
  --teal:        #1ecda8;
  --teal-pale:   rgba(30,205,168,0.10);
  --gold:        #f0b429;
  --gold-pale:   rgba(240,180,41,0.10);
  --coral:       #f06050;
  --purple:      #9b72f8;

  --badge-free-bg:   rgba(30,205,168,0.10);
  --badge-free-text: #1ecda8;
  --badge-free-bdr:  rgba(30,205,168,0.22);
  --badge-wiki-bg:   rgba(240,180,41,0.10);
  --badge-wiki-text: #f0b429;
  --badge-wiki-bdr:  rgba(240,180,41,0.22);
  --badge-soon-bg:   rgba(232,240,255,0.05);
  --badge-soon-text: rgba(232,240,255,0.35);
  --badge-soon-bdr:  rgba(232,240,255,0.10);

  --nav-bg:        rgba(6,8,16,0.82);
  --footer-bg:     #0b0e1c;

  --shadow-card:   0 2px 20px rgba(0,0,0,0.40), 0 1px 4px rgba(0,0,0,0.25);
  --shadow-hover:  0 8px 40px rgba(77,132,232,0.22), 0 2px 8px rgba(0,0,0,0.35);

  --mode-icon: '☀️';
}

/* ─────────────────────────────────────────────
   LIGHT MODE
───────────────────────────────────────────── */
[data-theme="light"] {
  --bg-page:       #f0f4ff;
  --bg-deep:       #e4ecff;
  --bg-surface:    #ffffff;
  --bg-raised:     #f6f9ff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f0f6ff;
  --bg-input:      #f6f9ff;

  --border-dim:    rgba(59,111,212,0.12);
  --border-soft:   rgba(59,111,212,0.25);
  --border-glow:   rgba(59,111,212,0.45);

  --text-1: #12203a;
  --text-2: #3a4e6a;
  --text-3: #8090b0;

  --blue:        #2c5cc5;
  --blue-light:  #3b6fd4;
  --blue-pale:   rgba(59,111,212,0.08);
  --blue-glow:   rgba(59,111,212,0.12);
  --teal:        #0e9e7e;
  --teal-pale:   rgba(14,158,126,0.08);
  --gold:        #c88a00;
  --gold-pale:   rgba(200,138,0,0.08);
  --coral:       #d44030;
  --purple:      #7c52e0;

  --badge-free-bg:   rgba(14,158,126,0.08);
  --badge-free-text: #0a7a60;
  --badge-free-bdr:  rgba(14,158,126,0.2);
  --badge-wiki-bg:   rgba(200,138,0,0.08);
  --badge-wiki-text: #9a6a00;
  --badge-wiki-bdr:  rgba(200,138,0,0.2);
  --badge-soon-bg:   rgba(59,111,212,0.06);
  --badge-soon-text: #8090b0;
  --badge-soon-bdr:  rgba(59,111,212,0.12);

  --nav-bg:        rgba(240,244,255,0.90);
  --footer-bg:     #e4ecff;

  --shadow-card:   0 2px 12px rgba(59,111,212,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover:  0 8px 32px rgba(59,111,212,0.18), 0 2px 6px rgba(0,0,0,0.08);

  --mode-icon: '🌙';
}

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg-page);
  color: var(--text-1);
  font-family: 'Nunito', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
button { font-family: 'Nunito', sans-serif; cursor: pointer; border: none; background: none; }

/* ─────────────────────────────────────────────
   SPACE BACKGROUND CANVAS
───────────────────────────────────────────── */
#space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.5s;
}

[data-theme="light"] #space-bg { opacity: 0.35; }

/* ─────────────────────────────────────────────
   LAYOUT
───────────────────────────────────────────── */
.site-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content { flex: 1; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─────────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.3s, border-color 0.3s;
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo-icon { width: 32px; height: 32px; }

.nav-logo-text {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text-1);
  line-height: 1.1;
}

.nav-logo-text span { color: var(--blue); }

.nav-logo-domain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--text-3);
  letter-spacing: 0.05em;
  display: block;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-2);
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--blue-pale);
  color: var(--blue-light);
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
  color: var(--blue);
}

.nav-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--gold-pale);
  color: var(--gold);
  border: 1px solid rgba(240,180,41,0.22);
}

/* Nav right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-dim);
  color: var(--text-2);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--bg-card);
  border-color: var(--border-soft);
}

/* Account badge (future login) */
.nav-account-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-3);
  border: 1px solid var(--border-dim);
  border-radius: 8px;
  position: relative;
  cursor: default;
  transition: border-color 0.15s;
}

.nav-account-hint:hover { border-color: var(--border-soft); }

.nav-account-hint::after {
  content: 'Coming later';
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--gold);
  white-space: nowrap;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.nav-account-hint:hover::after { opacity: 1; }

/* ─────────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────────── */
.page-header {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--border-dim);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 65% 55% at 60% 50%, var(--blue-glow) 0%, transparent 70%);
  pointer-events: none;
}

.page-header .container { position: relative; z-index: 1; }

.page-header-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header-eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--blue);
  opacity: 0.6;
}

.page-header-title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text-1);
  margin-bottom: 0.75rem;
}

.page-header-sub {
  font-size: 0.98rem;
  line-height: 1.72;
  color: var(--text-2);
  max-width: 640px;
}

/* ─────────────────────────────────────────────
   SECTION UTILITIES
───────────────────────────────────────────── */
.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-eyebrow::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 1px;
  background: var(--blue);
  opacity: 0.55;
}

.section-title {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-1);
  line-height: 1.2;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border-dim);
}

/* ─────────────────────────────────────────────
   CONTENT BLOCKS
───────────────────────────────────────────── */
.content-block {
  padding: 4rem 0;
}

.content-block + .content-block {
  border-top: 1px solid var(--border-dim);
}

/* ─────────────────────────────────────────────
   TOOL CARDS
───────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-soft);
}

.tool-card-visual {
  height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.tool-card-body {
  padding: 1.2rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tool-card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.60rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.tool-card-name {
  font-size: 1.02rem;
  font-weight: 900;
  color: var(--text-1);
  margin-bottom: 0.45rem;
  letter-spacing: -0.01em;
}

.tool-card-desc {
  font-size: 0.80rem;
  line-height: 1.62;
  color: var(--text-2);
  flex: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.9rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-dim);
}

.tool-card-arrow {
  font-size: 1rem;
  color: var(--blue);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.tool-card:hover .tool-card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

/* ─────────────────────────────────────────────
   BADGES
───────────────────────────────────────────── */
.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.57rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 5px;
}

.badge-free  { background: var(--badge-free-bg);  color: var(--badge-free-text);  border: 1px solid var(--badge-free-bdr); }
.badge-wiki  { background: var(--badge-wiki-bg);  color: var(--badge-wiki-text);  border: 1px solid var(--badge-wiki-bdr); }
.badge-soon  { background: var(--badge-soon-bg);  color: var(--badge-soon-text);  border: 1px solid var(--badge-soon-bdr); }
.badge-free-always {
  background: rgba(30,205,168,0.12);
  color: var(--teal);
  border: 1px solid rgba(30,205,168,0.25);
  font-size: 0.55rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: 10px;
  transition: all 0.18s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border: none;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 16px var(--blue-glow);
}

.btn-primary:hover {
  background: var(--blue-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--blue-glow);
}

.btn-outline {
  background: transparent;
  color: var(--blue-light);
  border: 1.5px solid var(--border-soft);
}

[data-theme="light"] .btn-outline { color: var(--blue); }

.btn-outline:hover {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.btn-teal {
  background: var(--teal-pale);
  color: var(--teal);
  border: 1px solid rgba(30,205,168,0.25);
}

.btn-teal:hover {
  background: rgba(30,205,168,0.18);
  transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   PILL ITEMS
───────────────────────────────────────────── */
.pill-list { display: flex; flex-direction: column; gap: 0.75rem; }

.pill-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-dim);
  border-radius: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.pill-item:hover {
  border-color: var(--border-soft);
  background: var(--bg-card);
}

.pill-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }

.pill-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 0.18rem;
}

.pill-desc {
  font-size: 0.76rem;
  line-height: 1.58;
  color: var(--text-2);
}

/* ─────────────────────────────────────────────
   NOTICES
───────────────────────────────────────────── */
.notice {
  padding: 1.1rem 1.35rem;
  border-radius: 12px;
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.notice-blue   { background: var(--blue-pale);  border: 1px solid var(--border-soft); }
.notice-gold   { background: var(--gold-pale);  border: 1px solid rgba(240,180,41,0.22); }
.notice-teal   { background: var(--teal-pale);  border: 1px solid rgba(30,205,168,0.22); }

.notice-title  { font-size: 0.86rem; font-weight: 800; margin-bottom: 0.25rem; }
.notice-body   { font-size: 0.78rem; line-height: 1.68; color: var(--text-2); }

/* ─────────────────────────────────────────────
   WIKI LIST
───────────────────────────────────────────── */
.wiki-list {
  border: 1px solid var(--border-dim);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.wiki-list-header {
  padding: 0.75rem 1.2rem;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 10px;
}

.wl-dots { display: flex; gap: 5px; }
.wl-dots span { width: 8px; height: 8px; border-radius: 50%; }

.wiki-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.82rem 1.2rem;
  border-bottom: 1px solid var(--border-dim);
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}

.wiki-row:last-child { border-bottom: none; }
.wiki-row:hover { background: var(--bg-raised); }

.wiki-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.wiki-row-title { font-size: 0.83rem; font-weight: 700; color: var(--text-1); flex: 1; }

.wiki-row-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.59rem;
  color: var(--text-3);
  background: var(--bg-raised);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-dim);
  white-space: nowrap;
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border-dim);
  padding: 2.5rem 0 1.5rem;
  transition: background 0.3s;
}

.footer-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 3rem;
  align-items: start;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-dim);
  margin-bottom: 1.5rem;
}

.footer-brand { }

.footer-logo {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-1);
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-logo span { color: var(--blue); }

.footer-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}

.footer-col ul { list-style: none; }

.footer-col li + li { margin-top: 0.4rem; }

.footer-col a {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--blue-light); }
[data-theme="light"] .footer-col a:hover { color: var(--blue); }

.footer-bottom {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom-note {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.60rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

.footer-free-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--teal-pale);
  color: var(--teal);
  border: 1px solid rgba(30,205,168,0.22);
}

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn   { from { opacity: 0; } to   { opacity: 1; } }
@keyframes floatY   { 0%,100% { transform: translateY(0); }  50% { transform: translateY(-10px); } }
@keyframes pulseDot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } }
@keyframes spin     { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.anim-fade-up  { animation: fadeUp 0.65s ease both; }
.anim-float    { animation: floatY 6s ease-in-out infinite; }

.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.18s; }
.d3 { animation-delay: 0.30s; }
.d4 { animation-delay: 0.44s; }
.d5 { animation-delay: 0.58s; }

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 960px) {
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .nav-links  { display: none; }
  .footer-main { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .tools-grid  { grid-template-columns: 1fr; }
  .container   { padding: 0 1.25rem; }
  .footer-main { grid-template-columns: 1fr; gap: 1.5rem; }
}
