:root {
  color-scheme: dark;
  --ink: #f8faf7;
  --muted: rgba(248, 250, 247, 0.68);
  --panel: rgba(24, 28, 35, 0.86);
  --panel-strong: rgba(16, 19, 25, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.075);
  --button: #555d6a;
  --button-dark: #383f4a;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #f0c94d;
  --accent-strong: #ffd95b;
  --green: #8bd99c;
  --red: #ff7d76;
  --shadow: 0 18px 52px rgba(0, 0, 0, 0.34);
  --hairline: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell,
.scene {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: #06080a;
  color: var(--ink);
  overflow: hidden;
}

button {
  border: 0;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(240, 201, 77, 0.9);
  outline-offset: 3px;
}

.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: #101819;
}

.satellite-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #121a18;
}

.satellite-map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 500;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 18%),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.05), transparent 32%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), transparent 30%);
}

.topbar {
  position: absolute;
  top: 16px;
  left: 26px;
  right: 26px;
  z-index: 900;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  display: inline-grid;
  justify-self: start;
  align-self: start;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.brand h1 {
  display: inline-block;
  width: max-content;
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 2.3vw, 31px);
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.38);
}

.brand h1 span {
  color: #ef493d;
}

.round-timer {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 910;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  transform: translateX(-50%);
  color: #fff;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.38));
}

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

.round-timer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.round-timer__track,
.round-timer__ring {
  fill: rgba(27, 30, 37, 0.78);
  stroke-width: 4;
}

.round-timer__track {
  stroke: rgba(255, 255, 255, 0.18);
}

.round-timer__ring {
  fill: transparent;
  stroke: var(--accent);
  stroke-linecap: round;
  transition: stroke 0.18s ease;
}

.round-timer span {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: 19px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.62);
}

.round-timer.is-danger .round-timer__ring {
  stroke: #ff2f27;
  filter: drop-shadow(0 0 5px rgba(255, 47, 39, 0.9));
}

.round-timer.is-danger span {
  color: #ffefef;
}

.round-timer.is-danger {
  animation: timerPulse 0.55s ease-in-out infinite alternate;
}

@keyframes timerPulse {
  from {
    transform: translateX(-50%) scale(1);
  }

  to {
    transform: translateX(-50%) scale(1.08);
  }
}

.top-actions {
  pointer-events: auto;
  position: relative;
  display: grid;
  gap: 8px;
  justify-self: end;
  align-self: start;
  justify-items: end;
}

