/* Worldseed: the map fills the screen; the interface floats over it as dark glass panels. */
:root {
  --ink: #eef2f7;
  --ink-2: #b8c2d0;
  --ink-3: #8794a7;
  --glass: rgba(13, 18, 29, 0.86);
  --glass-2: rgba(25, 32, 48, 0.94);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --accent: #ffd23f;
  --accent-ink: #1d1604;
  --war: #ff6b5e;
  --good: #72d68f;
  --radius: 10px;
  --font-pixel: 'Silkscreen', ui-monospace, Menlo, monospace;
  --font-body: 'Schibsted Grotesk', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: #0c1a30; color: var(--ink); font: 14px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
.game { position: fixed; inset: 0; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.panel-body, .inspect dl { -webkit-user-select: text; user-select: text; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
#worldGL { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#worldGL[hidden] { display: none; }
.game[data-tool="inspect"] #world { cursor: grab; }
.game[data-tool="inspect"] #world:active { cursor: grabbing; }

/* ---- pixel logo ---- */
.logo {
  display: inline-block; width: 18px; height: 18px; flex: none; image-rendering: pixelated;
  background:
    linear-gradient(#2fa36b 0 0) 6px 3px / 6px 3px no-repeat,
    linear-gradient(#2fa36b 0 0) 3px 6px / 12px 6px no-repeat,
    linear-gradient(#1f4f8a 0 0) 0 0 / 18px 18px no-repeat;
  border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ---- shared controls ---- */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04); color: var(--ink-2); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.chip:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.icon { width: 32px; padding: 0; }
.chip.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip.primary:hover { filter: brightness(1.08); }
.chip.danger { color: #ffb3ab; border-color: rgba(255, 107, 94, 0.45); }
.chip.danger:hover { background: rgba(255, 107, 94, 0.14); }
.chip.file { position: relative; overflow: hidden; }
.chip.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note { color: var(--ink-3); font-size: 12.5px; margin: 8px 0 0; }

/* ---- top bar ---- */
.hud {
  position: absolute; top: calc(10px + var(--safe-t)); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; pointer-events: none;
}
.hud > * { pointer-events: auto; }
.brand, .stats, .time, .panel-tabs {
  display: flex; align-items: center; gap: 6px; padding: 5px; border-radius: var(--radius);
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.brand { padding: 5px 12px 5px 8px; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--font-pixel); font-size: 15px; letter-spacing: 0.02em; min-height: 44px; }
.brand:hover .logo { transform: rotate(-8deg); }
.logo { transition: transform 0.2s; }
.stats { padding: 0 12px; min-height: 44px; gap: 12px; font-size: 13px; color: var(--ink-3); }
.stat b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.stat.war { color: var(--war); font-weight: 650; }
.mobile-only, .chip .short { display: none; }
.panel-tabs { margin-left: auto; }

/* ---- side panel ---- */
.panel {
  position: absolute; top: calc(var(--hud-h, 56px) + 18px + var(--safe-t)); right: 10px; bottom: 190px; width: min(380px, calc(100% - 20px));
  display: flex; flex-direction: column; border-radius: var(--radius); background: var(--glass-2);
  border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.panel[hidden] { display: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-family: var(--font-pixel); font-size: 14px; font-weight: 700; letter-spacing: 0.03em; }
.panel-body { overflow-y: auto; padding: 10px 12px 16px; flex: 1; }
.panel-body[hidden] { display: none; }
.panel-body h3 { font-family: var(--font-pixel); font-size: 11.5px; font-weight: 400; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin: 14px 0 8px; }
.panel-body section:first-child h3 { margin-top: 4px; }
.empty { color: var(--ink-3); padding: 10px 4px; margin: 0; }

.kingdoms, .fallen ol, .chronicle { list-style: none; margin: 0; padding: 0; }
.kingdoms li + li { margin-top: 6px; }
.kingdom-row {
  width: 100%; display: grid; grid-template-columns: 6px 1fr auto; gap: 4px 10px; align-items: center; text-align: left;
  padding: 9px 10px 9px 0; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); cursor: pointer; overflow: hidden;
}
.kingdom-row:hover, .kingdom-row[aria-current="true"] { background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); }
.kingdom-row .swatch { grid-row: 1 / span 2; align-self: stretch; border-radius: 0 3px 3px 0; }
.kingdom-row .name { font-weight: 650; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kingdom-row .pop { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink); }
.kingdom-row .meta { grid-column: 2 / span 2; font-size: 12.5px; color: var(--ink-3); }
.kingdom-row .meta .war { color: var(--war); }
.fallen { margin-top: 14px; color: var(--ink-3); }
.fallen summary { cursor: pointer; font-size: 13px; padding: 6px 2px; }
.fallen li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 4px 2px; border-top: 1px solid var(--line); }
.fallen li .swatch { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fallen li span:last-child { margin-left: auto; white-space: nowrap; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filters .chip { min-height: 28px; font-size: 12px; }
.chronicle li { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 7px 4px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.chronicle li:first-child { border-top: 0; }
.chronicle li.jump { cursor: pointer; border-radius: 6px; }
.chronicle li.jump:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.chronicle .yr { font-family: var(--font-pixel); font-size: 10.5px; color: var(--ink-3); padding-top: 2px; white-space: nowrap; }
.chronicle .txt::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 7px; background: var(--k, #8794a7); vertical-align: 1px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.legend span::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
#popChart { width: 100%; height: auto; aspect-ratio: 560 / 200; display: block; border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
.toggle { display: flex; gap: 10px; align-items: flex-start; padding: 6px 2px; color: var(--ink-2); cursor: pointer; font-size: 13.5px; }
.toggle input { margin: 3px 0 0; accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions .note { flex-basis: 100%; }

/* ---- inspect card ---- */
.inspect {
  position: absolute; left: 10px; bottom: 190px; width: min(330px, calc(100% - 20px));
  border-radius: var(--radius); background: var(--glass-2); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 12px 14px 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.inspect[hidden] { display: none; }
.inspect .top { display: flex; gap: 12px; align-items: flex-start; }
.inspect .portrait { width: 44px; height: 44px; flex: none; border-radius: 8px; background: rgba(0, 0, 0, 0.3); display: grid; place-items: center; border: 1px solid var(--line); }
.inspect .portrait canvas { image-rendering: pixelated; width: auto; height: 34px; }
.inspect .portrait.swatch { border: 0; }
.inspect h3 { margin: 0; font-size: 16px; line-height: 1.25; }
.inspect .sub { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.inspect .close { margin-left: auto; }
.inspect .hp { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); margin: 12px 0 4px; overflow: hidden; }
.inspect .hp span { display: block; height: 100%; background: var(--good); border-radius: 3px; transition: width 0.25s; }
.inspect .hp.low span { background: var(--war); }
.inspect dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 10px 0 0; font-size: 13px; }
.inspect dt { color: var(--ink-3); }
.inspect dd { margin: 0; text-align: right; color: var(--ink); }
.inspect dd .war { color: var(--war); }
.inspect .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.inspect .gone { color: var(--ink-3); font-size: 13px; margin: 10px 0 0; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; cursor: pointer; font: inherit; text-align: inherit; }
.link:hover { text-decoration-color: var(--ink); }

/* ---- news toasts ---- */
.toasts { position: absolute; top: calc(var(--hud-h, 56px) + 18px + var(--safe-t)); left: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; width: min(420px, calc(100% - 20px)); pointer-events: none; }
.toast {
  pointer-events: auto; cursor: pointer; display: flex; gap: 10px; align-items: baseline; padding: 8px 14px; border-radius: 9px;
  background: var(--glass-2); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); font-size: 13.5px; color: var(--ink);
  animation: toast-in 0.25s ease-out; max-width: 100%;
}
.toast .yr { font-family: var(--font-pixel); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--k, #8794a7); align-self: center; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: opacity 0.3s, transform 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---- toolbar ---- */
.toolbar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(10px + var(--safe-b)); width: min(920px, calc(100% - 20px));
  border-radius: 12px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.groups { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.groups::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid transparent;
  background: none; color: var(--ink-3); font-family: var(--font-pixel); font-size: 12px; letter-spacing: 0.03em; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, 0.06); }
.tab[aria-selected="true"] { color: var(--ink); background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); }
.tab[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); }
.tab canvas { width: 18px; height: 18px; image-rendering: pixelated; }
.sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; flex: none; }
.powers { display: flex; gap: 6px; padding: 8px 0 6px; overflow-x: auto; scrollbar-width: thin; }
.power {
  flex: none; width: 68px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 6px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); color: var(--ink-2); cursor: pointer; font-size: 11.5px; line-height: 1.15; text-align: center;
}
.power:hover { background: rgba(255, 255, 255, 0.09); color: var(--ink); }
.power[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 210, 63, 0.14); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.power canvas { width: 36px; height: 36px; image-rendering: pixelated; border-radius: 4px; }
.tool-info { display: flex; align-items: center; gap: 14px; min-height: 26px; padding: 0 4px; }
.hint { margin: 0; color: var(--ink-3); font-size: 12.5px; flex: 1; min-width: 0; }
.hint.flash { color: var(--accent); }
.brush { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.brush[hidden] { display: none; }
.brush input { width: 120px; accent-color: var(--accent); }
.brush output { width: 18px; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- dialogs ---- */
dialog {
  border: 1px solid var(--line-2); border-radius: 14px; background: #141b29; color: var(--ink); padding: 22px 24px;
  width: min(460px, calc(100% - 24px)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
dialog::backdrop { background: rgba(5, 9, 18, 0.55); backdrop-filter: blur(2px); }
dialog h2 { margin: 0 0 8px; font-family: var(--font-pixel); font-size: 18px; display: flex; gap: 10px; align-items: center; }
dialog p { color: var(--ink-2); margin: 0 0 10px; }
dialog ul { padding-left: 18px; margin: 12px 0; color: var(--ink-2); }
dialog li + li { margin-top: 6px; }
dialog li b { color: var(--ink); }
dialog form > label:not(.toggle) { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
dialog select, dialog input:not([type="checkbox"]) {
  min-height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); color: var(--ink); font-size: 14px;
}
dialog .toggle { margin-top: 12px; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
dialog form[method="dialog"]:only-of-type .chip.primary { margin-top: 8px; }
#welcome form { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---- small screens ---- */
@media (max-width: 1360px) {
  .brand { padding: 5px 8px; }
  .brand span:last-child { display: none; }
}
@media (max-width: 1100px) {
  .time .chip, .panel-tabs .chip { padding: 0 9px; }
}
@media (max-width: 860px) {
  .stats .kingdoms-stat { display: none; }
  .panel-tabs { margin-left: 0; }
  .hud { gap: 6px; }
}
@media (max-width: 640px) {
  html, body { font-size: 13.5px; }
  .hud { top: calc(6px + var(--safe-t)); left: 6px; right: 6px; gap: 6px; }
  .brand { order: 0; }
  .stats { order: 1; flex: 1 1 calc(100% - 60px); justify-content: flex-start; padding-right: 5px; }
  .stat { white-space: nowrap; }
  .stats .pause-btn { margin-left: auto; }
  .time { order: 2; }
  .panel-tabs { order: 3; margin-left: auto; }
  .mobile-only { display: inline-flex; }
  .desktop-only { display: none; }
  .chip .long { display: none; }
  .chip .short { display: inline; }
  .brand span:last-child { display: none; }
  .brand { padding: 5px 8px; min-height: 40px; }
  .stats { min-height: 40px; gap: 10px; padding: 0 10px; font-size: 12.5px; }
  .time, .panel-tabs { gap: 4px; padding: 4px; }
  .time .chip, .panel-tabs .chip { min-height: 30px; padding: 0 6px; font-size: 12px; }
  .game[data-panel-open] .toasts { display: none; }
  .time .chip.icon, .panel-tabs .chip.icon { width: 30px; padding: 0; }
  .time [data-speed="3"] { display: none; }
  .panel { top: auto; left: 6px; right: 6px; width: auto; bottom: calc(176px + var(--safe-b)); max-height: 58vh; }
  .inspect { left: 6px; right: 6px; width: auto; bottom: calc(176px + var(--safe-b)); }
  .toolbar { width: calc(100% - 12px); bottom: calc(6px + var(--safe-b)); padding: 6px; }
  .power { width: 60px; font-size: 11px; }
  .power canvas { width: 32px; height: 32px; }
  .brush input { width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
  * { transition: none !important; }
}

/* ---- seasons, ages, sound ---- */
.season { color: var(--ink-3); font-weight: 500; }
.stat.age { color: var(--accent); font-weight: 650; white-space: nowrap; }
#soundBtn .snd-on { display: none; }
#soundBtn[aria-pressed="true"] .snd-on { display: block; }
#soundBtn[aria-pressed="true"] .snd-off { display: none; }
.age-now { margin: 0 0 8px; color: var(--ink-2); font-size: 13.5px; }
.age-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.age-pick select { min-height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); padding: 0 8px; flex: 1; min-width: 150px; }

/* ---- legends ---- */
.note.intro { margin: 0 0 10px; }
.legends { list-style: none; margin: 0; padding: 0; }
.legend-row {
  width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 2px 10px; align-items: center; text-align: left;
  padding: 8px 10px 8px 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); margin-top: 6px; color: var(--ink-2);
}
button.legend-row { cursor: pointer; }
button.legend-row:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); }
.legend-row.dead { opacity: 0.72; }
.legend-row .badge { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-family: var(--font-pixel); font-size: 12px; color: var(--accent-ink); background: var(--accent); }
.legend-row.dead .badge { background: #6b7280; color: #f1f4f8; }
.legend-row .who { color: var(--ink); font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-row .kills { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 650; }
.legend-row .what { grid-column: 2 / span 2; font-size: 12.5px; color: var(--ink-3); }

/* ---- inspect extras ---- */
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.chips span { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--ink-2); }
.chips span.hero { border-color: var(--accent); color: var(--accent); }
.lore { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); margin-top: 4px; overflow: hidden; }
.lore span { display: block; height: 100%; background: #8fb8ff; }
.inspect details { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.inspect details summary { cursor: pointer; }
.inspect details ol { margin: 6px 0 0; padding-left: 18px; }
.inspect details li { margin: 2px 0; }

/* ---- minimap ---- */
.minimap {
  position: absolute; right: 10px; bottom: 190px; padding: 4px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); line-height: 0;
}
.minimap[hidden] { display: none; }
.minimap canvas { width: 200px; height: auto; border-radius: 6px; cursor: pointer; touch-action: none; }
.game[data-panel-open] .minimap { display: none; }
/* Wide screens have room beside the toolbar, so the minimap can stay in the corner even with a panel open. */
@media (min-width: 1380px) {
  .minimap { bottom: calc(10px + var(--safe-b)); }
  .game[data-panel-open] .minimap { display: block; }
  .game[data-panel-open] .minimap[hidden] { display: none; }
}
@media (max-width: 640px) {
  .minimap { display: none; }
  .stat.age { display: none; }
}

/* ---- map modes ---- */
.map-modes { display: flex; gap: 3px; padding: 0 0 4px; line-height: 1.2; }
.map-modes button {
  flex: 1; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); color: var(--ink-3); border-radius: 6px;
  font-size: 11px; font-weight: 600; padding: 3px 0; cursor: pointer;
}
.map-modes button:hover { color: var(--ink); }
.map-modes button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px; color: var(--ink-2); font-size: 13.5px; }
.field-row select { min-height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05); padding: 0 8px; }
.legend-row .badge.faith { color: #1d1604; }
.legend-row .badge.wonder { background: #8fb8ff; color: #0d1a33; }

/* ---- ruler mode ---- */
.rule-tab .crown, .kingdom-row .crown { color: var(--accent); }
.rule-tab[aria-pressed="true"] .crown { color: inherit; }
.player-stat {
  border: 1px solid rgba(255, 210, 63, 0.45); background: rgba(255, 210, 63, 0.1); color: var(--accent); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; white-space: nowrap; font-size: 12.5px; font-weight: 600;
}
.player-stat b { color: var(--accent); }
.player-stat:hover { background: rgba(255, 210, 63, 0.18); }
.player-stat[hidden] { display: none; }
.envoy-count { color: #fff; margin-left: 4px; }
/* With the gold pill showing, the kingdom count makes room so the bar stays on one line. */
.stats:has(.player-stat:not([hidden])) .kingdoms-stat { display: none; }
.panel-tools { display: flex; gap: 6px; margin-bottom: 10px; }
.panel-tools .chip { min-height: 28px; font-size: 12px; }
.realm-head { display: flex; gap: 12px; align-items: center; }
.realm-head .swatch.big { width: 42px; height: 42px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 22px; color: rgba(10, 14, 22, 0.7); }
.realm-name { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.realm-head .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.purse { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; }
.purse div { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.purse b { display: block; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.purse span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.renown { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.renown b { color: var(--accent); font-size: 15px; }
.realm-effects { margin: 6px 0 0; font-size: 12.5px; color: var(--good); }
.ties { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 10px 0 0; font-size: 13px; }
.ties dt { color: var(--ink-3); }
.ties dd { margin: 0; text-align: right; color: var(--ink-2); }
.ties .war, .meta .war { color: var(--war); }
.envoys, .ambitions, .diplo, .targets ol, .hall { list-style: none; margin: 0; padding: 0; }
.envoys li {
  display: grid; grid-template-columns: 8px 1fr; gap: 6px 10px; align-items: start; padding: 9px 10px; margin-top: 6px; border-radius: 8px;
  border: 1px solid rgba(255, 210, 63, 0.4); background: rgba(255, 210, 63, 0.07); font-size: 13px; color: var(--ink);
}
.envoys .swatch { width: 8px; height: 100%; min-height: 18px; border-radius: 2px; grid-row: 1 / span 2; }
.envoys .btns { display: flex; gap: 6px; }
.envoys .btns .chip { min-height: 28px; font-size: 12px; }
.decrees { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.decree {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; min-height: 44px;
}
.decree b { font-size: 13px; font-weight: 650; color: var(--ink); }
.decree span { font-size: 11.5px; color: var(--accent); }
.decree:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-2); }
.decree[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(255, 210, 63, 0.1); }
.decree[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.decree[aria-disabled="true"] span { color: var(--ink-3); }
.targets { margin-top: 10px; padding: 10px; border-radius: 8px; border: 1px solid var(--accent); background: rgba(255, 210, 63, 0.05); }
.targets .note { margin: 0 0 6px; }
.targets .chip { margin-top: 8px; min-height: 28px; font-size: 12px; }
.target-row, .rule-row {
  width: 100%; display: grid; grid-template-columns: 6px 1fr auto; gap: 1px 10px; align-items: center; text-align: left; padding: 7px 10px 7px 0;
  border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); margin-top: 5px; color: var(--ink-2);
}
button.target-row { cursor: pointer; }
button.target-row:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); }
.target-row .swatch, .rule-row .swatch { grid-column: 1; grid-row: 1 / span 2; align-self: stretch; border-radius: 0 3px 3px 0; }
.rule-row .name { grid-column: 2; grid-row: 1; }
.target-row .name, .rule-row .name { font-weight: 650; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.target-row .meta { grid-column: 2 / span 2; font-size: 12px; color: var(--ink-3); }
.rule-row .meta { grid-column: 2; grid-row: 2; font-size: 12px; color: var(--ink-3); }
.rule-row .chip { grid-column: 3; grid-row: 1 / span 2; min-height: 30px; }
.opinion { font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.opinion.good { color: var(--good); }
.opinion.bad { color: var(--war); }
.ambitions li, .hall li { display: grid; grid-template-columns: 18px 1fr auto; gap: 0 8px; padding: 6px 2px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.hall li { grid-template-columns: 1fr auto; }
.ambitions li:first-child, .hall li:first-child { border-top: 0; }
.ambitions .tick { color: var(--good); font-weight: 700; }
.ambitions .who, .hall .who { color: var(--ink); font-weight: 600; }
.ambitions .num, .hall .num { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 650; }
.ambitions .what { grid-column: 2 / span 2; font-size: 12px; color: var(--ink-3); }
.hall .what { grid-column: 1 / span 2; font-size: 12px; color: var(--ink-3); }
.ambitions li.done .who { color: var(--good); }
.ambitions li.inherited { opacity: 0.6; }
.ambitions li.inherited .tick { color: var(--ink-3); }
.realm-msg { margin: 0 0 8px; padding: 7px 10px; border-radius: 8px; font-size: 13px; background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.realm-msg.ok { background: rgba(114, 214, 143, 0.12); color: #bff0cc; }
.realm-msg.no { background: rgba(255, 107, 94, 0.12); color: #ffc2bb; }
.realm-msg.pick { background: rgba(255, 210, 63, 0.12); color: var(--accent); }
.realm-ended { padding: 10px; border-radius: 8px; background: rgba(255, 210, 63, 0.08); border: 1px solid rgba(255, 210, 63, 0.35); color: var(--ink); font-size: 13px; margin: 0 0 10px; }
#realmBody .row { display: flex; gap: 8px; margin-top: 16px; }
.reign-score { color: var(--ink); }
.reign-score b { color: var(--accent); font-size: 18px; }
#reignDialog h3 { font-family: var(--font-pixel); font-size: 11.5px; font-weight: 400; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin: 14px 0 6px; }
#reignDialog .hall { max-height: 220px; overflow-y: auto; }

/* ---- atlas ---- */
dialog.atlas { width: min(800px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px 20px; }
.atlas-head { display: flex; align-items: center; gap: 12px; }
.atlas-head h2 { margin: 0; }
.atlas-year { font-family: var(--font-pixel); color: var(--accent); font-size: 15px; }
#atlasClose { margin-left: auto; }
dialog.atlas .note { margin: 6px 0 0; }
#atlasMap { width: 100%; height: auto; display: block; border-radius: 8px; background: #0c1a30; margin-top: 10px; }
.atlas-controls { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.atlas-controls .chip { min-width: 92px; }
.atlas-controls input { flex: 1; accent-color: var(--accent); }
.atlas-names { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.atlas-names li[data-kingdom] { cursor: pointer; }
.atlas-names li[data-kingdom]:hover { color: var(--ink); text-decoration: underline; }
.atlas-names li::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
dialog.atlas h3 { font-family: var(--font-pixel); font-size: 11.5px; font-weight: 400; color: var(--ink-3); letter-spacing: 0.06em; text-transform: uppercase; margin: 16px 0 0; }
.atlas-timeline { max-height: 280px; overflow-y: auto; border-radius: 8px; background: rgba(0, 0, 0, 0.22); margin-top: 8px; }
#atlasTimeline { width: 100%; display: block; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 640px) {
  .purse { grid-template-columns: repeat(2, 1fr); }
  .stats .player-stat { display: none; }
  .rule-tab .crown { font-size: 15px; }
  .panel-tabs { gap: 3px; padding: 3px; }
  .panel-tabs .chip { padding: 0 6px; }
  .panel-tabs .rule-tab { padding: 0 7px; }
  dialog.atlas { padding: 14px; }
}
@media (max-width: 400px) {
  .time { gap: 3px; padding: 3px; }
  .time .chip, .panel-tabs .chip { padding: 0 5px; font-size: 11.5px; }
  .panel-tabs .rule-tab { padding: 0 6px; }
}
@media (max-width: 370px) {
  .time .chip, .panel-tabs .chip { padding: 0 4px; font-size: 11px; }
  .panel-tabs .rule-tab { padding: 0 5px; }
}

/* ---- wars, houses, lives ---- */
.legend-row .badge.war-badge { background: #5a2e2b; color: #ffd9cf; font-family: inherit; font-size: 15px; }
.legend-row .badge.war-badge.live { background: var(--war); color: #2a0d0a; }
.legend-row .badge.house-badge { color: rgba(10, 14, 22, 0.75); font-family: inherit; font-size: 15px; }
.legend-row.dead .badge.house-badge { opacity: 0.7; }
.legend-row .what i { font-style: normal; color: var(--ink-3); }
.side { white-space: nowrap; color: var(--ink-2); }
.side::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; background: var(--c); vertical-align: 0; }
.legend-row[aria-expanded="true"] { border-color: var(--line-2); background: rgba(255, 255, 255, 0.07); }
.war-detail, .reigns { margin: 4px 0 8px 10px; padding: 8px 10px; border-left: 2px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); }
.war-detail .score { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: #333; }
.war-detail .score span:last-child { flex: 1; }
.war-detail .note { margin: 6px 0; }
.battles, .reigns { list-style: none; padding-left: 10px; }
.battles li, .reigns li { padding: 3px 0; }
.battles li span, .reigns li span { color: var(--ink-3); }
.life { list-style: none; margin: 8px 0 0; padding: 0; }
.life li { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.life li:first-child { border-top: 0; }
.life .yr { font-family: var(--font-pixel); font-size: 10.5px; color: var(--ink-3); padding-top: 2px; }
#bioDialog .life { max-height: 60vh; overflow-y: auto; }
.inspect details .life li { grid-template-columns: 44px 1fr; font-size: 12px; }
.arts { color: var(--ink-3); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }

/* ---- history book ---- */
dialog.book { width: min(720px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px 22px; }
.chapter { margin-top: 18px; padding: 2px 0 2px 14px; border-left: 3px solid var(--c, var(--line-2)); }
.chapter h3 { margin: 0; font-family: var(--font-pixel); font-size: 14px; font-weight: 400; color: var(--ink); letter-spacing: 0.02em; }
.chapter .years { margin: 2px 0 8px; font-size: 12px; color: var(--ink-3); }
.chapter p { font-size: 14px; line-height: 1.55; color: var(--ink-2); margin: 0 0 8px; }

/* ---- charts and feats ---- */
#realmChart { width: 100%; height: auto; aspect-ratio: 560 / 200; display: block; border-radius: 8px; background: rgba(0, 0, 0, 0.22); }
#realmLegend span { opacity: 0.7; }
#realmLegend span.alive { opacity: 1; color: var(--ink); }
.feat-count { color: var(--accent); margin-left: 6px; }
.feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.feats li { display: grid; grid-template-columns: 20px 1fr; gap: 0 6px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); font-size: 12.5px; color: var(--ink-3); }
.feats li .medal { grid-row: 1 / span 2; color: var(--ink-3); font-size: 15px; line-height: 1.1; }
.feats li .who { color: var(--ink-2); font-weight: 600; }
.feats li .what { font-size: 11.5px; }
.feats li.got { border-color: rgba(255, 210, 63, 0.45); background: rgba(255, 210, 63, 0.07); }
.feats li.got .medal, .feats li.got .who { color: var(--accent); }

/* ---- research ---- */
.research-now { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.research-now b { color: #7fe0d2; }
.techs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.tech { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); cursor: pointer; }
.tech b { font-size: 13px; color: var(--ink); }
.tech span { font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.tech:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-2); }
.tech[aria-pressed="true"] { border-color: #7fe0d2; box-shadow: inset 0 0 0 1px #7fe0d2; background: rgba(127, 224, 210, 0.08); }
@media (max-width: 640px) {
  .feats, .techs { grid-template-columns: 1fr; }
}
.legend-row[data-war] .who { white-space: normal; }

/* ---- the atomic age ---- */
.muted { color: var(--ink-3); }
.hot, .chips span.hot { color: #b6ff4d; border-color: rgba(182, 255, 77, 0.5); }

/* ---- your worlds ---- */
.worlds { list-style: none; margin: 0; padding: 0; }
.worlds li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 8px 10px; margin-top: 6px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.worlds li.current { border-color: rgba(255, 210, 63, 0.45); background: rgba(255, 210, 63, 0.06); }
.worlds .who { color: var(--ink); font-weight: 650; font-size: 13.5px; }
.worlds li.current .who { color: var(--accent); }
.worlds .btns { display: flex; gap: 6px; }
.worlds .btns .chip { min-height: 28px; font-size: 12px; }
.worlds .what { grid-column: 1 / span 2; font-size: 12px; color: var(--ink-3); }

/* ---- great moments ---- */
.titlecard {
  position: absolute; left: 50%; top: calc(var(--hud-h, 56px) + 8vh); transform: translateX(-50%); width: min(760px, calc(100% - 32px));
  text-align: center; pointer-events: none; animation: card-in 0.6s cubic-bezier(.2,.8,.2,1);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 0, 0, 0.55);
}
.titlecard[hidden] { display: none; }
.titlecard.out { opacity: 0; transform: translateX(-50%) translateY(-10px); transition: opacity 0.45s, transform 0.45s; }
.tc-kicker { font-family: var(--font-pixel); font-size: 13px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--c, var(--accent)); }
.tc-title { font-family: var(--font-pixel); font-size: clamp(26px, 5vw, 50px); line-height: 1.1; color: #fff; margin: 6px 0 8px; }
.tc-title::after { content: ''; display: block; width: 120px; height: 3px; margin: 10px auto 0; background: var(--c, var(--accent)); border-radius: 2px; }
.tc-sub { font-size: 15px; color: #e8edf3; max-width: 620px; margin: 0 auto; }
@keyframes card-in { from { opacity: 0; transform: translateX(-50%) scale(0.94); letter-spacing: 0.04em; } }

/* ---- director mode ---- */
.game.director .toolbar, .game.director .panel, .game.director .minimap, .game.director .inspect, .game.director .toasts,
.game.director .stats, .game.director .time, .game.director .panel-tabs > .chip:not(.director-btn), .game.director .brand { display: none !important; }
.game.director .hud { justify-content: flex-end; }
.game.director::before, .game.director::after { content: ''; position: absolute; left: 0; right: 0; height: 7vh; background: #000; z-index: 5; pointer-events: none; animation: bars-in 0.6s ease; }
.game.director::before { top: 0; }
.game.director::after { bottom: 0; }
@keyframes bars-in { from { height: 0; } }
.game.director .hud { z-index: 6; }
.director-bar {
  position: absolute; left: 12px; right: 12px; margin: 0 auto; width: fit-content; bottom: calc(7vh + 14px); z-index: 6; display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 14px; border-radius: 999px; background: rgba(8, 12, 20, 0.78); border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.director-bar[hidden] { display: none; }
.director-bar .rec { width: 9px; height: 9px; border-radius: 50%; background: #ff4d3d; animation: rec 1.4s infinite; flex: none; }
.director-bar .caption { font-size: 14px; color: #f1f4f8; min-width: 0; }
.director-bar .chip { flex: none; min-height: 30px; font-size: 12px; }
@keyframes rec { 50% { opacity: 0.25; } }
@media (max-width: 640px) {
  .tc-sub { font-size: 13px; }
  .director-bar .caption { font-size: 12.5px; }
}
@media (max-width: 640px) {
  .stats .director-btn { margin-left: auto; }
  .stats .director-btn + .pause-btn { margin-left: 0; }
}
.field-row input[type="range"] { width: 150px; accent-color: var(--accent); }

/* ---- scenarios ---- */
dialog.wide { width: min(760px, calc(100% - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 18px 20px; }
.scenarios { list-style: none; margin: 10px 0 0; padding: 0; }
.scenarios li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 12px; margin-top: 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.sc-icon { font-size: 26px; text-align: center; }
.sc-body b { color: var(--ink); font-size: 15px; }
.sc-body p { margin: 3px 0 0; font-size: 13px; color: var(--ink-2); }
.sc-body .sc-goal { color: var(--ink-3); font-size: 12.5px; }
.sc-rec { display: block; margin-top: 5px; font-size: 12px; color: var(--ink-3); }
.sc-stars { color: var(--accent); letter-spacing: 0.1em; margin-right: 6px; }
.sc-stars.dim { color: var(--ink-3); }
.scenario-now { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 210, 63, 0.45); background: rgba(255, 210, 63, 0.07); font-size: 13px; color: var(--ink-2); }
.scenario-now[hidden] { display: none; }
.scenario-now b { color: var(--accent); }
.result-stars { font-size: 34px; color: var(--accent); letter-spacing: 0.15em; margin: 4px 0 8px; }
#scenarioResult .row { flex-wrap: wrap; }
.goal-bar {
  position: absolute; left: 12px; right: 12px; margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); top: calc(var(--hud-h, 56px) + 16px);
  display: flex; gap: 12px; align-items: center; padding: 6px 14px; border-radius: 999px; z-index: 3;
  background: rgba(8, 12, 20, 0.82); border: 1px solid rgba(255, 210, 63, 0.4); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer;
}
.goal-bar[hidden] { display: none; }
.goal-bar .g-name { font-weight: 650; color: var(--accent); white-space: nowrap; }
.goal-bar .g-progress { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-bar .g-faith { color: #ffe9a8; white-space: nowrap; }
.goal-bar.alarm { border-color: #ff4d3d; animation: rec 1s infinite; }
.game[data-panel-open] .goal-bar { right: 400px; }
.game.director .goal-bar { display: none; }
.power .cost { position: absolute; top: 2px; right: 3px; font-size: 10px; color: #ffe9a8; font-weight: 650; }
.power { position: relative; }
.preparing { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 9, 18, 0.7); backdrop-filter: blur(3px); }
.preparing[hidden] { display: none; }
.preparing > div { display: flex; gap: 12px; align-items: center; padding: 14px 20px; border-radius: 12px; background: #141b29; border: 1px solid var(--line-2); font-size: 15px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.lang-switch { display: inline-flex; gap: 4px; margin-right: auto; }
.lang-switch .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--ink); }
@media (max-width: 640px) {
  .scenarios li { grid-template-columns: 32px 1fr; }
  .scenarios li .chip { grid-column: 1 / span 2; justify-self: end; }
  .game[data-panel-open] .goal-bar { right: 12px; }
  .goal-bar { top: calc(var(--hud-h, 56px) + 10px); font-size: 12px; gap: 8px; }
  .goal-bar .g-name { display: none; }
}

/* ---- tutorial ---- */
.tutorial {
  position: absolute; left: 10px; bottom: 196px; width: min(360px, calc(100% - 20px)); z-index: 4; padding: 12px 14px; border-radius: 12px;
  background: #141b29; border: 1px solid rgba(255, 210, 63, 0.55); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}
.tutorial[hidden] { display: none; }
.tut-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tut-step { font-family: var(--font-pixel); font-size: 11px; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.tut-top .link { font-size: 12px; color: var(--ink-3); }
.tutorial p { margin: 8px 0 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.tut-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 8px; min-height: 0; }
.tut-row:empty { display: none; }
.tut-done { color: var(--good); font-weight: 650; font-size: 13px; }
.tut-done[hidden] { display: none; }
.tut-hl { outline: 2px solid var(--accent) !important; outline-offset: 2px; animation: tut-pulse 1.2s ease-in-out infinite; position: relative; z-index: 2; }
@keyframes tut-pulse { 50% { outline-color: rgba(255, 210, 63, 0.25); box-shadow: 0 0 0 6px rgba(255, 210, 63, 0.12); } }
.game.director .tutorial { display: none; }
@media (max-width: 640px) {
  .tutorial { left: 6px; right: 6px; width: auto; bottom: calc(180px + var(--safe-b)); }
  .tutorial p { font-size: 13px; }
}
.tutorial [hidden] { display: none !important; }
