:root {
  color-scheme: dark;
  --bg: #0a0b0d;
  --panel: #111216;
  --panel-strong: #16171c;
  --panel-muted: #0f1013;
  --ink: #f0f0f2;
  --muted: #858892;
  --muted-strong: #a8abb4;
  --line: #282a30;
  --line-strong: #363942;
  --field: #151820;
  --field-hover: #1a1d25;
  --accent: #f2f2f2;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --teal: #9ea4ad;
  --orange: #d9a441;
  --coral: #d66d5c;
  --green: #55c27f;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), transparent 280px),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 96px 96px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 96px 96px,
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  width: min(1520px, calc(100% - 64px));
  margin: 0 auto;
  padding: 18px 0 52px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) 5px 6px / 13px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 5px 11px / 8px 3px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 5px 16px / 16px 3px no-repeat;
  border: 1px solid transparent;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
  letter-spacing: 0;
}

h1 {
  font-size: 1.24rem;
  font-weight: 760;
}

h2 {
  font-size: 1.34rem;
  font-weight: 760;
}

.mode-switch,
.scope-switch,
.unit-toggle {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101115;
}

.mode-button,
.scope-button,
.unit-button {
  min-width: 86px;
  min-height: 34px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.88rem;
  font-weight: 650;
}

.scope-button {
  min-width: 96px;
  padding: 0 13px;
  font-size: 0.82rem;
}

.unit-button {
  min-width: 52px;
  min-height: 32px;
  font-size: 0.82rem;
}

.mode-button.active,
.scope-button.active,
.unit-button.active {
  background: var(--ink);
  color: #080a0e;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.68fr);
  gap: 18px;
  align-items: start;
}

.play-area,
.side-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.play-area {
  padding: 20px;
}

.side-panel {
  padding: 18px;
}

.puzzle-meta,
.panel-heading,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.round-chip {
  display: grid;
  place-items: center;
  min-width: 72px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-muted);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 760;
}

.silhouette-frame {
  position: relative;
  margin: 20px 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.044) 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.044) 1px, transparent 1px) 0 0 / 42px 42px,
    #0b0c0f;
}

.silhouette-frame::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--line-strong);
}

#country-svg {
  display: block;
  width: 100%;
  aspect-ratio: 900 / 560;
}

#country-svg rect {
  fill: transparent;
}

#country-path {
  fill: #eeeeea;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1.1;
  stroke-linejoin: round;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.32));
}

.guess-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  position: relative;
  z-index: 5;
}

.country-combobox {
  position: relative;
  min-width: 0;
}

#guess-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 54px 0 16px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

#guess-input::placeholder {
  color: #777b85;
}

#guess-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.combo-toggle {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #1a1d24;
}

.combo-toggle::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 11px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--muted-strong);
}

.country-options {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 322px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #17191f;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

.country-options.hidden {
  display: none;
}

.country-option,
.country-empty {
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 4px;
  color: var(--muted-strong);
  font-weight: 620;
}

.country-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.country-option.guessed {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.country-option-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.country-option-proximity {
  --heat-hue: 8;
  flex: 0 0 auto;
  min-width: 48px;
  padding: 4px 7px;
  border: 1px solid hsl(var(--heat-hue) 82% 58% / 0.42);
  border-radius: 4px;
  background: hsl(var(--heat-hue) 76% 45% / 0.14);
  color: hsl(var(--heat-hue) 86% 74%);
  font-size: 0.7rem;
  font-weight: 760;
  line-height: 1;
  text-align: center;
}

.country-option:hover,
.country-option.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
}

.country-empty {
  color: var(--muted);
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 6px;
  font-weight: 720;
  letter-spacing: 0;
}

.primary-button {
  min-width: 116px;
  min-height: 48px;
  padding: 0 22px;
  background: var(--accent);
  color: #07090c;
  box-shadow: none;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: #ffffff;
}

.secondary-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: #121318;
  color: var(--ink);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--line-strong);
  background: #191b21;
  color: #ffffff;
}

.notice {
  min-height: 28px;
  margin: 12px 0 16px;
  color: var(--muted-strong);
  font-weight: 620;
}

.notice.success {
  color: var(--green);
}

.notice.warning {
  color: var(--coral);
}

.compass {
  position: relative;
  width: 76px;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.11) 0 31%, rgba(255, 255, 255, 0.035) 32% 100%);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 720;
}

.compass::before,
.compass::after {
  content: "";
  position: absolute;
  background: var(--line-strong);
}

