/* =====================================================================
   Hoard-Board — "Dragon's Hoard" theme: fantasy, not nautical.
   A layer on top of style.css: remove the <link> to this file and the
   app is back to the old look. Deep teal, aged gold, old paper.
   ===================================================================== */

:root {
  --bg: #061820;
  --panel: #0b2530;
  --panel-2: #10313b;
  --panel-3: #173f4a;
  --line: #22454d;
  --text: #efe5cf;
  --muted: #96aba6;
  --accent: #d4a646;
  --accent-2: #f0cd74;
  --user: #8fc6e8;
  --world: #bfb0e6;
  --danger: #e2806f;
  --ok: #94d39a;
  --radius: 12px;

  --gold-hi: #f7dc95;
  --gold: #d4a646;
  --gold-lo: #8f6420;
  --gold-line: rgba(212, 166, 70, .38);
  --gold-glow: 0 0 0 1px rgba(240, 205, 116, .55), 0 0 14px rgba(240, 205, 116, .28);
  --gold-grad: linear-gradient(180deg, #f6d98e 0%, #dcae52 45%, #b4832f 100%);
  /* gold filigree rule: a bright line over a dark one */
  --rope: linear-gradient(#f3d48a, #f3d48a) 0 0 / 100% 1px no-repeat, linear-gradient(#6e4c18, #6e4c18) 0 100% / 100% 1px no-repeat, linear-gradient(90deg, transparent, rgba(212, 166, 70, .5) 20%, rgba(212, 166, 70, .5) 80%, transparent);
  --display: Georgia, "Palatino Linotype", "Book Antiqua", Palatino, serif;

  /* Very faint grain so panels read as old paper rather than flat fill. */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95 0 0 0 0 .85 0 0 0 0 .6 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color-scheme: dark;
}

html, body {
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(40, 110, 120, .28), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(20, 70, 90, .35), transparent 60%),
    var(--bg);
}

::selection { background: rgba(240, 205, 116, .35); color: #fff8e6; }
* { scrollbar-color: #2f5a62 transparent; }

/* ------------------------------------------------------------ buttons -- */
button {
  background: linear-gradient(180deg, #14394400, #0000), var(--panel-2);
  border-color: var(--line);
  transition: border-color .15s, box-shadow .15s, background .15s, color .15s;
}
button:hover:not(:disabled) { border-color: var(--gold); box-shadow: 0 0 10px rgba(240, 205, 116, .18); }
button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

button.primary {
  background: var(--gold-grad);
  border: 1px solid var(--gold-lo);
  color: #241805;
  text-shadow: 0 1px 0 rgba(255, 240, 200, .45);
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, .6), inset 0 -1px 0 rgba(90, 60, 10, .45), 0 2px 6px rgba(0, 0, 0, .35);
}
button.primary:hover:not(:disabled) {
  border-color: var(--gold-lo);
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, .7), inset 0 -1px 0 rgba(90, 60, 10, .45), 0 0 16px rgba(240, 205, 116, .45);
  filter: brightness(1.06);
}
button.danger-solid { color: #2a0d08; }
.icon-button:hover:not(:disabled) { color: var(--accent-2); border-color: var(--gold-line); box-shadow: none; }

select, input[type="text"], input[type="number"], textarea, .limit-input,
.field input[type="password"], .field input[type="email"] {
  background: rgba(4, 18, 24, .6);
  border-color: var(--line);
}
input[type="text"]:focus, select:focus, textarea:focus,
.field input[type="password"]:focus, .field input[type="email"]:focus, .tag-input:focus-within {
  outline: 1px solid var(--accent-2);
  box-shadow: 0 0 0 3px rgba(240, 205, 116, .15);
}

/* ------------------------------------------------------------ top bar -- */
.topbar {
  position: relative;
  background: linear-gradient(180deg, #0f3440 0%, #0a2630 100%);
  border-bottom: none;
  padding: 8px 20px 34px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .35);
}
.topbar { z-index: 20; }
/* The golden-dragon banner is the header's anchor (Willow's art). */
.topbar { padding: 0 20px 0 0; min-height: 132px; align-items: center; }
.topbar::after { /* gold filigree rule under the header */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rope); opacity: .8;
}
.brand-banner-wrap { margin: 0 4px 0 0; padding: 0; line-height: 0; filter: none; background: none; flex-shrink: 0; }
.brand-banner {
  display: block; height: 132px; width: auto; max-width: 46vw; object-fit: contain; object-position: left center;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
}
@media (max-width: 900px) { .topbar { min-height: 96px; } .brand-banner { height: 96px; } }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: .14em;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .6));
}
.brand-emblem {
  width: 36px; height: 36px; flex-shrink: 0; object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(240, 205, 116, .35));
}
.view-tabs { background: rgba(3, 14, 18, .55); border-color: var(--gold-line); }
.view-tab { font-family: var(--display); letter-spacing: .03em; }
.view-tab[aria-pressed="true"] {
  background: var(--gold-grad); color: #241805;
  box-shadow: inset 0 1px 0 rgba(255, 245, 210, .55);
}
.view-tab:hover:not([aria-pressed="true"]) { color: var(--accent-2); }
.usage-pill { border-color: var(--gold-line); }

