@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;
}

* {
  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;
}

.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;
}

.brand-overlay {
  position: absolute;
  top: 24px;
  left: 24px;
  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: 24px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  pointer-events: none;
}

.round-status-overlay {
  position: absolute;
  top: 24px;
  right: 24px;
  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: 24px;
  left: 24px;
  max-width: min(480px, calc(100vw - 48px));
  padding: 20px 22px;
}

.result-panel {
  left: 24px;
  bottom: 28px;
  width: min(58rem, calc(100vw - 72px));
  font-family: var(--font-ui);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #a2a9b1;
  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: rgba(255, 255, 255, 0.96);
  border: 1px solid #c8ccd1;
  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 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: var(--paper-ink);
  white-space: pre-line;
}

.wiki-summary-card {
  display: grid;
  gap: 1rem;
  max-height: 48rem;
  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: #e8edf3;
}

.wiki-summary-image {
  display: block;
  width: 100%;
  max-height: 20rem;
  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.2rem;
  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.7rem;
  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: 9;
}

.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: 24px;
  bottom: 98px;
  width: 360px;
  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: 24px;
  bottom: 24px;
  z-index: 5;
  min-height: 62px;
  display: flex;
  align-items: center;
}

.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;
}

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

.guess-action-button:focus,
.guess-action-button:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(51, 102, 204, 0.22),
    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-overlay .hidden {
  display: none !important;
}

.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 #guess-map {
  height: 100%;
  border-radius: 0;
}

.viewer-stage.is-round-end .result-panel {
  left: auto;
  right: 24px;
  top: 24px;
  bottom: auto;
  width: min(58rem, calc(100vw - 48px));
  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: 720px;
    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: rgba(255, 255, 255, 0.96);
  border: 1px solid #c8ccd1;
  border-radius: 1.2rem;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.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: #f8f9fa;
  border-color: #a2a9b1;
}

.settings-overlay {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 2;
  min-height: 62px;
  display: flex;
  align-items: center;
}

.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(51, 102, 204, 0.22),
    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: 24px;
}

.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: pointer;
}

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

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

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

.settings-modal-version {
  flex-shrink: 0;
  margin: 0;
  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: uppercase;
  text-align: right;
}

.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;
}

.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:hover {
  background: #f8f9fa;
}

.settings-option:focus,
.settings-option:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(51, 102, 204, 0.22),
    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-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(51, 102, 204, 0.22),
    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: 24px;
}

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

.endgame-modal-card {
  width: min(56rem, calc(100vw - 48px));
}

.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 #a2a9b1;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  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 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;
}

.timeline-year-overlay {
  position: absolute;
  left: 50%;
  bottom: 98px;
  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 - 33rem));
  transform: translateX(-50%);
  bottom: 24px;
  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;
}

.timeline-canvas {
  display: block;
  width: calc(100% + 48px);
  margin-left: -24px;
  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: 16px;
    bottom: 90px;
    width: 320px;
    aspect-ratio: 4 / 3;
    height: auto;
    opacity: 0.98;
  }

  .timer-overlay {
    top: 16px;
  }

  .round-status-overlay {
    top: 16px;
    right: 16px;
  }

  .brand-overlay {
    top: 16px;
    left: 16px;
    font-size: 3.2rem;
  }

  .settings-overlay {
    left: 16px;
    bottom: 16px;
  }

  .guess-action-overlay {
    right: 16px;
    bottom: 16px;
  }

  .timeline-year-overlay {
    bottom: 90px;
  }

  .timeline-overlay {
    width: min(58rem, calc(100vw - 28rem));
    bottom: 16px;
  }

  .result-panel {
    left: 24px;
    right: 24px;
    width: auto;
    bottom: 96px;
  }

  .viewer-stage.is-round-end .result-panel {
    left: 24px;
    right: auto;
    top: auto;
    bottom: 16px;
  }

}

@media (max-width: 720px) {
  .result-panel,
  .map-dock {
    left: 16px;
    right: 16px;
  }

  .map-dock {
    top: auto;
    bottom: 82px;
    width: auto;
    aspect-ratio: 4 / 3;
    height: auto;
    opacity: 1;
    transition: none;
  }

  .result-panel {
    bottom: 88px;
  }

  .viewer-stage.is-round-end .result-panel {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    width: auto;
  }

  .guess-action-overlay {
    right: 16px;
    bottom: 16px;
  }

  .timeline-year-overlay {
    bottom: 82px;
  }

  .settings-overlay {
    left: 16px;
    bottom: 16px;
  }

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

  .settings-modal {
    padding: 16px;
  }

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

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

  .endgame-modal {
    padding: 16px;
  }

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

  .endgame-modal-stat {
    align-items: flex-start;
    flex-direction: column;
  }

  .endgame-modal-stat strong {
    white-space: normal;
    text-align: left;
  }

  .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: 16px;
  }

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

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

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

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

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