/* Explore */
.explore-shell {
  --explore-header-height: 64px;
  min-height: 100vh;
  min-height: 100dvh;
}

.explore-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: var(--explore-header-height);
  min-height: var(--explore-header-height);
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  background: var(--paper);
  display: grid;
}

.explore-header .brand-group {
  min-width: 0;
  justify-self: start;
}

.explore-header .home-button {
  justify-self: end;
}

.explore-context {
  min-width: 0;
  max-width: 42vw;
  margin: 0;
  overflow: hidden;
  display: flex;
  justify-content: center;
  gap: 0.35em;
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}

.explore-context:focus {
  outline: none;
}

.explore-context-prefix {
  color: var(--muted);
}

.explore-context-region {
  overflow: hidden;
  text-overflow: ellipsis;
}

.explore-content {
  padding-top: 14px;
  margin-bottom: 70px;
}

.explore-map-layout {
  height: min(650px, calc(100dvh - 255px));
  min-height: 470px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 320px);
  gap: 14px;
}

.explore-map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
}

.explore-map-stage > .explore-region-map {
  height: 100%;
}

.explore-map-scope-controls {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
}

.explore-map-scope-button {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 3px 12px rgba(24, 35, 29, 0.14);
  font-size: 12px;
}

.explore-region-map {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--blue-soft);
  box-shadow: 0 8px 24px rgba(24, 35, 29, 0.08);
}

.explore-region-map > svg {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
}

.explore-map-context-shape {
  fill: rgba(112, 129, 118, 0.14);
  stroke: rgba(73, 91, 80, 0.16);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.explore-map-context-shape.is-crop-edge,
.explore-map-country-shape.is-crop-edge {
  fill: none;
  stroke: var(--blue-soft);
  stroke-width: 3;
  opacity: 1;
  filter: none;
  pointer-events: none;
}

.explore-map-country {
  cursor: pointer;
  outline: none;
}

.explore-region-map.is-zoomed > svg,
.explore-region-map.is-zoomed .explore-map-country,
.explore-region-map.is-zoomed .explore-map-marker-control {
  cursor: grab;
}

.explore-region-map.is-dragging > svg,
.explore-region-map.is-dragging .explore-map-country,
.explore-region-map.is-dragging .explore-map-marker-control {
  cursor: grabbing;
}

.explore-map-country-shape {
  fill: #d9ded5;
  stroke: #6e7c72;
  stroke-width: 0.85;
  vector-effect: non-scaling-stroke;
  paint-order: stroke fill;
  transition:
    fill 150ms ease,
    stroke 150ms ease,
    filter 150ms ease,
    opacity 150ms ease;
}

.explore-map-country.has-locator-marker.is-locator-hidden
  .explore-map-country-shape {
  opacity: 0;
  pointer-events: none;
}

.explore-map-country-marker {
  fill: #9aa99e;
  stroke: var(--card);
  stroke-width: 1.25;
  transition:
    fill 150ms ease,
    stroke 150ms ease,
    filter 150ms ease,
    opacity 150ms ease;
}

.explore-map-marker-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.explore-map-marker-control {
  cursor: pointer;
  transition: opacity 150ms ease;
}

.explore-map-marker-control.is-geometry-readable,
.explore-map-country.is-geometry-readable .explore-map-marker-hit {
  opacity: 0;
  pointer-events: none;
}

.explore-map-marker-top-hit {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.explore-map-country.is-pinned .explore-map-country-shape,
.explore-map-marker-control.is-pinned .explore-map-country-marker {
  fill: var(--green);
  stroke: var(--ink);
  filter: drop-shadow(0 0 4px rgba(33, 91, 66, 0.42));
}

.explore-map-country.is-preview .explore-map-country-shape,
.explore-map-marker-control.is-preview .explore-map-country-marker {
  fill: var(--coral);
  stroke: var(--ink);
  filter: drop-shadow(0 0 4px rgba(217, 111, 78, 0.48));
}

.explore-map-country:focus-visible .explore-map-country-shape {
  stroke: #8d5b00;
  stroke-width: 2.5;
}

.explore-map-zoom-controls {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  padding: 3px;
  border: 1px solid rgba(24, 35, 29, 0.24);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.94);
  box-shadow: 0 5px 14px rgba(24, 35, 29, 0.14);
  display: flex;
  gap: 2px;
  transition:
    opacity 150ms ease,
    visibility 150ms ease;
}

.explore-region-map.has-expanded-silhouette .explore-map-zoom-controls {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
}

.explore-map-zoom-controls button {
  min-width: 34px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: transparent;
  font-size: 18px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
}

.explore-map-zoom-controls button:hover:not(:disabled) {
  background: var(--green-soft);
}

.explore-map-zoom-controls button:disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.42;
}

.explore-map-zoom-controls .explore-map-zoom-reset {
  min-width: 58px;
  font-size: 12px;
}

.explore-silhouette-overlay {
  display: contents;
}

.country-silhouette-inset.is-preview-only {
  cursor: default;
}

.country-silhouette-inset.is-preview-only:hover {
  border-color: rgba(24, 35, 29, 0.28);
  box-shadow:
    0 8px 22px rgba(24, 35, 29, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.explore-country-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.explore-country-status-wrap {
  height: 82px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--green-soft);
  display: grid;
  align-items: center;
}

.explore-country-status {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.explore-country-status.is-empty {
  grid-template-columns: 1fr;
}

.explore-country-status span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.explore-country-status strong {
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.05;
}

.explore-country-status small {
  color: var(--muted);
  font-size: 12px;
}

.explore-status-flag {
  width: 52px;
  border-radius: 4px;
}

.scroll-affordance-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.scroll-affordance-frame::before,
.scroll-affordance-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 0;
  left: 0;
  height: 26px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
}

.scroll-affordance-frame::before {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(24, 35, 29, 0.2),
    rgba(24, 35, 29, 0)
  );
}

