@font-face {
  font-family: "Linux Libertine";
  src: url("fonts/LinLibertine_R.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Pixel Operator";
  src: url("fonts/PixelOperator.otf") format("opentype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Linux Libertine", Georgia, "Times New Roman", Times, serif;
  --font-pixel: "Pixel Operator", "SFMono-Regular", Consolas, monospace;
  --font-mono: "SFMono-Regular", Consolas, monospace;
  --lg-bg-color: rgba(255, 255, 255, 0.25);
  --lg-highlight: rgba(255, 255, 255, 0.75);
  --lg-text: #ffffff;
  --page: #f8f9fa;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --border: #a2a9b1;
  --border-soft: #c8ccd1;
  --text: #202122;
  --muted: #54595d;
  --accent: #3366cc;
  --accent-strong: #2a4b8d;
  --aero-top: #f8ffff;
  --aero-mid: #cff3ff;
  --aero-low: #8cddff;
  --aero-bottom: #57bde9;
  --aero-border-light: rgba(255, 255, 255, 0.9);
  --aero-border-dark: rgba(52, 128, 177, 0.55);
  --aero-text: #0f4560;
  --track: #eaecf0;
  --shadow: none;
  --radius-lg: 2px;
  --chrome-surface: rgba(245, 247, 251, 0.76);
  --chrome-surface-strong: rgba(255, 255, 255, 0.88);
  --chrome-border: rgba(255, 255, 255, 0.68);
  --chrome-border-soft: rgba(197, 205, 216, 0.72);
  --chrome-shadow: rgba(18, 27, 42, 0.18);
  --chrome-shadow-strong: rgba(18, 27, 42, 0.28);
  --paper-bg: rgba(255, 255, 255, 0.94);
  --paper-bg-soft: rgba(248, 249, 252, 0.96);
  --paper-line: #d8dee8;
  --paper-ink: #202122;
  --paper-muted: #57606a;
  --paper-accent: #3366cc;
  --layout-edge: 2.4rem;
  --layout-edge-mobile: 1.6rem;
  --layout-bottom-row: 4rem;
  --layout-bottom-row-mobile: 3rem;
  --layout-map-bottom: 11.4rem;
  --layout-map-bottom-tablet: 9rem;
  --layout-map-bottom-mobile: 10.2rem;
  --layout-map-width: 36rem;
  --layout-map-width-tablet: 32rem;
  --layout-map-width-expanded: 72rem;
  --layout-timeline-bottom: 4rem;
  --layout-timeline-bottom-mobile: 3rem;
  --layout-timeline-year-bottom: 11.4rem;
  --layout-timeline-year-bottom-tablet: 9rem;
  --timeline-canvas-min-width: 740px;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  min-height: 100%;
  font-size: 10px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1.6rem;
  line-height: 1.5;
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

code {
  font-family: var(--font-mono);
}

.app-shell {
  min-height: 100vh;
}

.viewer-stage {
  position: relative;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

.timer-overlay,
.round-status-overlay,
.brand-overlay,
.top-panel,
.result-panel,
.map-dock,
.guess-action-overlay,
.settings-overlay,
.settings-modal,
.endgame-modal,
.timeline-year-overlay,
.timeline-overlay {
}

.viewer-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  background: rgba(255, 72, 92, var(--timer-warning-flash-opacity, 0.18));
}

.viewer-stage.is-timer-warning-flash::after {
  animation: timerWarningFlash 560ms ease-out;
}

@keyframes timerWarningFlash {
  0% {
    opacity: 0;
  }

  16% {
    opacity: 1;
  }

  42% {
    opacity: 0.58;
  }

  100% {
    opacity: 0;
  }
}

#viewer {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.viewer-stage.is-game-start-loading #viewer {
  opacity: 0;
  visibility: hidden;
}

.visit-backdrop {
  position: absolute;
  inset: 0;
  z-index: 34;
  background: #c7d0dc;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
  overflow: hidden;
  pointer-events: none;
}

.visit-backdrop::before {
  content: "";
  position: absolute;
  inset: -32px;
  background-color: inherit;
  background-image: inherit;
  background-position: inherit;
  background-repeat: inherit;
  background-size: inherit;
  filter: blur(5px);
  transform: translateZ(0) scale(1.02);
}

.visit-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
}

.visit-backdrop.is-ready {
  background-size: cover, cover;
}

.visit-backdrop.hidden {
  display: none;
}

.viewer-stage.has-visit-backdrop .brand-overlay {
  z-index: 35;
}

.viewer-stage.is-settings-open .brand-overlay {
  z-index: 41;
}

.brand-overlay {
  position: absolute;
  top: var(--layout-edge);
  left: var(--layout-edge);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.38),
    0 0 14px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.brand-icon {
  display: block;
  width: clamp(3.4rem, 5.2vw, 4.6rem);
  height: clamp(3.4rem, 5.2vw, 4.6rem);
  flex-shrink: 0;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.38))
    drop-shadow(0 0 12px rgba(118, 212, 255, 0.18));
}

.brand-wordmark {
  display: inline-flex;
  align-items: center;
}

.brand-letter {
  position: relative;
  display: inline-block;
  line-height: 1;
  letter-spacing: -0.03em;
}

.timer-overlay {
  position: absolute;
  top: var(--layout-edge);
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
}

.round-status-overlay {
  position: absolute;
  top: var(--layout-edge);
  right: var(--layout-edge);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  pointer-events: none;
  text-align: right;
}

.round-status-label,
.round-status-score {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.38),
    0 0 14px rgba(0, 0, 0, 0.22);
  font-variant-numeric: tabular-nums;
}

.round-status-label {
  font-size: 2.8rem;
  letter-spacing: 0.01em;
}

.round-status-score {
  font-size: 5.2rem;
}

.timer-shell {
  display: inline-flex;
  width: auto;
  min-height: 54px;
}