.compass::before {
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
}

.compass::after {
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
}

.compass span {
  position: absolute;
}

.compass span:nth-child(1) {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.compass span:nth-child(2) {
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
}

.compass span:nth-child(3) {
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.compass span:nth-child(4) {
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
}

.guess-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.guess-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: stretch;
  min-height: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #15161b;
}

.guess-card.correct {
  border-color: rgba(85, 194, 127, 0.42);
  background: rgba(85, 194, 127, 0.08);
}

.guess-number {
  display: grid;
  place-items: center;
  align-self: start;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #202229;
  color: var(--muted-strong);
  font-weight: 720;
}

.guess-body {
  align-self: start;
  min-width: 0;
  padding: 7px 4px 0 0;
}

.guess-name {
  min-width: 0;
  font-weight: 720;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.guess-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 610;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guess-metrics {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.metric-cell {
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 0;
  min-height: 52px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101115;
  color: var(--ink);
}

.metric-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.metric-value {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 720;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.distance-metric .metric-value {
  white-space: nowrap;
}

.degrees-metric .metric-value {
  white-space: nowrap;
}

.proximity {
  --heat-hue: 8;
  border-color: hsl(var(--heat-hue) 82% 58% / 0.42);
  background: linear-gradient(
    180deg,
    hsl(var(--heat-hue) 76% 50% / 0.20),
    hsl(var(--heat-hue) 76% 42% / 0.10)
  );
}

.proximity .metric-label {
  color: hsl(var(--heat-hue) 70% 72% / 0.76);
}

.proximity .metric-value {
  color: hsl(var(--heat-hue) 86% 72%);
}

.arrow-metric {
  align-content: center;
  justify-items: center;
}

.bearing-arrow {
  position: relative;
  width: 36px;
  height: 36px;
}

.bearing-arrow::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  width: 15px;
  height: 25px;
  background: var(--orange);
  clip-path: polygon(50% 0, 92% 38%, 65% 38%, 65% 100%, 35% 100%, 35% 38%, 8% 38%);
  transform: translateX(-50%) rotate(var(--bearing));
  transform-origin: 50% 52%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.34));
}

.bearing-arrow.correct {
  border: 2px solid var(--green);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--green) 0 3px, transparent 4px),
    radial-gradient(circle, transparent 0 12px, rgba(85, 194, 127, 0.18) 13px 100%);
  box-shadow: 0 0 0 1px rgba(85, 194, 127, 0.16), 0 0 18px rgba(85, 194, 127, 0.18);
}

.bearing-arrow.correct::before,
.bearing-arrow.correct::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--green);
  clip-path: none;
  filter: none;
  transform: translate(-50%, -50%);
}

.bearing-arrow.correct::before {
  width: 25px;
  height: 2px;
}

.bearing-arrow.correct::after {
  width: 2px;
  height: 25px;
}


.empty-state {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 30px;
  color: var(--muted);
  text-align: center;
  font-weight: 610;
}

.empty-state.hidden {
  display: none;
}

.results-button {
  width: 100%;
  margin-top: 14px;
}

.results-button.hidden {
  display: none;
}

.empty-compass {
  width: 56px;
  height: 56px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  background:
    linear-gradient(var(--line-strong), var(--line-strong)) center / 1px 38px no-repeat,
    linear-gradient(90deg, var(--line-strong), var(--line-strong)) center / 38px 1px no-repeat;
}

.round-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

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

.modal-card {
  position: relative;
  width: min(980px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #1b1d23;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  top: 17px;
  left: 10px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted-strong);
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.modal-message {
  margin: 14px 0 0;
  color: var(--muted-strong);
  font-size: 0.98rem;
  line-height: 1.5;
}

.modal-stat {
  margin: 18px 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1b1d23;
  color: var(--ink);
  font-weight: 720;
}

.modal-analytics {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(230px, 0.8fr);
  gap: 14px;
  margin: 0 0 22px;
  align-items: start;
}

.route-map {
  width: 100%;
  aspect-ratio: 2 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0c0d10;
}

.route-map-ocean {
  fill: #0b0c0f;
}

.route-map-grid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}

.route-map-land {
  fill: rgba(255, 255, 255, 0.12);
  stroke: rgba(255, 255, 255, 0.10);
  stroke-width: 0.6;
}

.route-map-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.route-map-dot {
  fill: var(--orange);
  stroke: #0c0d10;
  stroke-width: 2;
}

