/* ============================================
   LAST DAYDREAM - CORE STYLES
   Themes, Fonts, Variables, Reset, Typography
   ============================================ */

/* ========== FONTS ========== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..800&family=Jim+Nightshade&family=Lora:ital,wght@0,400..700;1,400..700&family=Lugrasimo&family=Quicksand:wght@300..700&family=Rubik+Vinyl&family=Snippet&display=swap');

/* RPG Fonts */
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&family=Uncial+Antiqua&family=Almendra:wght@400;700&family=Pirata+One&family=Grenze+Gotisch:wght@400;700&family=IM+Fell+English+SC&family=Fondamento:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Lato:wght@400;700&family=Montserrat:wght@400;600;700&family=Poppins:wght@400;600;700&family=Nunito:wght@400;600;700&family=Raleway:wght@400;600;700&family=Source+Sans+3:wght@400;600;700&family=Work+Sans:wght@400;600;700&family=Manrope:wght@400;600;700&family=Rubik:wght@400;600;700&family=Ubuntu:wght@400;500;700&family=PT+Sans:wght@400;700&family=Fira+Sans:wght@400;500;700&family=DM+Sans:wght@400;500;700&family=Outfit:wght@400;600;700&family=Space+Grotesk:wght@400;500;700&family=Plus+Jakarta+Sans:wght@400;600;700&family=Bitter:wght@400;600;700&family=Playfair+Display:wght@400;600;700&family=Cormorant+Garamond:wght@400;600;700&family=Karla:wght@400;500;700&display=swap');

/* Dungeon Font (using MedievalSharp as base) */
@font-face {
  font-family: 'Dungeon';
  src: local('MedievalSharp'), local('Medieval Sharp');
  font-weight: 400;
  font-style: normal;
}

/* ========== THEME TOKENS ========== */
:root {
  /* Core palette - Default: Midnight */
  /* These are the prototype's exact values — the look everything else is
     measured against. --primary is the cyan accent that carries derived
     stats (HP / AP / Init, attribute tiers); it was a near-white before,
     which is why those numbers read flat. */
  --bg:        #0a0713;
  --surface:   #0f0a1c;
  --panel:     #120c22;
  --panel-2:   #1a122e;
  --stroke:    #2a2140;
  --muted:     #a9b2cc;
  --text:      #eef2ff;
  --heading:   #ffffff;
  /* Renormalized accent — the old #22d3ee was a full-neon cyan that read far
     hotter than the purple/gold themes. Pulled ~18% chroma out so it sits in
     the same intensity band while keeping the same teal-cyan hue. */
  --primary:   #45c2d6;
  --primary-2: #7c5cbf;
  --gold:      #d4af37;

  /* Metal accent — the trim colour used across the sheet, panels and chrome.
     Everything that used to hardcode var(--ld-gold, #d4af37) now reads these, so the whole
     site's character can be retuned from one place (and per theme).
     --ld-gold-rgb is the same colour as bare channels so existing
     rgba(...) glows keep their alpha. */
  /* Gold is the brand metal — it is what makes the sheet look rich.
     Silver was tried as a default and drained the warmth out of every
     page; it lives on as the opt-in `silvered` theme instead. */
  --ld-gold:     #d4af37;
  --ld-gold-rgb: 212, 175, 55;

  /* Inputs / focus */
  --input:       #030108;
  --input-brd:   #600cb4bb;
  --input-focus: #3e6fb1;

  /* Status */
  --danger-1: #de7070;
  --danger-2: #9e3a3a;
  --success-1:#57c09b;
  --warn-1:  #e2b566;

  /* Radii & shadows */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow-lg: 0 18px 45px rgba(10,16,28,.55), 0 0 0 1px rgba(62,110,176,.18);
  --shadow-sm: 0 8px 20px rgba(10,16,28,.45);

  /* Max widths */
  --w-sm: 680px;
  --w-md: 980px;
  --w-lg: 1180px;
  --app-scale: 1;
}

@media (min-width: 1280px) {
  :root { --app-scale: 1.06; }
}

/* ========== DARK THEMES ========== */
/* Midnight Gold is the default and must stay identical to :root. This block
   previously carried the old blue-grey values and silently overrode :root for
   every user explicitly set to 'midnight' — i.e. almost everyone. */
