@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  --purple-950: #21134f;
  --purple-900: #2d1b69;
  --purple-800: #3f2b87;
  --purple-700: #5c49b4;
  --purple-500: #8371d2;
  --orange-600: #ed8e1a;
  --orange-500: #f4a52d;
  --orange-400: #ffbc4d;
  --cream: #fff8e9;
  --ink: #221744;
  --muted: #6f6680;
  --green: #22b573;
  --yellow: #f0bb20;
  --red: #e95454;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(34, 20, 83, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  background: var(--purple-800);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, 0.12), transparent 26rem),
    linear-gradient(135deg, #4c37a0 0%, #6a55bd 55%, #4a359c 100%);
}

.background-shape {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.background-shape--one {
  width: 54vw;
  height: 54vw;
  top: 42%;
  left: -30vw;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 0 0 70px rgba(255, 255, 255, 0.018),
    0 0 0 150px rgba(255, 255, 255, 0.018);
}

.background-shape--two {
  width: 30vw;
  height: 30vw;
  right: -12vw;
  bottom: -18vw;
  background: rgba(34, 19, 79, 0.11);
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(176px, 1fr) minmax(420px, 2.25fr) minmax(176px, 1fr);
  align-items: center;
  min-height: 96px;
  padding: 16px clamp(20px, 3vw, 52px);
  color: var(--white);
  background: rgba(34, 20, 82, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px;
  height: 48px;
  border: 2px solid var(--orange-400);
  border-radius: 50% 50% 50% 6px;
  transform: rotate(-45deg);
}

.brand-dot {
  width: 12px;
  height: 12px;
  border: 3px solid var(--orange-400);
  border-radius: 50%;
}

.brand-copy {
  display: grid;
  line-height: 1;
  letter-spacing: 0.05em;
}

.brand-copy strong {
  color: var(--orange-400);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 17px;
  font-weight: 800;
}

.brand-copy span {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
}

.game-status {
  display: grid;
  grid-column: 2;
  grid-template-columns: 105px minmax(230px, 1fr) 130px;
  align-items: stretch;
  gap: 10px;
  width: min(100%, 690px);
  justify-self: center;
  animation: drop-in 0.5s ease both;
}

.status-card,
.target-card {
  min-height: 62px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.status-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px;
}

.status-label,
.target-eyebrow {
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.score-card strong {
  color: var(--orange-400);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 25px;
  line-height: 1;
}

.target-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 58px;
  overflow: hidden;
  text-align: center;
  background: var(--cream);
}

.target-card .target-eyebrow {
  color: var(--purple-700);
}

.target-card strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--purple-950);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-timer {
  position: absolute;
  top: 50%;
  right: 13px;
  display: flex;
  align-items: baseline;
  color: var(--purple-700);
  transform: translateY(-50%);
  transition: color 0.2s ease;
}

.turn-timer strong {
  color: inherit;
  font-size: 20px;
}

.turn-timer span {
  margin-left: 1px;
  font-size: 9px;
  font-weight: 800;
}

.turn-timer.is-urgent {
  color: var(--orange-600);
}

.timer-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  overflow: hidden;
  background: rgba(63, 43, 135, 0.1);
}

.timer-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--orange-500), var(--purple-700));
  transform-origin: left center;
  transition: transform 0.1s linear;
}

.distance-budget {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--orange-400);
  line-height: 1;
}

.distance-budget strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.distance-budget span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.distance-budget.is-low {
  color: var(--red);
}

.map-stage {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  overflow: hidden;
  cursor: default;
}

.map-stage::before {
  position: absolute;
  width: min(42vw, 540px);
  height: min(42vw, 540px);
  content: "";
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  transform: translateX(1.5%);
}