.scroll-affordance-frame::after {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(24, 35, 29, 0.2),
    rgba(24, 35, 29, 0)
  );
}

.scroll-affordance-frame.can-scroll-up::before,
.scroll-affordance-frame.can-scroll-down::after {
  opacity: 1;
}

.explore-country-list {
  height: 100%;
  min-height: 0;
  padding: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  align-content: start;
  gap: 7px;
}

.explore-country-card {
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fffdf8;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.explore-country-card.is-preview {
  border-color: var(--coral);
  background: var(--coral-soft);
}

@media (hover: hover) {
  .explore-country-card:hover {
    border-color: var(--coral);
    background: var(--coral-soft);
  }
}

.explore-country-card.is-pinned {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 4px 0 0 var(--green);
}

.explore-country-card:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.explore-country-card > span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.explore-country-card strong {
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.05;
}

.explore-country-card small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.explore-country-flag {
  width: 45px;
  border-radius: 3px;
}

.map-region-prompt {
  min-height: 440px;
  padding: clamp(28px, 6vw, 70px);
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--blue-soft);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.map-region-prompt h2 {
  margin: 5px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
}

.map-region-prompt > p:not(.kicker) {
  margin: 0 0 22px;
  color: var(--muted);
}

.map-region-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.map-region-grid button {
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--card);
  display: grid;
  place-content: center;
  gap: 3px;
  cursor: pointer;
}

.map-region-grid button:hover {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.map-region-grid button:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 2px;
}

.map-region-grid button strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-weight: 400;
}

.map-region-grid button span {
  color: var(--muted);
  font-size: 11px;
}

.map-region-step {
  padding: clamp(28px, 7vh, 72px) 0 50px;
}

.country-table-wrap {
  margin-bottom: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.country-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  text-align: left;
}

.country-table .flag-column {
  width: 104px;
}

.country-table .country-column {
  width: 42%;
}

.country-table th,
.country-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.country-table thead th {
  position: sticky;
  z-index: 2;
  top: var(--explore-header-height);
  background: var(--green-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.country-table thead th:first-child {
  border-top-left-radius: 13px;
}

.country-table thead th:last-child {
  border-top-right-radius: 13px;
}

.country-table tbody tr:last-child > * {
  border-bottom: 0;
}

.country-table tbody th {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  font-weight: 400;
}

.country-table tbody td:last-child {
  color: var(--muted);
}

.country-table tbody tr {
  cursor: pointer;
}

.country-table tbody tr > * {
  transition: background 150ms ease;
}

@media (hover: hover) {
  .country-table tbody tr:hover > * {
    background: var(--coral-soft);
  }

  .country-table tbody:has(tr:hover)
    tr:has(.table-flag-button:focus-visible):not(:hover)
    > * {
    background: transparent;
  }

  .country-table tbody:has(tr:hover)
    tr:not(:hover)
    .table-flag-button:focus-visible {
    outline-color: transparent;
  }
}

.country-table tbody
  tr:has(
    .table-flag-button:focus-visible:not(.is-pointer-restored-focus)
  )
  > * {
  background: var(--coral-soft);
}

.table-flag-button.is-pointer-restored-focus:focus-visible {
  outline-color: transparent;
}

.table-flag {
  width: 66px;
  border-radius: 4px;
}

.table-flag-button {
  width: 66px;
  border: 0;
  background: transparent;
  padding: 0;
  display: block;
  cursor: zoom-in;
}

.table-flag-button:hover .flag-frame {
  box-shadow:
    0 0 0 2px var(--green),
    0 5px 12px rgba(24, 35, 29, 0.16);
}

body.modal-open {
  overflow: hidden;
}

.install-help-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  padding: 24px;
  background: rgba(17, 26, 21, 0.72);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
}

.install-help-dialog {
  width: min(430px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(36, 93, 69, 0.25);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 22px 70px rgba(17, 26, 21, 0.3);
  text-align: center;
}

.install-help-icon {
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
}

.install-help-dialog h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 400;
  line-height: 1.05;
}

.install-help-dialog p {
  margin: 16px 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.install-help-close {
  min-width: 112px;
  min-height: 44px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.install-help-close:hover {
  background: #194a37;
}

.flag-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 28px;
  background: rgba(17, 26, 21, 0.82);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  cursor: zoom-out;
}

.flag-modal-toolbar {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: default;
}

.flag-modal-toolbar .language-switcher {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(17, 26, 21, 0.72);
}

.flag-modal-card {
  width: min(820px, 90vw);
  max-height: calc(100dvh - 56px);
  display: grid;
  justify-items: center;
  gap: 14px;
  color: #fff;
  text-align: center;
  pointer-events: none;
}

.modal-flag {
  width: min(760px, 86vw, 93vh);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42);
}

.flag-modal-card.has-note .modal-flag {
  width: min(700px, 82vw, 68vh);
}

.flag-modal-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 400;
}

.modal-capital {
  margin-top: -8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(14px, 2vw, 18px);
}

.country-note {
  width: min(640px, 86vw);
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 15px;
  line-height: 1.5;
}
