/* KURUKSHETRA — research dashboard. Same identity as the game: obsidian, antique gold, Cinzel / Inter. */
@font-face { font-family: 'Cinzel'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/cinzel-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 500; font-display: swap; src: url('../vendor/fonts/cormorant-garamond-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('../vendor/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('../vendor/fonts/inter-latin-600-normal.woff2') format('woff2'); }
:root {
  --bg: #f4efe4;
  --surface: #fbf8f1;
  --surface-2: #efe8d8;
  --border: #d8cdb6;
  --text: #2a2418;
  --muted: #6e6350;
  --accent: #b5651d;
  --accent-ink: #ffffff;
  --ally: #2f6db3;
  --danger: #b3261e;
  --gatekeeper: #6b3fa0;
  --good: #2e7d4f;
  --warn: #a8710b;
  --map-fog: #2d2a33;
  --map-seen: #5a5462;
  --map-lit: #d9cdb4;
  --map-field: #6d7f5c;
  --map-field-lit: #a9bb8f;
  --map-wall: #3b2f22;
  --map-wall-unknown: #8d8579;
  --map-core: #e0a43a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121118; --surface: #1b1a23; --surface-2: #24222e; --border: #34313f;
    --text: #ece6d8; --muted: #a39b8b; --accent: #e08a35; --accent-ink: #1a1208;
    --ally: #5b9be0; --danger: #e0584f; --gatekeeper: #a77be0; --good: #58b07f; --warn: #d9a23a;
    --map-fog: #0b0a10; --map-seen: #2c2935; --map-lit: #4a4352; --map-field: #24301f; --map-field-lit: #3d5233;
    --map-wall: #e7dcc4; --map-wall-unknown: #5d576a; --map-core: #e7b04a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0b0a; --surface: #15130f; --surface-2: #1f1b18; --border: rgba(201,162,92,.22);
  --text: #ece4d4; --muted: #a39782; --accent: #c9a25c; --accent-ink: #17120a;
  --ally: #7ea8d8; --danger: #d0574a; --gatekeeper: #ad8fdb; --good: #79b087; --warn: #d7a24c;
  --map-fog: #0b0a10; --map-seen: #2c2935; --map-lit: #4a4352; --map-field: #24301f; --map-field-lit: #3d5233;
  --map-wall: #e7dcc4; --map-wall-unknown: #5d576a; --map-core: #e7b04a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-family: Cinzel, Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: .06em; }
h3 { font-family: Cinzel, Georgia, serif; }
h2 { font-size: 1.15rem; }
h3 { font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
p { margin: 0 0 .8em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.brand { font-family: Cinzel, Georgia, serif; font-weight: 600; letter-spacing: .22em; font-size: 1.05rem; color: var(--accent); }
.brand span { color: var(--muted); font-family: Inter, system-ui, sans-serif; letter-spacing: 0; font-weight: 400; font-size: .85rem; margin-left: 10px; }
.topbar nav { display: flex; gap: 8px; align-items: center; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 20px 16px 48px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }

button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); padding: 8px 14px; text-decoration: none; display: inline-block;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.ghost { background: transparent; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Form controls (study form, debrief questionnaire) */
label.field { display: block; font-size: .9rem; margin-bottom: 10px; }
input[type=text], input[type=number], textarea, select {
  font: inherit; width: 100%; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
kbd { font: 12px ui-monospace, monospace; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface-2); }

/* Debrief */
.outcome-title { font-family: Georgia, serif; font-size: 1.8rem; margin-bottom: .2em; }
.win { color: var(--good); } .partial { color: var(--warn); } .loss { color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.metric { background: var(--surface-2); border-radius: 8px; padding: 10px; }
.metric b { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.metric span { font-size: .78rem; color: var(--muted); }
.qbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 6px 0; gap: 2px; }
.qbar div { height: 100%; }
.q-optimal { background: var(--good); } .q-info { background: var(--warn); } .q-decision { background: var(--danger); } .q-forced { background: var(--muted); }
.qlegend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); }
.qlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.likert { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; font-size: .9rem; margin-bottom: 10px; }
.likert .scale { display: flex; gap: 4px; }
.likert .scale label { display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--muted); cursor: pointer; }
.lesson { border-left: 3px solid var(--accent); padding: 4px 0 4px 12px; margin: 12px 0; }

/* Analysis */
table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: .78rem; }
.table-scroll { overflow-x: auto; }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .charts { grid-template-columns: 1fr; } }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
@media (max-width: 600px) { .wrap { padding: 12px 16px 40px; } .brand span { display: none; } .topbar { padding: 10px 16px; } }

/* ---------------------------------------------------------------------------
   Dashboard art direction: the analytical wing of the same product.
   Quiet surfaces instead of outlined cards, Cinzel section titles with a gold
   rule, numbers set large and plain. Works in both themes through the tokens.
   --------------------------------------------------------------------------- */
body { background: var(--bg); }
.topbar { border-bottom: none; background: transparent; padding: 22px 32px 10px; }
.brand { font-size: 1.15rem; letter-spacing: .3em; }
.brand span { font-family: Inter, system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; font-size: .7rem; font-weight: 600; }
.wrap { max-width: 1280px; padding: 12px 32px 64px; }
.viz-root .card { border: none; box-shadow: none; border-radius: 3px; padding: 22px 24px; background: var(--surface); }
.viz-root .chart h2, .viz-root .card h2 { font-family: Cinzel, Georgia, serif; font-weight: 600; font-size: 1.02rem; letter-spacing: .04em; }
.viz-root .section-title { font-family: Cinzel, Georgia, serif; font-weight: 600; font-size: .82rem; letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin: 44px 0 14px; display: flex; align-items: center; gap: 14px; }
.viz-root .section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.viz-root .tiles { gap: 0; margin: 8px 0 28px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.viz-root .tile { border: none; background: transparent; border-radius: 0; padding: 20px 18px; }
.viz-root .tile + .tile { box-shadow: inset 1px 0 0 var(--border); }
.viz-root .tile b { font-family: Cinzel, Georgia, serif; font-weight: 600; font-size: 2rem; }
.viz-root .tile span { font-size: .78rem; letter-spacing: .02em; }
button, .btn { border: none; border-radius: 3px; background: var(--surface-2); }
button:hover:not(:disabled), .btn:hover { border-color: transparent; background: color-mix(in srgb, var(--surface-2) 70%, var(--accent) 30%); }
.ghost { background: transparent; }
.primary { border: none; }
input[type=text], input[type=number], textarea, select { border: none; box-shadow: inset 0 0 0 1px var(--border); border-radius: 3px; }
th { font-weight: 500; letter-spacing: .02em; }
th, td { border-bottom-color: color-mix(in srgb, var(--border) 55%, transparent); }
.empty { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; }
@media (max-width: 600px) { .topbar { padding: 14px 16px 6px; } .wrap { padding: 8px 16px 40px; } }
