/* ============================================================
   D&D Virtual Tabletop — modern UI with fantasy accents
   ============================================================ */
:root {
  --bg: #14100b;
  --bg-2: #1b150f;
  --panel: #221b14;
  --panel-2: #2c241b;
  --panel-3: #362c21;
  --ink: #f1e8d8;
  --muted: #a99a83;
  --faint: #6f6353;
  --accent: #c0392b;        /* primary action (ember red) */
  --accent-d: #9c2c20;
  --gold: #cBA45a;
  --gold-2: #e4c884;
  --border: #3b3024;
  --border-2: #4a3d2d;
  --good: #6fbf73;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 6px 20px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 50px rgba(0,0,0,0.55);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Cinzel", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 75% -10%, #2a2014 0%, transparent 60%),
    radial-gradient(900px 500px at 0% 110%, #241a10 0%, transparent 55%),
    var(--bg);
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
h1, h2, h3, .brand { font-family: var(--display); letter-spacing: 0.02em; }

/* ---- Buttons ---- */
button {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--accent), var(--accent-d));
  color: #fff;
  border: 1px solid rgba(0,0,0,0.25);
  padding: 9px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: transform .06s ease, filter .15s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
button:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn-secondary {
  background: linear-gradient(180deg, var(--panel-3), var(--panel-2));
  color: var(--ink);
  border: 1px solid var(--border-2);
  box-shadow: none;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-2); }
button.active { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; border-color: var(--gold); }

/* ---- Inputs ---- */
input, select, textarea {
  background: var(--panel);
  border: 1px solid var(--border-2);
  color: var(--ink);
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,164,90,0.18);
}
select { cursor: pointer; }

/* ---- Scrollbars ---- */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-2); background-clip: padding-box; }

/* ============================================================
   Landing / join screen
   ============================================================ */
