.country-finder-home-tile {
  width: 100%;
  color: #f4f7ff;
  font: inherit;
  text-align: left;
}
.country-finder-home-tile .quiz-tile-copy strong { color: #f4f7ff; }

.country-finder-screen {
  --country-blue: #70bcf0;
  --country-gold: #efc46f;
  padding: clamp(.45rem, 2vw, 1rem);
  overflow-y: auto;
  color: #f1f7ff;
  background:
    radial-gradient(circle at 12% 8%, rgba(49, 131, 183, .25), transparent 31%),
    radial-gradient(circle at 88% 90%, rgba(62, 156, 112, .18), transparent 34%),
    linear-gradient(145deg, #081721, #10222b 58%, #071117);
}

.country-finder-card,
.country-finder-game-shell {
  width: min(980px, 100%);
  min-width: 0;
  margin: auto;
}

.country-finder-card {
  display: grid;
  justify-items: center;
  gap: .9rem;
  padding: clamp(1rem, 4vw, 2.4rem);
  border: 1px solid rgba(112, 188, 240, .32);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(20, 48, 62, .97), rgba(13, 28, 37, .98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
  text-align: center;
}

.country-finder-card h2 {
  margin: 0;
  color: #fff5db;
  font-family: Georgia, serif;
  font-size: clamp(2.1rem, 7vw, 4rem);
  line-height: 1;
}

.country-finder-card > p {
  max-width: 680px;
  margin: 0;
  color: #b8cbd5;
  line-height: 1.55;
}

.country-finder-logo { font-size: clamp(3rem, 10vw, 5rem); line-height: 1; }
.country-finder-kicker {
  color: var(--country-gold);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.country-finder-rules,
.country-finder-result-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 13px;
  background: rgba(255, 255, 255, .1);
}

.country-finder-rules span,
.country-finder-result-stats span {
  display: grid;
  gap: .25rem;
  padding: .9rem .5rem;
  background: rgba(5, 20, 29, .78);
  color: #9fb3bd;
  font-size: .72rem;
}

.country-finder-rules strong,
.country-finder-result-stats strong { color: #fff1c8; font-size: 1.08rem; }

.country-finder-modes {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  padding: .75rem;
  border: 1px solid rgba(112, 188, 240, .24);
  border-radius: 15px;
}
.country-finder-modes legend { padding: 0 .4rem; color: #a9bec9; font-size: .75rem; }
.country-finder-modes input { position: absolute; opacity: 0; }
.country-finder-modes span {
  min-height: 108px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .2rem;
  padding: .65rem .45rem;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 11px;
  background: rgba(255, 255, 255, .04);
  color: #d8e7ee;
  cursor: pointer;
  text-align: center;
}
.country-finder-mode-icon {
  display: block;
  margin-bottom: .1rem;
  font-style: normal;
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, .28));
}
.country-finder-modes strong { color: #f5ead0; font-size: 1rem; line-height: 1.2; }
.country-finder-modes small { color: #91a9b5; font-size: .68rem; line-height: 1.25; text-align: center; }
.country-finder-modes input:checked + span {
  border-color: var(--country-gold);
  background: linear-gradient(145deg, rgba(239, 196, 111, .18), rgba(68, 143, 185, .12));
  box-shadow: inset 0 0 0 1px rgba(255, 230, 169, .18);
}

.country-finder-rounds {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem;
  border: 1px solid rgba(112, 188, 240, .24);
  border-radius: 13px;
}
.country-finder-rounds legend { padding: 0 .4rem; color: #a9bec9; font-size: .75rem; }
.country-finder-rounds input { position: absolute; opacity: 0; }
.country-finder-rounds span {
  display: grid;
  place-items: center;
  min-width: 62px;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .04);
  color: #d8e7ee;
  font-weight: 850;
  cursor: pointer;
}
.country-finder-rounds input:checked + span {
  border-color: var(--country-gold);
  background: rgba(239, 196, 111, .14);
  color: #ffe4aa;
}

.country-finder-primary-btn,
.country-finder-secondary-btn {
  min-height: 44px;
  padding: .68rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.country-finder-primary-btn {
  border: 1px solid #bde5ff;
  background: linear-gradient(145deg, #77c8f5, #3d91c2);
  color: #071823;
  box-shadow: 0 8px 22px rgba(36, 124, 176, .26);
}
.country-finder-secondary-btn {
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .045);
  color: #d9e8ef;
}
.country-finder-card > .country-finder-primary-btn { width: min(420px, 100%); }
.country-finder-card > .country-finder-secondary-btn { justify-self: start; }

.country-finder-game-screen {
  padding-bottom: max(.45rem, env(safe-area-inset-bottom, 0px));
  overflow: hidden;
}
.country-finder-game-shell {
  height: calc(100dvh - max(.9rem, env(safe-area-inset-top, 0px)) - max(.9rem, env(safe-area-inset-bottom, 0px)));
  display: grid;
  grid-template-rows: auto auto minmax(260px, 1fr) auto;
  gap: .55rem;
}
.country-finder-hud {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr) auto;
  align-items: center;
  gap: .5rem;
  padding: .58rem .7rem;
  border: 1px solid rgba(112, 188, 240, .28);
  border-radius: 13px;
  background: rgba(7, 25, 35, .92);
}
.country-finder-hud > div { display: grid; justify-items: center; gap: .1rem; }
.country-finder-hud span { color: #829da9; font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.country-finder-hud strong { color: #ffe0a0; font-size: .95rem; }

.country-finder-question {
  display: grid;
  justify-items: center;
  gap: .12rem;
  padding: .55rem .75rem;
  border: 1px solid rgba(239, 196, 111, .25);
  border-radius: 13px;
  background: rgba(20, 39, 46, .94);
  text-align: center;
}
.country-finder-question span { color: #8fa8b3; font-size: .62rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.country-finder-question h2 { margin: 0; color: #fff1c6; font-family: Georgia, serif; font-size: clamp(1.35rem, 4vw, 2.15rem); }
.country-finder-question small { color: #9eb2bc; }

.country-finder-map-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(112, 188, 240, .35);
  border-radius: 17px;
  background: #071019;
  box-shadow: 0 16px 45px rgba(0, 0, 0, .38);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#countryFinderMap { width: 100%; height: 100%; min-height: 260px; }
.country-finder-map-wrap .leaflet-container { background: #071019; font-family: inherit; }
.country-finder-map-wrap .leaflet-interactive {
  pointer-events: auto !important;
  cursor: pointer;
  touch-action: manipulation;
  transition: fill-opacity .12s ease;
}

.country-finder-pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .45rem;
  padding: 1rem;
  background: rgba(5, 17, 24, .93);
  backdrop-filter: blur(7px);
  text-align: center;
}
.country-finder-pause-overlay.hidden { display: none; }
.country-finder-pause-overlay strong { color: var(--country-gold); font-family: Georgia, serif; font-size: clamp(2.5rem, 9vw, 5rem); letter-spacing: .08em; }
.country-finder-pause-overlay span { color: #c1d1d8; }

.country-finder-feedback {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .18rem .8rem;
  padding: .65rem .8rem;
  border-left: 3px solid var(--country-gold);
  border-radius: 10px;
  background: rgba(6, 22, 30, .96);
}
.country-finder-feedback.hidden { display: none; }
.country-finder-feedback strong { color: #caffdf; }
.country-finder-feedback strong.wrong { color: #ffd0d3; }
.country-finder-feedback p { margin: 0; color: #afc3cc; font-size: .8rem; }
.country-finder-feedback .country-finder-primary-btn { grid-column: 2; grid-row: 1 / 3; }

.country-finder-correct-label,
.country-finder-wrong-label {
  padding: .28rem .48rem;
  border: 1px solid #bfffe0;
  border-radius: 7px;
  background: rgba(7, 56, 34, .94);
  color: #d8ffeb;
  font-weight: 900;
  box-shadow: 0 5px 15px rgba(0, 0, 0, .4);
}
.country-finder-wrong-label { border-color: #ffd1d4; background: rgba(91, 24, 31, .94); color: #ffe1e3; }
.country-finder-correct-label::before,
.country-finder-wrong-label::before { display: none; }

.country-finder-result-card { width: min(680px, 100%); }
.country-finder-result-score { margin: 0; color: var(--country-gold) !important; font-size: clamp(2.8rem, 10vw, 5rem); font-weight: 900; }
.country-finder-result-stats { grid-template-columns: repeat(3, 1fr); }
.country-finder-result-card > .country-finder-secondary-btn { width: min(420px, 100%); justify-self: center; }

.country-finder-champion-notice {
  width: 100%;
  padding: .75rem;
  border: 1px solid rgba(239, 196, 111, .58);
  border-radius: 12px;
  background: rgba(239, 196, 111, .12);
  color: #ffe09a;
  font-weight: 900;
}
.country-finder-champion-notice.hidden,
.country-finder-highscore-form.hidden { display: none; }
.country-finder-highscore-form {
  width: 100%;
  display: grid;
  gap: .5rem;
  padding: .85rem;
  border: 1px solid rgba(112, 188, 240, .3);
  border-radius: 13px;
  background: rgba(5, 20, 29, .72);
  text-align: left;
}
.country-finder-highscore-form label { color: #f7e8bd; font-weight: 850; }
.country-finder-highscore-form > div { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.country-finder-highscore-form input {
  min-width: 0;
  padding: .72rem .8rem;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 10px;
  background: #091923;
  color: #f2f7fa;
  font: inherit;
}
.country-finder-highscore-form p { min-height: 1.2em; margin: 0; color: #a9bec8; font-size: .76rem; }

@media (max-width: 680px) {
  .country-finder-screen { padding: .35rem; }
  .country-finder-rules { grid-template-columns: 1fr; gap: .35rem; background: transparent; }
  .country-finder-rules span { border-radius: 9px; }
  .country-finder-modes { grid-template-columns: 1fr; gap: .35rem; }
  .country-finder-modes span { min-height: 88px; gap: .16rem; }
  .country-finder-mode-icon { font-size: 1.7rem; }
  .country-finder-game-shell { height: calc(100dvh - .7rem - env(safe-area-inset-bottom, 0px)); gap: .35rem; }
  .country-finder-hud { grid-template-columns: auto repeat(3, 1fr) auto; gap: .18rem; padding: .38rem; }
  .country-finder-hud .country-finder-secondary-btn { min-height: 36px; padding: .35rem .42rem; font-size: .68rem; }
  .country-finder-hud span { font-size: .52rem; }
  .country-finder-hud strong { font-size: .78rem; }
  .country-finder-question { padding: .4rem .55rem; }
  .country-finder-question h2 { font-size: 1.25rem; }
  .country-finder-question small { display: none; }
  .country-finder-feedback { grid-template-columns: 1fr; gap: .35rem; padding: .55rem; text-align: center; }
  .country-finder-feedback .country-finder-primary-btn { grid-column: 1; grid-row: auto; width: 100%; }
  .country-finder-result-stats { grid-template-columns: 1fr; gap: .35rem; background: transparent; }
  .country-finder-result-stats span { border-radius: 9px; }
  .country-finder-highscore-form > div { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .country-finder-game-shell { grid-template-rows: auto auto minmax(180px, 1fr) auto; }
  .country-finder-question { grid-template-columns: auto 1fr; align-items: center; justify-items: start; column-gap: .6rem; padding: .3rem .65rem; text-align: left; }
  .country-finder-question h2 { font-size: 1.2rem; }
  .country-finder-question small { display: none; }
  #countryFinderMap { min-height: 180px; }
}
