.world-explorer-screen {
  --wx-ink: #17233b;
  --wx-paper: #f8fbff;
  --wx-night: #062c46;
  --wx-mint: #00a884;
  --wx-gold: #f5c84b;
  background: var(--wx-night);
  color: var(--wx-ink);
  overflow: hidden;
  padding: 0 !important;
}

.wx-shell {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: var(--wx-night);
  font-family: "Outfit", sans-serif;
}

.wx-topbar {
  position: relative;
  z-index: 20;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(205px, 0.75fr) minmax(250px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) max(64px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: #f8fbff;
  border-bottom: 1px solid #cfe0ea;
  box-shadow: 0 5px 18px rgba(2, 26, 43, 0.2);
}

.wx-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wx-title img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(18, 45, 67, 0.18);
}

.wx-title-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.wx-title-copy strong {
  font-size: 20px;
  font-weight: 900;
  color: #17344a;
}

.wx-title-copy span {
  margin-top: 4px;
  overflow: hidden;
  color: #51677a;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wx-command,
.wx-topic,
.wx-child,
.wx-icon-command,
.wx-search-result {
  min-height: 44px;
  border: 0;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.wx-command {
  padding: 0 16px;
  border-radius: 8px;
  background: #18334a;
  color: #fff;
  box-shadow: 0 4px 0 #0b1f31;
}

.wx-command:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #0b1f31;
}

.wx-command.secondary {
  background: #e5f0f5;
  color: #27465b;
  box-shadow: 0 4px 0 #bfd4de;
}

.wx-command.accent {
  background: var(--wx-mint);
  color: #fff;
  box-shadow: 0 4px 0 #05765f;
}

.wx-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.wx-top-actions .wx-command {
  white-space: nowrap;
}

.wx-passport {
  width: 128px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid #e6bd43;
  border-radius: 8px;
  background: #fff7d0;
  color: #5d4810;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.wx-passport-meter {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #e5d497;
}

.wx-passport-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #e7a900;
  transition: width 300ms ease;
}

.wx-search-wrap {
  position: relative;
  min-width: 0;
}

.wx-search {
  width: 100%;
  min-height: 46px;
  padding: 0 16px 0 42px;
  border: 2px solid #bdd2df;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #18334a;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}

.wx-search-wrap::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 15px;
  width: 12px;
  height: 12px;
  border: 3px solid #557489;
  border-radius: 50%;
  pointer-events: none;
}

.wx-search-wrap::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 28px;
  left: 28px;
  width: 8px;
  height: 3px;
  border-radius: 2px;
  background: #557489;
  transform: rotate(45deg);
  pointer-events: none;
}

.wx-search:focus {
  border-color: #00a884;
  box-shadow: 0 0 0 3px rgba(0, 168, 132, 0.16);
}

.wx-search-results {
  position: absolute;
  z-index: 80;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  overflow: hidden;
  border: 1px solid #b8cbd6;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(5, 31, 49, 0.25);
}

.wx-search-results.show {
  display: block;
}

.wx-search-result {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  border-bottom: 1px solid #e3edf2;
  background: #fff;
  color: #17344a;
  text-align: left;
}

.wx-search-result:last-child {
  border-bottom: 0;
}

.wx-search-result:hover,
.wx-search-result:focus-visible {
  background: #e6fbf5;
}

.wx-search-result small {
  color: #6b7d89;
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.wx-search-result.empty {
  cursor: default;
}

.wx-topic-rail {
  position: relative;
  z-index: 10;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px max(16px, env(safe-area-inset-right)) 9px max(16px, env(safe-area-inset-left));
  background: #dceaf0;
  scrollbar-width: none;
}

.wx-topic-rail::-webkit-scrollbar {
  display: none;
}

.wx-topic {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #f8fbff;
  color: #29485c;
  box-shadow: 0 3px 0 #afc5d0;
  white-space: nowrap;
}

.wx-topic.active {
  border-color: var(--topic-color);
  background: var(--topic-color);
  color: #fff;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--topic-color), #000 28%);
}

.wx-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 32vw, 470px);
  background: var(--wx-night);
}

