:root {
  --cell: 34px;
  --terrain: #1e3527;
  --terrain-light: #2a4734;
  --grid-line: #476b51;
  --panel: #16261b;
  --panel-raised: #1d3525;
  --trail: #e0a458;
  --valid: #3fa34d;
  --invalid: #c0392b;
  --text: #edf2e9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0d1a12;
  color: var(--text);
}

header { text-align: center; margin-bottom: 20px; }
h1 { margin: 0; letter-spacing: 2px; }
.tagline { margin: 4px 0 0; opacity: 0.7; font-size: 14px; }

main {
  max-width: 1340px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  background: var(--panel);
  border: 1px solid var(--grid-line);
  border-radius: 8px;
  padding: 14px 16px;
}
.placement-controls { flex: 1 1 100%; }
/* Once the season is running the whole top bar collapses to one line. */
.season-controls:not(.hidden) {
  display: flex;
  flex: 1 1 320px;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
/* New Season sits above the two window links, off to the right. */
.controls .secondary {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Once the season is running the top bar is only a thin strip of links:
   the instruction line lives in the tracker, so nothing is repeated. */
body:not(.planning) .controls {
  gap: 8px 14px;
  padding: 0;
  background: none;
  border: none;
  justify-content: flex-end;
}
body:not(.planning) .season-controls:not(.hidden) { flex: 0 1 auto; }

/* Scouting by voice: its own colour, and the button says whether the
   microphone is open. */
.voice-bar {
  grid-area: voice;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}
body.planning .voice-bar,
body.planning #btn-new-game { display: none; }
.voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #8a5a2b;
  border-color: #b98a51;
  color: #fdf6e8;
}
.voice-btn:hover:not([disabled]) { background: #9c6832; }
.voice-ear { width: 19px; height: 19px; }
#btn-voice-scout.listening {
  background: #2f7d4f;
  border-color: #7fc79b;
  box-shadow: 0 0 0 2px rgba(47, 125, 79, 0.3);
}
#btn-voice-scout[disabled] { opacity: 0.55; cursor: not-allowed; }
.voice-heard {
  margin: 0;
  font-size: 12px;
  color: var(--trail);
}
.voice-heard:empty { display: none; }
.voice-heard.error { color: var(--dead-end, #a8442a); }
body:not(.planning) .controls .secondary { margin-left: auto; }
body:not(.planning) .controls button { padding: 5px 11px; font-size: 13px; }
body:not(.planning) .controls .link-btn { margin-top: 0; padding: 0; }
body:not(.planning) main { gap: 14px; }
body:not(.planning) header { margin-bottom: 12px; }
body:not(.planning) h1 { font-size: 26px; }
body:not(.planning) .tagline { display: none; }

/* Log and season tracker share a row; they stack on narrow screens. */
.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "log voice"
    "log tracker";
  align-items: stretch;
  gap: 10px 16px;
}
.log-panel { grid-area: log; }
.tracker { grid-area: tracker; }
/* Status line and calendar live in one panel, matching the log's height. */
.tracker {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--grid-line);
  border-left: 4px solid #5c8a68;
  border-radius: 8px;
  padding: 14px 16px;
}
.tracker.your-turn { border-left-color: #3fa34d; }
.tracker.waiting { border-left-color: var(--trail); }
.tracker.over { border-left-color: #c0392b; }
body.planning .tracker { border-left-width: 1px; }
body.planning .field-row {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "log" "tracker";
}

/* The story window hands off to how to play, which opens the Classic. */
.how-to-steps { margin: 4px 0 18px; padding-left: 20px; }
.how-to-steps li { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.how-to-steps em { font-style: normal; color: var(--trail); }

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}
.modal-actions .link-btn { margin-top: 0; }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  margin-top: 12px;
  color: var(--trail);
  font-size: 13px;
  text-decoration: underline;
}
.link-btn:hover:not(:disabled) { background: none; color: #f2c88f; }

.status { padding: 0; }

.turn {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

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

.park-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-raised);
  border: 2px solid transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.park-btn:hover { background: #26482f; }
.park-btn.selected { border-color: var(--park-color, #f0c419); }
.park-btn.placed { opacity: 0.55; text-decoration: line-through; }
.park-btn .acres { font-size: 12px; opacity: 0.7; }
.park-btn .pips { display: flex; gap: 2px; }
.park-btn .pip {
  width: 10px; height: 10px; background: var(--park-color, #7a8794); border-radius: 2px;
}

.buttons { display: flex; gap: 8px; flex-wrap: wrap; }
button {
  font: inherit;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--grid-line);
  background: #24492f;
  color: var(--text);
  cursor: pointer;
}
button:hover:not(:disabled) { background: #2d5b3a; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

#btn-start:not(:disabled) { background: #2f7d3a; border-color: #3fa34d; }

kbd {
  background: var(--panel-raised);
  border: 1px solid var(--grid-line);
  border-radius: 4px;
  padding: 0 5px;
  font-family: inherit;
  font-size: 0.9em;
}

.hint { font-size: 13px; opacity: 0.75; margin: 12px 0 4px; }
.orientation { font-size: 13px; margin: 0 0 8px; }

.message { min-height: 20px; margin: 4px 0 0; font-size: 14px; }
.message.error { color: #ff8a7a; }
.message.info { color: #8fd694; }

/* Narrowest: each map with its own passport underneath it. */
.boards {
  display: grid;
  justify-content: center;
  justify-items: center;
  align-items: start;
  gap: 16px 18px;
  grid-template-columns: minmax(0, auto);
  grid-template-areas:
    "rival-map"
    "rival-pass"
    "player-map"
    "player-pass";
}
#player-wrap { grid-area: player-map; }
#player-passport { grid-area: player-pass; }
#rival-wrap { grid-area: rival-map; }
#rival-passport { grid-area: rival-pass; }

.board-wrap { text-align: center; }
.board-wrap .board { margin: 0 auto; }
.boards .passport-book { width: min(100%, 340px); margin-top: 0; }

/* Both maps on one level, each passport under its own map. */
@media (min-width: 760px) {
  .boards {
    grid-template-columns: auto auto;
    grid-template-areas:
      "rival-map player-map"
      "rival-pass player-pass";
  }
}

/* Widest: your passport, the route drawn for you, the route you drew,
   your rival's passport — all on one level. */
@media (min-width: 1360px) {
  .boards {
    grid-template-columns: auto auto auto auto;
    grid-template-areas: "rival-pass rival-map player-map player-pass";
  }
  .boards .passport-book { width: 256px; }
  .boards .stamp-slot { padding-right: 112px; }
  .boards .stamp-mark { width: 102px; height: 44px; }
}
.board-wrap h2 { font-size: 18px; margin: 0 0 2px; }
.board-note { margin: 0 0 10px; font-size: 12px; opacity: 0.65; }

.board {
  display: grid;
  grid-template-columns: repeat(11, var(--cell));
  grid-template-rows: repeat(11, var(--cell));
  gap: 2px;
  user-select: none;
}

.label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  opacity: 0.7;
}

.cell {
  background: var(--terrain);
  border: 1px solid var(--grid-line);
  border-radius: 2px;
  cursor: pointer;
}
.board:not(.disabled) .cell:hover { background: var(--terrain-light); }
.cell.park { border-color: rgba(0, 0, 0, 0.45); }
.cell.preview-valid { background: var(--valid); }
.cell.preview-invalid { background: var(--invalid); }

.board.disabled .cell { cursor: default; }
.board.disabled .cell:hover { background: var(--terrain); }

/* Trail marker (painted in the park's own colour) and dead end. */
.cell.marker { border-color: rgba(0, 0, 0, 0.5); }
.cell.dead-end { background: #d8d2c3; border-color: #aaa392; }
.board.disabled .cell.dead-end:hover { background: #d8d2c3; }

/* Each park signs its own trail markers; a dead end is a switchback that
   peters out on a forest road. */
.sprite { display: none; }

.cell-icon {
  display: block;
  width: 100%;
  height: 100%;
  padding: 2px;
  box-sizing: border-box;
  pointer-events: none;
}
.cell.marker .cell-icon { fill: rgba(0, 0, 0, 0.62); color: rgba(0, 0, 0, 0.62); }
.cell.dead-end .cell-icon { fill: #8a8372; color: #8a8372; }
.cell.revealed .cell-icon { fill: rgba(0, 0, 0, 0.6); color: rgba(0, 0, 0, 0.6); }

.cell.revealed { border-color: rgba(0, 0, 0, 0.45); opacity: 0.85; }

.hidden { display: none; }

.panel {
  background: var(--panel);
  border: 1px solid var(--grid-line);
  border-radius: 8px;
  padding: 12px 16px;
}

.status-panel {
  margin-top: 16px;
  text-align: left;
}
.panel h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: 1px; }

.status-panel ul { list-style: none; margin: 0; padding: 0; }

/* Passport: a booklet page per explorer, inked with a dated rubber stamp
   in the park's colour on the day that park is completed. */
.passport-book {
  background: linear-gradient(180deg, #f5efdd, #e6dcc2);
  border: 1px solid #b9a882;
  border-radius: 10px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.3);
  color: #3b3323;
}
.passport-head {
  border-bottom: 2px solid rgba(90, 72, 40, 0.35);
  margin-bottom: 10px;
  padding-bottom: 6px;
}
.passport-book h3 { margin: 0; color: #4a3d23; }
.passport-sub {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8a7a55;
}

.passport { display: grid; gap: 8px; }

.stamp-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 54px;
  padding: 9px 10px;
  padding-right: 116px;
  border: 1px dashed rgba(90, 72, 40, 0.4);
  border-radius: 6px;
  font-size: 13px;
  color: #6a5b3d;
}
.stamp-name { font-weight: 600; }
.stamp-detail { font-size: 11px; letter-spacing: 0.5px; opacity: 0.8; }

.stamp-slot.stamped {
  border-style: solid;
  border-color: rgba(90, 72, 40, 0.3);
  color: #3b3323;
}

/* A rubber stamp sized to the passport line: a rounded rectangle rather
   than a ring, so the park name and the date sit inside the border. */
.stamp-mark {
  position: absolute;
  top: 50%;
  right: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 46px;
  padding: 3px 5px;
  border: 2px solid var(--park-color, var(--trail));
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 0 0 2px var(--park-color, var(--trail));
  color: var(--park-color, var(--trail));
  text-align: center;
  text-transform: uppercase;
  opacity: 0.95;
  filter: saturate(1.3) brightness(0.85);
  transform: translateY(-50%) rotate(var(--tilt, -4deg));
  pointer-events: none;
}
.stamp-mark-top { font-size: 5px; letter-spacing: 0.8px; font-weight: 700; }
.stamp-mark-park {
  margin: 1px 0;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.4px;
}
.stamp-mark-date {
  padding: 0 3px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.stamp-mark-place {
  margin-top: 1px;
  font-size: 5px;
  font-weight: 700;
  letter-spacing: 0.8px;
}

/* Route planning is its own view: the log, the calendar, the rival map and
   both passports only appear once the itineraries have been traded. */
body.planning .log-panel,
body.planning .season-clock,
body.planning #rival-wrap,
body.planning .passport-book { display: none; }
body.planning .boards {
  grid-template-columns: minmax(0, auto);
  grid-template-areas: "player-map";
}

/* The planning map: paper over a greyed-back state flag. */
.map-flag { display: none; }

/* Single file: the voice button drops to just above the rival's map. */
@media (max-width: 820px) {
  .field-row {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "log" "tracker" "voice";
  }
  /* Under the title, the season controls read down the middle of the page. */
  .controls,
  body:not(.planning) .controls { justify-content: center; }
  .controls .secondary,
  body:not(.planning) .controls .secondary {
    margin-left: 0;
    align-items: center;
    width: 100%;
  }
  .controls .secondary .buttons { justify-content: center; }
  .voice-bar { justify-content: center; }
  .voice-heard { flex: 1 1 100%; text-align: center; }
  :root { --cell: 30px; }
}
body.planning .player-wrap {
  position: relative;
  overflow: hidden;
  padding: 18px 20px 22px;
  border: 1px solid #b9a882;
  border-radius: 12px;
  background: linear-gradient(180deg, #f2e7c9, #e4d5ad);
  color: #3b3323;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.25), 0 6px 18px rgba(0, 0, 0, 0.35);
}
body.planning .player-wrap .map-flag {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 104%;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.32;
  filter: grayscale(1) contrast(0.9);
  pointer-events: none;
}
body.planning .player-wrap h2 {
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #4a3a1e;
}
body.planning .player-wrap .board-note { color: #6a5b3d; opacity: 0.9; }
body.planning .player-wrap .label { color: #6a5b3d; opacity: 0.9; }
body.planning .player-wrap .board { gap: 0; }
body.planning .player-wrap .cell {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(90, 72, 40, 0.35);
  border-radius: 0;
}
body.planning .player-wrap .board:not(.disabled) .cell:hover {
  background: rgba(255, 255, 255, 0.5);
}
body.planning .player-wrap .cell.park { border-color: rgba(0, 0, 0, 0.4); }
body.planning .player-wrap .cell.preview-valid { background: var(--valid); }
body.planning .player-wrap .cell.preview-invalid { background: var(--invalid); }

/* Sealing window: the back of an envelope closed with a wax seal. */
.seal-window { max-width: 460px; text-align: center; }
.seal-window h2 { margin-bottom: 18px; }
.seal-note { font-size: 14px; opacity: 0.85; }

.envelope {
  position: relative;
  width: 280px;
  height: 180px;
  margin: 0 auto 20px;
  border-radius: 6px;
  /* The two diagonals are the side flaps folded in behind the envelope. */
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px),
      rgba(90, 72, 40, 0.35) 50%, transparent calc(50% + 1px)),
    linear-gradient(to bottom left, transparent calc(50% - 1px),
      rgba(90, 72, 40, 0.35) 50%, transparent calc(50% + 1px)),
    linear-gradient(180deg, #efe3c6, #ddcda6);
  box-shadow: inset 0 0 0 1px rgba(90, 72, 40, 0.3), 0 8px 20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

/* The top flap folded down over the two side flaps. */
.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52%;
  background: linear-gradient(180deg, #f5ebd2, #e6d8b6);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 3px rgba(90, 72, 40, 0.35));
}

.wax-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 112px;
  height: 112px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  transform: translate(-50%, -50%) rotate(-5deg);
}
.wax-blob { fill: #9d2c1a; }
.wax-ring {
  fill: none;
  stroke: rgba(255, 224, 205, 0.32);
  stroke-width: 1.4;
}
.wax-text {
  fill: #f7e0d0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-anchor: middle;
  text-transform: uppercase;
}
.wax-state { fill: rgba(60, 12, 4, 0.55); }

/* Result window: the season card for both explorers. */
.result-window { max-width: 560px; }
.result-table {
  width: 100%;
  margin: 6px 0 20px;
  border-collapse: collapse;
  font-size: 14px;
}
.result-table th,
.result-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(237, 242, 233, 0.16);
  text-align: right;
}
.result-table thead th {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--trail);
}
.result-table th[scope='row'],
.result-table thead th:first-child { text-align: left; font-weight: 600; }
.result-table tbody th { color: #cdd8c8; font-weight: 500; }
.result-table td { font-variant-numeric: tabular-nums; }
#game-over .intro { border-color: #3fa34d; }
#game-over.lost .intro { border-color: #c0392b; }
.result-verdict {
  margin: 6px 0 2px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #6fd47a;
}
#game-over.lost .result-verdict { color: #ff7a68; }

/* The result flashed over the maps before the season card opens. */
.winner-flash {
  margin: 0 auto 6px;
  max-width: 1100px;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  color: #6fd47a;
  animation: flash-in 320ms ease-out;
}
.winner-flash.lost { color: #ff7a68; }
@keyframes flash-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* Intro: the Summer Classic story, shown on load and from "The story". */
.intro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 16px;
  background: rgba(6, 14, 9, 0.88);
}
.intro-backdrop.hidden { display: none; }

.intro {
  max-width: 620px;
  background: var(--panel-raised);
  border: 1px solid #5c8a68;
  border-radius: 10px;
  padding: 24px 28px;
  line-height: 1.5;
  font-size: 15px;
}
.intro h2 { margin: 2px 0 14px; font-size: 24px; letter-spacing: 1px; }
.intro h3 { margin: 20px 0 8px; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; opacity: 0.8; }
.intro p { margin: 0 0 12px; }
.intro-kicker {
  margin: 0;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--trail);
}
.intro-parks { list-style: none; margin: 0 0 20px; padding: 0; }
.intro-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.intro-badge {
  flex: none;
  width: 76px;
  height: 76px;
}

/* The ranger who gives the briefing, standing in the window's top corner. */
.ranger-portrait {
  flex: none;
  width: 66px;
  height: auto;
  align-self: flex-start;
  margin: -20px 0 10px;
}

.intro-arrowhead {
  flex: none;
  width: auto;
  height: 82px;
}

/* The title card: the game's name and the two sound settings. */
.title-card {
  max-width: 460px;
  text-align: center;
  padding: 32px 28px 24px;
}
.title-flag {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.title-card h2 { margin: 12px 0 4px; font-size: 30px; }
.title-card .intro-kicker { margin-bottom: 22px; }
.title-card .modal-actions { justify-content: center; }

.sound-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.sound-toggles button { min-width: 172px; }
.sound-toggles button[aria-pressed="false"] { opacity: 0.6; }

.park-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.park-icon.death-valley { color: #f0c419; }
.park-icon.joshua-tree { color: #e9762f; }
.park-icon.yosemite { color: #2fa8c9; }
.park-icon.kings-canyon { color: #8f6bd6; }
.park-icon.sequoia { color: #d76ba6; }

.intro-parks li {
  display: grid;
  align-items: center;
  grid-template-columns: 22px 1fr auto auto;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(237, 242, 233, 0.18);
  font-size: 14px;
}
.intro-park-name { font-weight: 600; }
.intro-park-cells { opacity: 0.75; }
.intro-park-acres { color: var(--trail); min-width: 130px; text-align: right; }
.intro .link-btn { margin-top: 0; align-self: center; }

/* Season calendar: 100 trail days from the fourth of July, one date per
   round, turning over only once both explorers have scouted. */
.season-clock {
  display: flex;
  align-items: center;
  gap: 16px;
}
.calendar-body { flex: 1; }

.calendar-leaf {
  flex: none;
  width: 92px;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  background: #f4efe2;
  color: #2c2517;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.calendar-month {
  margin: 0;
  padding: 3px 0;
  background: #a4381f;
  color: #fdf6e8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
}
.calendar-day {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
}
.calendar-weekday {
  margin: 0;
  padding-bottom: 5px;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0.7;
}

.clock-line { margin: 0 0 8px; font-size: 14px; }
.clock-note { margin: 6px 0 0; font-size: 12px; opacity: 0.7; }
.clock-note.waiting { color: var(--trail); opacity: 0.95; }
.clock-bar {
  height: 8px;
  border-radius: 4px;
  background: #0d1a12;
  border: 1px solid var(--grid-line);
  overflow: hidden;
}
.clock-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3fa34d, var(--trail));
  transition: width 0.2s ease;
}

/* Explorer's log: a field journal — plain paper, a stitched spine, and a
   hairline under each entry so nothing is ruled through. */
.log-panel {
  background: #efe6d0;
  border: 1px solid #b9a882;
  border-left: 12px solid #6b4b2a;
  border-radius: 8px;
  color: #35301f;
}
.log-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid rgba(90, 72, 40, 0.45);
  margin-bottom: 6px;
  padding-bottom: 6px;
}
.log-panel h3 {
  margin: 0;
  color: #4a3a1e;
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  font-size: 17px;
  letter-spacing: 0.5px;
}
.log-sub {
  margin: 0;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #8a7a55;
}

.log {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  font-size: 13px;
  /* Four entries tall; older days stay reachable by scrolling. */
  max-height: calc(4 * 27px);
  overflow-y: auto;
}
.log.empty { min-height: 27px; }
.log.empty::before {
  content: 'No entries yet — the season starts once the itineraries are traded.';
  display: block;
  padding: 5px 0;
  font-style: italic;
  opacity: 0.6;
}

.log-entry {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  line-height: 18px;
  border-bottom: 1px solid rgba(90, 72, 40, 0.2);
}
.log-entry:last-child { border-bottom: none; }
.log-date {
  flex: none;
  width: 52px;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8a6a3a;
}
.log-entry.player { color: #1f4b6b; }
.log-entry.rival { color: #8a3220; }
.log-entry.system { color: #5a4a12; font-style: italic; }

/* Phone widths: shrink the squares so a whole map fits without scrolling. */
@media (max-width: 460px) {
  :root { --cell: 26px; }
  body.planning .player-wrap { padding: 14px 8px 16px; }
}
