/* css/style.css - Risk game shell (DESIGN.md section 5)
   Dark "war room" theme. Body never scrolls; the side panel scrolls internally.
   Works at 1366x768 and 1920x1080. */

:root {
  --bg: #0b1220;
  --panel: #121a2b;
  --panel-2: #182236;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8edf5;
  --muted: #9aa6ba;
  --accent: #ffd54a;
  --accent-2: #d9a441;
  --danger: #e23b3b;
  --ok: #2ead5b;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --panel-w: 340px;
  --topbar-h: 48px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 var(--font);
}

button { font-family: inherit; }
[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; font-weight: 700; }
.muted { color: var(--muted); font-weight: 400; }
.error { color: #ff8a80; font-weight: 600; margin: 8px 0 0; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, #26324a, #1b2538);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s ease, filter 0.12s ease, background 0.12s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.big { padding: 13px 26px; font-size: 17px; border-radius: 10px; }
.btn.primary {
  background: linear-gradient(180deg, #e0b04c, #b98424);
  border-color: rgba(255, 255, 255, 0.25);
  color: #1a1204;
}
.btn.danger { background: linear-gradient(180deg, #d4473f, #a82c26); border-color: rgba(255, 255, 255, 0.2); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.forced { animation: forcedPulse 1.1s ease-in-out infinite; }
@keyframes forcedPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 74, 0.0); }
  50% { box-shadow: 0 0 0 5px rgba(255, 213, 74, 0.35); }
}

/* Segmented control (used on setup + settings) */
.seg {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}
.seg button {
  padding: 7px 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.seg button + button { border-left: 1px solid rgba(255, 255, 255, 0.1); }
.seg button.on { background: var(--accent-2); color: #1a1204; }
.seg.small button { padding: 5px 9px; font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Screens                                                             */
/* ------------------------------------------------------------------ */
.screen { position: fixed; inset: 0; }

/* ------------------------------------------------------------------ */
/* Setup screen                                                        */
/* ------------------------------------------------------------------ */
#setup {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.setup-bg { position: absolute; inset: 0; overflow: hidden; z-index: 0; }
.setup-bg img, .setup-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.setup-bg video { opacity: 1; }
.setup-shade {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(5, 9, 18, 0.15) 0%, rgba(5, 9, 18, 0.55) 70%, rgba(5, 9, 18, 0.85) 100%),
    linear-gradient(180deg, rgba(5, 9, 18, 0.25), rgba(5, 9, 18, 0.35));
}
.setup-card {
  position: relative;
  z-index: 1;
  width: min(1040px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: rgba(14, 20, 34, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  padding: 22px 28px 24px;
}
.setup-head { text-align: center; margin-bottom: 14px; }
.title {
  font-size: 56px;
  letter-spacing: 0.18em;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 2px 0 #7a5a10, 0 6px 24px rgba(255, 213, 74, 0.35);
}
.subtitle { margin: 6px 0 0; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; }

.setup-body { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; }
.setup-col h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }

.player-row {
  display: grid;
  grid-template-columns: 22px minmax(150px, 1fr) auto auto auto auto auto;   /* num, name (room for the commander names), mic note, swatches, Human/AI, difficulty, remove */
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  margin-bottom: 6px;
}
.player-row .num { color: var(--muted); font-weight: 700; text-align: center; }
.player-row input[type="text"] {
  width: 100%;
  min-width: 90px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font: 14px var(--font);
}
.swatches { display: flex; gap: 3px; flex: none; }
.player-row .seg { width: max-content; flex: none; }
.swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35); }
.swatch.taken { opacity: 0.35; }
/* White = the British Army: the Union Jack stands in for the colour dot (setup swatch, banners, remark strip, fact card, handover) */
.swatch.uk, .chip.uk, .pc.uk { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'><clipPath id='t'><path d='M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z'/></clipPath><path d='M0,0 v30 h60 V0 z' fill='%23012169'/><path d='M0,0 L60,30 M60,0 L0,30' stroke='%23fff' stroke-width='6'/><path d='M0,0 L60,30 M60,0 L0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/><path d='M30,0 v30 M0,15 h60' stroke='%23fff' stroke-width='10'/><path d='M30,0 v30 M0,15 h60' stroke='%23C8102E' stroke-width='6'/></svg>") !important; background-size: cover !important; background-position: center !important; }
.player-row select {
  padding: 6px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1b2538;
  color: var(--text);
  font: 12px var(--font);
}
.player-row .btn-remove {
  width: 28px; height: 28px;
  padding: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.row-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }

.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: 0; }
.opt .seg { flex: none; }            /* the Off/On toggle never shrinks or clips: the label wraps instead */
.opt-label { font-weight: 600; min-width: 0; }

/* Sound & commentary controls (setup screen + Settings dialog) */
.vol { display: flex; align-items: center; gap: 8px; }
.vol input[type="range"] { width: 150px; accent-color: var(--accent); height: 26px; cursor: pointer; }
.vol-val { min-width: 2.2em; text-align: right; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.voice-select {
  max-width: 230px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #1b2538;
  color: var(--text);
  font: 13px var(--font);
  cursor: pointer;
}
.voice-select:disabled { opacity: 0.55; cursor: default; }
.voice-name { font-weight: 700; color: var(--accent); white-space: nowrap; }
/* setup rows: the general knows this name (microphone) / will use the colour (faint note) */
.mic-note { flex: none; font-size: 11px; line-height: 1.15; color: var(--muted); opacity: 0.7; width: 56px; }   /* "called by colour" wraps to two lines so the name box keeps its room */
.mic-note.known { font-size: 14px; opacity: 1; text-align: center; }   /* same width as the note so the name fields line up */
.seg button:disabled { opacity: 0.45; cursor: default; }
.speaker { font-size: 16px; line-height: 1; flex: none; animation: speakPulse 0.9s ease-in-out infinite; }
#p-banner .speaker { margin-left: auto; }
@keyframes speakPulse { 0%, 100% { opacity: 0.45; transform: scale(0.92); } 50% { opacity: 1; transform: scale(1.1); } }

.setup-actions { display: flex; gap: 12px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ */
/* Game layout                                                         */
/* ------------------------------------------------------------------ */
#game {
  display: grid;
  grid-template-columns: 1fr var(--panel-w);
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "top top" "board panel";
}
#topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(180deg, #151e31, #0f1626);
  border-bottom: 1px solid var(--line);
}
.tb-left { display: flex; align-items: baseline; gap: 14px; }
.tb-title { font-weight: 800; letter-spacing: 0.2em; color: var(--accent); font-size: 20px; }
.tb-turn { color: var(--muted); font-weight: 600; }
.tb-right { display: flex; gap: 8px; }

#board-wrap {
  grid-area: board;
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 6px;
  background: #0a1a33 url("../assets/img/ocean.jpg") center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#board-wrap::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%);
}
#board {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  font-family: var(--font);
}