.glass-container {
  position: relative;
  display: flex;
  align-items: center;
  background: transparent;
  color: var(--lg-text);
  overflow: hidden;
  box-shadow:
    0 6px 6px rgba(0, 0, 0, 0.2),
    0 0 20px rgba(0, 0, 0, 0.1);
}

.glass-container--rounded {
  border-radius: 3rem;
}

.glass-filter,
.glass-overlay,
.glass-specular {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.glass-filter {
  z-index: 0;
  backdrop-filter: blur(4px);
  filter: url(#lensFilter) saturate(120%) brightness(1.15);
}

.glass-overlay {
  z-index: 1;
  background: var(--lg-bg-color);
}

.glass-specular {
  z-index: 2;
  box-shadow:
    inset 1px 1px 0 var(--lg-highlight),
    inset 0 0 5px var(--lg-highlight);
}

.glass-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.timer-content {
  min-height: 54px;
  padding: 0 1.8rem;
  width: auto;
}

.timer-border {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.timer-border-track,
.timer-border-progress {
  fill: none;
  stroke-width: 3;
}

.timer-border-track {
  stroke: rgba(255, 255, 255, 0.2);
}

.timer-border-progress {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-linecap: butt;
}

.timer-border-track,
.timer-border-progress,
.timer-label {
  position: absolute;
  inset: 0;
}

.timer-label {
  position: relative;
  display: inline-block;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 3.2rem;
  font-weight: 400;
  letter-spacing: 0;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  line-height: 1;
}

.hud-panel {
  position: absolute;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.win98-panel-body {
  padding: 2rem;
  background: transparent;
  border-radius: inherit;
}

.top-panel {
  top: var(--layout-edge);
  left: var(--layout-edge);
  max-width: min(48rem, calc(100vw - (var(--layout-edge) * 2)));
  padding: 2rem 2.2rem;
}

.result-panel {
  left: var(--layout-edge);
  bottom: 2.8rem;
  width: min(58rem, calc(100vw - (var(--layout-edge) * 3)));
  font-family: var(--font-ui);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2.2rem;
  overflow: hidden;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.result-panel-body {
  display: grid;
  gap: 0;
}

.result-panel-body > :not(.is-hidden) + :not(.is-hidden) {
  margin-top: 0.8rem;
}

.reveal-piece {
  max-height: 8rem;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 180ms ease,
    padding 180ms ease,
    border-width 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.reveal-piece.is-hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  transform: translateY(0.4rem);
}

.result-next {
  justify-self: end;
  margin-top: 0.4rem;
}

.hidden {
  display: none;
}

.eyebrow,
.panel-label,
.metric-label,
.map-caption {
  margin: 0;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 1.6rem;
  color: var(--paper-muted);
}

h1 {
  margin: 6px 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 3.5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.08;
}

.supporting-text {
  margin: 0;
  padding: 1.4rem 1.6rem;
  color: var(--paper-ink);
  line-height: 1.35;
  background: var(--paper-bg-soft);
  border: 1px solid var(--paper-line);
  border-radius: 1.3rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
  max-height: 12rem;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition:
    max-height 180ms ease,
    padding 180ms ease,
    border-width 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.supporting-text.is-hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  transform: translateY(0.4rem);
}

#answer-summary {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  align-items: baseline;
  gap: 1.2rem;
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--paper-ink);
  white-space: normal;
}

.answer-summary-name,
.answer-summary-date {
  min-width: 0;
}

.answer-summary-name {
  text-align: left;
}

.answer-summary-date {
  text-align: right;
  white-space: nowrap;
}

.wiki-summary-card {
  display: grid;
  gap: 1rem;
  max-height: 54rem;
  padding: 1.1rem;
  overflow: hidden;
}

.wiki-summary-card.is-hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.wiki-summary-image-link {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--paper-line);
}

.wiki-summary-image {
  display: block;
  width: 100%;
  max-height: 24rem;
  object-fit: cover;
}

.wiki-summary-content {
  display: grid;
  gap: 0.6rem;
  min-width: 0;
  overflow: hidden;
}

.wiki-summary-title {
  color: var(--paper-ink);
  font-family: var(--font-serif);
  font-size: 2.4rem;
  line-height: 1.15;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.wiki-summary-title:hover,
.wiki-summary-title:focus-visible,
.wiki-summary-links a:hover,
.wiki-summary-links a:focus-visible {
  color: var(--paper-accent);
}

.wiki-summary-extract,
.wiki-summary-meta {
  margin: 0;
  color: var(--paper-muted);
  font-size: 1.8rem;
  line-height: 1.45;
  overflow: hidden;
}

.wiki-summary-meta {
  font-size: 1.5rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.wiki-summary-extract {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
}

.wiki-summary-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  min-width: 0;
  overflow: hidden;
}

.wiki-summary-links a {
  color: var(--paper-accent);
  font-size: 1.6rem;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--accent-strong);
  border-radius: 2px;
  padding: 10px 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  box-shadow: none;
}

.map-dock {
  position: absolute;
  right: var(--layout-edge);
  bottom: var(--layout-map-bottom);
  width: var(--layout-map-width);
  aspect-ratio: 4 / 3;
  display: block;
  height: auto;
  overflow: hidden;
  padding: 0;
  border-radius: 2.2rem;
  border: 1px solid var(--chrome-border);
  background: var(--chrome-surface-strong);
  z-index: 2;
  opacity: 0.7;
  box-shadow:
    0 20px 48px var(--chrome-shadow),
    0 6px 20px rgba(255, 255, 255, 0.18) inset;
  backdrop-filter: blur(22px) saturate(150%);
  transition:
    width 100ms ease,
    height 100ms ease,
    opacity 100ms ease;
  will-change: width, height, opacity;
}

#guess-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #ffffff;
  border-radius: inherit;
}

.guess-action-overlay {
  position: absolute;
  right: var(--layout-edge);
  bottom: var(--layout-bottom-row);
  z-index: 5;
  min-height: 62px;
  display: flex;
  align-items: center;
}

.round-end-toggle-overlay {
  position: absolute;
  right: calc(var(--layout-edge) + var(--round-end-toggle-offset, 16.4rem));
  bottom: var(--layout-bottom-row);
  z-index: 5;
  min-height: 62px;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.guess-action-label,
.guess-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15.2rem;
  min-height: 6.2rem;
  padding: 0 2.4rem;
  margin: 0;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #202122;
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  text-shadow: none;
  font-family: var(--font-serif);
  font-style: normal;
}

.guess-action-label {
  user-select: none;
}

.guess-action-button {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.round-end-toggle-button {
  appearance: none;
  -webkit-appearance: none;
  width: 6.2rem;
  height: 6.2rem;
  min-width: 6.2rem;
  min-height: 6.2rem;
  padding: 0;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #202122;
  cursor: pointer;
  pointer-events: auto;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.round-end-toggle-button.hidden {
  display: none !important;
}

.round-end-toggle-button:hover {
  background: #f8f9fa;
}

.round-end-toggle-button:focus,
.round-end-toggle-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.round-end-toggle-button:active {
  background: #eaecf0;
}

.round-end-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.round-end-toggle-icon svg {
  width: 2.8rem;
  height: 2.8rem;
  fill: currentColor;
}

.round-end-toggle-icon--map {
  display: none;
}

.viewer-stage.is-round-end-pano .round-end-toggle-icon--streetview {
  display: none;
}

.viewer-stage.is-round-end-pano .round-end-toggle-icon--map {
  display: flex;
}

.guess-action-label,
.guess-action-button,
.settings-button,
.settings-option,
.round-end-toggle-button,
.mobile-map-hide-button,
.mobile-map-show-button,
.settings-modal-help,
.settings-selector,
.settings-selector-face,
.endgame-modal-action,
.settings-selector-face,
.timeline-year-label,
.timeline-overlay,
.timeline-canvas {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.guess-action-button:hover {
  background: #f8f9fa;
}

.guess-action-button:focus,
.guess-action-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.guess-action-button:active {
  background: #eaecf0;
}

.guess-action-button.is-waiting,
.endgame-modal-action.is-waiting {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.guess-action-button.is-waiting span,
.endgame-modal-action.is-waiting span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.6ch;
  margin: 0 auto;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0;
}

.waiting-dots-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.08em;
}

.waiting-dots-dot {
  display: inline-block;
  opacity: 0.2;
  animation: waiting-dot-pulse 1s infinite;
}

.waiting-dots-dot:nth-child(1) {
  animation-delay: 0s;
}

.waiting-dots-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.waiting-dots-dot:nth-child(3) {
  animation-delay: 0.32s;
}

.waiting-dots-dot:nth-child(4) {
  animation-delay: 0.48s;
}

.guess-action-overlay .hidden {
  display: none !important;
}

.mobile-map-hide-button,
.mobile-map-show-button {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 4.2rem;
  padding: 0 1.5rem;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #202122;
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.mobile-map-hide-button.hidden,
.mobile-map-show-button.hidden {
  display: none !important;
}

.mobile-map-show-button {
  width: 5rem;
  height: 5rem;
  min-width: 5rem;
  min-height: 5rem;
  padding: 0;
  border-radius: 999px;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.mobile-map-show-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
}

.mobile-map-show-icon svg {
  width: 1.8rem;
  height: 1.8rem;
  fill: currentColor;
}

.viewer-stage.is-round-end .timer-overlay,
.viewer-stage.is-round-end .round-status-overlay,
.viewer-stage.is-round-end .settings-overlay,
.viewer-stage.is-round-end .timeline-year-overlay,
.viewer-stage.is-round-end .timeline-overlay {
  display: none !important;
}

.viewer-stage.is-round-end .map-dock {
  inset: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  opacity: 1;
  z-index: 2;
  box-shadow: none;
  backdrop-filter: none;
  transition: none;
}

.viewer-stage.is-round-end #viewer {
  z-index: 1;
}

.viewer-stage.is-round-end .map-dock {
  z-index: 2;
}

.viewer-stage.is-round-end .brand-overlay {
  z-index: 6;
}

.viewer-stage.is-round-end.is-round-end-pano #viewer {
  z-index: 4;
}

.viewer-stage.is-round-end.is-round-end-pano .map-dock {
  pointer-events: none;
}

.viewer-stage.is-round-end #guess-map {
  height: 100%;
  border-radius: 0;
}

.viewer-stage.is-round-end .result-panel {
  left: auto;
  right: var(--layout-edge);
  top: var(--layout-edge);
  bottom: auto;
  width: min(58rem, calc(100vw - (var(--layout-edge) * 2)));
  max-width: none;
  max-height: calc(100vh - 11.2rem);
  transform: none;
  z-index: 5;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.viewer-stage.is-round-end .result-panel-body {
  max-height: calc(100vh - 14rem);
  overflow-y: auto;
}

@media (hover: hover) and (pointer: fine) {
  .map-dock.is-expanded {
    opacity: 1;
    width: var(--layout-map-width-expanded);
    height: auto;
    z-index: 4;
  }
}

.result-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.result-row:not(.is-hidden) + .result-row:not(.is-hidden) {
  margin-top: 0.7rem;
}

.result-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  padding: 1.1rem 1.4rem;
  background: var(--paper-bg-soft);
  border: 1px solid var(--paper-line);
  border-radius: 1.2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.result-row.hidden {
  display: none;
}

.result-row .metric-label {
  font-size: 2.2rem;
  font-family: var(--font-serif);
  color: var(--paper-muted);
  line-height: 1;
}

.result-row strong {
  display: block;
  font-size: 2.4rem;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--paper-ink);
  line-height: 1;
  white-space: nowrap;
}

.total-score {
  background: var(--paper-bg);
  border-color: var(--border);
}

.result-row-single {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.3rem;
  width: 100%;
}

.result-row-single.hidden {
  display: none;
}

#total-row:not(.is-multiplayer-split) .result-row-single {
  display: flex;
}

