/* Echo Reapers game UI — brand, title screen, ambient echoes and the polish pass (ER-0025, ER-0048).
   Loaded after the feature stylesheets and before fx.css. Contract: teal only for echoes (the logo art carries its own),
   amber = primary / mine, no UIDs, prefers-reduced-motion turns motion off (er.css kills animations; the canvases are never started). */

:root {
  /* Historical width-audit references: /art/ui/keyart.png?w=1600, /art/ui/keyart-portrait.png?w=720,
     /art/brand/echo-reapers-keyart.png?w=1600. The approved v3 image below is used now. */
  --keyart-src: url("/art/brand/echo-reapers-keyart-v5c.png?w=1600"); /* the approved key art v5 C (ER-0751; v3 files kept for rollback): 1672 px master, WebP derivative */
  /* ER-1672: the key art is fetched only once <html class="keyart-on"> is set (login sheet opens, a view replaces the home, or a plot/tower deep link); the home never preloads it. */
  --keyart: none;
  --badge: url("/art/brand/logo-badge.png?w=160");
  --vignette: radial-gradient(ellipse at 50% 42%, rgba(8, 6, 4, .05), rgba(8, 6, 4, .72) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .38), transparent 28%, rgba(0, 0, 0, .55));
}

:root.keyart-on { --keyart: var(--keyart-src); }

/* wide or sharp screens (ER-0606): the key art in web-optimised 4K (3840 px WebP derivative of a free Lanczos upscale of the 1672 px master) */
/* ER-0755: 1280..1699 px windows get the 2560 px sharpened variant (never more than 1.5x of the 1672 master) */
@media (min-width: 1280px) { :root { --keyart-src: url("/art/brand/echo-reapers-keyart-v5c-2560.png?w=2560"); } }
@media (min-width: 1700px), (min-resolution: 1.5dppx) { :root { --keyart-src: url("/art/brand/echo-reapers-keyart-v5c-4k.png?w=3840"); } }

/* phones never load the 1600 px file: the landscape key art at 1100 px, centre-cropped by `cover` (the tower and the monster stay in frame) */
@media (max-width: 600px) { :root { --keyart-src: url("/art/brand/echo-reapers-keyart-v5c.png?w=1100"); } }

/* ── loading backdrop and the empty map: the key art ─────────────────────────────────────────────────────── */
.stage:not(.stage-root):not(.plot-root) { background: transparent; }
/* ER-0754: the logo lives in the free sky band ABOVE the main Reaper (v5 C: her top is at 0.31 of the picture height). The art is
   background-size: cover, centred, so its drawn height is max(56.28vw, 100vh); --reaper-top is her top edge in window pixels
   (the +96px covers the animated backdrop's -48px inset). The logo width shrinks until it fits between a 16px top margin and that edge. */
.boot, .landing-cta {
  --reaper-top: calc(50vh - 0.19 * (max(56.28vw, 100vh) + 96px));
  --logo-w: max(120px, min(720px, 56vw, (var(--reaper-top) - 30px) / 0.3717));
  --logo-cy: calc(16px + var(--logo-w) * 0.1859);
}
.boot {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: var(--vignette), var(--keyart) center / cover no-repeat, #0a0906;
  transition: opacity 600ms ease;
}
.boot.done { opacity: 0; pointer-events: none; }

/* ── ambient echo canvases ──────────────────────────────────────────────────────────────────────────────── */
.fx-ambient { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.panel > .panel-head, .panel > .panel-body, .panel > .panel-foot { position: relative; z-index: 1; }
.panel-foot { position: sticky; }
.stage.idle .fx-ambient { z-index: 1; }

/* ── HUD brand ──────────────────────────────────────────────────────────────────────────────────────────── */
.hud > .hud-brand { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); height: 58px; width: auto; max-width: 26vw; pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .75)); user-select: none; }
.brand-badge { height: 34px; width: auto; margin: -2px 0; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }

