/* Parcheesi — Tronsoft Games — css/game.css
 * Vintage board-game parlor look: lacquer red, ivory, brass. */

:root {
  --lacquer: #7c2a1e;
  --lacquer-deep: #571c13;
  --ivory: #f4ecd9;
  --parchment: #fbf6e9;
  --brass: #c9a23f;
  --ink: #3a2a1c;
  --green: #1c9e6d;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(ellipse at 50% 20%, #6d4f35 0%, #3f2c1c 65%, #2c1e12 100%);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  min-height: 100%;
}

body.cover-open { overflow: hidden; }

body.high-contrast {
  --lacquer: #5b0b00;
  --lacquer-deep: #260400;
  --ivory: #fffdf4;
  --parchment: #ffffff;
  --brass: #8a6200;
  --ink: #090909;
  --green: #006b3f;
  background: #111;
}
body.high-contrast .panel,
body.high-contrast .masthead,
body.high-contrast .career-stat,
body.high-contrast .achievement,
body.high-contrast .rules-card,
body.high-contrast .rules-grid article,
body.high-contrast .dice-ledger,
body.high-contrast .coach-advice {
  border-color: #090909;
}
body.high-contrast button:focus-visible,
body.high-contrast select:focus-visible,
body.high-contrast input:focus-visible,
body.high-contrast canvas:focus-visible {
  outline: 4px solid #005ce6;
  outline-offset: 2px;
}

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 15%, rgba(201,162,63,0.16), transparent 38%),
    rgba(25, 15, 9, 0.96);
}
.cover-card {
  display: grid;
  grid-template-columns: minmax(250px, 430px) minmax(280px, 410px);
  width: min(900px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 2px solid var(--brass);
  border-radius: 14px;
  background: linear-gradient(145deg, #3b2414, #1e130c);
  box-shadow: 0 24px 80px rgba(0,0,0,0.72);
}
.cover-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
}
.cover-actions {
  align-self: center;
  max-height: calc(100vh - 52px);
  overflow-y: auto;
  padding: clamp(28px, 5vw, 56px);
  color: var(--ivory);
  text-align: center;
}
.cover-kicker {
  margin: 0 0 10px;
  color: var(--brass);
  font-size: 0.78rem;
  font-weight: bold;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.cover-actions h2 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 3px 12px rgba(0,0,0,0.55);
}
.cover-actions h2::after {
  content: "";
  display: block;
  width: 110px;
  margin: 16px auto 20px;
  border-top: 2px solid var(--brass);
}
.cover-actions > p:not(.cover-kicker):not(.cover-meta) {
  margin: 0 auto 18px;
  max-width: 32ch;
  color: #eadfc6;
  line-height: 1.55;
}
.cover-meta {
  margin: 0 0 18px;
  color: #cdbf9e;
  font-size: 0.85rem;
}
.resume-info {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(201,162,63,0.72);
  border-radius: 9px;
  background: rgba(244,236,217,0.08);
  text-align: left;
}
.resume-label {
  margin: 0 0 5px;
  color: var(--brass);
  font-size: 0.68rem;
  font-weight: bold;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.resume-players {
  margin: 0 0 10px;
  color: var(--ivory);
  font-size: 0.82rem;
  line-height: 1.35;
}
.resume-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.resume-grid span {
  color: #cdbf9e;
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.resume-grid strong {
  display: block;
  overflow: hidden;
  color: #fff8df;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}
.cover-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
}
.begin-button {
  width: min(260px, 100%);
  margin: 0;
  padding: 13px 22px;
  border-color: var(--brass);
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cover-new-button {
  border-color: #a98d61;
  background: transparent;
  color: var(--ivory);
  box-shadow: none;
}
.cover-help {
  color: var(--brass);
  text-underline-offset: 4px;
}

.turn-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 15, 9, 0.9);
  backdrop-filter: blur(5px);
}
.turn-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 3px solid var(--turn-color, var(--brass));
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ivory), #e9dfc6);
  box-shadow: 0 24px 70px rgba(0,0,0,0.66);
  text-align: center;
}
.turn-card p {
  margin: 0 0 8px;
  color: #695744;
  font-style: italic;
}
.turn-card h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 2rem;
}
.turn-color {
  margin: 0 0 24px;
  color: var(--turn-color, var(--lacquer));
  font-weight: bold;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.summary-overlay {
  position: fixed;
  inset: 0;
  z-index: 960;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 15, 9, 0.91);
  backdrop-filter: blur(6px);
}
.summary-card {
  width: min(480px, 100%);
  padding: 38px 34px;
  border: 3px solid var(--winner-color, var(--brass));
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ivory), #e9dfc6);
  box-shadow: 0 24px 70px rgba(0,0,0,0.7);
  text-align: center;
}
.summary-kicker {
  margin: 0 0 8px;
  color: #8a6510;
  font-size: 0.76rem;
  font-weight: bold;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.summary-card h2 {
  margin: 0 0 20px;
  color: var(--winner-color, var(--lacquer));
  font-size: 2.2rem;
}
.summary-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.summary-detail {
  padding: 10px 6px;
  border: 1px solid #cbb98c;
  border-radius: 8px;
  background: var(--parchment);
}
.summary-detail strong { display: block; font-size: 1.25rem; }
.summary-detail span { color: #695744; font-size: 0.7rem; text-transform: uppercase; }
.summary-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.rules-overlay {
  position: fixed;
  inset: 0;
  z-index: 970;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 20px;
  background: rgba(25, 15, 9, 0.92);
  backdrop-filter: blur(6px);
}
.rules-card {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border: 3px solid var(--brass);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--ivory), #e9dfc6);
  box-shadow: 0 24px 70px rgba(0,0,0,0.7);
}
.rules-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.rules-heading h2 { margin: 0 0 18px; color: var(--lacquer); font-size: 2rem; }
.rules-close { min-width: 42px; padding: 4px 10px; font-size: 1.5rem; line-height: 1; }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rules-grid article {
  padding: 12px 14px;
  border: 1px solid #cbb98c;
  border-radius: 8px;
  background: var(--parchment);
}
.rules-grid h3 { margin: 0 0 5px; color: var(--lacquer); font-size: 1rem; }
.rules-grid p, .rules-note { margin: 0; font-size: 0.86rem; line-height: 1.45; }
.rules-note { margin: 14px 0; font-weight: bold; }
.rules-link { color: var(--lacquer); font-weight: bold; text-underline-offset: 3px; }

.achievement-toast {
  position: fixed;
  z-index: 1200;
  top: 18px;
  left: 50%;
  width: min(390px, calc(100% - 28px));
  transform: translateX(-50%);
  padding: 12px 16px;
  border: 2px solid var(--brass);
  border-radius: 9px;
  background: #2c1e12;
  color: var(--ivory);
  box-shadow: 0 8px 30px rgba(0,0,0,0.58);
  text-align: center;
  font-weight: bold;
}

.masthead {
  text-align: center;
  padding: 18px 12px 8px;
  color: var(--ivory);
}
.masthead h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: 0.14em;
  font-weight: 700;
  text-transform: uppercase;
  text-shadow: 0 2px 0 var(--lacquer-deep), 0 4px 12px rgba(0,0,0,0.5);
}
.title-version {
  display: inline-block;
  margin-left: 0.45em;
  color: var(--brass);
  font-size: 0.3em;
  letter-spacing: 0.08em;
  vertical-align: middle;
}
.masthead .rule {
  width: min(420px, 70%);
  margin: 8px auto 4px;
  border: 0;
  border-top: 2px solid var(--brass);
}
.masthead p {
  margin: 2px 0 0;
  font-style: italic;
  letter-spacing: 0.08em;
  color: #e6d6ae;
  font-size: 0.95rem;
}

