/* ============================================================
   Kara — visual system
   Dark forest + parchment + brass, with rushnyk red accents.
   ============================================================ */
:root {
  --bg: #0b120e;
  --panel: #111a15;
  --panel-2: #17231c;
  --panel-3: #1e2c24;
  --line: rgba(214, 174, 92, .16);
  --line-strong: rgba(214, 174, 92, .38);
  --gold: #d6ae5c;
  --gold-2: #f2d892;
  --cream: #efe6d2;
  --muted: #98a69c;
  --dim: #6c7a70;
  --red: #b8483a;
  --red-2: #e06a55;
  --green: #6fa16f;
  --blue: #6f9fc0;
  --paper: #ece2cc;
  --paper-2: #e2d6bb;
  --ink: #1b231e;
  --ink-2: #4c5a51;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--cream); font: 400 14px/1.45 var(--font-ui); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { user-select: none; -webkit-user-drag: none; }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.hidden { display: none !important; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid currentColor; border-radius: 5px; font: 700 10px var(--font-ui); opacity: .7; }
.eyebrow, .panel-label { margin: 0; text-transform: uppercase; letter-spacing: .16em; font-size: 10.5px; font-weight: 700; color: var(--gold); }
.inline-icon { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; }
.tiny-icon { width: 15px; height: 15px; object-fit: contain; vertical-align: -3px; }

/* ---------- Start screen ---------- */
.start-screen { position: relative; height: 100dvh; display: grid; grid-template-columns: minmax(340px, 560px) 1fr; overflow: hidden; background: radial-gradient(ellipse at 70% 40%, #34402f 0%, #172119 55%, #0b120e 100%); }
.start-backdrop { position: absolute; z-index: 0; inset: 0; overflow: hidden; }
.start-zmey { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 30%; opacity: .5; filter: saturate(.8) contrast(1.05); -webkit-mask-image: linear-gradient(90deg, transparent 22%, #000 60%), linear-gradient(transparent, #000); mask-image: linear-gradient(90deg, transparent 22%, #000 60%); animation: zmey-drift 16s ease-in-out infinite alternate; }
.start-sun { position: absolute; right: 22%; top: 18%; width: 34vmin; height: 34vmin; border-radius: 50%; background: radial-gradient(circle, #f6d48a 0%, #e8a95a 45%, transparent 70%); opacity: .38; filter: blur(4px); }
.start-guardian { position: absolute; z-index: 2; right: 6%; bottom: -12%; height: 106%; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(0,0,0,.6)); animation: guardian-rise 1.2s cubic-bezier(.2,.8,.2,1) both; }
.start-fog { position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, #0b120ecc 70%, #0b120e); }
@keyframes zmey-drift { from { transform: scale(1); } to { transform: scale(1.05); } }
.start-sun { z-index: 1; }
.start-fog { z-index: 3; }
@keyframes guardian-rise { from { opacity: 0; transform: translateY(40px); } }
.start-panel { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 0; padding: clamp(28px, 6vh, 70px) clamp(24px, 5vw, 72px); background: linear-gradient(90deg, rgba(11,18,14,.96) 0%, rgba(11,18,14,.9) 70%, rgba(11,18,14,0) 100%); overflow-y: auto; }
.start-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: auto; padding-bottom: 24px; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--gold); border-radius: 8px; color: var(--gold-2); font: 700 22px var(--font-display); background: linear-gradient(145deg, #2a3a2f, #121b16); box-shadow: inset 0 0 0 3px #0b120e, 0 0 0 1px #d6ae5c33; }
.start-panel h1 { margin: 14px 0 0; font: 600 clamp(72px, 10vw, 128px)/.85 var(--font-display); letter-spacing: .14em; color: var(--cream); text-shadow: 0 4px 30px rgba(214,174,92,.25); }
.subtitle { margin: 8px 0 18px; font: 600 clamp(20px, 2.2vw, 26px) var(--font-display); color: var(--red-2); letter-spacing: .06em; }
.intro { max-width: 440px; margin: 0 0 22px; color: #c3cbc1; font-size: 15px; line-height: 1.65; }
.guardian-select { margin-bottom: 18px; }
.guardian-strip { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 8px; }
.guardian-choice { position: relative; display: grid; justify-items: center; gap: 4px; width: 62px; padding: 0; border: 0; background: none; }
.guardian-choice img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 2px solid #3d4a40; background: #1c2821; transition: transform .2s, border-color .2s, filter .2s; }
.guardian-choice span { font-size: 10px; color: var(--muted); }
.guardian-choice.selected img { border-color: var(--gold); box-shadow: 0 0 0 3px #d6ae5c33, 0 8px 18px #0008; }
.guardian-choice.selected span { color: var(--gold-2); font-weight: 700; }
.guardian-choice.locked img { filter: grayscale(.9) brightness(.6); }
.guardian-choice.locked:after { content: "🔒"; position: absolute; top: 34px; right: 4px; font-size: 13px; filter: grayscale(1) brightness(1.6); }
.guardian-choice:hover img { transform: translateY(-3px); }
.guardian-note { min-height: 20px; margin: 0; max-width: 440px; color: var(--muted); font-size: 12.5px; }
.seed-row { display: flex; align-items: end; gap: 10px; margin-bottom: 18px; }
.seed-field { display: grid; gap: 4px; width: 200px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--muted); }
.seed-field input { padding: 8px 2px; border: 0; border-bottom: 1px solid #56635a; background: transparent; outline: none; font: 600 24px var(--font-display); letter-spacing: .08em; color: var(--cream); }
.seed-field input:focus { border-color: var(--gold); }
.seed-random { width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--panel-2); color: var(--gold-2); font-size: 20px; transition: transform .3s; }
.seed-random:hover { transform: rotate(180deg); }
.start-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
.primary-button { display: inline-flex; align-items: center; gap: 28px; padding: 15px 22px; border: 1px solid #f2d89255; border-radius: 10px; background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; font-weight: 800; letter-spacing: .02em; box-shadow: 0 10px 26px #0009, inset 0 1px #fff5; transition: transform .2s, filter .2s; }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.continue-button { display: grid; text-align: left; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: #17231ccc; }
.continue-button b { font-size: 13px; }
.continue-button small { color: var(--muted); font-size: 11px; }
.continue-button:hover { border-color: var(--gold); }
.small-note { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 18px 0 auto; color: var(--dim); font-size: 11.5px; }

/* ---------- Game shell ---------- */
.game-screen { height: 100dvh; display: grid; grid-template-rows: 62px minmax(0, 1fr) auto; background: var(--bg); }
.topbar { position: relative; z-index: 20; display: grid; grid-template-columns: auto minmax(220px, 1fr) auto auto; align-items: center; gap: 22px; padding: 0 16px; background: linear-gradient(180deg, #16211b, #0f1813); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px #0007; }
.brand-lockup { display: flex; align-items: center; gap: 10px; }
.brand-lockup b { display: block; font: 700 19px/1 var(--font-display); letter-spacing: .1em; }
.brand-lockup small { color: var(--muted); font-size: 10.5px; }
.phase-block { max-width: 560px; width: 100%; justify-self: center; }
.phase-line { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; font-size: 12px; }
.phase-line b { font: 700 18px/1 var(--font-display); color: var(--gold-2); letter-spacing: .04em; }
.phase-line span { color: var(--muted); }
.phase-ash { margin-left: auto; padding: 2px 8px; border-radius: 20px; background: #ffffff0d; font-size: 11px; }
body[data-phase="dusk"] .phase-ash { background: #b8483a33; color: #f2a17d; }
body[data-phase="night"] .phase-ash { background: #4a3a8a44; color: #bcb4ff; }
.phase-track { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; }
.phase-track i { height: 6px; border-radius: 2px; opacity: .35; }
.phase-track i:nth-child(6n) { margin-right: 3px; }
.phase-track i.dawn { background: #e9b27a; }
.phase-track i.day { background: #f2d892; }
.phase-track i.dusk { background: #d06a3e; }
.phase-track i.night { background: #6a5fc0; }
.phase-track i.past { opacity: .9; }
.phase-track i.now { opacity: 1; transform: scaleY(1.8); box-shadow: 0 0 10px currentColor; outline: 1px solid #fff8; }
.top-stats { display: flex; gap: 8px; }
.stat { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 18px; background: #0b120e99; }
.stat img { width: 20px; height: 20px; object-fit: contain; }
.stat b { font-weight: 700; font-variant-numeric: tabular-nums; }
.hearts { display: flex; gap: 2px; }
.hearts i { width: 8px; height: 14px; border-radius: 3px; background: #ffffff1a; }
.hearts i.on { background: linear-gradient(180deg, #ee7563, #a8342a); box-shadow: 0 0 6px #e0604a66; }
.mobile-hud { display: none; }
.topbar-actions { display: flex; gap: 8px; }
.language-button, .icon-button { min-width: 36px; height: 36px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-2); color: var(--gold-2); font-weight: 800; font-size: 12px; }
.language-button:hover, .icon-button:hover { border-color: var(--gold); background: var(--panel-3); }
.bump { animation: bump .5s cubic-bezier(.2,.8,.2,1); }
@keyframes bump { 40% { transform: scale(1.35); color: var(--gold-2); } }

.game-layout { min-height: 0; display: grid; grid-template-columns: 286px minmax(0, 1fr) 270px; }
.side-panel { min-height: 0; overflow-y: auto; padding: 16px 14px 20px; background: var(--panel); scrollbar-width: thin; scrollbar-color: #3a4a40 transparent; }
.guardian-panel { border-right: 1px solid var(--line); }
.resources-panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-section { margin-top: 18px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-row > span { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.panel-section > .panel-label { margin-bottom: 8px; }

.guardian-card { display: flex; align-items: center; gap: 12px; }
.portrait { flex: none; width: 78px; height: 78px; border-radius: 50%; padding: 3px; background: conic-gradient(from 210deg, var(--gold), #7a5a26, var(--gold-2), var(--gold)); box-shadow: 0 8px 20px #0008; }
.portrait img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 10%; background: #1b2620; }
.guardian-card h2 { margin: 2px 0 4px; font: 700 26px/1 var(--font-display); }
.level-chip { display: inline-block; padding: 2px 8px; border: 1px solid #d6ae5c55; border-radius: 10px; color: var(--gold-2); font-size: 10.5px; }
.meter-row { display: flex; justify-content: space-between; margin: 14px 0 5px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.meter-row strong { color: var(--cream); font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 6px; background: #ffffff12; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #a8342a, #ee7563); transition: width .4s; }

.oath-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: none; }
.oath-list li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; color: var(--dim); font-size: 12.5px; }
.oath-list li i { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #ffffff22; font-style: normal; font-size: 10.5px; font-weight: 800; }
.oath-list li b { display: block; font-weight: 600; }
.oath-list li small { display: block; margin-top: 2px; color: #c7cfc5; font-size: 11.5px; line-height: 1.4; }
.oath-list li.done { color: var(--muted); }
.oath-list li.done b { text-decoration: line-through; text-decoration-color: #ffffff33; }
.oath-list li.done i { background: #3f6b45; border-color: #6fa16f; color: #e6f5e0; }
.oath-list li.active { background: linear-gradient(90deg, #d6ae5c1f, transparent); color: var(--cream); box-shadow: inset 2px 0 var(--gold); }
.oath-list li.active i { border-color: var(--gold); color: var(--gold-2); }

.ability-list { display: grid; gap: 6px; }
.ability { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.ability-icon { width: 30px; height: 30px; object-fit: contain; flex: none; }
.ability b { display: block; font-size: 12.5px; }
.ability small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }

.gear-list { display: grid; gap: 6px; }
.gear-chip { display: flex; gap: 9px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.gear-art { width: 38px; height: 36px; object-fit: contain; flex: none; }
.gear-chip span { flex: 1; min-width: 0; }
.gear-chip b { display: block; font-size: 12px; }
.gear-chip small { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.gear-chip em { font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); }
.gear-chip.spell { border-color: #6f9fc040; }
.gear-chip.amulet { border-color: #b8483a40; }
.use-button { padding: 5px 10px; border: 1px solid var(--gold); border-radius: 7px; background: #d6ae5c22; color: var(--gold-2); font-size: 11px; font-weight: 700; }
.use-button:hover:not(:disabled) { background: #d6ae5c44; }
.empty-note { padding: 10px; border: 1px dashed #ffffff1c; border-radius: 9px; color: var(--dim); font-size: 11.5px; line-height: 1.45; }

.resource-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.resource { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); text-align: center; }
.resource img { width: 34px; height: 34px; object-fit: contain; }
.resource small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.resource b { display: inline-block; font: 700 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }

.army-list { display: grid; gap: 6px; }
.army-unit { display: flex; gap: 9px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.army-portrait { width: 40px; height: 40px; flex: none; border-radius: 50%; object-fit: cover; object-position: 50% 10%; border: 2px solid #3d4a40; background: #1b2620; }
.army-unit.knight .army-portrait { border-color: #6f9fc0; }
.army-unit.archer .army-portrait { border-color: #c08c4a; }
.army-unit.mage .army-portrait { border-color: #7fbf8a; }
.army-unit.cossack .army-portrait { border-color: var(--gold); }
.army-unit span:not(.die-faces) { flex: 1; min-width: 0; }
.army-unit b { display: block; font-size: 12.5px; }
.army-unit small { display: block; color: var(--muted); font-size: 10.5px; line-height: 1.3; }
.army-list.compact .army-unit small { display: none; }
.die-faces { display: flex; gap: 2px; flex: none; }
.die-faces i { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: #ffffff14; font-style: normal; font-size: 10px; font-weight: 800; color: var(--cream); }
.die-faces i.skull { background: #b8483a55; color: #ffc2b6; }

.journal { display: flex; flex-direction: column; min-height: 140px; flex: 1; }
.journal-list { display: grid; gap: 4px; overflow-y: auto; max-height: 100%; }
.journal-entry { display: flex; gap: 8px; padding: 4px 2px; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.journal-entry i { flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: #ffffff2a; }
.journal-entry.latest { color: var(--cream); }
.journal-entry.latest i { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* ---------- Map ---------- */
.map-stage { position: relative; min-width: 0; overflow: hidden; background: #172219; cursor: grab; touch-action: none; }
.map-stage.dragging { cursor: grabbing; }
.map-backdrop { position: absolute; inset: 0; background:
  radial-gradient(ellipse at 50% 45%, #2e3d2c 0%, #1c271e 50%, #0f1712 100%),
  #172219; }
.map-backdrop:after { content: ""; position: absolute; inset: 0; opacity: .5; background-image: radial-gradient(#d6ae5c14 1px, transparent 1.4px); background-size: 22px 22px; }
.hex-map { position: absolute; z-index: 2; left: 50%; top: 50%; width: 0; height: 0; transition: transform .5s cubic-bezier(.2,.75,.2,1); }
.hex-map.instant { transition: none; }
.phase-tint { position: absolute; inset: 0; z-index: 3; pointer-events: none; transition: background 2s; }
.map-stage[data-phase="dawn"] .phase-tint { background: linear-gradient(180deg, #ffcf9a14, transparent 60%); }
.map-stage[data-phase="dusk"] .phase-tint { background: linear-gradient(180deg, #d0602a40, #6a1a2a48); mix-blend-mode: multiply; }
.map-stage[data-phase="night"] .phase-tint { background: radial-gradient(ellipse at 50% 50%, #2a3a8a55, #080a2abb); mix-blend-mode: multiply; }
.map-vignette { position: absolute; inset: 0; z-index: 4; pointer-events: none; box-shadow: inset 0 0 120px 30px #050a07; }
.hedge-layer { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 30; }
.hedge { stroke: #173a1d; stroke-width: 10; stroke-linecap: round; }
.hedge-tree { fill: #2f6a35; stroke: #10291a; stroke-width: 2.5; }

.tile { position: absolute; z-index: 1; width: 150px; height: 130px; margin: -65px 0 0 -75px; padding: 0; border: 0; background: none; filter: drop-shadow(0 9px 7px rgba(0,0,0,.5)); transition: transform .18s; -webkit-tap-highlight-color: transparent; }
.tile:hover { z-index: 20; }
.tile.current, .tile.selected { z-index: 21; }
.hex-shape { position: absolute; inset: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: #33433a; transition: background .2s; }
.hex-fill { position: absolute; inset: 3px; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); overflow: hidden; background: #4a5a43; transition: filter .2s; }
.tile-img { position: absolute; inset: -2%; width: 104%; height: 104%; object-fit: cover; }
.tile-img.half-a { clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%); }
.tile-img.half-b { clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); }
.half-seam { position: absolute; left: calc(50% - 1px); top: 0; bottom: 0; width: 2px; background: #2c2412aa; }
.tile.ruins .hex-fill { background: radial-gradient(circle at 50% 45%, #d9c9a0, #a89466 70%, #7d6c48); }
.tile.boss .hex-fill { background: radial-gradient(circle at 50% 50%, #6a2a1e, #2d1310 75%); }
.tile.forest .hex-fill, .tile.farm .hex-fill, .tile.mixed .hex-fill, .tile.quarry .hex-fill { background: #5a6a40; }
.tile-diorama { position: absolute; left: 50%; top: 52%; width: 86%; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 6px #0006); }
.tile:hover .hex-fill { filter: brightness(1.1); }
.tile.gathered .hex-fill { filter: saturate(.55) brightness(.85); }

.tile.unknown { filter: none; }
.tile.unknown .hex-shape { background: #d6ae5c1c; }
.tile.unknown .hex-fill { background: radial-gradient(circle at 50% 40%, #1f2b23ee, #121b16ee); }
.fog-mark { position: absolute; inset: 0; display: grid; place-items: center; color: #d6ae5c55; font: 600 34px var(--font-display); }
.tile.unknown.reachable .hex-shape { background: var(--gold); }
.tile.unknown.reachable .hex-fill { background: radial-gradient(circle at 50% 40%, #3a4b37, #1d2a21); }
.tile.unknown.reachable .fog-mark { color: var(--gold-2); font-size: 42px; }
.tile.unknown:not(.reachable) { opacity: .55; }

.tile.reachable .hex-shape { background: var(--gold); animation: reach-pulse 1.8s ease-in-out infinite; }
@keyframes reach-pulse { 50% { background: #f6e3a8; } }
.tile.hostile .hex-shape { background: #a8392c; }
.tile.hostile.reachable .hex-shape { animation: hostile-pulse 1.6s ease-in-out infinite; }
@keyframes hostile-pulse { 50% { background: #ec6a50; } }
.tile.current .hex-shape { background: var(--gold-2); animation: none; }
.tile.selected:not(.current) .hex-shape { background: #fff3cf; animation: none; }
.tile.hedge-blocked .hex-shape { background: #2a5a30; }
.tile:active { transform: scale(.97); }

.yield-row { position: absolute; z-index: 3; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 1px; padding: 2px 5px; border-radius: 10px; background: #0b120ecc; box-shadow: 0 2px 6px #0007; pointer-events: none; }
.yield-icon { width: 18px; height: 18px; object-fit: contain; }
.tile.gathered .yield-row { opacity: .45; }
.token { position: absolute; z-index: 5; pointer-events: none; }
.token img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hero-token { left: 50%; top: 46%; width: 58px; height: 58px; transform: translate(-50%, -50%); border-radius: 50%; padding: 3px; background: conic-gradient(from 200deg, var(--gold), #8a6327, var(--gold-2), var(--gold)); box-shadow: 0 6px 14px #000a, 0 0 0 4px #0b120e66; z-index: 7; animation: hero-bob 3s ease-in-out infinite; }
.hero-token img { object-position: 50% 9%; background: #1b2620; }
@keyframes hero-bob { 50% { transform: translate(-50%, -56%); } }
.monster-token { left: 50%; top: 45%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; padding: 3px; background: linear-gradient(160deg, #e06a55, #6a1f17); box-shadow: 0 6px 14px #000b; }
.monster-token img { object-position: 50% 30%; background: #1a0f0d; }
.monster-token b { position: absolute; right: -6px; bottom: -4px; display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border: 2px solid #f6d2a0; border-radius: 13px; background: #7a1f16; color: #fff3df; font: 800 13px var(--font-ui); box-shadow: 0 3px 8px #000a; }
.monster-token.boss { width: 86px; height: 86px; top: 44%; background: linear-gradient(160deg, #ffb070, #6a1f17); animation: boss-glow 2.4s ease-in-out infinite; }
.monster-token.boss img { object-position: 50% 40%; }
@keyframes boss-glow { 50% { box-shadow: 0 0 26px #ff7a3a, 0 6px 14px #000b; } }
.tile.current.hostile .hero-token { left: 28%; width: 46px; height: 46px; }
.city-token { left: 24%; top: 24%; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 50%; padding: 2px; background: var(--gold); box-shadow: 0 4px 10px #000a; z-index: 6; }
.city-token.stage-2 { width: 52px; height: 52px; }
.city-token.stage-3 { width: 58px; height: 58px; box-shadow: 0 0 16px #f2d892aa, 0 4px 10px #000a; }
.tile.current.city .city-token { left: 20%; top: 22%; }
.tile-label { position: absolute; z-index: 8; left: 50%; top: calc(100% - 6px); transform: translate(-50%, 0); padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 10px; background: #0b120ef0; color: var(--cream); font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.tile.selected .tile-label, .tile:hover .tile-label { opacity: 1; }
.tile.unknown.reachable .tile-label { opacity: 1; top: 66%; border: 0; background: none; color: var(--gold-2); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }

.map-controls { position: absolute; z-index: 10; top: 12px; right: 12px; display: flex; gap: 6px; }
.map-controls button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 17px; background: #0b120ed9; color: var(--cream); font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); }
.map-controls button.square { width: 34px; padding: 0; justify-content: center; font-size: 18px; }
.map-controls button img { width: 18px; height: 18px; object-fit: contain; }
.map-controls button i { font-style: normal; font-size: 15px; }
.map-controls button:hover, .map-controls button.active { border-color: var(--gold); color: var(--gold-2); }
.map-legend { position: absolute; z-index: 10; left: 12px; bottom: 12px; display: flex; gap: 12px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px; background: #0b120ecc; color: var(--muted); font-size: 11px; pointer-events: none; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { display: inline-block; width: 12px; height: 12px; }
.legend-reach { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); background: var(--gold); }
.legend-hedge { height: 5px !important; border-radius: 3px; background: #2f6a35; }
.legend-monster { border-radius: 50%; background: #a8392c; }

.turn-banner { position: absolute; z-index: 12; left: 50%; top: 16px; display: flex; align-items: center; gap: 14px; max-width: min(560px, calc(100% - 32px)); padding: 10px 22px; border: 1px solid var(--line-strong); border-radius: 14px; background: #0b120ef2; box-shadow: var(--shadow); transform: translate(-50%, -140%); opacity: 0; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s; pointer-events: none; }
.turn-banner.show { transform: translate(-50%, 0); opacity: 1; }
.turn-banner small { display: block; color: var(--gold); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .2em; }
.turn-banner b { display: block; font: 700 22px/1.1 var(--font-display); }
.turn-banner span { display: block; margin-top: 3px; color: #c7cfc5; font-size: 12.5px; }
.turn-banner img { width: 74px; height: 70px; object-fit: contain; }
.turn-banner.phase-change { top: 30%; padding: 18px 26px; border-color: var(--gold); }
.turn-banner.phase-change b { font-size: 30px; }
.turn-banner.phase-dusk { border-color: #d06a3e; }
.turn-banner.phase-night { border-color: #6a5fc0; }

.toast { position: absolute; z-index: 13; left: 50%; bottom: 52px; max-width: calc(100% - 32px); padding: 10px 18px; border: 1px solid var(--line-strong); border-radius: 22px; background: #0b120ef2; box-shadow: var(--shadow); font-size: 13px; font-weight: 600; transform: translate(-50%, 20px); opacity: 0; transition: .3s; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.good { border-color: #6fa16f; color: #d4f0cd; }
.toast.bad { border-color: #b8483a; color: #ffd0c4; }

/* ---------- Action dock ---------- */
.action-dock { position: relative; z-index: 15; display: grid; grid-template-columns: minmax(260px, 1.1fr) minmax(0, 1.4fr) auto; align-items: center; gap: 16px; min-height: 96px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #16211b, #0f1813); border-top: 1px solid var(--line); box-shadow: 0 -8px 20px #0007; }
.location-summary { display: flex; gap: 12px; align-items: center; min-width: 0; }
.location-thumb { flex: none; display: grid; place-items: center; width: 70px; height: 64px; border-radius: 10px; background: radial-gradient(circle, #2b3a2f, #141e18); border: 1px solid var(--line); overflow: hidden; }
.location-thumb img { width: 100%; height: 100%; object-fit: contain; }
.location-thumb.monster img { object-fit: cover; object-position: 50% 22%; }
.location-thumb.monster { border-color: #b8483a88; }
.loc-fog { color: var(--gold); font: 600 32px var(--font-display); }
.location-summary small { display: block; color: var(--gold); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.location-summary b { display: block; font: 700 21px/1.15 var(--font-display); }
.location-summary p { margin: 2px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.context-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.action-button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); color: var(--cream); font-weight: 650; font-size: 13px; transition: transform .15s, background .15s, border-color .15s; }
.action-button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--gold); background: var(--panel-3); }
.action-button.primary { border-color: #f2d89266; background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; box-shadow: inset 0 1px #fff4, 0 6px 14px #0007; }
.action-button.primary:hover:not(:disabled) { filter: brightness(1.08); }
.action-button.danger { border-color: #ff9a8066; background: linear-gradient(180deg, #c4503c, #7d2a1f); color: #fff1ea; }
.action-button.ghost { background: transparent; color: var(--muted); }
.action-button:disabled { opacity: .45; transform: none; filter: grayscale(.4); }
.btn-icon { width: 22px; height: 22px; object-fit: contain; }
.action-button .cost-chip { background: #0003; }
.action-hint { color: var(--dim); font-size: 12.5px; }
.cost-chip { display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 2px; border-radius: 10px; background: #ffffff10; font-size: 12px; }
.cost-chip.short { color: #ff9a85; background: #b8483a33; }
.cost-icon { width: 18px; height: 18px; object-fit: contain; }
.turn-control { display: flex; align-items: center; gap: 14px; }
.steps { display: flex; align-items: center; gap: 10px; }
.steps b { display: block; font: 700 26px/1 var(--font-display); }
.steps small { display: block; max-width: 92px; color: var(--muted); font-size: 10.5px; line-height: 1.2; }
.step-pips { display: flex; gap: 5px; }
.step-pips i { display: grid; grid-template-rows: 1fr 1fr; gap: 2px; width: 14px; height: 34px; }
.step-pips i b { border-radius: 3px; background: var(--gold); }
.step-pips i.moved b:first-child { background: #ffffff1a; }
.step-pips i.spent b { background: #ffffff14; }
.end-turn-button { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-3); color: var(--cream); font-weight: 750; }
.end-turn-button:hover:not(:disabled) { border-color: var(--gold); }
.end-turn-button.urgent { border-color: #f2d89288; background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; animation: urgent 1.6s ease-in-out infinite; }
@keyframes urgent { 50% { box-shadow: 0 0 22px #d6ae5c88; } }
.mobile-quickbar { display: none; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; background: rgba(4, 8, 6, .72); backdrop-filter: blur(5px); animation: fade-in .2s; }
@keyframes fade-in { from { opacity: 0; } }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 36px); overflow-y: auto; border: 1px solid #a2885199; border-radius: 16px; background: var(--paper); background-image: linear-gradient(180deg, #f3ead6, #e4d8bd); color: var(--ink); box-shadow: 0 30px 90px #000, 0 0 0 5px #0b120e, 0 0 0 6px #d6ae5c44; animation: modal-in .3s cubic-bezier(.2,.8,.2,1); scrollbar-width: thin; }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-body { padding: 22px 24px 24px; }
.modal .eyebrow { color: #8a6327; }
.modal h2 { margin: 4px 0 8px; font: 700 30px/1.1 var(--font-display); color: #18201b; }
.modal .story { margin: 0 0 14px; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.modal .panel-label { margin: 16px 0 8px; color: #8a6327; }
.modal-close { display: block; width: 100%; margin-top: 18px; min-height: 46px; border: 0; border-radius: 10px; background: #1d2a22; color: var(--cream); font-weight: 700; }
.modal-close:hover { background: #26382d; }
.section-row b { font-size: 13px; }
.modal .section-row > span { color: var(--ink-2); }
.modal .empty-note { color: var(--ink-2); border-color: #0002; }
.modal .ability, .modal .gear-chip, .modal .army-unit { background: #fff7; border-color: #0001; color: var(--ink); }
.modal .ability small, .modal .gear-chip small, .modal .army-unit small { color: var(--ink-2); }
.modal .die-faces i { background: #1b231e1a; color: var(--ink); }
.modal .die-faces i.skull { background: #b8483a33; color: #8a2a1e; }
.modal .use-button { color: #6a4a12; background: #d6ae5c33; border-color: #a07a30; }
.modal .oath-list li { color: #7a847d; }
.modal .oath-list li.active { color: var(--ink); background: linear-gradient(90deg, #d6ae5c33, transparent); }
.modal .oath-list li small { color: var(--ink-2); }
.modal .oath-list li i { border-color: #0003; }

/* Battle */
.modal.combat { width: min(1000px, 100%); background: #101914; color: var(--cream); border-color: #b8483a88; }
.battle-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 560px; }
.battle-portrait { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(180deg, #0000 40%, #0b120e 96%), var(--battle-bg) center / cover no-repeat; }
.battle-portrait.boss { background: linear-gradient(180deg, #0000 30%, #0b120e 92%), var(--battle-bg) 50% 20% / cover no-repeat; }
.battle-portrait.boss .battle-enemy-art { display: none; }
.battle-enemy-art { position: absolute; left: 50%; bottom: 120px; width: 96%; max-height: 74%; object-fit: contain; object-position: bottom; transform: translateX(-50%); filter: drop-shadow(0 16px 20px #000c); animation: enemy-in .7s cubic-bezier(.2,.8,.2,1) both; }
.battle-portrait.boss .battle-enemy-art { width: 150%; max-height: 64%; bottom: 150px; }
@keyframes enemy-in { from { opacity: 0; transform: translate(-50%, 24px) scale(.96); } }
.enemy-plate { position: relative; padding: 18px 20px 20px; background: linear-gradient(180deg, transparent, #0b120ef5 30%); }
.enemy-plate .eyebrow { color: var(--red-2); }
.enemy-plate h2 { margin: 2px 0 8px; color: var(--cream); font-size: 30px; }
.enemy-strength { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.enemy-strength > span:first-child { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.enemy-strength > b { display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border: 2px solid #f6d2a0; border-radius: 23px; background: #7a1f16; font: 800 22px var(--font-ui); box-shadow: 0 0 20px #e0604a55; }
.ash-note { padding: 2px 8px; border-radius: 10px; background: #b8483a44; color: #ffb59f; font-size: 11px; font-weight: 700; }
.ash-note.good { background: #6fa16f44; color: #c9f0c0; }
.lore { margin: 10px 0 0; color: #b9c3b9; font-size: 12.5px; font-style: italic; line-height: 1.5; }
.battle-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 22px 22px; }
.modal.combat .section-row b { color: var(--cream); }
.modal.combat .section-row > span { color: var(--muted); }
.solo-note { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px dashed #ffffff22; border-radius: 10px; color: var(--muted); font-size: 12.5px; }
.guard-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.guard-token { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; border: 2px solid #e06a55; transition: .3s; }
.guard-token img { width: 100%; height: 100%; object-fit: cover; }
.guard-token.gone { filter: grayscale(1) brightness(.4); border-color: #444; }
.guard-row small { flex: 1 1 200px; color: var(--muted); font-size: 11.5px; }
.warrior-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.warrior-pick { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border: 1px solid #ffffff1f; border-radius: 22px; background: #ffffff08; text-align: left; transition: .15s; }
.warrior-pick-art { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; }
.warrior-pick b { display: block; font-size: 12px; }
.warrior-pick small { display: block; color: var(--muted); font-size: 10px; }
.warrior-pick i { font-style: normal; font-weight: 800; color: var(--muted); }
.warrior-pick.on { border-color: var(--gold); background: #d6ae5c1f; }
.warrior-pick.on i { color: var(--gold-2); }
.warrior-pick:not(.on) { opacity: .6; }
.warrior-pick:disabled { cursor: default; }

.reel-tray { position: relative; padding: 16px 12px; border: 1px solid #d6ae5c33; border-radius: 14px; background: radial-gradient(ellipse at 50% 0%, #2a3a2f, #0d1611 80%); box-shadow: inset 0 2px 18px #000a; }
.fate-reels { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.reel-result { display: grid; justify-items: center; gap: 6px; }
.fate-reel { width: 88px; display: grid; gap: 5px; justify-items: center; padding: 6px 6px 7px; border: 1px solid #a07a3055; border-radius: 12px; background: linear-gradient(180deg, #3a2b1a, #1d150d); box-shadow: inset 0 1px #ffffff14, 0 6px 14px #0009; }
.fate-reel.ready { animation: reel-in .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: var(--delay); }
@keyframes reel-in { from { opacity: 0; transform: translateY(10px); } }
.fate-reel.hero { border-color: var(--gold); background: linear-gradient(180deg, #5a4420, #241a0c); }
.fate-reel.knight { background: linear-gradient(180deg, #2c3c4a, #151d24); border-color: #6f9fc066; }
.fate-reel.archer { background: linear-gradient(180deg, #4a3620, #21180d); border-color: #c08c4a66; }
.fate-reel.mage { background: linear-gradient(180deg, #2a4430, #111f15); border-color: #7fbf8a66; }
.fate-reel.cossack { background: linear-gradient(180deg, #4a2420, #200f0d); border-color: #e06a5566; }
.reel-crown { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; }
.fate-mark { width: 18px; height: 18px; object-fit: contain; flex: none; }
.reel-crown span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; color: var(--gold-2); }
.reel-window { position: relative; width: 74px; height: 72px; overflow: hidden; border-radius: 8px; background: linear-gradient(180deg, #e9dfc6, #cbbd98); box-shadow: inset 0 3px 8px #0008; }
.reel-strip { display: flex; flex-direction: column; }
.reel-cell, .settled-symbol { height: 72px; display: flex; align-items: center; justify-content: center; gap: 0; }
.reel-symbol { width: 54px; height: 54px; object-fit: contain; }
.reel-cell .reel-symbol + .reel-symbol, .settled-symbol .reel-symbol + .reel-symbol { width: 36px; height: 36px; margin-left: -10px; }
.reel-symbol.omen { opacity: .5; }
.reel-glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, #0006, transparent 25%, transparent 75%, #0006); }
.reel-foot { font-size: 8.5px; font-weight: 800; letter-spacing: .14em; color: var(--muted); }
.fate-reel.landed { animation: land .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes land { 40% { transform: translateY(3px) scale(1.04); } }
.fate-reel.settled .reel-window { box-shadow: inset 0 3px 8px #0008, 0 0 0 2px #d6ae5c66; }
.reel-chips { display: flex; gap: 3px; }
.chip { display: grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: 12px; font-weight: 800; }
.chip.attack { background: #d6ae5c33; color: var(--gold-2); }
.chip.wound { background: #b8483a44; color: #ffb59f; }
.chip.ward { background: #6f9fc033; color: #cde6f5; text-decoration: line-through; }
.chip.loss { background: #b8483a; color: #fff; }
.chip.blank { background: #ffffff10; color: var(--muted); }
.stop-reels { display: block; margin: 12px auto 0; padding: 7px 16px; border: 1px solid var(--line-strong); border-radius: 18px; background: #0b120e; color: var(--cream); font-weight: 700; font-size: 12px; }
.stop-reels span { color: var(--muted); font-weight: 500; margin-left: 6px; }
.bonus-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bonus-row span { padding: 3px 9px; border-radius: 12px; background: #ffffff0d; color: var(--muted); font-size: 11.5px; }
.bonus-row .good { background: #6fa16f33; color: #c9f0c0; }
.power-meter { padding: 12px 14px; border: 1px solid #ffffff14; border-radius: 12px; background: #ffffff06; }
.power-head { display: flex; justify-content: space-between; align-items: baseline; }
.power-head span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.power-head b { font: 700 24px var(--font-display); }
.power-track { height: 10px; margin: 6px 0 5px; border-radius: 6px; background: #ffffff12; overflow: hidden; }
.power-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #8e6528, var(--gold-2)); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.power-meter small { color: var(--muted); font-size: 11.5px; }
.power-meter.winning { border-color: #6fa16f88; background: #6fa16f14; }
.power-meter.winning .power-track i { background: linear-gradient(90deg, #3f7a45, #9fe08f); }
.power-meter.winning small { color: #c9f0c0; font-weight: 700; }
.power-meter.short small { color: #ffb59f; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.choice { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid #ffffff1c; border-radius: 11px; background: #ffffff08; text-align: left; transition: .15s; }
.choice:hover:not(:disabled) { border-color: var(--gold); background: #d6ae5c14; }
.choice:disabled { opacity: .45; }
.choice-art { width: 34px; height: 34px; object-fit: contain; flex: none; }
.choice span { flex: 1; min-width: 0; }
.choice b { display: block; font-size: 12.5px; }
.choice small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.choice em { flex: none; font-style: normal; font-size: 11px; font-weight: 800; color: var(--gold-2); }
.spell-choice { border-color: #6f9fc055; }
.battle-cta { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 10px 18px; border: 1px solid #f2d89266; border-radius: 14px; text-align: left; transition: transform .15s, filter .15s; }
.battle-cta:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.battle-cta:disabled { opacity: .5; }
.battle-cta span { flex: 1; }
.battle-cta b { display: block; font-size: 16px; }
.battle-cta small { display: block; font-size: 11.5px; opacity: .8; }
.battle-cta i { font-style: normal; font-size: 26px; }
.battle-cta.spin { background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; box-shadow: 0 8px 20px #0008, inset 0 1px #fff5; }
.battle-cta.win { background: linear-gradient(180deg, #4f8a52, #2b5530); color: #effae9; border-color: #9fe08f66; box-shadow: 0 8px 20px #0008; }
.battle-cta.lose { background: linear-gradient(180deg, #7d3328, #4a1a14); color: #ffe8e0; border-color: #ff9a8044; }
.cta-icon { width: 34px; height: 34px; object-fit: contain; }

/* Rewards */
.loot-modal { width: min(500px, 100%); }
.reward-reveal { position: relative; display: grid; place-items: center; height: 220px; overflow: hidden; background: radial-gradient(circle at 50% 55%, #3a4b37, #101914 75%); }
.reward-rays { position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, #f2d89222 0 8deg, transparent 8deg 22deg); animation: rays 18s linear infinite; }
@keyframes rays { to { transform: rotate(360deg); } }
.loot-art { position: relative; max-width: 70%; max-height: 190px; object-fit: contain; filter: drop-shadow(0 12px 20px #000c); animation: loot-pop .6s cubic-bezier(.2,1.4,.4,1) both; }
.reward-reveal.portrait .loot-art { max-height: 210px; align-self: end; }
@keyframes loot-pop { from { opacity: 0; transform: scale(.6) rotate(-6deg); } }
.loot-status { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.loot-status.kept { background: #6fa16f26; color: #2c5a30; }
.loot-status.left { background: #b8483a1f; color: #7a2a1e; }
.swap-list { display: grid; gap: 6px; margin-bottom: 12px; }
.modal:not(.combat) .choice { background: #fff8; border-color: #0001; color: var(--ink); }
.modal:not(.combat) .choice small { color: var(--ink-2); }
.modal:not(.combat) .choice em { color: #8a6327; }
.cache-counter { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cache-counter b { font: 700 28px var(--font-display); }
.cache-counter span { color: var(--ink-2); font-size: 12px; }
.cache-picker { display: grid; gap: 6px; margin-bottom: 16px; }
.cache-resource { display: grid; grid-template-columns: 38px 42px 1fr 30px 38px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 11px; background: #fff8; }
.cache-resource button { width: 38px; height: 38px; border: 1px solid #0002; border-radius: 10px; background: #1d2a22; color: var(--cream); font-size: 20px; font-weight: 700; }
.cache-resource button:disabled { opacity: .3; }
.resource-icon { width: 38px; height: 38px; object-fit: contain; }
.cache-resource b { display: block; text-transform: capitalize; }
.cache-resource small { color: var(--ink-2); font-size: 11px; }
.cache-resource strong { font: 700 24px var(--font-display); text-align: center; }

/* City */
.city-modal { width: min(820px, 100%); }
.city-hero { position: relative; height: 200px; overflow: hidden; background: #2b3a2f; }
.city-hero img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.city-hero:after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, #0b120ee0); }
.city-hero-copy { position: absolute; z-index: 1; left: 24px; bottom: 14px; }
.city-hero-copy .eyebrow { color: var(--gold-2); }
.city-hero-copy h2 { color: var(--cream); margin: 0; font-size: 34px; }
.city-supplies { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.city-supplies > div { display: flex; align-items: center; gap: 6px; padding: 4px 12px 4px 6px; border-radius: 20px; background: #fff8; }
.city-supplies .resource-icon { width: 28px; height: 28px; }
.city-supplies small { display: block; color: var(--ink-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.city-supplies b { font: 700 18px/1 var(--font-display); }
.city-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid #0002; border-radius: 12px; background: #1d2a22; color: var(--cream); text-align: left; transition: .15s; }
.tab:hover:not(:disabled) { background: #26382d; }
.tab b { display: block; font-size: 14px; }
.tab small { display: block; color: var(--muted); font-size: 11px; }
.tab.active { background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; border-color: #8e6528; opacity: 1; }
.tab.active small { color: #3a2a10; }
.tab:disabled:not(.active) { opacity: .45; }
.tab-icon { width: 30px; height: 30px; object-fit: contain; }
.city-hint { margin: 10px 2px 12px; color: var(--ink-2); font-size: 12.5px; }
.building-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-bottom: 18px; }
.building { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #0001; border-radius: 12px; background: #fff7; color: var(--ink); text-align: left; transition: .15s; }
.building:disabled { cursor: default; }
.building.available { border-color: #a07a30; background: #fffbe9; box-shadow: 0 0 0 2px #d6ae5c55; cursor: pointer; }
.building.available:hover { transform: translateY(-1px); }
.building.built { background: #6fa16f22; border-color: #6fa16f66; }
.building:not(.built):not(.available) { opacity: .7; }
.building-icon { width: 42px; height: 42px; object-fit: contain; flex: none; }
.building-copy { flex: 1; min-width: 0; }
.building-copy b { display: block; font-size: 13.5px; }
.building-copy small { display: block; color: var(--ink-2); font-size: 11px; line-height: 1.35; }
.building-cost { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.modal .cost-chip { background: #1b231e14; color: var(--ink); }
.modal .cost-chip.short { background: #b8483a26; color: #8a2a1e; }
.built-tag { font-style: normal; font-size: 11px; font-weight: 800; color: #2c5a30; }
.recruit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.recruit-card { position: relative; display: grid; grid-template-rows: 150px auto auto; gap: 6px; padding: 0 0 10px; overflow: hidden; border: 1px solid #0001; border-radius: 12px; background: #1d2a22; color: var(--cream); text-align: left; transition: .15s; }
.recruit-card:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 0 0 2px var(--gold); }
.recruit-card:disabled { cursor: default; }
.recruit-card.locked { filter: grayscale(.8); opacity: .65; }
.recruit-character { width: 100%; height: 150px; object-fit: cover; object-position: 50% 8%; background: linear-gradient(180deg, #3a4a40, #1d2a22); }
.recruit-copy { padding: 0 10px; }
.recruit-copy b { display: block; font-size: 14px; }
.recruit-copy small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.recruit-cost { display: inline-flex; margin-top: 5px; }
.recruit-card .cost-chip { background: #ffffff14; color: var(--cream); }
.recruit-card .die-faces { padding: 0 10px; }
.recruit-card .die-faces i { background: #ffffff1a; color: var(--cream); }
.recruit-card .die-faces i.skull { background: #b8483a88; color: #fff; }

/* Sheets, help, result */
.sheet { width: min(520px, 100%); }
.sheet-hero { height: 220px; overflow: hidden; background: radial-gradient(circle at 50% 70%, #3a4b37, #101914); }
.sheet-character { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }
.sheet-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sheet-stats span { display: grid; justify-items: center; padding: 8px 4px; border-radius: 10px; background: #fff7; text-align: center; }
.sheet-stats b { font: 700 20px var(--font-display); }
.sheet-stats small { color: var(--ink-2); font-size: 10px; text-transform: uppercase; }
.sheet-resources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.sheet-resources span { display: grid; justify-items: center; padding: 8px; border-radius: 10px; background: #fff7; }
.sheet-resources b { font: 700 22px var(--font-display); }
.sheet-resources small { color: var(--ink-2); font-size: 10.5px; text-transform: capitalize; }
.soul-summary { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 14px; border-radius: 10px; background: #6f9fc022; }
.soul-summary b { display: block; }
.soul-summary small { color: var(--ink-2); font-size: 11px; }
.modal .journal-list.full { max-height: 55vh; }
.modal .journal-entry { color: var(--ink-2); }
.modal .journal-entry.latest { color: var(--ink); font-weight: 600; }
.help-modal { width: min(820px, 100%); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.help-card { position: relative; padding: 12px 12px 12px 46px; border-radius: 12px; background: #fff8; }
.help-card i { position: absolute; left: 12px; top: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #1d2a22; color: var(--gold-2); font-style: normal; font-weight: 800; font-size: 12px; }
.help-card b { display: block; margin-bottom: 3px; font-size: 14px; }
.help-card span { display: block; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.help-keys { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; color: var(--ink-2); font-size: 12px; }
.help-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.help-actions .modal-close { flex: 1 1 200px; }
.text-button { margin-top: 18px; padding: 8px 4px; border: 0; background: none; color: var(--ink-2); font-size: 12.5px; text-decoration: underline; }
.text-button.danger { color: #8a2a1e; }
.result-modal { width: min(620px, 100%); }
.result-hero { display: grid; place-items: center; height: 230px; overflow: hidden; }
.result-hero.won { background: radial-gradient(circle at 50% 60%, #f2d89288, #3a4b37 55%, #101914); }
.result-hero.lost { background: radial-gradient(circle at 50% 60%, #6a5fc055, #101320 70%); }
.result-art { max-height: 210px; max-width: 80%; object-fit: contain; filter: drop-shadow(0 12px 22px #000c); animation: loot-pop .8s cubic-bezier(.2,1.4,.4,1) both; }
.star-row { display: flex; gap: 6px; margin: 4px 0 14px; }
.star-row i { font-style: normal; font-size: 34px; color: #0002; }
.star-row i.on { color: #c99a45; text-shadow: 0 2px 8px #c99a4588; animation: loot-pop .6s cubic-bezier(.2,1.4,.4,1) both; }
.star-row i.on:nth-child(2) { animation-delay: .15s; }
.star-row i.on:nth-child(3) { animation-delay: .3s; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 16px; }
.result-stats div { padding: 8px 10px; border-radius: 10px; background: #fff7; }
.result-stats small { display: block; color: var(--ink-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; }
.result-stats b { font: 700 22px var(--font-display); }
.result-stats em { display: block; font-style: normal; font-size: 10.5px; font-weight: 800; color: #8a6327; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .game-layout { grid-template-columns: 250px minmax(0, 1fr) 236px; }
  .top-stats .hearts { display: none; }
  .map-legend { display: none; }
}
@media (max-width: 980px) {
  .game-screen { grid-template-rows: 56px minmax(0, 1fr) auto; }
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .side-panel { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; padding: 0 10px; }
  .brand-lockup div, .top-stats { display: none; }
  .phase-line span#phase-turns { display: none; }
  .mobile-hud { display: flex; gap: 6px; }
  .mobile-hud span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; font-weight: 700; }
  .mobile-hud img { width: 16px; height: 16px; object-fit: contain; }
  .action-dock { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "loc turn" "actions actions" "quick quick"; gap: 10px; padding: 10px 10px calc(8px + env(safe-area-inset-bottom)); }
  .location-summary { grid-area: loc; }
  .context-actions { grid-area: actions; justify-content: stretch; }
  .context-actions .action-button { flex: 1 1 140px; justify-content: center; }
  .turn-control { grid-area: turn; gap: 8px; }
  .steps small { display: none; }
  .end-turn-button kbd { display: none; }
  .mobile-quickbar { grid-area: quick; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .mobile-quickbar button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 38px; padding: 0 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); font-size: 12px; font-weight: 650; }
  .mobile-quickbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-quickbar img { width: 20px; height: 20px; object-fit: contain; }
  .location-thumb { width: 52px; height: 48px; }
  .location-summary b { font-size: 18px; }
  .location-summary p { -webkit-line-clamp: 1; }
  .battle-layout { grid-template-columns: 1fr; min-height: 0; }
  .battle-portrait { min-height: 300px; }
  .battle-enemy-art { bottom: 90px; max-height: 70%; width: 70%; }
  .battle-portrait.boss .battle-enemy-art { width: 120%; bottom: 100px; }
  .start-screen { grid-template-columns: 1fr; }
  .start-panel { background: linear-gradient(180deg, rgba(11,18,14,.55), rgba(11,18,14,.94) 40%); justify-content: flex-end; }
  .start-guardian { right: -12%; height: 70%; bottom: 30%; opacity: .75; }
  .start-zmey { width: 130vw; right: -40%; }
}
@media (max-width: 620px) {
  .topbar > .brand-lockup { display: none; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .topbar-actions .language-button, .topbar-actions .icon-button { min-width: 32px; height: 32px; }
  .mobile-quickbar button { flex-direction: column; gap: 1px; min-height: 44px; font-size: 10.5px; }
  .location-summary b { font-size: 16px; }
  .location-summary p { display: none; }
  .phase-line b { font-size: 15px; }
  .phase-ash { display: none; }
  .map-controls button span { display: none; }
  .map-controls button { padding: 0 9px; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100% !important; max-height: 94dvh; border-radius: 18px 18px 0 0; }
  .modal-body { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .battle-body { padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); }
  .battle-portrait { min-height: 330px; }
  .battle-enemy-art { bottom: 70px; max-height: 78%; width: 80%; }
  .enemy-plate { padding: 12px 16px 14px; }
  .enemy-plate h2 { font-size: 26px; margin-bottom: 4px; }
  .lore { display: none; }
  .fate-reel { width: 76px; }
  .reel-window { width: 64px; height: 64px; }
  .reel-cell, .settled-symbol { height: 64px; }
  .reel-symbol { width: 46px; height: 46px; }
  .recruit-grid { grid-template-columns: 1fr; }
  .recruit-card { grid-template-columns: 96px 1fr; grid-template-rows: auto auto; padding: 0; }
  .recruit-character { grid-row: span 2; height: 100%; min-height: 110px; }
  .recruit-copy { padding: 10px 10px 0 0; }
  .recruit-card .die-faces { padding: 0 10px 10px 0; }
  .result-stats { grid-template-columns: 1fr 1fr; }
  .result-actions { grid-template-columns: 1fr; }
  .sheet-stats { grid-template-columns: repeat(2, 1fr); }
  .start-panel h1 { font-size: 70px; }
  .intro { font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============================================================
   Art pass — delivered graphics (tokens, hex tiles, reels, UI kit)
   ============================================================ */

/* Start screen: key art + sealed guardians */
.start-zmey { object-position: 100% 35%; opacity: .9; filter: none; -webkit-mask-image: linear-gradient(90deg, transparent 14%, #000 52%); mask-image: linear-gradient(90deg, transparent 14%, #000 52%); }
.start-sun { display: none; }
.start-guardian { display: none; }
.guardian-choice.locked img { filter: saturate(.85); object-position: 50% 50%; border-color: #5b4a30; }
.guardian-choice.locked:after { content: none; }
.guardian-choice.locked:hover img { filter: none; }

/* Map surface */
.map-backdrop { background: radial-gradient(ellipse at 50% 45%, #0000 30%, #050906cc 100%), url("assets/graphics/textures/war-table.webp") center / 512px repeat, #172219; }
.map-backdrop:after { opacity: .25; }
.tile.unknown .hex-fill { background: #1a241e; }
.fog-img { opacity: .42; filter: saturate(.6) brightness(.75); }
.tile.unknown.reachable .fog-img { opacity: .85; filter: none; }
.tile.unknown.reachable .hex-fill { background: #2a3a2c; }
.fog-mark { z-index: 1; text-shadow: 0 2px 6px #000c; }
.tile.unknown.reachable .fog-mark { color: #fff3cf; }

/* Tokens: the art already carries its own carved medallion */
.hero-token { width: 66px; height: 66px; padding: 0; border-radius: 50%; background: none; box-shadow: 0 0 0 3px var(--gold-2), 0 8px 14px #000b; }
.hero-token img, .monster-token img, .city-token img { object-fit: contain; object-position: center; background: none; }
.monster-token { width: 66px; height: 66px; padding: 0; background: none; box-shadow: 0 0 0 2px #e06a55cc, 0 8px 14px #000b; }
.monster-token.boss { width: 88px; height: 88px; background: none; box-shadow: 0 0 0 3px #ffb070, 0 8px 18px #000c; }
.city-token { width: 50px; height: 50px; padding: 0; background: none; box-shadow: 0 4px 10px #000a; }
.city-token.stage-2 { width: 56px; height: 56px; }
.city-token.stage-3 { width: 62px; height: 62px; box-shadow: 0 0 16px #f2d892aa, 0 4px 10px #000a; }
.tile.current.hostile .hero-token { width: 48px; height: 48px; }
.location-thumb.monster img { object-fit: contain; object-position: center; }

/* Buildings in the city */
.building-art { width: 96px; height: 64px; flex: none; object-fit: contain; filter: drop-shadow(0 4px 4px #0004); transition: transform .2s; }
.building.available:hover .building-art { transform: scale(1.06); }

/* Spoils plate in battle */
.spoils { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.spoils-art { display: flex; }
.spoils-art img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 4px #000a); }
.spoils-art img + img { margin-left: -16px; }
.spoils small { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }
.spoils b { display: block; color: var(--gold-2); font-size: 13px; text-transform: capitalize; }

/* Wayside find toast */
.toast.has-art { display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 8px; }
.toast-art { width: 48px; height: 45px; object-fit: contain; }

/* Turn banner phase vignettes */
.turn-banner.phase-change img { width: 110px; height: 103px; }

/* Defeat illustration */
.result-hero.lost { height: 260px; background: #101320; }
.result-hero.lost .result-art { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; animation: fade-in 1s both; }

@media (max-width: 620px) {
  .start-zmey { width: 100%; right: auto; object-position: 50% 30%; opacity: .7; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 85%); mask-image: linear-gradient(180deg, #000 30%, transparent 85%); }
  .building-art { width: 72px; height: 48px; }
}
@media (max-width: 980px) { .battle-portrait.boss .battle-enemy-art { width: 92%; bottom: 80px; } }

/* Guardians drawn from portraits (no dedicated token art yet) and rival guardians */
.token.portrait img { object-fit: cover; object-position: 50% 10%; background: #1b2620; }
.rival-token { left: calc(70% + var(--i) * 14px); top: 66%; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 0 2px #8fb7e0, 0 5px 10px #000b; z-index: 6; }

/* ============================================================
   Online: lobby, sign-in, tables, rivals
   ============================================================ */
.online-button { border-color: #6f9fc066; }
.online-button b::before { content: "⚔ "; color: var(--blue); }
.online-button.offline { display: none; }

.lobby-screen { position: relative; height: 100dvh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; background: radial-gradient(ellipse at 70% 0%, #2a3a2c 0%, #121b16 55%, #0b120e 100%); }
.lobby-top { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #0f1813; }
.lobby-title { font: 700 22px var(--font-display); color: var(--cream); }
.lobby-spacer { flex: 1; }
.lobby-user { color: var(--gold-2); font-weight: 700; font-size: 13px; }
.text-button { padding: 6px 8px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 600; }
.text-button:hover { color: var(--cream); }

.auth-panel { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { display: grid; gap: 12px; width: min(400px, 100%); padding: 24px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: #0b120e; }
.auth-tabs button { padding: 9px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 700; }
.auth-tabs button.active { background: var(--panel-3); color: var(--gold-2); }
.auth-card label, .create-room label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.auth-card input, .create-room input, .create-room select, .chat-form input, .invite-row input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 9px; background: #0b120e; color: var(--cream); font: 500 14px var(--font-ui); }
.auth-card input:focus, .create-room input:focus, .chat-form input:focus { outline: 2px solid #d6ae5c66; border-color: var(--gold); }
.auth-hint { margin: 0; color: var(--dim); font-size: 11.5px; }
.auth-error { min-height: 18px; margin: 0; color: var(--red-2); font-size: 12.5px; font-weight: 600; }
.auth-submit { justify-content: space-between; }

.lobby-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(240px, .8fr); gap: 14px; padding: 16px; align-items: start; }
.lobby-main:has(.lobby-room.hidden) { grid-template-columns: minmax(0, 1.6fr) minmax(240px, .8fr); }
.lobby-card { display: grid; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.lobby-card h2 { margin: 0; font: 700 28px var(--font-display); color: var(--cream); }
.room-list { display: grid; gap: 8px; }
.room-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.room-row b { display: block; color: var(--cream); }
.room-row small, .room-seats { display: block; color: var(--muted); font-size: 11.5px; }
.room-seats { color: var(--dim); }
.room-count { color: var(--gold-2); font-weight: 800; }
.create-room { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.create-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.create-room .primary-button, .room-actions .primary-button { justify-content: space-between; padding: 12px 18px; }

.seat-list { display: grid; gap: 6px; }
.seat { display: grid; grid-template-columns: 44px 1fr auto auto; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.seat img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; }
.seat b { display: block; color: var(--cream); }
.seat small { color: var(--muted); font-size: 11.5px; }
.seat em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.seat.ready em { color: var(--green); }
.seat.empty { grid-template-columns: 1fr; min-height: 58px; border-style: dashed; background: none; }
.room-guardians { display: flex; flex-wrap: wrap; gap: 8px; }
.room-guardians .guardian-choice.locked img { filter: grayscale(.9) brightness(.5); }
.room-abilities { display: grid; gap: 6px; }
.room-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-hint { margin: 0; color: var(--muted); font-size: 12px; }
.room-invite { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.room-invite .panel-label { margin: 0; }
.invite-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.invite-row input { min-width: 0; color: var(--muted); font-size: 12px; padding: 8px 10px; }
.invite-row button { padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-3); color: var(--cream); font-weight: 700; }

.online-list { display: flex; flex-wrap: wrap; gap: 6px; }
.online-list > span { padding: 3px 9px; border-radius: 12px; background: var(--panel-3); color: var(--cream); font-size: 12px; }
.online-list > span::before { content: "●"; margin-right: 5px; color: var(--green); font-size: 9px; }
.chat-log { display: grid; align-content: start; gap: 5px; max-height: 220px; min-height: 80px; overflow-y: auto; padding: 8px 10px; border-radius: 10px; background: #0b120e; font-size: 12.5px; color: #c3cbc1; }
.chat-log b { color: var(--gold-2); }
.chat-log .empty, .leaderboard .empty { color: var(--dim); }
.leaderboard .empty { list-style: none; margin-left: -22px; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.chat-form button { padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-3); color: var(--cream); font-weight: 700; }
.leaderboard { margin: 0; padding-left: 22px; display: grid; gap: 4px; color: var(--cream); font-size: 13px; }
.leaderboard b { margin-left: 8px; color: var(--gold-2); }
.leaderboard small { color: var(--dim); }
.lobby-toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; padding: 10px 18px; border: 1px solid #b8483a; border-radius: 20px; background: #0b120ef2; color: #ffd0c4; font-weight: 600; font-size: 13px; transform: translate(-50%, 20px); opacity: 0; transition: .3s; pointer-events: none; }
.lobby-toast.show { transform: translate(-50%, 0); opacity: 1; }

/* In a match */
.online-turn { padding: 2px 9px; border-radius: 10px; background: #6f9fc022; color: #b9d4ee; font-size: 11px; font-weight: 800; white-space: nowrap; }
.online-turn.mine { background: #d6ae5c33; color: var(--gold-2); animation: urgent 1.6s ease-in-out infinite; }
.online-turn.late { background: #b8483a44; color: #ffd0c4; }
.rivals-section { border-bottom: 1px solid var(--line); }
.rival-list { display: grid; gap: 6px; }
.rival { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 4px 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.rival img { width: 34px; height: 34px; border-radius: 50%; object-fit: contain; grid-row: span 2; }
.rival img.portrait { object-fit: cover; object-position: 50% 10%; }
.rival b { display: block; color: var(--cream); font-size: 12.5px; }
.rival small { color: var(--muted); font-size: 10.5px; }
.rival-stats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; color: #c3cbc1; }
.rival-stats i { font-style: normal; }
.rival.active { border-color: var(--gold); box-shadow: 0 0 0 1px #d6ae5c55; }
.rival.me b::after { content: " (you)"; color: var(--gold); font-weight: 600; }
.rival.gone { opacity: .45; }
.match-feed { display: grid; gap: 4px; max-height: 180px; margin-top: 8px; overflow-y: auto; font-size: 11.5px; color: #aeb8b0; }
.match-feed.full { max-height: 40vh; color: var(--ink-2); }
.match-feed b { color: var(--gold-2); }
.modal .match-feed b { color: #8a6327; }
.match-feed .chat { color: var(--cream); }
.modal .match-feed .chat { color: var(--ink); }
.rivals-section .chat-form { margin-top: 8px; }
.rivals-section .chat-form input { padding: 7px 9px; font-size: 12px; }
.action-hint.waiting { color: #b9d4ee; }
.modal .rival { background: #fff7; border-color: #0001; }
.modal .rival b { color: var(--ink); }
.modal .rival small, .modal .rival-stats { color: var(--ink-2); }
.result-body h2 span { display: block; font-size: 18px; color: var(--ink-2); }
.result-ranking { display: grid; gap: 6px; margin: 4px 0 12px; }
.result-ranking > div { display: grid; grid-template-columns: 22px 38px 1fr auto; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: #fff7; }
.result-ranking > div.winner { background: #d6ae5c44; }
.result-ranking i { font-style: normal; font-weight: 800; color: #8a6327; }
.result-ranking img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; }
.result-ranking b { display: block; }
.result-ranking small { color: var(--ink-2); font-size: 11px; }
.result-ranking strong { font: 700 22px var(--font-display); }

@media (max-width: 980px) {
  .lobby-main, .lobby-main:has(.lobby-room.hidden) { grid-template-columns: 1fr; }
  .lobby-room { order: -1; }
}
@media (max-width: 620px) {
  .lobby-top { flex-wrap: wrap; padding: 10px 12px; }
  .lobby-main { padding: 10px; }
  .create-grid { grid-template-columns: 1fr 1fr; }
  .room-row { grid-template-columns: 1fr auto; }
  .room-row .room-count { display: none; }
}

/* ---------- Map borders, city land and labels ---------- */
.border-strip { position: absolute; transform-origin: 50% 50%; }
.border-strip img { position: relative; display: block; width: 100%; height: 100%; filter: drop-shadow(0 0 1px #f2d892cc) drop-shadow(0 2px 2px #000c); }
.border-strip.forest:before { content: ""; position: absolute; left: 3%; right: 3%; top: 55%; bottom: 0; border-radius: 50% 50% 0 0; background: #0a1a0bcc; }
.legend-ridge { height: 6px !important; border-radius: 1px; background: linear-gradient(90deg, #8e8b84, #f4f1e8 50%, #7d7a73); clip-path: polygon(0 100%, 20% 0, 40% 100%, 60% 10%, 80% 100%, 100% 30%, 100% 100%); }
.tile.city .hex-fill { background: radial-gradient(circle at 50% 55%, #6d7a45, #3f4a2a 75%); }
.tile.own-city .hex-shape { background: var(--gold-2); }
.tile.rival-city .hex-shape { background: #8fb7e0; }
.label-layer { position: absolute; left: 0; top: 0; z-index: 40; pointer-events: none; }
.label-layer .tile-label { top: auto; transform: translate(-50%, 0); opacity: 0; z-index: auto; }
.label-layer .tile-label.show, .label-layer .tile-label.hover { opacity: 1; }
.explore-label { position: absolute; z-index: 8; left: 50%; top: 66%; transform: translateX(-50%); color: #fff3cf; font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 1px 4px #000; pointer-events: none; }

/* ---------- Steps and turn ---------- */
.step-pips { gap: 6px; }
.step-pips i { position: relative; display: grid; grid-template-rows: none; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3b4a36, #16201a 70%); box-shadow: inset 0 0 0 2px var(--gold), 0 0 12px #d6ae5c55, 0 3px 6px #0008; transition: transform .2s, box-shadow .2s, filter .2s; }
.step-pips i .pip-icon { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 2px #000a); }
.step-pips i.ready { animation: pip-glow 2.4s ease-in-out infinite; }
.step-pips i.moved { box-shadow: inset 0 0 0 2px #8fd0e8, 0 0 12px #8fd0e866, 0 3px 6px #0008; background: radial-gradient(circle at 50% 35%, #2e4652, #121d22 70%); }
.step-pips i.spent { box-shadow: inset 0 0 0 2px #ffffff22; background: #121a15; filter: grayscale(1) brightness(.55); transform: scale(.86); }
@keyframes pip-glow { 50% { box-shadow: inset 0 0 0 2px var(--gold-2), 0 0 18px #f2d892aa, 0 3px 6px #0008; } }
.end-turn-button { --turn-a: #c99a45; --turn-b: #6e4b1c; gap: 8px; padding: 0 16px 0 10px; border-color: color-mix(in srgb, var(--turn-a) 60%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--turn-a) 28%, #16211b), #121a15); }
.end-turn-button .turn-icon { width: 30px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 3px #000a); transition: transform .4s; }
.end-turn-button:hover:not(:disabled) .turn-icon { transform: rotate(-25deg) scale(1.08); }
.end-turn-button.urgent { background: linear-gradient(180deg, var(--turn-a), var(--turn-b)); color: #1b1408; }
body[data-phase="day"] .end-turn-button { --turn-a: #e8c766; --turn-b: #8a6a22; }
body[data-phase="dusk"] .end-turn-button { --turn-a: #d06a3e; --turn-b: #6e2a17; }
body[data-phase="night"] .end-turn-button { --turn-a: #8a7ee0; --turn-b: #3a2f78; }
body[data-phase="night"] .end-turn-button.urgent, body[data-phase="dusk"] .end-turn-button.urgent { color: #fff3e6; }

/* ---------- Logo ---------- */
img.brand-mark { padding: 0; object-fit: cover; background: none; }

/* ---------- Phone top bar: phase name and chips on one row, the 24-turn track as a full-width strip below ---------- */
@media (max-width: 620px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 0 10px 6px; }
  .phase-block { position: static; max-width: none; }
  .phase-line { margin: 0; align-items: center; gap: 8px; }
  .phase-line b { font-size: 17px; }
  .phase-track { position: absolute; left: 10px; right: 10px; bottom: 5px; gap: 1px; }
  .phase-track i { height: 4px; border-radius: 1px; }
  .phase-track i:nth-child(6n) { margin-right: 4px; }
  .phase-track i:last-child { margin-right: 0; }
  .phase-track i.now { transform: scaleY(1.6); }
  .mobile-hud span { height: 30px; padding: 0 9px; background: #0b120e99; font-size: 13px; }
  .mobile-hud img { width: 18px; height: 18px; }
  .step-pips { gap: 4px; }
  .step-pips i { width: 30px; height: 30px; }
  .step-pips i .pip-icon { width: 22px; height: 22px; }
  .steps > div { display: none; }
  .turn-control { gap: 6px; }
  .location-summary { min-width: 0; }
  .end-turn-button { min-height: 42px; padding: 0 10px 0 6px; font-size: 13.5px; }
  .end-turn-button .turn-icon { width: 26px; height: 26px; }
}
.yield-row { bottom: 22px; }

/* ---------- Telegram sign-in ---------- */
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; }
.auth-or:before, .auth-or:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.telegram-button { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border-radius: 10px; background: #2aabee; color: #fff; font-weight: 700; text-decoration: none; transition: filter .2s; }
.telegram-button:hover { filter: brightness(1.08); }
.telegram-button[aria-disabled="true"] { pointer-events: none; opacity: .6; }
.telegram-button svg { width: 22px; height: 22px; }
.telegram-hint { text-align: center; }
.city-hero { background: radial-gradient(ellipse at 50% 60%, #3a4b37, #101914 75%); }
.city-hero img.city-hero-tile { width: auto; height: 118%; margin: -9% auto 0; display: block; object-fit: contain; filter: drop-shadow(0 8px 12px #000a); }

/* ---------- Start screen: guardian showcase ---------- */
.guardian-showcase { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: end; margin: 10px 0 12px; padding: 12px 14px 0; border: 1px solid var(--line-strong); border-radius: 16px; background: linear-gradient(180deg, #1c2a21cc, #0f1813ee); box-shadow: inset 0 1px 0 #f2d89222; }
.showcase-figure { position: relative; height: 250px; overflow: hidden; }
.showcase-figure:before { content: ""; position: absolute; left: 6%; right: 6%; bottom: 0; height: 78%; border-radius: 70px 70px 0 0; background: radial-gradient(ellipse at 50% 30%, #d6ae5c44, #d6ae5c08 70%); border: 1px solid #d6ae5c55; border-bottom: 0; }
.showcase-figure img { position: relative; display: block; height: 112%; margin-bottom: -6% !important; margin: 0 auto; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 12px #000a); animation: guardian-rise .5s cubic-bezier(.2,.8,.2,1) both; }
.showcase-copy { padding-bottom: 14px; }
.showcase-copy small { color: var(--gold); font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.showcase-copy b { display: block; margin: 2px 0 6px; font: 700 30px/1 var(--font-display); color: var(--cream); }
.showcase-copy .guardian-note { min-height: 0; margin-bottom: 10px; }
.showcase-abilities { display: flex; flex-wrap: wrap; gap: 6px; }
.showcase-abilities span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border: 1px solid var(--line); border-radius: 14px; background: #0b120e99; color: var(--cream); font-size: 11.5px; font-weight: 600; }
.showcase-icon { width: 20px; height: 20px; object-fit: contain; }
.start-screen .guardian-choice img { width: 56px; height: 56px; border: 0; border-radius: 50%; object-fit: contain; object-position: center; background: none; box-shadow: 0 3px 8px #0008; }
.start-screen .guardian-choice.selected img { box-shadow: 0 0 0 3px var(--gold), 0 0 16px #d6ae5c88; }
.seed-toggle { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--panel-2); color: var(--gold-2); font-size: 12px; font-weight: 700; }
.seed-row { align-items: center; }
@media (max-width: 620px) {
  .guardian-showcase { grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 10px 10px 0; }
  .showcase-figure { height: 170px; }
  .showcase-copy b { font-size: 24px; }
  .start-screen .guardian-choice { width: 50px; }
  .start-screen .guardian-choice img { width: 46px; height: 46px; }
}

/* ---------- Guardian medallions: the art is its own frame, so no ring or circular crop ---------- */
.token img, .seat img, .rival img, .result-ranking img, .guardian-choice img { border-radius: 0; object-fit: contain; object-position: center; background: none; }
.hero-token { padding: 0; border-radius: 0; background: none; box-shadow: none; filter: drop-shadow(0 0 6px #f2d892aa) drop-shadow(0 7px 8px #000c); }
.hero-token:before { content: ""; position: absolute; left: 50%; bottom: -6px; z-index: -1; width: 86%; height: 18%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, #f2d89299, #f2d89200 70%); }
.monster-token { box-shadow: none; filter: drop-shadow(0 0 5px #e06a55cc) drop-shadow(0 7px 8px #000c); }
.monster-token.boss { box-shadow: none; filter: drop-shadow(0 0 8px #ffb070) drop-shadow(0 8px 10px #000c); }
.rival-token { border-radius: 0; box-shadow: none; filter: drop-shadow(0 0 4px #8fb7e0) drop-shadow(0 4px 6px #000b); }
.token.portrait img { object-fit: cover; border-radius: 50%; }
.guardian-choice img { border: 0; box-shadow: none; filter: drop-shadow(0 3px 5px #0009); transition: transform .2s, filter .2s; }
.start-screen .guardian-choice img { box-shadow: none; }
.guardian-choice.selected img, .start-screen .guardian-choice.selected img { box-shadow: none; transform: translateY(-3px) scale(1.08); filter: drop-shadow(0 0 7px #f2d892) drop-shadow(0 5px 6px #000a); }
.guardian-choice.selected span { position: relative; }
.guardian-choice.selected span:after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 18px; height: 2px; border-radius: 2px; transform: translateX(-50%); background: var(--gold); }

/* ---------- Game menu ---------- */
.menu-button { display: inline-grid; align-content: center; justify-items: center; gap: 3px; }
.menu-button i { display: block; width: 14px; height: 2px; border-radius: 2px; background: var(--gold-2); }
.menu-actions { display: grid; gap: 8px; margin-top: 12px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-2); color: var(--cream); text-align: left; }
.menu-item:hover { border-color: var(--gold); background: var(--panel-3); }
.menu-item b { display: block; font-size: 15px; }
.menu-item small { display: block; color: var(--muted); font-size: 12px; }
.menu-item.danger { border-color: #b8483a66; }
.menu-item.danger b { color: #ff9a85; }
.menu-icon { width: 34px; height: 34px; object-fit: contain; flex: none; }
/* The whole figure always fits its frame, head to boots. */
.showcase-figure img { width: 100%; height: 100%; margin: 0 !important; object-fit: contain; object-position: 50% 100%; }
.showcase-figure { height: 260px; padding-top: 6px; }
@media (max-width: 620px) {
  .guardian-showcase { grid-template-columns: 118px minmax(0, 1fr); align-items: stretch; }
  .showcase-figure { height: auto; min-height: 210px; }
  .showcase-copy { align-self: end; }
}

/* ---------- City: army and recruiting ---------- */
.army-bar { margin: 14px 0 10px; padding: 10px 12px; border: 1px solid #0002; border-radius: 12px; background: #1d2a22; color: var(--cream); }
.army-bar-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 8px; }
.army-bar-head b { font: 700 16px var(--font-display); color: var(--gold-2); }
.army-bar-head span { color: var(--muted); font-size: 12px; }
.army-slots { display: flex; flex-wrap: wrap; gap: 6px; }
.army-slot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.army-slot.filled { background: radial-gradient(circle at 50% 40%, #3a4b37, #16201a); box-shadow: inset 0 0 0 1px var(--gold); }
.army-slot.open { border: 1px dashed #d6ae5c88; }
.army-slot.closed { border: 1px dashed #ffffff22; opacity: .5; }
.army-slot-icon { width: 32px; height: 32px; object-fit: contain; }
.recruit-card { grid-template-rows: 150px auto auto auto; }
.recruit-owned { position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: 10px; background: #0b120ee6; color: var(--gold-2); font-style: normal; font-weight: 800; font-size: 12px; }
.recruit-cost { flex-wrap: wrap; align-items: center; gap: 6px; }
.recruit-needs { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; }
.needs-icon { width: 18px; height: 18px; object-fit: contain; }
.recruit-status { margin: 0 10px; padding: 7px 8px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: center; }
.recruit-card.ready .recruit-status { background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; }
.recruit-card.ready { box-shadow: 0 0 0 2px var(--gold); }
.recruit-card.idle .recruit-status { background: #ffffff12; color: var(--gold-2); }
.recruit-card.short .recruit-status, .recruit-card.full .recruit-status { background: #b8483a33; color: #ffb4a3; }
.recruit-card.locked .recruit-status { background: #ffffff0d; color: var(--muted); }
.recruit-card.locked { filter: grayscale(.85); opacity: .7; }
.recruit-card.full, .recruit-card.short { opacity: .85; }
@media (max-width: 980px) {
  .recruit-card { grid-template-rows: auto auto auto; }
  .recruit-status { grid-column: 2; margin: 0 10px 10px 0; }
}

/* ---------- Online: header and table ---------- */
.lobby-top { position: sticky; top: 0; z-index: 10; gap: 12px; min-height: 60px; padding: 8px max(16px, calc((100% - 1280px) / 2)); background: linear-gradient(180deg, #16211b, #0f1813); box-shadow: 0 6px 18px #0007; }
.lobby-top .brand-mark { width: 40px; height: 40px; }
.lobby-heading { display: grid; line-height: 1.15; }
.lobby-heading small { color: var(--muted); font-size: 11.5px; }
.lobby-back { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-2); color: var(--gold-2); font-weight: 700; font-size: 13px; }
.lobby-back:hover, .lobby-signout:hover { border-color: var(--gold); }
.lobby-user { display: inline-flex; align-items: center; gap: 8px; }
.lobby-user:not(:empty):before { content: "●"; color: var(--green); font-size: 9px; }
.lobby-signout { height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 17px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.lobby-main { width: 100%; max-width: 1312px; margin: 0 auto; gap: 16px; }
.lobby-card { gap: 14px; padding: 18px; }
.lobby-card .panel-label { margin: 0; }
.lobby-card .section-row { margin: 0; }
.seat-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.seat { min-height: 58px; }
.seat.empty { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px 12px; color: var(--dim); }
.seat.empty i { width: 36px; height: 36px; border: 1px dashed #ffffff26; border-radius: 50%; }
.room-guardian-card { display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0b120e66; }
.room-guardian-pick { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: end; }
.room-guardian-art { width: 96px; height: 150px; object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 6px 8px #000a); }
.room-guardian-pick b { display: block; font: 700 22px/1.1 var(--font-display); color: var(--cream); }
.room-guardian-pick small { color: var(--gold); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.room-guardian-pick .guardian-note { margin: 6px 0 8px; }
.room-guardians { gap: 10px; }
.room-guardians .guardian-choice { width: 58px; }
.room-guardians .guardian-choice img { width: 52px; height: 52px; }
@media (max-width: 620px) {
  .lobby-top { flex-wrap: nowrap; gap: 8px; min-height: 54px; padding: 6px 10px; }
  .lobby-back b, .lobby-heading small, .lobby-user { display: none; }
  .lobby-back { width: 36px; padding: 0; justify-content: center; }
  .lobby-top .brand-mark { width: 34px; height: 34px; }
  .lobby-title { font-size: 19px; }
  .lobby-card { padding: 14px; }
  .room-guardian-pick { grid-template-columns: 76px minmax(0, 1fr); }
  .room-guardian-art { width: 76px; height: 120px; }
  .room-guardians .guardian-choice { width: 48px; }
  .room-guardians .guardian-choice img { width: 44px; height: 44px; }
}

/* ---------- City screen ---------- */
.city-modal { width: min(880px, 100%); }
.city-steps { position: absolute; z-index: 1; right: 18px; bottom: 16px; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 6px; padding: 6px 12px 6px 6px; border: 1px solid var(--gold); border-radius: 14px; background: #0b120ed9; color: var(--cream); }
.city-steps-icon { grid-row: span 2; width: 30px; height: 30px; object-fit: contain; }
.city-steps b { font: 700 20px/1 var(--font-display); color: var(--gold-2); }
.city-steps small { color: var(--muted); font-size: 10.5px; }
.city-supplies { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.city-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 16px; background: #fff9; color: var(--ink); }
.city-chip .resource-icon { width: 26px; height: 26px; }
.city-chip b { font: 700 17px/1 var(--font-display); }
.city-chip small { color: var(--ink-2); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.city-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.city-action { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #0002; border-radius: 12px; background: #1d2a22; color: var(--cream); text-align: left; transition: background .15s, transform .15s; }
.city-action:hover:not(:disabled) { background: #26382d; transform: translateY(-1px); }
.city-action b { display: block; font-size: 15px; }
.city-action small { display: block; color: var(--muted); font-size: 11.5px; }
.city-action.active { background: linear-gradient(180deg, #c99a45, #8e6528); color: #1b1408; border-color: #8e6528; box-shadow: 0 0 0 2px #f2d89288; }
.city-action.active small { color: #3a2a10; }
.city-action:disabled:not(.active) { opacity: .5; }
.city-view-tabs { display: none; }
.city-section.army { margin-top: 4px; }
.building { align-items: center; }
.building-status { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 8px; font-size: 10.5px; font-weight: 800; }
.building.ready .building-status { background: #c99a45; color: #1b1408; }
.building.idle .building-status { background: #1d2a2214; color: #6a5a2a; }
.building.short .building-status { background: #b8483a1f; color: #8a2a1e; }
.building.built .building-status { display: none; }
.building.ready { border-color: #a07a30; background: #fffbe9; box-shadow: 0 0 0 2px #d6ae5c55; cursor: pointer; }
.building.ready:hover { transform: translateY(-1px); }
.building.short, .building.idle { opacity: .8; }
.built-tag { font-size: 18px; }
@media (max-width: 980px) {
  .city-hero { height: 150px; }
  .city-hero-copy h2 { font-size: 26px; }
  .city-hero-copy { left: 16px; }
  .city-steps { right: 12px; bottom: 12px; }
  .city-action { padding: 9px 10px; gap: 8px; }
  .city-action b { font-size: 14px; }
  .city-action small { font-size: 10.5px; }
  /* Phones show one half of the city at a time; starting an action opens its half. */
  .city-view-tabs { position: sticky; top: -1px; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 -2px 10px; padding: 4px; border-radius: 12px; background: #1d2a22; box-shadow: 0 4px 10px #0003; }
  .city-view-tabs button { padding: 8px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 800; }
  .city-view-tabs button.active { background: var(--panel-3); color: var(--gold-2); }
  .city-view-tabs em { font-style: normal; font-weight: 700; opacity: .75; margin-left: 4px; }
  .city-body[data-view="build"] .city-section.army, .city-body[data-view="army"] .city-section.build { display: none; }
  .building-grid { grid-template-columns: 1fr; }
}
.menu-lang { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-2); font-weight: 800; font-size: 12px; }
html, body { touch-action: manipulation; }

/* ---------- Online: waiting for a rival's turn ---------- */
.turn-wait { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 4px 12px 4px 4px; border: 1px solid #8fb7e066; border-radius: 12px; background: linear-gradient(180deg, #1f2f3a, #121b20); }
.turn-wait img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 0 5px #8fb7e0aa); animation: hero-bob 3s ease-in-out infinite; }
.turn-wait small { display: block; color: #9fb8cc; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.turn-wait b { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cream); font-size: 14px; }
.turn-wait em { display: block; color: #bcd6f2; font-style: normal; font-size: 11px; }
.turn-wait-clock { margin-left: auto; padding-left: 8px; font: 700 20px/1 var(--font-display); color: #bcd6f2; font-variant-numeric: tabular-nums; }
.turn-wait-clock.late { color: #ff9a85; }
body.awaiting .turn-control .steps, body.awaiting #end-turn-button { display: none; }
.action-hint.waiting { color: #9fb8cc; }

/* ---------- Dock text never runs under the step medallions ---------- */
.location-summary > div { min-width: 0; }
.location-summary small, .location-summary b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 620px) {
  /* The turn badge floats over the map instead of squeezing the top bar. */
  body.online .online-turn { position: fixed; z-index: 25; top: calc(66px + env(safe-area-inset-top)); left: 10px; transform: none; padding: 5px 12px; font-size: 12px; box-shadow: 0 4px 12px #000a; background: #0f1813f0; border: 1px solid var(--line-strong); }
  body.online .online-turn.mine { border-color: var(--gold); }
  body.awaiting .online-turn { display: none; }
  .turn-wait { gap: 8px; padding-right: 10px; }
  .turn-wait img { width: 34px; height: 34px; }
  .turn-wait b { max-width: 96px; font-size: 13px; }
  .turn-wait-clock { font-size: 18px; }
  .location-summary b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
body.awaiting #context-actions .action-button { display: none; }
.city-hero .city-steps img.city-steps-icon { width: 30px; height: 30px; object-fit: contain; }

/* ---------- Online: vote to end after the last round ---------- */
.vote-card { position: fixed; z-index: 30; top: 76px; left: 50%; display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); padding: 14px 16px; transform: translateX(-50%); border: 1px solid var(--gold); border-radius: 14px; background: #0f1813f5; box-shadow: 0 10px 30px #000c; }
.vote-card .eyebrow { margin: 0; }
.vote-card > b { font: 700 19px/1.15 var(--font-display); color: var(--cream); }
.vote-card small { color: var(--muted); font-size: 12px; }
.vote-seats { display: flex; flex-wrap: wrap; gap: 6px; }
.vote-seats span { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 2px; border: 1px solid var(--line); border-radius: 14px; color: var(--cream); font-size: 12px; }
.vote-seats img { width: 24px; height: 24px; object-fit: contain; }
.vote-seats i { font-style: normal; font-weight: 800; color: var(--dim); }
.vote-seats .end { border-color: #d6ae5c88; } .vote-seats .end i { color: var(--gold-2); }
.vote-seats .keep { border-color: #8fb7e088; } .vote-seats .keep i { color: #bcd6f2; }
.vote-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vote-actions button { justify-content: center; min-height: 42px; }
.vote-mine { color: var(--gold-2) !important; font-weight: 700; }
@media (max-width: 620px) { .vote-card { top: calc(104px + env(safe-area-inset-top)); } }
/* Even spacing between the parts of a table: seats, guardian panel, buttons and hint. */
#room-body { display: grid; gap: 14px; }
#room-body > * { margin-top: 0; margin-bottom: 0; }
#room-body .room-hint { margin-top: -6px; }