.route-map-dot.correct,
.route-map-target {
  fill: var(--accent);
  stroke: #0c0d10;
  stroke-width: 2.5;
}

.route-map-label,
.route-map-answer {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 760;
  paint-order: stroke;
  stroke: #0c0d10;
  stroke-width: 4px;
  stroke-linejoin: round;
}

.route-map-answer {
  fill: var(--ink);
  font-size: 17px;
}

.route-map-axis-label,
.route-map-empty {
  fill: var(--muted-strong);
  font-size: 13px;
  font-weight: 680;
}

.route-map-empty {
  fill: var(--ink);
  font-size: 16px;
}

.anonymous-line {
  stroke: var(--accent);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.section-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.stat-tile {
  min-height: 70px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #1b1d23;
}

.stat-tile span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.stat-tile strong {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.round-guess-ledger {
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14161b;
}

.round-guess-list {
  display: grid;
  gap: 8px;
}

.round-guess-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) repeat(3, minmax(86px, 0.42fr)) 44px;
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101115;
}

.round-guess-row.correct {
  border-color: rgba(85, 194, 127, 0.42);
  background: rgba(85, 194, 127, 0.08);
}

.round-guess-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.round-guess-number {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #202229;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 720;
}

.round-guess-name strong {
  min-width: 0;
  font-size: 0.92rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.round-guess-metric {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #15161b;
}

.round-guess-metric span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 760;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.round-guess-metric strong {
  display: block;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.08;
  white-space: nowrap;
}

.proximity-ledger {
  --heat-hue: 8;
  border-color: hsl(var(--heat-hue) 82% 58% / 0.42);
  background: linear-gradient(
    180deg,
    hsl(var(--heat-hue) 76% 50% / 0.18),
    hsl(var(--heat-hue) 76% 42% / 0.08)
  );
}

.proximity-ledger span {
  color: hsl(var(--heat-hue) 70% 72% / 0.76);
}

.proximity-ledger strong {
  color: hsl(var(--heat-hue) 86% 72%);
}

.round-guess-arrow {
  display: grid;
  place-items: center;
  min-width: 0;
}

.round-guess-arrow .bearing-arrow {
  width: 30px;
  height: 30px;
}

.round-guess-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101115;
  color: var(--muted-strong);
  font-weight: 650;
}

.player-summary {
  margin: 0 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #14161b;
}

.player-summary.hidden {
  display: none;
}

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

.player-stat-card {
  min-height: 74px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101115;
}

.player-stat-card span,
.distribution-row span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 720;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.player-stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.guess-distribution {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
}

.distribution-track {
  height: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
}

.distribution-fill {
  height: 100%;
  border-radius: inherit;
  background: #d8d8da;
}

.share-panel {
  display: grid;
  margin: 0 0 16px;
}

.share-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101115;
}

.share-tab {
  min-width: 102px;
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 650;
}

.share-tab.active {
  background: var(--ink);
  color: #080a0e;
}

.share-fallback {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 72px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #0f1013;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.35;
  resize: none;
  outline: none;
}

.share-fallback.hidden {
  display: none;
}

.share-fallback.sr-only {
  min-height: 1px;
  max-height: 1px;
  padding: 0;
  border: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .app-shell {
    width: min(100% - 22px, 760px);
    padding-top: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    width: 100%;
    justify-content: stretch;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .scope-switch {
    width: 100%;
  }

  .scope-switch {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .mode-switch {
    grid-template-columns: 1fr 1fr;
  }

  .mode-button,
  .scope-button {
    width: 100%;
  }

  h1 {
    font-size: 1.24rem;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 16px, 520px);
  }

  h1 {
    font-size: 1.18rem;
  }

  .play-area,
  .side-panel {
    padding: 14px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .puzzle-meta,
  .panel-heading,
  .action-row,
  .modal-analytics,
  .modal-actions {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .guess-form {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .action-row,
  .unit-toggle {
    width: 100%;
  }

  .unit-toggle {
    grid-template-columns: 1fr 1fr;
  }

  .scope-switch {
    grid-template-columns: 1fr;
  }

  .share-tabs {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .player-stats,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .round-guess-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round-guess-name {
    grid-column: 1 / -1;
  }

  .round-guess-metric {
    grid-column: span 1;
  }

  .round-guess-arrow {
    justify-items: start;
  }

  .guess-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .guess-metrics {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .metric-cell {
    min-height: 50px;
  }
}
