:root {
  --bg: #0b0d12;
  --bg-2: #11141c;
  --panel: #161a24;
  --panel-2: #1d2230;
  --line: #2a3142;
  --ink: #e7e9ef;
  --ink-dim: #9aa3b8;
  --ink-faint: #6b7488;
  --gold: #e3b341;
  --gold-dim: #b8902f;
  --accent: #6db1ff;
  --frost: #76d6ff;
  --poison: #8bd450;
  --fire: #ff8a4c;
  --physical: #d7c9a8;
  --danger: #ff5d5d;
  --radius: 10px;
  --maxw: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #1a2030 0%, var(--bg) 60%) fixed,
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  min-height: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #9ccbff; }

img { image-rendering: pixelated; }

/* ---------------- Top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  height: 58px;
  background: rgba(11, 13, 18, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--ink);
}
.brand:hover { color: var(--gold); }
.brand-mark { color: var(--gold); font-size: 18px; }
.brand-text { font-size: 16px; }

.mainnav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.mainnav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--ink-dim);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.mainnav a:hover { background: var(--panel); color: var(--ink); }
.mainnav a.active { background: var(--panel-2); color: var(--gold); }

.navtoggle {
  display: none;
  margin-left: auto;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 18px;
  padding: 6px 12px;
  cursor: pointer;
}

/* ---------------- Layout ---------------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 64px;
  min-height: 60vh;
}

.loading { color: var(--ink-faint); padding: 60px 0; text-align: center; }

.page-head { margin: 0 0 22px; }
.page-head h1 {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: 1px;
}
.page-head p { margin: 0; color: var(--ink-dim); max-width: 70ch; }

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold-dim);
  margin: 30px 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}

/* ---------------- Hero (home) ---------------- */
.hero {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(900px 400px at 80% -40%, rgba(109,177,255,0.18), transparent 60%),
    radial-gradient(700px 400px at 0% 120%, rgba(227,179,65,0.12), transparent 60%),
    linear-gradient(180deg, #141a28, #0d1018);
  padding: 56px 40px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  margin: 0;
  letter-spacing: 6px;
  text-shadow: 0 2px 30px rgba(109,177,255,0.25);
}
.hero .tag { font-size: clamp(15px, 2.5vw, 20px); color: var(--ink-dim); margin-top: 10px; letter-spacing: 1px; }
.hero .cta { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.alpha-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 24px;
  padding: 18px 20px;
  max-width: 780px;
  background:
    linear-gradient(90deg, rgba(255,93,93,0.24), rgba(227,179,65,0.14) 58%, rgba(109,177,255,0.12));
  border: 1px solid rgba(227,179,65,0.48);
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
}
.alpha-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
}
.alpha-kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.alpha-copy strong {
  color: #fff3c3;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.alpha-build {
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.alpha-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hero-action {
  min-width: 136px;
  text-align: center;
  padding: 13px 22px;
  text-transform: uppercase;
}
.hero-action.contact {
  background: rgba(13,16,23,0.78);
  border-color: rgba(109,177,255,0.62);
  color: #dcecff;
}
.hero-action.contact:hover {
  border-color: var(--accent);
  color: #ffffff;
}
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.btn.primary { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.btn.primary:hover { background: #f0c454; color: #1a1405; }

/* Hero with the in-game splash artwork behind it. */
.hero.has-art {
  background-color: #0d1018;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}
.hero.has-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,10,15,0.55) 0%, rgba(8,10,15,0.78) 70%, rgba(8,10,15,0.95) 100%);
}
.hero.has-art > * { position: relative; z-index: 1; }

/* ---------------- Art galleries ---------------- */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.art-grid.small { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
.art-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 8px 10px;
  text-align: center;
  color: inherit;
}
.art-tile:hover { border-color: var(--gold-dim); }
.art-tile img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}
.art-grid.small .art-tile img { width: 52px; height: 52px; }
.art-tile .art-name {
  font-size: 12px;
  color: var(--ink-dim);
  font-weight: 600;
  line-height: 1.2;
}

.art-tile[href]:hover .art-name { color: var(--gold); }

/* ---------------- Feature grid ---------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.feature {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; color: var(--gold); }
.feature p { margin: 0; color: var(--ink-dim); font-size: 14px; }

.room-type-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.room-type { display: flex; flex-direction: column; }
.destination-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.destination-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 700;
}
.destination-list li:last-child { border-bottom: 0; }

.tier-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; }
.tier-chips .pill { margin-right: 0; }

/* ---------------- Tables ---------------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
table.data th { color: var(--gold-dim); text-transform: uppercase; letter-spacing: 1px; font-size: 12px; }
table.data tr:last-child td { border-bottom: none; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------- Cards / grid ---------------- */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.filter-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-label {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 9px 12px;
  font-size: 14px;
}
.chip {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { color: var(--ink); }
.chip.active { background: var(--panel-2); color: var(--gold); border-color: var(--gold-dim); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  color: inherit;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.card-head:hover { background: var(--panel-2); }
.card-head .icon {
  width: 46px; height: 46px;
  flex: 0 0 46px;
  border-radius: 8px;
  background: #0d1017;
  border: 1px solid var(--line);
  padding: 4px;
  object-fit: contain;
}
.card-title { display: block; font-weight: 700; font-size: 15px; }
.card-sub { display: block; color: var(--ink-faint); font-size: 12px; margin-top: 2px; }
.card-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  display: none;
}
.card.open .card-body { display: block; }
.card-body p { color: var(--ink-dim); font-size: 14px; }

.tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink-faint);
  border: 1px solid var(--line);
}

