:root {
  --background: #e8eef1;
  --surface: #fffdf8;
  --surface-strong: #f5f2e9;
  --text: #202522;
  --muted: #666e69;
  --border: #d4d8d5;
  --primary: #1d4033;
  --primary-hover: #122c22;
  --birth: #138a43;
  --death: #cb3d34;
  --correct: #126e37;
  --incorrect: #a42d27;
  --warning: #8a5a00;
  --warning-bg: #fff4cc;
  --ocean: #c8c8c8;
  --land: #ffffff;
  --coast: #a9a9a9;
  --boundary: #b8b8b8;
  --shadow: 0 16px 45px rgba(35, 48, 43, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 38%),
    var(--background);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
a { color: inherit; }

.game-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
}

.game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.header-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.intro {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.score-card {
  min-width: 110px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.score-card span,
.year-box span,
.round-box span,
.place-details span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-card strong { font-size: 2rem; }

.controls-panel,
.answer-card,
.map-card,
.clue-panel,
.place-details {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.controls-panel {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 16px;
}

.controls-panel label,
.answer-card label {
  display: grid;
  gap: 7px;
  font-weight: 750;
}

select, input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: white;
}

select { min-width: 220px; padding: 10px 12px; }
input { padding: 13px 14px; }

.clue-panel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 16px;
}

.year-box, .round-box { padding: 18px 22px; text-align: center; }
.year-box strong, .round-box strong { font-size: clamp(1.3rem, 3vw, 2rem); }
.birth-year-box { border-left: 7px solid var(--birth); }
.death-year-box { border-right: 7px solid var(--death); }

.round-box {
  min-width: 150px;
  border-right: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface-strong);
}

.data-warning {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #e8c86b;
  border-radius: 10px;
  color: var(--warning);
  background: var(--warning-bg);
  font-weight: 700;
}

.map-card {
  overflow: hidden;
  border-radius: 20px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-strong);
}

.map-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.region-button {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: white;
  font-size: 0.88rem;
  font-weight: 700;
}

.region-button.active {
  border-color: var(--primary);
  color: white;
  background: var(--primary);
}

.map-helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}


.map-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.84rem;
  font-weight: 700;
}

.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 999px;
}

.birth-dot { background: var(--birth); }
.death-dot { background: var(--death); }
.map-credit { margin: 0; color: var(--muted); font-size: 0.75rem; }

.place-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--border);
}

.place-details[hidden] { display: none; }
.place-details > div { padding: 15px 18px; background: var(--surface); }

.answer-card { margin-top: 16px; padding: 20px; border-radius: 18px; }
.input-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 2px; }

.primary-button,
.secondary-button,
.text-button {
  border-radius: 10px;
  font-weight: 800;
}

.primary-button {
  padding: 12px 20px;
  border: 1px solid var(--primary);
  color: white;
  background: var(--primary);
}
.primary-button:hover { background: var(--primary-hover); }