[data-theme='midnight'] {
  --bg:#0a0713;
  --surface:#0f0a1c;
  --panel:#120c22;
  --panel-2:#1a122e;
  --stroke:#2a2140;
  --text:#eef2ff;
  --muted:#a9b2cc;
  --primary:#45c2d6;
}

[data-theme='obsidian'] {
  --bg:#090c12;
  --surface:#11161e;
  --panel:#171c24;
  --panel-2:#131923;
  --stroke:#2a3445;
  --text:#e6eef7;
  --muted:#a4b1c4;
  --primary:#60a5fa;
}

/* Concord — the faction purple. Deep violet with an amethyst trim. */
[data-theme='concord'] {
  --bg:#0d0819;
  --surface:#150e28;
  --panel:#1b1233;
  --panel-2:#160e2b;
  --stroke:#3a2a63;
  --text:#efe9ff;
  --muted:#b6a8dc;
  --primary:#a78bfa;
}

/* Cryptid — bioluminescent green in deep forest dark. */
[data-theme='cryptid'] {
  --bg:#060f0a;
  --surface:#0b1a12;
  --panel:#0f2318;
  --panel-2:#0b1c13;
  --stroke:#1f4a32;
  --text:#e6f7ec;
  --muted:#9dc7ac;
  /* Renormalized from neon #4ade80 — softened to a calmer emerald so it
     matches the intensity of the other themes' accents. */
  --primary:#5cc888;
}

/* Silvered — mirrors, the reflection layer. Obsidian with mercury trim. */
[data-theme='silvered'] {
  --bg:#08090d;
  --surface:#101219;
  --panel:#14161d;
  --panel-2:#101218;
  --stroke:#2a303c;
  --text:#eef2f8;
  --muted:#9aa6b8;
  --primary:#7dd3fc;
}

/* Doorlight — ember through a doorway. (key kept as 'sunset' for existing rows) */
[data-theme='sunset'] {
  --bg:#120a0c;
  --surface:#1a0f12;
  --panel:#1e1215;
  --panel-2:#180e11;
  --stroke:#4a2a24;
  --text:#f8ece6;
  --muted:#c0a79e;
  --primary:#f0c987;
}

/* Verdigris — oxidised copper, aged brass. (key kept as 'forest') */
[data-theme='forest'] {
  --bg:#07100f;
  --surface:#0c1a16;
  --panel:#101e1c;
  --panel-2:#0c1816;
  --stroke:#1f4a3c;
  --text:#e9f5f0;
  --muted:#9fb8b0;
  --primary:#e6c46a;
}

[data-theme='discord'] {
  --bg:#1e1f22;
  --surface:#2b2d31;
  --panel:#313338;
  --panel-2:#2b2d31;
  --stroke:#1a1b1e;
  --text:#dbdee1;
  --muted:#b5bac1;
  --primary:#5865f2;
}

/* ========== LIGHT THEMES ========== */
/* Clean White — the one light/accessible option. Accent is the brand
   black-purple (matching the metal) rather than a generic bootstrap blue,
   so it reads as designed instead of default. */
[data-theme='light'] {
  --bg:#eef0f6;
  --surface:#ffffff;
  --panel:#ffffff;
  --panel-2:#f5f6fb;
  --stroke:#dde1ec;
  --text:#241a3a;
  --muted:#5a6480;
  --primary:#7c5cbf;
  --heading:#2b1b47;
  --input:#ffffff;
  --input-brd:#d3d8e6;
  --input-focus:#7c5cbf;
  --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
  --shadow-sm: 0 4px 12px rgba(0,0,0,.08);
}

[data-theme='parchment'] {
  --bg:#f4e8d0;
  --surface:#faf5e4;
  --panel:#fff8e7;
  --panel-2:#f5ecd6;
  --stroke:#d4c4a8;
  --text:#3e2723;
  --muted:#6d4c41;
  --primary:#8b4513;
  --heading:#3e2723;
  --gold:#be955b;
  --input:#ffffff;
  --input-brd:#d4c4a8;
  --input-focus:#8b4513;
  --shadow-lg: 0 8px 24px rgba(62,39,35,.15);
  --shadow-sm: 0 4px 12px rgba(62,39,35,.10);
}

