/* Game theme: classic (Classic D&D, red)
 *
 * Applied with <body class="theme-classic"> while a classic-themed campaign is open.
 * Every rule is scoped to body.theme-classic, so the Spelljammer look (theme-spelljammer)
 * is untouched. Background: /classic-bg.jpg (original generated art, no logos).
 */
body.theme-classic {
  --theme-id: classic;
  --gold: #c9a24a;
  --gold-hi: #f0d58c;
  --gold-lo: #7a5a1e;
  --wood: #2c0c0c;
  --wood-dk: #150505;
  --rune: #e0484f;
  --accent: #a3141c;
  --accent-rgb: 200, 40, 48;
  --logo-glow: rgba(210, 30, 30, 0.6);
  --accent-glow: rgba(210, 40, 40, 0.6);
  --accent-glow-soft: rgba(200, 40, 40, 0.32);
  --accent-glow-strong: rgba(225, 50, 50, 0.72);
  --crimson: #8e1018;
  --crimson-hi: #c42a30;
  --parch: #2b1d14;
  --parch-dk: #1a110b;
  --ink: #f1e4c8;
  --bot: #f0d58c;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.7) 100%),
    linear-gradient(rgba(12, 2, 2, 0.35), rgba(10, 2, 2, 0.6)),
    url('/classic-bg.jpg?v=1') center / cover fixed no-repeat,
    #0c0303;
}

/* Fonts: classic blackletter-ish serif for titles */
body.theme-classic .brand h1,
body.theme-classic .sheet-name,
body.theme-classic .lib-head h2 {
  font-family: "IM Fell English SC", "Cinzel", Georgia, serif;
  letter-spacing: 0.04em;
}
body.theme-classic .brand h1 { font-weight: 400; }
@media (min-width: 561px) { body.theme-classic .brand h1 { font-size: 1.3rem; } }

/* Chat watermark: a faint d20 instead of the gold dragon */
body.theme-classic #app::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%23c9a24a' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpolygon points='50,4 90,27 90,73 50,96 10,73 10,27'/%3E%3Cpolygon points='50,26 72,64 28,64'/%3E%3Cpath d='M50 4L50 26M90 27L50 26M90 27L72 64M90 73L72 64M50 96L72 64M50 96L28 64M10 73L28 64M10 27L28 64M10 27L50 26'/%3E%3C/g%3E%3Ctext x='50' y='55' font-family='Georgia,serif' font-size='13' font-weight='700' text-anchor='middle' fill='%23c9a24a'%3E20%3C/text%3E%3C/svg%3E") center 55% / min(46vh, 340px) no-repeat;
  opacity: 0.06;
  mix-blend-mode: normal;
}

