/* Dungeon Realms, dark theme: candlelight, old stone, worn gold.
   Loaded after app.css; remove its <link> in index.html to go back to the light layout. */

:root {
  --bg: #0b0a09;
  --card: #141210;
  --card-2: #1b1815;
  --ink: #e9e1d3;
  --muted: #8c8273;
  --line: #2c2620;
  --gold: #c9a45c;
  --gold-dim: #8a7040;
  --ember: #d0643a;
  --accent: #c9a45c;
  --accent-soft: rgba(201, 164, 92, .10);
  --ok: #7fae6b;
  --bad: #d0543a;
  --r: 6px;
  --serif: "Cinzel", "Trajan Pro", Georgia, serif;
  --book: "Cormorant Garamond", Georgia, serif;
}

body {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(201,164,92,.10), transparent 55%),
    radial-gradient(ellipse at 50% 120%, rgba(208,100,58,.07), transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}
/* soft vignette + grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.65) 100%),
    repeating-radial-gradient(circle at 17% 23%, rgba(255,255,255,.012) 0 1px, transparent 1px 3px);
}
main, .top { position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.top { background: transparent; border-bottom: 1px solid var(--line); padding: 18px 28px; }
.logo {
  font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); text-shadow: 0 0 18px rgba(201,164,92,.35);
}
#whoami { font-family: var(--book); font-style: italic; font-size: 16px; }

/* ---------- panels ---------- */
.card {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 20px 50px rgba(0,0,0,.45);
  position: relative;
}
/* gilded corners */
.card::before, .card::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--gold-dim); pointer-events: none;
}
.card::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.card::after  { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: .06em; color: var(--gold); }
h1 { font-size: 26px; text-align: center; }
h2 { font-size: 18px; }
h3 { font-family: var(--serif); color: var(--gold-dim); letter-spacing: .2em; font-size: 11px; }

/* ---------- inputs & buttons ---------- */
input, textarea, .gm-controls textarea {
  background: #0e0c0b; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  font-family: var(--book); font-size: 18px;
}
input::placeholder, textarea::placeholder { color: #5f574c; font-style: italic; }
input:focus, textarea:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(201,164,92,.12); }

