:root {
  --bg: #121310;
  --surface: #1a1c18;
  --surface-muted: #282b26;
  --surface-soft: #20221e;
  --text: #f2f0ea;
  --text-muted: #aaa89f;
  --text-faint: #77786f;
  --line: #373934;
  --line-strong: #66675f;
  --accent: #a878d9;
  --accent-soft: #6d4c91;
  --guess: #73a9ff;
  --close: #50ce79;
  --near: #f0b919;
  --far: #ef6a9b;
  --danger: #ea7b71;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.25);
}

:root[data-theme="light"] {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-muted: #efeee9;
  --surface-soft: #f7f6f2;
  --text: #171815;
  --text-muted: #6f6e67;
  --text-faint: #98978f;
  --line: #d8d8d1;
  --line-strong: #aaa9a0;
  --accent: #7650a6;
  --accent-soft: #ded0ec;
  --guess: #397fdc;
  --close: #259c54;
  --near: #b48200;
  --far: #c94372;
  --danger: #bd564e;
  --shadow: 0 22px 70px rgba(33, 35, 30, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 160ms ease, color 160ms ease;
}

button,
a,
input {
  font: inherit;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: min(720px, calc(100% - 40px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
}

.brand-button,
.brand-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.72px;
  text-decoration: none;
}

.brand-button:hover,
.brand-link:hover {
  opacity: 0.72;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.social-link {
  width: 23px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}

.social-link:hover {
  color: var(--text);
}

.social-link.instagram {
  font-size: 0;
}

.social-link.instagram::before {
  width: 13px;
  height: 13px;
  content: "";
  display: block;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px transparent;
}

.social-link.instagram::after {
  width: 4px;
  height: 4px;
  content: "";
  position: absolute;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.social-link.tiktok {
  font-size: 19px;
  line-height: 1;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 18px;
  transition: border-color 140ms ease, transform 140ms ease, background-color 160ms ease;
}

.theme-toggle:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.home-main {
  width: min(620px, calc(100% - 40px));
  flex: 1;
  min-height: calc(100vh - 136px);
  margin: 0 auto;
  padding: 20px 0 30px;
  display: grid;
  place-items: center;
}

.home-hero {
  width: 100%;
  margin-top: -16px;
  text-align: center;
}

.eyebrow,
.section-eyebrow {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2.2px;
  line-height: 1.4;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 16px 0 0;
  color: var(--text);
  font-size: clamp(50px, 7vw, 60px);
  font-weight: 600;
  letter-spacing: -4px;
  line-height: 1;
}

.tagline {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  letter-spacing: -0.35px;
}

.date-panel {
  margin-top: 26px;
  padding: 16px 0 15px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.date-panel p {
  margin: 0;
}

.date-panel .date {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.date-panel .challenge {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 14px;
}

.home-cta {
  min-width: 225px;
  min-height: 49px;
  margin: 24px auto 10px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.home-cta:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.13);
}

.home-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pill-button {
  min-height: 45px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.pill-button:hover,
.text-button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.pill-button.selected {
  border-color: var(--text);
}

.live-button::before {
  width: 9px;
  height: 9px;
  margin-right: 5px;
  content: "";
  display: inline-block;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.home-links {
  margin-top: 21px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
}

.text-button {
  padding: 0 2px 2px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  transition: color 140ms ease, transform 140ms ease;
}

.text-button:hover {
  color: var(--text);
}

.site-footer {
  width: min(720px, calc(100% - 40px));
  min-height: 56px;
  margin: 0 auto;
  padding: 16px 0 0;
  display: flex;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
}

.site-footer a,
.site-footer button {
  color: inherit;
}

.footer-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  cursor: pointer;
}

.footer-button:hover,
.site-footer a:hover {
  color: var(--text);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 48px));
  padding: 11px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.score-card {
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--near);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 85%, var(--near));
  text-align: left;
}

.score-card-toggle {
  width: 100%;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.score-card-toggle:hover {
  background: color-mix(in srgb, var(--surface) 70%, var(--near));
}

.score-card-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.score-card-badge {
  padding: 3px 8px;
  border: 1px solid var(--near);
  border-radius: 999px;
  color: var(--near);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.score-card-value {
  margin-top: 2px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1.6px;
  line-height: 1;
}

.score-card-value span {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.score-card-note {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

.score-card-chevron {
  margin-left: 5px;
  color: var(--text-muted);
  font-size: 17px;
}

.score-card-details {
  border-top: 1px solid color-mix(in srgb, var(--line) 85%, var(--near));
}

.daily-score-rows {
  padding: 0 20px;
}

.daily-score-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 17px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.daily-score-pair,
.daily-score-flags {
  display: flex;
  align-items: center;
}

.daily-score-pair {
  min-width: 0;
  gap: 9px;
}

.daily-score-pair > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-score-flags {
  flex: 0 0 auto;
  gap: 3px;
}

.daily-score-flags .country-flag {
  width: 27px;
  height: 19px;
  border-radius: 2px;
}

.daily-score-row strong {
  min-width: 25px;
  font-size: 16px;
  text-align: right;
}

.daily-score-chevron {
  color: var(--text-muted);
  font-size: 17px;
  text-align: right;
}

.daily-score-stats {
  margin: 0;
  padding: 10px 20px 11px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  text-align: center;
}

.daily-score-stats > div {
  display: grid;
  gap: 3px;
}

.daily-score-stats > div + div {
  border-left: 1px solid var(--line);
}

.daily-score-stats dt {
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.daily-score-stats dd {
  margin: 0;
  font-size: 19px;
}

.next-daily {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.54);
  animation: fade-in 120ms ease;
}

.modal-card {
  width: min(520px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: lift-in 160ms ease;
}

.modal-card.small {
  width: min(520px, 100%);
}

.modal-header {
  padding: 24px 26px 6px;
}

.modal-header h2 {
  margin: 5px 0 0;
  font-size: 28px;
  letter-spacing: -1.5px;
  line-height: 1.1;
}

.modal-header p:last-child {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  float: right;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  border-color: var(--line-strong);
}

.map-options {
  padding: 20px 26px 28px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.map-option {
  grid-column: span 2;
  min-height: 96px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease, background-color 140ms ease;
}

.map-option-primary {
  grid-column: span 6;
}

.map-option:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface-soft) 85%, var(--accent));
  transform: translateY(-2px);
}

.map-option strong,
.map-option span {
  display: block;
}

.map-option strong {
  font-size: 14px;
}

.map-option span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.news-modal {
  width: min(670px, 100%);
}

.news-art {
  margin: 18px 22px 0;
  padding: 15px;
  border-radius: 13px;
  background: #10120f;
}

.news-art-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.news-mini-card {
  min-height: 205px;
  padding: 13px;
  border: 1px solid #30352e;
  border-radius: 9px;
  background: #191d17;
}

.news-mini-top {
  height: 7px;
  width: 55%;
  margin-bottom: 13px;
  border-radius: 10px;
  background: #6c596e;
}

.news-mini-map {
  height: 125px;
  border: 1px solid #566052;
  border-radius: 50% 47% 52% 45%;
  background: #292d28;
  position: relative;
  overflow: hidden;
}

.news-mini-map::after {
  width: 150%;
  height: 3px;
  content: "";
  position: absolute;
  top: 55%;
  left: -25%;
  background: #ae7cd6;
  transform: rotate(-28deg);
}

.news-mini-score {
  width: 80%;
  height: 7px;
  margin-top: 13px;
  border-radius: 10px;
  background: #6b8065;
}

.news-content {
  padding: 20px 26px 16px;
}

.news-content h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.5px;
}

.news-content p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.news-controls {
  padding: 16px 26px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.news-dots {
  display: flex;
  gap: 8px;
}

.news-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--surface-muted);
}

.news-dot.active {
  width: 24px;
  border-radius: 999px;
  background: var(--accent);
}

.primary-button,
.secondary-button {
  min-height: 43px;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
}

.secondary-button {
  background: var(--surface-soft);
  color: var(--text);
}

.secondary-button:disabled,
.primary-button:disabled {
  opacity: 0.42;
  box-shadow: none;
  transform: none;
}

.page-main {
  width: min(620px, calc(100% - 40px));
  flex: 1;
  min-height: calc(100vh - 136px);
  margin: 0 auto;
  padding: 30px 0 50px;
  display: grid;
  place-items: center;
}

.simple-page {
  width: 100%;
  text-align: center;
}

.simple-page h1 {
  margin: 13px 0 0;
  font-size: 42px;
  letter-spacing: -2.5px;
  line-height: 1;
}

.simple-page .lead {
  max-width: 520px;
  margin: 16px auto 0;
  color: var(--text-muted);
  font-size: 16px;
}

.simple-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.info-card {
  margin-top: 28px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 14px;
  text-align: left;
}

.info-card p:first-child {
  margin-top: 0;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.lobby-main {
  width: min(620px, calc(100% - 40px));
  flex: 1;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 30px 0 60px;
  display: grid;
  place-items: center;
  text-align: center;
}

.lobby-card {
  width: 100%;
  margin-top: -10px;
}

.lobby-card h1 {
  margin: 13px 0 0;
  font-size: 38px;
  letter-spacing: -2px;
  line-height: 1.05;
}

.lobby-card .lead {
  max-width: 480px;
  margin: 16px auto 0;
  color: var(--text-muted);
}

.invite-row {
  min-height: 60px;
  margin: 28px auto 0;
  padding: 7px 8px 7px 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  text-align: left;
}

.invite-url {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-row .primary-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 17px;
  font-size: 12px;
}

.waiting-mark {
  width: 128px;
  height: 7px;
  margin: 23px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.waiting-mark::before {
  width: 42px;
  height: 100%;
  content: "";
  display: block;
  border-radius: inherit;
  background: var(--text);
  animation: waiting 1.7s ease-in-out infinite;
}

.game-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-header {
  width: min(1080px, calc(100% - 48px));
  min-height: 64px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.game-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 19px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 650;
}

.round-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.round-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface-muted);
}

.round-dots span.current {
  width: 24px;
  border-radius: 999px;
  background: var(--text);
}

.timer-badge {
  min-width: 58px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 15px;
  text-align: center;
}

.timer-badge.warning {
  border-color: var(--near);
  color: var(--near);
}

.game-body {
  width: min(1080px, calc(100% - 48px));
  flex: 1;
  margin: 20px auto 44px;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(280px, 320px);
  align-items: start;
  justify-content: space-between;
  gap: 56px;
}

.map-card {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 20%, transparent);
}

.map-svg {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
  cursor: crosshair;
}

.map-water {
  fill: var(--surface);
}

.country-shape {
  fill: var(--surface-muted);
  stroke: none;
}

.country-outline {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.draw-line {
  fill: none;
  stroke: var(--guess);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.target-line {
  fill: none;
  stroke: var(--text);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.reveal-border {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: reveal-border var(--reveal-duration, 900ms) cubic-bezier(0.22, 0.8, 0.35, 1) var(--reveal-delay, 0ms) forwards;
}

.round-reveal {
  animation: round-enter 180ms ease both;
}

.attempt-reveal {
  animation-name: reveal-border, reveal-attempt;
  animation-duration: var(--reveal-duration, 900ms), 240ms;
  animation-delay: var(--reveal-delay, 0ms), var(--attempt-delay, 0ms);
  animation-timing-function: cubic-bezier(0.22, 0.8, 0.35, 1), ease;
  animation-fill-mode: forwards;
}

.reveal-opponent {
  animation-name: reveal-border, reveal-opponent;
  animation-duration: var(--reveal-duration, 900ms), 240ms;
  animation-delay: var(--reveal-delay, 0ms), 0ms;
  animation-timing-function: cubic-bezier(0.22, 0.8, 0.35, 1), ease;
  animation-fill-mode: forwards;
}

.reveal-canvas {
  animation: reveal-canvas 520ms ease both;
}

.reveal-summary {
  animation: reveal-summary 420ms cubic-bezier(0.22, 0.8, 0.35, 1) 320ms both;
}

.reveal-summary-item {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal-summary-item 360ms cubic-bezier(0.22, 0.8, 0.35, 1) calc(350ms + (var(--reveal-index, 0) * 70ms)) both;
}

.score-pop {
  display: inline-block;
  animation: score-pop 520ms cubic-bezier(0.22, 0.8, 0.35, 1) 400ms both;
}

.opponent-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.result-line.far {
  stroke: var(--far);
}

.result-line.near {
  stroke: var(--near);
}

.result-line.close {
  stroke: var(--close);
}

.result-segment {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.result-segment.far {
  stroke: var(--far);
}

.result-segment.near {
  stroke: var(--near);
}

.result-segment.close {
  stroke: var(--close);
}

.game-side {
  min-height: 370px;
  padding: 27px 24px 20px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: var(--surface);
  text-align: center;
}

.game-side .section-eyebrow {
  margin-bottom: 13px;
}

.country-pair {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  gap: 7px;
}

.country {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.country-flag {
  display: block;
  width: 24px;
  height: 16px;
  min-height: 0;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line-strong) 55%, transparent);
}

.country-flag-wrap {
  display: flex;
  min-height: 21px;
  align-items: center;
}

.country-flag-fallback {
  width: auto;
  height: 21px;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}

.country-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.country-and {
  color: var(--text-muted);
  font-size: 13px;
}

.game-instruction {
  margin: 17px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.65;
}

.game-actions {
  margin-top: 31px;
  display: grid;
  gap: 11px;
}

.game-actions button {
  width: 100%;
}

.round-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.round-actions button {
  width: 100%;
}

.round-hint {
  margin: 6px 0 0;
  color: var(--text-faint);
  font-size: 12px;
}

.live-scores {
  margin: -3px 0 20px;
  padding: 11px 14px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 12px;
}

.live-score {
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-score strong {
  color: var(--text);
  font-size: 15px;
}

.score-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: var(--guess);
}

.score-dot.opponent {
  background: var(--accent);
}

.round-result {
  margin-top: 23px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.live-round-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  text-align: left;
}

.live-round-score.opponent {
  text-align: left;
}

.live-round-score.opponent .round-score,
.live-round-score.opponent .round-score span {
  color: var(--accent);
}

.live-round-result .round-score {
  font-size: 50px;
}

.live-round-result .round-score span {
  font-size: 15px;
}

.live-round-result .score-verdict {
  margin-top: 10px;
  text-align: center;
}

.live-round-result .legend-row {
  flex-wrap: wrap;
  gap: 11px;
}

.legend-item.opponent {
  color: var(--accent);
}

.legend-item.opponent i {
  width: 12px;
  height: 2px;
  border-radius: 0;
}

.auto-advance {
  margin: 17px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.round-score-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.round-score {
  margin-top: 5px;
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -4px;
  line-height: 1;
}

.round-score span {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.4px;
}

.score-verdict {
  margin: 9px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.score-verdict.far {
  color: var(--far);
}

.score-verdict.near {
  color: var(--near);
}

.score-verdict.close {
  color: var(--close);
}

.legend {
  margin-top: 24px;
  padding: 15px 0 4px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 11px;
}

.legend-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.legend-row {
  margin-bottom: 11px;
  display: flex;
  justify-content: center;
  gap: 15px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-item i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
}

.legend-item.close {
  color: var(--close);
}

.legend-item.near {
  color: var(--near);
}

.legend-item.far {
  color: var(--far);
}

.waiting-opponent {
  margin: 29px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.results-main {
  width: min(720px, calc(100% - 40px));
  flex: 1;
  margin: 0 auto;
  padding: 48px 0 60px;
  text-align: center;
}

.results-main h1 {
  margin: 12px 0 0;
  font-size: 48px;
  letter-spacing: -3px;
  line-height: 1;
}

.results-lead {
  margin: 13px 0 0;
  color: var(--text-muted);
}

.versus-card {
  margin-top: 28px;
  padding: 21px 28px 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.versus-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.versus-player {
  display: grid;
  gap: 4px;
}

.versus-player:first-child {
  text-align: left;
}

.versus-player:last-child {
  text-align: right;
}

.versus-player span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.versus-player:last-child span,
.versus-player:last-child strong {
  color: var(--accent);
}

.versus-player strong {
  font-size: 47px;
  letter-spacing: -3px;
  line-height: 1;
}

.versus-divider {
  color: var(--text-faint);
  font-size: 13px;
}

.winner-copy {
  margin: 17px 0 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 750;
}

.match-history {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.history-row {
  min-height: 45px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 13px;
}

.history-row strong {
  color: var(--text);
  text-align: right;
}

.history-row strong:last-child {
  text-align: left;
}

.history-row .history-round {
  text-align: center;
  font-size: 12px;
}

.live-match-history {
  overflow: hidden;
}

.live-history-row {
  min-height: 45px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 0 2px;
}

.history-pair,
.history-flags,
.history-scores {
  display: flex;
  align-items: center;
}

.history-pair {
  min-width: 0;
  gap: 9px;
}

.history-flags {
  flex: 0 0 auto;
  gap: 3px;
}

.history-flags .country-flag {
  width: 18px;
  height: 14px;
  border-radius: 1px;
}

.history-country-names {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-scores {
  justify-content: flex-end;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.history-scores strong {
  min-width: 17px;
  color: var(--text);
  text-align: right;
}

.history-scores .opponent-score {
  color: var(--accent);
}

.results-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.practice-results {
  padding-top: 48px;
}

.practice-total {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.practice-total span {
  color: var(--text-muted);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -1px;
}

.practice-leaderboard {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.practice-round-row {
  width: 100%;
  min-height: 57px;
  padding: 8px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.practice-round-row:hover {
  background: var(--surface-soft);
}

.practice-round-pair,
.practice-round-flags {
  display: flex;
  align-items: center;
}

.practice-round-pair {
  min-width: 0;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.practice-round-pair > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-round-flags {
  flex: 0 0 auto;
  gap: 3px;
}

.practice-round-flags .country-flag {
  width: 27px;
  height: 19px;
  border-radius: 2px;
}

.practice-round-row strong {
  min-width: 25px;
  color: var(--text);
  font-size: 16px;
  text-align: right;
}

.practice-round-chevron {
  color: var(--text-muted);
  font-size: 17px;
  text-align: right;
}

.practice-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.practice-stats > div {
  padding: 10px 12px 11px;
  display: grid;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.practice-stats > div:last-child {
  border-right: 0;
}

.practice-stats dt {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.practice-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.practice-results-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.practice-results-actions button {
  width: 100%;
}

.practice-note {
  margin: 13px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}

.practice-back-link {
  margin-top: 25px;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes lift-in {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes waiting {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(86px); }
}

@keyframes reveal-border {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes round-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-attempt {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes reveal-opponent {
  from { opacity: 0; }
  to { opacity: 0.95; }
}

@keyframes reveal-canvas {
  0% { border-color: var(--line); box-shadow: 0 0 0 transparent; transform: scale(1); }
  45% { border-color: var(--text); box-shadow: var(--shadow); transform: scale(1.008); }
  100% { border-color: var(--line); box-shadow: 0 10px 28px -24px rgba(0, 0, 0, 0.16); transform: scale(1); }
}

@keyframes reveal-summary {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-summary-item {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes score-pop {
  0% { opacity: 0; transform: scale(0.72); }
  70% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

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

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 320px);
    gap: 22px;
  }

  .game-side {
    padding-inline: 18px;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .home-main,
  .page-main,
  .lobby-main,
  .results-main {
    width: min(100% - 28px, 620px);
  }

  .site-header {
    height: 58px;
  }

  .social-link {
    display: none;
  }

  .home-main {
    min-height: calc(100vh - 118px);
    padding-top: 24px;
  }

  .home-hero {
    margin-top: 0;
  }

  .home-hero h1 {
    font-size: 53px;
  }

  .tagline {
    font-size: 16px;
  }

  .home-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .score-card {
    width: 100%;
  }

  .score-card-toggle {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .score-card-note {
    text-align: left;
  }

  .map-options {
    padding-inline: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-option,
  .map-option-primary {
    grid-column: span 2;
  }

  .modal-header,
  .news-content,
  .news-controls {
    padding-inline: 18px;
  }

  .news-art {
    margin-inline: 14px;
  }

  .game-header,
  .game-body {
    width: min(100% - 28px, 680px);
  }

  .game-header {
    min-height: 58px;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
  }

  .map-card,
  .game-side {
    width: 100%;
  }

  .game-side {
    min-height: 0;
    border-radius: 17px;
  }

  .game-body {
    margin-top: 14px;
  }

  .game-meta {
    gap: 10px;
  }

  .round-dots {
    display: none;
  }

  .invite-row {
    border-radius: 18px;
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .invite-url {
    padding: 2px 3px;
  }

  .invite-row .primary-button {
    width: 100%;
  }

  .lobby-card h1 {
    font-size: 32px;
  }

  .results-main {
    padding-top: 34px;
  }

  .results-main h1 {
    font-size: 40px;
  }

  .versus-card {
    padding-inline: 17px;
  }

  .versus-scores {
    gap: 10px;
  }

  .versus-player strong {
    font-size: 38px;
  }

  .live-round-result .round-score {
    font-size: 42px;
  }
}

@media (max-width: 430px) {
  .site-footer {
    gap: 9px;
    font-size: 11px;
  }

  .home-hero h1 {
    font-size: 48px;
    letter-spacing: -3.3px;
  }

  .home-nav {
    gap: 6px;
  }

  .pill-button {
    padding-inline: 8px;
    font-size: 12px;
  }

  .map-options {
    grid-template-columns: 1fr;
  }

  .country-pair {
    grid-template-columns: 1fr 25px 1fr;
  }
}