#total-row:not(.is-multiplayer-split) .result-row-multiplayer {
  display: none;
}

.result-row-multiplayer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.result-row-multiplayer.hidden {
  display: none;
}

#total-row.is-multiplayer-split .result-row-single {
  display: none;
}

#total-row.is-multiplayer-split .result-row-multiplayer {
  display: grid;
}

.result-row.total-score.is-multiplayer-split {
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.result-row-split-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-width: 0;
  width: 100%;
  padding: 1.1rem 1.4rem;
  background: var(--paper-bg);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.result-row-multiplayer .metric-label {
  font-size: 1.95rem;
}

.result-row-multiplayer strong {
  font-size: 2.3rem;
}

@keyframes waiting-dot-pulse {
  0%,
  100% {
    opacity: 0.2;
  }

  45% {
    opacity: 1;
  }
}

.settings-overlay {
  position: absolute;
  left: var(--layout-edge);
  bottom: var(--layout-bottom-row);
  z-index: 2;
  min-height: 62px;
  display: flex;
  align-items: center;
}

.legal-links {
  position: absolute;
  left: var(--layout-edge);
  bottom: 1.2rem;
  z-index: 2;
  display: none;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.2rem;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.viewer-stage.is-home .legal-links {
  display: flex;
}

.viewer-stage.is-home.is-settings-open .legal-links {
  z-index: 41;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  outline: none;
}

.settings-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  min-width: 15.2rem;
  min-height: 6.2rem;
  padding: 0 2.4rem;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  color: #202122;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  pointer-events: auto;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  text-shadow: none;
}

.settings-button:focus,
.settings-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.settings-button:hover {
  background: #f8f9fa;
}

.settings-button:active {
  background: #eaecf0;
}

.settings-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--layout-edge);
}