/* Tier ladder */
.tier {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.tier:last-child { border-bottom: none; }
.tier .tier-badge {
  flex: 0 0 auto;
  align-self: flex-start;
  font-weight: 800;
  font-size: 12px;
  color: var(--gold);
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 8px;
  min-width: 34px;
  text-align: center;
}
.tier .tier-main { flex: 1; }
.tier-name { font-weight: 700; }
.tier-desc { color: var(--ink-dim); font-size: 13px; white-space: pre-line; }

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.choice {
  flex: 1 1 220px;
  display: flex;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
}
.choice .icon { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 6px; background: #0d1017; padding: 3px; }
.choice .c-name { font-weight: 700; font-size: 13px; }
.choice .c-desc { color: var(--ink-dim); font-size: 12px; }

/* Nested ability box */
.ability {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  background: #0e1320;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
}
.ability .icon { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 6px; background: #0d1017; padding: 3px; }
.ability .a-name { font-weight: 700; font-size: 13px; }
.ability .a-meta { font-size: 11px; color: var(--ink-faint); margin: 2px 0; }
.ability .a-desc { font-size: 12px; color: var(--ink-dim); }
.detail-list { margin-top: 6px; color: var(--ink-dim); font-size: 12px; }
.status-detail { border-left-color: #d596ff; }
.root-properties { margin-top: 10px; }

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  margin-right: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink-dim);
}

.icon-missing { opacity: 0.18; }

/* ---------------- Crafting ---------------- */
.crafting-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.resource-card,
.recipe-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.resource-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-left-width: 3px;
}

.resource-card .icon,
.recipe-head .icon,
.requirement .icon,
.enchantment-preview .icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: #0d1017;
  border: 1px solid var(--line);
  padding: 4px;
  object-fit: contain;
}

.resource-main { min-width: 0; }

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.recipe-card {
  padding: 14px;
  border-left-width: 3px;
}

.recipe-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.recipe-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.recipe-section-title {
  color: var(--gold-dim);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 12px 0 6px;
  text-transform: uppercase;
}

.requirements {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.requirement,
.enchantment-preview {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}

.requirement strong,
.requirement span {
  display: block;
}

.requirement span {
  color: var(--ink-dim);
  font-size: 12px;
}

.enchantment-preview {
  align-items: flex-start;
}

.element-fire { border-left-color: var(--fire); }
.element-frost { border-left-color: var(--frost); }
.element-shock { border-left-color: #d596ff; }
.toolbar-break { flex-basis: 100%; height: 0; }

/* ---------------- Titles ---------------- */
.title-overview,
.title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.title-overview { margin-bottom: 28px; }

.title-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold-dim);
  background: var(--panel);
}