/* ── title screen (login) ───────────────────────────────────────────────────────────────────────────────── */
.login-layer { z-index: 60; background: transparent; overflow: hidden; animation: none; }
.login-layer .fx-ambient { z-index: 1; }
.login-layer .panel.login-sheet {
  position: absolute; inset: 0; top: 0; z-index: 2; width: 100%; min-width: 0; max-width: none; height: auto;
  background: transparent; border: 0; border-radius: 0; box-shadow: none; animation: none; overflow: visible;
}
.login-layer .panel.login-sheet::before { display: none; }
.login-sheet .panel-head { position: absolute; top: 10px; right: 10px; margin: 0; padding: 0; background: none; border: 0; z-index: 3; }
.login-sheet .panel-head::before, .login-sheet .panel-head::after, .login-sheet .panel-head h2 { display: none; }
.login-sheet .panel-head .close { background: rgba(14, 12, 10, .6); border-color: var(--brass); color: #ecdfc4; }
.login-sheet .panel-body { position: absolute; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 16px; }
.login-body { gap: 10px; width: min(440px, 100%); padding: 0; }
.login-emblem { display: block; height: min(40vh, 350px); width: auto; max-width: 78vw; margin: 0 auto;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, .75)); animation: emblem-float 7s ease-in-out infinite; }
@keyframes emblem-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.login-lore { color: #efe3c6; text-shadow: 0 1px 6px #000, 0 0 14px rgba(0, 0, 0, .9); font-size: 15px; }
.login-card { display: grid; gap: 10px; padding: 16px; text-align: left; background-color: rgba(14, 12, 10, .8); }
.login-card .login-input { text-align: center; }
.login-go { min-height: 52px !important; font-family: var(--font-display); font-variant-caps: small-caps; font-size: 1.35rem !important; letter-spacing: .06em; }
@media (max-width: 600px) and (orientation: portrait) {
  .login-emblem { height: min(30vh, 250px); }
  .login-body { gap: 8px; }
  .login-layer .panel.login-sheet { top: 0; height: auto; border-radius: 0; }
}
@media (max-height: 560px) { .login-emblem { height: 28vh; } .login-lore { display: none; } }

/* ── panels: masonry backdrop, ornamented headers ───────────────────────────────────────────────────────── */
.panel {
  background:
    radial-gradient(120% 50% at 50% 0, color-mix(in srgb, var(--amber) 9%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg2) 96%, #fff), var(--bg2) 30%, color-mix(in srgb, var(--bg) 60%, var(--bg2)));
}
.panel-head { border-bottom: 0; box-shadow: inset 0 -1px 0 var(--brass), 0 3px 10px rgba(0, 0, 0, .45); }
.panel-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px; pointer-events: none;
  background:
    linear-gradient(90deg, transparent, var(--brass) 12%, var(--brass-hi) 50%, var(--brass) 88%, transparent) 0 0 / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, color-mix(in srgb, var(--masonry) 55%, transparent) 0 22px, transparent 22px 24px) 0 2px / 100% 2px no-repeat;
}
.panel-head h2 { display: flex; align-items: center; gap: 10px; letter-spacing: .05em; text-shadow: 0 1px 0 rgba(0, 0, 0, .6); }
.panel-head h2::before {
  content: ""; flex: none; width: 12px; height: 14px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(135deg, var(--amber-glow), var(--amber) 55%, #b8721a); filter: drop-shadow(0 0 4px rgba(255, 210, 122, .5));
}
.panel-head .close { border: 1px solid var(--border-bright); background: color-mix(in srgb, var(--iron) 70%, transparent); }
.panel-body h3:not(.cards-name):not(.skins-name), .panel-body section > h3:not(.cards-name):not(.skins-name) { font-family: var(--font-display); font-variant-caps: small-caps; letter-spacing: .05em; font-size: 1.25rem; color: var(--heading); }
.panel-foot { box-shadow: 0 -4px 12px rgba(0, 0, 0, .35); }

/* ── shared surfaces: rows, cards, stats get the iron/brass treatment ───────────────────────────────────── */
.finder-row, .tray-item, .menu-item, .cards-card, .skins-card, .amber-stat, .summary-stat, .trans-fallen li, .replay-events .ev, .menu-theme-row, .notice-row {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brass) 9%, var(--a-card, var(--bg2))), var(--a-card, var(--bg2)) 60%);
  border-color: color-mix(in srgb, var(--brass) 45%, transparent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform 150ms, border-color 150ms, box-shadow 150ms;
}
.finder-row:hover, .menu-item:hover, .cards-card:hover, .skins-card:hover, .tray-item:hover { border-color: var(--brass-hi); box-shadow: 0 6px 14px rgba(0, 0, 0, .4), 0 0 0 1px rgba(224, 190, 122, .22), inset 0 1px 0 rgba(255, 255, 255, .08); }
.pill-toggle, .cards-tab, .menu-theme { transition: border-color 150ms, background 150ms, transform 150ms; }
.pill-toggle:hover, .cards-tab:hover, .menu-theme:hover { border-color: var(--brass-hi); transform: translateY(-1px); }
.pill-toggle[aria-pressed="true"], .menu-theme[aria-checked="true"] { background: color-mix(in srgb, var(--amber) 14%, var(--a-card, transparent)); }
.cards-tab[aria-selected="true"] { background: color-mix(in srgb, var(--amber) 12%, var(--a-card, transparent)); color: var(--amber-ink); }

/* selects in filter rows sit side by side (er.css makes every select full width) */
.cards-filters { flex-wrap: nowrap; }
.cards-filters .cards-select { width: auto; flex: 1 1 0; min-width: 0; background-color: var(--field-bg); border-color: var(--border-bright); }
@media (max-width: 600px) { .cards-filters { flex-wrap: wrap; } .cards-filters .cards-select { flex: 1 1 42%; } }
.finder-search, .login-input { border-color: var(--border-bright); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4); }
.finder-search:focus, .login-input:focus-visible { border-color: var(--amber); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4), 0 0 0 2px color-mix(in srgb, var(--amber) 35%, transparent); outline: 0; }

/* brass checkboxes */
.set-ctl input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 24px; height: 24px; border-radius: 3px; cursor: pointer; display: inline-grid; place-content: center;
  background: var(--field-bg); border: 1px solid var(--brass); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .5);
}
.set-ctl input[type="checkbox"]::after { content: ""; width: 12px; height: 12px; transform: scale(0); transition: transform 140ms cubic-bezier(.3, 1.6, .5, 1);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(135deg, var(--amber-glow), var(--amber)); }
.set-ctl input[type="checkbox"]:checked { border-color: var(--amber); }
.set-ctl input[type="checkbox"]:checked::after { transform: scale(1); }