[data-theme='dawn'] {
  --bg:#fef3e2;
  --surface:#fffbf0;
  --panel:#ffffff;
  --panel-2:#fff9ed;
  --stroke:#e8d5b7;
  --text:#2c1810;
  --muted:#8b6f47;
  --primary:#d97706;
  --heading:#1a0f08;
  --input:#ffffff;
  --input-brd:#e8d5b7;
  --input-focus:#d97706;
  --shadow-lg: 0 8px 24px rgba(44,24,16,.12);
  --shadow-sm: 0 4px 12px rgba(44,24,16,.08);
}

[data-theme='ivory'] {
  --bg:#fffef9;
  --surface:#faf8f0;
  --panel:#ffffff;
  --panel-2:#f5f3eb;
  --stroke:#e8e4d8;
  --text:#1a1410;
  --muted:#6b5d4f;
  --primary:#be955b;
  --heading:#1a1410;
  --input:#ffffff;
  --input-brd:#e8e4d8;
  --input-focus:#be955b;
  --shadow-lg: 0 8px 24px rgba(26,20,16,.10);
  --shadow-sm: 0 4px 12px rgba(26,20,16,.06);
}

/* ========== FONT SYSTEM ========== */
:root,
[data-font='quicksand'] {
  --font-body: 'Quicksand', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Bricolage Grotesque', sans-serif;
}

[data-font='inter'] {
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-title: 'Inter', sans-serif;
}

[data-font='merriweather'] {
  --font-body: 'Merriweather', Georgia, serif;
  --font-title: 'Merriweather', Georgia, serif;
}

[data-font='cinzel'] {
  --font-body: 'Cinzel', serif;
  --font-title: 'Cinzel Decorative', serif;
}

[data-font='lugrasimo'] {
  --font-body: 'Lugrasimo', cursive;
  --font-title: 'Lugrasimo', cursive;
}

/* RPG Fonts */
[data-font='dungeon'] {
  --font-body: 'Dungeon', 'MedievalSharp', serif;
  --font-title: 'Dungeon', 'MedievalSharp', serif;
}

[data-font='medieval'] {
  --font-body: 'MedievalSharp', serif;
  --font-title: 'Uncial Antiqua', serif;
}

[data-font='almendra'] {
  --font-body: 'Almendra', serif;
  --font-title: 'Almendra', serif;
}

[data-font='pirate'] {
  --font-body: 'Pirata One', cursive;
  --font-title: 'Pirata One', cursive;
}

[data-font='gothic'] {
  --font-body: 'Grenze Gotisch', serif;
  --font-title: 'Grenze Gotisch', serif;
}

[data-font='fell'] {
  --font-body: 'IM Fell English SC', serif;
  --font-title: 'IM Fell English SC', serif;
}

/* ========== RESET / BASE ========== */
*,
*::before,
*::after { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
  font-size: calc(16px * var(--app-scale)); 
}

