:root {
  --ink: #18231d;
  --muted: #647068;
  --paper: #f6f3eb;
  --card: #fffdf7;
  --line: #d9d8cf;
  --green: #245d45;
  --green-soft: #dfece3;
  --coral: #d96f4e;
  --coral-soft: #f6dfd7;
  --gold: #e9b949;
  --gold-soft: #f8edc9;
  --blue: #416f83;
  --blue-soft: #dcebf0;
  --plum: #745b78;
  --plum-soft: #ece2ed;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 9% 5%, rgba(233, 185, 73, 0.13), transparent 24rem),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  min-height: 100vh;
}

button,
a {
  font: inherit;
}

button {
  margin: 0;
  color: inherit;
}

img {
  max-width: 100%;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.site-shell,
.quiz-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.brand-bar,
.quiz-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

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

.setup-shell {
  min-height: 0;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.setup-shell .brand-bar {
  min-height: 64px;
}

.brand-group {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

.language-button {
  width: 34px;
  height: 26px;
  padding: 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  opacity: 0.58;
  transition:
    background-color 150ms ease,
    opacity 150ms ease,
    transform 150ms ease;
}

.language-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.language-button.is-selected {
  background: var(--paper);
  box-shadow: 0 1px 5px rgba(24, 35, 29, 0.18);
  opacity: 1;
}

.language-button img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(24, 35, 29, 0.16);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-home-link {
  padding-left: 16px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-decoration: none;
  white-space: nowrap;
}

.site-home-link:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.setup-shell .site-home-link {
  padding-left: 0;
  border-left: 0;
}

.brand-mark {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 4px 7px rgba(24, 35, 29, 0.18));
}

.hero {
  width: 100%;
  padding: 14px 0 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: center;
  gap: 30px;
}

.hero-content {
  min-width: 0;
}

.hero-globe {
  display: block;
  width: 104px;
  height: 104px;
  justify-self: end;
  object-fit: contain;
  filter: drop-shadow(0 9px 14px rgba(24, 35, 29, 0.13));
}

.kicker {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.question-prompt h1,
.result-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero h1 {
  font-size: clamp(40px, 5vw, 58px);
  text-wrap: balance;
}

.hero h1 em {
  color: var(--coral);
  font-weight: 400;
}

.region-panel {
  padding: 10px 12px 12px;
  border: 1px solid rgba(36, 93, 69, 0.18);
  border-radius: 16px;
  background: var(--green-soft);
}

.region-panel h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.region-picker-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr);
  align-items: center;
  gap: 14px;
}

.region-map-card {
  width: min(100%, 600px);
  justify-self: center;
  position: relative;
}

.region-map {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.map-ocean {
  fill: rgba(220, 235, 240, 0.8);
  stroke: rgba(65, 111, 131, 0.24);
  stroke-width: 1;
}

.map-country {
  fill: #b9c8be;
  stroke: rgba(255, 253, 247, 0.92);
  stroke-width: 0.75;
  fill-rule: evenodd;
  transition:
    fill 150ms ease,
    stroke 150ms ease,
    opacity 150ms ease;
}

.map-country.is-merged-shape {
  paint-order: stroke fill;
}

.map-context {
  pointer-events: none;
}

.map-context .map-country {
  fill: #cbd3cd;
}

.map-region {
  cursor: pointer;
  outline: none;
}

.map-marker {
  fill: #82998a;
  stroke: var(--card);
  stroke-width: 1.2;
  pointer-events: none;
  transition:
    fill 150ms ease,
    r 150ms ease;
}

.map-country.is-active,
.map-marker.is-active {
  fill: var(--green);
}

.map-country.is-preview,
.map-marker.is-preview {
  fill: var(--coral);
}

.map-region:focus .map-country,
.map-region:focus .map-marker {
  stroke: var(--gold);
  stroke-width: 2.2;
}

.map-region:hover .map-country:not(.is-preview) {
  fill: #d88467;
}

.action-section {
  padding: 12px 0 14px;
}

.activity-panels {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 2fr);
  gap: 9px;
}

.activity-panel {
  min-width: 0;
  min-height: 106px;
  padding: 9px;
  border: 1px solid rgba(36, 93, 69, 0.28);
  border-radius: 16px;
  background: rgba(223, 236, 227, 0.55);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
}

.explore-panel {
  border-color: rgba(116, 91, 120, 0.34);
  background: rgba(236, 226, 237, 0.68);
}

.activity-panel h2 {
  margin: 0;
  padding: 0 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.1;
}

.activity-grid {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.guess-actions {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.activity-button {
  --action-color: var(--green);
  --action-soft: var(--green-soft);
  --action-border: rgba(36, 93, 69, 0.42);
  min-width: 0;
  min-height: 60px;
  padding: 6px;
  border: 1px solid var(--action-border);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--action-soft), var(--card) 78%);
  text-align: center;
  cursor: pointer;
  display: grid;
  place-content: center;
  gap: 3px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.activity-button:hover {
  transform: translateY(-2px);
  border-color: var(--action-color);
  background: #fff;
  box-shadow: 0 7px 18px rgba(41, 54, 45, 0.09);
}

.activity-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: saturate(0.45);
}

.activity-button:disabled:hover {
  transform: none;
  border-color: var(--action-border);
  background: linear-gradient(145deg, var(--action-soft), var(--card) 78%);
  box-shadow: none;
}

.activity-button strong {
  min-width: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.activity-button small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.05;
}

.tone-coral {
  --action-color: var(--coral);
  --action-soft: var(--coral-soft);
  --action-border: rgba(217, 111, 78, 0.48);
}

.tone-green {
  --action-color: var(--green);
  --action-soft: var(--green-soft);
  --action-border: rgba(36, 93, 69, 0.42);
}

.tone-gold {
  --action-color: #9a7419;
  --action-soft: var(--gold-soft);
  --action-border: rgba(154, 116, 25, 0.42);
}

.tone-blue {
  --action-color: var(--blue);
  --action-soft: var(--blue-soft);
  --action-border: rgba(65, 111, 131, 0.42);
}

.tone-plum {
  --action-color: var(--plum);
  --action-soft: var(--plum-soft);
  --action-border: rgba(116, 91, 120, 0.42);
}

.tone-map {
  --action-color: #28757a;
  --action-soft: #dceced;
  --action-border: rgba(40, 117, 122, 0.42);
}

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

.region-card {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 253, 247, 0.82);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.region-card:hover {
  border-color: var(--green);
}

.region-card.is-selected {
  border-color: var(--green);
  background: var(--card);
  box-shadow: inset 4px 0 0 var(--green);
}

.region-card.is-preview {
  border-color: var(--coral);
  background: var(--coral-soft);
  box-shadow: inset 4px 0 0 var(--coral);
}

.region-card span {
  font-weight: 720;
  font-size: 13px;
  line-height: 1.18;
}

.region-card small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.primary-button {
  border: 0;
  background: var(--coral);
  color: #fff;
  border-radius: 999px;
  min-height: 54px;
  padding: 0 24px 0 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 9px 24px rgba(146, 66, 42, 0.2);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: #c95e3d;
}

.primary-button span {
  font-size: 22px;
  line-height: 1;
}

footer {
  border-top: 1px solid var(--line);
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.setup-shell footer {
  min-height: 52px;
  margin-top: auto;
  gap: 8px 16px;
}

footer a {
  color: var(--muted);
  text-underline-offset: 3px;
}

.license-links {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px 16px;
}

.copyright {
  white-space: nowrap;
}

.install-app-banner {
  width: 100%;
  padding: 11px max(16px, env(safe-area-inset-right)) 12px
    max(16px, env(safe-area-inset-left));
  border-top: 3px solid var(--gold);
  background: var(--green);
  box-shadow: 0 5px 18px rgba(24, 35, 29, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.install-app-button {
  min-height: 40px;
  padding: 7px 14px 7px 10px;
  border: 1px solid rgba(36, 93, 69, 0.32);
  border-radius: 999px;
  background: var(--card);
  color: var(--green);
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.install-app-button img {
  width: 22px;
  height: 22px;
}

.install-app-button:hover {
  border-color: var(--green);
  background: #fff;
}

.install-app-button:focus-visible,
.install-help-close:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