.title-status {
  margin-bottom: 14px;
  color: var(--gold-dim);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.title-nameplate {
  width: min(100%, 220px);
  margin: 0 auto 18px;
  padding: 8px 14px;
  border: 1px solid #4ca4af;
  background: #090d0e;
  text-align: center;
}

.title-nameplate strong,
.title-nameplate span { display: block; }
.title-nameplate strong { color: #f5f1e7; font-size: 15px; }
.title-nameplate span { margin-top: 2px; color: #f0ddb0; font-size: 13px; }

.title-card h2 { margin: 0 0 8px; }
.title-card p { color: var(--ink-dim); }

.title-source {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
}

.title-source span {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.title-undiscovered { border-top-color: var(--line); }
.title-undiscovered .title-status,
.title-source-sealed { color: var(--ink-faint); }
.title-nameplate-sealed { border-color: var(--line); opacity: 0.58; }

/* ---------------- Calculator ---------------- */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}
.calc-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.calc-panel h2 { font-size: 15px; margin: 0 0 12px; color: var(--gold); letter-spacing: 1px; }

.slot-row { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.slot-row .slot-label { width: 92px; flex: 0 0 92px; color: var(--ink-dim); font-size: 13px; font-weight: 600; }
.slot-row select, .slot-row input[type="number"] {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 13px;
}
.slot-row select { flex: 1; min-width: 140px; }
.slot-row input[type="number"] { width: 64px; }

.perk-picker { margin: 6px 0 14px 102px; display: flex; flex-direction: column; gap: 6px; }
.perk-opt { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-dim); }
.perk-opt input { margin-top: 3px; }
.perk-opt .p-name { color: var(--ink); font-weight: 600; }

.summary {
  position: sticky;
  top: 74px;
}
.summary .stat-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.summary .stat-line span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.summary .budget { font-size: 13px; margin: 4px 0; }
.summary .budget.over { color: var(--danger); font-weight: 700; }
.summary .mod-line { font-size: 12px; color: var(--ink-dim); padding: 3px 0; }
.summary h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-dim); margin: 14px 0 6px; }

.toolbelt-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.tb-item {
  display: flex; gap: 8px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--ink); font-size: 13px;
  text-align: left; cursor: pointer;
}
.tb-item .icon { width: 28px; height: 28px; border-radius: 5px; background: #0d1017; padding: 2px; }
.tb-item small { display: block; color: var(--ink-faint); font-size: 9px; text-transform: uppercase; }
.tb-item.selected { border-color: var(--gold-dim); color: var(--gold); }

.empty { color: var(--ink-faint); font-size: 13px; padding: 8px 0; }

/* ---------------- Adversaries ---------------- */
.adversary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.adversary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.adversary-card:hover { color: var(--gold); border-color: var(--gold-dim); }
.adversary-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  padding: 4px;
  object-fit: contain;
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.card-arrow { margin-left: auto; color: var(--gold-dim); font-size: 20px; }
.back-link { display: inline-block; margin-bottom: 18px; }
.adversary-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.adversary-hero h1 { margin: 2px 0 6px; font-size: 34px; }
.adversary-portrait {
  width: 128px;
  height: 128px;
  flex: 0 0 128px;
  padding: 6px;
  object-fit: contain;
  background: #0d1017;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.55));
}
.eyebrow { color: var(--gold-dim); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }
.detail-columns { display: grid; grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr); gap: 16px; }
.detail-panel {
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.detail-panel h2 { margin: 0 0 12px; color: var(--gold); font-size: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); }
.stat-grid div { padding: 8px 10px; background: var(--panel-2); }
.stat-grid dt { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-grid dd { margin: 2px 0 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.encounter-grid { display: grid; gap: 10px; }
.encounter-card { padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.encounter-head { display: flex; justify-content: space-between; gap: 12px; }
.compact-table { margin-top: 10px; }
.compact-table th, .compact-table td { padding: 6px 8px; font-size: 11px; }
.ability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.ability-grid .ability { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.phase-table { min-width: 720px; }

/* ---------------- Footer ---------------- */
.sitefoot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 40px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

/* ---------------- Artwork attribution ---------------- */
.attribution-hero { max-width: 850px; }
.attribution-project {
  padding: 20px;
  border: 1px solid rgba(227,179,65,0.48);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  background: var(--panel);
}
.attribution-project h2 { margin-top: 0; color: var(--gold); }
.attribution-facts { display: grid; gap: 8px; }
.attribution-facts div { display: grid; grid-template-columns: minmax(150px, 210px) 1fr; gap: 12px; }
.attribution-facts dt { color: var(--ink-dim); font-weight: 700; }
.attribution-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.credit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.credit-grid li { min-width: 0; overflow-wrap: anywhere; padding: 9px 12px; border-left: 2px solid var(--line); background: var(--panel); }
.credit-grid small { display: block; color: var(--ink-dim); margin-top: 3px; }
.dng-credit-grid li { border-left-color: var(--gold); font-weight: 700; }
.attribution-empty { padding: 14px 16px; border: 1px dashed var(--line); color: var(--ink-dim); }
.attribution-table code { overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .attribution-facts div { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 820px) {
  .mainnav { display: none; position: absolute; top: 58px; right: 0; left: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px; }
  .mainnav.open { display: flex; }
  .navtoggle { display: block; }
  .calc-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .alpha-callout { align-items: flex-start; flex-direction: column; }
  .alpha-actions { justify-content: stretch; width: 100%; }
  .hero-action { flex: 1 1 150px; }
  .room-type-grid, .detail-columns { grid-template-columns: 1fr; }
  .adversary-hero { align-items: flex-start; }
}

@media (max-width: 520px) {
  .app { padding-left: 14px; padding-right: 14px; }
  .hero { padding: 34px 20px; }
  .adversary-hero { gap: 14px; padding: 14px; }
  .adversary-portrait { width: 88px; height: 88px; flex-basis: 88px; }
  .adversary-hero h1 { font-size: 26px; }
  .stat-grid { grid-template-columns: 1fr; }
  .tier-chips { justify-content: flex-start; }
  .perk-picker { margin-left: 0; }
}

/* ---- Death Penalty page (Issue #632) -------------------------------------
   Page-specific only. The shell, palette, table chrome, and card grid all
   come from the existing site styles; what is added here is the risk-band
   colouring, the outcome-cell vocabulary, and the wide-matrix scroll region.
   ------------------------------------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.risk-grid { gap: 16px; }

.risk-card {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--panel);
}
.risk-card header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.risk-card h3 { margin: 0; font-size: 18px; }
.risk-card ul { margin: 0 0 12px; padding-left: 20px; }
.risk-card li { margin-bottom: 6px; color: var(--ink-dim); }
.risk-cleanup { margin: 0; font-size: 13px; color: var(--ink-dim); font-style: italic; }

.risk-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  border: 1px solid currentColor;
}

/* The three bands the game itself uses: green / amber / red. */
.risk-safe { border-left-color: #5fbf7a; }
.risk-safe .risk-badge { color: #5fbf7a; }
.risk-caution { border-left-color: #d9a441; }
.risk-caution .risk-badge { color: #d9a441; }
.risk-severe { border-left-color: #cf5b4e; }
.risk-severe .risk-badge { color: #cf5b4e; }

.risk-terms { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.risk-terms dt { font-weight: 700; color: var(--gold-dim); }
.risk-terms dd { margin: 0; color: var(--ink-dim); }

.risk-matrix th[scope="row"] { text-align: left; text-transform: none; letter-spacing: 0; font-size: 13px; }
.risk-matrix td { white-space: nowrap; font-weight: 600; }
.cell-keep { color: #5fbf7a; }
.cell-destroy { color: #cf5b4e; }
.cell-reset { color: #d9a441; }
.cell-none { color: var(--ink-dim); font-style: italic; font-weight: 400; }

/* The matrix is six outcome columns wide by design. It scrolls inside its own
   region so the page body never scrolls sideways, and the region is focusable
   so a keyboard can reach the far columns. */
.risk-matrix-scroll { max-width: 100%; }
.risk-matrix-scroll:focus-visible { outline: 2px solid var(--gold-dim); outline-offset: 2px; }
.table-hint { margin: 8px 0 0; font-size: 13px; color: var(--ink-dim); }

.risk-list { padding-left: 20px; }
.risk-list li { margin-bottom: 8px; color: var(--ink-dim); }

@media (min-width: 760px) {
  /* The hint only matters where the table actually has to scroll. */
  .table-hint { display: none; }
}