/* Header: crimson leather with brass trim and a filigree rule */
body.theme-classic .topbar {
  background:
    linear-gradient(180deg, rgba(255,200,160,0.07), transparent 45%),
    repeating-linear-gradient(135deg, rgba(0,0,0,0.12) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #5a1114, #2a0708 70%, #1a0405);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 1px 0 var(--gold-lo), 0 6px 22px rgba(0,0,0,0.6), inset 0 -1px 0 rgba(255,230,160,0.25);
}
body.theme-classic .topbar::after {
  content: "❦  ◆  ⚔  ◆  ❦  ◆  ⚔  ◆  ❦  ◆  ⚔  ◆  ❦  ◆  ⚔  ◆  ❦";
  color: var(--gold);
  text-shadow: 0 0 6px rgba(201,162,74,0.55);
  letter-spacing: 0.35em;
}
body.theme-classic .presence { color: #e3c48a; }
body.theme-classic .you-chip,
body.theme-classic .logout-btn,
body.theme-classic .library-btn,
body.theme-classic .header-toggle,
body.theme-classic .spellbook-btn {
  background: linear-gradient(180deg, #3d0c0e, #1c0506);
}

/* Chat */
body.theme-classic .bubble {
  background:
    linear-gradient(180deg, rgba(46, 30, 20, 0.9), rgba(28, 17, 11, 0.92));
  border-color: rgba(201,162,74,0.35);
  color: var(--ink);
}
body.theme-classic .bubble.mine {
  background: linear-gradient(180deg, rgba(92, 18, 22, 0.9), rgba(58, 10, 13, 0.92));
  border-color: rgba(201,162,74,0.5);
}
body.theme-classic .day-rule { color: #e7c98d; }
body.theme-classic .empty { color: #e3cfa6; }
body.theme-classic .composer {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.14) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #3a0b0d, #170405);
}
body.theme-classic .composer textarea { background: rgba(20, 8, 6, 0.8); }
body.theme-classic .log { scrollbar-color: var(--gold) rgba(40,8,8,0.6); }
body.theme-classic .log::-webkit-scrollbar-track { background: linear-gradient(90deg, #170405, #2c0c0c, #170405); }

/* Side panes: dark parchment */
body.theme-classic .pane-sheet,
body.theme-classic .pane-inventory {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(120, 20, 24, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(26, 14, 10, 0.94), rgba(16, 8, 6, 0.95));
}
body.theme-classic .sheet-section {
  background: linear-gradient(180deg, rgba(48, 33, 22, 0.72), rgba(30, 20, 13, 0.75));
  border-color: rgba(201,162,74,0.45);
  box-shadow: inset 0 0 0 1px rgba(201,162,74,0.08), inset 0 0 18px rgba(0,0,0,0.35);
}
body.theme-classic .sheet-section h3 {
  color: var(--gold-hi);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, rgba(201,162,74,0), rgba(201,162,74,0.7) 20%, rgba(196,42,48,0.8) 50%, rgba(201,162,74,0.7) 80%, rgba(201,162,74,0)) 1;
}
body.theme-classic .sheet-section h3::before { content: "❦ "; color: var(--crimson-hi); }
body.theme-classic .ability,
body.theme-classic .inv-currency {
  background: linear-gradient(180deg, rgba(70, 16, 18, 0.75), rgba(26, 12, 8, 0.85));
}
body.theme-classic .combat-box,
body.theme-classic .spell-item { background: rgba(22, 12, 8, 0.72); }
body.theme-classic .ability .mod,
body.theme-classic .item-list .qty { color: #ff8a8f; }

/* Mobile tabs */
@media (max-width: 1023px) {
  body.theme-classic .pane-tabs { background: linear-gradient(180deg, rgba(42,8,10,0.94), rgba(20,6,6,0.94)); }
  body.theme-classic .pane-tab { background: rgba(26, 6, 6, 0.65); }
  body.theme-classic .pane-tab.is-active {
    color: #2a0606;
    background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
    border-color: #f9e2a0;
  }
}

/* Image library, lightbox, spellbook */
body.theme-classic .lib-modal {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(90, 12, 16, 0.45), rgba(8, 2, 2, 0.88) 60%),
    rgba(8, 2, 2, 0.8);
}
body.theme-classic .lib-card {
  background: linear-gradient(180deg, rgba(40, 14, 10, 0.97), rgba(16, 6, 5, 0.97));
  box-shadow: 0 0 0 1px rgba(0,0,0,0.6), 0 0 40px rgba(160, 20, 28, 0.35), 0 24px 60px rgba(0,0,0,0.55);
}
body.theme-classic .lib-head { background: linear-gradient(180deg, rgba(58, 14, 14, 0.98), rgba(30, 8, 8, 0.95)); }
body.theme-classic .lib-item { background: rgba(22, 8, 6, 0.75); }

/* Character sheet portrait ring: brass + crimson, matching the classic logo glow */
body.theme-classic .sheet-portrait {
  border-color: var(--gold);
  background: #140606;
  box-shadow:
    0 0 0 2px rgba(20, 4, 4, 0.9),
    0 0 0 3px var(--gold-lo),
    0 0 14px var(--logo-glow);
}

body.theme-classic .chat-dock {
  background:
    repeating-linear-gradient(135deg, rgba(0,0,0,0.14) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, #5a1114, #2a0708 70%, #1a0405);
  border-top-color: var(--gold);
}
body.theme-classic .terms-card {
  background: linear-gradient(180deg, rgba(46, 18, 16, 0.97), rgba(18, 6, 6, 0.98));
  border-color: rgba(201,162,74,0.55);
}
body.theme-classic .lib-head.terms-head,
body.theme-classic .terms-accept-row {
  background: linear-gradient(180deg, rgba(58, 16, 16, 0.98), rgba(28, 8, 8, 0.96));
}
body.theme-classic .admin-view-badge {
  border-color: var(--gold);
  color: var(--gold-hi);
}

