/* Midgard's Fate wiki. Every color, gradient, radius and size comes from css/tokens.css
   (generated from assets/ui/design_tokens.json). Component looks follow docs/DESIGN_SYSTEM.md:
   FantasyPanel (Panel face, iron rim, double gold filet, gems), Ribbon (parchment banner),
   FantasyButton (gold/stone faces with a metal rim). */

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  background: var(--color-bg-canvas);
  background-image: radial-gradient(ellipse at 50% -10%, var(--color-bg-surface-raised) 0%, var(--color-bg-canvas) 60%);
  background-attachment: fixed;
  color: var(--color-text-primary);
  font: 400 19px/1.4 "Crimson Pro", Georgia, serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--color-text-accent); text-decoration: none; }
a:hover { color: var(--color-action-primary-bg-hover); text-decoration: underline; }
img { max-width: 100%; }
code { font: 500 0.85em "Barlow Condensed", sans-serif; color: var(--color-text-secondary); background: var(--color-surface-inset); padding: 1px 6px; border-radius: var(--radius-sm); }
.muted { color: var(--color-text-muted); }
b.term { font-weight: 700; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--space-lg);
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-surface-panel);
  border-bottom: 2px solid var(--color-border-accent);
  box-shadow: 0 6px 18px #0009;
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-text-primary); white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--color-ornament-gold); }
.brand img { height: 36px; width: auto; filter: drop-shadow(0 2px 4px #000); }
.brand span { font: 400 var(--fs-xl) "Germania One", serif; letter-spacing: .5px; text-shadow: 0 2px 0 #000; }
.brand em { font-style: normal; color: var(--color-text-accent); }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.search input {
  width: 100%; padding: var(--space-sm) var(--space-md);
  font: 500 var(--fs-md) "Barlow Condensed", sans-serif; color: var(--color-text-primary);
  background: var(--grad-groove); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg);
  box-shadow: inset 0 3px 5px #000b;
}
.search input:focus { outline: none; border-color: var(--color-border-focus); box-shadow: inset 0 3px 5px #000b, 0 0 12px #ffc6408c; }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: 70vh; overflow: auto;
  background: var(--grad-panel); border: 2px solid var(--color-border-accent); border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px #0009; padding: var(--space-xs);
}
.search-results a { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-md); color: var(--color-text-primary); font: 500 var(--fs-md) "Barlow Condensed", sans-serif; }
.search-results a:hover, .search-results a.sel { background: var(--color-action-secondary-bg-hover); text-decoration: none; }
.search-results img { width: 36px; height: 36px; object-fit: contain; }
.search-results small { margin-left: auto; color: var(--color-text-secondary); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
.search-results .none { padding: var(--space-sm); color: var(--color-text-muted); }
.lang { display: flex; gap: var(--btn-gap-small); }
.lang a {
  font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; letter-spacing: .06em; padding: 4px 10px;
  color: var(--color-action-secondary-text); background: var(--grad-stone);
  border: 2px solid transparent; border-radius: var(--radius-md);
  background-clip: padding-box; box-shadow: 0 0 0 1px var(--color-border-strong), 0 3px 0 #0a0d2a;
}
.lang a.on { background: var(--grad-gold); color: var(--color-action-primary-text); box-shadow: 0 0 0 1px #b5501a, 0 3px 0 #7a2e10; }
.lang a:hover { text-decoration: none; filter: brightness(1.12); }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-xl); padding: var(--space-xl); max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.sidebar { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; padding-right: var(--space-xs); }
.nav-group { margin-bottom: var(--space-lg); }
.nav-title { font: 400 var(--fs-lg) "Germania One", serif; color: var(--color-ornament-gold); padding: 0 var(--space-sm) var(--space-xs); border-bottom: 1px solid var(--color-border-default); margin-bottom: var(--space-xs); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: 3px var(--space-sm); border-radius: var(--radius-md); font: 500 var(--fs-md) "Barlow Condensed", sans-serif; color: var(--color-action-secondary-text); }
.sidebar li a:hover { background: var(--color-action-secondary-bg-hover); text-decoration: none; }
.sidebar li a.active { background: var(--grad-stone); color: var(--color-text-primary); box-shadow: inset 3px 0 0 var(--color-border-accent); }
.content { min-width: 0; }
.crumbs { font: 500 var(--fs-sm) "Barlow Condensed", sans-serif; color: var(--color-text-secondary); margin-bottom: var(--space-sm); }
.crumbs span { color: var(--color-text-muted); margin: 0 4px; }

/* ------------------------------------------------------------ FantasyPanel */
.panel {
  position: relative;
  background: var(--grad-panel) padding-box, var(--grad-rim-iron) border-box;
  border: var(--panel-rim) solid transparent;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 48px #00000099, inset 0 2px 0 #ffda9a29, inset 0 -2px 0 #00000066;
  padding: var(--space-xl) var(--space-xl);
  margin-bottom: var(--space-xl);
}
.panel::before, .panel::after { content: ""; position: absolute; pointer-events: none; border-radius: var(--radius-sm); }
.panel::before { inset: 4px; border: 1px solid #ffd66699; }
.panel::after { inset: 9px; border: 1px solid #ffd66638; }
.intro { font-size: var(--fs-lg); }
.intro p:first-child { margin-top: 0; }
.intro p:last-child, .intro ul:last-child { margin-bottom: 0; }
.intro ul, .article-body ul { padding-left: 1.2em; }
.intro li { margin: 4px 0; }
.section { padding-top: var(--space-lg); }
.h2 {
  position: relative; z-index: 1;
  font: 400 var(--fs-2xl) "Germania One", serif; color: var(--color-ornament-gold);
  margin: 0 0 var(--space-lg); text-shadow: 0 2px 0 #000;
  display: flex; align-items: center; gap: var(--space-md);
}
.h2::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, #ffd66699, transparent); }
/* Gems on top and bottom of the main panels (FantasyPanel ornaments). */
.panel.intro::before { box-shadow: none; }
.panel.intro { padding-top: calc(var(--space-xl) + 6px); }
.panel.intro > :first-child::before {
  content: ""; position: absolute; top: -13px; left: 50%; width: 16px; height: 16px; transform: translateX(-50%) rotate(45deg);
  background: var(--grad-gem-gold); border: 2px solid #6a2412; box-shadow: 0 2px 4px #000a;
}

/* ------------------------------------------------------------ Ribbon */
.ribbon-wrap { display: flex; justify-content: center; margin: var(--space-sm) 0 var(--space-xl); }
.ribbon {
  position: relative; margin: 0; padding: 6px 32px 8px;
  font: 400 var(--fs-3xl) "Germania One", serif; line-height: 1.1; color: var(--color-text-on-parchment);
  background: var(--grad-parchment); border-radius: 3px; text-align: center;
  text-shadow: 0 1px 0 #fff8e0b3; box-shadow: 0 6px 10px #00000073;
  display: inline-flex; align-items: center; gap: 10px; z-index: 1; max-width: calc(100% - 80px);
}
.ribbon::before, .ribbon::after {
  content: ""; position: absolute; top: 24%; width: 40px; height: 76%; z-index: -1;
  background: var(--grad-parchment-tail); box-shadow: 0 6px 10px #00000073;
}
.ribbon::before { left: -26px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 12px 50%); }
.ribbon::after { right: -26px; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%); }
.ribbon .spark { width: 6px; height: 6px; background: #9a4a1c; transform: rotate(45deg); flex: none; }

/* ------------------------------------------------------------ FantasyButton */
.btn {
  font: 700 var(--fs-md) "Barlow Condensed", sans-serif; letter-spacing: .06em; text-transform: uppercase;
  padding: 12px 24px; border-radius: var(--radius-md); cursor: pointer; border: 3px solid transparent;
  box-shadow: 0 3px 0 #0a0d2a, 0 6px 10px #05061a8c, inset 0 1.5px 0 #fff4e066;
}
.btn.primary { background: var(--grad-gold) padding-box, var(--grad-rim-gold) border-box; color: var(--color-action-primary-text); text-shadow: 0 1px 0 #fff4d08c; }
.btn.primary:hover { background: var(--grad-gold-hover) padding-box, var(--grad-rim-gold) border-box; box-shadow: 0 3px 0 #0a0d2a, 0 0 18px #ffb84a80; }
.btn.secondary { background: var(--grad-stone) padding-box, var(--grad-rim-iron) border-box; color: var(--color-action-secondary-text); text-shadow: 0 2px 0 #000; }
.btn.secondary:hover { background: var(--grad-stone-hover) padding-box, var(--grad-rim-iron) border-box; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a0d2a, inset 0 3px 5px #0a0d2a8c; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--btn-gap); margin-top: var(--space-lg); }

/* ------------------------------------------------------------ hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); margin-bottom: var(--space-xl);
  min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background-size: cover; background-position: center 30%;
  border: 3px solid var(--color-border-accent); box-shadow: 0 24px 48px #0009;
}
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, #0c0b1e33 0%, #0c0b1ecc 85%); }
.hero > * { position: relative; }
.hero-logo { width: min(440px, 80%); filter: drop-shadow(0 6px 12px #000); }
.hero-title { font: 400 var(--fs-display) "Germania One", serif; line-height: 1; color: var(--color-ornament-gold); text-shadow: 0 4px 0 #3a1630, 0 0 24px #ffc64066; margin-top: var(--space-sm); }
.hero-tag { font-size: var(--fs-xl); max-width: 720px; padding: 0 var(--space-lg); text-shadow: 0 2px 4px #000; }

/* ------------------------------------------------------------ tiles */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-md); position: relative; z-index: 1; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.grid.decks .tile-art { aspect-ratio: 2 / 3; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.wide .tile-art { aspect-ratio: 16 / 9; }
.grid.wide .tile-art img { object-fit: cover; width: 100%; height: 100%; }
.text-tiles .grid, .grid.text-tiles > * { display: contents; }
.tile {
  --accent: var(--color-border-strong);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: var(--space-sm);
  background: var(--color-bg-row); border: 2px solid var(--accent); border-radius: var(--radius-lg);
  color: var(--color-text-primary); text-align: center; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.tile:hover { text-decoration: none; transform: translateY(-3px); border-color: var(--color-border-focus); box-shadow: 0 0 18px #ffc6408c; }
.tile-art { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle, var(--color-surface-inset) 0%, transparent 70%); border-radius: var(--radius-md); }
.tile-art img { max-height: 100%; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px #000a); }
.tile-name { font: 400 var(--fs-lg) "Germania One", serif; line-height: 1.1; color: var(--color-ornament-gold); }
.tile-sub { font: 500 var(--fs-sm) "Barlow Condensed", sans-serif; color: var(--color-text-secondary); line-height: 1.25; }
.tile.text { justify-content: center; min-height: 90px; background: var(--grad-stone); border-color: var(--color-border-accent); }
.tile.text .tile-name { color: var(--color-action-secondary-text); font-size: var(--fs-xl); }
.grid.text-tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.letter {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--grad-coin); color: var(--color-icon-on-gold); font: 900 15px "Barlow Condensed", sans-serif; box-shadow: 0 2px 0 #7a2e10;
}
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 2px; border-radius: 999px; background: var(--color-surface-inset); border: 1px solid var(--c); color: var(--c); font: 600 var(--fs-sm) "Barlow Condensed", sans-serif; }
.chip img { width: 20px; height: 20px; }
.chip:hover { text-decoration: none; filter: brightness(1.2); }
.ilink { display: inline-flex; align-items: center; gap: 4px; font-family: "Barlow Condensed", sans-serif; font-weight: 600; }
.ilink img { width: 24px; height: 24px; object-fit: contain; }

/* ------------------------------------------------------------ articles + infobox */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-xl); align-items: start; }
.article > .infobox { grid-column: 2; grid-row: 1; position: sticky; top: 76px; }
.article-body { grid-column: 1; grid-row: 1; min-width: 0; }
.infobox { --accent: var(--color-border-accent); padding: var(--space-lg); }
.infobox-title { position: relative; z-index: 1; font: 400 var(--fs-2xl) "Germania One", serif; text-align: center; color: var(--color-text-on-parchment); background: var(--grad-parchment); margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) var(--space-md); padding: 6px var(--space-md); border-radius: 2px 2px 0 0; box-shadow: 0 4px 0 var(--accent); }
.infobox-art { position: relative; z-index: 1; display: flex; justify-content: center; gap: var(--space-sm); padding: var(--space-md); background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent) 0%, var(--color-surface-inset) 72%); border-radius: var(--radius-lg); margin-bottom: var(--space-md); }
.infobox-art img { max-height: 260px; object-fit: contain; filter: drop-shadow(0 6px 10px #000c); }
.infobox-art img.portrait { max-height: 300px; border-radius: var(--radius-lg); }
.infobox-art:has(img + img) img { max-width: 48%; }
.infobox table { position: relative; z-index: 1; width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.infobox th { text-align: left; font: 600 var(--fs-sm) "Barlow Condensed", sans-serif; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px 6px 0; vertical-align: top; width: 40%; }
.infobox td { padding: 6px 0; border-bottom: 1px solid var(--color-border-faint); }
.infobox tr:last-child td { border-bottom: none; }
.effect { font-size: var(--fs-xl); margin: 0; position: relative; z-index: 1; }
.row-card { display: flex; gap: var(--space-lg); align-items: center; position: relative; z-index: 1; }
.row-card > .tile { width: 160px; flex: none; }
.banner { height: 180px; border-radius: var(--radius-xl); background-size: cover; background-position: center; margin-bottom: var(--space-xl); border: 2px solid var(--color-border-strong); box-shadow: inset 0 -60px 60px -20px var(--color-bg-canvas); }
.wide-art { width: 100%; border-radius: var(--radius-lg); position: relative; z-index: 1; border: 2px solid var(--color-border-strong); }
.art-row { display: flex; gap: var(--space-lg); justify-content: center; flex-wrap: wrap; margin-top: var(--space-lg); }
.art-row img { max-height: 140px; }
.drop-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-md); position: relative; z-index: 1; }
.palette { display: flex; gap: 6px; } .palette span { width: 40px; height: 40px; border-radius: var(--radius-md); border: 2px solid #0006; }
.pager { display: flex; justify-content: space-between; }
.found-badge:empty { display: none; }
.found-badge { position: relative; z-index: 1; margin-top: var(--space-md); text-align: center; font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .06em; padding: 6px; border-radius: var(--radius-md); }
.found-badge.yes { background: var(--color-status-success); }
.found-badge.no { background: var(--color-action-disabled-bg); color: var(--color-action-disabled-text); }

/* ------------------------------------------------------------ tables */
.table-scroll { overflow-x: auto; position: relative; z-index: 1; }
.wiki-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: var(--fs-md); }
.wiki-table th { font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--color-text-accent); text-align: left; padding: 4px var(--space-md); white-space: nowrap; }
.wiki-table td { background: var(--color-bg-row); padding: var(--space-sm) var(--space-md); vertical-align: middle; }
.wiki-table td:first-child { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.wiki-table td:last-child { border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.wiki-table tr:hover td { background: var(--color-action-secondary-bg-hover); }
.chance { color: color-mix(in srgb, var(--color-text-success) calc(var(--p) * 100%), var(--color-text-danger)); font-weight: 700; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; }

/* Formation example cards (CombateRegras.CARTAS_FORMACAO). */
.fcards { display: inline-flex; gap: 3px; }
.fcard { width: 22px; height: 30px; border-radius: 3px; background: var(--color-bg-parchment); color: var(--color-text-on-parchment); font: 900 14px "Barlow Condensed", sans-serif; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 0 #0008; }
.fcard.blank { background: var(--color-suit-hearts); animation: suit 8s steps(1) infinite; }
.fcard.empty { background: transparent; border: 1px dashed var(--color-border-strong); box-shadow: none; }
@keyframes suit { 0% { background: var(--color-suit-hearts); } 25% { background: var(--color-suit-diamonds); } 50% { background: var(--color-suit-clubs); } 75% { background: var(--color-suit-spades); } }

/* World map with city pins (MapCity.posicao). */
.world-map { position: relative; z-index: 1; border-radius: var(--radius-lg); overflow: hidden; border: 2px solid var(--color-border-strong); }
.world-map > img { display: block; width: 100%; }
.map-pin { position: absolute; transform: translate(-50%, -60%); display: flex; flex-direction: column; align-items: center; width: 9%; min-width: 46px; }
.map-pin img { width: 100%; filter: drop-shadow(0 3px 4px #000); transition: transform .12s; }
.map-pin span { font: 700 clamp(10px, 1.2vw, 15px) "Barlow Condensed", sans-serif; color: var(--color-text-primary); background: #0c0b1ecc; padding: 0 6px; border-radius: 999px; white-space: nowrap; }
.map-pin:hover { text-decoration: none; } .map-pin:hover img { transform: scale(1.12); }

/* Save import. */
.save-box textarea { position: relative; z-index: 1; width: 100%; font: 500 var(--fs-md) "Barlow Condensed", monospace; color: var(--color-text-primary); background: var(--grad-groove); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); padding: var(--space-md); }
.save-box .btn-row, .save-box p { position: relative; z-index: 1; }
.progress-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-sm); position: relative; z-index: 1; }
.progress-list li { display: flex; justify-content: space-between; background: var(--color-bg-row); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-lg); font-family: "Barlow Condensed", sans-serif; }
.progress-list b { color: var(--color-text-accent); }

/* ------------------------------------------------------------ footer */
.footer { text-align: center; padding: var(--space-xl) var(--space-lg); border-top: 1px solid var(--color-border-default); font-size: var(--fs-sm); color: var(--color-text-secondary); background: var(--color-bg-surface); }
.footer p { margin: 4px 0; }

/* ------------------------------------------------------------ mobile */
@media (max-width: 1100px) {
  .article { grid-template-columns: minmax(0, 1fr); }
  .article > .infobox { grid-column: 1; grid-row: auto; position: static; max-width: 420px; margin: 0 auto var(--space-xl); width: 100%; }
  .article-body { grid-row: auto; }
}
@media (max-width: 820px) {
  body { font-size: 18px; }
  .shell { grid-template-columns: 1fr; padding: var(--space-lg) var(--space-lg); gap: 0; }
  .topbar { flex-wrap: wrap; gap: var(--space-sm); padding: var(--space-sm) var(--space-lg); }
  .menu-btn { display: inline-flex; font-size: 22px; padding: 4px 12px; color: var(--color-action-secondary-text); background: var(--grad-stone); border: 2px solid var(--color-border-strong); border-radius: var(--radius-md); cursor: pointer; }
  .brand span { font-size: var(--fs-lg); }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .lang { margin-left: auto; }
  .sidebar { display: none; position: fixed; inset: 0; top: 0; z-index: 30; max-height: none; background: var(--color-bg-scrim-strong); padding: var(--space-2xl) var(--space-lg); overflow: auto; }
  body.nav-open .sidebar { display: block; }
  body.nav-open .menu-btn { position: fixed; top: var(--space-sm); right: var(--space-lg); z-index: 31; }
  .panel { padding: var(--space-lg); }
  .ribbon { font-size: var(--fs-2xl); padding: 6px 18px 8px; }
  .hero { min-height: 260px; } .hero-title { font-size: var(--fs-4xl); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .grid.cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .row-card { flex-direction: column; align-items: stretch; }
  .row-card > .tile { width: 100%; }
}

/* ------------------------------------------------------------ forum */
.posts { display: grid; gap: var(--space-lg); position: relative; z-index: 1; }
.post { display: flex; gap: var(--space-lg); align-items: center; margin: 0; padding: var(--space-lg); color: var(--color-text-primary); transition: transform .12s, box-shadow .12s; }
.post:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 0 18px #ffc6408c, 0 24px 48px #00000099; }
.post-art { width: 96px; height: 96px; object-fit: contain; flex: none; position: relative; z-index: 1; filter: drop-shadow(0 4px 6px #000a); }
.post-body { display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 1; }
.post-title { font: 400 var(--fs-2xl) "Germania One", serif; color: var(--color-ornament-gold); line-height: 1.1; }
.post-meta { font: 500 var(--fs-sm) "Barlow Condensed", sans-serif; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.post-summary { font-size: var(--fs-lg); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font: 600 var(--fs-xs) "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: var(--grad-stone); color: var(--color-action-secondary-text); border: 1px solid var(--color-border-strong); }
.intro .btn-row { position: relative; z-index: 1; }
a.btn { display: inline-block; }
a.btn:hover { text-decoration: none; }
.key-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: var(--space-md); }
.forum-form { display: flex; flex-direction: column; gap: var(--space-lg); }
.forum-form > *, .forum-form label, .forum-form fieldset { position: relative; z-index: 1; }
.forum-form label { display: flex; flex-direction: column; gap: 4px; font: 600 var(--fs-sm) "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .04em; color: var(--color-text-secondary); flex: 1; }
.forum-form input, .forum-form select, .forum-form textarea {
  font: 400 var(--fs-lg) "Crimson Pro", serif; text-transform: none; letter-spacing: 0; color: var(--color-text-primary);
  background: var(--grad-groove); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); padding: var(--space-sm) var(--space-md);
  box-shadow: inset 0 3px 5px #000b;
}
.forum-form input:focus, .forum-form select:focus, .forum-form textarea:focus { outline: none; border-color: var(--color-border-focus); }
.form-row { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
.forum-form fieldset { border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: var(--space-md); }
.forum-form legend { font: 600 var(--fs-sm) "Barlow Condensed", sans-serif; text-transform: uppercase; color: var(--color-text-secondary); padding: 0 6px; }
@media (max-width: 820px) { .post { flex-direction: column; text-align: center; } .post .tags { justify-content: center; } }

/* ------------------------------------------------------------ locked entries
   Hidden by default: save-import.js adds .is-found to what the imported save has discovered
   (and to what is free from the start). Without JS, nothing undiscovered is revealed. */
.tile[data-entry]:not(.is-found) { pointer-events: none; border-color: var(--color-border-default); }
.tile[data-entry]:not(.is-found) .tile-art img { filter: brightness(0) drop-shadow(0 0 1px #6b638899); opacity: .7; }
.tile[data-entry]:not(.is-found) .tile-name { font-size: 0; }
.tile[data-entry]:not(.is-found) .tile-name::after { content: "???"; font-size: var(--fs-lg); color: var(--color-text-muted); }
.tile[data-entry]:not(.is-found) .tile-sub { visibility: hidden; }
.ilink[data-entry]:not(.is-found) { pointer-events: none; color: var(--color-text-muted); }
.ilink[data-entry]:not(.is-found) img { filter: brightness(0); opacity: .6; }
.ilink[data-entry]:not(.is-found) .ilink-name { font-size: 0; }
.ilink[data-entry]:not(.is-found) .ilink-name::after { content: "???"; font-size: var(--fs-mask, 1rem); }
.locked-note { display: none; text-align: center; }
body[data-entry]:not(.is-found) .locked-note { display: block; }
body[data-entry]:not(.is-found) .article,
body[data-entry]:not(.is-found) .ribbon-wrap,
body[data-entry]:not(.is-found) .crumb-current { display: none; }
.locked-art { position: relative; z-index: 1; width: 96px; height: 96px; margin: 0 auto var(--space-md); border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 400 56px "Germania One", serif; color: var(--color-text-muted); background: var(--grad-socket); border: 3px solid var(--color-border-strong); }
.locked-note .btn-row { justify-content: center; position: relative; z-index: 1; }

/* Header save chip (nickname from the imported save). */
.save-chip { font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; color: var(--color-action-secondary-text); background: var(--grad-stone); border: 1px solid var(--color-border-strong); }
.save-chip::before { content: "⛉ "; }
.save-chip.on { background: var(--grad-gold); color: var(--color-action-primary-text); border-color: #b5501a; }
.save-chip.on::before { content: "★ "; }
.save-chip.admin { background: var(--grad-ruby); color: var(--color-action-danger-text); }
.save-chip:hover { text-decoration: none; filter: brightness(1.12); }
.panel.intro:has(.intro-art) { padding-right: 150px; min-height: 140px; }
.intro-art { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); width: 104px; z-index: 1; filter: drop-shadow(0 4px 8px #000c); }
@media (max-width: 820px) { .save-chip { order: 2; } .panel.intro:has(.intro-art) { padding-right: var(--space-lg); } .intro-art { position: static; transform: none; display: block; margin: var(--space-md) auto 0; } }

/* Forum editor. */
.editor-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-xl); align-items: start; }
.editor-grid .preview { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.forum-form.is-discussion .only-strategy { display: none; }
.author-row { position: relative; z-index: 1; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-lg); background: var(--color-surface-inset); font: 600 var(--fs-md) "Barlow Condensed", sans-serif; color: var(--color-text-danger); }
.author-row.on { color: var(--color-text-accent); }
.forum-form fieldset.kind { display: flex; gap: var(--space-lg); }
.forum-form label.radio { flex-direction: row; align-items: center; gap: 6px; flex: none; font-size: var(--fs-md); color: var(--color-text-primary); }
.forum-form label.radio input { accent-color: var(--color-action-primary-bg); box-shadow: none; }
.ed-section { position: relative; z-index: 1; background: var(--color-bg-row); border-radius: var(--radius-lg); padding: var(--space-md); margin-bottom: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); }
.ed-section-head { display: flex; gap: 6px; }
.ed-section-head .ed-h { flex: 1; font-family: "Germania One", serif; color: var(--color-ornament-gold); }
.ed-tools { display: flex; gap: var(--btn-gap-small); }
.forum-form input, .forum-form select, .forum-form textarea, .ed-section input, .ed-section textarea {
  font: 400 var(--fs-lg) "Crimson Pro", serif; color: var(--color-text-primary); background: var(--grad-groove); border: 1px solid var(--color-border-strong); border-radius: var(--radius-lg); padding: var(--space-sm) var(--space-md); box-shadow: inset 0 3px 5px #000b; width: 100%;
}
.ed-section .ed-h { font-family: "Germania One", serif; }
.tool, .icon-btn { font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; letter-spacing: .04em; padding: 4px 10px; border-radius: var(--radius-md); cursor: pointer; color: var(--color-action-secondary-text); background: var(--grad-stone); border: 1px solid var(--color-border-strong); box-shadow: 0 2px 0 #0a0d2a; }
.tool:hover, .icon-btn:hover { filter: brightness(1.15); }
.icon-btn { padding: 4px 8px; flex: none; }
.btn:disabled { background: var(--grad-disabled) padding-box, var(--grad-rim-disabled) border-box; color: var(--color-action-disabled-text); cursor: not-allowed; box-shadow: none; text-shadow: none; }
.key-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-sm); }
.key-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 6px; border-radius: 999px; background: var(--color-surface-inset); border: 1px solid var(--color-border-accent); font: 600 var(--fs-sm) "Barlow Condensed", sans-serif; }
.key-chip img { width: 22px; height: 22px; object-fit: contain; }
.key-chip button { background: none; border: none; color: var(--color-text-secondary); cursor: pointer; }
.picker { position: fixed; z-index: 50; width: 330px; background: var(--grad-panel); border: 2px solid var(--color-border-accent); border-radius: var(--radius-lg); box-shadow: 0 24px 48px #0009; padding: var(--space-sm); }
.picker input { width: 100%; font: 500 var(--fs-md) "Barlow Condensed", sans-serif; color: var(--color-text-primary); background: var(--grad-groove); border: 1px solid var(--color-border-strong); border-radius: var(--radius-md); padding: 6px 10px; }
.picker-list { max-height: 300px; overflow: auto; margin-top: 6px; }
.picker-list button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 4px 6px; background: none; border: none; border-radius: var(--radius-md); color: var(--color-text-primary); font: 500 var(--fs-md) "Barlow Condensed", sans-serif; cursor: pointer; text-align: left; }
.picker-list button img { width: 28px; height: 28px; object-fit: contain; }
.picker-list button small { margin-left: auto; color: var(--color-text-secondary); font-size: var(--fs-xs); text-transform: uppercase; }
.picker-list button:hover, .picker-list button.sel { background: var(--color-action-secondary-bg-hover); }
.preview .article-body { position: relative; z-index: 1; }
.pv-kind, .post-kind { font: 700 var(--fs-xs) "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-accent); }
.post-kind.discussion { color: var(--color-status-info); }
.pv-title { font: 400 var(--fs-2xl) "Germania One", serif; color: var(--color-ornament-gold); margin: 4px 0; }
.pv-h { font: 400 var(--fs-xl) "Germania One", serif; color: var(--color-ornament-gold); margin: var(--space-lg) 0 4px; border-bottom: 1px solid var(--color-border-default); }
.pv-keys { display: flex; flex-wrap: wrap; gap: 8px; margin: var(--space-sm) 0; }
.bad-ref { color: var(--color-text-danger); text-decoration: line-through; }
@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } .editor-grid .preview { position: static; max-height: none; } }

/* Forum cards: the art is a span now (masked when the key piece is locked); previews are text only. */
.post-art { display: flex; align-items: center; justify-content: center; }
.post-art img { width: 96px; height: 96px; object-fit: contain; }
.post-art[data-entry]:not(.is-found) img { filter: brightness(0) drop-shadow(0 0 1px #6b638899); opacity: .7; }
.post-summary img, .post-title img { display: none; }
span.ilink { color: inherit; font-family: inherit; font-weight: 700; }

/* Home callout: shown until a save is imported (save-import.js adds body.has-save). */
.save-callout { display: flex; gap: var(--space-xl); align-items: center; border-color: transparent; background: var(--grad-panel) padding-box, var(--grad-rim-gold) border-box; }
.has-save .save-callout { display: none; }
.callout-art, .callout-body { position: relative; z-index: 1; }
.callout-art img { width: 120px; filter: drop-shadow(0 6px 10px #000c); }
.callout-title { font: 400 var(--fs-2xl) "Germania One", serif; color: var(--color-ornament-gold); margin: 0 0 var(--space-sm); }
.save-callout ol { padding-left: 1.3em; margin: var(--space-sm) 0 0; }
.save-callout li { margin: 4px 0; }
@media (max-width: 820px) { .save-callout { flex-direction: column; text-align: left; } }
/* Size of a masked "???" name: the size of the text around it. */
.post-title { --fs-mask: var(--fs-2xl); }
.post-summary { --fs-mask: var(--fs-lg); }
.ribbon { --fs-mask: var(--fs-3xl); }
.crumbs { --fs-mask: var(--fs-sm); }
.intro, .article-body { --fs-mask: var(--fs-lg); }
@media (max-width: 820px) { .ribbon { --fs-mask: var(--fs-2xl); } }

/* ------------------------------------------------------------ top bar download */
.topbar .search { margin-left: 0; flex: 0 1 380px; }
.download { position: relative; margin: 0 auto; display: flex; flex: none; }
.dl-main, .dl-more {
  font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-action-primary-text); text-shadow: 0 1px 0 #fff4d08c; cursor: pointer;
  background: var(--grad-gold) padding-box, var(--grad-rim-gold) border-box; border: 2px solid transparent;
  box-shadow: 0 3px 0 #7a2e10, 0 4px 10px #05061a8c;
}
.dl-main { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--radius-md) 0 0 var(--radius-md); white-space: nowrap; }
.dl-more { padding: 6px 10px; border-radius: 0 var(--radius-md) var(--radius-md) 0; border-left: 1px solid #b5501a; }
.dl-main:hover, .dl-more:hover { background: var(--grad-gold-hover) padding-box, var(--grad-rim-gold) border-box; color: var(--color-action-primary-text); text-decoration: none; box-shadow: 0 3px 0 #7a2e10, 0 0 16px #ffb84a80; }
.dl-main:active, .dl-more:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a2e10; }
.dl-icon { font-size: 1.1em; }
.dl-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 40; width: 300px;
  background: var(--grad-panel) padding-box, var(--grad-rim-iron) border-box; border: 3px solid transparent; border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px #00000099; padding: var(--space-sm);
}
.dl-title { font: 400 var(--fs-lg) "Germania One", serif; color: var(--color-ornament-gold); padding: 4px 8px 8px; border-bottom: 1px solid var(--color-border-default); margin-bottom: 6px; }
.dl-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: var(--radius-md); color: var(--color-text-primary); font: 600 var(--fs-md) "Barlow Condensed", sans-serif; }
.dl-item:hover { background: var(--color-action-secondary-bg-hover); text-decoration: none; color: var(--color-text-primary); }
.dl-item.detected { background: var(--color-surface-inset); box-shadow: inset 3px 0 0 var(--color-border-accent); }
.dl-item.detected::after { content: "★"; color: var(--color-text-accent); margin-left: 6px; }
.dl-ver { margin-left: auto; color: var(--color-text-muted); font-size: var(--fs-xs); }
.dl-hint { font: 500 var(--fs-xs) "Barlow Condensed", sans-serif; color: var(--color-text-secondary); margin: 6px 10px; line-height: 1.3; }
.dl-all { display: block; padding: 6px 10px; font: 600 var(--fs-sm) "Barlow Condensed", sans-serif; border-top: 1px solid var(--color-border-default); margin-top: 4px; }
@media (max-width: 1100px) { .topbar .search { flex-basis: 240px; } }
@media (max-width: 820px) {
  .topbar .search { flex: 1 1 100%; }
  .download { order: 4; flex-basis: 100%; justify-content: center; margin: 0; }
  .dl-main { flex: 1; justify-content: center; }
  .dl-menu { left: auto; right: 0; transform: none; width: min(300px, calc(100vw - 32px)); }
}

/* Home: early access callout (always shown, right under the top banner). */
.early-callout { border-color: transparent; background: var(--grad-panel) padding-box, var(--grad-ruby) border-box; }
.early-callout .callout-body { position: relative; z-index: 1; }
.early-tag { display: inline-block; font: 700 var(--fs-xs) "Barlow Condensed", sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--color-action-danger-text); background: var(--grad-ruby); padding: 2px 10px; border-radius: 999px; margin-bottom: var(--space-sm); box-shadow: 0 2px 0 #3a1630; }
.early-how { background: var(--color-surface-inset); border-radius: var(--radius-lg); padding: var(--space-sm) var(--space-md); }
kbd { font: 700 var(--fs-sm) "Barlow Condensed", sans-serif; color: var(--color-action-primary-text); background: var(--grad-gold); border-radius: var(--radius-sm); padding: 1px 8px; box-shadow: 0 2px 0 #7a2e10; }