/* ── card art tiles: brass frame, riveted corners, faded badge while art loads (or is missing) ───────────── */
.cards-art, .skins-img, .pick-card, .card-art-missing {
  background-image: var(--badge), radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--iron-hi) 90%, transparent), var(--iron));
  background-size: 42% auto, 100% 100%; background-position: 50% 42%, 0 0; background-repeat: no-repeat;
}
.cards-art { position: relative; border: 2px solid var(--brass); border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .55), inset 0 0 18px rgba(0, 0, 0, .5), 0 3px 8px rgba(0, 0, 0, .4); }
.cards-art::before, .cards-art::after { content: ""; position: absolute; z-index: 2; top: 4px; width: 7px; height: 7px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #f4d894, var(--brass) 55%, #5a3e14); box-shadow: 0 1px 1px rgba(0, 0, 0, .6); }
.cards-art::before { left: 4px; } .cards-art::after { right: 4px; }
.cards-art img, .pick-card img { position: relative; z-index: 1; }
.cards-card:hover .cards-art { border-color: var(--brass-hi); }
.card-art-missing { background-blend-mode: normal; }
.pick-card { border-color: var(--brass); }
.pick-card:hover:not(:disabled) { box-shadow: 0 6px 14px rgba(0, 0, 0, .45), 0 0 14px rgba(224, 190, 122, .3); }
.skins-card { overflow: hidden; }
.skins-img { border-bottom: 1px solid var(--brass); }

/* ── empty states carry art: the faded badge ────────────────────────────────────────────────────────────── */
.empty, .pick-empty, .queue-empty, .empty-state { position: relative; text-align: center; }
.empty:empty { display: none; }
.empty::before, .pick-empty::before, .queue-empty::before, .empty-state::before {
  content: ""; display: block; width: 88px; height: 98px; margin: 0 auto 10px; opacity: .38; filter: grayscale(.35) drop-shadow(0 4px 8px rgba(0, 0, 0, .5));
  background: var(--badge) center / contain no-repeat;
}
td > .empty { padding: 12px 8px; }
td > .empty::before { width: 56px; height: 62px; }

/* ── amber panel figures ────────────────────────────────────────────────────────────────────────────────── */
.amber-stat { align-content: start; border-radius: 6px; }
.amber-num { font-family: var(--font-mono); font-size: 24px; text-shadow: 0 0 14px rgba(232, 162, 58, .35); }
.amber-num { display: flex; align-items: center; gap: 8px; }
.amber-num .ico { display: inline-block; flex: none; width: 1.15em; height: 1.15em; }
.amber-num .ico svg { width: 100%; height: 100%; }
.ring-seg { stroke: color-mix(in srgb, var(--masonry) 45%, transparent); }

/* ── narrow desktops and landscape phones: fold the HUD so nothing overlaps ─────────────────────────────── */
@media (max-width: 1180px) {
  .hud > .hud-brand { display: none; }
}

/* ── phone: the plot label must never be clipped by the tick chip ───────────────────────────────────────── */
@media (max-width: 600px) and (orientation: portrait) {  /* the phone HUD now has two rows */
}

.cards-name, .skins-name { font-family: var(--font-body); font-variant-caps: normal; letter-spacing: 0; font-size: 15px; }

/* Audit fixes: readable panel labels, shared title treatment, and compact panel contents. */
.panel > .panel-head h2 { font: 600 1.25rem/1.25 var(--font-body); font-variant-caps: normal; letter-spacing: .02em; color: var(--heading); }
.panel .panel-body :is(.muted, .finder-sub, .finder-keeper, .finder-counts, .amber-stat-label, .amber-stat-sub, .tray-meta, .menu-label, .set-name, .set-msg, .login-countdown) { color: color-mix(in srgb, var(--ink) 88%, var(--heading)); font-size: max(13px, .8125rem); }
.amber-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.amber-tabs .cards-tab { flex: 1 1 0; }
@media (max-height: 520px) and (orientation: landscape) {
  .panel-body:has(.finder), .panel-body:has(.cards), .panel-body:has(.amber), .panel-body:has(.skins), .panel-body:has(.trans), .panel-body:has(.replay), .panel-body:has(.summary), .panel-body:has(.tray), .panel-body:has(.menu) {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 10px;
  }
  .panel-body:has(.amber) .amber-tabs, .panel-body:has(.menu) .menu-brand, .panel-body:has(.menu) .menu-theme-row { grid-column: 1 / -1; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .finder-bar, .finder-msg, .finder-filters, .finder-list, .finder-mine { grid-column: 1 / -1; }
  .amber { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .amber-tabs { grid-column: 1 / -1; }
  .amber-tabs ~ section[hidden] { display: none; }
  .amber-tabs ~ section:not([hidden]) { grid-column: 1 / -1; }
  .info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .info-list { grid-row: span 2; }
  .info-links, .info-actions { align-content: start; }
}
@media (max-height: 900px) {
  .login-emblem { height: min(24vh, 220px); }
  .login-body { gap: 7px; }
  .login-card { gap: 7px; padding: 10px; }
}
.panel .panel-body :is(.info-row dt, .cards-meta, .cards-stats, .trans-kv dt, .replay-legend, .summary-stat > span, .amber-prices) {
  color: color-mix(in srgb, var(--ink) 88%, var(--heading)); font-size: max(13px, .8125rem);
}
.pill-toggle[aria-pressed="true"] { color: var(--amber-ink); background: color-mix(in srgb, var(--amber) 18%, var(--iron)); box-shadow: inset 0 0 0 1px var(--amber), 0 0 8px color-mix(in srgb, var(--amber) 24%, transparent); }
.info { gap: 8px; }
.info-list { gap: 4px; }
.info-row { padding-bottom: 4px; }
.info-links .info-link { min-height: 38px; }
@media (max-height: 520px) and (orientation: landscape) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .cards-tabs, .cards-filters, .cards-grid { grid-column: 1 / -1; }
  .trans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; }
  .trans > h3, .trans > .trans-summary { grid-column: 1 / -1; }
  .replay { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 8px; align-content: start; }
  .replay-stepper, .replay-legend { grid-column: 1; }
  .replay-view { grid-column: 2; grid-row: 1 / span 2; min-width: 0; }
  .summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .summary > h3, .summary-events { grid-column: 1 / -1; }
  .tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tray-list, .tray > .btn { grid-column: 1 / -1; }
  .skins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .skins-banner, .skins-grid { grid-column: 1 / -1; }
}
html[data-theme="light"] .panel select, html[data-theme="wood"] .panel select { color-scheme: light; }
@media (max-height: 520px) and (orientation: landscape) {
  .login-body { gap: 4px; }
  .login-card { gap: 6px; padding: 8px; }
  .login-alt { gap: 4px; }
}
/* Keep one title voice across account, board, and signing panels despite feature-specific sheets. Menu shells set theirs in menu-base.css. */
.panel:not(.menu-shell) > .panel-head h2 {
  font-family: var(--font-body) !important; font-size: 1.25rem !important; font-weight: 600 !important;
  font-variant-caps: normal !important; letter-spacing: .02em !important; text-transform: none !important;
  color: var(--heading) !important;
}
@media (max-height: 520px) and (orientation: landscape) {
  .login-body { width: min(820px, 100%); }
}
.login-layer .panel.login-sheet { inset: 0 !important; top: 0 !important; bottom: 0 !important; height: 100% !important; }
@media (max-height: 520px) and (orientation: landscape) {
  .login-sheet .panel-body { display: flex; justify-content: center; align-items: center; }
  .login-body { flex: 0 1 820px; width: min(820px, 100%); margin: 0; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .login-body { width: min(820px, calc(100vw - 32px)); max-width: 100%; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-card { min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .login-card > * { min-width: 0; }
  .login-card .login-go { min-width: 0; padding-inline: 8px; font-size: 1rem !important; white-space: normal; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .panel-body:has(.pick) > .pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; }
  .pick > :is(.pick-site-summary, .pick-note, .pick-tabs, .pick-public, .pick-login, .er-load, .er-skeleton) { grid-column: 1 / -1; }
  .pick-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 8px; }
  .pick-list > :is(.pick-tools, .pick-results) { grid-column: 1 / -1; }
  .pick-workers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pick-workers > :is(.pick-tabs, .pick-slots-row, .pick-grid) { grid-column: 1 / -1; }
  .panel-body:has(.cmp) .cmp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
  .cmp > :is(.cmp-cols, .cmp-verdict, .cmp-rules, .cmp-resolve, .cmp-bottom) { grid-column: 1 / -1; }
  .panel-body:has(.sign) .sign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
  .sign > :is(.sign-top, .sign-result, .sign-refused, .sign-unassigned) { grid-column: 1 / -1; }
}
.panel .panel-body :is(.pick-meta, .cmp-tag, .cmp-others, .cmp-stale, .pick-site-chip, .pick-note, .info-row dt) {
  color: color-mix(in srgb, var(--ink) 88%, var(--heading)); font-size: max(13px, .8125rem);
}

/* ── ER-0329 / ER-0332: zero frames on the test lot ─────────────────────────────────────────────────────── */
/* pending tower: the bare art only, lightly translucent: no dark overlay, no grey filter, no empty-slot leftovers */
.pending-tower .tile-art { filter: none; opacity: 1; }
.pending-tower::after { display: none; }
.pending-tower .tile-clearing, .pending-tower .tile-plus, .pending-tower .empty-cap, .pending-tower .tile-frame { display: none; }
.tile-art.tower-bare, .tile-art.tower-bare:not(.is-skin):not(.full) { background: none; border: 0; box-shadow: none; }
/* outposts: the transparent original monster art, no crop, no mask, sitting above the stake ring (feet clear of the health bar) */
.tile-art.full.bare { background: none; overflow: visible; }
.tile-art.bare { background: none; overflow: visible; }
.tile-art.bare img.monster-bare {
  inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  -webkit-mask-image: none; mask-image: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45));
}
.tile-art.full.bare img.monster-bare {
  inset: auto; left: 0; bottom: 14%; top: auto; width: 100%; height: 86%; object-fit: contain; object-position: 50% 100%;
  -webkit-mask-image: none; mask-image: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45));
}
/* ER-0367: facing is determined by the current road layout; the plate never flips. */
.state-outpost.faces-left > .tile-art.full img { transform: scaleX(-1); }
.state-outpost.fx-monster-attack > .tile-art.full { animation: er-monster-swipe .38s ease-out; }
.state-tower.fx-tower-attack > .tile-art.tower-bare img.tower-img,
.state-grace.fx-tower-attack > .tile-art.tower-bare img.tower-img { animation: er-tower-fire .38s ease-out; }
.stage-worksite.fx-work-hit { animation: er-work-hit .5s ease-out; }
.site-tile.fx-hit > .tile-plinth { animation: er-site-shake .42s ease-out; }
.site-tile.fx-hit > .tile-art { animation: er-art-hit .42s ease-out; }
@keyframes er-monster-swipe { 0%,100% { translate: 0 0; } 45% { translate: var(--attack-x, -7px) -6px; } }
@keyframes er-tower-fire { 0%,100% { filter: drop-shadow(0 0 0 transparent); translate: 0 0; }
  30% { filter: drop-shadow(0 0 18px #ffd781); translate: 0 -4px; }
  55% { translate: 0 3px; } }
@keyframes er-work-hit { 0%,100% { filter: none; } 25% { filter: brightness(1.8) drop-shadow(0 0 16px #ffbd81); } }
@keyframes er-site-shake { 0%,100% { translate: 0 0; } 25% { translate: -3px 0; } 55% { translate: 3px 0; } 75% { translate: -1px 0; } }
@keyframes er-art-hit { 0%,100% { translate: 0 0; filter: none; } 25% { translate: -3px 0; filter: brightness(1.6); }
  55% { translate: 3px 0; } 75% { translate: -1px 0; } }
@media (prefers-reduced-motion: reduce) {
  .state-outpost.fx-monster-attack > .tile-art.full,
  .state-tower.fx-tower-attack > .tile-art.tower-bare img.tower-img,
  .state-grace.fx-tower-attack > .tile-art.tower-bare img.tower-img,
  .stage-worksite.fx-work-hit, .site-tile.fx-hit > .tile-plinth,
  .site-tile.fx-hit > .tile-art { animation: none; }
}
/* a pending outpost: no teal card box around the monster */
.pending-card.outpost { width: 60%; right: 20%; top: -6%; padding: 0; border: 0; background: none; box-shadow: none; }
.pending-card.outpost .tile-art { height: 120px; }
.site-tile.has-pending .pending-card.outpost { filter: none; }
.pending-card.outpost .tile-art { opacity: 1; filter: none; }
/* labels: wrap instead of ellipsis, and sit on the pedestal front, clear of the bottom info panel */
html .site-tile .tile-plaque:not(.empty-cap), html .site-tile .tile-plaque.pending-plaque:not(.empty-cap) {
  overflow: visible; text-overflow: clip; white-space: normal; max-width: 130%; text-align: center; line-height: 1.15;
}
html .state-outpost > .tile-plaque:not(.empty-cap) { top: 100%; }
html .site-tile.pending-tower > .tile-plaque.pending-plaque { top: calc(var(--plate-top, 118%) - 14%); }
/* ER-0333: echoes and lanes stay visible over the backdrop and the worksite panel, and end under their tile's art */
.fx-under { z-index: 3; }   /* above the worksite panel (z 2), still under the tile labels and health bars */
@media (max-width: 600px) {
  html .site-tile .tile-plaque:not(.empty-cap), html .site-tile .tile-plaque.pending-plaque:not(.empty-cap) { width: max-content; max-width: 112%; font-size: 12px; }
  html .state-outpost > .tile-plaque:not(.empty-cap) { top: 110%; left: auto; right: 0; transform: none; max-width: 100%; }
  .site-tile:has(.tile-art.tower-bare) > .tile-plaque { top: calc(var(--plate-top) + var(--plate-h) + 9px); }
  .site-tile > .stage-health .stage-health-title { white-space: normal; overflow-wrap: anywhere; font-size: 9px; line-height: 1.1; }
  .pending-card.outpost .tile-art { height: min(120px, 22vh); }
}
@keyframes mythic-gem-shimmer {
  0%, 13%, 100% { filter: brightness(1); }
  6% { filter: brightness(1.22) drop-shadow(0 0 5px rgba(255, 222, 165, .4)); }
}

/* One quiet plate for the pending state, health and outpost label. */
.site-tile .site-plate,
html.kit-plaque-label .site-tile .site-plate.tile-plaque {
  box-sizing: border-box; width: max(112px, 94%); max-width: min(210px, 128%);
  min-height: 48px; height: 48px; padding: 5px 8px;
  border: 1px solid #877656; border-radius: 6px; border-image: none;
  background: linear-gradient(180deg, rgba(37, 36, 32, .97), rgba(20, 23, 22, .97));
  color: #f5f0e5; box-shadow: 0 2px 7px #0009; text-shadow: none;
  font: 600 11px/1.25 var(--font-body); letter-spacing: 0;
  white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
}
.site-tile .site-plate.stage-health { left: 50%; transform: translateX(-50%); top: 103%; display: grid; gap: 2px; text-align: center; }
.site-tile .site-plate.stage-health .stage-health-title { white-space: normal; overflow: visible; text-overflow: clip; }
.site-tile .site-plate.stage-health .stage-health-track { height: 4px; border: 0; border-radius: 2px; }
.site-tile .site-plate.stage-health .stage-health-value { text-align: center; white-space: normal; }
.site-tile > .site-plate.tile-plaque,
.site-tile.pending-tower > .site-plate.pending-plaque,
.site-tile:has(.tile-art.tower-bare) > .site-plate.tile-plaque {
  top: calc(103% + 44px); left: 50%; right: auto; transform: translateX(-50%);
}
.site-tile > .site-plate.tile-plaque:only-of-type { top: 106%; }
.site-tile:has(.garrison-card) > .site-plate.tile-plaque { top: calc(103% + 144px); }
.site-tile:has(.tower-bare) > .site-plate.tile-plaque { top: calc(118% + 52px) !important; }
.site-tile:has(.tower-bare):has(.garrison-card) > .site-plate.tile-plaque { top: calc(118% + 150px) !important; }
.site-tile.state-outpost > .site-plate.tile-plaque { top: calc(103% + 52px) !important; }
.site-tile.pending-tower > .site-plate.pending-plaque { top: 106% !important; }
.site-tile .site-plate.pending-plaque { border-color: #b68c48; color: #f4d494; }
.site-tile .site-plate.stage-health.critical,
.site-tile .site-plate.stage-health.fallen { border-color: #b36355; }
.site-tile .site-plate.stage-health.damaged { border-color: #b49453; }
.site-tile .site-plate.stage-health.healthy { border-color: #668b6a; }

/* The art stands directly on the painted ground; selection uses a small label glow. */
.site-tile.state-tower > .tile-plinth,
.site-tile.state-grace:has(.tower-bare) > .tile-plinth,
.site-tile.state-outpost > .tile-plinth,
.site-tile.state-tower > .tile-frame,
.site-tile.state-outpost > .tile-frame,
.site-tile > .tile-crest,
.site-tile.state-tower > .tile-bar,
.site-tile.state-tower > .tile-cracks,
.site-tile.state-outpost > .tile-stake { visibility: hidden; }
.site-tile.selected::before, .state-empty.selected::before { display: none; }
.site-tile.selected > .site-plate { box-shadow: 0 0 0 2px #d2a052, 0 3px 10px #000a; }
.site-tile:focus-visible { outline: 2px solid #d2a052; outline-offset: 2px; }
.tile-art.tower-bare { --k: 1.42; top: calc(var(--tw) * (1.36 - var(--k) * 1.5 * var(--ring-y)) - 12px); }
.tile-art.tower-bare img.tower-img { -webkit-mask-image: none; mask-image: none; }
.tile-art.tower-bare .tower-shadow { display: none; }
.state-outpost .tile-art.full.bare img.monster-bare { bottom: 0; height: 100%; }
.fx-under { z-index: 3; }
.stage-roads .road-verge, .stage-roads .road-dirt, .stage-roads .road-track { stroke: transparent; }

/* Every site's status uses the same two compact rows. The pedestal stays visible
   behind the cutout so the tower has a physical landing surface. */
.site-tile.state-tower > .tile-plinth,
.site-tile.state-grace:has(.tower-bare) > .tile-plinth,
.site-tile.state-outpost > .tile-plinth { visibility: visible; }
.site-tile > .site-plate.stage-health {
  top: var(--status-top, calc(100% + 4px)) !important; height: 32px; min-height: 32px;
  width: min(172px, 100%); max-width: none; padding: 3px 7px;
  font-size: 10px; line-height: 1.05; gap: 1px;
}
.site-tile > .site-plate.tile-plaque,
.site-tile.pending-tower > .site-plate.pending-plaque,
.site-tile:has(.tower-bare) > .site-plate.tile-plaque,
.site-tile.state-outpost > .site-plate.tile-plaque {
  top: calc(var(--status-top, 100%) + 35px) !important; height: 32px; min-height: 32px;
  width: min(172px, 100%); max-width: none; padding: 4px 6px;
  font-size: 10px; line-height: 1.1; white-space: nowrap; overflow: hidden;
}
.site-tile > .site-plate.tile-plaque:only-of-type { top: calc(var(--status-top, 100%) + 35px) !important; }
.site-tile.state-empty > .site-plate.tile-plaque,
.site-tile.pending-tower > .site-plate.pending-plaque { top: var(--status-top, calc(100% + 4px)) !important; }
html.kit-plaque-label .site-tile > .site-plate.tile-plaque { height: 32px !important; min-height: 32px !important; }
.site-tile > .garrison-cards { top: 20%; left: 100%; transform: none; }
.site-tile .garrison-card { border: 0; background: none; box-shadow: none; }
.site-tile .garrison-card .tile-art { background: none; }
.tile-art.tower-bare { --k: 1.58; top: calc(var(--tw) * (1.12 - var(--k) * 1.5 * var(--ring-y))); }
.tile-art.tower-bare.ghost img.tower-img, .tile-art.ghost img { opacity: 1; }
.state-grace .tile-art.tower-bare img { filter: none; }
.pending-card.outpost .pending-caption { display: none; }
@media (max-width: 600px) and (orientation: portrait) {
  .site-tile > .site-plate.stage-health,
  .site-tile > .site-plate.tile-plaque,
  html.kit-plaque-label .site-tile > .site-plate.tile-plaque { height: 32px; min-height: 32px; }
}

@media (max-width: 600px) and (orientation: portrait) {
  .site-tile .site-plate,
  html.kit-plaque-label .site-tile .site-plate.tile-plaque { min-height: 48px; height: 48px; width: max(102px, 100%); max-width: 128%; font-size: 10px; padding: 4px 5px; }
  .site-tile > .site-plate.tile-plaque,
  .site-tile.pending-tower > .site-plate.pending-plaque,
  .site-tile:has(.tile-art.tower-bare) > .site-plate.tile-plaque { top: calc(103% + 44px); }
  .site-tile:has(.garrison-card) > .site-plate.tile-plaque { top: calc(103% + 130px); }
  .site-tile:has(.tower-bare):has(.garrison-card) > .site-plate.tile-plaque { top: calc(118% + 140px) !important; }
}

/* The reviewed Plains stage keeps its native art, labels, echoes and effects in one world. */
.stage-root.stage-world-play,
body.has-panel #stage.stage-world-play { width:100vw !important; height:100dvh; left:0 !important; right:0 !important; transition:none !important; }
body.has-panel #stage.plot-root { width:100vw !important; height:100dvh; left:0 !important; right:0 !important; transition:none !important; }
.stage-world-play .stage-world-viewport,
.stage-world-play .stage-world-sprites { pointer-events:none; }
.stage-world-play .world-tile { pointer-events:auto; min-width:var(--world-hit-min,44px); min-height:var(--world-hit-min,44px); }
.stage-world-play .world-worksite { transform:translateX(-50%); width:auto; max-width:none; }
.stage-world-play .stage-world-fx .fx-canvas,
.stage-world-play .stage-world-fx .fx-pops { width:100%; height:100%; }
.stage-world-play .stage-world-fx .fx-under { z-index:1; }
.stage-world-play .stage-world-fx .fx-over,
.stage-world-play .stage-world-fx .fx-pops { z-index:2; }
.stage-world-play .world-tile .tile-frame,
.stage-world-play .world-tile .tile-crest { display:none !important; }
.stage-world-play .world-tile .tile-art { background:none; border:0; box-shadow:none; }
.stage-world-play .world-tile.state-outpost .tile-art.full { left:6%; width:88%; top:0; height:100%; }
.stage-world-play .world-tile.state-outpost .tile-art.full img.monster-bare { bottom:0; height:100%; }
.stage-world-play .world-tile .tile-plinth { top:73%; }
.stage-world-play .world-tile > .site-plate.stage-health { top:var(--status-top) !important; }
.stage-world-play .world-tile > .site-plate.tile-plaque { top:calc(var(--status-top) + 35px) !important; }
.stage-world-play .world-tile.state-empty > .site-plate.tile-plaque,
.stage-world-play .world-tile.pending-tower > .site-plate.pending-plaque { top:var(--status-top) !important; }
/* World art uses the reviewed foot anchors; the native box is only its hit region. */
.stage-world-play .world-tile .tile-art.tower-bare {
  --k:1; left:10%; top:0; width:80%; height:100%; overflow:visible;
}
.stage-world-play .world-tile .tile-art.tower-bare img.tower-img { width:100%; height:100%; object-fit:contain; }
.stage-world-play .world-tile.state-outpost > .tile-plinth,
.stage-world-play .world-tile.state-constructing > .tile-plinth,
.stage-world-play .world-tile.has-pending > .tile-plinth { display:block; visibility:visible; }
.stage-world-play .world-tile.state-outpost::after {
  content:''; position:absolute; left:14%; bottom:-3%; width:72%; height:13%; border-radius:50%;
  background:radial-gradient(ellipse,#17200c99,transparent 75%); pointer-events:none;
}
.stage-world-play .world-tile > .site-plate {
  box-sizing:border-box; left:50%; transform:translateX(-50%); width:var(--world-plate-width,210px) !important;
  max-width:none !important; height:var(--world-plate-height,44px) !important;
  min-height:var(--world-plate-height,44px) !important;
  font-size:var(--world-plate-font,15px) !important;
}
.stage-world-play .world-tile > .site-plate.stage-health { width:var(--world-plate-width,210px) !important; }
.stage-world-play .world-tile > .site-plate.stage-health {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-content:center;
  column-gap:6px; row-gap:2px; padding:3px 8px;
}
.stage-world-play .world-tile > .site-plate.stage-health .stage-health-title {
  grid-column:1 / -1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  font-size:1em; line-height:1.1;
}
.stage-world-play .world-tile > .site-plate.stage-health .stage-health-track { grid-column:1; align-self:center; }
.stage-world-play .world-tile > .site-plate.stage-health .stage-health-value { grid-column:2; white-space:nowrap; line-height:1; }
.stage-world-play .world-tile > .site-plate.tile-plaque { top:calc(var(--status-top) + var(--world-plate-height,44px) + 3px) !important; }
.stage-world-play .world-tile.state-empty > .site-plate.tile-plaque,
.stage-world-play .world-tile.pending-tower > .site-plate.pending-plaque { top:var(--status-top) !important; }
.stage-world-play .world-tile:hover,
.stage-world-play .world-tile:active { transform:none; transition:none; }
.stage-world-play .world-tile.has-pending .tile-clearing,
.stage-world-play .world-tile.has-pending .tile-plus,
.stage-world-play .world-tile.has-pending .empty-cap { display:none; }
.stage-world-play .world-tile.has-pending .pending-card.outpost { width:100%; height:100%; left:0; top:0; right:auto; }
.stage-world-play .world-tile.has-pending .pending-card.outpost .tile-art { width:100%; height:100%; inset:0; }
.stage-world-play .world-tile.state-constructing > .site-plate.tile-plaque { top:var(--status-top) !important; }
.stage-world-play .world-tile.state-constructing .tile-art { opacity:1; filter:none; }
.stage-world-play .world-tile .construction-scaffold {
  z-index:2; position:absolute; left:13%; top:14%; width:74%; height:62%; pointer-events:none;
  border-left:3px solid #ad793d; border-right:3px solid #ad793d;
  background:linear-gradient(15deg,transparent 48%,#ae7638 49%,#ae7638 51%,transparent 52%),
    linear-gradient(-15deg,transparent 48%,#ae7638 49%,#ae7638 51%,transparent 52%);
  filter:drop-shadow(1px 2px 1px #241608);
}
html.kit-plaque-label .stage-world-play .world-tile > .site-plate.tile-plaque,
html.kit-plaque-label .stage-world-play .world-tile > .site-plate.stage-health {
  height:var(--world-plate-height,44px) !important;
  min-height:var(--world-plate-height,44px) !important;
  font-size:var(--world-plate-font,15px) !important;
}

/* R2b: painted lane puppets sit behind the interactive cards and their plates. */
.stage-world-play .stage-world-echoes { z-index: 2; }
.stage-world-play .stage-world-sprites { z-index: 3; }
.stage-world-play .stage-world-fx { z-index: 4; }
.stage-world-play .play-echo-canvas,
.stage-world-play .play-replay-effects { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.stage-world-play .play-echo-canvas[hidden] { display:none; }
.stage-world-play .replay-hp { position:absolute; z-index:2; transform:translate(-50%,-50%); width:84px;
  border:1px solid #a7d3aa; border-radius:6px; background:#10231de0; padding:3px 4px 4px;
  text-align:center; color:#fff9e6; box-shadow:0 2px 8px #0008; }
.stage-world-play .replay-hp:before { content:''; display:block; height:6px; border-radius:4px; background:#39423b; }
.stage-world-play .replay-hp i { position:absolute; left:4px; top:3px; height:6px; max-width:calc(100% - 8px);
  border-radius:4px; background:linear-gradient(90deg,#4de5be,#b2fa8a); }
.stage-world-play .replay-hp b { display:block; margin-top:1px; font:700 11px/1.15 var(--font-body); }
.stage-world-play .replay-bolt,.stage-world-play .replay-spell { stroke:#78fff1; stroke-width:7; stroke-linecap:round;
  filter:drop-shadow(0 0 10px #4af8df); animation:replay-bolt .3s ease-out forwards; }
.stage-world-play .replay-spell { stroke:#e4a5ff; stroke-dasharray:12 9; stroke-width:9; }
@keyframes replay-bolt { to { opacity:0; stroke-width:1; } }
.stage-world-play .replay-lunge { animation:replay-lunge .3s ease-out; }
@keyframes replay-lunge { 50% { transform:translateX(-12px) scale(1.04); } }
.stage-world-play .replay-fire { animation:replay-fire .3s ease-out; }
@keyframes replay-fire { 50% { filter:brightness(1.55) drop-shadow(0 0 12px #c7ffe1); transform:scale(1.04); } }
.play-hour-button { position:absolute; left:50%; bottom:30px; transform:translateX(-50%); z-index:2;
  min-width:176px; min-height:44px; padding:8px 18px; color:#fff0c9; font:700 14px var(--font-body);
  background:linear-gradient(#604d30,#2d281f); border:2px solid #c7a45c; border-radius:7px;
  box-shadow:0 3px 12px #0009,inset 0 1px #f7df9a80; text-shadow:0 1px #1b160f; cursor:pointer; }
.play-hour-button:hover { filter:brightness(1.13); }
.play-hour-button[hidden],.play-hour-panel[hidden] { display:none !important; }
/* The replay controls live in the quiet right margin of the painted scene. */
.play-hour-panel { position:absolute; z-index:3; top:84px; right:16px;
  width:300px; box-sizing:border-box; padding:7px 9px 8px; color:#f8eed8;
  background:#13251ee8; border:1px solid #c9a86a; border-radius:8px;
  box-shadow:0 5px 18px #07140f9c; backdrop-filter:blur(7px); }
.play-hour-heading { font:700 14px/1.1 Georgia,serif; color:#ffe3a5; margin-bottom:5px; }
.play-hour-stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:2px; }
.play-hour-stat { min-width:0; text-align:center; }
.play-hour-stat strong { display:block; font:700 16px/1 var(--font-body); color:#b7f3d5; font-variant-numeric:tabular-nums; }
.play-hour-stat span { display:block; font:9px/1.2 var(--font-body); white-space:nowrap; }
.play-hour-controls { display:flex; gap:5px; justify-content:center; margin-top:6px; }
.play-hour-controls button { min-height:26px; padding:2px 8px; color:#fff2cf; background:#344639;
  border:1px solid #bda167; border-radius:5px; font:600 11px var(--font-body); cursor:pointer; }
.play-hour-controls button:hover { background:#4a6250; }
.play-hour-info { position:absolute; top:5px; right:7px; width:18px; height:18px; padding:0;
  border:1px solid #c9a86a; border-radius:50%; color:#ffe3a5; background:#344639;
  font:italic 700 12px/16px Georgia,serif; cursor:pointer; }
.play-hour-note { position:absolute; z-index:4; top:calc(100% + 4px); right:0; width:min(285px,calc(100vw - 70px));
  box-sizing:border-box; margin:0; padding:7px 9px; border:1px solid #c9a86a; border-radius:6px;
  background:#13251ef5; color:#f8eed8; font:11px/1.3 var(--font-body); box-shadow:0 5px 16px #07140f9c; }
.play-hour-note[hidden],.play-hour-info[hidden] { display:none !important; }
.play-hour-info:hover + .play-hour-note, .play-hour-info:focus-visible + .play-hour-note { display:block !important; }
@media(max-width:600px) and (orientation:portrait) {
  .play-hour-button { bottom:76px; min-height:42px; font-size:12px; }
}
@media(prefers-reduced-motion:reduce) {
  .stage-world-play .replay-bolt,.stage-world-play .replay-spell,.stage-world-play .replay-lunge,.stage-world-play .replay-fire { animation:none; }
}
/* Compact single-row replay strip below the top HUD on small screens. */
@media (max-width:600px) and (orientation:portrait), (max-height:500px) and (min-width:601px) {
  .play-hour-panel { top:94px; left:64px; right:8px; width:auto; height:52px; padding:5px 7px;
    display:flex; align-items:center; gap:4px; }
  .play-hour-heading { display:none; }
  .play-hour-stats { flex:1; gap:1px; }
  .play-hour-stat strong { font-size:13px; }
  .play-hour-stat span { font-size:8px; }
  .play-hour-stat span[data-short] { font-size:0; }
  .play-hour-stat span[data-short]::after { content:attr(data-short); font-size:8px; }
  .play-hour-controls { flex:none; gap:2px; margin:0; }
  .play-hour-controls button { width:23px; min-height:26px; padding:0; font-size:0; }
  .play-hour-controls button::after { content:attr(data-short); font:700 17px/1 var(--font-body); }
  .play-hour-info { position:static; flex:none; width:17px; height:17px; font-size:11px; line-height:15px; }
  .play-hour-note { top:calc(100% + 3px); }
  .play-hour-panel:has(.play-hour-stats[hidden]) { height:auto; min-height:52px; }
  .play-hour-panel:has(.play-hour-stats[hidden]) .play-hour-heading { display:block; font-size:13px; margin:0; }

  .play-hour-panel:has(.play-hour-stats[hidden]) .play-hour-note { position:static; flex:1; width:auto; padding:0; border:0; box-shadow:none; background:none; }
}
@media (max-height:500px) and (min-width:601px) {
  .play-hour-panel { top:56px; left:auto; right:8px; width:350px; max-width:none; }
  .play-hour-button { bottom:70px; }
}

/* Classic stage fallback labels remain readable at both acceptance widths. The tiny pending-chip caption keeps its size (a larger caption pushes the chip out of its tile on phone). */
.site-tile .site-plate,
html.kit-plaque-label .site-tile .site-plate.tile-plaque,
.site-tile > .site-plate.stage-health,
.site-tile > .site-plate.tile-plaque,
.site-tile .garrison-card .stage-health,
.site-tile .garrison-card .stage-health-title,
.site-tile .stage-health-title,
.site-tile .tile-flag,
.site-tile .tile-plaque,
.site-tile .tile-plaque.empty-cap .tile-subtitle {
  font-size: clamp(12px, 1vw, 14px) !important;
}

/* -- panel header: title takes the free width, help and close sit together on the right, nothing overlaps (ER panel-header fix) -- */
.panel > .panel-head { justify-content: flex-start; gap: 8px; min-height: 48px; box-sizing: border-box; }
.panel > .panel-head > h2 { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel > .panel-head > .icon-btn { flex: none; margin: 0; }
.panel > .panel-head > .icon-btn.help {
  width: 32px; height: 32px; min-width: 32px; min-height: 32px; border-radius: 50%;
  border: 1px solid var(--brass); color: var(--amber-ink); font: 700 15px/1 var(--font-body); text-decoration: none;
}
.panel > .panel-head > .icon-btn.close { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.panel > .panel-head > .panel-swipe-handle { pointer-events: auto; }
@media (max-width: 600px) {
  .panel > .panel-head > .icon-btn.help { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
  .panel > .panel-head > .icon-btn.close { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
}
html[data-theme] .panel:not(.login-sheet) .panel-head > .icon-btn.help { border-image: none; background: transparent; }
.login-sheet .panel-head > .icon-btn.help { display: none; }

/* ── landing page (ER-0625): logged out, no plot asked for = the key art and one central Log in button ─────── */
.landing-cta { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.landing-cta[hidden] { display: none; }
.landing-cta .landing-login { position: absolute; left: 50%; bottom: clamp(14px, 4.5vh, 44px); translate: calc(-100% - 12px) 0; pointer-events: auto; min-width: 220px; min-height: 54px; padding: 12px 40px; font-size: 1.25rem; letter-spacing: .04em; font-family: Inter, system-ui, sans-serif; font-weight: 700;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .7)); }
body.landing #hud, body.landing .prealpha, body.landing #notice, body.landing .stage .plot-load-error { display: none !important; }
@media (max-width: 600px) { .landing-cta .landing-login { min-width: 70vw; translate: -50% 0; bottom: calc(clamp(14px, 4.5vh, 44px) + 52px); } .landing-cta .landing-whitepaper { translate: -50% 0 !important; } }

/* ER-0637: ONE static logo in ONE fixed place. The boot screen and the landing page draw it at identical coordinates, no animation,
   no spinner, no badge: nothing appears, disappears or moves between boot, veil and landing. */
.boot-mark, .landing-logo { position: fixed; left: 50%; top: var(--logo-cy, 44%); transform: translate(-50%, -50%); width: var(--logo-w, min(720px, 56vw, 92vh)); height: auto; animation: none; pointer-events: none;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, .85)); }
body.landing .stage .er-load { display: none !important; }

/* ER-0651: pre-plot view (logged in, no plot open): the brand plaque text is centred in its well and the wordmark is large and fully visible. */
.hud > .hud-brand { top: 6px; height: clamp(96px, 15vh, 150px); max-width: 34vw; }  /* identical to the plot plaque label (ER-0652) */

/* ER-0653: the Whitepaper is linked prominently on the landing page (under Log in) and on the pre-plot view (no plot open). */
.landing-cta .landing-whitepaper { position: fixed; left: 50%; bottom: clamp(14px, 4.5vh, 44px); min-height: 54px; display: inline-flex; align-items: center; box-sizing: border-box; translate: 12px 0; pointer-events: auto; padding: 9px 26px; }
.hud > .hud-whitepaper { position: absolute; left: 50%; top: calc(6px + clamp(96px, 15vh, 150px) + 6px); transform: translateX(-50%); pointer-events: auto; padding: 7px 22px; }

/* ER-0741: return summary offered as a chip, never a panel */
#summaryChip { position: fixed; right: 16px; bottom: 16px; z-index: 40; }
