/*
 * Solo Frontier — the dev build's classic look: dark green felt, gold accent,
 * flat terrain hexes and cream number tokens. Fonts: Nunito + JetBrains Mono (fonts.css).
 */
:root {
  /* Dev build palette (green felt, gold accent) */
  --bg: #0f1c14;
  --bg-deep: #0b150f;
  --panel: #1a2e22;
  --panel-2: #243d2e;
  --line: rgba(155, 181, 164, .22);
  --ink: #f0f5f1;
  --muted: #9bb5a4;
  --amber: #e8a838;
  --amber-soft: rgba(232, 168, 56, .16);
  --teal: #3d9b6a;
  --teal-soft: rgba(61, 155, 106, .18);
  --danger: #e74c3c;
  /* Resource colours (internal ids pine/sand/linen/honey/tin = wood/brick/sheep/wheat/ore) */
  --pine: #2d6a4f;
  --sand: #c45c26;
  --linen: #74c69d;
  --honey: #e9c46a;
  --tin: #6c757d;
  --copper: #c45c26;
  --mist: #d4a574;
  --sea: #1b4f72;
  --radius: 12px;
  --display: 'Nunito', system-ui, sans-serif;
  --text: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--text);
  color: var(--ink);
  background:
    radial-gradient(ellipse at top, #1a3326, var(--bg));
  background-attachment: fixed;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: .005em; margin: 0; }
h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
h3 .ic { color: var(--amber); }
.hidden { display: none !important; }
.hint { color: var(--muted); }
.tiny { font-size: .8rem; }
.error { color: var(--danger); min-height: 1em; margin: 6px 0 0; font-size: .9rem; }
.ic { flex-shrink: 0; vertical-align: -0.2em; }
strong, b { font-weight: 700; }

/* ---- Buttons ---- */
.btn {
  font: inherit; font-weight: 700;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover:not(:disabled) { border-color: rgba(240, 245, 241, .35); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .link-btn:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}
.btn.primary {
  background: linear-gradient(180deg, #FFC56E, var(--amber));
  color: #2A1B05;
  border-color: transparent;
  box-shadow: 0 0 0 1px rgba(232, 168, 56, .25), 0 6px 22px rgba(232, 168, 56, .22);
}
.btn.primary:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(232, 168, 56, .45), 0 8px 28px rgba(232, 168, 56, .32); }
.btn.tiny { padding: 6px 10px; font-size: .85rem; border-radius: 10px; }
.link-btn {
  font: inherit; color: var(--teal); background: none; border: 0; padding: 4px 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 3px;
}
input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
}
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }

/* ---- Main menu ---- */
#screen-lobby { min-height: 100dvh; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 32px; }
.lobby-card { width: 100%; max-width: 460px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand .logo { filter: drop-shadow(0 0 18px rgba(232, 168, 56, .35)); }
.brand h1 { font-size: 2.1rem; line-height: 1.05; }
.tagline { margin: 4px 0 0; color: var(--muted); }
.daily-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(240, 245, 241, .06);
  display: flex; flex-direction: column; gap: 12px;
}
.daily-card-head { display: flex; align-items: center; gap: 12px; }
.daily-card-head h2 { font-size: 1.35rem; }
.daily-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.daily-date { margin: 0; color: var(--muted); font-size: .9rem; }
.daily-pill {
  margin-left: auto; font-size: .78rem; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: rgba(155, 181, 164, .14); color: var(--muted); display: inline-flex; align-items: center; gap: 5px; text-align: right;
}
.daily-pill.done { background: var(--teal-soft); color: var(--teal); }
.daily-pill.going { background: var(--amber-soft); color: var(--amber); }
.daily-card .hint { margin: 0; }
.daily-play-btn { font-size: 1.05rem; padding: 13px; }
.daily-lb-link { align-self: center; }
.how-to { margin-top: 18px; background: rgba(26, 46, 34, .55); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; }
.how-to summary { cursor: pointer; font-family: var(--display); font-weight: 700; padding: 10px 0; }
.how-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.how-list li { display: flex; gap: 10px; font-size: .92rem; }
.how-list .ic { color: var(--amber); margin-top: 2px; }
.version-footer { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.version-chip {
  font: inherit; font-size: .78rem; color: var(--muted); background: rgba(155, 181, 164, .1);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.whats-new-link { font-size: .85rem; }

/* ---- Game screen ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(15, 28, 20, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-brand { display: flex; align-items: center; gap: 8px; margin-right: auto; }
.top-title { font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.last-roll { display: flex; align-items: center; gap: 6px; font-size: 1rem; padding: 5px 10px; border-radius: 10px; background: rgba(155, 181, 164, .1); }
.last-roll b { font-family: var(--display); font-size: 1.2rem; }
.last-roll.dark-hour { background: rgba(255, 107, 107, .14); color: #FFC9C9; }
.vp-badge { font-weight: 700; padding: 5px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); }
.vp-badge strong { font-family: var(--display); font-size: 1.2rem; }
.vp-of { opacity: .7; }

.game-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px;
  padding: 18px; max-width: 1280px; margin: 0 auto;
}
.board-column { min-width: 0; }
.board-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(27, 79, 114, .55), rgba(27, 79, 114, .15) 70%);
  border-radius: 24px;
  overflow: visible;
}
#board { width: 100%; height: auto; max-height: calc(100dvh - 120px); display: block; margin: 0 auto; touch-action: manipulation; overflow: visible; }
.place-hint { text-align: center; color: var(--amber); font-weight: 700; min-height: 1.4em; margin: 4px 0 0; }
.game-over-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 8px auto 0; max-width: 520px; padding: 10px 14px; border-radius: 12px;
  background: var(--teal-soft); color: var(--teal); font-weight: 700;
}
.sidebar { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card {
  background: linear-gradient(180deg, rgba(36, 61, 46, .92), rgba(26, 46, 34, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(240, 245, 241, .05);
}

/* Roll bar */
.daily-bar {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, #2b4a37, var(--panel));
  border: 1px solid rgba(232, 168, 56, .35);
  border-radius: var(--radius); padding: 14px;
  box-shadow: 0 0 30px rgba(232, 168, 56, .12);
}
.daily-counter { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.daily-counter-top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.daily-roll-count { font-family: var(--display); font-size: 1.15rem; }
.daily-vp-progress { color: var(--amber); }
.daily-progress { height: 8px; border-radius: 99px; background: rgba(155, 181, 164, .18); overflow: hidden; }
.daily-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--amber)); border-radius: 99px; transition: width .3s; }
.daily-bar-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.daily-roll-btn { min-width: 120px; padding: 12px 16px; font-size: 1.05rem; }
.daily-finish-btn { font-size: .82rem; color: var(--muted); }