.profile-button {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(26, 30, 38, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 22px rgba(0, 0, 0, 0.24);
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease;
}

.profile-button {
  width: 52px;
  height: 46px;
}

.profile-button:hover,
.profile-button:focus-visible {
  filter: brightness(1.08);
  background: rgba(42, 48, 58, 0.9);
}

.profile-button:active {
  transform: translateY(1px);
}

.profile-icon {
  position: relative;
  width: 29px;
  height: 29px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-icon::before,
.profile-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.profile-icon::before {
  top: 5px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.profile-icon::after {
  bottom: 4px;
  width: 14px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-top-left-radius: 999px;
  border-top-right-radius: 999px;
}

.difficulty-slider {
  display: none;
  position: static;
  gap: 7px;
  width: 100%;
  max-width: 520px;
  padding: 11px 13px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(20, 23, 30, 0.82), rgba(13, 16, 21, 0.72));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
}

.difficulty-slider[hidden] {
  display: none;
}

.difficulty-slider__meta {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  align-items: center;
}

.difficulty-slider__meta span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.difficulty-slider__meta strong {
  justify-self: end;
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.difficulty-slider__meta small {
  display: none;
}

.difficulty-slider input {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.mode-overlay.is-home-menu .difficulty-slider input[type="range"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.difficulty-slider input::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--accent-strong) 0 var(--difficulty-progress, 50%), rgba(255, 255, 255, 0.16) var(--difficulty-progress, 50%) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.difficulty-slider input::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  appearance: none;
  border: 3px solid #1b1d22;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.difficulty-slider input::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.difficulty-slider input::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--accent-strong);
}

.difficulty-slider input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #1b1d22;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
}

.difficulty-random {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: fit-content;
  min-width: 128px;
  min-height: 0;
  margin-top: 0;
  padding: 7px 8px 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.difficulty-random input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.difficulty-random i {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  transition: background 0.16s ease;
}

.difficulty-random i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.16s ease, background 0.16s ease;
}

.difficulty-random input:checked + i {
  background: rgba(245, 215, 97, 0.9);
}

.difficulty-random input:checked + i::after {
  background: #1b1d22;
  transform: translateX(16px);
}

.difficulty-random input:disabled + i {
  opacity: 0.45;
}

.difficulty-slider__ticks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.difficulty-slider__ticks button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  color: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.difficulty-slider__ticks button span {
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
}

.difficulty-slider__ticks button small {
  color: rgba(255, 255, 255, 0.46);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: right;
  text-transform: uppercase;
}

.difficulty-slider__ticks button[aria-pressed="true"] {
  border-color: rgba(245, 215, 97, 0.52);
  background:
    linear-gradient(180deg, rgba(245, 215, 97, 0.2), rgba(245, 215, 97, 0.08));
  color: #fff;
  box-shadow:
    inset 3px 0 0 rgba(245, 215, 97, 0.95),
    0 10px 24px rgba(0, 0, 0, 0.22);
}

.difficulty-slider__ticks button[aria-pressed="true"] small {
  color: rgba(245, 215, 97, 0.9);
}

.difficulty-slider__ticks button:not(:disabled):hover,
.difficulty-slider__ticks button:not(:disabled):focus-visible {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
}

.difficulty-slider__ticks button:disabled {
  opacity: 0.54;
  cursor: not-allowed;
}

.round-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.play-panel {
  position: absolute;
  right: clamp(16px, 1.7vw, 24px);
  bottom: clamp(16px, 1.7vw, 24px);
  z-index: 880;
  width: clamp(320px, 26vw, 388px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 28, 35, 0.9), rgba(18, 22, 29, 0.88));
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: bottom right;
  backdrop-filter: blur(10px);
}

.play-panel.is-expanded {
  right: clamp(16px, 1.7vw, 24px);
  bottom: clamp(16px, 1.7vw, 24px);
  width: min(68vw, 920px);
}

.play-panel.is-reviewing {
  width: min(360px, calc(100vw - 36px));
  pointer-events: auto;
}

.play-panel.is-reviewing .round-meta,
.play-panel.is-reviewing .guess-map,
.play-panel.is-reviewing .primary-button {
  display: none;
}

.play-panel.is-reviewing .result {
  margin: 12px;
  padding: 13px 14px;
  background: rgba(24, 29, 37, 0.82);
}

.play-panel.is-reviewing .result strong {
  font-size: 24px;
}

.play-panel.is-reviewing .actions {
  padding-top: 0;
}

.play-panel.is-reviewing .secondary-button {
  height: 54px;
  background: linear-gradient(180deg, rgba(115, 124, 140, 0.98), rgba(69, 77, 91, 0.98));
  font-size: 20px;
}

.play-panel.is-blitz-recap {
  position: fixed;
  inset: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1040;
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100vw !important;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #081016;
  box-shadow: none;
  overflow: hidden;
  transform-origin: center;
  backdrop-filter: none;
}

.play-panel.is-blitz-recap .round-meta,
.play-panel.is-blitz-recap .primary-button {
  display: none;
}

.play-panel.is-blitz-recap .guess-map {
  position: absolute;
  inset: 0 !important;
  z-index: 1;
  width: 100vw !important;
  max-width: none;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 100vh;
  min-height: 100dvh;
}

.play-panel.is-blitz-recap .result {
  position: absolute;
  left: auto;
  right: clamp(18px, 2.2vw, 34px);
  bottom: clamp(96px, 8vw, 132px);
  z-index: 2;
  width: min(380px, calc(100vw - 36px));
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(19, 23, 30, 0.92), rgba(10, 14, 20, 0.92));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(12px);
}

.play-panel.is-blitz-recap .actions {
  position: absolute;
  left: auto;
  right: clamp(18px, 2.2vw, 34px);
  bottom: clamp(22px, 2vw, 34px);
  z-index: 2;
  width: min(520px, calc(100vw - 36px));
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.play-panel.is-blitz-recap .secondary-button {
  height: 58px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5d761, #bd8f28);
  color: #151923;
  font-size: 19px;
}

.play-panel.is-blitz-recap .secondary-button--quiet {
  background: linear-gradient(180deg, rgba(85, 94, 110, 0.96), rgba(48, 55, 67, 0.97));
  color: #f5f6f8;
}

.round-meta {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 9px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(14, 17, 23, 0.82);
}

.round-meta strong {
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
  text-align: center;
}

.guess-map {
  position: relative;
  width: 100%;
  height: clamp(142px, 15vh, 170px);
  overflow: hidden;
  background: #071116;
  cursor: crosshair;
}

.guess-map.leaflet-container,
.guess-map .leaflet-pane,
.guess-map .leaflet-tile-pane,
.guess-map .leaflet-tile-container {
  background: #5cc7d8 !important;
}

.guess-map .leaflet-tile {
  filter: saturate(1.06) contrast(1.02);
  image-rendering: auto;
}

.map-marker {
  position: absolute;
  z-index: 650;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.guess-line {
  position: absolute;
  inset: 0;
  z-index: 640;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.guess-line line {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 8;
}

.satellite-line {
  position: absolute;
  inset: 0;
  z-index: 640;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.satellite-line line {
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-dasharray: 6 9;
  stroke-linecap: round;
  opacity: 0.92;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.62));
}

.satellite-marker {
  position: absolute;
  z-index: 650;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.target-marker {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54)) 0 0 / 2px 100% no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54)) 0 0 / 12px 2px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54)) 0 100% / 12px 2px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54)) 100% 0 / 2px 100% no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54)) 100% 0 / 12px 2px no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, 0.54), rgba(255, 255, 255, 0.54)) 100% 100% / 12px 2px no-repeat;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.42));
  opacity: 0.76;
}

