/* LuMar Frontiers — page layout on top of brand/base.css */

[hidden] { display: none !important; }

.shell {
  max-width: 1320px; margin: 0 auto; padding: 16px;
  min-height: 100vh; display: flex; flex-direction: column; box-sizing: border-box;
}
.shell > .view:not([hidden]) { flex: 1 0 auto; align-content: start; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 2px 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.brand { display: inline-flex; align-items: center; gap: 0.45em; font-size: 1.35rem; font-weight: 700; letter-spacing: 0.04em; color: var(--text); }
.brand .mark { height: 1.45em; width: auto; display: block; flex: 0 0 auto; }
.brand span { color: var(--orange); font-weight: 600; }
.brand:hover { text-decoration: none; color: var(--text); }
.top nav a { color: var(--muted); font-size: 0.95rem; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; }
button.nav-icon { padding: 0; background: transparent; border-color: transparent; color: var(--muted); }
.nav-icon svg { width: 20px; height: 20px; display: block; }
.nav-icon:hover, button.nav-icon:hover { color: var(--text); background: var(--surface-2); border-color: transparent; text-decoration: none; }
#user-name { margin-right: 4px; }

h2 { margin: 0 0 12px; font-size: 1.05rem; color: var(--orange); font-weight: 650; }
h3 { margin: 18px 0 8px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--orange-dim); }
.muted { color: var(--muted); }
.err {
  background: var(--accent-faint); border: 1px solid var(--accent-border-strong);
  color: var(--missing); padding: 10px 14px; border-radius: var(--radius);
}

.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0;
}

/* New game layout */
#view-new:not([hidden]) {
  display: grid; gap: 16px;
  grid-template-columns: minmax(240px, 320px) 1fr;
  grid-template-areas: "picker preview" "picker recent";
  align-items: start;
}
.picker { grid-area: picker; }
.preview { grid-area: preview; }
.recent { grid-area: recent; }

.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button {
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; cursor: pointer;
}
.tabs button.on { color: var(--text); border-color: var(--accent-border-strong); background: var(--accent-faint); }

input, select {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
#map-search { width: 100%; margin-bottom: 10px; }
#map-gallery-search { width: 100%; margin-bottom: 10px; }

.map-list { list-style: none; margin: 0; padding: 0; max-height: 72vh; overflow-y: auto; }
.map-list .empty { padding: 10px 4px; }
.map-item {
  width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto;
  gap: 0 8px; background: transparent; color: var(--text); border: 1px solid transparent;
  border-radius: 8px; padding: 7px 10px; cursor: pointer; font: inherit;
}
.map-item:hover { background: var(--surface-2); }
.map-item.on { border-color: var(--accent-border-medium); background: var(--accent-faint); }
.map-item .name { font-weight: 550; font-size: 0.95rem; }
.map-item .sub { grid-column: 1 / -1; color: var(--muted); font-size: 0.78rem; }
.tag {
  font-size: 0.7rem; align-self: center; padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--pill-accent-border); color: var(--tag);
}
.tag.fixed { border-color: var(--accent-border-medium); color: var(--link-hover); }

.preview-head { display: flex; justify-content: space-between; gap: 12px; }
.preview-head p { margin: -6px 0 10px; font-size: 0.88rem; }

.board-wrap {
  background: var(--board-plain, #0b1626); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; display: flex; justify-content: center;
}
.board { width: 100%; height: auto; max-height: 62vh; display: block; }
.board-wrap.big .board { max-height: 80vh; }

.options { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-top: 14px; }
.options label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--muted); }
.options input[name="seed"] { width: 110px; }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 7px 16px;
  background: var(--orange); color: #fff; border: 1px solid var(--orange); display: inline-block;
}
button:hover, .button:hover { background: var(--link-hover); border-color: var(--link-hover); text-decoration: none; color: #fff; }
button:disabled { opacity: 0.45; cursor: default; }
.ghost, .button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.ghost:hover, .button.ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--accent-border-medium); }
.options button { margin-left: auto; }

