/* ─────────────────────────────────────────────────────────────
   Cursed Realm — shared base + navigation styles.

   The :root palette, reset, base typography, header, buttons, "More" menu and
   mobile nav that used to be copy-pasted into every page's inline <style>.
   Loaded in <head> BEFORE each page's own <style>, so a page can still override
   any of these — e.g. the deckbuilder's compact header, or archive's custom
   small buttons. Pairs with site-nav.js, which injects the markup these style.
   ───────────────────────────────────────────────────────────── */

:root {
  --void: #0b0a0f;
  --abyss: #111018;
  --dusk: #1a1826;
  --twilight: #252338;
  --mist: #3a3658;
  --rune: #6b5fa0;
  --arcane: #9b87d4;
  --shimmer: #c9bfee;
  --parchment: #e8e0cc;
  --gold: #c8a96e;
  --ember: #c4614a;
  --sage: #5a8a6a;
  --water: #5a96b0;
  --fire: #c4614a;
  --earth: #a08246;
  --air: #8cb4d2;
  --border: rgba(155, 135, 212, 0.18);
  --border-strong: rgba(155, 135, 212, 0.35);
  --glow: 0 0 20px rgba(155, 135, 212, 0.15);
  --glow-strong: 0 0 30px rgba(155, 135, 212, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: clip; max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--parchment);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
}

/* HEADER */
header {
  background: linear-gradient(180deg, #0d0b14 0%, var(--void) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.header-main { min-width: 0; flex-wrap: wrap; }
#auth-bar { flex-shrink: 0; }
.logo { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 700; letter-spacing: 0.08em; color: var(--gold); text-shadow: 0 0 20px rgba(200,169,110,0.4); }
.logo span { color: var(--arcane); font-weight: 400; }
.header-nav { display: flex; gap: 10px; align-items: center; }
.header-link { font-family: 'Cinzel', serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--rune); text-decoration: none; transition: color 0.2s; white-space: nowrap; }
.header-link:hover, .header-link.active { color: var(--arcane); }

/* BUTTONS */
.btn { padding: 7px 16px; font-family: 'Cinzel', serif; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 4px; cursor: pointer; border: 1px solid transparent; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.btn-primary { background: var(--rune); border-color: var(--arcane); color: #fff; }
.btn-primary:hover { background: var(--arcane); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--rune); }
.btn-ghost:hover { border-color: var(--arcane); color: var(--arcane); }
.btn-danger { background: transparent; border-color: rgba(196,97,74,0.3); color: var(--ember); }
.btn-danger:hover { background: rgba(196,97,74,0.12); }
.btn-sm { padding: 5px 10px; font-size: 0.65rem; }

/* MORE MENU */
.more-menu { position: relative; display: inline-block; }
.more-trigger { background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit; color: var(--rune); display: inline-flex; align-items: center; gap: 4px; }
.more-trigger:hover { color: var(--arcane); }
.more-dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 170px; background: var(--dusk); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); padding: 6px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.14s, transform 0.14s; z-index: 300; }
.more-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.more-item { display: block; font-family: 'Crimson Pro', serif; font-size: 0.92rem; color: var(--parchment); padding: 8px 12px; border-radius: 5px; text-decoration: none; white-space: nowrap; transition: background 0.12s, color 0.12s; }
.more-item:hover { background: rgba(155,135,212,0.12); color: var(--shimmer); }
.more-item.active { color: var(--gold); }
.more-discord { color: #b9c0ff !important; font-weight: 600; }
.more-discord:hover { color: #d4d8ff !important; }
.more-item[target="_blank"]::after,
.mobile-nav a[target="_blank"]::after { content: "\2197"; font-size: 0.72em; margin-left: 4px; opacity: 0.55; vertical-align: 1px; }
.mobile-discord { color: #b9c0ff !important; font-weight: 600; }

/* HAMBURGER + MOBILE NAV */
.hamburger { display: none; background: none; border: 1px solid var(--border-strong); color: var(--gold); font-size: 1.3rem; line-height: 1; padding: 4px 12px; border-radius: 4px; cursor: pointer; }
.hamburger:active { background: rgba(155,135,212,0.12); }
.mobile-nav { display: none; position: sticky; top: 60px; z-index: 99; background: #0d0b14; border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px 0; }
.mobile-nav.open { display: flex; }
.mobile-nav .header-link { padding: 13px 24px; font-size: 0.85rem; border-bottom: 1px solid rgba(155,135,212,0.06); }
.mobile-nav-divider { height: 1px; background: var(--border); margin: 4px 16px; }
.mobile-auth { padding: 4px 0; }
.mobile-auth-header { padding: 14px 24px 10px; }
.mobile-auth-name { font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 700; color: var(--gold); }
.mobile-auth-email { font-size: 0.78rem; color: var(--rune); margin-top: 2px; word-break: break-all; }
.mobile-auth-signout { color: var(--ember) !important; cursor: pointer; }
.mobile-auth-signin { color: var(--gold) !important; cursor: pointer; font-weight: 600; }

@media (max-width: 820px) {
  .nav-collapsible { display: none !important; }
  .hamburger { display: block; }
  header { padding: 0 16px; }
}