body {
  margin: 0;
  line-height: 1.6;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(1000px 700px at 50% 120%, rgba(108,48,255,.12), transparent 55%),
    radial-gradient(900px 600px at -10% -10%, rgba(67,132,255,.10), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* Smooth focus */
:focus-visible { 
  outline: 3px solid rgba(63,111,177,.65); 
  outline-offset: 2px; 
}

/* Media defaults */
img, svg, canvas, video { 
  max-width: 100%; 
  display: block; 
}

/* Links */
a { 
  color: var(--primary); 
  text-decoration: underline; 
}

a:hover, a:focus { 
  color: #83b6ff; 
}

/* ========== TYPOGRAPHY ========== */
.ff-title, .font-title {
  font-family: var(--font-title);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5rem;
  line-height: 1.15;
  letter-spacing: 0.2px;
  font-weight: 700;
  font-family: var(--font-title);
}

h1 { 
  color: var(--heading); 
  font-weight: 800; 
  font-size: clamp(2rem, 4.5vw, 3.25rem); 
}

h2 { 
  color: var(--primary); 
  font-weight: 800; 
  font-size: clamp(1.1rem, 2.6vw, 2rem); 
}

h3 { 
  color: var(--text); 
  font-weight: 700; 
  font-size: clamp(1rem, 1.6vw, 1.4rem); 
}

h4 {
  color: var(--text);
  font-weight: 600;
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
}

p {
  margin: 0 0 1rem;
}

.lead, .muted, .sub, .help, .description { 
  color: var(--muted); 
}

/* ========== UTILITY CLASSES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* ========== FONT FAMILIES ========== */
.font-fantasy { font-family: 'Cinzel', serif; }
.font-decorative { font-family: 'Cinzel Decorative', serif; }
.font-medieval { font-family: 'MedievalSharp', serif; }
.font-uncial { font-family: 'Uncial Antiqua', serif; }
.font-pirate { font-family: 'Pirata One', cursive; }
.font-gothic { font-family: 'Grenze Gotisch', serif; }
.font-handwriting { font-family: 'Lugrasimo', cursive; }
.font-quicksand { font-family: 'Quicksand', sans-serif; }
.font-inter { font-family: 'Inter', sans-serif; }


/* ============================================
   ADDITIONAL THEME VARIABLES (ld- prefix)
   These work alongside the main theme system
   ============================================ */
:root,
[data-theme='midnight'] {
  --ld-bg: #010002;
  --ld-panel: #12020297;
  --ld-ink: #e7edf6;
  --ld-ink-dim: #aeb8c9;
  --ld-accent: #6ea2ff;
  --ld-accent-2: #ffd166;
  --ld-grad-a: rgba(2, 0, 4, 0.07);
  --ld-grad-b: rgba(7, 0, 12, 0.06);
}

[data-theme='obsidian'] {
  --ld-bg: #090c12;
  --ld-panel: rgba(17,22,30,.75);
  --ld-ink: #e6eef7;
  --ld-ink-dim: #a4b1c4;
  --ld-accent: #60a5fa;
  --ld-accent-2: #a5b4fc;
  --ld-grad-a: rgba(22, 26, 34, .18);
  --ld-grad-b: rgba(10, 13, 18, .2);
}

[data-theme='sunset'] {
  --ld-bg: #1b0f17;
  --ld-panel: rgba(38,18,34,.72);
  --ld-ink: #fff1e8;
  --ld-ink-dim: #f8c9b1;
  --ld-accent: #fb7185;
  --ld-accent-2: #fbbf24;
  --ld-grad-a: rgba(251, 113, 133, 0.14);
  --ld-grad-b: rgba(251, 191, 36, 0.12);
}

[data-theme='forest'] {
  --ld-bg: #081310;
  --ld-panel: rgba(13,34,25,.74);
  --ld-ink: #e3f6ee;
  --ld-ink-dim: #9ec8b8;
  --ld-accent: #34d399;
  --ld-accent-2: #86efac;
  --ld-grad-a: rgba(16, 185, 129, 0.12);
  --ld-grad-b: rgba(20, 83, 45, 0.18);
}

[data-theme='discord'] {
  --ld-bg: #1e1f22;
  --ld-panel: rgba(42,45,49,.85);
  --ld-ink: #dbdee1;
  --ld-ink-dim: #b5bac1;
  --ld-accent: #5865f2;
  --ld-accent-2: #57f287;
  --ld-grad-a: rgba(88, 101, 242, .18);
  --ld-grad-b: rgba(49, 51, 56, .2);
}

[data-theme='parchment'] {
  --ld-bg: #2a2318;
  --ld-panel: rgba(58,48,38,.75);
  --ld-ink: #f5ead6;
  --ld-ink-dim: #d4c4a8;
  --ld-accent: var(--ld-gold, #d4af37);
  --ld-accent-2: #f4e4c1;
  --ld-grad-a: rgba(var(--ld-gold-rgb), 0.12);
  --ld-grad-b: rgba(139, 115, 85, 0.15);
}

[data-theme='dawn'] {
  --ld-bg: #f8f5ff;
  --ld-panel: rgba(230,220,255,.85);
  --ld-ink: #2d1b4e;
  --ld-ink-dim: #6b5b7b;
  --ld-accent: #8b5cf6;
  --ld-accent-2: #a78bfa;
  --ld-grad-a: rgba(139, 92, 246, 0.08);
  --ld-grad-b: rgba(167, 139, 250, 0.06);
}

[data-theme='ivory'] {
  --ld-bg: #fffef9;
  --ld-panel: rgba(250,248,240,.9);
  --ld-ink: #1a1410;
  --ld-ink-dim: #6b5d4f;
  --ld-accent: #be955b;
  --ld-accent-2: var(--ld-gold, #d4af37);
  --ld-grad-a: rgba(190, 149, 91, 0.06);
  --ld-grad-b: rgba(var(--ld-gold-rgb), 0.05);
}

/* ============================================
   BODY BACKGROUND WITH GRADIENTS
   ============================================ */
body {
  background: radial-gradient(1200px 800px at 20% -10%, var(--ld-grad-a), transparent),
              radial-gradient(900px 700px at 120% 20%, var(--ld-grad-b), transparent),
              var(--ld-bg);
  color: var(--ld-ink);
  font-family: var(--ld-font-body);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.ff-title {
  font-family: var(--ld-font-title);
  letter-spacing: .3px;
}

.glass {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.08);
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
}

.card:hover {
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.08) inset;
}

/* ============================================
   BUTTON STYLES
   ============================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  transition: all 0.18s ease;
  overflow: hidden;
  font-family: var(--ld-font-body);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  box-shadow: 0 0 0.75rem 0.25rem var(--ld-accent);
}

.btn:hover::before {
  opacity: 0.4;
}

.btn:active {
  transform: translateY(1px) scale(.98);
}

.btn-primary {
  background: linear-gradient(to bottom right, #4925b5, #283aaf);
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(to bottom right, #7c25ff, #303f96);
}

.btn-emerald {
  background: linear-gradient(to bottom right, #e3ede9, #059669);
  color: #03100a;
}

.btn-emerald:hover {
  background: linear-gradient(to bottom right, #6ee7b7, #10b981);
}

.btn-lava {
  background: linear-gradient(to bottom right, #f80101ce, #ce6b02b1);
  color: #ffffff;
}

.btn-lava:hover {
  background: linear-gradient(to bottom right, #f80101ce, #ce6b02b1);
  color: #9b3fd8bf;
}

.btn-rose {
  background: linear-gradient(to bottom right, #f43f5e, #be123c);
  color: #fff;
}

.btn-rose:hover {
  background: linear-gradient(to bottom right, #fb7185, #e11d48);
}

.btn-ghost {
  background: rgba(255,255,255,.06);
  color: var(--ld-ink);
  border: 1px solid rgba(255,255,255,.1);
}

.btn-ghost:hover {
  background: rgba(255,255,255,.1);
}

/* ============================================
   BUTTON GLOW EFFECT
   ============================================ */
.btn-glow {
  position: relative;
  box-shadow: 0 0 10px currentColor;
  transition: all 0.25s ease;
}

.btn-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at center, currentColor 0%, transparent 70%);
  opacity: 0.25;
  z-index: -1;
  transition: opacity 0.25s ease;
}

.btn-glow:hover {
  box-shadow: 0 0 18px currentColor, 0 0 30px rgba(255,255,255,0.05);
  transform: scale(1.05);
}

.btn-glow:hover::after {
  opacity: 0.45;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0.5rem rgba(255,255,255,0.15); }
  50%      { box-shadow: 0 0 1.2rem rgba(255,255,255,0.35); }
}

