@font-face {
  font-family: Atlas;
  src: url("/play/game-assets/VT323-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  --paper: #f4e9cd;
  --paper-light: #fbf5e4;
  --paper-deep: #e6d8b4;
  --ink: #2b2118;
  --muted: #6c5f46;
  --red: #ac3e32;
  --ocean: #b5cbcd;
  --rule: #8d8062;
  --texture: url("/play/game-assets/paper-speckle.svg");
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Authentic Farflung Rarity Palette */
  --tier-miss: #587285;
  --tier-common: #4c4637;
  --tier-uncommon: #2b6e49;
  --tier-rare: #af3a2e;
  --tier-elusive: #6d3a7c;
  --tier-farflung: #9b690c;
  --tier-farflung-bg: #f6df98;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 8px;
  background: repeating-linear-gradient(
    1deg,
    #392a1c 0px,
    #4a3523 3px,
    #3b2b1d 5px,
    #503b27 7px,
    #38291c 9px
  );
  color: var(--ink);
  font: 18px/1.18 Atlas, monospace;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 2px solid var(--ink);
  background: var(--paper);
  border-radius: 0;
  transition: transform 0.08s ease, background-color 0.12s ease;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.52;
  cursor: default;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible,
svg:focus-visible,
.compass:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.board {
  --panel-width: clamp(386px, 31.5vw, 472px);
  position: relative;
  height: calc(100dvh - 16px);
  min-height: 520px;
  border: 3px double var(--ink);
  box-shadow: 0 0 0 3px #e3d7b9;
  background: var(--paper);
  overflow: hidden;
}

.board:before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 9;
  pointer-events: none;
  background:
    radial-gradient(circle at 4px 4px, #ad4939 0 3px, #342a21 3px 4px, transparent 4px),
    radial-gradient(circle at calc(100% - 4px) 4px, #ad4939 0 3px, #342a21 3px 4px, transparent 4px),
    radial-gradient(circle at 4px calc(100% - 4px), #ad4939 0 3px, #342a21 3px 4px, transparent 4px),
    radial-gradient(circle at calc(100% - 4px) calc(100% - 4px), #ad4939 0 3px, #342a21 3px 4px, transparent 4px);
}

.board:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid #e9dfbd;
  z-index: 8;
}

/* Map Area */
.map-area {
  position: absolute;
  inset: 0 var(--panel-width) 0 0;
  overflow: hidden;
  background-color: var(--ocean);
  background-image: url("/play/game-assets/ocean-waves.svg");
  background-size: 80px 64px;
}

.map-area:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: var(--texture);
  mix-blend-mode: multiply;
}

#world-map {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#world-map.dragging {
  cursor: grabbing;
}

.country {
  fill: #ecdfb7;
  stroke: #403c2b;
  stroke-width: 0.95;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
  paint-order: stroke fill;
  transition: fill 0.12s ease;
}

.board.hide-borders .country {
  stroke: #ecdfb7;
  stroke-width: 0.25;
  stroke-dasharray: none;
}

.country:hover {
  fill: #dfd09c;
}

.country.selected {
  fill: #c7c387;
  stroke: #6e4f28;
  stroke-width: 2.2;
  stroke-dasharray: none;
}

.country.reveal-hit {
  fill: #b8cf9c;
  stroke: #2e6e48;
  stroke-width: 3.4;
  stroke-dasharray: none;
}

.country.reveal-miss {
  fill: #c4ced4;
  stroke: #587285;
  stroke-width: 2.8;
  stroke-dasharray: none;
}

/* Chart Answer Explorer Rarity Fills */
.country.overlay-farflung { fill: #f1cb59; stroke: #784f05; stroke-width: 2; stroke-dasharray: none; }
.country.overlay-elusive { fill: #b78cc6; stroke: #4f255c; stroke-width: 1.8; stroke-dasharray: none; }
.country.overlay-rare { fill: #dd8478; stroke: #7c241b; stroke-width: 1.6; stroke-dasharray: none; }
.country.overlay-uncommon { fill: #84ba98; stroke: #205538; stroke-width: 1.5; stroke-dasharray: none; }
.country.overlay-common { fill: #b8b19c; stroke: #453f32; stroke-width: 1.4; stroke-dasharray: none; }

.map-controls {
  position: absolute;
  left: 10px;
  bottom: 28px;
  display: grid;
  gap: 5px;
  z-index: 3;
}

.map-controls button {
  width: 38px;
  height: 38px;
  box-shadow: 0 2px var(--ink);
  font-size: 22px;
  background: var(--paper-light);
}

.map-controls button:hover {
  background: var(--paper-deep);
}

.compass {
  position: absolute;
  bottom: 28px;
  right: 12px;
  width: 54px;
  height: 54px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper-light);
  box-shadow: 0 2px var(--ink);
  text-align: center;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 11px;
  line-height: 10px;
  cursor: pointer;
  user-select: none;
}

.compass b {
  color: var(--red);
  font-size: 29px;
  line-height: 26px;
  text-shadow: 1px 1px var(--ink);
}

.map-readout {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: #fbf5e4ee;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px #2b211844;
  padding: 5px 10px;
  font-size: 17px;
  letter-spacing: 1px;
}

.map-readout strong {
  color: var(--red);
  font-weight: normal;
  margin-left: 6px;
}

.map-overlay-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  max-width: 480px;
  z-index: 4;
  background: #fbf5e4f2;
  border: 3px double var(--ink);
  box-shadow: 2px 2px #2b211844;
  padding: 6px 10px;
}

.overlay-bar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.overlay-bar-top strong {
  font-weight: normal;
  font-size: 16px;
  letter-spacing: 0.8px;
}

.tiny-btn {
  padding: 1px 7px;
  font-size: 13px;
}

.overlay-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
}

.overlay-legend span {
  padding: 1px 5px;
  border: 1px solid var(--ink);
}

.leg-f { background: #f1cb59; }
.leg-e { background: #d6bce0; }
.leg-r { background: #ecb0a8; }
.leg-u { background: #aad3b9; }
.leg-c { background: #d5cfc0; }

.overlay-fact {
  margin: 4px 0 0;
  font: 12px/1.3 var(--serif);
  color: var(--ink);
}

.overlay-fact:empty {
  display: none;
}

.map-status {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper-light);
  border: 3px double var(--ink);
  padding: 12px 18px;
  z-index: 4;
}

.map-status:empty {
  display: none;
}

.latitude {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-size: 12px;
  text-shadow: 1px 1px var(--paper);
  z-index: 2;
}

.latitude span {
  position: absolute;
  right: 8px;
}

.longitude {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 15px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  text-shadow: 1px 1px var(--paper);
  pointer-events: none;
  z-index: 2;
}

.longitude span {
  position: absolute;
  transform: translateX(-50%);
}

/* Topbar */
.topbar {
  height: 52px;
  position: absolute;
  right: 0;
  top: 0;
  width: var(--panel-width);
  display: flex;
  align-items: stretch;
  border-left: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  background-image: var(--texture);
  z-index: 5;
}

.icon-button {
  border: 0;
  border-right: 2px solid var(--ink);
  width: 39px;
  flex: none;
  font-size: 20px;
  background: transparent;
  display: grid;
  place-items: center;
}

.icon-button.muted {
  opacity: 0.65;
}

.icon-button.border-left {
  border-right: 0;
  border-left: 2px solid var(--ink);
}

.icon-button:hover,
.account-pill:hover {
  background: var(--paper-deep);
}

.top-info {
  padding: 4px 11px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.top-info > span {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-info strong {
  font-weight: normal;
  font-size: 23px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-right-cluster {
  display: flex;
  align-items: stretch;
}

.pip-bars {
  display: flex;
  align-items: flex-end;
  align-self: center;
  gap: 3px;
  height: 24px;
  padding-inline: 6px;
}

.pip-bars:empty {
  display: none;
}

.pip-bar {
  width: 6px;
  background: #cfc29f;
  border: 1px solid #534632;
}

.pip-bar.h-0 { height: 5px; background: #dfd3b5; }
.pip-bar.h-miss { height: 7px; background: var(--tier-miss); }
.pip-bar.h-common { height: 11px; background: var(--tier-common); }
.pip-bar.h-uncommon { height: 14px; background: var(--tier-uncommon); }
.pip-bar.h-rare { height: 17px; background: var(--tier-rare); }
.pip-bar.h-elusive { height: 20px; background: var(--tier-elusive); }
.pip-bar.h-farflung { height: 24px; background: #d69c22; }

.clock-pill {
  align-self: center;
  margin-right: 6px;
  padding: 2px 7px;
  font-size: 16px;
  background: var(--paper-light);
  border: 2px solid var(--ink);
}

.clock-pill.urgent {
  background: var(--red);
  color: #fff6df;
}

.account-pill {
  border: 0;
  border-left: 2px solid var(--ink);
  height: 100%;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  font-size: 14px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  max-width: 118px;
}

#account-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Sidebar */
.sidebar {
  position: absolute;
  right: 0;
  top: 52px;
  bottom: 0;
  width: var(--panel-width);
  border-left: 2px solid var(--ink);
  background: var(--paper);
  background-image: var(--texture);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 4;
}

.round-panel {
  padding: 15px 19px 15px;
  border-bottom: 4px double var(--ink);
  background: #f8efd699;
}

.round-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.round-meta em {
  font-style: normal;
  color: var(--red);
}

.round-cat {
  border: 1px solid var(--rule);
  padding: 1px 6px;
  font-size: 12px;
  background: var(--paper-light);
}

.round-panel h1 {
  font-size: 31px;
  line-height: 1.16;
  font-weight: normal;
  margin: 9px 0 0;
}

.round-clarifier {
  margin: 7px 0 0;
  font: italic 13.5px/1.38 var(--serif);
  color: var(--muted);
}

.action-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.loading-box {
  padding: 24px;
  text-align: center;
}

.question-space {
  flex: 1;
  min-height: 0;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}

.gameplay-tip {
  border-left: 3px solid var(--rule);
  padding: 6px 10px;
  font: 13px/1.4 var(--serif);
  color: var(--muted);
  background: #efe2c170;
}

.country-search-panel {
  padding: 9px 14px;
  font-size: 16px;
  border-top: 1px dashed var(--rule);
}

.country-search-panel summary {
  cursor: pointer;
  color: var(--muted);
  letter-spacing: 0.6px;
}

.country-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.country-picker input,
.country-picker select {
  width: 100%;
  min-width: 0;
  padding: 7px;
  border: 1.5px solid var(--ink);
  background: var(--paper-light);
  font-size: 16px;
}

.drop-panel {
  border-top: 4px double var(--ink);
  padding: 11px 13px;
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr 154px;
  align-items: center;
  gap: 9px;
  background: #efe3c2;
}

.drop-panel .primary {
  height: 66px;
  font-size: 23px;
}

.pin-note {
  font-size: 15px;
  line-height: 1.45;
}

.pin-note p {
  margin: 0;
}

.pin-selected-title {
  font-size: 20px;
  color: var(--ink);
}

.pin-selected-title.active {
  color: var(--red);
}

.pin-note kbd {
  font: 13px Atlas, monospace;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  padding: 1px 4px;
}

.pin-note .quiet {
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--muted);
}

/* Buttons */
.primary {
  min-height: 48px;
  padding: 10px 18px;
  letter-spacing: 2.5px;
  box-shadow: 0 3px var(--ink);
  font-size: 21px;
  background: var(--paper-light);
}

.primary:hover:not(:disabled),
.secondary:hover:not(:disabled) {
  background: #e4d6ad;
}

.primary.red {
  background: var(--red);
  color: #fff3d6;
}

.primary.red:hover:not(:disabled) {
  background: #943227;
}

.primary.dark {
  background: var(--ink);
  color: var(--paper);
}

.primary.dark:hover:not(:disabled) {
  background: #443627;
}

.secondary {
  padding: 9px 14px;
  min-height: 40px;
  letter-spacing: 1.2px;
  font-size: 17px;
  box-shadow: 0 2px var(--ink);
  background: var(--paper-light);
}

/* Stamps & Rarity Colors */
.stamp,
.mini-stamp,
.result-ticket b {
  text-transform: uppercase;
}

.stamp {
  display: inline-block;
  padding: 3px 10px;
  border: 3px double currentColor;
  transform: rotate(-2.5deg);
  font-size: 24px;
  letter-spacing: 2.5px;
  background: #fbf5e4cc;
}

.mini-stamp {
  display: inline-block;
  font-size: 15px;
  letter-spacing: 1px;
  padding: 1px 6px;
  border: 3px double currentColor;
  transform: rotate(-2deg);
  background: #fbf5e4aa;
}

.tier-miss { color: var(--tier-miss); }
.tier-common { color: var(--tier-common); }
.tier-uncommon { color: var(--tier-uncommon); }
.tier-rare { color: var(--tier-rare); }
.tier-elusive { color: var(--tier-elusive); }
.tier-farflung {
  color: var(--tier-farflung);
  background: var(--tier-farflung-bg);
}

/* Post-round Feedback */
.board[data-stage="feedback"] .round-panel {
  display: none;
}

.journey-art {
  flex: 1;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px 10px;
  overflow: hidden;
}

.journey-map {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 265px;
  max-height: 340px;
  overflow: visible;
}

.journey-route {
  fill: none;
  stroke: var(--red);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feedback-card {
  margin: 0 11px 9px;
  padding: 12px 14px;
  border: 4px double var(--ink);
  background: var(--paper-light);
}

.feedback-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feedback-km {
  font-size: 27px;
}

.feedback-country-line {
  margin: 8px 0 5px;
  font-size: 23px;
}

.feedback-fact {
  margin: 0;
  font: 14px/1.45 var(--serif);
  color: #3e3222;
}

.bottom-action {
  padding: 9px 12px 12px;
  border-top: 3px double var(--rule);
}

.bottom-action button {
  width: 100%;
}

.map-popup {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  width: min(290px, calc(100% - 24px));
  padding: 13px 16px;
  border: 5px double var(--ink);
  background: var(--paper-light);
  text-align: center;
  z-index: 4;
  box-shadow: 4px 4px #2b211855;
}

.map-popup .eyebrow {
  color: var(--red);
  font-size: 13px;
  letter-spacing: 1.5px;
}

.map-popup h2 {
  font-size: 31px;
  font-weight: normal;
  text-transform: uppercase;
  margin: 7px 0 10px;
  text-shadow: 1px 1px #d7c392;
}

.popup-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 23px;
}

/* Intro Stage Layout */
.intro-banner {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 28px));
  background: var(--paper-light);
  background-image: var(--texture);
  border: 5px double var(--ink);
  padding: 15px 20px;
  text-align: center;
  box-shadow: 5px 5px #2b211860;
}

.intro-banner h1 {
  font-size: 74px;
  font-weight: normal;
  letter-spacing: 4px;
  margin: 2px 0 0;
  line-height: 0.96;
  text-shadow: 3px 3px var(--red);
}

.eyebrow {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
}

.intro-banner p {
  font: 15px/1.4 var(--serif);
  color: #463928;
  margin: 8px 0 0;
}

.challenge-banner {
  margin-top: 10px;
  padding: 7px 10px;
  background: #f6df98;
  border: 2px solid var(--ink);
  font-size: 16px;
  letter-spacing: 1px;
}

.board[data-stage="intro"] {
  max-width: min(1160px, calc((100dvh - 16px) * 1.5));
  margin: auto;
  min-height: 610px;
}

.board[data-stage="intro"] .map-area {
  inset: 52px 0 0;
}

.board[data-stage="intro"] .topbar {
  width: 100%;
  border-left: 0;
}

.board[data-stage="intro"] .sidebar {
  top: auto;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 28px));
  height: auto;
  border: 5px double var(--ink);
  background: var(--paper-light);
  background-image: var(--texture);
  z-index: 4;
  box-shadow: 5px 5px #2b211860;
  overflow: visible;
}

.board[data-stage="intro"] .latitude,
.board[data-stage="intro"] .longitude,
.board[data-stage="intro"] .map-controls,
.board[data-stage="intro"] .compass {
  display: none;
}

.home-cta {
  padding: 12px 16px 13px;
  text-align: center;
}

.home-status-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 8px;
  margin-bottom: 10px;
  font-size: 15px;
}

.home-status-strip button {
  border: 0;
  background: none;
  color: var(--red);
  padding: 2px 4px;
  font-size: 15px;
  letter-spacing: 1px;
}

.difficulty-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 14px;
}

.difficulty-bar > span {
  color: var(--muted);
  letter-spacing: 1px;
  margin-right: 2px;
}

.diff-toggle {
  padding: 4px 9px;
  font-size: 14px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
}

.diff-toggle.active {
  background: var(--ink);
  color: #f6df98;
}

.home-cta .primary {
  width: 100%;
  min-height: 56px;
  font-size: 25px;
}

.home-secondary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.home-secondary button {
  border: 3px double var(--ink);
  min-height: 46px;
  padding: 5px 6px;
  background: var(--paper);
  font-size: 18px;
  letter-spacing: 0.8px;
}

.home-secondary button:hover {
  background: var(--paper-deep);
}

.board-footer {
  display: none;
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  z-index: 4;
  text-shadow: 1px 1px var(--paper);
}

.board[data-stage="intro"] .board-footer {
  display: block;
}

.board-footer a {
  color: var(--ink);
  text-decoration: none;
}

.link-btn {
  border: 0;
  background: none;
  padding: 0 3px;
  text-decoration: underline;
  font-size: 13px;
}

/* Summary ("Camp") Stage */
.board[data-stage="summary"] .round-panel {
  display: none;
}

.results-body {
  padding: 15px 17px 14px;
  overflow: auto;
  flex: 1;
}

.score-card {
  border: 2px solid var(--ink);
  background: var(--paper-light);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.result-tickets {
  padding: 7px 10px 7px 13px;
  display: grid;
  align-content: center;
}

.result-ticket {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  border-bottom: 1px solid #d5c7a5;
  font-size: 19px;
}

.result-ticket:last-child {
  border-bottom: 0;
}

.result-ticket > span {
  width: 14px;
  color: var(--muted);
}

.result-ticket b {
  font-weight: normal;
  font-size: 18px;
  letter-spacing: 1.6px;
  border: 2px solid currentColor;
  padding: 1px 5px;
  line-height: 1;
}

.result-ticket:nth-child(odd) b {
  transform: rotate(-1.6deg);
}

.score-art {
  position: relative;
  overflow: hidden;
  border-left: 2px solid var(--ink);
  padding: 11px 10px 44px;
  text-align: center;
  background: linear-gradient(180deg, #b8d1d4 0%, #dce7dc 68%, #9cb376 68%, #7d985c 100%);
}

.score-art.zone-ice,
.score-art.zone-edge {
  background: linear-gradient(180deg, #9fb9cc 0%, #e7eff4 66%, #cadce6 66%, #9cb7c8 100%);
}

.score-art.zone-mountains {
  background: linear-gradient(180deg, #c6d4d0 0%, #ebe5cf 66%, #a59d84 66%, #7f7761 100%);
}

.score-art strong {
  display: inline-block;
  padding: 2px 10px;
  border: 3px double var(--ink);
  background: var(--paper-light);
  font-weight: normal;
  font-size: 24px;
  letter-spacing: 2px;
  text-shadow: 1px 1px var(--red);
}

.score-art .distance {
  font-size: 46px;
  line-height: 1;
  margin: 12px 0 3px;
  color: var(--ink);
  text-shadow: 2px 2px #fff6df;
}

.score-art .distance small {
  font-size: 20px;
}

.score-zone-tag {
  display: block;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: var(--red);
}

.score-landscape {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  font-size: 24px;
  letter-spacing: 5px;
  color: #3f5b3a;
  opacity: 0.85;
}

.score-share-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 7px;
  padding: 9px 10px 6px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
}

.score-share-row button {
  min-height: 44px;
  padding: 7px 8px;
  font-size: 18px;
  letter-spacing: 1.5px;
}

.percentile-banner {
  grid-column: 1 / -1;
  padding: 5px 11px 8px;
  background: var(--paper);
  font: 13px/1.35 var(--serif);
  color: #463928;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.percentile-banner button {
  border: 0;
  background: none;
  color: var(--red);
  font: 15px Atlas, monospace;
  letter-spacing: 1px;
  padding: 0;
  text-decoration: underline;
  white-space: nowrap;
  flex: none;
}

.challenge-verdict {
  margin-top: 10px;
  padding: 8px 11px;
  border: 2px solid var(--ink);
  background: #f6df98;
  font-size: 16px;
  text-align: center;
}

/* Progression Trio (Streak / Passport / Souvenirs) */
.progression-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 11px;
}

.prog-card {
  position: relative;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 0 2px var(--ink);
  padding: 9px 5px 8px;
  text-align: center;
}

.prog-card span {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--muted);
}

.prog-card b {
  display: block;
  font-weight: normal;
  font-size: 17px;
  margin-top: 3px;
}

.new-ribbon {
  position: absolute;
  top: -7px;
  right: 4px;
  background: var(--red);
  color: #fff6df;
  font-size: 11px;
  padding: 0 4px;
  border: 1px solid var(--ink);
}

/* Camp Login / Save CTA */
.camp-cta-card {
  margin-top: 10px;
  border: 4px double var(--ink);
  background: #fbf3dc;
  padding: 10px 12px;
  display: grid;
  gap: 7px;
}

.camp-cta-card strong {
  font-weight: normal;
  font-size: 19px;
  letter-spacing: 1px;
}

.camp-cta-card p {
  margin: 0;
  font: 13px/1.38 var(--serif);
  color: var(--muted);
}

.practice-again-btn {
  width: 100%;
  margin-top: 9px;
}

.results-heading {
  font-size: 14px;
  letter-spacing: 1.5px;
  border-bottom: 3px double var(--ink);
  padding-bottom: 6px;
  margin: 16px 0 4px;
}

.result-detail {
  padding: 11px 6px;
  border-bottom: 1px solid #c3b491;
}

.result-detail.inspected {
  background: #e5d6ad99;
  outline: 1px dashed var(--red);
}

.result-detail h3 {
  font-weight: normal;
  font-size: 17px;
  line-height: 1.22;
  margin: 0 0 6px;
}

.result-answer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.result-answer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 19px;
}

.result-reason {
  margin: 6px 0;
  font: 13px/1.38 var(--serif);
  color: #4f412e;
}

.result-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.chart-btn {
  padding: 3px 9px;
  font-size: 14px;
  letter-spacing: 0.8px;
  background: var(--paper-light);
}

.result-detail details {
  margin-top: 6px;
}

.result-detail summary {
  cursor: pointer;
  color: var(--red);
  font-size: 15px;
  letter-spacing: 0.8px;
}

.answer-list {
  list-style: none;
  padding: 6px 0 0;
  margin: 0;
  display: grid;
  gap: 3px;
}

.answer-list li button {
  width: 100%;
  border: 0;
  border-bottom: 1px dashed #cbbd9a;
  background: transparent;
  padding: 4px 3px;
  display: flex;
  justify-content: space-between;
  font-size: 16px;
  text-align: left;
}

.answer-list li button:hover {
  background: #e8dab5;
}

/* Dialogs */
dialog {
  width: min(560px, calc(100% - 20px));
  max-height: 88dvh;
  overflow: auto;
  background: var(--paper);
  background-image: var(--texture);
  border: 5px double var(--ink);
  padding: 18px 20px;
  color: var(--ink);
  box-shadow: 6px 6px #1c161088;
}

dialog::backdrop {
  background: #221b1388;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 19px;
  letter-spacing: 1.8px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.dialog-heading button {
  border: 2px solid var(--ink);
  background: var(--paper-light);
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
}

.dialog-lead,
.body-copy {
  font: 14px/1.45 var(--serif);
  color: #3f3324;
  margin: 0 0 9px;
}

.serif-heading {
  font: 28px/1.15 var(--serif);
  margin: 4px 0 10px;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.tab-btn {
  padding: 7px 8px;
  font-size: 16px;
  letter-spacing: 1px;
  background: var(--paper-light);
}

.tab-btn.active {
  background: var(--ink);
  color: #f6df98;
}

/* Leaderboard */
.nudge-card {
  border: 3px double var(--ink);
  background: #fbf3dc;
  padding: 9px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nudge-card strong {
  font-weight: normal;
  font-size: 18px;
}

.nudge-card p {
  margin: 2px 0 0;
  font: 12.5px/1.35 var(--serif);
  color: var(--muted);
}

.small-cta {
  white-space: nowrap;
  font-size: 15px;
  padding: 7px 10px;
}

.board-meta-line {
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.leaderboard-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.leaderboard-wrap th,
.leaderboard-wrap td {
  text-align: left;
  border-bottom: 1px solid #c9ba96;
  padding: 7px 4px;
}

.leaderboard-wrap th {
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: normal;
}

.you-row {
  background: #e6d7b1;
}

.verified-dot {
  color: var(--tier-farflung);
  font-size: 14px;
  margin-left: 3px;
}

.mini-pips {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.mini-pip {
  width: 7px;
  height: 11px;
  border: 1px solid #3c3123;
}

.mini-pip.p-F { background: #e6b432; }
.mini-pip.p-E { background: #8e56a1; }
.mini-pip.p-R { background: #c55043; }
.mini-pip.p-U { background: #438c64; }
.mini-pip.p-C { background: #776f5c; }
.mini-pip.p-M { background: #7f95a3; }

.dialog-footer-actions,
.button-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* Auth Form */
.merge-preview {
  border-left: 3px solid var(--tier-uncommon);
  background: #e9efe2;
  padding: 8px 11px;
  margin-bottom: 11px;
  font: 13px/1.4 var(--serif);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form label {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 2px;
}

.auth-form input {
  width: 100%;
  padding: 9px 10px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  font: 15px var(--sans);
}

.emblem-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
}

.emblem-choice {
  height: 38px;
  font-size: 20px;
  display: grid;
  place-items: center;
  background: var(--paper-light);
}

.emblem-choice.selected {
  background: var(--ink);
  box-shadow: inset 0 0 0 2px #f6df98;
}

.form-error {
  margin: 2px 0;
  padding: 6px 9px;
  background: #f5d8d3;
  border: 1px solid var(--red);
  color: #7d1f16;
  font: 13px/1.35 var(--serif);
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  margin-bottom: 10px;
}

.profile-badge {
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-size: 26px;
}

.profile-hero h2 {
  margin: 0;
  font-weight: normal;
  font-size: 26px;
}

.stats-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.stats-mini-grid div {
  border: 1.5px solid var(--ink);
  background: var(--paper-light);
  padding: 7px 5px;
  text-align: center;
}

.stats-mini-grid span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.stats-mini-grid b {
  font-weight: normal;
  font-size: 20px;
}

/* Field Log / Archive / Passport / Souvenirs */
.quick-nav-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

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

.archive-list {
  display: grid;
  gap: 7px;
}

.archive-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
}

.archive-row strong {
  font-weight: normal;
  font-size: 19px;
}

.archive-row span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}

.passport-meter {
  border: 2px solid var(--ink);
  background: var(--paper-light);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.continent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 10px 0;
}

.continent-box {
  border: 1.5px solid var(--rule);
  background: var(--paper-light);
  padding: 6px 8px;
  font-size: 15px;
}

.stamp-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.country-stamp-chip {
  border: 1.5px solid var(--tier-uncommon);
  color: var(--tier-uncommon);
  background: #edf4ea;
  padding: 2px 7px;
  font-size: 15px;
}

.souvenir-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.souvenir-item {
  border: 2px solid var(--ink);
  background: var(--paper-light);
  padding: 8px 10px;
  display: flex;
  gap: 9px;
  align-items: center;
}

.souvenir-item.locked {
  opacity: 0.55;
  border-style: dashed;
}

.souvenir-icon {
  font-size: 25px;
  width: 34px;
  text-align: center;
}

.souvenir-item strong {
  display: block;
  font-weight: normal;
  font-size: 17px;
}

.souvenir-item span {
  display: block;
  font: 12px/1.3 var(--serif);
  color: var(--muted);
}

/* Postcard Modal */
.postcard-canvas-wrap {
  border: 3px solid var(--ink);
  background: #dfd2b1;
  padding: 6px;
  margin-bottom: 12px;
}

#postcard-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.share-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.span-two {
  grid-column: 1 / -1;
}

.share-feedback {
  margin: 8px 0 0;
  text-align: center;
  color: var(--tier-uncommon);
  font-size: 16px;
  min-height: 20px;
}

/* Help Modal */
.tier-showcase {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  margin: 12px 0;
}

.tier-pill {
  border: 2px solid currentColor;
  padding: 7px 4px;
  text-align: center;
  background: var(--paper-light);
}

.tier-pill span {
  display: block;
  font-size: 13px;
}

.tier-pill b {
  font-weight: normal;
  font-size: 18px;
}

.tier-c { color: var(--tier-common); }
.tier-u { color: var(--tier-uncommon); }
.tier-r { color: var(--tier-rare); }
.tier-e { color: var(--tier-elusive); }
.tier-f { color: var(--tier-farflung); background: var(--tier-farflung-bg); }

.help-rules-box {
  border-left: 3px solid var(--red);
  background: #efe3c2;
  padding: 9px 12px;
  margin: 10px 0;
  font: 13px/1.45 var(--serif);
}

.help-rules-box p {
  margin: 4px 0;
}

.fine-print {
  font: 12.5px/1.45 var(--serif);
  color: var(--muted);
  margin: 8px 0 0;
}

.notice {
  position: absolute;
  z-index: 10;
  left: 14px;
  bottom: 36px;
  max-width: calc(100% - 28px);
  padding: 11px 14px;
  background: var(--paper-light);
  border: 3px solid var(--red);
  box-shadow: 3px 3px #2b211866;
}

.notice button {
  margin-left: 10px;
  padding: 3px 9px;
}

.pin-marker {
  filter: drop-shadow(1px 2px 0 #3f332677);
}

/* Mobile Responsive */
@media (max-width: 760px) {
  body {
    padding: 4px;
  }
  .board {
    height: calc(100dvh - 8px);
    min-height: 560px;
  }
  .map-area {
    inset: 48px 0 49%;
  }
  .topbar {
    width: 100%;
    height: 48px;
    border-left: 0;
  }
  .sidebar {
    top: 51%;
    bottom: 0;
    width: 100%;
    border-left: 0;
    border-top: 3px double var(--ink);
  }
  .icon-button {
    width: 33px;
    font-size: 17px;
  }
  .pip-bars {
    display: none;
  }
  .account-pill {
    padding: 0 5px;
    font-size: 13px;
    max-width: 78px;
  }
  .round-panel {
    padding: 9px 13px;
  }
  .round-panel h1 {
    font-size: 23px;
    margin-top: 4px;
  }
  .round-clarifier {
    font-size: 12px;
    margin-top: 3px;
  }
  .drop-panel {
    min-height: 74px;
    padding: 7px 11px;
    grid-template-columns: 1fr 132px;
  }
  .drop-panel .primary {
    height: 52px;
    font-size: 19px;
  }
  .intro-banner {
    top: 56px;
    padding: 11px 12px;
  }
  .intro-banner h1 {
    font-size: 54px;
  }
  .home-secondary {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .home-secondary button {
    min-height: 40px;
    font-size: 16px;
  }
  .board[data-stage="summary"] .map-area {
    bottom: 62%;
  }
  .board[data-stage="summary"] .sidebar {
    top: 38%;
  }
  .journey-art {
    padding: 6px 14px;
    min-height: 72px;
  }
  .journey-map {
    max-height: 135px;
  }
  .tier-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
  .emblem-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .souvenir-grid,
  .share-actions-grid,
  .dialog-footer-actions {
    grid-template-columns: 1fr;
  }
}

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