.wx-globe-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--wx-night);
  isolation: isolate;
}

.wx-globe-host,
.wx-globe-host canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.wx-globe-host canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}

.wx-globe-host canvas.dragging {
  cursor: grabbing;
}

.wx-globe-loading {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: #062c46;
  color: #fff;
  transition: opacity 250ms ease, visibility 250ms ease;
}

.wx-globe-loading.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.wx-loader-ring {
  width: 48px;
  height: 48px;
  border: 6px solid rgba(255, 255, 255, 0.25);
  border-top-color: #f5c84b;
  border-radius: 50%;
  animation: wx-spin 850ms linear infinite;
}

@keyframes wx-spin {
  to { transform: rotate(360deg); }
}

.wx-globe-controls {
  position: absolute;
  z-index: 8;
  top: 14px;
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: repeat(2, 48px);
  gap: 7px;
}

.wx-icon-command {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 2px solid #d8e7ed;
  border-radius: 50%;
  background: #f8fbff;
  color: #17344a;
  box-shadow: 0 4px 0 rgba(4, 26, 42, 0.42);
  font-size: 25px;
  line-height: 1;
}

.wx-icon-command.home {
  font-size: 12px;
}

.wx-icon-command.spin {
  font-size: 25px;
}

.wx-icon-command.spin.active {
  border-color: #f5c84b;
  background: #fff4bf;
  color: #765700;
}

.wx-country-label {
  position: absolute;
  z-index: 7;
  top: 16px;
  left: 50%;
  max-width: min(55%, 440px);
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: rgba(5, 32, 51, 0.82);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  transform: translate(-50%, -16px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  pointer-events: none;
}

.wx-country-label.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.wx-globe-hint {
  position: absolute;
  z-index: 7;
  right: 16px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 16px;
  color: #eaf7ff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 5px #00131f;
  pointer-events: none;
}

.wx-deck {
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid #b9d0dc;
  background: var(--wx-paper);
}

.wx-deck-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 24px max(24px, env(safe-area-inset-bottom));
}

.wx-place-kicker {
  color: #008a70;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.wx-place-name {
  margin: 3px 0 0;
  color: #17344a;
  font-size: clamp(30px, 3.3vw, 46px);
  font-weight: 900;
  line-height: 1;
  overflow-wrap: anywhere;
}

.wx-place-breadcrumb {
  margin-top: 7px;
  color: #657886;
  font-size: 13px;
  font-weight: 800;
}

.wx-child-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.wx-child-picker {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  color: #3a5365;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.wx-child-picker select {
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 13px;
  border: 2px solid #e36b8b;
  border-radius: 8px;
  background: #fff0f4;
  color: #70223b;
  font: inherit;
  font-size: 16px;
  text-transform: none;
  cursor: pointer;
}

.wx-child {
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid #e36b8b;
  border-radius: 8px;
  background: #fff0f4;
  color: #8c2845;
  box-shadow: 0 3px 0 #e4a0b3;
}

.wx-fact {
  position: relative;
  margin-top: 22px;
  padding: 20px 18px 18px;
  border: 2px solid var(--fact-color);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(25, 60, 82, 0.1);
}

.wx-fact::before {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: -2px;
  width: 7px;
  border-radius: 7px 0 0 7px;
  background: var(--fact-color);
}

.wx-fact-topic {
  color: var(--fact-color);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.wx-fact-text {
  margin: 10px 0 14px;
  color: #1d3144;
  font-size: clamp(19px, 1.65vw, 24px);
  font-weight: 800;
  line-height: 1.32;
}

.wx-fact-count {
  color: #748692;
  font-size: 11px;
  font-weight: 800;
}

.wx-deck-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
}