.btn-primary:hover,
.btn-emerald:hover {
  animation: pulseGlow 1.2s infinite alternate;
}

/* ============================================
   TAGS & NAVIGATION
   ============================================ */
.tag {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--ld-ink);
}

.sidebar-link {
  color: var(--ld-ink-dim);
}

.sidebar-link:hover,
.sidebar-link[aria-current="page"] {
  color: var(--ld-ink);
  background: rgba(255,255,255,.06);
}

/* ============================================
   DISCORD THEME SPECIFIC STYLES
   ============================================ */
.discord-main-shell {
  transition: all .2s ease;
}

[data-theme='discord'] .discord-main-shell {
  position: fixed;
  top: 72px;
  right: 0;
  bottom: 0;
  left: 16rem;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  z-index: 20;
}

[data-theme='discord'] footer {
  display: none;
}

[data-theme='discord'] html,
[data-theme='discord'] body {
  overflow: hidden;
}

[data-theme='discord'] body {
  background: #1e1f22;
}

[data-theme='discord'] aside.glass,
[data-theme='discord'] header.glass {
  backdrop-filter: none;
  border-color: rgba(0,0,0,.35);
  background: #2b2d31;
}

[data-theme='discord'] .sidebar-link:hover,
[data-theme='discord'] .sidebar-link[aria-current="page"] {
  background: #404249;
}