.table {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(480px, 800px) minmax(270px, 320px);
  gap: 18px;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 14px 30px;
  max-width: 1460px;
  margin: 0 auto;
}

.table.board-focus {
  grid-template-columns: minmax(480px, 820px);
  max-width: 900px;
}
.table.board-focus .panel { display: none; }

.board-holder {
  max-width: 820px;
  min-width: 300px;
}
.board-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}
.match-ribbon {
  display: grid;
  grid-template-columns: minmax(120px, 1.35fr) repeat(3, minmax(70px, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0 0 8px;
  border: 2px solid var(--brass);
  border-radius: 9px;
  background: var(--brass);
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.match-ribbon > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 7px 10px;
  background: rgba(44, 30, 18, 0.94);
  color: var(--ivory);
}
.match-ribbon strong {
  overflow: hidden;
  font-size: 0.83rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-ribbon small {
  margin-top: 2px;
  color: #d8c9a4;
  font-size: 0.6rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.match-player { position: relative; padding-left: 30px !important; }
.match-player i {
  position: absolute;
  left: 11px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255,255,255,0.72);
  border-radius: 50%;
  background: var(--match-player-color, var(--lacquer));
}
.recent-rolls {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  margin: 0 0 8px;
  padding: 6px 9px;
  border: 1px solid rgba(201,162,63,0.8);
  border-radius: 8px;
  background: rgba(44,30,18,0.82);
  color: var(--ivory);
}
.recent-rolls h2 {
  flex: 0 0 auto;
  margin: 0;
  color: var(--brass);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.recent-roll-list { display: flex; flex: 1; justify-content: flex-end; gap: 6px; min-width: 0; }
.recent-roll-empty { color: #cdbf9e; font-size: 0.72rem; font-style: italic; }
.recent-roll {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 7px;
  border: 1px solid var(--roll-color);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.recent-roll::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--roll-color);
}
.recent-roll.double { box-shadow: inset 0 0 0 1px var(--brass); color: #fff2b8; }
.race-progress {
  margin: 0 0 8px;
  padding: 8px 9px;
  border: 1px solid rgba(201,162,63,0.8);
  border-radius: 8px;
  background: rgba(44,30,18,0.82);
  color: var(--ivory);
}
.race-progress h2 {
  margin: 0 0 6px;
  color: var(--brass);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.race-progress-list {
  display: grid;
  grid-template-columns: repeat(var(--race-count, 4), minmax(0, 1fr));
  gap: 7px;
}
.race-progress-player { min-width: 0; }
.race-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  margin-bottom: 4px;
  font-size: 0.68rem;
}
.race-progress-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-progress-label strong { color: #fff; font-variant-numeric: tabular-nums; }
.race-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
}
.race-progress-fill {
  display: block;
  width: var(--race-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--race-color);
  transition: width 220ms ease;
}
.focus-board-button {
  padding: 6px 11px;
  border-color: var(--brass);
  background: rgba(44, 30, 18, 0.88);
  box-shadow: 0 2px 0 #171008;
  font-size: 0.78rem;
}
.focus-play-dock { display: none; }
.table.board-focus .focus-play-dock {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  padding: 9px 11px;
  border: 2px solid var(--brass);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--ivory), #e9dfc6);
  box-shadow: 0 4px 16px rgba(0,0,0,0.34);
}
.focus-play-dock p { margin: 0; font-size: 0.84rem; line-height: 1.25; }
.focus-dice { display: flex; gap: 5px; }
.focus-dice span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--parchment);
  font-weight: bold;
}
.focus-moves {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px;
}
.focus-move-button { min-width: 42px; padding: 5px 9px; font-size: 0.76rem; }
.focus-move-button.selected { background: var(--green); border-color: #0e6b47; }
#board {
  display: block;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.55), inset 0 0 0 2px var(--brass),
              0 0 0 4px var(--active-player-color, var(--brass));
  cursor: pointer;
  transition: box-shadow 240ms ease;
}
.board-holder.turn-changed #board { animation: turn-spotlight 680ms ease-out; }

@keyframes turn-spotlight {
  0% {
    box-shadow: 0 10px 40px rgba(0,0,0,0.55), inset 0 0 0 2px var(--brass),
                0 0 0 4px var(--active-player-color, var(--brass));
  }
  45% {
    box-shadow: 0 12px 48px rgba(0,0,0,0.62), inset 0 0 0 2px var(--brass),
                0 0 0 9px var(--active-player-color, var(--brass)),
                0 0 28px var(--active-player-color, var(--brass));
  }
  100% {
    box-shadow: 0 10px 40px rgba(0,0,0,0.55), inset 0 0 0 2px var(--brass),
                0 0 0 4px var(--active-player-color, var(--brass));
  }
}

.panel {
  min-width: 0;
  background: linear-gradient(180deg, var(--ivory), #e9dfc6);
  border: 2px solid var(--brass);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  padding: 14px 16px 18px;
}
.info-panel,
.controls-panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  scrollbar-color: var(--brass) transparent;
}
.panel h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--brass);
  padding-bottom: 6px;
}