.settings-modal.hidden {
  display: none;
}

.settings-modal-scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 25, 34, 0.42);
  backdrop-filter: blur(16px);
  cursor: default;
}

.viewer-stage.has-visit-backdrop .settings-modal-scrim {
  background: transparent;
  backdrop-filter: none;
}

.settings-modal-card {
  position: relative;
  z-index: 1;
  width: min(56rem, calc(100vw - (var(--layout-edge) * 2)));
  padding: 2.4rem;
  font-family: var(--font-ui);
  border: 1px solid #a2a9b1;
  border-radius: 2.2rem;
  background: #fff;
  overflow: visible;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
}

.settings-modal-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  min-width: 0;
}

.settings-modal-title {
  margin: 0;
  min-width: 0;
  color: var(--paper-ink);
  font-family: var(--font-serif);
  font-size: 3.8rem;
  font-weight: 400;
  line-height: 1.05;
  flex: 1 1 auto;
}

.settings-modal-version {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper-muted);
  font-family: var(--font-pixel);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}

.settings-modal-version:hover {
  color: var(--paper-ink);
}

.settings-modal-version:focus,
.settings-modal-version:focus-visible {
  outline: none;
  color: var(--paper-ink);
}

.settings-modal-mobile-note {
  display: none;
  color: var(--paper-muted);
  font-family: var(--font-pixel);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
  flex: 0 0 auto;
}

.settings-modal-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.settings-modal-footer-actions {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  flex: 1 1 30rem;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.settings-modal-help {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  padding: 0;
  text-decoration: none;
  background: transparent;
  color: var(--paper-muted);
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 400;
  line-height: 1;
  text-align: right;
}

.settings-modal-help:hover,
.settings-modal-help:focus-visible {
  color: var(--paper-ink);
  outline: none;
}

.settings-modal-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  transform: translateY(0.28rem);
}

.settings-modal-help-icon svg {
  width: 2rem;
  height: 2rem;
  fill: currentColor;
}

#settings-language-button {
  transform: translateY(0.42rem);
}

#settings-stats-button {
  transform: translateY(0.4rem);
}

#settings-x-button {
  transform: translateY(0.5rem);
}

#settings-stats-button svg {
  width: 1.84rem;
  height: 1.84rem;
}

#settings-reddit-button {
  transform: translateY(0.42rem);
}

#settings-reddit-button svg {
  width: 1.9rem;
  height: 1.9rem;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#settings-language-button svg {
  width: 1.84rem;
  height: 1.84rem;
}

#settings-music-button {
  transform: translateY(0.42rem);
}

#settings-music-button svg {
  width: 1.84rem;
  height: 1.84rem;
}

.settings-modal-summary {
  margin: 0.8rem 0 0;
  color: var(--paper-ink);
  font-family: var(--font-serif);
  font-size: 2.6rem;
  line-height: 1.35;
}

#multiplayer-modal .settings-modal-header {
  display: grid;
  gap: 0.8rem;
  align-items: flex-start;
  justify-content: flex-start;
}

#multiplayer-status,
#multiplayer-room-role {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#multiplayer-status {
  min-height: 0;
  font-size: 1.7rem;
  line-height: 1.4;
  text-align: left;
}

#multiplayer-room-role {
  font-size: 2.3rem;
  line-height: 1.3;
}

.multiplayer-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
  min-width: 0;
}

.multiplayer-code-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.multiplayer-code-actions.hidden {
  display: none;
}

.multiplayer-code-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.8rem;
  height: 4.8rem;
  padding: 0;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--paper-ink);
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.multiplayer-code-action:hover {
  background: #f8f9fa;
}

.multiplayer-code-action:focus,
.multiplayer-code-action:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.multiplayer-code-action:active {
  background: #eaecf0;
}

.multiplayer-code-action:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.multiplayer-code-action svg {
  width: 2.2rem;
  height: 2.2rem;
  fill: currentColor;
}