@media (max-width: 768px) {
  [data-theme='discord'] .discord-main-shell {
    top: 64px;
    left: 0;
  }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.2);
}

/* ============================================
   CARD GRID LAYOUT (for Step 2)
   ============================================ */
.card-grid {
  display: inline-grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  justify-content: center;
  margin: 0 auto;
  max-width: 960px;
}

.attr-field {
  align-items: center;
  text-align: center;
}

.card-grid .card {
  width: 100%;
  max-width: 300px;
  height: auto;
}


/* ============================================
   CAMPAIGNS PAGE - DISCORD-STYLE CHAT LAYOUT
   ============================================ */
.campaigns-main-shell {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  height: calc(100dvh - 74px) !important;
  overflow: hidden;
}

.campaigns-wrap {
  width: 100%;
  padding: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}

[data-theme='discord'] .campaigns-wrap {
  width: min(100% - .15rem, 100%);
  padding: 0;
}

[data-theme='discord'] .chat-shell {
  border: none;
  border-radius: 0;
  min-height: 100%;
  grid-template-columns: 72px 360px 1fr;
  background: linear-gradient(180deg, #2b2d31, #1e1f22);
}

[data-theme='discord'] .realm-rail {
  background: #1e1f22;
  height: 100dvh;
}

[data-theme='discord'] .channel-pane {
  background: #2b2d31;
  height: 100dvh;
}

[data-theme='discord'] .messages-header,
[data-theme='discord'] .message-compose {
  background: #313338;
}

[data-theme='discord'] .channel-row {
  background: #2f3136;
}

[data-theme='discord'] .channel-row.active {
  background: rgba(88,101,242,.38);
  border-color: rgba(88,101,242,.72);
}

.chat-shell {
  display: grid;
  grid-template-columns: 68px 300px 1fr;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(32,34,37,.95), rgba(23,24,27,.98));
}

.realm-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(12,16,29,.9);
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  z-index: 5;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(99,102,241,.18);
  color: #dbe4ff;
  font-size: 20px;
}

.rail-btn:hover {
  background: rgba(99,102,241,.32);
}

.channel-pane {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100%;
  background: rgba(20,28,44,.84);
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 12px;
  overflow: auto;
  z-index: 4;
}

.pane-title {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #cbd5e1;
  margin-bottom: 2px;
}

.pane-subtitle {
  font-size: .68rem;
  color: #93a4bf;
  margin-bottom: 8px;
  line-height: 1.2;
}

.channel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-row {
  text-align: left;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(15,23,42,.72);
  color: #e5e7eb;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: .85rem;
}

.channel-row.active {
  border-color: rgba(96,165,250,.75);
  background: rgba(30,64,175,.28);
}