.target-marker::after {
  display: none;
}


.play-panel.is-expanded .guess-map {
  height: min(48vh, 420px);
}

.actual-marker,
.guess-marker {
  position: relative;
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.42));
}

.actual-marker {
  width: 22px;
  height: 22px;
}

.actual-marker::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 2px;
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.actual-marker::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 2px;
  width: 13px;
  height: 10px;
  border-radius: 1px 3px 3px 1px;
  background:
    linear-gradient(45deg, #11151b 25%, transparent 25% 75%, #11151b 75%) 0 0 / 6px 6px,
    linear-gradient(45deg, transparent 25%, #11151b 25% 75%, transparent 75%) 3px 3px / 6px 6px,
    #fff;
  clip-path: polygon(0 0, 100% 0, 84% 50%, 100% 100%, 0 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 0 1px rgba(0, 0, 0, 0.3);
}

.guess-marker {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.guess-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 3px, transparent 3.2px),
    #e64235;
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(0, 0, 0, 0.24);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.guess-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  width: 7px;
  height: 7px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0 0 2px;
  background: #e64235;
  transform: translateX(-50%) rotate(45deg);
  z-index: 1;
}

.result {
  display: block;
  min-height: 38px;
  margin: 10px 12px 0;
  padding: 10px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.35;
}

.result.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.82);
}

.result.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
  flex: 0 0 auto;
}

.result.good {
  color: var(--green);
}

.result.miss {
  color: var(--red);
}