/* Territory paths */
#board .terr {
  stroke-linejoin: round;
  transition: filter 0.12s ease;
  cursor: default;
}
#board .terr.clickable { cursor: pointer; }
#board .terr.clickable:hover { filter: brightness(1.22); }
#board .terr:hover { filter: brightness(1.12); }
#board .terr.sel { filter: brightness(1.28) drop-shadow(0 0 10px rgba(255, 255, 255, 0.85)); }
#board .coast { fill: none; pointer-events: none; stroke: #fff; stroke-opacity: 0.3; stroke-width: 1.2; }
#board .sea-route { fill: none; stroke: #cfe6ff; stroke-opacity: 0.75; stroke-width: 2.5; stroke-dasharray: 8 7; stroke-linecap: round; pointer-events: none; }

/* Highlight outlines drawn on top of everything */
#board .outline { fill: none; pointer-events: none; display: none; stroke-linejoin: round; }
#board .outline.sel { display: block; stroke: #ffffff; stroke-width: 5; }
#board .outline.target { display: block; stroke: var(--accent); stroke-width: 4; animation: targetPulse 0.9s ease-in-out infinite; }
#board .outline.src { display: block; stroke: rgba(255, 255, 255, 0.9); stroke-width: 4; stroke-dasharray: 10 7; stroke-linecap: round; animation: srcDash 1.2s linear infinite; }
@keyframes targetPulse {
  0%, 100% { stroke-width: 3; stroke-opacity: 0.55; }
  50% { stroke-width: 7; stroke-opacity: 1; }
}
@keyframes srcDash { to { stroke-dashoffset: -34; } }

