/* Pantheon client layout. The look (panels, buttons, palette) comes from art/pantheon.css. */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body.pantheon { font-size: 16px; line-height: 1.45; }
body.busy { cursor: progress; }
a { color: var(--gold-light); }
.pt-panel a, .pt-book a { color: var(--clay-d, #7d4428); }
h1, h2, h3, h4 { margin: 0 0 .5em; }
h2.pt-title { font-size: 20px; }
h3.pt-title { font-size: 17px; }
h4 { font-family: var(--font-display); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-top: 12px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.muted { color: #b3ab9b; }
.muted-ink { color: #6b5845; }
.pt-panel.stone .muted-ink { color: #b3ab9b; }
.small { font-size: 13px; }
.bad { color: #d9574a; font-weight: 700; }
.pt-panel .bad, .pt-book .bad { color: var(--blood); }
.loading { padding: 80px 20px; text-align: center; font-family: var(--font-display); letter-spacing: .1em; color: var(--gold-light); }

.pt-icon.small { width: 20px; height: 20px; }
.pt-btn.small { min-height: 32px; font-size: 13px; border-width: 9px; padding: 0 4px; }
.pt-btn { text-decoration: none; }
.pt-btn.on { filter: brightness(1.2); outline: 2px solid var(--gold-light); }
.icon-btn { background: none; border: 0; color: inherit; cursor: pointer; padding: 4px; font-size: 20px; line-height: 1; border-radius: 6px; }
.icon-btn:hover { background: rgba(255, 243, 196, .12); }
.linkish { background: none; border: 0; color: var(--gold-light); text-decoration: underline; cursor: pointer; font: inherit; padding: 0 4px; }
.pt-panel .linkish { color: var(--clay-d, #7d4428); }

input, textarea, select { font: inherit; color: var(--ink); background: #fbf7ee; border: 2px solid var(--parch-3); border-radius: 6px; padding: 6px 8px; max-width: 100%; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); border-color: var(--gold-dark); }
textarea { width: 100%; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 3px; margin: 6px 0; min-width: 0; }
.field-label { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.field input:not([type=checkbox]), .field select { width: 100%; }
.help { color: #6b5845; font-size: 12.5px; }
.row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: flex-start; }
.row > .field { flex: 1 1 160px; }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.check.dark { color: var(--parch); margin: 0; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline input.copy { flex: 1; min-width: 200px; }
input.copy { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 1px 8px; border-radius: 10px; background: rgba(42, 29, 20, .12); margin: 0 4px; }
.pt-panel.stone .tag, .topbar .tag { background: rgba(255, 243, 196, .12); }
.tag.ok { background: rgba(95, 154, 70, .25); }
.error { display: flex; gap: 8px; align-items: flex-start; background: #f6dcd6; color: #6a1a14; border: 2px solid var(--blood); border-radius: 8px; padding: 8px 12px; margin: 10px 0; }
.card { margin: 0 0 16px; }
.narrow { max-width: 720px; margin-left: auto; margin-right: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 40px); opacity: 0; transition: .3s; z-index: 50;
  background: var(--panel); color: var(--parch); border: 2px solid var(--gold); padding: 10px 18px; border-radius: 10px; max-width: 90vw; white-space: pre-wrap; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { border-color: var(--blood-l, #d9574a); }
.update-banner { position: fixed; right: 16px; bottom: 16px; z-index: 40; }

/* ---- home ---- */
.home { max-width: 1040px; margin: 0 auto; padding: 24px 16px 60px; }
.home-head { text-align: center; margin-bottom: 18px; }
.home-head .logo { width: min(420px, 90%); }
.tagline { color: var(--parch-2); font-style: italic; margin-top: 4px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.game-list { list-style: none; padding: 0; margin: 0; }
.game-list li { padding: 6px 0; border-bottom: 1px solid rgba(255, 243, 196, .12); }
.game-list a { color: var(--gold-light); }

/* ---- game shell ---- */
.game { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 8px 16px; background: rgba(27, 23, 34, .85); border-bottom: 2px solid var(--panel-edge); flex-wrap: wrap; }
.home-link img { height: 34px; display: block; }
.title-block { flex: 1; min-width: 200px; }
.game-name { font-size: 18px; color: var(--gold-light); }
.sub { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.sub > span { display: inline-flex; align-items: center; gap: 4px; }
.phase { font-family: var(--font-display); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding: 1px 8px; border-radius: 10px; background: rgba(212, 166, 64, .2); }
.phase-submissions { background: rgba(95, 154, 70, .35); }
.stats { display: flex; gap: 14px; align-items: center; }
.god-badge { font-family: var(--font-display); font-weight: 700; padding: 2px 10px; border-radius: 12px; color: #fff; }
.seat-switch { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.seat-switch select { padding: 2px 4px; }

.tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--panel); border-bottom: 2px solid var(--panel-edge); overflow-x: auto; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 14px; color: var(--parch-2); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: .05em; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a .pt-icon { width: 22px; height: 22px; }
.tabs a.on { color: var(--gold-light); border-bottom-color: var(--gold); }
.tabs a:hover { color: var(--glow); }
.badge { background: var(--blood); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.body { flex: 1; padding: 16px; max-width: 1200px; width: 100%; margin: 0 auto; }
.body.tab-map { max-width: none; padding: 0; display: flex; flex-direction: column; }
.actions-bar { display: flex; justify-content: flex-end; gap: 12px; margin: 12px 0 30px; flex-wrap: wrap; }

.god-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
.god-chip .dot, .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0, 0, 0, .4); }
.god-crimson .dot, .god-badge.god-crimson { background: var(--god-crimson); }
.god-azure .dot, .god-badge.god-azure { background: var(--god-azure); }
.god-verdant .dot, .god-badge.god-verdant { background: var(--god-verdant); }
.god-amber .dot, .god-badge.god-amber { background: var(--god-amber); }
.god-violet .dot, .god-badge.god-violet { background: var(--god-violet); }
.god-teal .dot, .god-badge.god-teal { background: var(--god-teal); }

.seat-list { list-style: none; padding: 0; }
.seat-list li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.seat-img { width: 28px; }

/* ---- creation ---- */
.creation { max-width: 900px; margin: 0 auto; }
.cp-meter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.cp-meter .pt-bar, .ap-meter .pt-bar { width: 220px; }
.choice { border: 2px solid var(--parch-3); border-radius: 10px; padding: 8px 12px; margin: 10px 0; background: rgba(251, 247, 238, .5); }
.choice-head { display: flex; align-items: center; gap: 10px; }
.choice-head strong { font-family: var(--font-display); flex: 1; }
.choice-head .shield { width: 26px; }
.cost { font-weight: 700; }
.penalty { font-size: 13.5px; color: #4a3526; }
.penalty.warn { color: var(--blood); }
.penalty.warn::before { content: "⚠ "; }
.add-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ---- map ---- */
.map-wrap { display: flex; flex: 1; min-height: calc(100vh - 190px); }
.map-main { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 0; }
.map-holder { flex: 1; position: relative; background: #2d4f6c; overflow: hidden; min-height: 420px; }
.hexmap { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; user-select: none; }
.hexmap:active { cursor: grabbing; }
.hexmap .tile:hover image:first-child { filter: brightness(1.12); }
.hexmap .river { fill: none; stroke: #9cc6e6; stroke-width: 4; stroke-linecap: round; opacity: .9; pointer-events: none; }
.hexmap .settlement, .hexmap .prophet { cursor: pointer; }
.map-label { font: 700 11px var(--font-display); fill: var(--parch); stroke: var(--ink); stroke-width: 3px; paint-order: stroke; text-anchor: middle; pointer-events: none; }
.mark { fill: var(--gold-light); stroke: var(--ink); stroke-width: 2; }
.mark-dest { fill: var(--sky-l, #9cc6e6); }
.mark-label { font: 700 11px sans-serif; text-anchor: middle; fill: var(--ink); }
.map-tools { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: var(--panel); flex-wrap: wrap; }
.map-tools .icon-btn { font-weight: 700; min-width: 32px; }
.pick-banner { background: var(--gold); color: var(--ink); padding: 6px 12px; display: flex; gap: 8px; align-items: center; font-weight: 700; }
.pick-banner .linkish { color: var(--ink); }
.map-side { width: 340px; max-height: calc(100vh - 190px); overflow-y: auto; margin: 0; flex-shrink: 0; }
.tile-head { display: flex; gap: 10px; align-items: flex-start; }
.tile-head img { width: 44px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 8px 0; }
.kv > span:nth-child(odd) { font-weight: 700; }
.faith-row { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 6px; font-size: 14px; }
.fbar { height: 10px; background: rgba(42, 29, 20, .15); border-radius: 5px; overflow: hidden; }
.fbar i { display: block; height: 100%; }
.known { display: flex; flex-wrap: wrap; gap: 3px; }
.known .tag { margin: 0; }
.prophet-row { display: flex; align-items: center; gap: 4px; }
.prophet-row img { width: 18px; }
.shield-sm { width: 16px; vertical-align: middle; margin-right: 4px; }
.settle-list { list-style: none; padding: 0; margin: 0; }
.settle-list li { display: flex; align-items: center; gap: 6px; padding: 2px 4px; cursor: pointer; border-radius: 4px; }
.settle-list li:hover { background: rgba(42, 29, 20, .1); }
.settle-list img { width: 22px; }
.mini-stats > div { display: flex; gap: 6px; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 14px; background: var(--panel); font-size: 13.5px; align-items: center; }

/* ---- turn ---- */
.turn { max-width: 980px; margin: 0 auto; }
.turn-head .turn-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ap-meter { display: flex; align-items: center; gap: 12px; }
.burdens { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--parch-2); margin-top: 6px; }
.prose { font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
.pt-title.light { color: var(--gold-light); }
.lines { margin: 8px 0; }
.line { margin: 0 0 12px; color: var(--ink); }
.line-head { display: flex; align-items: center; gap: 8px; }
.line-no { font-family: var(--font-display); font-weight: 700; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ap-input { width: 62px; text-align: center; font-weight: 700; }
.ap-label { font-family: var(--font-display); font-weight: 700; }
.intent { flex: 1; min-width: 0; }
.act-pick { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.act { display: flex; flex-direction: column; align-items: center; gap: 1px; background: rgba(251, 247, 238, .6); border: 2px solid transparent; border-radius: 8px; padding: 3px 5px; cursor: pointer; font: 600 11px var(--font-display); color: var(--ink); width: 76px; }
.act .pt-icon { width: 28px; height: 28px; }
.act:hover { border-color: var(--parch-3); }
.act.on { border-color: var(--gold-dark); background: var(--gold-light); }
.line-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13.5px; margin-top: 4px; }
.odds { display: inline-flex; align-items: center; gap: 4px; }
.line-text { flex-basis: 100%; font-size: 12.5px; color: #4a3526; background: rgba(42, 29, 20, .07); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }

/* ---- chronicle ---- */
.results { max-width: 860px; margin: 0 auto; }
.entry { margin-bottom: 16px; }
.entry h3 { display: flex; align-items: center; gap: 6px; }
.chronicle { font-size: 16.5px; }
.private { background: rgba(107, 74, 138, .12); border-left: 4px solid var(--purple, #6b4a8a); padding: 4px 12px; border-radius: 4px; margin: 8px 0; }
.private h4 { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.rolls { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 8px; }
.rolls th, .rolls td { text-align: left; padding: 3px 6px; border-bottom: 1px solid rgba(42, 29, 20, .2); vertical-align: top; }
.outcome { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.out-triumph { color: #3c6b33; } .out-success { color: #3c6b33; } .out-partial { color: #9a7322; } .out-failure { color: #7d4428; } .out-backfire { color: var(--blood); }
.chapter { text-align: center; font-style: italic; margin: 8px 0; }
.ornament { width: 160px; display: block; margin: 0 auto 6px; }
figure { margin: 8px 0; text-align: center; }
figure img { max-width: 100%; border-radius: 6px; border: 3px solid var(--parch-3); }
figcaption { font-style: italic; font-size: 14px; }
.art-vote { margin-bottom: 14px; }
.art-cands { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.art-cand { background: none; border: 3px solid transparent; border-radius: 8px; padding: 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.art-cand img { width: 200px; border-radius: 6px; }
.art-cand.on { border-color: var(--gold); }

/* ---- messages ---- */
.messages { max-width: 820px; margin: 0 auto; }
.msg-filter { margin-bottom: 10px; }
.msg-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.msg { background: var(--panel-light); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 8px 12px; max-width: 86%; }
.msg.mine { align-self: flex-end; background: #463c52; }
.msg.public { border-color: var(--gold-dark); }
.msg p { margin: 4px 0 0; }
.msg-head { font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.compose .to { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.compose h3 { display: flex; align-items: center; gap: 6px; }

/* ---- gods ---- */
.gods { max-width: 980px; margin: 0 auto; }
.god-title { display: flex; gap: 12px; align-items: center; }
.god-title img { width: 48px; }
.god-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.god-card { display: flex; gap: 10px; align-items: flex-start; }
.god-card img { width: 40px; flex-shrink: 0; }
.god-card > div > div { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.god-card.destroyed { opacity: .55; }
.pantheon { border-top: 1px solid rgba(42, 29, 20, .2); padding: 8px 0; }
.pantheon h3 { display: flex; align-items: center; gap: 6px; }
.req { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; }

/* ---- book ---- */
.book { max-width: 860px; margin: 0 auto; }
.book-title { text-align: center; margin: 10px 0 20px; }
.book-title h1 { color: var(--gold-light); font-size: 30px; }
.book section { margin-bottom: 18px; }
.dropcap::first-letter { font-family: var(--font-display); font-size: 2.6em; float: left; line-height: .9; margin: 4px 6px 0 0; color: var(--blood); }
.book details { border-bottom: 1px solid rgba(42, 29, 20, .2); padding: 4px 0; }
.book summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; }
.book-prose, .book-result { margin-left: 12px; }
.book-map input[type=range] { width: 100%; }
.snapmap { width: 100%; height: auto; background: #2d4f6c; border-radius: 6px; }
.snap-settlement { stroke: var(--ink); stroke-width: 2; }
.book-tools { display: flex; gap: 8px; justify-content: flex-end; max-width: 860px; margin: 0 auto; }
.book-msg { margin: 6px 0; }

/* ---- host ---- */
.host { max-width: 820px; margin: 0 auto; }
.token-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: center; margin: 4px 0; }

@media (max-width: 800px) {
  .map-wrap { flex-direction: column; }
  .map-side { width: auto; max-height: none; }
  .map-holder { min-height: 60vh; }
  .stats { gap: 8px; }
  .body { padding: 10px; }
  .act { width: 64px; }
}
@media print {
  .topbar, .tabs, .book-tools, .toast { display: none !important; }
  body.pantheon { background: #fff; }
  .book details { display: block; }
}

/* ---- accounts, game list, admin, DM seat ---- */
.account-nav { display: flex; gap: 14px; align-items: center; font-size: 14px; flex-wrap: wrap; }
.account-nav a { color: var(--parch-2); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.account-nav a:hover { color: var(--glow); }
.auth .card { max-width: 480px; }
.home-grid.wide { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 900px) { .home-grid.wide { grid-template-columns: 1fr; } }
.game-rows { list-style: none; padding: 0; margin: 0; }
.game-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255, 243, 196, .12); }
.game-row.mine .gr-name { color: var(--gold-light); }
.gr-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gr-name { font-family: var(--font-display); font-size: 16px; margin-right: 8px; }
.gr-seats .tag { margin: 2px 4px 0 0; }
.gr-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.gm-row { margin: 4px 0 4px 4px; }
.admin { max-width: 980px; }
.req-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(42, 29, 20, .2); flex-wrap: wrap; }
.note { margin: 4px 0; font-style: italic; }
.accounts { width: 100%; border-collapse: collapse; }
.accounts th, .accounts td { text-align: left; padding: 5px 6px; border-bottom: 1px solid rgba(42, 29, 20, .2); }
.accounts tr.off td { opacity: .55; }
.accounts select { padding: 2px 4px; }
.small-print ul { margin: 0; padding-left: 18px; }
.gm { max-width: 980px; margin: 0 auto; }
.judge-row { border-top: 1px solid rgba(42, 29, 20, .2); padding: 8px 0; }
.judge-row .field { margin: 2px 0; }
.judge-row .grow { flex: 1; min-width: 200px; }
.prose-read { background: rgba(251, 247, 238, .6); padding: 6px 10px; border-radius: 6px; }
.topbar .account-nav { margin-left: auto; }