.join-screen { display: flex; align-items: flex-start; justify-content: center; height: 100vh; overflow-y: auto; padding: 28px 20px; }
.join-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--border-2);
  padding: 34px;
  border-radius: var(--radius-lg);
  width: 380px; max-width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop .25s ease;
}
.join-card h1 { margin: 0 0 18px; color: var(--gold-2); font-size: 26px; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.brand-logo { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto 14px; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.55)); }
#welcome { font-size: 19px; margin: 0 0 14px; }
.join-card label { display: block; text-align: left; margin: 12px 0 5px; color: var(--muted); font-size: 13px; font-weight: 500; }
.join-card input { width: 100%; }
.join-card button { width: 100%; margin-top: 18px; padding: 11px; font-size: 15px; }
.mode-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg-2); padding: 4px; border-radius: var(--radius); }
.mode-tab { flex: 1; background: transparent; color: var(--muted); border: none; box-shadow: none; padding: 9px; }
.mode-tab.active { background: linear-gradient(180deg, var(--accent), var(--accent-d)); color: #fff; }

/* Dashboard is wider than the login card; keep the form itself a comfortable width. */
#join-screen .join-card { width: 880px; max-width: 100%; padding: 32px 36px; }
/* Two-column dashboard: table management on the left, menu on the right. */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 28px; align-items: start; text-align: left; margin-top: 8px; }
.dash-main { min-width: 0; }
@media (max-width: 760px) { #join-screen .join-card { width: 480px; } .dash-grid { grid-template-columns: 1fr; gap: 18px; } }
.dash-menu { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.dash-menu .dash-h { margin: 2px 0 6px; }
.menu-btn { width: 100%; text-align: left; background: transparent; color: var(--ink); border: 1px solid transparent; box-shadow: none; font-size: 14px; font-weight: 500; padding: 9px 12px; margin: 0; border-radius: var(--radius); text-decoration: none; }
.menu-btn:hover { background: var(--panel-3); color: var(--gold-2); filter: none; }
.menu-btn:disabled { opacity: .6; cursor: default; }
.menu-admin { color: var(--gold-2); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.dash-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 20px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.dash-footer .link-btn { margin: 0; }
.dash-footer + .dash-footer { margin-top: 8px; padding-top: 10px; border-top: none; }
.dash-admin .link-btn { color: var(--gold-2); }
.join-hint { color: var(--muted); font-size: 12px; text-align: left; margin: 10px 0 0; line-height: 1.5; }
.auth-error { color: #e89b9b; font-size: 13px; min-height: 16px; margin: 12px 0 0; }
/* SSO buttons */
.sso-buttons { margin-top: 16px; }
.sso-buttons.hidden { display: none; }
.sso-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 4px 0 14px; }
.sso-divider::before, .sso-divider::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
.sso-btn { display: block; text-align: center; padding: 11px; border-radius: var(--radius); font-weight: 600; font-size: 14px; margin-bottom: 8px; color: #fff; text-decoration: none; }
.sso-btn.hidden { display: none; }
.sso-discord { background: #5865F2; }
.sso-google { background: #ffffff; color: #1f1f1f; border: 1px solid #dadce0; }
.sso-btn:hover { filter: brightness(1.05); }
.dash-h { text-align: left; margin: 6px 0 8px; color: var(--gold-2); font-size: 15px; }
/* Trial / subscription banner */
.trial-banner { text-align: left; font-size: 13px; line-height: 1.5; padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; background: var(--panel-2); border: 1px solid var(--border-2); }
.trial-banner.hidden { display: none; }
.trial-banner.ended { border-color: var(--accent); background: rgba(192,57,43,0.12); }
.trial-banner.ok { border-color: #3a6e44; background: rgba(47,158,68,0.10); }
.trial-banner a { color: var(--gold-2); font-weight: 600; }
/* AI tab upsell */
.ai-upsell { font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: var(--radius); margin-bottom: 10px; background: rgba(201,164,90,0.12); border: 1px solid var(--gold); color: var(--ink); }
.ai-upsell.hidden { display: none; }
.acct-plan { font-size: 12px; }
/* AI usage meter */
.ai-meter { margin-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.ai-meter.hidden { display: none; }
.ai-meter-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.ai-meter-row b { color: var(--gold-2); }
.ai-meter-bar { height: 6px; background: var(--panel-3); border-radius: 999px; overflow: hidden; }
.ai-meter-bar > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); }
.ai-meter-actions { margin-top: 8px; }
.ai-buy { width: 100%; padding: 7px; font-size: 12.5px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-2); color: var(--gold-2); }
.ai-pack-row { display: flex; flex-direction: column; gap: 6px; }
.ai-pack { padding: 8px; font-size: 12.5px; background: linear-gradient(180deg, var(--accent), var(--accent-d)); color: #fff; }
.ai-pack-cancel { padding: 6px; font-size: 12px; }
/* Subscription / billing block in the AI tab */
.billing-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 8px; }
.billing-box.hidden { display: none; }
.billing-cur { font-size: 12.5px; color: var(--muted); }
.billing-cur b { color: var(--gold-2); }
.billing-plans { display: flex; flex-direction: column; gap: 6px; }
.billing-sub { padding: 9px; font-size: 13px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; font-weight: 700; }
.billing-portal { padding: 7px; font-size: 12.5px; }
/* Signup "what's included in the trial" callout */
.trial-callout { background: rgba(212,175,55,0.07); border: 1px solid var(--gold); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.trial-callout-head { font-family: "MedievalSharp", serif; color: var(--gold-2); font-size: 16px; margin-bottom: 6px; }
.trial-callout p { font-size: 12.5px; line-height: 1.5; margin: 0 0 7px; color: var(--ink); }
.trial-callout p:last-child { margin-bottom: 0; }
.trial-callout-fine { color: var(--muted) !important; font-size: 11.5px !important; }
/* Two-column signup: trial info on the left, form fields on the right. */
#auth-screen .join-card:has(#signup-form:not(.hidden)) { width: 720px; }
#auth-screen .join-card:has(#signup-form:not(.hidden)) .mode-tabs { max-width: 420px; margin-left: auto; margin-right: auto; }
.signup-split { display: flex; gap: 24px; text-align: left; }
.signup-left, .signup-right { flex: 1 1 0; min-width: 0; }
.signup-left { display: flex; }
.signup-left .trial-callout { margin-bottom: 0; width: 100%; }
.signup-right > button { margin-top: 16px; }
@media (max-width: 680px) {
  #auth-screen .join-card:has(#signup-form:not(.hidden)) { width: 380px; }
  .signup-split { flex-direction: column; gap: 6px; }
  .signup-left .trial-callout { margin-bottom: 14px; }
}
.billing-card-prompt { background: rgba(212,175,55,0.08); border: 1px solid var(--gold); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.billing-card-prompt b { color: var(--gold-2); }
.billing-card-prompt p { font-size: 12px; color: var(--muted); margin: 5px 0 8px; line-height: 1.45; }
.billing-addcard { width: 100%; padding: 9px; font-size: 13px; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; font-weight: 700; }
.banner-addcard { margin-left: 8px; padding: 5px 12px; font-size: 12.5px; vertical-align: middle; background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; font-weight: 700; border-radius: 6px; }
.billing-pulse { animation: billing-pulse 0.9s ease-in-out 3; }
/* Spell-template helper hint */
.menu-hint { font-size: 11.5px; color: var(--muted); padding: 2px 2px 0; }
/* Game-system labels: dashboard table cards + in-app top bar */
.table-name { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.table-sys { font-size: 11px; color: var(--gold-2); font-weight: 600; opacity: 0.85; }
.topbar-center { flex-wrap: wrap; }
.table-sys-badge { flex-basis: 100%; width: 100%; text-align: center; font-size: 11px; color: var(--gold-2); font-family: "MedievalSharp", serif; letter-spacing: .4px; margin-top: 1px; }
/* DL:T reference panel (conditions / traps) */
.dlt-refs .ref-search { margin-bottom: 10px; }
.dlt-ref-tier { font-size: 12.5px; margin: 2px 0; line-height: 1.4; }
.dlt-ref-tier b { color: var(--gold-2); }
/* Dragon Lore: Teramyth (DL:T) character sheet */
.dlt-card { display: flex; flex-direction: column; gap: 8px; }
.dlt-head { display: flex; gap: 8px; align-items: center; }
.dlt-name { flex: 1; font-size: 16px; font-weight: 700; }
.dlt-rank { font-size: 12px; color: var(--muted); white-space: nowrap; }
.dlt-rank-in { width: 52px; }
.dlt-identity { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.dlt-identity label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 2px; min-width: 0; }
/* Keep the sheet inside the sidebar: let grid/flex children shrink and fill their track. */
.dlt-card { min-width: 0; }
.dlt-card .dlt-name { min-width: 0; }
.dlt-identity input, .dlt-identity select { width: 100%; min-width: 0; }
.dlt-derived .dlt-der { min-width: 0; }
.dlt-derived .dlt-der input { width: 100%; min-width: 0; }
.dlt-pillars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dlt-pillar { background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 2px; text-align: center; min-width: 0; }
.dlt-pillar-name { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.dlt-score { width: 100%; text-align: center; padding: 3px 0; font-weight: 700; }
.dlt-pillar-mod { font-size: 13px; color: var(--gold-2); font-weight: 700; margin-top: 2px; }
.dlt-derived { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.dlt-der { display: flex; flex-direction: column; font-size: 10.5px; color: var(--muted); gap: 2px; }
.dlt-skills { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.dlt-skills-head { font-size: 12.5px; font-weight: 700; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 6px; }
.dlt-skill-rows { display: flex; flex-direction: column; gap: 4px; }
.dlt-skill-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dlt-skill-name { flex: 1; }
.dlt-skill-mod { color: var(--gold-2); font-weight: 700; white-space: nowrap; }
.dlt-skill-roll, .dlt-skill-rm { padding: 2px 8px; font-size: 12px; }
.dlt-skill-add { margin-top: 7px; }
.dlt-skill-pick { width: 100%; }
.dlt-weapons { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.dlt-weapon-rows { display: flex; flex-direction: column; gap: 4px; }
.dlt-atk, .dlt-dmg, .dlt-wrm { padding: 2px 8px; font-size: 12px; }
.dlt-armor-info { margin-top: 6px; font-size: 11px; }
.dlt-armor-pick { max-width: 48%; }
.dlt-spells, .dlt-talents { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px; }
.dlt-talent-rows { display: flex; flex-direction: column; gap: 4px; }
.dlt-tal-rm { padding: 2px 8px; font-size: 12px; }
.dlt-tal-cat, .dlt-tal-pick { max-width: 48%; }
.dlt-spell-rows { display: flex; flex-direction: column; gap: 5px; }
.dlt-spell-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.dlt-sp-name { flex: 1; min-width: 110px; }
.dlt-sp-current, .dlt-sp-disc { font-size: 11px; }
.dlt-sp-tierl { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.dlt-sp-tier { width: 44px; }
.dlt-sp-cast, .dlt-sp-rm { padding: 2px 8px; font-size: 12px; }
.dlt-spell-add { margin-top: 7px; padding: 4px 10px; font-size: 12px; }
.dlt-notes-l { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 3px; }
.dlt-test { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: rgba(212,175,55,0.06); border: 1px solid var(--border-2); border-radius: 8px; padding: 7px 8px; }
.dlt-test-title { font-weight: 700; font-size: 12.5px; }
.dlt-test label { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 3px; }
.dlt-test input { width: 50px; }
.dlt-test-go { padding: 5px 12px; }
.dlt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dlt-notes-l { min-width: 0; }
.dlt-notes-l input, .dlt-notes-l textarea { width: 100%; min-width: 0; }
@media (max-width: 560px) { .dlt-pillars { grid-template-columns: repeat(4, 1fr); } }
/* Admin Console */
.console-card { max-height: 88vh; display: flex; flex-direction: column; }
.console-head { display: flex; justify-content: space-between; align-items: center; }
.console-head h2 { margin: 0; }
.console-tabs { display: flex; gap: 4px; margin: 12px 0; background: var(--bg-2); padding: 4px; border-radius: var(--radius); flex-wrap: wrap; }
.console-tab { flex: 1; min-width: 90px; background: transparent; color: var(--muted); border: none; box-shadow: none; padding: 8px 10px; font-size: 13px; }
.console-tab.active { background: linear-gradient(180deg, var(--accent), var(--accent-d)); color: #fff; }
.console-panel { display: none; overflow-y: auto; flex: 1; min-height: 0; }
.console-panel.active { display: block; }
.console-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 6px; }
.cstat { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; text-align: center; }
.cstat-num { font-size: 24px; font-weight: 800; color: var(--gold-2); font-family: "Cinzel", serif; }
.cstat-label { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
/* Feedback admin dashboard */
.admin-card-wide { max-width: 760px; width: 92vw; }
.feedback-stats { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 14px; font-size: 13px; color: var(--muted); }
.feedback-stats span { background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; }
.fb-card { border: 1px solid var(--border-2); border-left: 3px solid var(--border-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel); }
.fb-card.fb-open { border-left-color: #4a9; }
.fb-card.fb-in_progress { border-left-color: var(--gold); }
.fb-card.fb-done { border-left-color: #58f; opacity: 0.7; }
.fb-card.fb-closed { opacity: 0.5; }
.fb-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.fb-kind { font-weight: 700; text-transform: capitalize; }
.fb-msg { margin: 6px 0 8px; font-size: 14px; line-height: 1.45; white-space: normal; word-break: break-word; }
.fb-actions { display: flex; gap: 8px; align-items: center; }
.fb-actions .fb-status { padding: 4px 8px; font-size: 12.5px; }
.fb-actions .fb-del { padding: 4px 10px; font-size: 12px; margin-left: auto; }
@keyframes billing-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(212,175,55,0); } 50% { box-shadow: 0 0 0 4px rgba(212,175,55,0.6); } }
.my-tables { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.table-row { display: flex; align-items: stretch; gap: 8px; width: 100%; }
.table-open { flex: 1 1 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border-2); color: var(--ink); padding: 13px 16px; border-radius: var(--radius); text-align: left; font-size: 15px; }
.table-open:hover { border-color: var(--gold); }
.table-open .table-role { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: var(--gold-2); background: rgba(0,0,0,0.28); padding: 3px 9px; border-radius: 999px; }
.table-del { flex: 0 0 46px; width: 46px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border-2); color: var(--muted); border-radius: var(--radius); font-size: 15px; }
.table-del:hover { border-color: #b03636; color: #e89b9b; }
.owner-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: var(--gold); color: #1a130a; padding: 1px 6px; border-radius: 10px; }
/* Account cards in the admin panel */
.acct-card { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.acct-card.acct-pending { border-color: var(--gold); background: rgba(201,164,90,0.08); }
/* Accounts toolbar: search + filters, sticky atop the list */
.acct-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; position: sticky; top: 0; background: var(--panel); padding: 8px 0; z-index: 2; }
.acct-toolbar #acct-search { flex: 1 1 220px; min-width: 160px; }
.acct-toolbar select { padding: 7px 9px; font-size: 13px; width: auto; }
.acct-toolbar-chk { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.acct-toolbar-chk input { width: auto; }
#acct-count { margin-left: auto; white-space: nowrap; }
.acct-info .ar-name { font-weight: 600; }
.acct-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acct-controls .acct-role { padding: 6px 8px; font-size: 13px; }
.acct-controls .acct-del { background: linear-gradient(180deg, #b03636, #8c2727); padding: 6px 10px; font-size: 12px; }
.acct-controls .acct-reset { padding: 6px 10px; font-size: 12px; }
.acct-controls .acct-approve { background: linear-gradient(180deg, #2f9e44, #248239); padding: 6px 10px; font-size: 12px; }
.acct-controls .acct-forge { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.acct-controls .acct-forge input { width: auto; }
.req-badge { background: var(--gold); color: #2a1d0b; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; text-transform: uppercase; }
/* Settings: dice skin picker */
.skin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.skin-card { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 6px; color: var(--ink); font-size: 12px; }
.skin-card .die-svg { width: 56px; height: 56px; }
.skin-card.selected { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.skin-card:hover { border-color: var(--gold-2); }
#auth-screen .join-card label select { width: 100%; margin-top: 4px; }
.link-btn { background: transparent; color: var(--muted); border: none; box-shadow: none; font-size: 12px; text-decoration: underline; margin-top: 16px; padding: 4px; font-weight: 500; }
.link-btn:hover { color: var(--gold-2); filter: none; }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  flex: 0 0 auto;
  padding: 10px 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--border-2);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  z-index: 10;
}
.brand { font-weight: 700; color: var(--gold-2); font-size: 17px; letter-spacing: 0.06em; }
.brand-block { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 0 0 auto; }
.brand-logo-sm { height: 58px; width: auto; display: block; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5)); }
/* Centered room + player name in a medieval script. pointer-events:none so it
   never blocks the buttons it floats over. */
.topbar-center { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; pointer-events: none; max-width: 50%; }
.room-title { font-family: "MedievalSharp", "Cinzel", serif; font-size: 23px; line-height: 1; color: var(--gold-2); letter-spacing: 0.03em; text-shadow: 0 1px 4px rgba(0,0,0,0.6); white-space: nowrap; }
.me-name { font-family: "MedievalSharp", serif; font-size: 16px; color: var(--ink); opacity: 0.92; white-space: nowrap; }
.brand-meta { display: flex; align-items: center; gap: 8px; }
.room-label { color: var(--muted); font-size: 13px; }
.role-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
.role-badge.dm { background: linear-gradient(180deg, var(--accent), var(--accent-d)); color: #fff; }
.role-badge.player { background: var(--panel-3); color: var(--muted); border: 1px solid var(--border-2); }
.map-controls { flex: 1; margin-left: 14px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.map-controls > button { padding: 8px 11px; }
.topbar-spacer { flex: 1 1 auto; }

/* Grouped dropdown menus in the top bar */
.menu { position: relative; }
.menu-trigger { white-space: nowrap; padding: 8px 11px; }
.menu-trigger.active { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; border-color: var(--gold); }
.menu-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 230px; background: var(--panel); border: 1px solid var(--gold); border-radius: 10px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.6); display: none; flex-direction: column; gap: 8px; }
.menu-panel.open { display: flex; }
.menu-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.menu-row > button { padding: 7px 10px; }
.menu-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-top: 4px; }
.menu-panel input:not([type=number]) { width: 100%; }
.menu-panel input[type=number] { width: 64px; }
#map-picker, #creature-template { background: var(--panel); color: var(--ink); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 8px; }
.voice-controls { display: inline-flex; gap: 6px; margin-left: 6px; padding-left: 12px; border-left: 1px solid var(--border-2); }
#voice-join { background: linear-gradient(180deg, #2f9e44, #248239); }
#voice-leave { background: linear-gradient(180deg, #b03636, #8c2727); }

/* ============================================================
   Left tool rail (DM map tools + view tools)
   ============================================================ */
.tool-rail {
  flex: 0 0 auto; width: 54px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 0; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-right: 1px solid var(--border-2); z-index: 20; position: relative;
}
.rail-btn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  font-size: 19px; padding: 0; border-radius: 10px;
  background: var(--panel-3); border: 1px solid var(--border-2); color: var(--ink);
}
.rail-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.rail-btn.active, .menu-trigger.rail-btn.active { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; border-color: var(--gold); }
.rail-sep { width: 26px; height: 1px; background: var(--border-2); margin: 4px 0; }
/* Rail menu panels fly out to the right of the rail, not downward. */
.tool-rail .menu { width: 40px; }
.tool-rail .menu-panel { top: 0; left: calc(100% + 10px); }
body.is-player .tool-rail .rail-sep { display: none; } /* players only see the 3 view tools */

/* ============================================================
   Layout: map + sidebar
   ============================================================ */
/* App shell: full-height column so the layout fills exactly the space left by the
   top bar — no magic pixel offset that breaks when the bar is taller or wraps. */
.app:not(.hidden) { display: flex; flex-direction: column; height: 100vh; min-height: 0; }
.layout { display: flex; flex: 1; min-height: 0; }
.map-wrap { flex: 1; position: relative; background: radial-gradient(circle at 50% 40%, #181208, #0d0a06); overflow: hidden; }
#map-canvas { display: block; width: 100%; height: 100%; }
.weather-canvas { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.hint {
  position: absolute; bottom: 10px; left: 14px; margin: 0;
  font-size: 12px; color: var(--muted);
  background: rgba(15,11,7,0.6); padding: 4px 10px; border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* Token right-click menu */
.token-menu { position: fixed; z-index: 95; background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 5px; display: flex; flex-direction: column; min-width: 150px; }
.token-menu button { background: transparent; color: var(--ink); border: none; box-shadow: none; text-align: left; padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.token-menu button:hover { background: var(--panel-3); filter: none; }

/* Voice/video tiles */
.video-strip { position: absolute; top: 12px; left: 12px; z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; max-width: 70%; }
.vtile { position: relative; width: 148px; height: 110px; background: #000; border: 2px solid var(--border-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.vtile.muted-tile { border-color: var(--accent); }
.vtile video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.vtile .vname { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.65); color: #fff; font-size: 12px; padding: 3px 7px; text-align: center; }

/* Sidebar */
.sidebar { width: 372px; background: linear-gradient(180deg, var(--panel), var(--bg-2)); border-left: 1px solid var(--border-2); display: flex; flex-direction: column; }
/* Tabs wrap into tidy rows — no horizontal scrollbar. */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--border-2); background: var(--bg-2); }
.tab {
  flex: 1 1 auto; text-align: center; background: transparent; color: var(--muted); border: none; box-shadow: none;
  border-radius: var(--radius) var(--radius) 0 0; padding: 9px 11px; font-size: 12.5px; font-weight: 600;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); filter: none; background: rgba(255,255,255,0.03); }
.tab.active { color: var(--gold-2); background: var(--panel); border-bottom: 2px solid var(--gold); }
.tab-panel { display: none; flex: 1; flex-direction: column; min-height: 0; padding: 14px; overflow-y: auto; }
.tab-panel.active { display: flex; animation: fade .2s ease; }
/* Chat panel: only the log scrolls; the compose tray stays pinned at the bottom. */
#tab-chat { overflow: hidden; padding-bottom: 0; }

/* ---- Chat & dice ---- */
.chat-log { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
/* Pinned compose tray (input + dice), visually separated from the message log. */
.chat-compose { flex: 0 0 auto; margin: 10px -14px 0; padding: 12px 14px 14px; background: var(--bg-2); border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 0; }
.chat-compose .chat-input { margin-bottom: 2px; }
.chat-log:empty::after { content: "No messages yet. Say hello, or roll like 2d6+3 below."; color: var(--faint); font-size: 13px; text-align: center; margin: auto; max-width: 80%; }
.msg { padding: 8px 11px; border-radius: var(--radius); background: var(--panel-2); font-size: 14px; border: 1px solid var(--border); }
.msg .who { font-weight: 700; color: var(--gold-2); }
.msg.system { background: transparent; border: none; color: var(--muted); font-style: italic; text-align: center; font-size: 12.5px; }
.msg.roll { border-left: 3px solid var(--accent); background: linear-gradient(180deg, var(--panel-2), var(--panel)); display: flex; align-items: flex-start; gap: 8px; }
.msg.roll .roll-body { flex: 1; }
.die-mini { width: 24px; height: 24px; flex: 0 0 auto; margin-top: 1px; }
.msg.roll .total { font-weight: 800; font-size: 17px; color: var(--gold-2); }
.msg .detail { color: var(--muted); font-size: 12px; margin-top: 2px; }
/* Dice macros */
.macro-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.macro-btn { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; border: none; padding: 6px 10px; font-size: 12px; font-weight: 700; }
.macro-add { background: transparent; border: 1px dashed var(--border-2); color: var(--muted); padding: 6px 10px; font-size: 12px; box-shadow: none; }
.macro-add:hover { border-color: var(--gold); color: var(--gold-2); }

/* Soundboard */
.snd-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.snd-add input { flex: 1; min-width: 90px; }
.snd-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.snd-row { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 7px 10px; }
.snd-row .snd-nm { flex: 1; } .snd-row .snd-nm em { color: var(--muted); font-size: 11px; }
.snd-row button { padding: 4px 10px; font-size: 13px; }

/* Handout overlay */
.handout-overlay { position: fixed; inset: 0; background: rgba(6,4,2,0.85); z-index: 88; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(3px); }
.handout-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 92%; max-height: 92%; }
.handout-inner img { max-width: 100%; max-height: 80vh; border: 2px solid var(--gold); border-radius: 8px; box-shadow: var(--shadow-lg); }

.roll-mods { display: flex; gap: 6px; margin-top: 10px; }
.roll-mods button { flex: 1; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); padding: 7px 4px; font-size: 12px; box-shadow: none; }
.roll-mods button:hover { color: var(--ink); border-color: var(--gold); }
.roll-mods button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.dice-bar { display: flex; gap: 6px; margin: 8px 0 0; flex-wrap: wrap; }
.die-btn { flex: 1; min-width: 46px; background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border-2); padding: 6px 0; box-shadow: none; }
.die-btn:hover { border-color: var(--gold); }
.die-svg { width: 38px; height: 38px; display: block; margin: 0 auto; }
.die-btn:hover .die-svg { filter: brightness(1.12); }

/* Shared faceted-die look (galaxy gradient + gold engraved numbers) */
.die-body { stroke: var(--gold-2); stroke-width: 3; stroke-linejoin: round; }
.die-edge { stroke: rgba(255,255,255,0.16); stroke-width: 1.2; }
.die-face { fill: rgba(255,255,255,0.10); stroke: rgba(255,255,255,0.14); stroke-width: 1; }
.die-num { fill: #ecd089; font: 800 30px var(--font); paint-order: stroke; stroke: #4a3310; stroke-width: 2.4; stroke-linejoin: round; }

/* On-screen roll animation */
.dice-anim { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 85; }
.die-roll { width: 160px; height: 160px; filter: drop-shadow(0 10px 26px rgba(0,0,0,0.65)); }
.die-roll .die-svg { width: 160px; height: 160px; }
.die-roll.spinning { animation: dieSpin 0.5s linear infinite; }
.die-roll.settled { animation: diePop 0.45s ease; }
@keyframes dieSpin { 0% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(180deg) scale(1.12); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes diePop { 0% { transform: scale(1.35); } 55% { transform: scale(0.9); } 100% { transform: scale(1); } }
.chat-input { display: flex; gap: 6px; }
.chat-input input { flex: 1; }

/* ---- Cards (characters & creatures) ---- */
.char-list { overflow-y: auto; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
#char-list:empty::after { content: "No characters yet — click “+ New character”, or describe one in the ✨ AI tab."; color: var(--faint); font-size: 13px; text-align: center; padding: 20px 10px; }
#creature-list:empty::after { content: "No creatures yet — add one from a template above, or generate one in the ✨ AI tab."; color: var(--faint); font-size: 13px; text-align: center; padding: 20px 10px; }
.char-card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow); }
.char-card h3 { margin: 0 0 8px; }
.char-row { display: flex; gap: 8px; margin-bottom: 8px; }
.char-row label { flex: 1; font-size: 12px; color: var(--muted); font-weight: 500; }
.char-row input { width: 100%; }
.abilities { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.abilities .ability { text-align: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 4px; }
.abilities label { font-size: 11px; color: var(--muted); display: block; }
.abilities input { width: 100%; text-align: center; }
.char-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.char-actions button { flex: 1 1 auto; min-width: 84px; }
[data-act="open"] { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; border-color: var(--gold); }

/* Compact roster rows (characters & bestiary): name + chips, expand for the full card */
.compact-card { padding: 9px 12px; }
.compact-row { display: flex; align-items: center; gap: 10px; }
.compact-id { flex: 1; min-width: 0; }
.compact-name { font-weight: 700; color: var(--gold-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.compact-meta .chip { display: inline-block; padding: 1px 8px; background: var(--panel-3); border: 1px solid var(--border-2); border-radius: 999px; color: var(--ink); font-size: 11px; white-space: nowrap; }
.compact-btns { display: flex; gap: 6px; flex-shrink: 0; }
.compact-btns button { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
.compact-edit { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #2a1d0b; border: 1px solid var(--gold); box-shadow: none; }
.compact-edit:hover { filter: brightness(1.06); }
.compact-body:empty { display: none; }
.compact-body > .char-card { margin-top: 10px; border: none; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; padding: 12px 0 2px; }

/* Expandable sheet sections */
.char-card details { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.char-card summary { cursor: pointer; color: var(--gold-2); font-size: 13px; font-weight: 600; list-style: none; }
.char-card summary::-webkit-details-marker { display: none; }
.char-card summary::before { content: "▸ "; color: var(--muted); }
.char-card details[open] summary::before { content: "▾ "; }
.char-card .lines { margin-top: 6px; }
.char-card .line { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; }
.char-card .line .ln-name { flex: 1; }
.char-card .line .ln-name em { color: var(--muted); font-style: normal; font-size: 11px; }
.char-card .line .ln-mod { width: 32px; text-align: right; color: var(--gold-2); font-weight: 700; }
.char-card .mini { padding: 3px 7px; background: var(--panel-3); border: 1px solid var(--border-2); font-size: 12px; box-shadow: none; }
.char-card .mini:hover { background: var(--accent); }
.char-card .slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.char-card .slot { display: flex; align-items: center; gap: 3px; font-size: 12px; }
.char-card .slot label { color: var(--muted); width: 18px; }
.char-card .slot input { width: 36px; text-align: center; padding: 4px; }
.char-card textarea { width: 100%; margin-top: 6px; resize: vertical; }
.creature-kind { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.creature-actions textarea { width: 100%; margin-top: 4px; resize: vertical; min-height: 52px; }
.bestiary-top { display: flex; gap: 6px; margin-bottom: 8px; }
.bestiary-top select { flex: 1; }
.player-note { color: var(--muted); font-size: 12px; font-style: italic; margin: 4px 0; display: none; }
body.is-player .player-note { display: block; }

/* ---- Initiative ---- */
.init-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.init-round { font-family: var(--display); font-weight: 700; color: var(--gold-2); font-size: 17px; }
.init-add { display: flex; gap: 6px; margin-bottom: 12px; }
.init-add .narrow { width: 58px; }
.init-add input { flex: 1; min-width: 0; }
.init-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#init-list:empty::after { content: "No combatants yet. Add names above, or drop monsters from the Bestiary with “→ Initiative”."; color: var(--faint); font-size: 13px; text-align: center; padding: 16px 10px; }
.init-row { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 8px 10px; transition: border-color .15s ease, background .15s ease; }
.init-row.current { border-color: var(--gold); background: linear-gradient(90deg, rgba(201,164,90,0.16), var(--panel-2)); box-shadow: 0 0 0 1px var(--gold) inset; }
.init-row .init-val { font-weight: 700; width: 30px; text-align: center; color: var(--gold-2); }
.init-row .init-nm { flex: 1; }
.init-row .init-hp { width: 62px; }
.init-row input { padding: 5px 6px; }
.init-row .del { background: transparent; color: var(--muted); padding: 2px 6px; box-shadow: none; border: none; }
.init-row .del:hover { color: var(--accent); filter: none; }

/* Tracked conditions on a combatant (chips + DM-only add form) */
.init-row { flex-wrap: wrap; }
.init-row .cond-add { background: transparent; color: var(--muted); padding: 2px 7px; box-shadow: none; border: 1px dashed var(--border-2); border-radius: 999px; line-height: 1; }
.init-row .cond-add:hover { color: var(--gold-2); border-color: var(--gold); filter: none; }
.init-conds { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.cond-chip { display: inline-flex; align-items: center; gap: 4px; background: rgba(201,164,90,0.10); border: 1px solid var(--border-2); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; color: var(--gold-2); cursor: pointer; white-space: nowrap; }
.cond-chip:hover { border-color: var(--gold); }
.cond-chip .cond-x { background: transparent; color: var(--muted); border: none; box-shadow: none; padding: 0 0 0 2px; font-size: 10px; line-height: 1; cursor: pointer; }
.cond-chip .cond-x:hover { color: var(--accent); filter: none; }
.cond-form { flex-basis: 100%; display: flex; align-items: center; gap: 4px; margin-top: 5px; }
.cond-form .cond-name { flex: 1; min-width: 0; }
.cond-form .cond-span { width: 58px; }
.cond-form .cond-inf-l { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; cursor: pointer; }
.cond-form .cond-save { padding: 4px 9px; }

/* ---- Reference ---- */
.ref-intro { color: var(--muted); font-size: 13px; }
.ref-search { display: flex; gap: 6px; margin-bottom: 18px; }
.ref-search input { flex: 1; min-width: 0; }
.ref-links h4 { margin: 0 0 8px; color: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; }
.ref-links a { display: block; color: var(--ink); padding: 9px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 6px; text-decoration: none; transition: border-color .15s ease, color .15s ease; }
.ref-links a:hover { border-color: var(--gold); color: var(--gold-2); }

/* ---- FX ---- */
.fx-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.fx-buttons button { padding: 15px 8px; font-size: 14px; background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border-2); color: var(--ink); box-shadow: none; }
.fx-buttons button:hover { border-color: var(--gold); }
.fx-flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; z-index: 80; }

/* ---- AI ---- */
#ai-prompt { width: 100%; resize: vertical; margin-top: 8px; }
.ai-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0; }
.ai-output { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 12px; min-height: 64px; white-space: pre-wrap; font-size: 14px; line-height: 1.55; overflow-y: auto; }
.ai-output:empty::after { content: "Answers and confirmations appear here."; color: var(--faint); }

/* ============================================================
   Pop-out character sheet
   ============================================================ */
.sheet-modal { position: fixed; inset: 0; background: rgba(8,5,3,0.72); z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 24px; overflow-y: auto; backdrop-filter: blur(3px); }
.sheet-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 26px; width: 780px; max-width: 100%; box-shadow: var(--shadow-lg); animation: pop .22s ease; }
.sheet-card h3 { margin: 22px 0 8px; border-bottom: 1px solid var(--border-2); padding-bottom: 6px; color: var(--gold-2); }
.sheet-card h3 small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; font-family: var(--font); }
.sh-head { display: flex; gap: 12px; align-items: center; }
.sh-name { flex: 1; font-family: var(--display); font-size: 22px; font-weight: 700; }
.sh-headbtns { display: flex; gap: 8px; }
.sh-headbtns button, .sh-save { padding: 10px 16px; }
.sh-intro { background: var(--panel-2); border-left: 3px solid var(--gold); padding: 11px 13px; border-radius: var(--radius); font-size: 13px; line-height: 1.55; }
.sh-readonly { color: var(--muted); font-size: 13px; font-style: italic; }
.sh-core { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0; }
.sh-core label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
.sh-core input { font-size: 16px; }
.sh-core small { color: var(--faint); font-size: 11px; }
.sh-abils { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sh-abil { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 12px; }
.sh-abil-top { display: flex; justify-content: space-between; align-items: center; }
.sh-abil-name { font-weight: 700; } .sh-abil-name small { color: var(--muted); }
.sh-abil-mod { font-size: 24px; font-weight: 800; color: var(--gold-2); }
.sh-abil input { width: 100%; text-align: center; font-size: 18px; margin: 6px 0; }
.sh-desc { color: var(--muted); font-size: 12px; margin: 4px 0; line-height: 1.4; }
.sh-roll { width: 100%; background: var(--panel-3); border: 1px solid var(--border-2); color: var(--ink); padding: 7px; font-size: 12px; box-shadow: none; }
.sh-roll:hover { background: var(--accent); }
.sh-list { display: flex; flex-direction: column; gap: 3px; }
.sh-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius); }
.sh-row:hover { background: var(--panel-2); }
.sh-row.skill { align-items: flex-start; }
.sh-row-main { flex: 1; display: flex; flex-direction: column; }
.sh-row-name { flex: 1; } .sh-row-name small { color: var(--muted); }
.sh-row .sh-desc { margin: 0; }
.sh-row-mod { width: 38px; text-align: right; font-weight: 700; color: var(--gold-2); }
.sh-roll.sm { width: auto; padding: 5px 9px; }
.sh-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-slot { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 7px 9px; font-size: 12px; }
.sh-slot label { color: var(--muted); }
.sh-slot input { width: 44px; text-align: center; padding: 4px; }
.sheet-card textarea { width: 100%; resize: vertical; }
.sh-savebar { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.sh-saved { color: var(--good); font-size: 13px; }

/* ============================================================
   Owner room management
   ============================================================ */
.admin-overlay { position: fixed; inset: 0; background: rgba(8,5,3,0.7); display: flex; align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(3px); }
.admin-card { background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 26px; width: 480px; max-width: 100%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.admin-card h2 { margin-top: 0; color: var(--gold-2); }
.admin-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.admin-room { display: flex; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 12px; }
.admin-room .ar-name { flex: 1; font-weight: 600; }
.admin-room .ar-meta { font-size: 11px; color: var(--muted); }
.admin-room button { background: linear-gradient(180deg, #b03636, #8c2727); padding: 5px 11px; font-size: 12px; }
.admin-room .acct-role { padding: 6px 8px; font-size: 13px; }

/* ============================================================
   Permission gating + animations
   ============================================================ */
body.is-player .dm-only { display: none !important; }

/* Table View — second-screen / TV display: just the map, no chrome. */
#tv-fullscreen { display: none; }
body.table-display .topbar,
body.table-display .tool-rail,
body.table-display .sidebar,
body.table-display .hint,
body.table-display #turn-timer { display: none !important; }
body.table-display .layout { height: 100vh; }
body.table-display #tv-fullscreen {
  display: block; position: fixed; bottom: 14px; right: 16px; z-index: 70;
  opacity: 0.35; font-size: 13px; transition: opacity .15s;
}
body.table-display #tv-fullscreen:hover { opacity: 1; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ============================================================
   Batch 5: journal, loot, turn timer
   ============================================================ */
.muted { color: #9a8c74; font-style: italic; font-size: 13px; }

/* Journal */
.journal-card { background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.journal-card:hover { border-color: var(--gold); }
.journal-head { display: flex; align-items: center; gap: 8px; color: var(--gold-2); margin-bottom: 4px; }
.badge-share { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 10px; }
.journal-body { font-size: 13px; line-height: 1.5; white-space: normal; }
.journal-meta { font-size: 11px; color: #8a7c64; margin-top: 6px; }
/* Cross-link chips — @[Kind: Name] in journal & handout bodies */
.xlink { display: inline-block; padding: 0 7px; border: 1px solid var(--gold); border-radius: 10px; color: var(--gold-2); background: rgba(203, 164, 90, 0.12); font-size: 0.92em; line-height: 1.5; cursor: pointer; text-decoration: none; }
.xlink:hover { background: rgba(203, 164, 90, 0.26); }
.xlink-miss { animation: xlink-shake 0.3s; border-style: dashed; opacity: 0.75; }
@keyframes xlink-shake { 25% { transform: translateX(-2px); } 50% { transform: translateX(2px); } 75% { transform: translateX(-1px); } }
.je-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.je-hint { font-size: 11px; color: var(--muted); }

/* Handouts — DM-composed documents in the Journal tab */
.handout-h { margin: 14px 0 6px; color: var(--gold-2); font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; border-top: 1px solid var(--border-2); padding-top: 10px; }
.badge-shown { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--gold); color: #241a06; padding: 1px 6px; border-radius: 10px; }
.handout-btns { display: flex; gap: 6px; margin-top: 6px; }
.handout-view-card { display: flex; flex-direction: column; align-items: center; gap: 12px; width: min(680px, 94vw); max-height: 92vh; }
.handout-view-card .comp-page { overflow-y: auto; width: 100%; box-shadow: var(--shadow-lg); }
.hv-image { max-width: 100%; max-height: 46vh; border: 1px solid var(--bk-gold-d); border-radius: 6px; display: block; margin: 0 auto 12px; }

.journal-edit-inner { background: var(--panel); border: 1px solid var(--gold); border-radius: 12px; padding: 18px; width: min(560px, 92vw); display: flex; flex-direction: column; gap: 10px; }
.journal-edit-inner h3 { margin: 0; color: var(--gold-2); }
.journal-edit-inner textarea { width: 100%; resize: vertical; font-family: inherit; }
.je-share { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.je-actions { display: flex; gap: 8px; }
#je-delete { margin-left: auto; }

/* Loot */
.loot-gold { font-size: 14px; margin-bottom: 10px; color: var(--gold-2); }
.loot-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.loot-row { display: flex; align-items: center; gap: 8px; background: linear-gradient(180deg, var(--panel-3), var(--panel-2)); border: 1px solid var(--border-2); border-radius: 7px; padding: 7px 10px; margin-bottom: 6px; font-size: 13px; }
.loot-row:hover { border-color: var(--gold); }
.loot-q { color: var(--gold-2); font-weight: 600; }
.loot-n { flex: 1; }
.loot-v { color: #c9b890; font-size: 12px; }
.loot-h { color: #8fae8f; font-size: 12px; }
.loot-del { background: linear-gradient(180deg, #b03636, #8c2727); padding: 2px 8px; font-size: 12px; }
.loot-total { margin-top: 8px; color: var(--gold-2); font-weight: 600; }

/* Turn timer (floating) */
.turn-timer { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px; background: rgba(20, 15, 10, 0.94); border: 1px solid var(--gold); border-radius: 30px; padding: 6px 16px; box-shadow: 0 4px 18px rgba(0,0,0,0.5); font-family: "Cinzel", serif; }
#timer-label { color: var(--gold-2); font-size: 13px; }
#timer-clock { font-size: 22px; font-weight: 700; color: var(--ink); min-width: 56px; text-align: center; }
.turn-timer.timer-warn { border-color: #e0a020; }
.turn-timer.timer-warn #timer-clock { color: #f0c050; }
.turn-timer.timer-done { border-color: var(--accent); animation: fade 0.6s infinite alternate; }
.turn-timer.timer-done #timer-clock { color: #ff6b5b; }
.timer-ctrl { display: flex; align-items: center; gap: 5px; }
.timer-ctrl input { padding: 3px 6px; font-size: 12px; }
.timer-ctrl button { padding: 3px 9px; }

/* 3D dice overlay */
.dice3d { position: fixed; inset: 0; z-index: 60; pointer-events: none; transition: opacity 0.4s ease; }
.dice3d.hidden { display: none; }
.dice3d canvas { width: 100%; height: 100%; display: block; }
.set-toggle { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink); margin: 4px 0 14px; line-height: 1.4; cursor: pointer; }
.set-toggle input { margin-top: 2px; }
/* Account fields in Settings */
#settings-overlay .admin-card label { display: block; text-align: left; margin: 10px 0 4px; color: var(--ink); font-size: 13px; font-weight: 500; }
#settings-overlay .admin-card input, #settings-overlay .admin-card textarea { width: 100%; }
#settings-overlay #acc-save, #settings-overlay #pw-save { margin-top: 12px; }
#acc-msg, #pw-msg { min-height: 16px; }

/* Styled hover tooltips */
.tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  max-width: 260px; padding: 7px 11px;
  background: rgba(18, 13, 9, 0.97); color: var(--ink);
  border: 1px solid var(--gold); border-radius: 8px;
  font-size: 12.5px; line-height: 1.4; font-weight: 500;
  white-space: pre-line; /* condition popovers pass multi-paragraph text */
  box-shadow: 0 6px 20px rgba(0,0,0,0.55);
  opacity: 1; transition: opacity 0.12s ease;
}
.tooltip.hidden { opacity: 0; visibility: hidden; }

/* Asset finder (maps & sounds) */
.finder-overlay { position: fixed; inset: 0; z-index: 85; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 24px; }
.finder-overlay.hidden { display: none; }
.finder-wrap { background: var(--panel); border: 1px solid var(--gold); border-radius: 14px; width: min(820px, 96vw); height: min(82vh, 760px); display: flex; flex-direction: column; padding: 16px 18px; box-shadow: 0 12px 40px rgba(0,0,0,0.6); }
.finder-head { display: flex; align-items: center; gap: 12px; }
.finder-head h2 { margin: 0; color: var(--gold-2); font-size: 19px; flex: 1; }
.finder-tabs { display: flex; gap: 6px; }
.finder-search { display: flex; gap: 8px; margin: 12px 0 6px; }
.finder-search input { flex: 1; }
.finder-note { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.finder-results { flex: 1; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; align-items: start; }
@media (max-width: 600px) { .finder-results { grid-template-columns: 1fr; } }
/* No overflow:hidden — it cropped the audio player + button. Cards size to their
   own content (align-items:start above), and the thumb rounds its own top corners. */
.finder-card { background: var(--panel-2); border: 1px solid var(--border-2); border-radius: var(--radius); display: flex; flex-direction: column; }
.finder-thumb { width: 100%; height: 130px; object-fit: cover; background: #000; border-radius: var(--radius) var(--radius) 0 0; }
.finder-info { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.finder-title-t { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.finder-meta { font-size: 11px; color: var(--muted); }
.finder-meta a { color: var(--gold-2); }
.finder-info audio { width: 100%; height: 34px; }
.finder-acts { display: flex; gap: 6px; align-items: center; margin-top: 2px; }
.finder-acts .fa-add { flex: 1; padding: 7px 8px; font-size: 12px; }
.finder-acts .fa-use, .finder-acts .fa-kind { padding: 6px 8px; font-size: 12px; }

/* Help & Guide overlay */
.help-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 24px; }
.help-overlay.hidden { display: none; }
.help-card { background: var(--panel); border: 1px solid var(--gold); border-radius: 14px; width: min(920px, 96vw); height: min(80vh, 760px); display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,0.6); overflow: hidden; }
.help-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); }
.help-head h2 { margin: 0; color: var(--gold-2); font-size: 19px; white-space: nowrap; }
.help-head #help-search { flex: 1; }
.help-body { display: flex; flex: 1; min-height: 0; }
.help-nav { width: 220px; flex: 0 0 auto; overflow-y: auto; border-right: 1px solid var(--border-2); padding: 10px; background: var(--bg-2); }
.help-navlink { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: transparent; border: none; color: var(--ink); padding: 7px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; }
.help-navlink:hover { background: var(--panel-3); color: var(--gold-2); }
.help-content { flex: 1; overflow-y: auto; padding: 6px 22px 28px; scroll-behavior: smooth; }
.help-section { padding-top: 18px; }
.help-section h3 { color: var(--gold-2); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.help-section p { line-height: 1.6; }
.help-section ul { line-height: 1.65; padding-left: 20px; }
.help-section li { margin: 4px 0; }
.help-section code { background: var(--panel-3); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.help-dm { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: 10px; }
.help-admin-badge { background: var(--gold); color: #1a130a; }
.help-sys { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 1px 6px; border-radius: 10px; margin-left: 4px; }
.help-sys-5e { background: #2d4a6b; color: #fff; }
.help-sys-dlt { background: #6b2d4a; color: #fff; }
.dlt-deity-meta { display: block; margin-top: 3px; line-height: 1.3; }
/* DL:T crafting (Skills of Creation) */
.dlt-craft { margin: 10px 0; border: 1px solid var(--border-2); border-radius: var(--radius); padding: 6px 10px; background: var(--panel-2); }
.dlt-craft > summary { cursor: pointer; font-weight: 600; color: var(--gold-2); }
.dlt-craft-roll { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 10px 0; }
.dlt-craft-roll label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 2px; }
.dlt-craft-roll input { width: 64px; }
.dlt-craft-info { font-size: 12px; }
.dlt-craft-tbl { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.dlt-craft-tbl th, .dlt-craft-tbl td { text-align: left; padding: 2px 6px; border-bottom: 1px solid var(--border); }
.dlt-craft-tbl th:last-child, .dlt-craft-tbl td:last-child { text-align: right; width: 56px; color: var(--gold-2); }
@media (max-width: 640px) { .help-nav { display: none; } }

/* Hue helper locator (FX tab) */
.hue-status { font-size: 13px; margin: 4px 0 8px; }
.hue-status.ok { color: #7fd99a; }
.hue-status.off { color: #d99a7f; }
.hue-locate { display: flex; gap: 6px; align-items: center; }
.hue-locate input { flex: 1; }
#hue-open { text-decoration: none; white-space: nowrap; }

/* ---- Dragon Lore Compendium (DLT Refs tab) — printed-book styling -------
   Palette from Curt's STYLES doc: ink-blue #1B2A4A, golds #C9A227/#9C7A1A,
   dark red #6E1423; EB Garamond body, Cinzel headings, fleur-de-lis rules. */
.dlt-refs,
.handout-view-card {
  --bk-ink: #1b2a4a; --bk-ink-d: #121d34; --bk-gold: #c9a227; --bk-gold-d: #9c7a1a;
  --bk-red: #8e2437; --bk-cream: #f3ead7; --bk-cream-2: #d9cdb2;
  --bk-serif: "EB Garamond", Garamond, "Times New Roman", serif;
}
.dlt-refs .comp-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.dlt-refs .comp-q { flex: 1; min-width: 0; font-family: var(--bk-serif); font-size: 15px; }
.dlt-refs .comp-cat { max-width: 42%; }

/* Result rows */
.comp-row { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%;
  text-align: left; cursor: pointer; padding: 7px 10px; margin-bottom: 4px;
  background: var(--panel); border: 1px solid var(--border-2); border-left: 3px solid var(--bk-gold-d);
  border-radius: 6px; color: var(--ink); }
.comp-row:hover { border-left-color: var(--bk-gold); background: var(--panel-2); }
.comp-row-name { font-family: var(--display); font-size: 13.5px; letter-spacing: 0.02em; color: var(--gold-2); }
.comp-row-meta { font-family: var(--bk-serif); font-style: italic; font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.comp-empty { font-family: var(--bk-serif); font-style: italic; color: var(--muted); text-align: center; padding: 10px 0; }

/* Cover / title page */
.comp-cover { padding: 18px 8px 8px; }
.comp-cover-title { font-family: var(--display); font-weight: 700; font-size: 24px; text-align: center;
  letter-spacing: 0.12em; color: var(--bk-gold); text-transform: uppercase; }
.comp-cover-sub { font-family: var(--bk-serif); font-style: italic; font-size: 15px; text-align: center;
  color: var(--bk-cream-2); margin-top: 2px; }
.comp-cover-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 14px; }
.comp-cover-card { display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  padding: 8px 12px; cursor: pointer; background: linear-gradient(180deg, var(--bk-ink) 0%, var(--bk-ink-d) 100%);
  border: 1px solid #2c3d63; border-radius: 6px; color: var(--bk-cream); }
.comp-cover-card:hover { border-color: var(--bk-gold-d); }
.comp-cover-cat { font-family: var(--display); font-size: 12.5px; letter-spacing: 0.04em; }
.comp-cover-n { font-family: var(--bk-serif); font-size: 13px; color: var(--bk-gold); }

/* Doubled gold rule with fleur-de-lis */
.comp-rule { display: flex; align-items: center; gap: 10px; margin: 8px 0 12px; }
.comp-rule span { flex: 1; height: 4px; border-top: 1px solid var(--bk-gold); border-bottom: 1px solid var(--bk-gold-d); }
.comp-rule i { font-style: normal; color: var(--bk-gold); font-size: 14px; line-height: 1; }

/* Reader page */
.comp-reader-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.comp-crumb { font-family: var(--bk-serif); font-style: italic; font-size: 13px; color: var(--muted); }
.comp-page { background: linear-gradient(180deg, #18233c 0%, var(--bk-ink-d) 100%);
  border: 1px solid #2c3d63; border-radius: 8px; padding: 16px 18px 18px;
  font-family: var(--bk-serif); color: var(--bk-cream); font-size: 15.5px; line-height: 1.55; }
.comp-kind { font-family: var(--bk-serif); font-style: italic; font-size: 13px; color: var(--bk-cream-2); text-align: center; }
.comp-h { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.05em;
  color: var(--bk-gold); text-align: center; margin: 2px 0 0; }
.comp-page p { margin: 0 0 8px; }
.comp-lede { font-style: italic; color: var(--bk-cream-2); }
.comp-sub { font-family: var(--display); font-weight: 500; font-size: 13.5px; letter-spacing: 0.05em;
  color: var(--bk-gold); margin: 14px 0 6px; padding-bottom: 2px; border-bottom: 1px solid var(--bk-gold-d); }
.comp-line b, .comp-page .comp-field-l { color: var(--bk-gold); }
.comp-epigraph { font-style: italic; color: var(--bk-cream-2); padding-left: 12px; border-left: 2px solid var(--bk-red); }
.comp-foot { font-size: 13px; font-style: italic; color: var(--muted); margin-top: 10px; }
.comp-field { display: flex; gap: 10px; margin: 0 0 4px; }
.comp-field-l { flex: 0 0 108px; font-family: var(--display); font-size: 11.5px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--bk-gold); padding-top: 3px; }
.comp-field-v { flex: 1; }
.comp-tier { display: flex; gap: 8px; margin: 0 0 6px; }
.comp-tier-t { flex: 0 0 auto; font-family: var(--display); font-size: 12px; color: var(--bk-ink-d);
  background: var(--bk-gold); border-radius: 4px; padding: 1px 7px; height: fit-content; margin-top: 2px; }
.comp-statband { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.comp-stat { border: 1px solid var(--bk-gold-d); border-radius: 5px; padding: 2px 8px; font-size: 14px; }
.comp-stat b { color: var(--bk-gold); font-weight: 600; font-size: 12px; }
.comp-pillars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 10px; }
.comp-pillar { display: flex; flex-direction: column; align-items: center; border: 1px solid #2c3d63;
  border-radius: 5px; padding: 3px 0; background: rgba(0,0,0,0.18); }
.comp-pillar-k { font-family: var(--display); font-size: 10px; letter-spacing: 0.06em; color: var(--bk-gold); }
.comp-pillar-v { font-size: 14px; }
.comp-pillar-m { font-size: 11.5px; color: var(--bk-cream-2); }
.comp-table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: 14px; }
.comp-table th { font-family: var(--display); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--bk-gold); text-align: left; border-bottom: 1px solid var(--bk-gold-d); padding: 2px 8px 3px 0; }
.comp-table td { border-bottom: 1px solid #2c3d63; padding: 3px 8px 3px 0; vertical-align: top; }