/* ------------------------------------------------------------ sidebar -- */
.sidebar {
  background: var(--grain), linear-gradient(180deg, #0b2631, #08202a);
  border-right: 1px solid var(--gold-line);
}
.sidebar-heading {
  font-family: var(--display); color: var(--accent-2); letter-spacing: .2em;
}
.sidebar-heading::before { content: "◆ "; font-size: 9px; opacity: .75; letter-spacing: 0; vertical-align: 1px; }
.sidebar section + section { border-top: none; position: relative; }
.sidebar section + section::before {
  content: ""; position: absolute; top: 0; left: 8px; right: 8px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}
.scene-list button { border-radius: 8px; }
.scene-list button:hover { background: rgba(240, 205, 116, .06); }
.scene-list button.active {
  background: linear-gradient(90deg, rgba(240, 205, 116, .14), rgba(240, 205, 116, .03));
  border-color: var(--gold-line); color: var(--accent-2);
  box-shadow: inset 3px 0 0 var(--gold);
}
.character-card {
  background: linear-gradient(180deg, rgba(255, 240, 200, .035), transparent), var(--panel-2);
  border-color: var(--line);
}
.character-card:hover { border-color: var(--gold-line); }
.character-dot { box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 0 6px var(--c, var(--accent)); }

/* --------------------------------------------------------- story room -- */
.room { background: transparent; }
.scene-header {
  border-bottom: none; position: relative;
  background: linear-gradient(180deg, rgba(240, 205, 116, .05), transparent);
}
.scene-header::after {
  content: ""; position: absolute; left: 28px; right: 28px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6;
}
.scene-header h2 {
  font-family: var(--display); font-size: 27px; letter-spacing: .02em; color: var(--gold-hi);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6), 0 0 18px rgba(240, 205, 116, .15);
}
.scene-description { color: #b8c6c0; }
.flow { border-top-color: var(--line); }
.chip, .chip-go { border-color: var(--gold-line); }
.chip-go:hover { background: rgba(240, 205, 116, .08); }

.event-who { font-family: var(--display); letter-spacing: .06em; }
.event-text { color: var(--text); }
.event.world .event-text { color: #d3caea; }
.event.character { border-left-width: 2px; padding-left: 16px; }
.event.character::before { /* little gold rivet where the speaker's rail starts */
  content: ""; position: absolute; left: -4px; top: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c, var(--accent)); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6), 0 0 6px var(--c, var(--accent));
}
@keyframes settle { from { background: rgba(240, 205, 116, .16); } to { background: transparent; } }