.map-caption {
  position: absolute;
  z-index: 6;
  top: 18px;
  left: clamp(20px, 3vw, 52px);
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.map-caption > span:first-child {
  color: var(--orange-400);
}

.caption-divider {
  width: 26px;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
}

.serbia-map {
  z-index: 2;
  width: min(62vw, 660px);
  height: calc(100% - 42px);
  min-height: 0;
  max-height: 100%;
  overflow: visible;
  touch-action: none;
  user-select: none;
}

.serbia-map.is-active {
  cursor: crosshair;
}

.map-shadow {
  fill: rgba(34, 18, 79, 0.16);
  stroke: none;
}

.map-country {
  fill: var(--cream);
  stroke: rgba(68, 50, 137, 0.72);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
  vector-effect: non-scaling-stroke;
  transition: fill 0.3s ease;
}

.map-country:hover {
  fill: #fffdf6;
}

.map-texture {
  fill: url("#paperGrain");
  stroke: none;
  pointer-events: none;
}

.discovered-marker {
  pointer-events: none;
  animation: discovered-pop 0.35s ease both;
}

.discovered-connector {
  stroke: rgba(63, 43, 135, 0.5);
  stroke-linecap: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.discovered-label-bg {
  fill: rgba(255, 250, 239, 0.94);
  stroke: rgba(63, 43, 135, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.discovered-label-text {
  fill: var(--purple-950);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.discovered-halo {
  fill: rgba(255, 248, 233, 0.96);
  stroke: rgba(63, 43, 135, 0.64);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.discovered-pin {
  fill: var(--orange-500);
}

.discovered-center {
  fill: var(--purple-950);
}

.feedback-line {
  stroke: var(--feedback-color);
  stroke-width: 3;
  stroke-dasharray: 7 8;
  stroke-linecap: round;
  animation: line-reveal 0.45s ease both;
}

.guess-ring {
  fill: transparent;
  stroke: var(--feedback-color);
  stroke-width: 4;
  animation: marker-pulse 0.7s ease both;
}

.guess-dot {
  fill: var(--feedback-color);
  stroke: var(--white);
  stroke-width: 4;
}

.target-ring {
  fill: rgba(255, 255, 255, 0.96);
  stroke: var(--purple-950);
  stroke-width: 4;
  animation: target-pop 0.45s 0.16s ease both;
  transform-box: fill-box;
  transform-origin: center;
}

.target-dot {
  fill: var(--orange-500);
}

.map-label-bg {
  fill: var(--purple-950);
}

.map-label-text {
  fill: var(--white);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
}

.map-legend {
  position: absolute;
  z-index: 5;
  right: clamp(20px, 3vw, 52px);
  bottom: 24px;
  display: flex;
  gap: 18px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(34, 20, 82, 0.28);
  backdrop-filter: blur(8px);
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot--green {
  background: var(--green);
}

.legend-dot--yellow {
  background: var(--yellow);
}

.legend-dot--red {
  background: var(--red);
}

.feedback-toast {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: inherit;
  background: var(--green);
  pointer-events: none;
  transition: background 0.2s ease;
  animation: result-in 0.28s ease both;
}

.feedback-toast.is-hit {
  background: var(--green);
}

.feedback-toast.is-miss {
  background: var(--red);
}

.feedback-toast strong,
.feedback-toast small {
  display: inline-flex;
  align-items: center;
  color: var(--white);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(14px, 1.4vw, 18px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.welcome-overlay,
.game-over-overlay,
.highscore-overlay {
  position: absolute;
  z-index: 15;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(37, 22, 84, 0.26);
  backdrop-filter: blur(5px);
}

.welcome-overlay {
  grid-template-rows: 1fr auto;
  gap: 12px;
}

.welcome-card,
.game-over-card,
.highscore-card {
  width: min(92vw, 530px);
  max-height: calc(100% - 8px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 36px;
  box-shadow: var(--shadow);
  animation: card-in 0.65s cubic-bezier(0.18, 0.83, 0.32, 1.12) both;
}

.welcome-card {
  position: relative;
  align-self: end;
  padding: clamp(28px, 4vw, 48px);
  overflow: hidden;
  background:
    radial-gradient(circle at 108% -10%, rgba(255, 255, 255, 0.34), transparent 12rem),
    linear-gradient(145deg, var(--orange-400), var(--orange-500));
}

.welcome-card::after {
  position: absolute;
  width: 280px;
  height: 280px;
  right: -205px;
  bottom: -90px;
  content: "";
  border: 30px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.welcome-kicker,
.game-over-kicker {
  display: block;
  margin-bottom: 13px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.welcome-kicker {
  color: rgba(45, 27, 105, 0.65);
}

.welcome-card h1 {
  margin: 0;
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(35px, 5.2vw, 60px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.welcome-card h1 em {
  color: var(--white);
  font-style: normal;
}

.welcome-card p {
  max-width: 410px;
  margin: 21px 0;
  color: rgba(34, 23, 68, 0.72);
  font-size: 14px;
  line-height: 1.55;
}

.rules-row {
  display: flex;
  gap: 10px;
  margin-bottom: 23px;
}

.rules-row > div {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255, 255, 255, 0.27);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.rule-number {
  display: grid;
  min-width: 38px;
  height: 28px;
  padding: 0 7px;
  place-items: center;
  color: var(--white);
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: var(--purple-700);
}

.rules-row small {
  color: rgba(34, 23, 68, 0.66);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.welcome-actions,
.end-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-button {
  min-height: 58px;
  padding: 0 22px;
  color: var(--purple-950);
  font-weight: 800;
  border: 1px solid rgba(45, 27, 105, 0.22);
  border-radius: 999px;
  outline: none;
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.58);
  transform: translateY(-2px);
}

.secondary-button:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.mode-buttons {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mode-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 7px 8px 7px 16px;
  color: var(--white);
  border: 1px solid transparent;
  border-radius: 18px;
  outline: none;
  background: var(--purple-950);
  box-shadow: 0 10px 26px rgba(45, 27, 105, 0.2);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.mode-button:hover {
  box-shadow: 0 14px 32px rgba(45, 27, 105, 0.3);
  transform: translateY(-2px);
}

.mode-button:active {
  transform: translateY(0);
}

.mode-button:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.mode-button--easy {
  color: var(--purple-950);
  border-color: rgba(45, 27, 105, 0.12);
  background: rgba(255, 255, 255, 0.78);
}

.mode-button-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.mode-button-copy strong {
  font-family: "Manrope", Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-button-copy small {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.56);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-button--easy .mode-button-copy small {
  color: rgba(45, 27, 105, 0.58);
}

.mode-button .button-arrow {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.mode-button--easy .button-arrow {
  color: var(--white);
  background: var(--purple-700);
}

.primary-button {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-width: 210px;
  padding: 8px 9px 8px 22px;
  color: var(--white);
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: var(--purple-950);
  box-shadow: 0 10px 26px rgba(45, 27, 105, 0.24);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.primary-button:hover {
  box-shadow: 0 14px 32px rgba(45, 27, 105, 0.34);
  transform: translateY(-2px);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.button-arrow {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--purple-950);
  font-size: 18px;
  border-radius: 50%;
  background: var(--orange-400);
}

.place-count {
  align-self: start;
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.place-count strong {
  color: var(--orange-400);
}

.game-over-overlay {
  background: rgba(31, 18, 74, 0.7);
  backdrop-filter: blur(12px);
}

.highscore-overlay {
  z-index: 25;
  background: rgba(31, 18, 74, 0.78);
  backdrop-filter: blur(14px);
}

.game-over-card,
.highscore-card {
  position: relative;
  padding: clamp(28px, 4vw, 44px);
  text-align: center;
  background: var(--cream);
}

.game-over-card {
  width: min(92vw, 500px);
  padding: 24px 30px;
}

.highscore-card {
  width: min(94vw, 650px);
  padding: 14px 18px;
  overflow: hidden;
}

.highscore-card h2 {
  margin: 0;
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(30px, 4vw, 38px);
  letter-spacing: -0.05em;
  line-height: 1;
}

.highscore-card .game-over-kicker {
  margin-bottom: 2px;
  font-size: 8px;
}

.highscore-card .close-button {
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  font-size: 20px;
}

.close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--purple-900);
  font-size: 24px;
  border: 1px solid rgba(63, 43, 135, 0.12);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
}

.empty-highscore {
  display: grid;
  gap: 7px;
  margin: 28px 0 22px;
  padding: 30px 20px;
  border: 1px dashed rgba(63, 43, 135, 0.2);
  border-radius: 20px;
  background: var(--white);
}

.empty-highscore > span {
  color: var(--orange-500);
  font-size: 42px;
  line-height: 1;
}

.empty-highscore strong {
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 18px;
}

.empty-highscore p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.highscore-status {
  margin: 28px 0 22px;
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
  border-radius: 18px;
  background: var(--white);
}

.highscore-status.is-error {
  color: #a52f2f;
  background: #fff0f0;
}

.highscore-list {
  display: grid;
  gap: 3px;
  max-height: none;
  margin: 10px 0 8px;
  padding: 0;
  overflow: visible;
  list-style: none;
}

.highscore-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 3px 9px 3px 5px;
  text-align: left;
  border: 1px solid rgba(63, 43, 135, 0.09);
  border-radius: 10px;
  background: var(--white);
}

.highscore-rank {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--purple-700);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  border-radius: 50%;
  background: rgba(92, 73, 180, 0.1);
}

.highscore-item.is-top-three .highscore-rank {
  color: var(--white);
  background: var(--orange-500);
}

.highscore-player {
  display: grid;
  gap: 0;
  min-width: 0;
}

.highscore-player strong {
  overflow: hidden;
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(12px, 1.2vw, 14px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.highscore-player small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.highscore-points {
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 800;
  text-align: right;
}

.highscore-points small {
  display: block;
  color: var(--muted);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.highscore-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  margin: 0;
}

.highscore-page-button {
  min-height: 34px;
  padding: 5px 10px;
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(10px, 1.1vw, 12px);
  font-weight: 800;
  border: 1px solid rgba(63, 43, 135, 0.15);
  border-radius: 11px;
  background: var(--white);
  cursor: pointer;
}

.highscore-page-button:last-child {
  justify-self: stretch;
}

.highscore-page-button:disabled {
  color: rgba(63, 43, 135, 0.36);
  cursor: default;
  background: rgba(255, 255, 255, 0.55);
}

.highscore-page-button:not(:disabled):hover {
  color: var(--white);
  border-color: var(--purple-700);
  background: var(--purple-700);
}

.highscore-page-button:focus-visible {
  outline: 3px solid rgba(244, 128, 36, 0.35);
  outline-offset: 2px;
}

.highscore-page-info {
  color: var(--muted);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(11px, 1.3vw, 13px);
  font-weight: 800;
  white-space: nowrap;
}

.game-over-kicker {
  margin-bottom: 8px;
  color: var(--orange-600);
}

.game-over-card h2 {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.final-score {
  display: block;
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: clamp(58px, 8vw, 76px);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.96;
}

.final-score-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 12px;
}

.result-grid > div {
  display: grid;
  gap: 2px;
  padding: 9px 7px;
  border: 1px solid rgba(63, 43, 135, 0.1);
  border-radius: 14px;
  background: var(--white);
}

.result-grid strong {
  color: var(--purple-900);
  font-family: "Manrope", Arial, sans-serif;
  font-size: 20px;
}

.result-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-submit {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 10px;
  text-align: left;
  border: 1px solid rgba(63, 43, 135, 0.1);
  border-radius: 16px;
  background: var(--white);
}

.score-submit > label {
  color: var(--purple-900);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nickname-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.nickname-row input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  color: var(--ink);
  font: 700 14px "DM Sans", Arial, sans-serif;
  border: 1px solid rgba(63, 43, 135, 0.2);
  border-radius: 12px;
  outline: none;
  background: var(--cream);
}

.nickname-row input:focus {
  border-color: var(--purple-700);
  box-shadow: 0 0 0 3px rgba(92, 73, 180, 0.12);
}

.nickname-row input.is-error {
  border-color: var(--red);
}

.nickname-row button {
  min-width: 100px;
  padding: 0 16px;
  color: var(--white);
  font-weight: 800;
  border: 0;
  border-radius: 12px;
  background: var(--purple-900);
  cursor: pointer;
}

.nickname-row button:disabled,
.nickname-row input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.score-submit > small {
  color: var(--muted);
  font-size: 9px;
}

.score-submit-message {
  min-height: 12px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.score-submit-message.is-success {
  color: #14784d;
}

.score-submit-message.is-error {
  color: #b13030;
}

.game-over-card > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.primary-button--dark {
  flex: 1;
}

.game-over-card .primary-button--dark {
  min-width: 0;
  padding: 6px 7px 6px 18px;
}

.game-over-card .button-arrow {
  width: 36px;
  height: 36px;
}

.secondary-button--dark {
  background: var(--white);
}

.game-over-card .secondary-button--dark {
  min-height: 48px;
  padding-inline: 18px;
}

.credit {
  position: absolute;
  z-index: 6;
  right: clamp(20px, 3vw, 52px);
  top: 38px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drop-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes line-reveal {
  from {
    opacity: 0;
    stroke-dashoffset: 80;
  }
  to {
    opacity: 1;
    stroke-dashoffset: 0;
  }
}

@keyframes marker-pulse {
  0% {
    opacity: 0;
    r: 2px;
  }
  55% {
    opacity: 1;
    r: 25px;
  }
  100% {
    opacity: 0;
    r: 34px;
  }
}

@keyframes target-pop {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes discovered-pop {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr;
    min-height: 84px;
    padding-block: 11px;
  }

  .brand-copy {
    display: none;
  }

  .game-status {
    grid-column: 2;
    grid-template-columns: 72px minmax(165px, 1fr) 96px;
  }

  .status-card {
    padding-inline: 10px;
  }

  .target-card {
    padding-inline: 10px;
  }

  .turn-timer {
    top: 5px;
    right: 7px;
    transform: none;
  }

  .turn-timer strong {
    font-size: 12px;
  }

  .turn-timer span {
    font-size: 7px;
  }

  .target-card strong {
    font-size: 17px;
  }

  .credit {
    display: none;
  }

  .serbia-map {
    width: min(78vw, 620px);
  }
}

@media (max-width: 620px) {
  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .topbar {
    grid-template-columns: 38px 1fr;
    gap: 9px;
    min-height: 78px;
    padding: 8px 12px;
  }

  .brand-mark {
    width: 30px;
    height: 34px;
    border-width: 1.5px;
  }

  .brand-dot {
    width: 8px;
    height: 8px;
    border-width: 2px;
  }

  .game-status {
    grid-template-columns: 56px minmax(130px, 1fr) 70px;
    gap: 5px;
  }

  .status-card,
  .target-card {
    min-height: 55px;
    border-radius: 12px;
  }

  .status-label,
  .target-eyebrow {
    font-size: 7px;
    letter-spacing: 0.1em;
  }

  .score-card strong {
    font-size: 20px;
  }

  .target-card strong {
    font-size: clamp(13px, 4vw, 17px);
  }

  .distance-budget {
    gap: 2px;
  }

  .distance-budget strong {
    font-size: 17px;
  }

  .distance-budget span {
    font-size: 8px;
  }

  .map-caption {
    top: 12px;
    left: 12px;
    font-size: 8px;
  }

  .map-caption span:last-child {
    display: none;
  }

  .caption-divider {
    display: none;
  }

  .serbia-map {
    width: 94vw;
    height: calc(100% - 32px);
  }

  .map-legend {
    right: auto;
    bottom: 10px;
    left: 50%;
    gap: 10px;
    width: max-content;
    padding: 7px 10px;
    font-size: 8px;
    transform: translateX(-50%);
  }

  .welcome-overlay,
  .game-over-overlay,
  .highscore-overlay {
    padding: 14px;
  }

  .welcome-card,
  .game-over-card,
  .highscore-card {
    border-radius: 26px;
  }

  .welcome-card {
    align-self: center;
    padding: 25px;
  }

  .welcome-card h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

  .welcome-card p {
    margin: 16px 0;
    font-size: 12px;
  }

  .rules-row {
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 19px;
  }

  .rules-row > div {
    padding-right: 8px;
  }

  .mode-buttons {
    grid-template-columns: 1fr;
    gap: 7px;
  }

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

  .mode-button-copy small {
    font-size: 8px;
  }

  .rule-number {
    width: 24px;
    height: 24px;
  }

  .primary-button {
    width: 100%;
  }

  .welcome-actions,
  .end-actions {
    flex-direction: column;
  }

  .secondary-button {
    width: 100%;
    min-height: 50px;
  }

  .nickname-row {
    grid-template-columns: 1fr;
  }

  .nickname-row button {
    min-height: 42px;
  }

  .game-over-card {
    padding: 18px;
  }

  .game-over-card .end-actions {
    flex-direction: row;
  }

  .game-over-card .nickname-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .game-over-card .nickname-row button {
    min-height: 40px;
  }

  .game-over-card .primary-button--dark,
  .game-over-card .secondary-button--dark {
    width: auto;
    min-height: 48px;
    font-size: 13px;
  }

  .highscore-item {
    grid-template-columns: 27px minmax(0, 1fr) auto;
    gap: 5px;
    min-height: 33px;
    padding: 3px 7px 3px 4px;
  }

  .highscore-rank {
    width: 22px;
    height: 22px;
  }

  .highscore-card {
    padding: 12px;
  }

  .highscore-card h2 {
    font-size: clamp(28px, 9vw, 36px);
  }

  .highscore-list {
    max-height: none;
    margin-top: 9px;
  }

  .highscore-page-button {
    min-height: 34px;
    padding-inline: 8px;
    font-size: 11px;
  }

  .highscore-page-info {
    font-size: 10px;
  }

  .place-count {
    display: none;
  }

}

@media (max-height: 650px) and (min-width: 621px) {
  .topbar {
    min-height: 76px;
    padding-block: 7px;
  }

  .welcome-card {
    padding: 24px 34px;
  }

  .welcome-card h1 {
    font-size: 39px;
  }

  .welcome-card p {
    margin: 12px 0;
  }

  .rules-row {
    margin-bottom: 14px;
  }
}

@media (max-height: 650px) {
  .highscore-card {
    padding: 8px 12px;
  }

  .highscore-card .game-over-kicker {
    display: none;
  }

  .highscore-card h2 {
    font-size: 26px;
  }

  .highscore-list {
    gap: 2px;
    margin: 6px 0;
  }

  .highscore-item {
    min-height: 28px;
    padding-block: 1px;
  }

  .highscore-rank {
    width: 20px;
    height: 20px;
  }

  .highscore-page-button {
    min-height: 30px;
    padding-block: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