.messages-pane {
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.messages-header {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 10px 12px;
  background: rgba(7,10,16,.48);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(30,41,59,.88);
  color: #e2e8f0;
  font-size: 18px;
  flex: 0 0 auto;
}

.room-title {
  font-size: 1rem;
  font-weight: 700;
  color: #e5e7eb;
}

.room-meta {
  font-size: .78rem;
  color: #94a3b8;
}

.identity-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.identity-pill {
  font-size: .75rem;
  color: #bfdbfe;
  border: 1px solid rgba(96,165,250,.35);
  border-radius: 999px;
  padding: 4px 10px;
}

.message-list {
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 12px 12px 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: .88rem;
  line-height: 1.35;
}

.msg-card {
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  background: rgba(49,51,56,.75);
  padding: 8px 10px;
  color: #e2e8f0;
  max-width: min(100%, 980px);
  backdrop-filter: blur(8px);
}

.msg-card.mine {
  margin-left: auto;
  background: rgba(88,101,242,.22);
  border-color: rgba(88,101,242,.6);
}

.msg-card.mention {
  border-color: rgba(250,204,21,.7);
  box-shadow: 0 0 0 1px rgba(250,204,21,.35) inset;
}

.msg-head {
  font-size: .68rem;
  color: #c4d0ff;
  margin-bottom: 3px;
  letter-spacing: .01em;
}

.msg-source-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(34,211,238,.45);
  color: #67e8f9;
  font-size: .62rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.mention-token {
  color: #fcd34d;
  font-weight: 700;
}

.msg-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.msg-action-btn {
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(15,23,42,.5);
  border-radius: 8px;
  font-size: .72rem;
  padding: 3px 8px;
  color: #e2e8f0;
}

.notification-pill {
  border: 1px solid rgba(250,204,21,.45);
  color: #fef08a;
  background: rgba(250,204,21,.12);
  border-radius: 9999px;
  font-size: .72rem;
  padding: 2px 8px;
}

.msg-empty {
  color: #94a3b8;
  font-size: .88rem;
  border: 1px dashed rgba(148,163,184,.35);
  border-radius: 10px;
  padding: 12px;
}

.msg-image-wrap {
  margin-top: 8px;
}

.msg-image {
  max-width: min(100%, 460px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
}

.message-compose {
  position: sticky;
  bottom: 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 10px;
  display: flex;
  gap: 8px;
  background: rgba(49,51,56,.96);
  backdrop-filter: blur(8px);
  z-index: 20;
  box-shadow: 0 -8px 18px rgba(0,0,0,.32);
}

.message-compose input {
  flex: 1;
  background: rgba(30,31,34,.95);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 8px 10px;
  color: #f3f4f6;
  font-size: .88rem;
}

.tool-dock {
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(2,6,23,.55);
  padding: 10px 12px;
}

.tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #dbeafe;
}

.tool-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tabletop-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tabletop-toolbar label {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #cbd5e1;
  font-size: .75rem;
}

.tabletop-canvas-wrap {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  overflow: auto;
  background: #0a0f1c;
}

#tabletopCanvas {
  width: 100%;
  height: 360px;
  display: block;
  background: #111827;
  cursor: crosshair;
}

.tabletop-hint {
  font-size: .75rem;
  color: #93c5fd;
  margin-top: 8px;
  min-height: 1rem;
}

.tabletop-permission {
  font-size: .75rem;
  color: #facc15;
}

.mobile-menu-backdrop {
  display: none;
}

/* Mobile responsive for campaigns */
@media (max-width: 960px) {
  .campaigns-wrap {
    width: 100%;
    padding-top: 0;
    min-height: 100%;
    height: 100%;
  }

  .chat-shell {
    grid-template-columns: 1fr;
    min-height: 100%;
    height: 100%;
    position: relative;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header-row {
    align-items: flex-start;
  }

  .realm-rail,
  .channel-pane {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 45;
  }

  .realm-rail {
    display: none;
  }

  .channel-pane {
    left: 0;
    width: min(88vw, 340px);
    padding-top: 74px;
    box-shadow: 16px 0 36px rgba(0,0,0,.45);
    display: block;
  }

  body.mobile-chat-menu-open .channel-pane {
    transform: translateX(0);
  }

  .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2,6,23,.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    border: 0;
    padding: 0;
    z-index: 40;
  }

  body.mobile-chat-menu-open .mobile-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .messages-pane {
    min-height: 100%;
  }

  .message-list {
    padding-bottom: 120px;
  }

  .message-compose {
    flex-wrap: wrap;
  }

  .identity-wrap {
    justify-content: flex-start;
  }
}


/* ========== EXTENDED THEMES ========== */
[data-theme='amethyst'] {
  --bg:#120d1f;
  --surface:#1a1230;
  --panel:#21163b;
  --panel-2:#1a1230;
  --stroke:#4b3b72;
  --text:#efe9ff;
  --muted:#c4b8ea;
  --primary:#b9a4ff;
}