.secondary-button {
  padding: 10px 16px;
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface-strong);
}
.secondary-button:hover { background: #e9e5db; }

.link-button { display: grid; place-items: center; text-decoration: none; }

.text-button {
  padding: 8px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.action-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.feedback { min-height: 28px; margin-top: 15px; font-weight: 750; line-height: 1.5; }
.feedback.correct { color: var(--correct); }
.feedback.incorrect { color: var(--incorrect); }
.feedback.neutral { color: var(--text); }

@media (max-width: 760px) {
  .game-shell { width: min(100% - 20px, 1120px); margin: 16px auto; }
  .game-header, .header-actions, .map-toolbar { flex-direction: column; align-items: stretch; }
  .score-card { min-width: 88px; }
  .controls-panel { align-items: stretch; flex-direction: column; }
  select { min-width: 0; }
  .clue-panel { grid-template-columns: 1fr 1fr; }
  .round-box {
    grid-column: 1 / -1;
    grid-row: 2;
    border: 0;
    border-top: 1px solid var(--border);
  }
  .birth-year-box, .death-year-box { grid-row: 1; }
  .input-row, .place-details { grid-template-columns: 1fr; }
  .map-footer { align-items: flex-start; flex-direction: column; }
  .offline-vector-map { min-height: 330px; }
}


.offline-vector-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1419.6 / 719.98;
  min-height: 0;
  overflow: hidden;
  background: var(--ocean);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.offline-vector-map:active { cursor: grabbing; }

.offline-map-scene {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.offline-map-scene--animate {
  transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.offline-map-image {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}

.offline-map-marker-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.offline-map-marker {
  position: absolute;
  z-index: 4;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid white;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
  transform: translate(-50%, -50%) scale(var(--marker-inverse-scale, 1));
  transform-origin: center;
  pointer-events: auto;
}

.offline-map-marker--birth { background: var(--birth); }
.offline-map-marker--death { background: var(--death); }
.offline-map-marker--admin {
  width: 17px;
  height: 17px;
  background: #176fbd;
  cursor: grab;
  touch-action: none;
}
.offline-map-marker--admin:active { cursor: grabbing; }

.offline-map-controls {
  position: absolute;
  z-index: 10;
  top: 12px;
  right: 12px;
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.14);
}

.offline-map-controls button {
  width: 38px;
  height: 36px;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  color: #222;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 800;
}

.offline-map-controls button:last-child { border-bottom: 0; }
.offline-map-controls button:hover { background: #f0f0f0; }

@media (max-width: 760px) {
  .offline-vector-map {
    min-height: 0;
    aspect-ratio: 1419.6 / 719.98;
  }
}


/* Timed round interface */
.round-status-panel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.round-status-item {
  padding: 15px 18px 18px;
  text-align: center;
}

.round-status-item + .round-status-item {
  border-left: 1px solid var(--border);
}

.round-status-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.round-status-item strong {
  font-size: clamp(1.25rem, 3vw, 1.8rem);
}

.timer-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  overflow: hidden;
  background: #e5e5e5;
}

.timer-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 80ms linear, background-color 180ms ease;
}

.round-time-low .timer-status strong,
.round-time-low .points-status strong {
  color: var(--death);
}

.round-time-low .timer-progress span {
  background: var(--death);
}

.map-stage-wrapper {
  position: relative;
}

.round-countdown {
  position: absolute;
  z-index: 30;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  color: #242424;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.round-countdown[hidden] {
  display: none;
}

.round-countdown span {
  max-width: 90px;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  line-height: 1.15;
  text-transform: uppercase;
}

.round-countdown strong {
  min-width: 1.3em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 0.9;
  text-align: center;
}

.countdown-pulse {
  animation: countdown-pulse 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes countdown-pulse {
  from {
    opacity: 0;
    transform: scale(1.3);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Game marker with year and revealed place label */
.offline-map-marker--birth,
.offline-map-marker--death {
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}

.offline-map-marker-dot {
  position: absolute;
  inset: 0;
  display: block;
  border: 2px solid white;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.offline-map-marker--birth .offline-map-marker-dot {
  background: var(--birth);
}

.offline-map-marker--death .offline-map-marker-dot {
  background: var(--death);
}

.offline-map-marker-label {
  position: absolute;
  z-index: 2;
  left: 18px;
  display: grid;
  gap: 3px;
  min-width: max-content;
  max-width: 230px;
  padding: 5px 8px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  color: #202020;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  line-height: 1.05;
}

.offline-map-marker-year {
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.offline-map-marker-place {
  overflow: hidden;
  color: #4f5551;
  font-size: 0.68rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-map-marker-place[hidden] {
  display: none;
}

.offline-map-marker--birth .offline-map-marker-label {
  bottom: 10px;
  border-left: 4px solid var(--birth);
}

.offline-map-marker--death .offline-map-marker-label {
  top: 10px;
  border-left: 4px solid var(--death);
}

.offline-map-marker--label-left .offline-map-marker-label {
  right: 18px;
  left: auto;
  border-right: 4px solid;
  border-left-width: 1px;
}

.offline-map-marker--birth.offline-map-marker--label-left .offline-map-marker-label {
  border-right-color: var(--birth);
}

.offline-map-marker--death.offline-map-marker--label-left .offline-map-marker-label {
  border-right-color: var(--death);
}

@media (max-width: 760px) {
  .round-status-panel {
    grid-template-columns: 1fr 1fr;
  }

  .round-status-item:first-child {
    grid-column: 1 / -1;
    border-bottom: 1px solid var(--border);
  }

  .round-status-item:nth-child(2) {
    border-left: 0;
  }

  .offline-map-marker-label {
    max-width: 175px;
    padding: 4px 6px;
  }

  .offline-map-marker-year {
    font-size: 0.68rem;
  }

  .offline-map-marker-place {
    font-size: 0.62rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .countdown-pulse {
    animation: none;
  }
}


/* V10: compact game information and end-of-round result overlay */
.map-game-hud {
  position: absolute;
  z-index: 22;
  top: 12px;
  right: 12px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.map-game-hud-item {
  min-width: 82px;
  padding: 9px 12px;
  text-align: center;
}

.map-game-hud-item + .map-game-hud-item {
  border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.map-game-hud-item span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  line-height: 1.1;
  text-transform: uppercase;
}

.map-game-hud-item strong {
  display: block;
  font-size: 1.08rem;
  line-height: 1.15;
}

.map-game-hud-item strong span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  letter-spacing: 0;
  line-height: inherit;
  text-transform: none;
}

.round-time-low .map-game-hud-time strong {
  color: var(--death);
}

/* Move the map's own zoom buttons away from the game HUD. */
.map-stage-wrapper .offline-map-controls {
  top: auto;
  right: 12px;
  bottom: 12px;
}

.round-result {
  position: absolute;
  z-index: 31;
  left: 14px;
  bottom: 14px;
  display: grid;
  gap: 7px;
  width: min(390px, calc(100% - 28px));
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  color: #242424;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(7px);
  text-align: left;
}

.round-result[hidden] {
  display: none;
}

.round-result-status {
  justify-self: start;
  padding: 6px 11px;
  border-radius: 999px;
  color: white;
  background: var(--primary);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.round-result--correct .round-result-status {
  background: var(--correct);
}

.round-result--incorrect .round-result-status {
  background: var(--incorrect);
}

.round-result--neutral .round-result-status,
.round-result--game-over .round-result-status {
  background: var(--primary);
}

.round-result > strong {
  max-width: 100%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  line-height: 1;
}

.round-result p {
  margin: 3px 0 0;
  font-size: 1.05rem;
  font-weight: 850;
}

.round-result p span {
  font-size: 1.3em;
}

.round-result small {
  color: #4d514e;
  font-size: 0.88rem;
  font-weight: 750;
}

.round-result--game-over > strong {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
}

@media (max-width: 760px) {
  .map-game-hud {
    top: 8px;
    right: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(310px, calc(100% - 16px));
  }

  .map-game-hud-item {
    min-width: 0;
    padding: 8px 6px;
  }

  .map-game-hud-item strong {
    font-size: 0.95rem;
  }

  .round-result {
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    padding: 13px 14px;
  }

  .round-countdown {
    left: 8px;
    bottom: 8px;
  }
}


/* Histoglyph platform structure */
.site-page {
  background:
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.95), transparent 32%),
    linear-gradient(180deg, #e9eeef 0%, #f5f3ec 100%);
}

.site-header,
.site-footer {
  width: min(1240px, calc(100% - 36px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

.brand,
.play-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50% 50% 46% 54% / 42% 55% 45% 58%;
  color: white;
  background: var(--primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 900;
}

.brand--small { font-size: 1.05rem; }
.brand--small .brand-mark { width: 28px; height: 28px; font-size: .86rem; }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a {
  color: var(--muted);
  font-size: .92rem;
  font-weight: 750;
  text-decoration: none;
}
.site-nav a:hover { color: var(--primary); }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(420px, 1.1fr);
  width: min(1240px, calc(100% - 36px));
  min-height: 590px;
  margin: 30px auto 70px;
  overflow: hidden;
  border: 1px solid rgba(32,37,34,.12);
  border-radius: 30px;
  background: #fdfcf7;
  box-shadow: var(--shadow);
}

.home-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 7vw, 86px);
}

.home-hero h1 {
  max-width: 650px;
  font-size: clamp(3rem, 6vw, 5.7rem);
  letter-spacing: -.045em;
}

.home-hero-intro {
  max-width: 590px;
  margin: 24px 0 30px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.hero-button { align-self: flex-start; text-decoration: none; }

.home-map-art {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: #c8c8c8;
}
.home-map-art img {
  position: absolute;
  width: 145%;
  max-width: none;
  height: 100%;
  left: -27%;
  object-fit: cover;
  opacity: .97;
}
.hero-map-dot {
  position: absolute;
  z-index: 2;
  width: 17px;
  height: 17px;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 3px 14px rgba(0,0,0,.3);
}
.hero-map-dot--one { top: 29%; left: 53%; background: var(--birth); }
.hero-map-dot--two { top: 53%; left: 29%; background: var(--death); }
.hero-map-line {
  position: absolute;
  z-index: 1;
  top: 31%;
  left: 30%;
  width: 31%;
  height: 2px;
  background: rgba(29,64,51,.55);
  transform: rotate(-31deg);
  transform-origin: left center;
}

.home-section,
.site-callout,
.mode-page-shell {
  width: min(1240px, calc(100% - 36px));
  margin-inline: auto;
}

.home-section { margin-bottom: 72px; }
.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 34px;
  align-items: end;
  margin-bottom: 24px;
}
.section-heading h2,
.site-callout h2,
.collection-section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.4rem);
}
.section-heading > p,
.site-callout > p { margin: 0; color: var(--muted); line-height: 1.65; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.mode-card,
.collection-card {
  display: flex;
  flex-direction: column;
  min-height: 290px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(35,48,43,.07);
}
.mode-card--clickable,
.collection-card--clickable { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.mode-card--clickable:hover,
.collection-card--clickable:hover {
  border-color: rgba(29,64,51,.55);
  box-shadow: 0 16px 34px rgba(35,48,43,.13);
  transform: translateY(-3px);
}
.mode-card--coming-soon,
.collection-card--coming-soon { background: rgba(255,253,248,.62); }
.mode-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mode-card-eyebrow { color: var(--muted); font-size: .75rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.status-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-badge--available { color: #0e6330; background: #dff3e6; }
.status-badge--coming-soon { color: #6d6658; background: #ebe7dc; }
.mode-card h2,
.collection-card h3 { margin: 30px 0 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; }
.mode-card p,
.collection-card p { margin: 0; color: var(--muted); line-height: 1.55; }
.mode-card-footer,
.collection-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 26px; }
.mode-card-action { text-decoration: none; }
.mode-card-disabled-text,
.collection-card-footer > span { color: var(--muted); font-size: .82rem; }
.compact-button { padding: 8px 14px; text-decoration: none; }

.site-callout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 80px;
  padding: 34px;
  border: 1px solid rgba(29,64,51,.18);
  border-radius: 22px;
  background: rgba(238,245,241,.85);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 0 38px;
  border-top: 1px solid rgba(32,37,34,.12);
  color: var(--muted);
}
.site-footer p { margin: 0; font-size: .85rem; }

.mode-page-shell { margin-top: 22px; margin-bottom: 80px; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs--play { margin: 10px 0 15px; }
.mode-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 40px;
  align-items: end;
  margin: 25px 0 58px;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.mode-hero h1 { font-size: clamp(2.8rem, 6vw, 5rem); }
.mode-hero p:not(.eyebrow) { max-width: 720px; margin: 20px 0 0; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.mode-rules { display: grid; gap: 10px; }
.mode-rules span { display: flex; align-items: baseline; gap: 9px; padding: 13px 15px; border-radius: 12px; background: var(--surface-strong); color: var(--muted); }
.mode-rules strong { color: var(--primary); font-size: 1.35rem; }
.collection-groups { display: grid; gap: 56px; }
.collection-section-heading { margin-bottom: 18px; }
.collection-section-heading h2 { font-size: 2.25rem; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.collection-card { min-height: 245px; }
.collection-card h3 { margin-top: 22px; }

.game-header--play { align-items: flex-end; }
.play-brand { margin-bottom: 2px; }
.game-header--play h1 { font-size: clamp(2.3rem, 5vw, 4.3rem); }

/* One split marker when birth and death are the same place */
.combined-dot {
  background: linear-gradient(90deg, var(--birth) 0 50%, var(--death) 50% 100%);
}
.offline-map-marker--combined {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  pointer-events: none;
}
.offline-map-marker--combined .offline-map-marker-dot {
  background: linear-gradient(90deg, var(--birth) 0 50%, var(--death) 50% 100%);
}
.offline-map-marker--combined .offline-map-marker-label {
  bottom: 11px;
  border-left: 0;
  padding-left: 11px;
}
.offline-map-marker--combined .offline-map-marker-label::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  border-radius: 8px 0 0 8px;
  background: linear-gradient(180deg, var(--birth) 0 50%, var(--death) 50% 100%);
}
.offline-map-marker--combined.offline-map-marker--label-left .offline-map-marker-label {
  right: 20px;
  left: auto;
  padding-right: 11px;
  padding-left: 8px;
  border-right: 0;
}
.offline-map-marker--combined.offline-map-marker--label-left .offline-map-marker-label::before {
  right: 0;
  left: auto;
  border-radius: 0 8px 8px 0;
}

.person-textarea-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-help { color: var(--muted); font-size: .76rem; font-weight: 500; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-map-art { min-height: 390px; }
  .mode-grid,
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-hero { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .site-header { align-items: flex-start; }
  .site-nav { flex-direction: column; align-items: flex-end; gap: 8px; }
  .home-hero { margin-top: 10px; border-radius: 20px; }
  .home-hero-copy { padding: 34px 24px; }
  .home-map-art { min-height: 285px; }
  .section-heading,
  .site-callout { grid-template-columns: 1fr; }
  .mode-grid,
  .collection-grid,
  .person-textarea-grid { grid-template-columns: 1fr; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .game-header--play { align-items: stretch; }
}


/* V13: pre-game settings dialog */
.game-settings-dialog {
  width: min(610px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(32, 37, 34, 0.18);
  border-radius: 22px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(19, 28, 24, 0.3);
}

.game-settings-dialog::backdrop {
  background: rgba(28, 34, 31, 0.58);
  backdrop-filter: blur(5px);
}

.game-settings-form {
  display: grid;
  gap: 20px;
  padding: clamp(22px, 5vw, 34px);
}

.game-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.game-settings-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5vw, 2.55rem);
  line-height: 1;
}

.game-settings-heading p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.dialog-close-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
  font-size: 1.45rem;
  line-height: 1;
}

.game-settings-options {
  display: grid;
  gap: 10px;
}

.game-setting-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  cursor: pointer;
}

.game-setting-option:hover {
  border-color: rgba(29, 64, 51, 0.52);
  background: #f8faf8;
}

.game-setting-copy {
  display: grid;
  gap: 4px;
}

.game-setting-copy strong {
  font-size: 1rem;
}

.game-setting-copy small {
  max-width: 430px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.game-setting-option input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.game-settings-note {
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.84rem;
  line-height: 1.5;
}

.game-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.play-settings-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.play-settings-summary span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.78rem;
  font-weight: 750;
}

.map-game-hud-item[hidden] {
  display: none;
}

.untimed-game .map-game-hud {
  grid-template-columns: repeat(2, auto);
}

@media (max-width: 640px) {
  .game-settings-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .game-settings-actions button {
    width: 100%;
  }

  .game-setting-option {
    align-items: flex-start;
  }
}


/* V14: reliable map loading and flexible game settings */
.map-load-error {
  display: grid;
  width: 100%;
  height: 100%;
  place-content: center;
  gap: 8px;
  padding: 30px;
  color: #722b25;
  background: #f2e7e4;
  text-align: center;
}

.map-load-error strong {
  font-size: 1.05rem;
}

.map-load-error span {
  max-width: 520px;
  color: #6c504d;
  font-size: 0.86rem;
  line-height: 1.5;
}

.game-setting-number {
  width: 92px !important;
  min-width: 92px;
  padding: 10px 8px !important;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-weight: 800;
}

.untimed-game .map-game-hud {
  grid-template-columns: repeat(2, auto);
}

.untimed-game #result-metric {
  color: var(--primary);
}

@media (max-width: 640px) {
  .game-setting-option--number {
    align-items: center;
  }

  .game-setting-number {
    width: 78px !important;
    min-width: 78px;
  }
}


/* Projection-safe geometry: both the map image and markers use the exact
   1419.6 × 719.98 SVG viewBox generated by Basemap's Robinson projection. */
.offline-vector-map {
  aspect-ratio: 1419.6 / 719.98;
  min-height: 0;
}
.offline-map-scene,
.offline-map-image,
.offline-map-marker-layer {
  width: 100%;
  height: 100%;
}
.offline-map-image {
  object-fit: fill;
}

/* Supabase administration and setup */
.auth-gate{min-height:100vh;display:grid;place-items:center;padding:24px}.auth-gate[hidden]{display:none}.auth-card{width:min(440px,100%);display:grid;gap:14px;padding:28px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:var(--shadow)}.auth-card h1{font-size:2.4rem}.auth-card label{display:grid;gap:6px;font-weight:750}.admin-header-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center}.pagination-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;color:var(--muted);font-size:.86rem}.setup-check-list{display:grid;gap:10px;margin-top:18px}.setup-check-row{display:grid;gap:4px;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-strong)}.setup-check-row span{color:var(--muted);font-size:.9rem}code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
