/* The Embercrown Wiki: the game's warm ember colours, phone first (docs/plans/WIKI_BUILD.md). */
:root { --bg: #0d0a0f; --panel: #1b130e; --panel2: #24180f; --line: #3d2c1e; --text: #f0e2c4; --dim: #bba888; --faint: #8a7a62; --ember: #f29a2e; --ember2: #c2451e; --link: #ffc070; }
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; background: radial-gradient(circle at 50% 0, #2a1a10, var(--bg) 60%) fixed; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: Cinzel, Georgia, serif; font-weight: 900; letter-spacing: .5px; line-height: 1.2; }
h1 { font-size: 28px; margin: 6px 0 10px; color: #ffd9a0; }
h2 { font-size: 18px; margin: 26px 0 10px; color: var(--ember); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.top { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: rgba(13, 10, 15, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font: 700 16px Cinzel, Georgia, serif; white-space: nowrap; }
.brand b { color: var(--ember); }
.brand:hover { text-decoration: none; }
.search { position: relative; flex: 1; min-width: 0; }
.search input { width: 100%; height: 38px; padding: 0 12px; border-radius: 19px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 15px system-ui; }
.search input:focus { outline: 2px solid var(--ember); outline-offset: 0; }
.results { position: absolute; left: 0; right: 0; top: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-height: 60vh; overflow: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.results a { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.results a span { color: var(--faint); font-size: 13px; }
.results a.on, .results a:hover { background: var(--panel2); text-decoration: none; }
.sections { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.sections a { flex: none; padding: 6px 12px; border-radius: 16px; background: var(--panel); color: var(--dim); font-size: 14px; }
.sections a[aria-current] { background: var(--ember); color: #1a0d05; font-weight: 700; }
main { max-width: 860px; margin: 0 auto; padding: 14px 16px 30px; }
.crumbs { font-size: 13px; color: var(--faint); }
.lead { color: var(--dim); font-size: 17px; margin-top: 0; }
.small { color: var(--faint); font-size: 13px; }
.tag { color: var(--faint); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 6px; }
.hero { text-align: center; padding: 18px 0 6px; }
.hero h1 { font-size: 34px; }
.hero h1 span { color: var(--ember); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.cards.big { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin-top: 14px; }
.card { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.card:hover { border-color: var(--ember); text-decoration: none; }
.card b { color: #ffd9a0; }
.card span { color: var(--dim); font-size: 14px; }
.card.row { flex-direction: row; align-items: center; gap: 10px; }
.card.row > span { display: flex; flex-direction: column; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-size: 13px; text-align: center; }
.tile:hover { border-color: var(--ember); text-decoration: none; }
.pic { flex: none; image-rendering: auto; }
.chip { display: inline-flex; align-items: center; gap: 4px; }
.chip .pic { vertical-align: middle; }
.head { display: flex; gap: 16px; align-items: flex-start; }
.head > canvas { background: radial-gradient(circle, #2e1f14, transparent 70%); border-radius: 12px; }
.head h1 { margin-top: 0; }
/* Gear pages, "How it looks": the figure wearing it, front, side and back. */
.looks { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.looks canvas { background: radial-gradient(circle, #3a4a30, #24301e 75%); border-radius: 12px; }
.fact { display: flex; gap: 10px; padding: 3px 0; }
.fact > span { flex: none; width: 104px; color: var(--faint); font-size: 14px; }
.examine { font-style: italic; color: var(--dim); margin: 0 0 8px; }
blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--ember2); background: var(--panel); color: var(--dim); font-style: italic; border-radius: 0 8px 8px 0; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font-weight: 600; font-size: 13px; }
td.lvl { width: 56px; font-weight: 700; color: var(--ember); }
td.word { color: var(--dim); width: 110px; }
table.stats { width: auto; margin-top: 12px; }
table.stats td { text-align: center; min-width: 64px; }
td.pos { color: #8fd07a; } td.neg { color: #e07a6a; }
ul { padding-left: 20px; } li { margin: 4px 0; }
details.spoiler { margin-top: 24px; border: 1px dashed var(--ember2); border-radius: 10px; padding: 0 14px; background: rgba(194, 69, 30, .06); }
details.spoiler summary { cursor: pointer; padding: 12px 0; color: var(--ember); font-weight: 700; }
details.spoiler[open] summary { border-bottom: 1px solid var(--line); }
ol.steps li { margin: 8px 0; color: var(--dim); }
.map { width: 100%; aspect-ratio: var(--w) / var(--h); max-height: 320px; margin: 12px 0; border-radius: 10px; border: 1px solid var(--line);
  background-image: url(/play/maps/world.png); background-repeat: no-repeat; image-rendering: pixelated;
  background-size: calc(768 / var(--w) * 100%) calc(512 / var(--h) * 100%);
  background-position: calc(var(--x) / (768 - var(--w)) * 100%) calc(var(--y) / (512 - var(--h)) * 100%); }
footer { max-width: 860px; margin: 0 auto; padding: 18px 16px 40px; border-top: 1px solid var(--line); text-align: center; }
.play { display: inline-block; padding: 10px 26px; border-radius: 10px; background: linear-gradient(#f5a43a, #c2451e); color: #1a0d05; font: 900 16px Cinzel, Georgia, serif; letter-spacing: 1px; }
.play:hover { text-decoration: none; filter: brightness(1.08); }
@media (max-width: 560px) {
  h1 { font-size: 24px; }
  .brand span { display: none; }
  .head { flex-direction: column; align-items: center; text-align: center; }
  .head .fact { text-align: left; }
  .fact > span { width: 92px; }
}
/* In-depth pages (docs/WIKI_STANDARD.md): sub-headings, notes, wide tables that scroll sideways on a phone, maps with pins. */
h3 { font: 700 16px system-ui, -apple-system, "Segoe UI", sans-serif; margin: 20px 0 6px; color: #ffd9a0; }
p.note { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--panel); color: var(--dim); font-size: 14px; border-radius: 0 8px 8px 0; }
.scroll { overflow-x: auto; margin: 8px 0; }
.scroll table { min-width: 100%; }
.scroll td .chip { white-space: nowrap; }
table.levels { width: 100%; }
ol { padding-left: 22px; } ol li { margin: 6px 0; }
ol.steps .small { margin-top: 2px; }
.mapfig { margin: 12px 0; }
.mapfig .map { position: relative; overflow: hidden; margin: 0; }
.mapfig figcaption { color: var(--faint); font-size: 13px; margin-top: 4px; }
.map .pin, .map .dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ember); border: 2px solid #1a0d05; box-shadow: 0 0 0 2px rgba(255, 217, 160, .85); }
.map .dot { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: #8fd0ff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .8); }
.map .zone { position: absolute; border: 2px solid var(--ember); background: rgba(242, 154, 46, .22); border-radius: 4px; }