/* Proposals: a sealed note waiting for your mark. */
.proposal {
  background: var(--grain), linear-gradient(180deg, #13353f, #0d2a33);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .06), 0 6px 18px rgba(0, 0, 0, .35);
}
.proposal-text { color: #e6dcc6; }
.proposal-badge { border-color: var(--gold-line); color: var(--accent-2); }

.composer {
  background: var(--grain), linear-gradient(180deg, #0c2a34, #0a222b);
  border-top: none; position: relative;
}
.composer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--rope); opacity: .55;
}
.turn-label, .round-title { color: var(--accent-2); }
.turn-chip { background: rgba(4, 18, 24, .5); }
.turn-chip:hover:not(:disabled) { box-shadow: 0 0 10px rgba(240, 205, 116, .2); }
.round-bar { border-color: var(--gold-line); background: rgba(240, 205, 116, .05); }
.round-step.done, .state-saved, .saved-key, .key-status.ok { color: var(--ok); }
.round-step.done { border-color: rgba(148, 211, 154, .4); }
.autopilot-switch { border-color: var(--gold); color: var(--accent-2); }
.consent { color: #eadbb4; }

/* Empty room: the hoard jewel on the table. */
.empty-state {
  background:
    radial-gradient(circle at 50% 46%, rgba(240, 205, 116, .07), transparent 32%),
    var(--grain);
  font-family: var(--display); font-size: 17px; letter-spacing: .02em; color: #b8c6c0;
}
.empty-state p { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty-state p::before {
  content: ""; width: 92px; height: 92px; opacity: .55;
  background: url("../img/emblem-placeholder.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 14px rgba(240, 205, 116, .25));
}

/* ----------------------------------------------------------- inspector -- */
.inspector {
  background: var(--grain), linear-gradient(180deg, #0b2631, #08202a);
  border-left: 1px solid var(--gold-line);
}
.inspector-name { font-family: var(--display); font-size: 20px; }
.inspector-tabs { border-bottom-color: var(--gold-line); }
.memory {
  background: linear-gradient(180deg, rgba(255, 240, 200, .04), transparent), var(--panel-2);
  border-color: var(--line);
}
.memory-stars { color: var(--accent-2); text-shadow: 0 0 6px rgba(240, 205, 116, .35); }
.sheet-section h4 { color: var(--accent-2); font-family: var(--display); }
.sheet-chip { border-color: var(--gold-line); }
.outbound-preview { border-color: var(--gold-line); background: rgba(3, 14, 18, .55); }

/* ---------------------------------------------------------- storyboard -- */
.board-toolbar {
  background: linear-gradient(180deg, #0b2630, #09222b);
  border-bottom: 1px solid var(--gold-line);
}
.board-canvas {
  /* a map table: soft grid and a faint warm glow */
  background-color: #08212a;
  background-image:
    radial-gradient(circle at 85% 80%, rgba(240, 205, 116, .06), transparent 18%),
    linear-gradient(rgba(150, 200, 200, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 200, 200, .045) 1px, transparent 1px),
    var(--grain);
  background-size: auto, 48px 48px, 48px 48px, auto;
}
.scene-card {
  background: var(--grain), linear-gradient(180deg, #16404b 0%, #0f303a 100%);
  border: 1px solid var(--gold-line);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .08),
    inset 0 0 0 3px rgba(3, 14, 18, .35),
    0 8px 20px rgba(0, 0, 0, .45);
}
.scene-card::before { /* gilded lid band */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  border-radius: 10px 10px 0 0; background: var(--gold-grad); opacity: .85;
}
.scene-card:hover { border-color: var(--gold); box-shadow: var(--gold-glow), 0 8px 20px rgba(0, 0, 0, .45); }
.scene-card.current { border-color: var(--accent-2); box-shadow: var(--gold-glow), 0 8px 20px rgba(0, 0, 0, .45); }
.scene-card.link-target { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(240, 205, 116, .45); }
.card-title { font-family: var(--display); color: var(--gold-hi); letter-spacing: .05em; }
.scene-card.status-completed { border-left: 3px solid var(--ok); }
.status-completed .card-status { color: var(--ok); border-color: rgba(148, 211, 154, .4); }
.board-edges .edge-flow { stroke: var(--gold); filter: drop-shadow(0 0 3px rgba(240, 205, 116, .35)); }
.board-edges .edge-draft { stroke: var(--accent-2); }

/* -------------------------------------------------- modals and menus -- */
.modal-backdrop { background: rgba(2, 10, 14, .72); backdrop-filter: blur(2px); }
.modal {
  background: var(--grain), linear-gradient(180deg, #10323d, #0b2630);
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 0 0 4px rgba(3, 14, 18, .4), 0 20px 60px rgba(0, 0, 0, .65);
}
.modal-head { position: relative; border-bottom: none; }
.modal-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--rope); opacity: .7;
}
.modal-head h2 { font-family: var(--display); color: var(--gold-hi); letter-spacing: .03em; }
.modal-foot { border-top-color: var(--gold-line); }
.field > span b { color: var(--accent-2); }
.tag { border-color: var(--gold-line); background: rgba(240, 205, 116, .07); }
.provider-card { border-color: var(--line); }
.provider-card:hover:not(:disabled) { border-color: var(--gold); box-shadow: var(--gold-glow); }

.menu {
  background: linear-gradient(180deg, #123843, #0d2b35);
  border: 1px solid var(--gold-line);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
}
.menu button:hover { background: rgba(240, 205, 116, .1); color: var(--gold-hi); }
.menu-sep { background: var(--gold-line); }

.notice, .creator-warning { background: rgba(240, 205, 116, .07); border-color: var(--gold-line); color: #eadbb4; }
.toast {
  background: linear-gradient(180deg, #123843, #0d2b35);
  border: 1px solid var(--gold-line);
}
.autopilot-tag { border-color: var(--gold-line); color: var(--accent-2); }
.inspector-resize:hover, .inspector-resize.dragging {
  background: linear-gradient(90deg, transparent 2px, var(--gold) 2px, var(--gold) 4px, transparent 4px);
}

@media (prefers-reduced-motion: reduce) {
  button, .scene-card { transition: none; }
}

/* Arriving from the landing page: a short fade, not a page wipe. */
@keyframes app-arrive { from { opacity: 0; } to { opacity: 1; } }
body:not(.landing) { animation: app-arrive .25s ease both; }
.brand-banner-wrap a { display: block; border-radius: 8px; }
.brand-banner-wrap a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { body:not(.landing) { animation: none; } }

/* 0023: account link in the header, read-only notice */
.account-link {
  color: var(--accent-2); text-decoration: none; font-size: 13px; white-space: nowrap;
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 5px 12px; background: rgba(3, 14, 18, .45);
}
.account-link:hover { border-color: var(--gold); box-shadow: 0 0 12px rgba(240, 205, 116, .25); }
.readonly-strip {
  margin: 0; padding: 8px 20px; font-size: 13px; text-align: center;
  color: #f4dcc0; background: rgba(226, 128, 111, .14); border-bottom: 1px solid rgba(226, 128, 111, .4);
}
.new-project-form { display: flex; align-items: center; gap: 6px; }
.new-project-form input { width: 200px; }