/* Resources */
.res-pine { --res: var(--pine); --res-ink: #95d5b2; }
.res-sand { --res: var(--sand); --res-ink: #f4a582; }
.res-linen { --res: var(--linen); --res-ink: #b7e4c7; }
.res-honey { --res: var(--honey); --res-ink: #f6dc8c; }
.res-tin { --res: var(--tin); --res-ink: #ced4da; }
.resources { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.res-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
  border-radius: 12px; background: color-mix(in srgb, var(--res) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--res) 60%, transparent);
  color: var(--res-ink);
}
.res-chip .n { font-family: var(--display); font-size: 1.35rem; color: var(--ink); line-height: 1.1; }
.res-chip .res-name { font-size: .72rem; font-weight: 700; }
.res-inline { display: inline-flex; align-items: center; gap: 3px; color: var(--res-ink); }

/* Build */
.build-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.build { flex-direction: column; gap: 3px; padding: 10px 6px; }
.btn.build .ic { color: var(--muted); }
.btn.build.affordable { border-color: rgba(61, 155, 106, .55); }
.btn.build.affordable .ic { color: var(--teal); }
.btn.build.active { background: var(--teal-soft); border-color: var(--teal); box-shadow: 0 0 18px rgba(61, 155, 106, .25); }
.build-name { font-size: .88rem; }
.pieces-left { font-size: .72rem; color: var(--muted); font-weight: 400; }
.pieces-note { margin: 8px 0 0; color: var(--amber); }
.costs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 12px 0 6px; padding: 10px; border-radius: 12px; background: rgba(11, 21, 15, .55); }
.cost-line { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: .8rem; }
.cost-label { color: var(--muted); }
.cost-icons { display: inline-flex; gap: 4px; }
.cost-res { display: inline-flex; align-items: center; gap: 1px; color: var(--res-ink); }
.cost-res b { font-size: .75rem; color: var(--ink); }

/* Trade */
.bank-rows { display: grid; gap: 8px; }
.bank-row { flex-direction: row; align-items: center; gap: 10px; }
.trade-label { width: 70px; color: var(--muted); font-weight: 400; }
.trade-rate { font-family: var(--display); font-size: 1.2rem; width: 22px; text-align: center; }
.bank-row select { flex: 1; }
.bank-trade-btn { width: 100%; margin-top: 10px; }

/* Development cards */
.hand { display: grid; gap: 8px; }
.lore-card {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: rgba(11, 21, 15, .5); border: 1px solid var(--line);
}
.lore-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--amber-soft); color: var(--amber); }
.lore-keepsake .lore-icon { background: var(--teal-soft); color: var(--teal); }
.lore-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.squall-note { display: flex; gap: 8px; margin: 10px 0 0; }
.squall-note .ic { color: var(--muted); margin-top: 2px; }

/* Log */
.log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; font-size: .85rem; }
.log li { padding: 5px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.log li:first-child { color: var(--ink); }

/* ---- Modals ---- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(5, 12, 8, .66); backdrop-filter: blur(4px);
}
.modal-card {
  width: 100%; max-width: 440px; max-height: 92dvh; overflow: auto;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 20px; padding: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  text-align: center;
}
.modal-card h2 { font-size: 1.35rem; display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; text-align: left; margin-bottom: 10px; }
.modal-head h2 { justify-content: flex-start; margin: 0; }
.modal-head .hint { margin: 2px 0 0; }
.modal-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }
.modal-x:hover { color: var(--ink); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.confirm-actions .btn { flex: 1; }
.haul-picks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.haul-pick { font: inherit; color: var(--res-ink); background: rgba(11, 21, 15, .5); border: 1px solid var(--line); border-radius: 12px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .8rem; }
.haul-have { font-size: .72rem; opacity: .85; }
.haul-pick.none .haul-have { color: var(--amber); font-weight: 700; opacity: 1; }
.haul-n { min-height: 1em; }
@media (max-width: 420px) { .haul-picks { gap: 4px; } .haul-pick { padding: 8px 2px; font-size: .72rem; } }
.haul-pick.on { border-color: var(--amber); background: var(--amber-soft); }
.haul-n { color: var(--amber); min-height: 1em; }
.lore-cost { display: grid; gap: 8px; margin: 10px 0; }
.cost-chip { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(11, 21, 15, .5); border: 1px solid var(--line); text-align: left; }
.cost-chip.ok { border-color: rgba(61, 155, 106, .5); }
.cost-chip.short { border-color: rgba(255, 107, 107, .5); }
.cost-chip.short .cost-have { color: var(--danger); }
.cost-icon { color: var(--res-ink); display: grid; place-items: center; }
.cost-have { color: var(--muted); font-size: .8rem; }
.discard-picks { display: grid; gap: 8px; margin: 12px 0; }
.discard-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: rgba(11, 21, 15, .5); }
.discard-row .label { display: flex; align-items: center; gap: 6px; color: var(--res-ink); font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { font: inherit; font-weight: 700; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper .count { font-family: var(--display); font-size: 1.2rem; min-width: 1.5em; }

/* What's new */
.modal#modal-changelog { z-index: 60; }
.changelog-card { max-width: 560px; display: flex; flex-direction: column; text-align: left; }
.changelog-body { overflow: auto; flex: 1; }
.changelog-done { margin-top: 12px; }
.cl-version { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: rgba(11, 21, 15, .4); }
.cl-version[open] { border-color: rgba(232, 168, 56, .45); }
.cl-version summary { cursor: pointer; list-style: none; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.cl-version summary::-webkit-details-marker { display: none; }
.cl-v { font-family: var(--display); font-weight: 700; color: var(--amber); }
.cl-date { color: var(--muted); font-size: .8rem; }
.cl-tag { margin-left: auto; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--teal-soft); color: var(--teal); }
.cl-body { padding: 0 14px 10px; font-size: .92rem; }
.cl-body .cl-note { color: var(--muted); font-style: italic; margin: 0 0 6px; }
.cl-section { font-family: var(--display); font-size: .95rem; margin: 10px 0 4px; color: var(--ink); }
.cl-body ul { margin: 0; padding-left: 1.2em; }
.cl-body li { margin: 3px 0; }
.cl-body li::marker { color: var(--amber); }
.cl-body a { color: var(--teal); }

/* Leaderboard */
.daily-results-card, .daily-board-card { max-width: 560px; text-align: left; }
.daily-date-nav { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 12px; }
.daily-mine { padding: 12px; border-radius: 14px; background: var(--amber-soft); border: 1px solid rgba(232, 168, 56, .35); margin-bottom: 10px; }
.daily-mine-score { display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; font-size: 1.05rem; color: var(--amber); }
.daily-mine-score strong { color: var(--ink); }
.daily-share { display: grid; gap: 6px; margin-bottom: 12px; }
.daily-share-text { width: 100%; resize: none; font-size: .9rem; line-height: 1.4; }
.daily-lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.daily-row { display: grid; grid-template-columns: 28px 12px 1fr auto 14px; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(11, 21, 15, .5); border: 1px solid var(--line); cursor: pointer; }
.daily-row:hover { border-color: rgba(240, 245, 241, .3); }
.daily-row.me { border-color: var(--amber); }
.daily-rank { font-family: var(--display); font-weight: 700; color: var(--muted); text-align: center; }
.daily-row.ten .daily-rank { color: var(--amber); }
.swatch { width: 12px; height: 12px; border-radius: 4px; transform: rotate(45deg); }
.daily-row-name { display: flex; flex-direction: column; min-width: 0; }
.you-tag { color: var(--amber); font-size: .8rem; }
.daily-row-vp { font-size: .85rem; color: var(--muted); }
.daily-row-vp strong { font-family: var(--display); font-size: 1.15rem; color: var(--ink); }
.daily-row-go { color: var(--muted); }
.daily-lb-note { margin-top: 10px; }
.daily-actions { margin-top: 12px; }
.final-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.stat { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; padding: 5px 10px; border-radius: 99px; background: rgba(11, 21, 15, .5); border: 1px solid var(--line); }
.stat .ic { color: var(--amber); }
.final-board-wrap svg { width: 100%; height: auto; max-height: 56dvh; display: block; margin: 0 auto 12px; }

/* Feedback */
.feedback-panel { background: rgba(11, 21, 15, .55); border: 1px solid rgba(61, 155, 106, .35); border-radius: 14px; padding: 14px; text-align: left; }
.feedback-panel.compact { padding: 10px 14px; }
.feedback-slot:empty { display: none; }
.fb-form h3 { margin-bottom: 2px; }
.fb-stars { display: flex; gap: 6px; margin: 8px 0 2px; }
.fb-star { background: none; border: 0; color: rgba(155, 181, 164, .5); cursor: pointer; padding: 2px; }
.fb-star.on { color: var(--amber); }
.fb-star.on .ic path { fill: currentColor; }
.fb-label { margin-top: 8px; font-size: .85rem; }
.fb-text { width: 100%; resize: vertical; margin-top: 4px; }
.fb-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.fb-thanks, .fb-skipped { display: flex; align-items: center; gap: 10px; }
.fb-thanks-icon { color: var(--teal); }

/* Toasts */
.award-toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.award-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(26, 46, 34, .97); border: 1px solid rgba(232, 168, 56, .5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 24px rgba(232, 168, 56, .18);
  animation: toast-in .25s ease-out;
}
.toast-icon { color: var(--amber); }
.toast-msg { flex: 1; font-weight: 700; font-size: .92rem; }
.toast-error { border-color: rgba(255, 107, 107, .6); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon, .toast-lore .toast-icon { color: var(--teal); }
.toast-dismiss { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- Board (SVG) ---- */
/* Board (dev build look) */
.hex { stroke: #0d1f17; stroke-width: .04; }
.hex.pine { fill: #2d6a4f; }
.hex.sand { fill: #b35c2a; }
.hex.linen { fill: #74c69d; }
.hex.honey { fill: #d4a017; }
.hex.tin { fill: #6c757d; }
.hex.mire { fill: #c4a484; }
.hex.robbed { filter: brightness(.6) saturate(.6); }
.hex-number { fill: #f5f0e6; stroke: #222; stroke-width: .02; }
.hex-number-text { font-size: .4px; font-weight: 800; font-family: var(--mono); text-anchor: middle; dominant-baseline: central; fill: #1a1a1a; pointer-events: none; }
.hex-number-text.hot { fill: #c0392b; }
.hex-pip { fill: #1a1a1a; pointer-events: none; }
.hex-pip.hot { fill: #c0392b; }
.port-label { font-size: .3px; font-family: var(--text); font-weight: 800; fill: #a8d5ff; dominant-baseline: central; paint-order: stroke; stroke: rgba(15, 28, 20, .85); stroke-width: .06px; }
.port-icon, .port-icon-halo { fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.port-icon { stroke: var(--res-ink, #a8d5ff); stroke-width: 2.1; }
.port-icon-halo { stroke: rgba(15, 28, 20, .85); stroke-width: 5; }
.port-pier { stroke: rgba(168, 213, 255, .55); stroke-width: .03; stroke-dasharray: .06 .05; pointer-events: none; }
.robber { fill: #111; stroke: #eee; stroke-width: .03; }
.robber.cleared { fill: none; stroke: #eee; stroke-dasharray: .06 .05; opacity: .7; }
.edge { stroke: rgba(255, 255, 255, .12); stroke-width: .14; stroke-linecap: round; }
.edge.buildable { stroke: rgba(232, 168, 56, .85); stroke-width: .2; cursor: pointer; }
.road-line { stroke-linecap: round; stroke-width: .14; fill: none; pointer-events: none; }
.building-settlement, .building-city { stroke: #111; stroke-width: .03; }
.vertex.blocked { fill: #2a2a2a; stroke: #e74c3c; stroke-width: .05; cursor: not-allowed; }
.vertex { fill: rgba(255, 255, 255, .15); stroke: rgba(255, 255, 255, .35); stroke-width: .03; cursor: pointer; }
.vertex.buildable { fill: rgba(232, 168, 56, .55); stroke: var(--amber); }
.vertex.too-close { fill: rgba(255, 107, 107, .35); stroke: none; }
.piece-body { stroke: #0d1f17; stroke-width: .035; stroke-linejoin: round; }
.piece-door { fill: #FFE3A3; stroke: none; }
.piece-lamp { fill: #FFE3A3; }
.piece-rays { fill: none; stroke: #FFE3A3; stroke-width: .03; stroke-linecap: round; }
.piece-glow { opacity: .55; pointer-events: none; }
.hall-glow { opacity: .8; }
.cottage.upgradable { cursor: pointer; }
.cottage.upgradable .building-settlement { stroke: var(--amber); stroke-width: .06; cursor: pointer; }
@keyframes glow-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .edge.buildable, .vertex.buildable, .award-toast { animation: none; } }

/* ---- Phones ---- */
@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; padding: 10px; gap: 12px; }
  .top-title, .top-desktop { display: none; }
  .topbar { padding: 8px 10px; gap: 8px; }
  #board { max-height: none; }
  .daily-bar {
    position: sticky; bottom: 8px; z-index: 15; order: -1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 30px rgba(232, 168, 56, .12);
  }
  .sidebar { display: flex; }
  #sidebar-feedback-slot { order: -2; }
}
@media (max-width: 420px) {
  .brand h1 { font-size: 1.75rem; }
  .resources { gap: 5px; }
  .res-chip .res-name { font-size: .66rem; }
  .costs { grid-template-columns: 1fr; }
}

/* ---- Small bits ---- */
.daily-sub { margin: 0; font-size: .8rem; }
.daily-share-btn { width: 100%; }
.share-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#weekly-share { margin-top: 12px; }
.daily-share-status { margin: 0; color: var(--teal); min-height: 1em; font-size: .85rem; }
.discard-current { margin: 4px 0 0; }
.toast-action { font: inherit; font-weight: 700; font-size: .82rem; color: var(--teal); background: none; border: 1px solid rgba(61, 155, 106, .5); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.fb-error { color: var(--danger); font-size: .85rem; margin: 6px 0 0; min-height: 1em; }
.lore-confirm-card .confirm-btn, .confirm-actions .confirm-btn { min-width: 120px; }
.daily-name-label input { font-weight: 400; }
.daily-card .error:empty { display: none; }

/* ---- Accounts, sign-in, friends, practice (1.0.0-beta.2) ---- */
.account-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding: 8px 10px;
  background: rgba(26, 46, 34, .55); border: 1px solid var(--line); border-radius: 14px;
}
.account-who { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-who .ic { color: var(--teal); flex: none; }
.count-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: var(--bg-deep); font-size: .72rem; font-weight: 700; }
.signin-box { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.gsi-button { display: flex; justify-content: center; min-height: 44px; }
.gsi-fallback { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 999px; padding: 10px 16px; font: 600 .95rem var(--text); cursor: pointer; }
.gsi-fallback:disabled { opacity: .6; cursor: not-allowed; }
.gsi-fallback svg { flex: none; }
.dev-login { border: 1px dashed var(--danger); border-radius: 12px; padding: 8px 10px; display: grid; gap: 6px; }
.dev-login-tag { margin: 0; color: var(--danger); font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dev-login-row { display: flex; gap: 8px; }
.dev-login-row input { flex: 1; min-width: 0; }
.practice-card {
  margin-top: 14px; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: rgba(26, 46, 34, .55); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px;
}
.practice-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.practice-card .hint { margin: 4px 0 0; }
.practice-card .btn { flex: none; }
.username-card label { text-align: left; }
.username-card input[type="text"] { font-size: 1.05rem; }
.username-status { margin: 0; min-height: 1.2em; font-size: .85rem; color: var(--muted); }
.username-status.ok { color: var(--teal); }
.username-status.bad { color: var(--danger); }
.check-label { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .9rem; text-align: left; }
.check-label input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--amber); }
.check-label a, .danger-zone a { color: var(--teal); }
.notice { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); font-size: .88rem; }
.version-footer a.link-btn { text-decoration: none; }
.lb-tabs { display: flex; gap: 6px; margin: 2px 0 10px; padding: 4px; background: rgba(11, 21, 15, .5); border-radius: 12px; }
.lb-tab { flex: 1; font: 700 .9rem var(--text); color: var(--muted); background: none; border: 0; border-radius: 9px; padding: 8px; cursor: pointer; }
.lb-tab.active { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.lb-tab:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.report-link { margin-top: 10px; color: var(--muted); font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; }
.friends-card, .account-card { text-align: left; display: flex; flex-direction: column; gap: 10px; }
.friend-add { display: flex; gap: 8px; }
.friend-add input { flex: 1; min-width: 0; }
.friends-msg { margin: 0; min-height: 1.1em; font-size: .88rem; color: var(--teal); }
.friends-msg.bad { color: var(--danger); }
.friends-lists { display: grid; gap: 14px; }
.friends-lists h3 { font-size: .95rem; margin-bottom: 6px; color: var(--muted); font-family: var(--text); }
.friend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.friend-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(11, 21, 15, .35); }
.friend-row .fname { margin-right: auto; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.friend-row .btn { padding: 5px 9px; font-size: .8rem; }
.btn.danger { border-color: rgba(255, 107, 107, .55); color: var(--danger); }
.danger-zone { border: 1px solid rgba(255, 107, 107, .35); border-radius: 12px; padding: 8px 12px; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 700; }
.danger-zone[open] { display: grid; gap: 8px; }
.practice-tag { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); }
.practice-done { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }

/* Pending action feedback (1.0.0-beta.6) */
body.lv-busy { cursor: progress; }
body.lv-busy button:not(.toast-dismiss) { opacity: .75; }
button:active { transform: scale(.97); }

/* First-visit welcome (1.0.0-beta.11) */
.welcome-card { text-align: center; max-width: 440px; }
.welcome-card .logo { display: block; margin: 0 auto 6px; }
.welcome-body p { margin: 0 0 10px; color: var(--ink); line-height: 1.5; }
.welcome-card .btn.primary { margin-top: 8px; min-width: 160px; }

/* Past boards */
.past-card { margin-top: 14px; background: rgba(26, 46, 34, .55); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.past-card h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.past-card .hint { margin: 0 0 10px; }
.past-list { display: grid; gap: 6px; }
.past-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--ink); background: rgba(11, 21, 15, .5); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.past-row:hover:not(:disabled) { border-color: var(--amber); }
.past-row:disabled { cursor: default; opacity: .75; }
.past-row .pd { font-weight: 700; min-width: 7.5em; }
.past-row .ps { flex: 1; font-size: .82rem; color: var(--muted); }
.past-row .pgo { font-size: .82rem; font-weight: 700; color: var(--amber); }
.past-row.done .pgo { color: var(--teal); }
.past-result-card { max-width: 460px; }
.past-big { text-align: center; font-size: 1.15rem; font-weight: 800; margin: 4px 0 2px; }
.past-sub { text-align: center; color: var(--muted); margin: 0 0 12px; font-size: .9rem; }
.past-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.past-stat { background: rgba(11, 21, 15, .5); border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.past-stat b { display: block; font-family: var(--mono); font-size: 1.15rem; color: var(--amber); }
.past-stat span { font-size: .72rem; color: var(--muted); }
.past-friends { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; font-size: .88rem; }
.past-friends li { display: flex; gap: 8px; padding: 4px 8px; border-radius: 8px; background: rgba(11, 21, 15, .35); }
.past-friends li.you { outline: 1px solid var(--amber); }
.past-friends .rk { font-family: var(--mono); color: var(--muted); min-width: 2.5em; }
.past-tag { margin-left: 8px; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(61, 155, 106, .25); color: #b7e4c7; }

/* Rate & feedback: collapsible, open by default (1.0.0-beta.14) */
.fb-details > summary.fb-toggle { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-weight: 700; color: var(--ink); padding: 4px 2px; border-radius: 8px; }
.fb-details > summary.fb-toggle::-webkit-details-marker { display: none; }
.fb-details > summary.fb-toggle:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.fb-details .fb-chevron { display: inline-flex; transition: transform .15s ease; color: var(--amber); }
.fb-details:not([open]) .fb-chevron { transform: rotate(-90deg); }
.fb-details[open] > summary.fb-toggle { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .fb-details .fb-chevron { transition: none; } }

/* Yesterday's placement pop-up (1.0.0-beta.20): same card as the welcome */
.recap-body .recap-place { font-size: 1.15rem; margin-bottom: 4px; }
.recap-body .recap-result strong { color: var(--amber); }
.recap-friends { list-style: none; padding: 0; margin: 6px 0 0; text-align: left; display: grid; gap: 4px; }
.recap-friends li { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.recap-card .link-btn { margin-top: 4px; }

/* Profile (1.0.0-beta.21) */
.profile-card { max-width: 480px; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 6px 0 8px; }
.profile-stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 12px 8px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.profile-stat b { font-size: 1.5rem; color: var(--amber); line-height: 1.1; }
.profile-stat span { font-size: .85rem; color: var(--ink); }
.profile-stat small { line-height: 1.3; }
.profile-replays { grid-column: 1 / -1; text-align: center; margin: 2px 0 0; }
.profile-note { text-align: center; margin: 0 0 10px; }
.profile-card > #btn-account { width: 100%; }

/* Weekly Challenge (1.0.0-beta.22) */
.weekly-card { margin-top: 14px; }
.weekly-icon { background: var(--teal-soft); color: var(--teal); }
.weekly-countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.weekly-countdown.soon { background: var(--amber-soft); color: var(--amber); }
.weekly-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.weekly-stat { background: rgba(11, 21, 15, .5); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; text-align: center; }
.weekly-stat b { display: block; font-family: var(--mono); font-size: 1.15rem; color: var(--amber); }
.weekly-stat span { font-size: .72rem; color: var(--muted); }
.weekly-lb-range { font-weight: 700; font-size: .9rem; align-self: center; }
.daily-row.anon .daily-row-name { color: var(--muted); font-style: italic; }
.weekly-row { grid-template-columns: 28px 12px 1fr auto; cursor: default; }
.weekly-stop { background: var(--amber-soft); color: var(--ink); border: 1px solid var(--amber); border-radius: 12px; padding: 10px 12px; margin: 4px 0 12px; font-size: .9rem; line-height: 1.45; }
.weekly-line { text-align: center; font-size: .85rem; color: var(--muted); margin: 0 0 10px; }

/* Past boards: collapsed drop-down (1.0.0-beta.22) */
.past-details > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.past-details > summary::-webkit-details-marker { display: none; }
.past-details > summary h3 { margin: 0; }
.past-details > summary:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 8px; }
.past-details .past-summary-note { margin: 0 0 0 auto; }
.past-details .past-chevron { display: inline-flex; color: var(--amber); transition: transform .15s ease; transform: rotate(-90deg); }
.past-details[open] .past-chevron { transform: rotate(0deg); }
.past-details[open] > summary { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .past-details .past-chevron { transition: none; } }

/* Combined recap pop-up: Daily + Weekly sections */
.recap-section { padding: 10px 0; }
.recap-section + .recap-section { border-top: 1px solid var(--line); }
.recap-section h3 { font-size: 1.05rem; margin: 0 0 6px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.recap-section .link-btn { margin-top: 6px; }

/* Profile: Weekly section */
.profile-section-title { font-size: 1rem; margin: 12px 0 4px; display: flex; align-items: center; gap: 6px; }
@media (max-width: 480px) {
  .weekly-card .daily-card-head { flex-wrap: wrap; row-gap: 8px; }
  .weekly-card .daily-card-head > div { flex: 1 0 auto; }
  .weekly-card .weekly-countdown { margin-left: 54px; }
  .weekly-stat b { font-size: 1rem; white-space: nowrap; }
}
.practice-tag.weekly { white-space: nowrap; }
.weekly-cap { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--teal-soft); color: var(--ink); border: 1px solid rgba(61, 155, 106, .45); font-size: .92rem; text-align: center; }
.how-sub { font-family: var(--display); font-size: 1rem; margin: 4px 0 10px; color: var(--amber); }

/* Solo Frontier: site footer + About */
.site-footer { text-align: center; margin-top: 18px; font-size: 0.85rem; }
.site-footer .footer-links { margin: 0 0 6px; line-height: 1.8; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.not-affiliated { max-width: 560px; margin: 4px auto 0; opacity: 0.8; }
.legal-wrap table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 0.9rem; }
.legal-wrap th, .legal-wrap td { border: 1px solid rgba(255,255,255,0.15); padding: 6px 8px; text-align: left; vertical-align: top; }
.legal-wrap blockquote { margin: 10px 0; padding: 6px 12px; border-left: 3px solid var(--teal); opacity: 0.9; }
.legal-foot { margin-top: 24px; }

/* ---- Endless Mode (1.0.0-test.8) ---- */
.endless-icon { color: #B79CFF; }
.endless-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.endless-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .82rem; }
.endless-rules li { display: flex; gap: 6px; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.endless-rules li b { text-align: right; }
.endless-rules li.changed b { color: #FF9F68; }
.endless-hist-wrap { margin-top: 6px; font-size: .8rem; }
.endless-hist-wrap summary { cursor: pointer; color: var(--teal); }
.endless-hist { margin: 6px 0 0 18px; padding: 0; display: grid; gap: 3px; }
.endless-hist li.reward { color: #8EE07A; }
.endless-hist li.modifier { color: #FFB547; }
.endless-modal { max-width: 420px; }
.endless-mod { background: rgba(255, 159, 104, .12); border: 1px solid rgba(255, 159, 104, .5); border-radius: 10px; padding: 10px; margin: 10px 0; text-align: left; }
.endless-mod-tag { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #FF9F68; }
.endless-mod p { margin: 4px 0 0; }
.endless-rw-title { margin: 8px 0 6px; font-size: 1rem; }
.endless-rewards { display: grid; gap: 8px; }
.endless-reward { text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(11, 21, 15, .5); color: inherit; font: inherit; cursor: pointer; }
.endless-reward.selected { border-color: #8EE07A; box-shadow: 0 0 0 2px rgba(142, 224, 122, .35); }
.endless-reward b { display: block; }
.endless-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.endless-boards { list-style: none; margin: 6px 0; padding: 0; font-size: .85rem; text-align: left; max-height: 160px; overflow: auto; }
.endless-boards li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.hex-number-text.small { font-size: .24px; }
.endless-card { margin-top: 14px; }


/* ---- Survival Mode (1.0.0-test.10) ---- */
.survival-icon { color: #FF7A93; }
.survival-card { margin-top: 14px; }
.survival-panel { border-color: rgba(255, 122, 147, .35); }
.endless-menu-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.endless-menu-actions .btn { flex: 1 1 140px; }
.survival-robber-disc { fill: #2a1218; stroke: #FF7A93; stroke-width: 0.04; }
.survival-knight-disc { fill: #1a2a3a; stroke: #6EC3FF; stroke-width: 0.04; }
.survival-knight.movable { cursor: pointer; }
.survival-knight.movable .survival-knight-disc { stroke: #FFB547; stroke-width: 0.06; }
.knight-place-target, .knight-move-target {
  fill: rgba(110, 195, 255, .18); stroke: #6EC3FF; stroke-width: 0.05; cursor: pointer;
}
.knight-move-target { fill: rgba(255, 181, 71, .2); stroke: #FFB547; }

.survival-threat-ring {
  fill: rgba(255, 122, 147, .12); stroke: #FF7A93; stroke-width: 0.06;
  stroke-dasharray: 0.12 0.08; pointer-events: none;
}
.survival-stack-count {
  font-size: .28px; font-weight: 800; font-family: var(--mono);
  text-anchor: start; dominant-baseline: central; fill: #FF7A93;
  pointer-events: none;
}
.survival-target-overlay { pointer-events: auto; }

/* Endless Mode retired from the menu unless FEATURE_ENDLESS=1 */
body.feature-endless-off #endless-card,
body.feature-endless-off #how-endless,
body.feature-endless-off #endless-panel,
body.feature-endless-off #modal-endless-clear,
body.feature-endless-off #modal-endless-over {
  display: none !important;
}

/* ---- 1v1 Survival (test.20) ---- */
.duel-card .duel-menu-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.duel-lobby-panel { margin-top: 0.75rem; padding: 0.75rem; border-radius: 10px; background: rgba(0,0,0,0.18); }
.duel-code { font-size: 2.2rem; font-weight: 700; letter-spacing: 0.35em; text-align: center; margin: 0.4rem 0; font-variant-numeric: tabular-nums; }
.duel-code-input { font-size: 1.6rem; letter-spacing: 0.35em; text-align: center; width: 8rem; padding: 0.4rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.25); color: inherit; display: block; margin: 0.4rem auto; }
.duel-panel { margin: 0.5rem 0; padding: 0.6rem 0.8rem; border-radius: 10px; background: rgba(30,40,70,0.55); }
.duel-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.3rem 0; }
.duel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; align-items: center; }
.duel-notice { position: sticky; top: 0; z-index: 20; text-align: center; padding: 0.55rem 0.75rem; background: #5a2438; color: #ffe0e8; font-weight: 700; border: 1px solid rgba(255,180,200,0.35); border-radius: 8px; margin: 0 0 0.4rem; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.haul-pick.picked { outline: 2px solid #e8a838; outline-offset: 2px; }
svg .hex.fog-hidden { fill: #1a1d2a !important; stroke: #2a2e3d; }
svg .hex.fog-memory { opacity: 0.55; }
.duel-icon { background: linear-gradient(135deg, #6EC3FF33, #e8a83833); }

/* 1v1 polish (test.20b) */
.duel-only { display: none; }
body.duel-active .duel-only { display: inline-flex; }
body.duel-active #pieces-limits-hint { display: none !important; }
body.duel-active .pieces-left { display: none; }
body.duel-active #btn-build-instigate {
  grid-column: 1 / -1;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  opacity: 1;
}
body.duel-active #btn-build-instigate:disabled {
  opacity: 1;
  cursor: not-allowed;
  color: var(--ink);
}
body.duel-active #btn-build-instigate:disabled .ic,
body.duel-active #btn-build-instigate:disabled .build-name { opacity: .7; }
body.duel-active #btn-build-instigate .pieces-left,
body.duel-active #instigate-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: .75rem;
  line-height: 1.25;
  white-space: nowrap;
  color: var(--ink);
  opacity: 1;
}
body.duel-active #instigate-hint .instigate-lock { font-weight: 700; color: var(--ink); }
body.duel-active #instigate-hint .instigate-now { color: var(--muted); font-weight: 500; }

/* 1v1 Development cards: cream names on the dark panel; playable cards look tappable */
body.duel-active .hand .lore-card {
  color: var(--ink);
  background: rgba(240, 245, 241, .07);
  border: 1px solid rgba(240, 245, 241, .18);
  text-align: left;
  width: 100%;
  opacity: 1;
  cursor: default;
}
body.duel-active .hand .lore-card strong {
  color: var(--ink);
  font-weight: 700;
  font-size: .95rem;
}
body.duel-active .hand .lore-card .hint { color: var(--muted); }
body.duel-active .hand .lore-card.playable {
  cursor: pointer;
  border-color: rgba(232, 168, 56, .6);
  box-shadow: 0 0 0 1px rgba(232, 168, 56, .22), 0 0 16px rgba(232, 168, 56, .1);
  background: rgba(232, 168, 56, .1);
}
body.duel-active .hand .lore-card.playable:hover {
  border-color: var(--amber);
  background: rgba(232, 168, 56, .16);
}
body.duel-active .hand .lore-card.waiting,
body.duel-active .hand .lore-card.lore-vp {
  cursor: default;
  opacity: 1;
}
body.duel-active .hand .lore-status {
  color: var(--amber);
  font-size: .75rem;
  font-weight: 700;
}
body.duel-active #btn-roll { display: none !important; }
body.duel-active #daily-bar { display: none !important; }
svg .hex.fog-memory { opacity: 0.78; filter: saturate(0.85); }
svg .hex.fog-hidden { fill: #151822 !important; stroke: #2a3144; opacity: 1; }
svg .hex.place-zone { stroke: rgba(232, 168, 56, .55); stroke-width: 0.08; filter: brightness(1.08); }
.vp-badge.duel-vp { font-size: .85rem; letter-spacing: 0; }
.vp-badge.duel-vp .vp-gap { color: var(--muted); font-weight: 500; margin-left: .25rem; }

/* rivers removed in test.20h */


/* 1v1 horizontal-scroll viewport (test.20d) — no pan/zoom */
body.duel-active .board-wrap {
  overflow-x: scroll !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  isolation: isolate;
  z-index: 0;
  /* Height set in JS to classic hex scale; fallback until layout: */
  height: min(42dvh, 420px);
  max-height: min(42dvh, 420px);
  /* Reserve space so the themed bar is never an overlay that auto-hides */
  scrollbar-gutter: stable;
  padding-bottom: 2px;
  scrollbar-width: auto; /* Firefox: always show */
  scrollbar-color: #e8c878 #0b150f;
}
body.duel-active .board-wrap::-webkit-scrollbar {
  height: 16px;
  background: #0b150f;
  display: block !important;
}
body.duel-active .board-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #f0d78a, #b8862e 55%, #8a6420);
  border-radius: 8px;
  border: 2px solid #0b150f;
  min-width: 48px;
}
body.duel-active .board-wrap::-webkit-scrollbar-track {
  background: linear-gradient(180deg, #142218, #0b150f);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(196, 163, 90, .35);
}
body.duel-active .board-column { z-index: 0; min-width: 0; }
body.duel-active .sidebar { z-index: 2; position: relative; }
body.duel-active #board {
  display: block;
  /* JS sets both width and height to preserve viewBox aspect (uniform scale) */
  height: auto;
  width: auto;
  max-height: none;
  max-width: none;
  margin: 0;
  touch-action: pan-x;
  overflow: visible;
  transform: none !important;
}
body.duel-active .place-hint {
  position: absolute; left: 0; right: 0; bottom: 18px;
  pointer-events: none; z-index: 1;
}
@media (max-width: 720px) {
  body.duel-active .board-wrap {
    height: min(38dvh, 340px);
    max-height: min(38dvh, 340px);
  }
  body.duel-active .board-wrap::-webkit-scrollbar { height: 16px; }
}

/* 1v1 End Turn bar — between the board and Resources (test.20i) */
.duel-end-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(232, 168, 56, .4);
  background: linear-gradient(180deg, #2b4a37, var(--panel));
  box-shadow: 0 0 24px rgba(232, 168, 56, .1);
}
.duel-end-bar.hidden { display: none !important; }
.duel-end-bar #duel-phase { margin: 0; flex: 1; min-width: 0; }
.duel-end-bar #btn-duel-end { flex-shrink: 0; min-width: 8.5rem; }
/* Never overlap the board or its horizontal scrollbar: the bar is a sibling
   in the sidebar (desktop) / after the board column (mobile stacked layout). */
body.duel-active .duel-end-bar { position: relative; z-index: 3; }

/* 1v1 result modal — keep the close control off the title */
#modal-duel-over .modal-card { position: relative; padding-top: 28px; }
#modal-duel-over .modal-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: 0; color: var(--muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 4px 8px;
}
#modal-duel-over .modal-close:hover { color: var(--ink); }
#modal-duel-over #duel-over-title {
  flex-wrap: wrap;
  padding: 0 1.75rem;
  text-wrap: balance;
  line-height: 1.3;
}
@media (max-width: 720px) {
  .duel-end-bar { flex-wrap: wrap; }
  .duel-end-bar #btn-duel-end { width: 100%; }
}

/* Classic 1v1 robber — persistent, visible even on fogged hexes */
.duel-robber-halo {
  fill: rgba(240, 215, 138, .22);
  stroke: #f0d78a;
  stroke-width: 0.06;
}
.duel-robber-disc { fill: #1a0c10; stroke: #c45a6a; stroke-width: 0.05; }
.duel-robber-icon { fill: #f0d78a; stroke: none; pointer-events: none; }