#status {
  min-height: 2.6em;
  font-size: 1rem;
  line-height: 1.3;
  margin: 6px 0 10px;
}

.player-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0 0 12px;
}
.player-card {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #cbb98c;
  border-radius: 7px;
  background: rgba(251,246,233,0.72);
  box-shadow: inset 4px 0 0 var(--player-color);
}
.player-card.active {
  border-color: var(--player-color);
  background: var(--parchment);
  box-shadow: inset 5px 0 0 var(--player-color), 0 0 0 2px rgba(201,162,63,0.24);
}
.player-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: bold;
}
.player-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: var(--player-color);
}
.player-progress {
  margin-top: 3px;
  color: #695744;
  font-size: 0.75rem;
  line-height: 1.25;
}
.progress-track {
  height: 4px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 2px;
  background: #ded2b7;
}
.progress-fill {
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: var(--player-color);
  transition: width 220ms ease;
}

.dice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.die {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--parchment);
  border: 2px solid var(--ink);
  box-shadow: inset 0 -4px 0 rgba(0,0,0,0.12), 0 3px 6px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-weight: bold;
}
.die.double { border-color: var(--lacquer); color: var(--lacquer); }
.die.rolling { animation: dice-roll 340ms ease-out; }

@keyframes dice-roll {
  0% { transform: rotate(-12deg) scale(0.82); }
  45% { transform: rotate(10deg) scale(1.12); }
  100% { transform: rotate(0) scale(1); }
}