.recent-list { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.recent-list li { padding: 3px 0; }

/* Game layout */
.side p { margin: -6px 0 0; font-size: 0.85rem; }
.players, .legend { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.players li, .legend li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.4); flex: none; }
.status { margin: 0 0 8px !important; font-size: 0.88rem; color: var(--text); }
.player { min-height: 34px; }
.player .pname { flex: 1; }
.player.first .pname { color: var(--link-hover); font-weight: 600; }
.player.out { opacity: 0.5; }
.dice { display: flex; align-items: center; gap: 4px; }
.dice b { min-width: 1.6em; text-align: right; font-family: var(--mono); }
.dice.stale { opacity: 0.45; }
.die {
  width: 22px; height: 22px; padding: 3px; border-radius: 5px; background: #efe5d3;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
}
.die i { width: 4px; height: 4px; border-radius: 50%; place-self: center; }
.die i.on { background: #2a221e; }
button.small, .button.small { padding: 3px 12px; font-size: 0.82rem; }
#btn-roll-all { margin-top: 8px; }
.log {
  list-style: none; margin: 0; padding: 0; font-size: 0.82rem; color: var(--muted);
  max-height: 180px; overflow-y: auto;
}
.log li { border-left: 3px solid var(--border); padding: 1px 0 1px 8px; margin-bottom: 3px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; cursor: pointer; }
.actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* SVG board */
.board .hex-base { stroke: #0b1626; stroke-width: 1.2; }
.board .fog { fill: var(--fog-plain, #262120); }
.board .fog-revealed { fill: #fff; opacity: 0.12; }
.board .fog-q { fill: var(--fog-plain-q, #8c7f77); font: 700 18px var(--font); text-anchor: middle; pointer-events: none; }
.board .hint { fill: #f2ebe4; font: 600 8.5px var(--font); text-anchor: middle; opacity: 0.85; pointer-events: none; }
.board .chip { fill: #efe5d3; stroke: #8a7a5c; stroke-width: 1; }
.board .chip-num { fill: #2a221e; font: 700 13px var(--font); text-anchor: middle; pointer-events: none; }
.board .chip-num.hot { fill: #af3d47; }
.board .pip { fill: #2a221e; }
.board .pip.hot { fill: #af3d47; }
.board .nostart { stroke: #af3d47; stroke-width: 2.4; stroke-linecap: round; }
.board .dock { stroke: #c4a882; stroke-width: 4; stroke-linecap: round; }
.board .jetty { stroke: #8a6f4f; stroke-width: 2.2; }
.board .harbour { stroke: #2a221e; stroke-width: 1; }
.board .harbour-label { fill: #2a221e; font: 700 9px var(--font); text-anchor: middle; pointer-events: none; }
.board .harbour-label.light { fill: #f2ebe4; }
.board .barbarian { fill: #d4727c; font: 700 10px var(--font); text-anchor: middle; }

.options .house-rules {
  flex: 1 0 100%; display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  margin: 0; border: 0; padding: 0; min-width: 0;
}
.options .house-rules legend { font-size: 0.8rem; color: var(--muted); padding: 0; }
.options .house-rules p { margin: 0; font-size: 0.8rem; }
.options .house-rules label { flex-direction: row; align-items: flex-start; color: var(--text); min-width: 0; }
.options .house-rules label span { min-width: 0; }

@media (max-width: 860px) {
  #view-new:not([hidden]) { grid-template-columns: 1fr; grid-template-areas: "preview" "picker" "recent"; }
  .map-list { max-height: 40vh; }
  .options button { margin-left: 0; }
}

/* ---------------------------------------------------------------- play */
.turnbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; min-height: 34px; }
.turn-label { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.dice-row { display: flex; align-items: center; gap: 6px; }
.dice-row b { font-family: var(--mono); font-size: 1.1rem; margin-left: 4px; }
.die.red { background: #c9545e; }
.die.red i.on { background: #fff; }
.die.yellow { background: #e8c45a; }
.event { font-size: 1.1rem; padding: 0 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
.ev-trade { color: #e2b33c; } .ev-politics { color: #6f9fd8; } .ev-science { color: #6fbf8a; }

.prompt { margin-top: 12px; }
.prompt p { margin: 0 0 6px; }
.prompt .big { font-size: 1.2rem; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.action-bar .build { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 5px 10px; background: var(--surface-2); color: var(--text); border-color: var(--border); }
.action-bar .build:hover:not(:disabled) { border-color: var(--accent-border-strong); background: var(--accent-faint); }
.action-bar .end { margin-left: auto; }
.action-bar .trade { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; }
.action-bar select { padding: 3px 6px; font-size: 0.85rem; }
button.tiny { padding: 0 7px; font-size: 0.8rem; line-height: 1.5; }
.cost { display: flex; gap: 3px; }

.card {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 5px;
  background: color-mix(in srgb, var(--c) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent);
  font-size: 0.75rem; line-height: 1.5;
}
.card b { font-family: var(--mono); }
.cost .card .card-name { display: none; }
.cost .card::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.hand { display: flex; flex-wrap: wrap; gap: 5px; }
.hand .card.zero { opacity: 0.4; }
.picker-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.pick { display: inline-flex; align-items: center; gap: 3px; }

.player { align-items: flex-start !important; padding: 5px 6px !important; border-radius: 8px; border: 1px solid transparent; }
.player.acting {
  border-color: #e14b56;
  box-shadow: inset 0 0 0 1px #e14b56;
  background: rgba(225, 75, 86, 0.18);
}
.player .pname { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; overflow-wrap: anywhere; }
.player .vp { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.player .vp small { font-weight: 400; color: var(--muted); font-size: 0.7rem; }
.small { font-size: 0.75rem; }

.improve { display: flex; flex-direction: column; gap: 8px; }
.track { border-left: 3px solid var(--t); padding-left: 8px; }
.track-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; min-width: 0; }
.track-head b { text-transform: capitalize; font-size: 0.85rem; color: var(--t); }
.levels { display: flex; gap: 3px; margin: 3px 0; }
.lvl { width: 18px; height: 6px; border-radius: 3px; background: var(--border); }
.lvl.on { background: var(--t); }

/* board pieces */
.board .road-under { stroke: #0b0908; stroke-width: 8; stroke-linecap: round; }
.board .road { stroke-width: 5; stroke-linecap: round; }
.board .piece { stroke: #0b0908; stroke-width: 2; stroke-linejoin: round; }
.board .piece.downgraded { opacity: 0.55; stroke-dasharray: 2 2; }
.board .wall { fill: #6b5d4f; stroke: #0b0908; stroke-width: 1.2; }
.board .mast { stroke: #2a221e; stroke-width: 1.4; }
.board .sail { stroke: #2a221e; stroke-width: 0.8; }
.board .metro { fill: none; stroke-width: 8; stroke-linejoin: round; }
.board .knight-mark { pointer-events: none; }
.board .robber-body { fill: #2b2522; stroke: #0b0908; stroke-width: 1; }
.board .pirate-hull { fill: #111; stroke: #555; stroke-width: 0.8; }
.board .pirate-flag { fill: #111; stroke: #ddd; stroke-width: 0.6; }
.board .target { fill: rgba(255, 255, 255, 0.25); stroke: #fff; stroke-width: 2; cursor: pointer; animation: pulse 1.2s ease-in-out infinite; }
.board .target.knight-ring { fill: rgba(255, 65, 84, 0.34); stroke: #ff4154; stroke-width: 3.5; }
.board .target-edge { stroke: rgba(255, 255, 255, 0.55); stroke-width: 7; stroke-linecap: round; cursor: pointer; animation: pulse 1.2s ease-in-out infinite; }
.board .target-hex { fill: rgba(255, 255, 255, 0.08); stroke: #fff; stroke-width: 2.5; pointer-events: none; }
.board .target-hex-hit { fill: transparent; stroke: none; cursor: pointer; }
.board.carrying,
.board.carrying .target-hex-hit,
.board.carrying .targets [data-tip] { cursor: none; }
.board .carried, .board .carried * { pointer-events: none; }
.board .carried { filter: drop-shadow(2px 3px 1px rgba(0, 0, 0, 0.5)); }
@keyframes pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .board .target, .board .target-edge { animation: none; } }


/* ---------------------------------------------------------------- account, lobby */
.top nav:not([hidden]) { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.skin-pick { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.skin-pick select { padding: 2px 6px; font-size: 0.85rem; }

.landing:not([hidden]) { display: grid; grid-template-columns: 1.3fr minmax(280px, 380px); gap: 32px; align-items: center; }
.hero-mark { width: clamp(168px, 28vw, 240px); height: auto; display: block; margin: 0 0 14px; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0; letter-spacing: 0.02em; color: var(--text); }
.hero .lead { font-size: 1.15rem; max-width: 36em; }
.features { padding-left: 1.2em; color: var(--muted); }
.features li::marker { color: var(--orange); }
.colophon {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.82rem; display: grid; gap: 6px;
}
.colophon p { margin: 0; }
body.in-game .colophon { display: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.stack button { margin-top: 6px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; }
.inline input { flex: 1; min-width: 180px; }

.lobby:not([hidden]) { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; align-items: start; }
.lobby-online { grid-column: 1 / -1; }
.online { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.online li { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 16rem; }
.online .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 auto; }
.online .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: #3ddc6e; border: 1px solid rgba(0, 0, 0, 0.35);
}
.stats-view:not([hidden]) { display: grid; gap: 16px; }
.stats-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5.5rem 5.5rem 9rem;
  gap: 8px 12px;
  align-items: baseline;
  margin: 14px 0 16px;
}
.stats-summary .head { color: var(--muted); font-size: 0.75rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-summary .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-summary .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-summary .rate { font-size: 1.35rem; font-weight: 650; }
.stats-lead .clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stats-rivals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem 6.5rem 6.5rem;
  gap: 6px 8px;
  align-items: baseline;
}
.stats-rivals .head { color: var(--muted); font-size: 0.75rem; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-rivals .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-rivals .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-split { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 0 0 16px; }
.stats-split .win { background: var(--found); }
.stats-split .loss { background: var(--border); }
.stats-charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 0 0 8px; }
.stats-charts .wide { grid-column: 1 / -1; }
.stats-fig { margin: 0; min-width: 0; }
.stats-fig figcaption { color: var(--orange-dim); font-size: 0.78rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 4px; }
.stats-lead { margin: 0 0 4px; font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.stats-note { margin: 0 0 8px; color: var(--muted); font-size: 0.78rem; }
.stats-sources + .stats-note { margin-top: 14px; }
.stats-fig svg { width: 100%; height: auto; display: block; }
.stats-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0 0; padding: 0; min-width: 0; }
.stats-legend li { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 0.78rem; }
.stats-legend i { width: 14px; height: 3px; border-radius: 99px; background: var(--swatch); flex: 0 0 auto; }
.stats-legend .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stats-legend .num { font-variant-numeric: tabular-nums; font-weight: 650; flex: 0 0 auto; }
.stats-fig text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.stats-fig .grid { stroke: var(--border); stroke-width: 1; }
.stats-scroll { overflow-x: auto; }
.stats-sources { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 6.5rem; gap: 6px 8px; align-items: center; }
.stats-sources .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-size: 0.85rem; }
.stats-sources .track { height: 8px; background: var(--surface-2); border-radius: 99px; }
.stats-sources .track i { display: block; height: 100%; width: var(--w); border-radius: 99px; background: var(--bar, var(--found)); }
.stats-sources .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .stats-charts { grid-template-columns: 1fr; }
}
.stats-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.9rem; }
.stats-table col.c-when { width: 8.5rem; }
.stats-table col.c-turns { width: 5rem; }
.stats-table col.c-you { width: 4.5rem; }
.stats-table col.c-winner { width: 9rem; }
.stats-table th, .stats-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.stats-table th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.stats-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.stats-table td.map, .stats-table td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-table b.clip, .stats-table span.clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stats-table tr.won td:last-child { font-weight: 700; }
#invite-panel { justify-self: end; width: max-content; max-width: 100%; }
#member-list .clip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#member-list .row { border-bottom: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.panel-links { display: flex; gap: 8px; flex: 0 0 auto; }
a.button[hidden], button[hidden] { display: none !important; }
.panel-head h2 { margin: 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows .row { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid var(--border); }
.rows .row > div { flex: 1; min-width: 0; }
.rows .row.your-move { background: var(--accent-faint); }
.badge { font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; background: var(--orange); color: #fff; white-space: nowrap; }
@media (max-width: 860px) {
  #invite-panel { justify-self: stretch; width: auto; }
}

.table-room:not([hidden]) { display: grid; gap: 16px; grid-template-columns: 1fr 300px; align-items: start; }

@media (max-width: 860px) {
  .landing:not([hidden]), .lobby:not([hidden]), .table-room:not([hidden]) { grid-template-columns: 1fr; }
}

/* victory point choice: radio buttons styled as segments */
.segmented { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented legend { font-size: 0.8rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.segments { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segments label { position: relative; cursor: pointer; }
.segments input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segments span { display: block; padding: 6px 12px; font-family: var(--mono); font-size: 0.9rem; color: var(--muted); border-left: 1px solid var(--border); }
.segments label:first-child span { border-left: 0; }
.segments input:checked + span { background: var(--accent-faint); color: var(--text); box-shadow: inset 0 -2px 0 var(--orange); }
.segments input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: -2px; }
.segments label:hover span { color: var(--text); }

.bot-add { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; margin-bottom: 4px; }

/* harbour badges with the resource picture (board.js) */
.board .harbour-icon-bg { fill: #fbf6ea; stroke: #2a221e; stroke-width: 1; }
.board .harbour-rate { font: 800 8px var(--font); text-anchor: middle; fill: #fbf6ea; stroke: #0b0908; stroke-width: 2.5px; paint-order: stroke; pointer-events: none; }
.board .res-icon { pointer-events: none; }
.board [data-tip] { cursor: help; }
.board .targets [data-tip] { cursor: pointer; }

/* the merchant is bright purple so the field stands out; the tooltip names the holder */
.board .merchant-ring { fill: none; stroke: #f04dff; stroke-width: 4.5; pointer-events: none; }
.board .merchant-halo { fill: #f04dff; stroke: #fff; stroke-width: 2; }
.board .merchant-robe { fill: #f04dff; stroke: #2a1030; stroke-width: 1.2; }
.board .merchant-piece { pointer-events: auto; }

/* Inventor: the two fields whose numbers just swapped. Same mark on every screen. */
.board .number-flash { fill: rgba(255, 122, 26, 0.34); stroke: #ff7a1a; stroke-width: 4.5; pointer-events: none; }

/* robber / pirate cover the number token (board.js) so the blocked field is obvious. */
.board .robber-block { fill: #140f0e; stroke: #f4efe6; stroke-width: 2; }
.board .on-field .robber-body { fill: #111; stroke: #f4efe6; stroke-width: 1.3; }
.board .on-field .pirate-hull { fill: #1a1614; stroke: #f4efe6; stroke-width: 1; }
.board .on-field .pirate-flag { fill: #c9545e; stroke: #f4efe6; stroke-width: 0.8; }
.board .on-field .mast { stroke: #f4efe6; }
.board .on-field { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }

/* coin stack on gold fields (board.js drawGoldEmblem), the same in every tile style */
.board .gold-emblem { pointer-events: none; }
.board .gold-emblem .coin-edge { fill: #9a6a08; stroke: #3d2a03; stroke-width: 0.8; }
.board .gold-emblem .coin-top { fill: #ffd84a; stroke: #6b4a05; stroke-width: 0.8; }

.server-view:not([hidden]) { display: grid; gap: 16px; }
.server-now { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; margin: 14px 0; }
.server-now span { display: block; color: var(--muted); font-size: 0.78rem; }
.server-now b { font-variant-numeric: tabular-nums; font-size: 1.6rem; font-weight: 650; }
.srv-peak { margin: 0 0 8px; color: var(--muted); font-size: 0.85rem; }
.srv-peak p { margin: 0 0 2px; }
.srv-charts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin: 12px 0 18px; }
.srv-fig { margin: 0; min-width: 0; }
.srv-fig figcaption { color: var(--muted); font-size: 0.78rem; margin-bottom: 6px; }
.srv-fig svg { width: 100%; height: auto; display: block; }
.srv-fig text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.srv-fig .grid { stroke: var(--border); stroke-width: 1; }
.srv-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 6px; font-size: 0.78rem; }
.srv-legend i { display: inline-block; width: 12px; height: 3px; margin-right: 5px; vertical-align: middle; background: var(--c); }
.srv-block { margin-top: 18px; }
.srv-block h3 { margin: 0 0 8px; font-size: 1rem; }
.ops-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.9rem; }
.ops-table col.c-num { width: 5.5rem; }
.ops-table col.c-last { width: 8.5rem; }
.ops-table th, .ops-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.ops-table th { color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.ops-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ops-table .clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) {
  .server-now { grid-template-columns: 1fr 1fr; }
  .srv-charts { grid-template-columns: 1fr; }
}

/* text size (textsize.js sets the root size): page text follows the root instead of the
 * brand's fixed 16px, so the per-account size choice scales everything together. */
body { font-size: 1rem; }

/* Tile-style gallery: one row per style, three fixed columns (island, resources, progress). */
.styles-view:not([hidden]) { display: block; }
.skin-legend, .skin-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(200px, 1fr) minmax(300px, 0.9fr);
  gap: 8px 12px;
  align-items: start;
}
.skin-legend {
  margin-top: 14px;
  padding: 0 11px;
  box-sizing: border-box;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.skin-legend span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skin-gallery { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
button.skin-sample {
  display: flex; flex-direction: column; align-items: stretch; gap: 0;
  min-width: 0; padding: 0; overflow: hidden; text-align: left;
  background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  font-weight: 650;
}
button.skin-sample:hover { background: transparent; color: var(--text); border-color: var(--accent-border-medium); }
button.skin-sample.on { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
button.skin-sample .name {
  padding: 8px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
button.skin-sample .skin-cols { padding: 0 10px 10px; }
button.skin-sample .board-wrap { border: 0; border-radius: 0; min-width: 0; }
button.skin-sample .board { max-height: none; }
.skin-cards { min-width: 0; align-content: flex-start; }
.skin-res { display: grid; grid-template-columns: repeat(4, 46px); gap: 6px; }
.skin-prog { display: flex; flex-wrap: wrap; gap: 6px; }
.skin-cards .pcard { width: 46px; height: 64px; cursor: inherit; }
.skin-cards .pcard:hover { transform: none; }
.skin-cards .pcard-art { width: 26px; height: 26px; }
.skin-cards .pcard-name { font-size: 0.5rem; }
.skin-cards .pcard-corner { font-size: 0.65rem; }
.skin-cards .pcard.prog { width: 96px; height: 96px; padding-top: 16px; }
.skin-cards .pcard.prog .prog-track { letter-spacing: 0; }
.skin-cards .pcard.prog .pcard-name { font-size: 0.62rem; padding-top: 4px; }
@media (max-width: 860px) {
  .skin-legend, .skin-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Map catalog: two equal columns, title and type on one line, the board under them. */
.maps-view:not([hidden]) { display: block; }
.map-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 4px;
}
a.map-card {
  display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  padding: 0; text-decoration: none; color: var(--text);
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
}
a.map-card:hover { text-decoration: none; color: var(--text); border-color: var(--accent-border-medium); }
.map-card-head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px 10px 0;
}
.map-card .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.map-card .sub {
  padding: 6px 10px 8px; color: var(--muted); font-size: 0.78rem;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.map-card .board-wrap { border: 0; border-radius: 0; min-width: 0; padding: 4px 8px; }
.map-card .board { width: 100%; height: auto; max-height: none; }
.map-card .map-open { align-self: flex-start; margin: 0 10px 10px; }
@media (max-width: 860px) {
  .map-gallery { grid-template-columns: minmax(0, 1fr); }
}

/* Logged out: only the language switch shows in the header. */
.top nav.guest .member { display: none !important; }
/* Language switch: spelled out for visitors; logged in, a globe keeps the header on one line. */
.top nav:not(.guest) .lang-label, .top nav.guest .lang-icon { display: none; }