.settings-help-panel {
  display: grid;
  gap: 1.2rem;
  margin-top: 1.2rem;
  min-height: 31rem;
}

.settings-help-panel.hidden {
  display: none;
}

#settings-language-panel {
  grid-template-rows: minmax(0, 1fr) auto;
}

#settings-language-panel .settings-selector-group {
  min-height: 0;
  max-height: 27rem;
  padding-right: 0.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.settings-music-player {
  display: grid;
  gap: 1rem;
  margin-top: 0.2rem;
  padding: 1.4rem;
  border: 1px solid #a2a9b1;
  border-radius: 1.6rem;
  background:
    linear-gradient(180deg, rgba(248, 249, 250, 0.98), rgba(235, 238, 242, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 18px rgba(18, 27, 42, 0.08);
}

.settings-music-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.settings-music-player-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0 0.9rem;
  border: 1px solid #c8ccd1;
  border-radius: 999px;
  background: #fff;
  color: #54595d;
  font-family: var(--font-pixel);
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.settings-music-track-frame {
  display: grid;
  gap: 0.5rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid #c8ccd1;
  border-radius: 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 246, 247, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.settings-music-track {
  margin: 0;
  color: var(--paper-ink);
  font-family: var(--font-pixel);
  font-size: 1.9rem;
  line-height: 1.3;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.settings-music-status {
  margin: 0;
  color: var(--paper-muted);
  font-family: var(--font-pixel);
  font-size: 1.45rem;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.settings-music-status[data-tone="active"] {
  color: #2f6f44;
}

.settings-music-status[data-tone="error"] {
  color: #a1302b;
}

.settings-music-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.settings-music-control.settings-option {
  min-width: 0;
  min-height: 5.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 1.4rem;
  flex-direction: row;
  gap: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 239, 243, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: none;
}

.settings-music-control.settings-option:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(230, 234, 239, 1));
}

.settings-music-control.settings-option:focus,
.settings-music-control.settings-option:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 1px 4px rgba(0, 0, 0, 0.08);
}

.settings-music-control.settings-option:active {
  background:
    linear-gradient(180deg, rgba(228, 232, 237, 1), rgba(244, 246, 249, 1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 2px 4px rgba(18, 27, 42, 0.14);
}

.settings-music-control.settings-option:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.settings-music-control-icon {
  width: 2.2rem;
  height: 2.2rem;
  flex: 0 0 auto;
  fill: currentColor;
}

.settings-modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.settings-selector-group {
  display: grid;
  gap: 0.7rem;
  margin: 0.7rem 0 0;
  min-width: 0;
}

.settings-selector-title {
  margin: 0;
  padding: 0;
  color: var(--paper-muted);
  font-family: var(--font-serif);
  font-size: 2.4rem;
  line-height: 1.1;
}

.settings-option {
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  min-height: 6.2rem;
  padding: 0 2.4rem;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #202122;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.settings-option.hidden {
  display: none;
}

.settings-option:hover {
  background: #f8f9fa;
}

.settings-option:focus,
.settings-option:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.settings-option:active {
  background: #eaecf0;
}

.settings-dropdown {
  position: relative;
  display: block;
  min-width: 0;
}

.settings-dropdown-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 3;
  appearance: none;
  -webkit-appearance: none;
  min-height: 6.2rem;
  padding: 0 5.6rem 0 2.4rem;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #202122;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transition: background-color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.settings-dropdown-trigger:hover {
  background: #f8f9fa;
}

.settings-dropdown-trigger:focus,
.settings-dropdown-trigger:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.settings-dropdown.is-open .settings-dropdown-trigger {
  background: #f8f9fa;
  border-color: #8a919b;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.settings-dropdown-chevron {
  position: absolute;
  top: 50%;
  right: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--paper-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.settings-dropdown-chevron svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.settings-dropdown.is-open .settings-dropdown-chevron {
  transform: translateY(-50%) rotate(180deg);
}

.settings-dropdown-menu {
  position: absolute;
  top: calc(100% - 3.1rem);
  left: 0;
  right: 0;
  z-index: 2;
  display: grid;
  gap: 0;
  padding: 3rem 0 0;
  border: 1px solid #8a919b;
  border-radius: 0 0 2.4rem 2.4rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.settings-dropdown-menu.hidden {
  display: none;
}

.settings-dropdown-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  min-height: 5.8rem;
  padding: 0 2.4rem;
  border: 0;
  border-top: 1px solid rgba(138, 145, 155, 0.6);
  border-radius: 0;
  background: transparent;
  color: #202122;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-align: left;
  box-shadow: none;
  backdrop-filter: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.settings-dropdown-option:first-child {
  border-top: 0;
}

.settings-dropdown-option:hover {
  background: rgba(248, 249, 250, 0.92);
}

.settings-dropdown-option:focus,
.settings-dropdown-option:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    inset 0 0 0 1px rgba(32, 33, 34, 0.14);
}

.settings-dropdown-option.is-selected {
  background: #e3e7ec;
  color: #101418;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.settings-selector {
  position: relative;
  display: block;
  cursor: pointer;
}

.settings-selector-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-selector-face {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 6.2rem;
  padding: 0 2.4rem;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #202122;
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transition: background-color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.settings-selector:hover .settings-selector-face {
  background: #f8f9fa;
}

.settings-selector-input:focus + .settings-selector-face,
.settings-selector-input:focus-visible + .settings-selector-face {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(32, 33, 34, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.settings-selector-input:checked + .settings-selector-face {
  border-color: #8a919b;
  background: #e3e7ec;
  box-shadow:
    inset 0 2px 4px rgba(18, 27, 42, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 1px 3px rgba(0, 0, 0, 0.08);
  transform: translateY(1px);
}

.endgame-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--layout-edge);
  pointer-events: auto;
}

.endgame-modal.hidden {
  display: none;
}

.endgame-modal-card {
  position: relative;
  z-index: 1;
  width: min(56rem, calc(100vw - (var(--layout-edge) * 2)));
}

.endgame-modal-scrim {
  pointer-events: auto;
}

.endgame-modal-card .settings-modal-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.8rem;
}

.endgame-modal-title {
  font-size: 4.5rem;
  line-height: 0.96;
}

.endgame-modal-quote {
  margin: 0;
  color: var(--paper-muted);
  font-family: var(--font-serif);
  font-size: 2.3rem;
  line-height: 1.35;
  text-align: left;
  white-space: pre-line;
}

.endgame-modal-stats {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}

.endgame-modal-section-title {
  margin-top: 0;
}

.endgame-modal-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  min-height: 6.2rem;
  padding: 0 2.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--paper-bg-soft);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

.endgame-modal-stat.hidden {
  display: none;
}

.endgame-modal-stat span,
.endgame-modal-stat strong {
  font-family: var(--font-serif);
  line-height: 1.1;
}

.endgame-modal-stat span {
  color: var(--paper-muted);
  font-size: 2.4rem;
}

.endgame-modal-stat strong {
  color: var(--paper-ink);
  font-size: 3rem;
  font-weight: 400;
  text-align: right;
  white-space: nowrap;
}

.endgame-modal-action {
  width: 100%;
  margin-top: 1.2rem;
}

.endgame-modal-action:disabled {
  opacity: 1;
  color: #202122;
  cursor: default;
}

.highscore-modal-card {
  width: min(56rem, calc(100vw - (var(--layout-edge) * 2)));
  min-height: 66rem;
}

.highscore-modal {
  z-index: 60;
}

.highscore-modal-header {
  display: grid;
  gap: 0.6rem;
}

.endgame-highscore-status {
  margin: 0;
  min-height: 2.1rem;
  color: var(--paper-muted);
  font-size: 1.5rem;
  line-height: 1.35;
}

.highscore-modal .endgame-highscore-status.hidden {
  display: block;
  visibility: hidden;
}

.endgame-highscore-status[data-tone="error"] {
  color: #b42318;
}

.endgame-highscore-status[data-tone="success"] {
  color: #0a7f37;
}

.endgame-highscore-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
}

.endgame-highscore-input {
  min-width: 0;
  min-height: 5.8rem;
  padding: 0 1.8rem;
  border: 1px solid #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--paper-ink);
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.endgame-highscore-input::placeholder {
  color: #72777d;
}

.endgame-highscore-input:disabled {
  opacity: 0.7;
}

#multiplayer-join-code {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.endgame-highscore-submit {
  width: 100%;
  min-width: 0;
}

.endgame-modal.is-multiplayer-endgame #endgame-open-highscores,
.endgame-modal.is-multiplayer-endgame #endgame-highscore-form,
.endgame-modal.is-multiplayer-endgame #endgame-highscore-submit {
  display: none;
}

.endgame-highscore-list {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  height: 42rem;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  opacity: 1;
  transition: opacity 140ms ease;
}

.endgame-highscore-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.endgame-highscore-list.is-loading {
  opacity: 0;
  pointer-events: none;
}

.endgame-highscore-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 5.4rem;
  padding: 0 1.6rem;
  border: 1px solid #d0d7de;
  border-radius: 1.4rem;
  background: rgba(248, 249, 252, 0.96);
}

.endgame-highscore-item.is-highlighted {
  border-color: #8a919b;
  background: #e3e7ec;
  box-shadow:
    inset 0 2px 4px rgba(18, 27, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 1px 3px rgba(0, 0, 0, 0.08);
}

.endgame-highscore-rank,
.endgame-highscore-name,
.endgame-highscore-score {
  font-family: var(--font-serif);
  line-height: 1.1;
}

.endgame-highscore-rank {
  color: var(--paper-muted);
  font-size: 1.9rem;
}

.endgame-highscore-name {
  min-width: 0;
  color: var(--paper-ink);
  font-size: 2.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.endgame-highscore-score {
  color: var(--paper-ink);
  font-size: 2.2rem;
  font-weight: 400;
}

.endgame-highscore-name.is-empty,
.endgame-highscore-score.is-empty {
  color: var(--paper-muted);
}

.highscore-modal-close {
  width: 100%;
  margin-top: 1rem;
}

.timeline-year-overlay {
  position: absolute;
  left: 50%;
  bottom: var(--layout-timeline-year-bottom);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.timeline-year-label {
  color: #fff;
  font-family: var(--font-serif);
  font-size: 5.4rem;
  font-weight: 400;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}

.timeline-year-value,
.timeline-year-era {
  display: inline-block;
  line-height: 1;
}

.timeline-year-value {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0;
}

.timeline-year-prompt {
  font-size: 1em;
}

.timeline-year-digit {
  display: inline-block;
}

.timeline-year-era {
  font-size: 0.8em;
  transform: translateY(0.03em);
}

.timeline-overlay {
  position: absolute;
  left: 50%;
  width: min(74rem, calc(100vw - 37rem));
  transform: translateX(-50%);
  bottom: var(--layout-timeline-bottom);
  z-index: 2;
  padding: 0;
  overflow: hidden;
  border-radius: 999px;
}

.timeline-glass {
  position: relative;
  overflow: hidden;
  border-radius: inherit;
  background: transparent;
  min-height: 62px;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12),
    0 0 20px rgba(0, 0, 0, 0.08);
}

.timeline-glass-filter,
.timeline-glass-overlay,
.timeline-glass-specular,
.timeline-glass-content {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.timeline-glass-filter,
.timeline-glass-overlay,
.timeline-glass-specular {
  pointer-events: none;
}

.timeline-glass-filter {
  z-index: 0;
  backdrop-filter: blur(12px);
  filter: url(#timelineLensFilter) saturate(125%) brightness(1.04);
}

.timeline-glass-overlay {
  z-index: 1;
  background: rgba(255, 255, 255, 0.12);
}

.timeline-glass-specular {
  z-index: 2;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 0 14px rgba(255, 255, 255, 0.18);
}

.timeline-glass-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.timeline-canvas {
  display: block;
  flex: 0 0 auto;
  min-width: var(--timeline-canvas-min-width);
  width: max(var(--timeline-canvas-min-width), calc(100% + 48px));
  margin-left: 0;
  height: 62px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
}

.timeline-canvas.is-dragging {
  cursor: ew-resize;
}

.timeline-filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.maplibregl-map {
  background: #eef1f4;
  font-family: inherit;
}

.maplibregl-canvas {
  outline: none;
}

.viewer-stage.is-round-end .maplibregl-ctrl-top-right {
  display: none !important;
}

.leaflet-container {
  background: #eef1f4;
  font-family: inherit;
}

.leaflet-top {
  top: 0;
}

.leaflet-left {
  left: 6px;
}

.leaflet-right {
  right: 0;
}

.leaflet-control-zoom {
  margin: 0;
  z-index: 1000;
}

.leaflet-control-zoom a,
.leaflet-touch .leaflet-bar a {
  width: 3.4rem;
  height: 3.4rem;
  min-width: 3.4rem;
  min-height: 3.4rem;
  line-height: 3.2rem;
  font-size: 1.8rem;
  font-weight: 400;
  border-radius: 0;
}

.leaflet-control-zoom a,
.leaflet-touch .leaflet-bar a,
.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {
  width: 3.4rem !important;
  height: 3.4rem !important;
  min-width: 3.4rem !important;
  min-height: 3.4rem !important;
  line-height: 3.2rem !important;
  font-size: 1.8rem !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  text-indent: 0;
}

.leaflet-bar a,
.leaflet-bar a:hover {
  color: var(--text);
}

.leaflet-bar {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58) !important;
  border-radius: 1.4rem !important;
  box-shadow:
    0 16px 32px rgba(18, 27, 42, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.62) !important;
  backdrop-filter: blur(20px) saturate(160%);
}

.leaflet-bar a,
.leaflet-bar a:hover {
  background: rgba(249, 250, 252, 0.84);
  border-bottom: 1px solid rgba(214, 220, 230, 0.82) !important;
  color: rgba(32, 33, 34, 0.9);
}

.leaflet-bar a:active {
  box-shadow:
    inset 0 2px 6px rgba(18, 27, 42, 0.16);
}

.viewer-stage.is-round-end .leaflet-control-zoom {
  display: none !important;
}

.leaflet-control-attribution {
  padding: 2px 6px;
  font-size: 0.92rem;
  line-height: 1.2;
  color: rgba(50, 58, 69, 0.78);
  background: rgba(252, 253, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  box-shadow:
    0 12px 24px rgba(18, 27, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px) saturate(160%);
}

.leaflet-control-attribution a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100dvh;
  }

  .viewer-stage {
    min-height: 100dvh;
    height: 100dvh;
  }

  .map-dock {
    right: var(--layout-edge-mobile);
    bottom: var(--layout-map-bottom-tablet);
    width: var(--layout-map-width-tablet);
    aspect-ratio: 4 / 3;
    height: auto;
    opacity: 0.98;
  }

  .timer-overlay {
    top: var(--layout-edge-mobile);
  }

  .round-status-overlay {
    top: var(--layout-edge-mobile);
    right: var(--layout-edge-mobile);
  }

  .brand-overlay {
    top: var(--layout-edge-mobile);
    left: var(--layout-edge-mobile);
    font-size: 3.2rem;
  }

  .settings-overlay {
    left: var(--layout-edge-mobile);
    bottom: var(--layout-bottom-row-mobile);
  }

  .legal-links {
    left: var(--layout-edge-mobile);
    bottom: 1rem;
    font-size: 1.15rem;
  }

  .guess-action-overlay {
    right: var(--layout-edge-mobile);
    bottom: var(--layout-bottom-row-mobile);
  }

  .timeline-year-overlay {
    bottom: var(--layout-timeline-year-bottom-tablet);
  }

  .timeline-overlay {
    width: min(54rem, calc(100vw - 38rem));
    bottom: var(--layout-timeline-bottom-mobile);
  }

  .result-panel {
    left: var(--layout-edge);
    right: var(--layout-edge);
    width: auto;
    bottom: 9.6rem;
  }

  .viewer-stage.is-round-end .result-panel {
    left: var(--layout-edge);
    right: auto;
    top: auto;
    bottom: var(--layout-bottom-row-mobile);
  }

}

@media (max-width: 720px) {
  html {
    font-size: 9px;
  }

  .brand-overlay {
    top: var(--layout-edge-mobile);
    left: 1.2rem;
    gap: 0.18rem;
    font-size: 2.6rem;
  }

  .brand-icon {
    width: clamp(2.6rem, 4.5vw, 3.4rem);
    height: clamp(2.6rem, 4.5vw, 3.4rem);
  }

  .viewer-stage {
    --mobile-ui-gutter: var(--layout-edge-mobile);
    --mobile-bottom-row: var(--layout-bottom-row-mobile);
    --mobile-timeline-row: 10rem;
    --mobile-timeline-year-gap: 7.4rem;
    --mobile-map-top: auto;
    --mobile-map-bottom: var(--layout-map-bottom-mobile);
    --mobile-map-height: min(36rem, calc(100dvh - 18rem));
    --mobile-summary-top: 1.2rem;
    --mobile-summary-bottom-clearance: 8.8rem;
  }

  .result-panel,
  .map-dock {
    left: var(--layout-edge-mobile);
    right: var(--layout-edge-mobile);
  }

  .viewer-stage .map-dock {
    left: var(--mobile-ui-gutter);
    right: var(--mobile-ui-gutter);
    top: auto;
    bottom: var(--mobile-map-bottom);
    width: auto;
    height: var(--mobile-map-height);
    aspect-ratio: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(1.6rem);
    transition:
      opacity 160ms ease,
      transform 160ms ease,
      visibility 0s linear 160ms;
  }

  .viewer-stage.is-mobile-map-visible .map-dock {
    z-index: 4;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .result-panel {
    bottom: var(--layout-map-bottom-mobile);
  }

  .viewer-stage .mobile-map-hide-button {
    bottom: calc(var(--mobile-map-bottom) + var(--mobile-map-height) + 0.8rem);
    right: var(--mobile-ui-gutter);
  }

  .viewer-stage .mobile-map-show-button {
    bottom: calc(var(--mobile-bottom-row) + 0.8rem);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .viewer-stage:not(.is-round-end) .mobile-map-hide-button.hidden,
  .viewer-stage:not(.is-round-end) .mobile-map-show-button.hidden {
    display: none !important;
  }

  .viewer-stage .guess-action-overlay {
    right: var(--mobile-ui-gutter);
    bottom: var(--mobile-bottom-row);
  }

  .viewer-stage .guess-action-button,
  .viewer-stage .settings-button {
    width: 15.2rem;
    min-width: 15.2rem;
    max-width: 15.2rem;
    padding: 0 1.8rem;
  }

  .viewer-stage .round-end-toggle-overlay {
    left: var(--mobile-ui-gutter);
    right: auto;
    bottom: var(--mobile-bottom-row);
  }

  .viewer-stage .settings-overlay {
    left: var(--mobile-ui-gutter);
    bottom: var(--mobile-bottom-row);
  }

  .viewer-stage .timeline-overlay {
    left: var(--mobile-ui-gutter);
    right: var(--mobile-ui-gutter);
    width: auto;
    bottom: var(--mobile-timeline-row);
    transform: none;
  }

  .viewer-stage .timeline-year-overlay {
    left: 50%;
    bottom: calc(var(--mobile-timeline-row) + var(--mobile-timeline-year-gap));
    transform: translateX(-50%);
  }

  .viewer-stage .guess-action-button--prompt {
    display: inline-flex;
  }

  .viewer-stage .map-dock,
  .viewer-stage .result-panel,
  .viewer-stage .timeline-overlay,
  .viewer-stage .timeline-year-overlay,
  .viewer-stage .guess-action-overlay,
  .viewer-stage .settings-overlay {
    transition-duration: 160ms;
  }

  .viewer-stage.is-round-end .result-panel {
    left: var(--layout-edge-mobile);
    right: var(--layout-edge-mobile);
    top: var(--mobile-summary-top);
    bottom: auto;
    width: auto;
    max-height: calc(100dvh - var(--mobile-summary-top) - var(--mobile-summary-bottom-clearance));
  }

  .viewer-stage.is-round-end:not(.is-round-end-pano) .brand-overlay {
    display: none !important;
  }

  .viewer-stage.is-round-end.is-round-end-pano .result-panel {
    display: none !important;
  }

  .viewer-stage.is-round-end .result-panel-body {
    max-height: calc(100dvh - var(--mobile-summary-top) - var(--mobile-summary-bottom-clearance) - 2.8rem);
  }

  .wiki-summary-card {
    max-height: 32rem;
  }

  .wiki-summary-image {
    max-height: 12rem;
  }

  .wiki-summary-extract {
    -webkit-line-clamp: 3;
  }

  .settings-content {
    min-height: 4.2rem;
    padding: 0 1.4rem;
  }

  .settings-modal {
    padding: var(--layout-edge-mobile);
  }

  .settings-modal-card {
    width: min(100%, 48rem);
    padding: 1.8rem;
    border-radius: 2rem;
  }

  .settings-modal-footer {
    align-items: flex-start;
  }

  .settings-modal-footer-actions {
    gap: 0.8rem 1.1rem;
  }

  .settings-help-panel {
    min-height: 28rem;
  }

  #settings-language-panel .settings-selector-group {
    max-height: 23rem;
  }

  .settings-modal-header .settings-modal-mobile-note {
    display: none !important;
  }

  .settings-modal-actions {
    grid-template-columns: 1fr;
  }

  .endgame-modal {
    padding: var(--layout-edge-mobile);
  }

  .endgame-modal-card {
    width: min(100%, 48rem);
    padding: 1.8rem;
    border-radius: 2rem;
  }

  .endgame-modal-stat {
    align-items: center;
    flex-direction: row;
  }

  .endgame-modal-stat strong {
    white-space: nowrap;
    text-align: right;
  }

  .endgame-highscore-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    border-radius: 1.2rem;
    padding: 1.1rem 1.4rem;
  }

  .endgame-highscore-list {
    height: min(34rem, calc(100dvh - 34rem));
  }

  .endgame-highscore-name {
    white-space: nowrap;
  }

  .endgame-highscore-score {
    text-align: right;
  }

  .highscore-modal-card {
    width: min(100%, 48rem);
    padding: 1.8rem;
    border-radius: 2rem;
    min-height: 58rem;
  }

  .settings-option {
    min-height: 5.4rem;
  }

  .timer-shell {
    width: auto;
    min-height: 42px;
  }

  .timer-content {
    min-height: 42px;
    padding: 0 1.2rem;
  }

  .timer-overlay {
    top: var(--layout-edge-mobile);
  }

  .round-status-label {
    font-size: 2rem;
  }

  .round-status-score {
    font-size: 3.8rem;
  }

  .timeline-overlay {
    width: min(42rem, calc(100vw - 19.2rem));
    bottom: var(--layout-timeline-bottom-mobile);
  }

  .timeline-year-label {
    font-size: 4rem;
  }

  .guess-action-label,
  .guess-action-button,
  .settings-button,
  .settings-option,
  .settings-dropdown-trigger,
  .settings-dropdown-option,
  .settings-selector-face {
    min-height: 5.4rem;
    font-size: 2.4rem;
  }
}