.wx-discovery-summary {
  margin-top: auto;
  padding-top: 22px;
  color: #6d7d89;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.wx-empty {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.wx-empty-globe {
  position: relative;
  width: 116px;
  height: 116px;
  margin-bottom: 17px;
  border: 8px solid #168cb8;
  border-radius: 50%;
  background: #66ca91;
  box-shadow: inset 23px 0 0 #f2d45b, 0 10px 0 #d9e5e9;
}

.wx-empty-globe::before,
.wx-empty-globe::after {
  content: "";
  position: absolute;
  border: 4px solid #075e84;
  border-radius: 50%;
}

.wx-empty-globe::before {
  inset: 13px 35px;
}

.wx-empty-globe::after {
  inset: 38px 4px;
}

.wx-empty strong {
  color: #17344a;
  font-size: 25px;
  font-weight: 900;
}

.wx-empty p {
  max-width: 330px;
  margin: 9px auto 20px;
  color: #5f7280;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.wx-country-count {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 2px solid #e6bd43;
  border-radius: 8px;
  background: #fff7d0;
  color: #5d4810;
}

.wx-country-count b {
  font-size: 28px;
  line-height: 1;
}

.wx-country-count span {
  max-width: 110px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.05;
  text-align: left;
}

@media (max-width: 1120px) {
  .wx-topbar {
    grid-template-columns: auto minmax(175px, 0.6fr) minmax(220px, 1fr) auto;
  }

  .wx-title-copy span {
    display: none;
  }

  .wx-top-actions .secondary {
    display: none;
  }

  .wx-layout {
    grid-template-columns: minmax(0, 1fr) clamp(310px, 35vw, 390px);
  }
}

@media (max-width: 820px) and (orientation: portrait) {
  .wx-shell {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .wx-topbar {
    min-height: auto;
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "back title actions"
      "search search search";
    padding-bottom: 9px;
  }

  #wxBack {
    grid-area: back;
  }

  .wx-title {
    grid-area: title;
    justify-self: center;
  }

  .wx-title img {
    width: 40px;
    height: 40px;
  }

  .wx-title-copy strong {
    font-size: 18px;
  }

  .wx-search-wrap {
    grid-area: search;
  }

  .wx-top-actions {
    grid-area: actions;
  }

  .wx-top-actions .wx-command {
    display: block;
    min-height: 40px;
    padding: 0 11px;
    font-size: 12px;
  }

  .wx-passport {
    width: 112px;
  }

  .wx-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(330px, 54%) minmax(0, 46%);
  }

  .wx-deck {
    border-top: 1px solid #b9d0dc;
    border-left: 0;
  }

  .wx-deck-inner {
    min-height: auto;
    padding: 18px 20px max(20px, env(safe-area-inset-bottom));
  }

  .wx-place-name {
    font-size: 31px;
  }

  .wx-fact {
    margin-top: 14px;
  }

  .wx-fact-text {
    font-size: 19px;
  }

  .wx-discovery-summary {
    display: none;
  }
}

@media (max-width: 620px) {
  .wx-topbar {
    gap: 8px;
    padding-right: 54px;
    padding-left: 10px;
  }

  .wx-title img,
  .wx-title-copy span {
    display: none;
  }

  .wx-title-copy strong {
    font-size: 17px;
  }

  .wx-command {
    padding: 0 12px;
  }

  .wx-top-actions .wx-command.secondary {
    display: none;
  }

  .wx-passport {
    width: 108px;
    font-size: 11px;
  }

  .wx-topic-rail {
    padding-right: 10px;
    padding-left: 10px;
  }

  .wx-topic {
    min-height: 38px;
    padding: 0 11px;
    font-size: 13px;
  }

  .wx-layout {
    grid-template-rows: minmax(300px, 52%) minmax(0, 48%);
  }

  .wx-globe-controls {
    grid-template-columns: repeat(4, 44px);
  }

  .wx-icon-command {
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .wx-country-label {
    top: 68px;
    max-width: 80%;
    font-size: 17px;
  }

  .wx-deck-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wx-loader-ring {
    animation-duration: 1600ms;
  }

  .wx-country-label,
  .wx-passport-meter span {
    transition: none;
  }
}