/* Badges + names */
#board .badge { pointer-events: none; }
#board .badge circle { stroke: #ffffff; stroke-width: 2; }
#board .badge .tnum { font-size: 20px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
#board .badge .tname {
  font-size: 16px;
  font-weight: 700;
  text-anchor: middle;
  fill: #fff;
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 3.5;
  paint-order: stroke fill;
  stroke-linejoin: round;
  letter-spacing: 0.01em;
}
#board .badge.flash circle:not(.halo) { animation: badgeFlash 0.5s ease-out; }
@keyframes badgeFlash { 0% { stroke-width: 10; stroke: #fff; } 100% { stroke-width: 2; } }
#board .cont-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  fill: rgba(255, 255, 255, 0.6);
  stroke: rgba(0, 0, 0, 0.6);
  stroke-width: 3;
  paint-order: stroke fill;
  text-anchor: middle;
  pointer-events: none;
}
#board .cont-label .bonus { font-size: 15px; letter-spacing: 0.08em; fill: var(--accent); }

/* ------------------------------------------------------------------ */
/* Side panel                                                          */
/* ------------------------------------------------------------------ */
#panel {
  grid-area: panel;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--panel);
  border-left: 1px solid var(--line);
  padding: 12px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: #2b3852 transparent;
}
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb { background: #2b3852; border-radius: 4px; }
/* Blocks keep their natural height (never squeezed to hide a line of text);
   the battle log is the one block that grows to fill any spare room, and the
   panel only scrolls when the fixed blocks genuinely do not fit. */
#panel > * { flex: none; }
#panel > .p-section:last-of-type { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 120px; }
#panel > .p-section:last-of-type h3 { flex: none; }

#p-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-left: 8px solid #888;
}
.p-color { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.6); flex: none; }
.p-name { font-size: 18px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-sub { color: var(--muted); font-size: 12px; }

#p-stepper {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
#p-stepper li {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
#p-stepper li .step-num {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}
#p-stepper li.active { background: rgba(255, 213, 74, 0.16); color: var(--accent); border-color: rgba(255, 213, 74, 0.5); }
#p-stepper li.active .step-num { background: var(--accent); color: #1a1204; }
#p-stepper li.done { color: #7fa46f; }
#p-stepper.setup li { opacity: 0.5; }

.p-info {
  padding: 10px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.4;
}
.p-info strong { color: var(--accent); }
.p-info.ai { color: var(--muted); font-style: italic; }
.p-actions { display: flex; flex-direction: column; gap: 6px; }
.p-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.p-actions .btn { width: 100%; padding: 10px 10px; }

/* Inline dice flash for cinematics = off */
.p-dice {
  padding: 8px 10px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  font-size: 13px;
  animation: fadeIn 0.15s ease;
}
.p-dice .who { color: var(--muted); margin-bottom: 4px; }
.p-dice .dice-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.p-dice .dice-row .vs { color: var(--muted); font-weight: 700; }
.die {
  width: 24px; height: 24px;
  border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
  background: #fff; color: #111;
  border: 2px solid rgba(0, 0, 0, 0.35);
}
.die.win { box-shadow: 0 0 0 2px var(--accent); }
.die.lose { opacity: 0.55; }
.p-dice .result { margin-top: 4px; font-weight: 700; }
.p-dice .result.captured { color: var(--accent); }

.p-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
}