button {
  background: #16130f; color: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .2s, background .2s, box-shadow .2s, color .2s;
}
button:hover { border-color: var(--gold-dim); background: #1e1a15; }
button:disabled { opacity: .45; cursor: default; }
button.primary {
  background: linear-gradient(180deg, #7a2f16, #4f1d0d); border-color: #a2492a; color: #f3e3c8;
  font-family: var(--serif); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; padding: 13px 16px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 8px 24px rgba(160,60,25,.25);
}
button.primary:hover { background: linear-gradient(180deg, #8d3719, #5c220f); box-shadow: 0 0 22px rgba(208,100,58,.35); }

hr { border-top-color: var(--line); }
label { color: var(--muted); }
input[type=radio] { accent-color: var(--gold); }
.code { background: transparent; border: 1px solid var(--gold-dim); color: var(--gold); letter-spacing: .15em; }

/* ---------- class picker ---------- */
.classes button { font-family: var(--serif); letter-spacing: .08em; padding: 16px 10px; }
.classes button.sel {
  background: var(--accent-soft); border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 18px rgba(201,164,92,.18) inset;
}

/* ---------- table ---------- */
.table { grid-template-columns: 250px 1fr 320px; gap: 20px; }

.party .pc { border-bottom-color: var(--line); padding: 12px 0; }
.party .pc b { font-family: var(--serif); letter-spacing: .04em; font-weight: 600; }
.party .pc.mine b { color: var(--gold); }
.hpbar { background: #2a1512; height: 5px; }
.hpbar i { background: linear-gradient(90deg, #8e2a1c, #d0543a); box-shadow: 0 0 8px rgba(208,84,58,.6); }

.dice { gap: 8px; }
.dice button {
  font-family: var(--serif); font-weight: 600; color: var(--gold); padding: 12px 0;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  border: 0; background: linear-gradient(180deg, #2a231b, #17130f);
}
.dice button:hover { background: linear-gradient(180deg, #3a2f22, #1f1913); color: #f0d79a; }
.dice button:active { transform: rotate(18deg) scale(.95); }

/* the stage: scene picture with narration on top like a film still */
.stage { padding: 0; overflow: hidden; }
.stage > *:not(.avatar-slot) { margin-left: 28px; margin-right: 28px; }
.avatar-slot {
  border-radius: 0; margin: 0; aspect-ratio: 16/8; background-color: #0e0c0a;
  color: var(--gold-dim); font-family: var(--serif); letter-spacing: .3em; text-transform: uppercase; font-size: 12px;
  position: relative; box-shadow: inset 0 0 120px rgba(0,0,0,.9);
}
.avatar-slot::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, var(--card-2) 100%);
}
.avatar-slot.speaking, .narration.speaking { outline: none; }
.avatar-slot.speaking { box-shadow: inset 0 0 0 1px var(--gold-dim), inset 0 0 120px rgba(0,0,0,.7); }

.narration {
  font-family: var(--book); font-style: italic; font-size: 22px; line-height: 1.55; color: #ddd2bf;
  margin-top: -40px; position: relative; z-index: 1; text-shadow: 0 2px 12px #000;
  padding-left: 18px; border-left: 2px solid transparent; transition: border-color .4s, color .4s;
}
.narration.speaking { border-left-color: var(--gold); color: #f3e8d4; }
.narration::first-letter { font-family: var(--serif); font-style: normal; font-size: 1.8em; color: var(--gold); }

.gm-line {
  font-family: var(--book); font-size: 19px; font-weight: 600; color: var(--gold);
  padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: 18px;
}
.gm-line::before { content: "❧ "; color: var(--gold-dim); }

.options { gap: 10px; margin-top: 14px; }
.options button {
  font-family: var(--book); font-size: 18px; padding: 14px 18px; background: rgba(255,255,255,.015);
  border-color: var(--line); position: relative;
}
.options button:not(:disabled):hover {
  border-color: var(--gold-dim); background: linear-gradient(90deg, rgba(201,164,92,.10), transparent 70%);
  padding-left: 24px;
}
.options .check {
  font-family: var(--serif); font-size: 11px; letter-spacing: .12em; color: var(--gold-dim);
  border: 1px solid var(--line); padding: 2px 8px; border-radius: 3px; margin-top: 2px;
}
.gm-controls { margin-bottom: 28px; }
.stage > .gm-controls:empty { margin-bottom: 20px; }

/* chronicle */
.log { max-height: calc(100vh - 140px); }
.ev { font-family: var(--book); font-size: 16px; border-bottom-color: var(--line); color: #c9bfae; }
.ev .who { font-family: var(--serif); font-size: 12px; letter-spacing: .06em; color: var(--gold); }
.ev b { color: #f0d79a; }
.ev.ok .res { color: var(--ok); }
.ev.bad .res { color: var(--bad); }
.ev:first-child { animation: ink .6s ease-out; }
@keyframes ink { from { opacity: 0; transform: translateY(-4px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

.muted { color: var(--muted); }
#toast { background: #1a1210; border-color: var(--bad); color: #f0b5a6; font-family: var(--book); font-size: 16px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: #3a3128 transparent; }

/* ---------- panels (dark) ---------- */
.place b { font-family: var(--serif); color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.panel-btns button { font-family: var(--serif); letter-spacing: .1em; font-size: 12px; text-transform: uppercase; }
.overlay { background: radial-gradient(ellipse at center, rgba(10,8,6,.7), rgba(0,0,0,.9)); }
.sheet h2 { font-size: 24px; }
.stat { background: #0f0d0b; }
.stat b { font-family: var(--serif); color: var(--gold); }
.stat.gold b { color: #e8c25e; }
.slot, .item { background: radial-gradient(circle at 50% 35%, #221c16, #120f0c); }
.slot-label { font-family: var(--serif); color: var(--gold-dim); }
.slot-item, .item-name { font-family: var(--book); font-size: 15px; color: #ddd2bf; }
.slot.filled { border-color: #4a3d2a; }
.ab { background: #0f0d0b; } .ab span { font-family: var(--serif); color: var(--gold-dim); } .ab b { font-family: var(--serif); }
.item.t-potion .ico { color: #c4483a; } .item.t-magic .ico { color: #8fb7e0; } .item.t-food .ico { color: #b08a5a; }
.item-detail { background: #0f0d0b; font-family: var(--book); font-size: 16px; }
.item-detail b { font-family: var(--serif); color: var(--gold); font-weight: 600; }
.ov-close { background: transparent; border-color: transparent; color: var(--gold-dim); }
.ov-close:hover { color: var(--gold); }
.map-legend { font-family: var(--book); font-style: italic; font-size: 15px; }
.node-name { font-family: var(--serif); letter-spacing: .04em; }
.road-days { font-family: var(--book); font-style: italic; font-size: 14px; }
.map-tip b { font-family: var(--serif); color: var(--gold); }
.options .check.travel { color: var(--gold); border-color: var(--gold-dim); }

.art-styles button { font-family: var(--book); font-size: 15px; }
.art-styles button.sel { box-shadow: 0 0 14px rgba(201,164,92,.15) inset; }
.avatar-slot.redrawing::before { font-family: var(--serif); text-transform: uppercase; font-size: 11px; color: var(--gold); }