[data-theme='ocean'] {
  --bg:#061725;
  --surface:#0b2235;
  --panel:#0f2a40;
  --panel-2:#0a2132;
  --stroke:#28506b;
  --text:#e4f3ff;
  --muted:#b0cbdf;
  --primary:#6ac1ff;
}

[data-theme='ember'] {
  --bg:#1a0f0b;
  --surface:#271611;
  --panel:#321c15;
  --panel-2:#24130f;
  --stroke:#694634;
  --text:#fff0e7;
  --muted:#ddb9a5;
  --primary:#ff9a66;
}

[data-theme='moss'] {
  --bg:#0a1510;
  --surface:#122019;
  --panel:#182a22;
  --panel-2:#12211a;
  --stroke:#365745;
  --text:#e8f6ee;
  --muted:#b1cdbd;
  --primary:#69c691;
}

[data-theme='rose'] {
  --bg:#1a0f17;
  --surface:#271726;
  --panel:#342033;
  --panel-2:#261724;
  --stroke:#6a4263;
  --text:#ffeef9;
  --muted:#ddb7d1;
  --primary:#ff8fc9;
}

[data-theme='slate'] {
  --bg:#14171c;
  --surface:#1f242c;
  --panel:#252b34;
  --panel-2:#1d222a;
  --stroke:#495362;
  --text:#edf1f7;
  --muted:#bec6d3;
  --primary:#90a7d8;
}

/* ========== EXTENDED FONT SYSTEM ========== */
[data-font='roboto'] { --font-body: 'Roboto', sans-serif; --font-title: 'Roboto', sans-serif; }
[data-font='lato'] { --font-body: 'Lato', sans-serif; --font-title: 'Lato', sans-serif; }
[data-font='montserrat'] { --font-body: 'Montserrat', sans-serif; --font-title: 'Montserrat', sans-serif; }
[data-font='poppins'] { --font-body: 'Poppins', sans-serif; --font-title: 'Poppins', sans-serif; }
[data-font='nunito'] { --font-body: 'Nunito', sans-serif; --font-title: 'Nunito', sans-serif; }
[data-font='raleway'] { --font-body: 'Raleway', sans-serif; --font-title: 'Raleway', sans-serif; }
[data-font='source-sans'] { --font-body: 'Source Sans 3', sans-serif; --font-title: 'Source Sans 3', sans-serif; }
[data-font='work-sans'] { --font-body: 'Work Sans', sans-serif; --font-title: 'Work Sans', sans-serif; }
[data-font='manrope'] { --font-body: 'Manrope', sans-serif; --font-title: 'Manrope', sans-serif; }
[data-font='rubik'] { --font-body: 'Rubik', sans-serif; --font-title: 'Rubik', sans-serif; }
[data-font='ubuntu'] { --font-body: 'Ubuntu', sans-serif; --font-title: 'Ubuntu', sans-serif; }
[data-font='pt-sans'] { --font-body: 'PT Sans', sans-serif; --font-title: 'PT Sans', sans-serif; }
[data-font='fira-sans'] { --font-body: 'Fira Sans', sans-serif; --font-title: 'Fira Sans', sans-serif; }
[data-font='dm-sans'] { --font-body: 'DM Sans', sans-serif; --font-title: 'DM Sans', sans-serif; }
[data-font='outfit'] { --font-body: 'Outfit', sans-serif; --font-title: 'Outfit', sans-serif; }
[data-font='space-grotesk'] { --font-body: 'Space Grotesk', sans-serif; --font-title: 'Space Grotesk', sans-serif; }
[data-font='plus-jakarta'] { --font-body: 'Plus Jakarta Sans', sans-serif; --font-title: 'Plus Jakarta Sans', sans-serif; }
[data-font='bitter'] { --font-body: 'Bitter', serif; --font-title: 'Bitter', serif; }
[data-font='playfair'] { --font-body: 'Playfair Display', serif; --font-title: 'Playfair Display', serif; }
[data-font='cormorant'] { --font-body: 'Cormorant Garamond', serif; --font-title: 'Cormorant Garamond', serif; }
[data-font='karla'] { --font-body: 'Karla', sans-serif; --font-title: 'Karla', sans-serif; }