button {
  font-family: inherit;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 2px solid var(--lacquer-deep);
  background: linear-gradient(180deg, #a03a2a, var(--lacquer));
  color: var(--ivory);
  padding: 8px 14px;
  cursor: pointer;
  letter-spacing: 0.04em;
  box-shadow: 0 3px 0 var(--lacquer-deep);
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--lacquer-deep); }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }

.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

#chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px; margin-bottom: 10px; }
.chip {
  background: var(--parchment);
  color: var(--ink);
  border: 2px solid var(--ink);
  min-width: 44px;
  font-weight: bold;
  box-shadow: 0 2px 0 rgba(0,0,0,0.35);
}
.chip.bonus { border-color: var(--brass); color: #8a6510; }
.chip.pair { border-style: dashed; }
.chip.sel { background: var(--green); color: #fff; border-color: #0e6b47; }

.coach-advice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 2px solid var(--brass);
  border-radius: 8px;
  background: #fff8df;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.42;
  box-shadow: inset 4px 0 0 var(--brass);
}
.coach-advice strong { color: var(--lacquer); }
#playSuggestionBtn:not(:disabled) {
  border-color: #0e6b47;
  background: linear-gradient(180deg, #35a978, #1c8058);
  box-shadow: 0 3px 0 #0e6b47;
}

.move-options {
  display: grid;
  gap: 6px;
  margin: -2px 0 8px;
}
.move-option {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #0e6b47;
  background: linear-gradient(180deg, #35a978, #1c8058);
  box-shadow: 0 2px 0 #0e6b47;
  text-align: left;
  font-size: 0.82rem;
}
.shortcut-help {
  margin: 2px 0 12px;
  color: #75614b;
  font-size: 0.72rem;
  line-height: 1.35;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 0.95rem;
}
.game-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 6px;
}
.preset-button {
  min-width: 0;
  padding: 7px 5px;
  border-color: #8a6510;
  background: linear-gradient(180deg, #d0aa4b, #98731b);
  box-shadow: 0 2px 0 #6e5010;
  font-size: 0.7rem;
  line-height: 1.2;
}
.preset-notice {
  min-height: 1.25em;
  margin: 0 0 8px;
  color: #695744;
  font-size: 0.72rem;
  line-height: 1.3;
}
.difficulty-row { justify-content: space-between; }
.difficulty-row select { min-width: 150px; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
  font-size: 0.84rem;
  line-height: 1.3;
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; accent-color: var(--green); }

.human-names {
  display: grid;
  gap: 6px;
  margin: -4px 0 12px;
}
.human-name-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
}
.human-name-row input {
  width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid #a98d61;
  border-radius: 6px;
  background: var(--parchment);
  color: var(--ink);
  font: inherit;
}
.human-name-row input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 1px;
}