.result__label {
  display: block;
  margin: 0 0 2px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result strong {
  display: block;
  color: #fff;
  font-size: 20px;
  line-height: 1.1;
}

.result small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.blitz-recap {
  color: rgba(255, 255, 255, 0.72);
}

.blitz-recap__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.blitz-recap__grid div {
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.blitz-recap__grid span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blitz-recap__grid b {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.actions {
  display: grid;
  padding: 10px 12px 12px;
}

.primary-button,
.secondary-button,
.return-button {
  cursor: pointer;
  color: #fff;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(98, 106, 119, 0.95), rgba(63, 70, 82, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 10px 22px rgba(0, 0, 0, 0.24);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
  font-weight: 950;
  transition: transform 0.14s ease, filter 0.14s ease, background 0.14s ease, opacity 0.14s ease;
}

.primary-button,
.secondary-button {
  width: 100%;
  height: 50px;
  font-size: 19px;
  text-transform: uppercase;
}

.primary-button:not(:disabled) {
  background: linear-gradient(180deg, #f5d761, #bd8f28);
  color: #171a21;
  text-shadow: none;
}

.primary-button:not(:disabled):hover,
.secondary-button:not(:disabled):hover,
.return-button:hover,
.music-button:hover,
.daily-nudge button:hover,
.share-panel button:hover,
.inline-share-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-button:not(:disabled):active,
.secondary-button:not(:disabled):active,
.return-button:active,
.music-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.return-button {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 890;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px;
  font-size: 16px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(20, 20, 20, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px) saturate(1.1);
}

.return-button span {
  font-size: 24px;
  line-height: 1;
}

.bullseye-icon {
  position: relative;
  width: 19px;
  height: 19px;
  border: 2px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
}

.bullseye-icon::before,
.bullseye-icon::after {
  content: "";
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
}

.bullseye-icon::before {
  width: 7px;
  height: 7px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.bullseye-icon::after {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.music-button {
  position: absolute;
  left: 18px;
  bottom: 76px;
  z-index: 890;
  display: grid;
  place-items: center;
  width: 46px;
  height: 40px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(26, 30, 38, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 10px 22px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.music-button[aria-pressed="true"] {
  background: linear-gradient(#f5d761, #bd8f28);
  color: #1b1d22;
}

.speaker-icon {
  width: 25px;
  height: 25px;
  overflow: visible;
}

.speaker-icon__body {
  fill: currentColor;
}

.speaker-icon__wave,
.speaker-icon__slash {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.speaker-icon__wave {
  opacity: 0;
}

.speaker-icon__slash {
  opacity: 1;
}

.music-button[aria-pressed="true"] .speaker-icon__wave {
  opacity: 1;
}

.music-button[aria-pressed="true"] .speaker-icon__slash {
  opacity: 0;
}

.music-picker {
  position: absolute;
  left: 18px;
  bottom: 124px;
  z-index: 890;
  display: grid;
  gap: 4px;
  width: 142px;
  padding: 8px 9px 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(20, 20, 20, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px) saturate(1.1);
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.music-picker select {
  width: 100%;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.scale-panel {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 890;
  display: grid;
  justify-items: start;
  width: min(240px, 18vw);
  padding: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.scale-bar {
  position: relative;
  width: 100%;
  height: 12px;
  margin: 0 0 3px;
}

.scale-bar::before {
  display: none;
}

.scale-bar span {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 96px;
  max-width: 100%;
  height: 9px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.75));
}

.scale-label {
  display: block;
  min-width: 42px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(8, 10, 12, 0.56);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.first-run-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(78px, 6.5vw, 128px);
  z-index: 875;
  max-width: min(420px, calc(100vw - 36px));
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(16, 19, 25, 0.8);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.first-run-hint[hidden] {
  display: none;
}

.stats-panel {
  position: absolute;
  left: clamp(18px, 1.6vw, 34px);
  top: clamp(112px, 7.8vw, 150px);
  z-index: 870;
  width: min(250px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 28, 35, 0.88), rgba(16, 19, 25, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.stats-panel[hidden] {
  display: none;
}

.stats-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-panel__header button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.stats-panel__score {
  display: grid;
  gap: 2px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.075);
}

.stats-panel__score span,
.stats-panel dt {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-panel__score strong {
  color: #fff;
  font-size: 30px;
  line-height: 1;
}

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

.stats-panel__grid div {
  min-width: 0;
  padding: 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
}

.stats-panel dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.profile-panel {
  position: absolute;
  top: clamp(76px, 5.8vw, 96px);
  right: clamp(18px, 1.6vw, 34px);
  z-index: 905;
  width: min(430px, calc(100vw - 36px));
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(22, 26, 33, 0.94), rgba(12, 16, 22, 0.93));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
}

.profile-panel[hidden] {
  display: none;
}

.profile-panel__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.profile-panel__header span {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.profile-panel__header strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
}

.profile-panel__header button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.profile-panel__content {
  display: grid;
  gap: 14px;
}

.profile-panel__note {
  margin: 0;
  padding: 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.38;
}

.profile-radar {
  display: grid;
  place-items: center;
  min-height: 250px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 215, 97, 0.08), transparent 56%),
    rgba(255, 255, 255, 0.045);
}

.profile-radar svg {
  width: min(310px, 100%);
  height: auto;
  overflow: visible;
}

.profile-radar__shell,
.profile-radar__mid {
  fill: none;
  stroke: rgba(255, 255, 255, 0.34);
  stroke-width: 2;
}

.profile-radar__mid {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1;
}

.profile-radar line {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
}

.profile-radar__shape {
  fill: rgba(113, 218, 145, 0.68);
  stroke: rgba(155, 255, 184, 0.98);
  stroke-width: 2;
  filter: drop-shadow(0 8px 22px rgba(75, 211, 116, 0.16));
}

.profile-radar text {
  fill: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-anchor: middle;
  dominant-baseline: middle;
  text-transform: uppercase;
}

.profile-axis-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-axis-list div,
.profile-metrics div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
}

.profile-axis-list span,
.profile-metrics dt {
  display: block;
  color: rgba(255, 255, 255, 0.56);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-axis-list strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.profile-axis-list small {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.profile-metrics dd {
  margin: 4px 0 0;
  color: #fff;
  font-size: 16px;
  font-weight: 950;
}

.daily-nudge {
  position: absolute;
  right: clamp(18px, 1.6vw, 34px);
  top: clamp(84px, 6vw, 108px);
  z-index: 890;
  display: grid;
  gap: 4px;
  width: min(286px, calc(100vw - 36px));
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(24, 28, 35, 0.9), rgba(16, 19, 25, 0.84));
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: auto;
  backdrop-filter: blur(7px);
}

.daily-nudge[hidden] {
  display: none;
}

.daily-nudge.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.daily-nudge span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-nudge strong {
  color: #fff;
  font-size: 18px;
  line-height: 1.05;
}

.daily-nudge small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.daily-nudge div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.daily-nudge button {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: linear-gradient(180deg, #f5d761, #bd8f28);
  color: #151923;
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.daily-nudge button:last-child {
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.78);
}

.map-credit {
  position: absolute;
  right: 14px;
  bottom: 4px;
  z-index: 860;
  margin: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: auto;
}

.map-credit a {
  color: inherit;
  text-decoration: none;
}

.mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 7, 10, 0.34);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.mode-overlay.is-daily-result {
  place-items: end end;
  padding: 0 22px 24px 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 10, 0), rgba(4, 7, 10, 0.1) 54%, rgba(4, 7, 10, 0.28));
  cursor: pointer;
}

.mode-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.mode-overlay[hidden] {
  display: none;
}

.mode-card {
  position: relative;
  width: min(420px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(24, 28, 35, 0.96), rgba(16, 19, 25, 0.95));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
}

.mode-back {
  position: static;
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(64, 72, 86, 0.8), rgba(34, 40, 50, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.86);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mode-back[hidden] {
  display: none;
}

.mode-back:not(:disabled):hover,
.mode-back:not(:disabled):focus-visible {
  background: linear-gradient(180deg, #f3d767, #c29a38);
  color: #161a21;
  transform: translateY(-1px);
}

.mode-card__eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mode-card h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 2.8vw, 40px);
  line-height: 1;
  letter-spacing: 0;
}

.mode-card p {
  margin: 13px 0 0;
  max-width: 36ch;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  line-height: 1.45;
}

.daily-summary {
  display: grid;
  gap: 3px;
  margin: 16px 0 0;
  padding: 13px 14px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
}

.daily-summary[hidden] {
  display: none;
}

.daily-summary span,
.daily-summary small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.daily-summary strong {
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.daily-summary small {
  text-transform: none;
  letter-spacing: 0;
}

.share-panel {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  text-align: left;
}

.share-panel[hidden] {
  display: none;
}

.share-panel__code {
  padding: 10px 12px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.45;
  white-space: pre-line;
}

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

.share-panel button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13), 0 8px 18px rgba(0, 0, 0, 0.18);
}

.share-panel button:first-child {
  background: linear-gradient(180deg, #f5d761, #bd8f28);
  color: #151923;
}

.share-panel button.is-copied {
  background: rgba(126, 211, 147, 0.22);
  color: #d9ffe1;
}

.inline-share-button {
  justify-self: center;
  min-height: 30px;
  margin-top: 3px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.inline-share-button.is-copied {
  background: rgba(126, 211, 147, 0.22);
  color: #d9ffe1;
}

.multiplayer-setup {
  display: grid;
  gap: 10px;
}

.multiplayer-setup__status,
.multiplayer-setup__spec div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
}

.multiplayer-setup__status span,
.multiplayer-setup__spec span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.multiplayer-setup__status strong,
.multiplayer-setup__spec strong {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  text-transform: capitalize;
}

.multiplayer-setup__status small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

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

.mode-overlay.is-daily-result .mode-card {
  width: min(390px, calc(100vw - 38px));
  max-height: calc(100vh - 170px);
  padding: 16px;
  overflow: auto;
  text-align: left;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(24, 28, 35, 0.94), rgba(13, 16, 22, 0.93));
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.45);
}

.mode-overlay.is-daily-result .mode-card__eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
}

.mode-overlay.is-daily-result .mode-card h2 {
  font-size: clamp(42px, 4.6vw, 58px);
}

.mode-overlay.is-daily-result .mode-card p {
  max-width: none;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.mode-overlay.is-daily-result .daily-summary {
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 12px;
  padding: 0;
  background: transparent;
}

.daily-result-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mode-overlay.is-daily-result .daily-result-main div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
}

.mode-overlay.is-daily-result .daily-result-main strong {
  overflow-wrap: anywhere;
  font-size: clamp(15px, 1.4vw, 20px);
}

.daily-leaderboard {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.daily-leaderboard header {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 3px;
}

.daily-leaderboard header span {
  margin: 0 0 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.daily-leaderboard header small {
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
}

.daily-leaderboard__row {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 29px;
  padding: 0 8px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 850;
}

.daily-leaderboard__row strong,
.daily-leaderboard__row small {
  color: inherit;
  font-size: 12px;
  font-weight: 950;
}

.daily-leaderboard__row small {
  justify-self: end;
}

.daily-leaderboard__row.is-player {
  background: linear-gradient(180deg, rgba(245, 215, 97, 0.24), rgba(189, 143, 40, 0.18));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(245, 215, 97, 0.22);
}

.daily-continue-hint {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.mode-overlay.is-daily-result .share-panel {
  margin-top: 9px;
  pointer-events: auto;
}

.mode-overlay.is-daily-result .share-panel__row {
  gap: 7px;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.mode-overlay.is-daily-result .share-panel button {
  min-height: 44px;
  font-size: 13px;
}

.mode-overlay.is-daily-result .share-panel .share-panel__button--primary {
  min-height: 52px;
  background: linear-gradient(180deg, #f5d761, #bd8f28);
  color: #151923;
  font-size: 17px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mode-overlay.is-daily-result .share-panel .share-panel__button--secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.mode-overlay.is-daily-result .mode-actions {
  position: static;
  width: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  transform: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  cursor: default;
}

.mode-overlay.is-daily-result .mode-button {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.mode-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.mode-button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 50px;
  padding: 12px 14px;
  border-radius: 7px;
  border: 0;
  background: linear-gradient(180deg, rgba(91, 99, 113, 0.96), rgba(57, 64, 76, 0.96));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mode-button span {
  display: block;
}

.mode-button small {
  display: block;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.mode-button--primary,
.mode-button--active,
.mode-button:not(:disabled):hover,
.mode-button:not(:disabled):focus-visible {
  background: linear-gradient(180deg, #f5d761, #bd8f28);
  color: #1b1d22;
  text-shadow: none;
}

.mode-button--primary small,
.mode-button--active small,
.mode-button:not(:disabled):hover small,
.mode-button:not(:disabled):focus-visible small {
  color: rgba(22, 26, 33, 0.72);
}

.mode-button--active {
  cursor: default;
}

.mode-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.mode-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mode-card:has(.mode-button:nth-child(3)) {
  width: min(620px, calc(100vw - 36px));
}

.mode-card:has(.mode-button:nth-child(3)) .mode-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-card:has(.mode-button:nth-child(3)) p {
  max-width: 52ch;
}

.mode-card:has(.mode-button:nth-child(4)) {
  width: min(760px, calc(100vw - 36px));
}

.mode-card:has(.mode-button:nth-child(4)) .mode-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-overlay.is-home-menu {
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 70% 10%, rgba(245, 215, 97, 0.08), transparent 26%),
    radial-gradient(circle at 12% 82%, rgba(104, 173, 201, 0.08), transparent 30%),
    rgba(5, 8, 12, 0.54);
}

.mode-overlay.is-home-menu .mode-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 14px 20px;
  width: min(860px, calc(100vw - 44px));
  padding: 22px;
  border-color: rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(27, 32, 40, 0.96), rgba(12, 16, 22, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 28px 80px rgba(0, 0, 0, 0.5);
}

.mode-overlay.is-home-menu .mode-card__eyebrow {
  grid-column: 1 / -1;
  order: 1;
  margin: 0;
  color: rgba(245, 215, 97, 0.92);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.mode-overlay.is-home-menu .difficulty-slider {
  grid-column: 2;
  grid-row: 2 / span 5;
  order: 4;
  align-self: start;
  display: grid;
  max-width: none;
  margin: 0;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 100% 0%, rgba(245, 215, 97, 0.1), transparent 36%),
    linear-gradient(180deg, rgba(8, 11, 16, 0.76), rgba(8, 11, 16, 0.46));
}

.mode-overlay.is-home-menu .difficulty-slider__meta {
  grid-template-columns: 1fr auto;
  padding-bottom: 2px;
}

.mode-overlay.is-home-menu .difficulty-slider__meta span {
  color: rgba(255, 255, 255, 0.54);
  letter-spacing: 0.16em;
}

.mode-overlay.is-home-menu .difficulty-slider__meta strong {
  color: rgba(245, 215, 97, 0.95);
  font-size: 18px;
}

.mode-overlay.is-home-menu .difficulty-random {
  margin-top: 2px;
}

.mode-overlay:not(.is-home-menu) .difficulty-slider {
  display: none;
}

.mode-overlay.is-home-menu .mode-card h2 {
  grid-column: 1;
  order: 2;
  font-size: clamp(34px, 3.9vw, 54px);
  line-height: 0.92;
}

.mode-overlay.is-home-menu .mode-card p {
  grid-column: 1;
  order: 3;
  max-width: 34ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  line-height: 1.45;
}

.mode-overlay.is-home-menu .daily-summary {
  grid-column: 1;
  order: 6;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(255, 255, 255, 0.045);
}

.mode-overlay.is-home-menu .daily-summary span,
.mode-overlay.is-home-menu .daily-summary small {
  font-size: 10px;
  letter-spacing: 0.13em;
}

.mode-overlay.is-home-menu .daily-summary strong {
  margin-top: 1px;
  font-size: 22px;
}

.mode-overlay.is-home-menu .mode-actions {
  grid-column: 1;
  order: 5;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.mode-overlay.is-home-menu .mode-card:has(.mode-button:nth-child(4)) .mode-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-overlay.is-home-menu .mode-card:has(.mode-button:nth-child(5)) .mode-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-overlay.is-home-menu .mode-button {
  min-height: 68px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(84, 93, 109, 0.88), rgba(42, 49, 61, 0.92));
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  font-weight: 850;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

.mode-overlay.is-home-menu .mode-button span {
  font-size: 18px;
  line-height: 1;
}

.mode-overlay.is-home-menu .mode-button small {
  margin-top: 2px;
}

.mode-overlay.is-home-menu .mode-back {
  grid-column: 1;
  order: 7;
  margin-top: 2px;
}

.mode-overlay.is-home-menu .mode-button--primary,
.mode-overlay.is-home-menu .mode-button--active,
.mode-overlay.is-home-menu .mode-button:not(:disabled):hover,
.mode-overlay.is-home-menu .mode-button:not(:disabled):focus-visible {
  background: linear-gradient(180deg, #f3d767, #c29a38);
  color: #161a21;
}

.leaflet-control-attribution,
.leaflet-control-zoom {
  display: none;
}

.leaflet-container {
  overflow: hidden;
  touch-action: none;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  border: 0;
  background: transparent;
  color: transparent;
  font-size: 0;
  image-rendering: auto;
  backface-visibility: hidden;
}

.leaflet-tile-error {
  opacity: 0;
}

.leaflet-fade-anim .leaflet-tile {
  transition: opacity 0.16s linear;
}

.leaflet-map-pane,
.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .play-panel {
    right: 16px;
    bottom: 16px;
    width: min(410px, calc(100vw - 48px));
  }

  .play-panel.is-expanded {
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 96px);
  }

  .mode-overlay.is-home-menu .mode-card {
    grid-template-columns: 1fr;
    width: min(640px, calc(100vw - 36px));
  }

  .mode-overlay.is-home-menu .difficulty-slider {
    grid-column: 1;
    grid-row: auto;
    order: 5;
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks button {
    grid-template-columns: 1fr;
    min-height: 54px;
    padding: 8px 6px;
    text-align: center;
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks button[aria-pressed="true"] {
    box-shadow:
      inset 0 3px 0 rgba(245, 215, 97, 0.95),
      0 10px 24px rgba(0, 0, 0, 0.22);
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks button small {
    text-align: center;
  }

  .mode-overlay.is-home-menu .mode-actions {
    order: 4;
  }

  .mode-overlay.is-home-menu .mode-card:has(.mode-button:nth-child(4)) .mode-actions,
  .mode-overlay.is-home-menu .mode-card:has(.mode-button:nth-child(5)) .mode-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .topbar {
    top: clamp(18px, 1.25vw, 28px);
    left: clamp(22px, 1.8vw, 40px);
    right: clamp(22px, 1.8vw, 40px);
  }

  .brand h1 {
    font-size: clamp(27px, 1.9vw, 41px);
  }

  .round-timer {
    top: clamp(14px, 1.2vw, 24px);
    width: clamp(58px, 3.6vw, 74px);
    height: clamp(58px, 3.6vw, 74px);
  }

  .round-timer span {
    font-size: clamp(19px, 1.25vw, 25px);
  }

  .difficulty-slider {
    width: 100%;
    max-width: 520px;
    padding: clamp(10px, 0.7vw, 14px) clamp(12px, 0.85vw, 16px);
  }

  .difficulty-slider__meta strong {
    font-size: clamp(14px, 0.9vw, 18px);
  }

  .difficulty-slider__meta small {
    font-size: clamp(11px, 0.72vw, 14px);
  }

  .play-panel {
    right: clamp(20px, 1.6vw, 34px);
    bottom: clamp(20px, 1.6vw, 34px);
    width: clamp(330px, 24vw, 470px);
  }

  .play-panel.is-expanded {
    right: clamp(20px, 1.6vw, 34px);
    bottom: clamp(20px, 1.6vw, 34px);
    width: clamp(560px, 46vw, 860px);
  }

  .round-meta {
    min-height: clamp(36px, 2.2vw, 46px);
    padding: clamp(9px, 0.7vw, 14px) clamp(12px, 1vw, 20px) clamp(7px, 0.6vw, 12px);
  }

  .round-meta strong {
    font-size: clamp(16px, 1.05vw, 22px);
  }

  .guess-map {
    height: clamp(142px, 16vh, 190px);
  }

  .play-panel.is-expanded .guess-map {
    height: clamp(270px, 36vh, 430px);
  }

  .primary-button,
  .secondary-button {
    height: clamp(50px, 3vw, 62px);
    font-size: clamp(19px, 1.35vw, 26px);
  }

  .return-button {
    left: clamp(18px, 1.6vw, 34px);
    bottom: clamp(18px, 1.6vw, 34px);
    height: clamp(44px, 2.8vw, 54px);
    padding: 0 clamp(14px, 1vw, 20px);
    font-size: clamp(15px, 1vw, 19px);
  }

  .return-button span {
    font-size: clamp(20px, 1.35vw, 28px);
  }

  .music-button {
    left: clamp(18px, 1.6vw, 34px);
    bottom: clamp(74px, 4.8vw, 96px);
    width: clamp(44px, 2.6vw, 54px);
    height: clamp(38px, 2.25vw, 46px);
  }

  .speaker-icon {
    width: clamp(24px, 1.55vw, 32px);
    height: clamp(24px, 1.55vw, 32px);
  }

  .scale-panel {
    bottom: clamp(22px, 1.75vw, 38px);
    width: clamp(210px, 14vw, 300px);
  }

  .scale-label {
    font-size: clamp(11px, 0.72vw, 15px);
  }

}

@media (max-width: 720px) {
  .topbar {
    top: 10px;
    left: 12px;
    right: 12px;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .brand h1 {
    font-size: 18px;
  }

  .round-timer {
    top: 10px;
    width: 48px;
    height: 48px;
  }

  .round-timer span {
    font-size: 16px;
  }

  .difficulty-slider {
    position: static;
    width: 100%;
    max-width: none;
    padding: 8px 9px;
  }

  .difficulty-slider__meta {
    gap: 1px 8px;
  }

  .difficulty-slider__meta strong {
    font-size: 12px;
  }

  .difficulty-slider__meta small {
    font-size: 10px;
  }

  .play-panel {
    right: 10px;
    bottom: 10px;
    width: min(360px, calc(100vw - 20px));
  }

  .play-panel.is-expanded {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .guess-map {
    height: 126px;
  }

  .play-panel.is-expanded .guess-map {
    height: min(46vh, 360px);
  }

  .primary-button,
  .secondary-button {
    height: 46px;
    font-size: 18px;
  }

  .return-button {
    left: 10px;
    bottom: 12px;
    height: 42px;
    padding: 0 12px;
    font-size: 15px;
  }

  .music-button {
    left: 10px;
    bottom: 60px;
    width: 42px;
    height: 36px;
  }

  .scale-panel {
    left: 50%;
    bottom: 16px;
    width: min(180px, calc(100vw - 150px));
  }

  .stats-panel {
    left: 10px;
    top: 82px;
    width: min(230px, calc(100vw - 20px));
    padding: 10px;
  }

  .profile-panel {
    top: 12px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 24px);
    padding: 13px;
  }

  .profile-axis-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-nudge {
    top: 68px;
    right: 10px;
    width: min(270px, calc(100vw - 20px));
    padding: 11px;
  }

  .daily-nudge strong {
    font-size: 16px;
  }

  .stats-panel__score strong {
    font-size: 24px;
  }

  .map-credit {
    right: 8px;
    bottom: 3px;
    font-size: 8px;
  }

  .mode-overlay {
    padding: 14px;
  }

  .mode-card {
    padding: 18px;
    border-radius: 8px;
  }

  .mode-card h2 {
    font-size: 30px;
  }

  .share-panel__row {
    grid-template-columns: 1fr;
  }

  .mode-overlay.is-daily-result .daily-summary {
    grid-template-columns: 1fr;
  }

  .daily-result-main {
    grid-template-columns: 1fr;
  }

  .daily-leaderboard__row {
    grid-template-columns: 58px 1fr auto;
    padding: 0 8px;
  }

  .mode-overlay.is-daily-result {
    place-items: end center;
    padding: 0 10px 12px;
    background: linear-gradient(180deg, rgba(4, 7, 10, 0), rgba(4, 7, 10, 0.28));
  }

  .mode-overlay.is-daily-result .mode-card {
    width: min(430px, calc(100vw - 20px));
    max-height: 58vh;
    padding: 13px;
  }

  .mode-overlay.is-daily-result .mode-actions {
    position: static;
    width: auto;
    grid-template-columns: 1fr;
    transform: none;
    margin-top: 10px;
  }

  .mode-overlay.is-daily-result .mode-card h2 {
    font-size: 36px;
  }

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

  .mode-button {
    min-height: 50px;
  }

  .mode-overlay.is-home-menu .mode-card {
    width: min(430px, calc(100vw - 28px));
    padding: 20px;
  }

  .mode-overlay.is-home-menu .mode-card h2 {
    font-size: 34px;
  }

  .mode-overlay.is-home-menu .mode-card p {
    font-size: 13px;
  }

  .mode-overlay.is-home-menu .mode-actions {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks {
    grid-template-columns: 1fr;
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks button {
    grid-template-columns: 1fr auto;
    min-height: 38px;
    padding: 8px 10px;
    text-align: left;
  }

  .mode-overlay.is-home-menu .difficulty-slider__ticks button small {
    text-align: right;
  }

  .mode-overlay.is-home-menu .mode-card:has(.mode-button:nth-child(4)) .mode-actions,
  .mode-overlay.is-home-menu .mode-card:has(.mode-button:nth-child(5)) .mode-actions {
    grid-template-columns: 1fr;
  }

  .mode-overlay.is-home-menu .mode-button {
    min-height: 58px;
    font-size: 13px;
  }

  .mode-overlay.is-home-menu .mode-button span {
    font-size: 16px;
  }

  .mode-overlay.is-home-menu .daily-summary {
    padding: 10px 12px;
  }
}