.p-cards { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.card {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px 5px 6px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f3ead6, #d9cbaa);
  color: #2a1e08;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  cursor: default;
}
.card .ico { font-size: 16px; line-height: 1; width: 18px; text-align: center; }
.card.infantry .ico { color: #2f6de1; }
.card.cavalry .ico { color: #2ead5b; }
.card.artillery .ico { color: #b23a2c; }
.card.wild { background: linear-gradient(180deg, #ffe58a, #e0b23a); }
.card.wild .ico { color: #6a4a00; }
.card.pick { cursor: pointer; }
.card.pick:hover { filter: brightness(1.08); }
.card.chosen { outline: 3px solid var(--accent); }
.card.owned { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cards-hidden { color: var(--muted); font-style: italic; font-size: 13px; }
.card-legend { width: 100%; font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.card-legend .ico { font-size: 13px; }

/* "Skip to my turn" while the computers play */
.p-actions .btn.skip-ai { border-color: rgba(255, 213, 74, 0.5); }
.speed-row { display: flex; align-items: center; gap: 8px; }
.speed-row .end { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.p-players { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-players th { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; padding: 2px 4px; }
.p-players td { padding: 4px; border-top: 1px solid var(--line); }
.p-players td.num, .p-players th.num { text-align: right; }
.p-players .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(255, 255, 255, 0.5); }
.p-players tr.current td { background: rgba(255, 213, 74, 0.08); }
.p-players tr.dead td { opacity: 0.4; text-decoration: line-through; }
.p-players .tag { font-size: 10px; color: var(--muted); margin-left: 4px; }

.p-continents { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.cont {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  border-left: 5px solid rgba(255, 255, 255, 0.15);
}
.cont .cname { font-weight: 700; flex: 1; }
.cont .cowner { color: var(--muted); }
.cont.owned .cowner { font-weight: 700; }
.cont.owned .cowner { font-weight: 700; }

.p-log {
  flex: 1 1 0px;
  min-height: 80px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
}
.p-log .line { padding: 3px 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.03); }
.p-log .line.turn { background: rgba(255, 213, 74, 0.1); color: var(--accent); font-weight: 700; }
.p-log .line.capture { color: #ffe79a; }
.p-log .line.big { color: #ff9f9f; font-weight: 700; }
.p-log .line .pc { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ------------------------------------------------------------------ */
/* Tooltip, toast                                                      */
/* ------------------------------------------------------------------ */
#tooltip {
  position: fixed;
  z-index: 800;
  pointer-events: none;
  background: rgba(8, 12, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.35;
  box-shadow: var(--shadow);
  max-width: 240px;
}
#tooltip .tt-name { font-weight: 800; font-size: 14px; }
#tooltip .tt-row { color: var(--muted); }
#tooltip .tt-row b { color: var(--text); font-weight: 600; }
#tooltip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: -1px; border: 1px solid rgba(255, 255, 255, 0.5); }

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 9700; /* above the PAUSED overlay too ("Game saved" from the pause screen) */
  pointer-events: none;
  background: rgba(8, 12, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: fadeIn 0.15s ease;
}
#toast.err { border-color: var(--danger); color: #ffb3b3; }
#toast.up { bottom: auto; top: 58px; }   /* while a fact card sits in a bottom corner (ui.js toast) */

/* ------------------------------------------------------------------ */
/* Modal dialogs                                                       */
/* ------------------------------------------------------------------ */
#modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(3, 6, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.12s ease;
}
/* The card is a flex column: title and footer buttons stay pinned, only the
   body scrolls, so the action buttons are always on screen. */
.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #1a2438, #121a2b);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px 22px 18px;
}
#modal.wide .modal-card { width: min(760px, 100%); }
.modal-title { flex: none; font-size: 22px; margin-bottom: 12px; letter-spacing: 0.02em; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; font-size: 15px; line-height: 1.5; scrollbar-width: thin; }
.modal-body p { margin: 0 0 10px; }
.modal-footer { flex: none; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.modal-footer .btn { min-width: 130px; padding: 12px 20px; font-size: 16px; }
.modal-footer .btn.big { min-width: 160px; }

/* Versus header used by attack / occupy / fortify dialogs */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 12px; }
.versus .side { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border-left: 6px solid #888; }
.versus .side .who { font-size: 12px; color: var(--muted); }
.versus .side .terr { font-size: 17px; font-weight: 800; }
.versus .side .armies { font-size: 26px; font-weight: 800; }
.versus .side .armies small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.versus .arrow { font-size: 26px; color: var(--muted); }

.dice-pick { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.dice-pick .label { color: var(--muted); margin-right: 4px; }
.dice-pick button {
  width: 44px; height: 44px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.dice-pick button.on { background: var(--accent); color: #1a1204; border-color: var(--accent); }
.dice-pick button:disabled { opacity: 0.3; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 13px; }

.slider-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 28px; }
.slider-row .val { font-size: 26px; font-weight: 800; min-width: 44px; text-align: center; color: var(--accent); }
.split { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.split b { color: var(--text); font-size: 15px; }

/* Trade dialog */
.sets { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; max-height: 46vh; overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.sets-more { align-self: flex-start; }
.set .card.bonus-pick { cursor: pointer; }
.set .card.bonus-pick:hover { filter: brightness(1.08); }
.set .card.bonus-pick.chosen { outline: 3px solid var(--accent); }
.set .card.bonus-pick .plus2 { font-size: 10px; font-weight: 800; color: #6a4a00; margin-left: 2px; }
.set .pick-hint { width: 100%; font-size: 12px; color: var(--muted); }
.set {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}
.set:hover { border-color: rgba(255, 255, 255, 0.3); }
.set.on { border-color: var(--accent); background: rgba(255, 213, 74, 0.08); }
.set .set-note { margin-left: auto; font-size: 12px; color: var(--muted); }
.set .set-note b { color: var(--accent); }
.set .sugg { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); font-weight: 800; }

/* Mission / handover */
.mission-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 213, 74, 0.08);
  border: 1px dashed rgba(255, 213, 74, 0.5);
  font-size: 17px;
  font-weight: 600;
}
.handover { text-align: center; padding: 8px 0 4px; }
.handover .big-name { font-size: 30px; font-weight: 800; margin: 10px 0 4px; }
.handover .chip { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto; border: 3px solid rgba(255, 255, 255, 0.6); }

/* Stats table (game over) */
.stats { width: 100%; border-collapse: collapse; margin-top: 6px; }
.stats th, .stats td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats tr.winner td { color: var(--accent); font-weight: 800; }
.winner-line { font-size: 20px; font-weight: 800; }

/* Settings */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .lbl { font-weight: 700; }
.settings-row .lbl small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.settings-row input[type="range"] { width: 180px; accent-color: var(--accent); }

.rules h4 { margin: 12px 0 4px; color: var(--accent); font-size: 15px; }
.rules ul { margin: 0 0 6px; padding-left: 20px; }
.rules li { margin-bottom: 3px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------------ */
/* Responsive: narrower panel on laptop screens                        */
/* ------------------------------------------------------------------ */
@media (max-width: 1500px) {
  :root { --panel-w: 300px; --topbar-h: 44px; }
  #panel { padding: 8px 10px 12px; gap: 8px; }
  .p-name { font-size: 16px; }
  #p-banner { padding: 7px 10px; }
  .p-color { width: 28px; height: 28px; }
  #p-stepper li { padding: 5px 4px; }
  .p-info { padding: 8px 10px; font-size: 13px; }
  .p-actions .btn { padding: 8px 8px; font-size: 13px; }
  .p-section h3 { margin-bottom: 4px; }
  .p-players td { padding: 2px 4px; }
  .p-continents { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .cont { padding: 3px 5px; font-size: 11px; gap: 4px; min-width: 0; border-left-width: 4px; }
  .cont .cname, .cont .cowner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .cont .cowner { max-width: 50%; }
  .card { font-size: 11px; padding: 4px 7px 4px 5px; }
  #panel > .p-section:last-of-type { min-height: 110px; }
}
@media (max-height: 800px) {
  .setup-card { padding: 14px 22px 16px; }
  .title { font-size: 44px; }
  .setup-head { margin-bottom: 8px; }
}

/* ------------------------------------------------------------------ */
/* Setup order + battle-video policy (owner fixes, 2026-09-04)         */
/* ------------------------------------------------------------------ */
/* "Battle videos" option: four long labels, so label above a vertical seg */
.opt.stack { flex-direction: column; align-items: stretch; gap: 6px; }
.seg.vert { flex-direction: column; }
.seg.vert button { text-align: left; }
.seg.vert button + button { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.settings-row .seg { flex-shrink: 0; }
.settings-row .lbl { min-width: 0; }
.settings-row .seg.vert { min-width: 250px; }
/* Settings (12 rows since the General's remarks / computer-facts rows, 2026-09-04): two columns on a
   laptop-or-wider window so the whole dialog fits 1366x768 without scrolling; one column below that. */
#modal.settings .modal-card { width: min(1000px, 100%); }
@media (min-width: 1100px) {
  #modal.settings .modal-body { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; align-items: start; }
  #modal.settings .settings-row { padding: 8px 0; }
  #modal.settings .settings-row:last-child { border-bottom: 1px solid var(--line); }
  #modal.settings .settings-row .seg.vert { min-width: 230px; }
}

/* "Auto-place for me for the rest of setup" tick box in the side panel */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; padding: 4px 2px; user-select: none; }
.check-row input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.check-row.on { color: var(--text); }

/* The territory that just received a setup army pulses so the "me, you, them" order is visible */
#board .outline.pulse { display: block; stroke: #ffffff; stroke-width: 6; animation: placePulse 0.6s ease-out; }
@keyframes placePulse {
  0% { stroke-width: 14; stroke-opacity: 1; }
  100% { stroke-width: 2; stroke-opacity: 0; }
}
/* Both territories flash when the computer attacks the human without a clip */
#board .terr.hit { animation: terrHit 0.55s ease-in-out 3; }
@keyframes terrHit {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.9) saturate(1.3); }
}
/* Compact battle card in the side panel (computer attacks the human, no clip) */
.p-dice.battle-card { border-color: rgba(255, 213, 74, 0.5); box-shadow: 0 0 0 1px rgba(255, 213, 74, 0.15); }
.p-dice .arrow { color: var(--accent); font-weight: 800; padding: 0 4px; }
.p-dice .who .pc { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ------------------------------------------------------------------ */
/* Board art: illustrated (painted continents, default) vs classic     */
/* ------------------------------------------------------------------ */
/* Classic: no paintings, no rings, no badge halo - the flat fills as before. */
#board.classic #layer-art, #board.classic .ring, #board.classic .wash, #board.classic .badge .halo { display: none; }

/* Illustrated: territories are see-through hit areas over the painting. */
#board.art .terr.painted { pointer-events: all; fill: none; }
#board.art .terr.painted:hover { filter: none; fill: #ffffff; fill-opacity: 0.14; }
#board.art .terr.painted.clickable:hover { fill-opacity: 0.18; }
#board.art .terr.painted.sel { filter: none; fill: #ffffff; fill-opacity: 0.2; }
#board.art .terr.painted.hit { animation: terrHitArt 0.55s ease-in-out 3; }
@keyframes terrHitArt {
  0%, 100% { fill: #ffffff; fill-opacity: 0; }
  50% { fill: #ffffff; fill-opacity: 0.55; }
}
/* Owner ring: a 9px stroke clipped to the territory = a 4.5px band just inside the border. */
#board .wash { fill: none; stroke-width: 34; stroke-opacity: 0.26; pointer-events: none; }
/* stroke / fill transitions: an owner change (e.g. the map battle's conquest) fades to the new colour */
#board .ring { fill: none; stroke-width: 11; stroke-linejoin: round; pointer-events: none; transition: stroke-width 0.12s ease, filter 0.12s ease, stroke 0.6s ease; }
#board .wash { transition: stroke 0.6s ease; }
#board .badge circle:not(.halo) { transition: fill 0.6s ease; }
#board .ring.hov { stroke-width: 15; filter: brightness(1.25) saturate(1.2); }
/* Dark edge line on every border, over the rings, so two touching colours never blur together. */
#board.art .coast { stroke: #0a1626; stroke-opacity: 0.8; stroke-width: 2.6; }
/* Selected source: white outline plus a glow, on top of the ring. */
#board.art .outline.sel { stroke-width: 5.5; filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95)); }
/* Badges on top of bright paintings: dark halo behind the circle, heavier name outline. */
#board .badge .halo { fill: rgba(0, 0, 0, 0.42); stroke: none; }
#board.art .badge circle { stroke-width: 2.5; }
#board.art .badge .tname { stroke: rgba(0, 0, 0, 0.9); stroke-width: 4.5; font-weight: 800; }
#board.art .cont-label { fill: rgba(255, 255, 255, 0.72); stroke: rgba(0, 0, 0, 0.7); stroke-width: 3.5; }

/* ------------------------------------------------------------------ */
/* Pause (owner request 2026-09-04)                                    */
/* ------------------------------------------------------------------ */
/* The Pause button stands out from the other top-bar buttons. */
.btn.pause {
  border-color: rgba(255, 213, 74, 0.6);
  color: var(--accent);
  background: linear-gradient(180deg, #2c3a55, #1b2538);
  letter-spacing: 0.04em;
}
.btn.pause:hover:not(:disabled) { filter: brightness(1.2); }

/* Full-screen PAUSED overlay. z-index sits above the battle overlays (9000) and
   the map-battle canvas (850); the toast (9700) and dialogs opened from it show
   on top (the overlay hides itself while one of its own dialogs is open). */
#pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(3px);
  cursor: default;
  opacity: 0;
  transition: opacity 0.18s ease;
}
#pause-overlay.show { opacity: 1; }
.pause-card {
  width: min(520px, 100%);
  text-align: center;
  padding: 30px 30px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, #1a2438, #121a2b);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}
.pause-title {
  font-size: 54px;
  font-weight: 900;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 2px 0 #7a5a10, 0 6px 24px rgba(255, 213, 74, 0.35);
}
.pause-sub { margin-top: 10px; color: var(--muted); font-size: 15px; min-height: 1.4em; }
.pause-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.pause-buttons .btn { width: 100%; padding: 15px 20px; font-size: 18px; }
.pause-hint { margin-top: 16px; color: var(--muted); font-size: 12px; }
/* Everything animated by CSS holds still while paused (the overlay itself uses a transition, so it still fades in). */
body.paused #game *, body.paused .ra-overlay *, body.paused .mb-hud *, body.paused #moment { animation-play-state: paused !important; }

/* ------------------------------------------------------------------ */
/* Moment banner: "<Attacker> captured <Territory> from <Defender>"     */
/* ------------------------------------------------------------------ */
#moment {
  position: fixed;
  z-index: 840;               /* over the board, under a map battle's canvas / HUD */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: 14px;
  background: rgba(8, 12, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
  max-width: min(720px, calc(100vw - var(--panel-w) - 40px));
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#moment.show { opacity: 1; }
#moment.out { opacity: 0; transition: opacity 0.35s ease; }
#moment .chip { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 12px currentColor; }
#moment-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#moment-text b { color: var(--accent); }
#moment-close {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 700 14px/1 var(--font);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#moment-close:hover { background: rgba(255, 255, 255, 0.22); }
/* The two territories of the moment pulse on the map while the banner is up. */
#board .outline.moment { display: block; stroke: #ffffff; stroke-width: 5; animation: momentPulse 0.8s ease-in-out infinite; }
#board .outline.moment.att { stroke: var(--accent); }
@keyframes momentPulse {
  0%, 100% { stroke-width: 3; stroke-opacity: 0.35; }
  50% { stroke-width: 9; stroke-opacity: 1; }
}
@media (max-width: 1500px) {
  #moment { font-size: 17px; padding: 10px 12px 10px 14px; }
  .pause-title { font-size: 44px; }
}

/* ------------------------------------------------------------------ */
/* The general's remark strip (js/remarks.js): italic one-liner with   */
/* an officer mark and the player's colour chip. Fixed at the bottom   */
/* (or top) centre of the board, never over the fact card, the two     */
/* fighting territories or an open dialog (ui.js positionRemark).      */
/* ------------------------------------------------------------------ */
#remark {
  position: fixed;
  z-index: 710;               /* readable beside an open dialog (700); positioned clear of its card */
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 14px;
  border-radius: 14px;
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid rgba(255, 210, 120, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  font-size: 17px;
  line-height: 1.3;
  max-width: min(640px, calc(100vw - var(--panel-w) - 40px));
  cursor: pointer;
  user-select: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
#remark.show { opacity: 1; }
#remark.out { opacity: 0; transition: opacity 0.35s ease; }
#remark .officer { flex: none; font-size: 18px; line-height: 1; filter: drop-shadow(0 0 6px rgba(255, 200, 90, 0.5)); }
#remark .chip { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 10px currentColor; }
#remark-who { flex: none; font-weight: 800; letter-spacing: 0.01em; }
#remark-who::after { content: ':'; }
#remark-text { font-style: italic; color: #f4e9cf; }
#remark-close {
  flex: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: 700 14px/1 var(--font);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#remark-close:hover { background: rgba(255, 255, 255, 0.22); }
.p-log .line.remark { font-style: italic; color: #e8dcc0; }
@media (max-width: 1500px) {
  #remark { font-size: 15px; padding: 8px 10px 8px 12px; }
}

/* ------------------------------------------------------------------ */
/* World fact card: a little geography lesson after every conquest      */
/* (owner request 2026-09-04). Fixed in a corner of the board; z-index  */
/* below the dialogs (700) - opening one dismisses it anyway.           */
/* ------------------------------------------------------------------ */
#fact-card {
  position: fixed;
  z-index: 690;
  width: 420px;
  max-width: calc(100vw - var(--panel-w) - 40px);
  border-radius: 16px;
  background: linear-gradient(180deg, #1a2438, #121a2b);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}
#fact-card.show { opacity: 1; transform: none; }
#fact-card.out { opacity: 0; transition: opacity 0.35s ease; }
#fact-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(8, 12, 22, 0.7);
  color: #fff;
  font: 700 14px/1 var(--font);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
#fact-close:hover { background: rgba(255, 255, 255, 0.25); }
.fc { display: flex; flex-direction: column; }
.fc-pic {
  height: 150px;
  background: radial-gradient(ellipse at 50% 40%, #16233d 0%, #0b1220 75%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex; align-items: center; justify-content: center;
}
.fc-pic .fc-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55)); }
.fc-head { display: flex; align-items: center; gap: 10px; padding: 12px 44px 0 16px; }
.fc-head .chip { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 0 12px currentColor; }
.fc-titles { min-width: 0; }
.fc-title { font-size: 22px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.15; color: var(--accent); }
.fc-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-head .speaker { margin-left: auto; font-size: 16px; }
.fc-what { margin: 8px 16px 0; font-size: 14px; line-height: 1.4; color: var(--text); }
.fc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 10px 16px 0; padding: 0; }
.fc-row { margin: 0; background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 6px 10px; min-width: 0; }
.fc-row dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.fc-row dd { margin: 1px 0 0; font-size: 15px; font-weight: 700; line-height: 1.3; }
.fc-row.wide { grid-column: 1 / -1; }                 /* a region with several capitals */
.fc-caps { margin: 2px 0 0; padding-left: 16px; font-size: 14px; font-weight: 600; line-height: 1.35; }
.fc-caps li { margin: 0 0 1px; }
.fc-caps li::marker { color: var(--accent); }
.fc-famous { margin: 10px 16px 14px; }
.fc-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; margin-bottom: 3px; }
.fc-famous ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.4; }
.fc-famous li { margin: 0 0 2px; }
.fc-famous li::marker { color: var(--accent); }
@media (min-width: 1700px) {
  #fact-card { width: 520px; }
  .fc-pic { height: 200px; }
  .fc-title { font-size: 26px; }
  .fc-what, .fc-famous ul { font-size: 16px; }
  .fc-row dd { font-size: 17px; }
}
@media (max-height: 800px) {
  .fc-pic { height: 120px; }
  .fc-famous { margin-bottom: 10px; }
}

/* World Atlas dialog: territory list on the left, the fact card content on the right */
#modal.atlas .modal-card { width: min(920px, 100%); }
.atlas-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 16px; min-height: 0; }
.atlas-list { overflow: auto; max-height: min(62vh, 560px); padding-right: 6px; scrollbar-width: thin; }
.atlas-list h4 { margin: 8px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.atlas-list h4:first-child { margin-top: 0; }
.atlas-item {
  display: block; width: 100%; text-align: left;
  padding: 7px 10px; margin: 0 0 2px;
  border-radius: 8px; border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  font: 600 14px/1.2 var(--font); cursor: pointer;
}
.atlas-item:hover { background: rgba(255, 255, 255, 0.1); }
.atlas-item.on { background: rgba(255, 213, 74, 0.16); border-color: rgba(255, 213, 74, 0.5); color: var(--accent); }
.atlas-detail { min-width: 0; }
.atlas-fc { border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; overflow: hidden; background: rgba(0, 0, 0, 0.18); }
.atlas-fc .fc-pic { height: 200px; }
.atlas-fc .fc-head { padding-right: 16px; }
.atlas-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.atlas-hint { margin-top: 10px; }
@media (max-height: 800px) {
  .atlas-fc .fc-pic { height: 150px; }
  .atlas-list { max-height: 56vh; }
}

/* Setup screen on laptop heights: the options column carries 13 rows (World facts
   added 2026-09-04) - tighten the rows so the Voice volume slider and Start game
   stay reachable without much scrolling. */
@media (max-height: 940px) {
  .setup-card .opt { padding: 5px 0; }
  .setup-card .seg button { padding: 6px 11px; }
  .setup-col h2 { margin-bottom: 6px; }
  .setup-actions { margin-top: 12px; }
  .row-actions { margin-top: 6px; }
}