.career-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 12px;
}
.career-stat {
  padding: 7px 4px;
  border: 1px solid var(--brass);
  border-radius: 7px;
  background: var(--parchment);
  text-align: center;
}
.career-stat strong {
  display: block;
  color: var(--lacquer);
  font-size: 1.15rem;
}
.career-stat span {
  color: #695744;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.achievements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.achievement {
  padding: 7px 8px;
  border: 1px solid #cbb98c;
  border-radius: 7px;
  background: rgba(251,246,233,0.65);
  color: #887965;
  font-size: 0.73rem;
  line-height: 1.25;
}
.achievement strong { display: block; color: inherit; font-size: 0.8rem; }
.achievement.unlocked {
  border-color: var(--brass);
  background: #fff8df;
  color: #6f5210;
  box-shadow: inset 3px 0 0 var(--brass);
}
.dice-ledger {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--brass);
  border-radius: 8px;
  background: rgba(251,246,233,0.72);
}
.dice-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 3px;
  text-align: center;
}
.dice-summary span { color: #695744; font-size: 0.7rem; text-transform: uppercase; }
.dice-summary strong { display: block; color: var(--lacquer); font-size: 1.05rem; }
.dice-face {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
}
.dice-face > span { font-weight: bold; }
.dice-face > strong { text-align: right; font-variant-numeric: tabular-nums; }
.dice-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid #a98d61;
  border-radius: 999px;
  background: #e3d6b8;
}
.dice-track i {
  display: block;
  width: var(--dice-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--lacquer), var(--brass));
  transition: width 180ms ease;
}
select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 5px 8px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: var(--parchment);
  color: var(--ink);
}

#log {
  background: var(--parchment);
  border: 1px solid var(--brass);
  border-radius: 8px;
  height: 180px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}
#log div + div { border-top: 1px dotted #d8c9a4; padding-top: 3px; margin-top: 3px; }

.footer-links {
  text-align: center;
  padding: 0 12px 26px;
  color: #d8c9a4;
  font-size: 0.9rem;
}
.footer-links a { color: var(--brass); }

@media (max-width: 1180px) {
  .table {
    grid-template-columns: minmax(220px, 280px) minmax(430px, 1fr);
    max-width: 1040px;
  }
  .info-panel { order: 1; }
  .board-holder { order: 2; }
  .controls-panel {
    position: static;
    order: 3;
    grid-column: 1 / -1;
    max-height: none;
  }
  .table.board-focus {
    grid-template-columns: minmax(430px, 820px);
  }
}

@media (max-width: 760px) {
  .cover-screen { padding: 12px; }
  .cover-card {
    grid-template-columns: 1fr;
    max-width: 430px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }
  .cover-card img {
    height: min(58vh, 540px);
    object-position: top center;
  }
  .cover-actions { padding: 22px 24px 26px; }
  .cover-actions h2 { font-size: 2rem; }
  .cover-actions h2::after { margin: 10px auto 12px; }
  .cover-actions > p:not(.cover-kicker):not(.cover-meta) { margin-bottom: 12px; }
  .cover-meta { margin-bottom: 16px; }
  .table {
    grid-template-columns: 1fr;
    padding: 8px 8px 20px;
  }
  .board-holder {
    order: 1;
    width: 100%;
    min-width: 0;
  }
  .table.board-focus { grid-template-columns: 1fr; }
  .table.board-focus .focus-play-dock { grid-template-columns: 1fr auto; }
  .focus-play-dock p { grid-column: 1 / -1; }
  .match-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
  .match-ribbon .match-player { grid-column: 1 / -1; }
  .recent-rolls { align-items: flex-start; flex-direction: column; }
  .recent-roll-list { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .race-progress-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .controls-panel {
    order: 2;
    grid-column: auto;
  }
  .info-panel { order: 3; }
  .info-panel,
  .controls-panel {
    position: static;
    width: 100%;
    max-height: none;
  }
  .player-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-card { padding: 22px 18px; }
  .rules-grid { grid-template-columns: 1fr; }
  #log { height: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
