﻿:root {
  --bg-0: #040b14;
  --bg-1: #0a1d2d;
  --ink-main: #e9f9f4;
  --ink-soft: #9fc4bf;
  --panel-bg: rgba(9, 29, 33, 0.9);
  --panel-border: rgba(128, 199, 183, 0.35);
  --ornament: rgba(121, 221, 201, 0.7);
  --accent-1: #74e3c3;
  --accent-2: #62a8d9;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow-x: hidden;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: var(--ink-main);
  background:
    radial-gradient(1200px 620px at 12% 100%, rgba(90, 206, 178, 0.22), transparent 66%),
    radial-gradient(900px 480px at 94% 2%, rgba(90, 141, 201, 0.2), transparent 68%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
}

#map,
#map * {
  -webkit-tap-highlight-color: transparent;
}

#map:focus,
#map *:focus,
.map-viewport:focus {
  outline: none !important;
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding:
    calc(18px + env(safe-area-inset-top))
    16px
    calc(18px + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 420px at 48% 22%, rgba(91, 206, 179, 0.24), transparent 68%),
    linear-gradient(180deg, #081723 0%, #041019 100%);
  transition: opacity 360ms ease, visibility 360ms ease;
}

.app-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading-card {
  width: min(92vw, 360px);
  margin-inline: auto;
  border-radius: 18px;
  border: 1px solid rgba(125, 213, 195, 0.42);
  background: linear-gradient(155deg, rgba(10, 35, 43, 0.95), rgba(5, 20, 28, 0.94));
  box-shadow: inset 0 0 0 1px rgba(168, 240, 223, 0.13), 0 24px 42px rgba(0, 0, 0, 0.45);
  padding: 18px 16px;
  text-align: center;
}

.app-loading-card img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(170, 246, 227, 0.72);
  box-shadow: 0 0 20px rgba(132, 234, 207, 0.45);
  animation: portalPulse 2s ease-in-out infinite;
}

.app-loading-card h2 {
  margin: 12px 0 6px;
  font-size: 1.18rem;
}

.app-loading-card p {
  margin: 0;
  color: #b4d9d2;
  font-size: 0.92rem;
}

.app-loading-card small {
  display: inline-block;
  margin-top: 10px;
  color: #93beb8;
  letter-spacing: 0.03em;
}

@keyframes portalPulse {
  0% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(101, 222, 194, 0.35), 0 0 14px rgba(101, 222, 194, 0.35);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 14px rgba(101, 222, 194, 0.08), 0 0 30px rgba(101, 222, 194, 0.58);
  }
  100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(101, 222, 194, 0.35), 0 0 14px rgba(101, 222, 194, 0.35);
  }
}

.app-shell {
  height: 100svh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding:
    calc(10px + env(safe-area-inset-top))
    calc(10px + env(safe-area-inset-right))
    calc(10px + env(safe-area-inset-bottom))
    calc(10px + env(safe-area-inset-left));
  gap: 10px;
  overflow: hidden;
}

.build-info-badge {
  position: fixed;
  right: calc(10px + env(safe-area-inset-right));
  bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
  padding: 2px 8px;
  border-radius: 8px;
  border: 1px solid rgba(129, 208, 189, 0.28);
  background: rgba(5, 16, 24, 0.5);
  color: rgba(188, 222, 215, 0.86);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
  pointer-events: none;
  user-select: none;
}

.masthead {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 2px 4px 2px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.masthead-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.app-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(169, 243, 225, 0.68);
  box-shadow: 0 0 12px rgba(116, 224, 196, 0.4);
  display: block;
}

.masthead-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(132, 215, 197, 0.35);
  background: rgba(6, 24, 30, 0.32);
  color: rgba(220, 255, 245, 0.95);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(173, 247, 228, 0.08);
  backdrop-filter: blur(4px);
}

.header-icon-btn:hover {
  border-color: rgba(182, 255, 238, 0.82);
  box-shadow: 0 0 12px rgba(136, 238, 212, 0.35);
}

.header-auth-btn.is-active {
  border-color: rgba(203, 255, 233, 0.92);
  box-shadow: 0 0 12px rgba(126, 245, 204, 0.46);
}

.header-seed-btn {
  border-color: rgba(180, 232, 255, 0.62);
}

.kicker {
  margin: 0;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(1.04rem, 2.15vw, 1.45rem);
  letter-spacing: 0.04em;
  color: #ddfff5;
  cursor: pointer;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.subtitle {
  margin: 0;
  color: #9ec7c0;
  font-size: 0.76rem;
}

.app {
  min-height: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.map-wrap {
  min-height: 0;
  min-width: 0;
}

.map-frame {
  position: relative;
  height: 100%;
  min-height: 46dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  border-radius: 18px;
  padding: 10px;
  background:
    linear-gradient(140deg, rgba(8, 21, 27, 0.95), rgba(5, 17, 22, 0.96)),
    repeating-linear-gradient(45deg, rgba(143, 222, 202, 0.05) 0 6px, rgba(6, 18, 22, 0.05) 6px 12px);
  border: 1px solid rgba(108, 138, 147, 0.26);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.map-ornament {
  display: none;
}

.map-ornament::before,
.map-ornament::after {
  content: none;
}

.map-ornament-nw { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.map-ornament-ne { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.map-ornament-sw { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.map-ornament-se { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.map-viewport {
  position: relative;
  min-height: 0;
  aspect-ratio: 3 / 2;
  border-radius: 12px;
  overflow: hidden;
  border: 0;
  background: #02141d;
  cursor: default;
  touch-action: none;
  transition: max-height 280ms ease, border-radius 280ms ease;
}

.portrait-map-resizer {
  display: none;
}

.map-viewport.is-zoomed {
  cursor: grab;
}

.map-viewport.is-panning {
  cursor: grabbing;
}

#map {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#map-bg {
  pointer-events: none;
}

#region-destruction {
  pointer-events: none;
  mix-blend-mode: normal;
  isolation: isolate;
}

.region-destroyed-layer {
  pointer-events: none;
  opacity: 0.9;
  mix-blend-mode: normal;
  filter: saturate(0.92) contrast(0.97) brightness(0.98);
}

#regions,
#pois,
#threat-arrows,
#region-labels,
#poi-labels {
  pointer-events: auto;
}

#threat-arrows {
  pointer-events: none;
}

#region-labels,
#poi-labels {
  pointer-events: none;
}

.threat-arrow {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.84;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.34));
  vector-effect: non-scaling-stroke;
}

.battle-attack-arrow {
  stroke-width: 5;
  opacity: 0.9;
}

.map-region-label {
  fill: rgba(229, 255, 248, 0.93);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(4, 18, 24, 0.86);
  stroke-width: 2.6px;
  vector-effect: non-scaling-stroke;
}

.map-poi-label {
  fill: rgba(222, 248, 242, 0.96);
  font-size: 15px;
  font-weight: 700;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(2, 16, 22, 0.85);
  stroke-width: 2.3px;
  vector-effect: non-scaling-stroke;
}

.map-label-bg {
  fill: rgba(2, 17, 24, 0.72);
  stroke: rgba(173, 239, 225, 0.45);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.map-label-bg-region {
  fill: rgba(4, 18, 26, 0.76);
}

.map-label-bg-poi {
  fill: rgba(6, 22, 30, 0.78);
}

.landscape-panel-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 11;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(145, 224, 208, 0.36);
  background: rgba(8, 32, 36, 0.24);
  color: rgba(220, 255, 248, 0.88);
  backdrop-filter: blur(4px);
  display: none;
}

.map-overlay-toggle {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 11;
  min-width: 96px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(145, 224, 208, 0.36);
  background: rgba(8, 32, 36, 0.28);
  color: rgba(220, 255, 248, 0.88);
  backdrop-filter: blur(4px);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
}

.guest-readonly-badge {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  min-width: 170px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(145, 224, 208, 0.36);
  background: rgba(8, 32, 36, 0.32);
  color: rgba(235, 250, 246, 0.92);
  backdrop-filter: blur(4px);
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  line-height: 1;
}

.guest-readonly-badge.is-hidden {
  display: none;
}

.readonly-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.map-overlay-toggle.is-off {
  background: rgba(8, 24, 28, 0.38);
  color: rgba(191, 223, 217, 0.82);
  border-color: rgba(122, 184, 172, 0.3);
}

.landscape-panel-toggle.is-active {
  border-color: rgba(212, 255, 245, 0.72);
  background: rgba(12, 44, 50, 0.4);
}

@media (max-width: 979px) {
  .map-overlay-toggle {
    top: 6px;
    left: 6px;
    min-width: 84px;
    height: 26px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .guest-readonly-badge {
    top: 6px;
    left: 50%;
    min-width: 136px;
    height: 26px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .threat-arrow {
    stroke-width: 3.5;
    opacity: 0.76;
  }

  .battle-attack-arrow {
    stroke-width: 3.9;
    opacity: 0.82;
  }

  .map-region-label {
    font-size: 13px;
    stroke-width: 2.2px;
  }

  .map-poi-label {
    font-size: 12px;
    stroke-width: 1.9px;
  }
}

.region {
  fill: rgba(var(--faction-rgb, 255, 255, 255), var(--region-fill-a, 0.12));
  stroke: rgba(var(--faction-rgb, 255, 255, 255), var(--region-stroke-a, 0.55));
  stroke-width: 2.15;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-miterlimit: 1;
  paint-order: stroke fill;
  transition: fill 180ms ease, stroke 180ms ease, filter 220ms ease;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(212, 255, 245, 0.16));
  cursor: pointer;
}

.region:hover,
.region:focus-visible,
.region:focus,
.region.active {
  fill: rgba(var(--faction-rgb, 255, 255, 255), var(--region-active-fill-a, 0.35));
  stroke: rgba(var(--faction-rgb, 255, 255, 255), var(--region-active-stroke-a, 0.95));
  filter: drop-shadow(0 0 5px rgba(212, 255, 245, 0.24));
  outline: none;
}

.region.region-heat-1 {
  filter: drop-shadow(0 0 4px rgba(255, 177, 88, 0.4));
}

.region.region-heat-2 {
  filter: drop-shadow(0 0 7px rgba(255, 134, 62, 0.55));
}

.region.region-heat-3 {
  filter: drop-shadow(0 0 11px rgba(255, 91, 45, 0.72));
}

.poi {
  fill: rgba(var(--faction-rgb, 255, 215, 0), var(--poi-fill-a, 0.97));
  stroke: rgba(3, 12, 16, 0.72);
  stroke-width: 2.4;
  transition: transform 160ms ease, fill 160ms ease, filter 180ms ease;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.58));
  cursor: pointer;
}

.poi-aura,
.poi-shadow,
.poi-ring,
.poi-rim,
.poi-texture,
.poi-glint,
.poi-city-core,
.poi-city-sigil {
  pointer-events: none;
  vector-effect: non-scaling-stroke;
}

.poi-shadow {
  fill: rgba(4, 10, 15, var(--coin-shadow-a, 0.38));
  filter: blur(2.6px);
  opacity: 0.9;
}

.poi-shadow.poi-shadow-city {
  fill: rgba(4, 10, 15, calc(var(--coin-shadow-a, 0.38) + 0.08));
  filter: blur(3.4px);
}

.poi-aura {
  fill: rgba(var(--faction-rgb, 255, 215, 0), 0.16);
  stroke: rgba(var(--faction-rgb, 255, 215, 0), 0.34);
  stroke-width: 1.2;
  opacity: 0.95;
  filter: drop-shadow(0 0 8px rgba(var(--faction-rgb, 255, 215, 0), 0.2));
}

.poi-ring {
  fill: rgba(255, 255, 255, 0.04);
  stroke: rgba(229, 252, 246, 0.68);
  stroke-width: 1.35;
  opacity: 0.92;
}

.poi-rim {
  fill: rgba(255, 246, 224, 0.12);
  stroke: rgba(255, 241, 212, 0.76);
  stroke-width: 1.5;
}

.poi-rim.poi-rim-city {
  fill: rgba(255, 246, 224, 0.14);
  stroke: rgba(255, 241, 212, 0.8);
  stroke-width: 1.7;
}

.poi-aura.poi-aura-city {
  fill: rgba(var(--faction-rgb, 255, 215, 0), 0.17);
  stroke: rgba(var(--faction-rgb, 255, 215, 0), 0.3);
  stroke-width: 1.25;
  filter: drop-shadow(0 0 8px rgba(var(--faction-rgb, 255, 215, 0), 0.18));
}

.poi-ring.poi-ring-city {
  stroke: rgba(229, 252, 246, 0.74);
  stroke-width: 1.5;
}

.poi:hover,
.poi:focus-visible,
.poi:focus,
.poi.active {
  transform: scale(1.15);
  fill: rgba(var(--faction-rgb, 255, 215, 0), var(--poi-active-fill-a, 1));
  outline: none;
}

.poi.poi-region-focus {
  transform: scale(1.2);
  stroke-width: 2.9;
  filter: drop-shadow(0 0 10px rgba(116, 227, 195, 0.95));
}

.poi.poi-city {
  fill: rgba(var(--faction-rgb, 255, 215, 0), 0.93);
  stroke: rgba(3, 12, 16, 0.76);
  stroke-width: 2.6;
  filter: drop-shadow(0 0 7px rgba(0, 0, 0, 0.24));
}

.poi-city-core {
  fill: rgba(247, 242, 223, 0.86);
  stroke: rgba(36, 26, 10, 0.72);
  stroke-width: 0.9;
  filter: none;
}

.poi-city-sigil {
  display: none;
}

.poi-texture {
  fill: none;
  stroke: rgba(36, 22, 8, 0.28);
  stroke-width: 0.9;
  stroke-linecap: round;
  opacity: 0.68;
}

.poi-texture.poi-texture-city {
  stroke: rgba(205, 225, 232, 0.28);
  stroke-width: 1;
  opacity: 0.66;
}

.poi-glint {
  fill: none;
  stroke: rgba(255, 253, 246, 0.72);
  stroke-width: 1.05;
  stroke-linecap: round;
  opacity: 0.9;
}

.poi-glint.poi-glint-city {
  stroke: rgba(236, 242, 244, 0.7);
  stroke-width: 1.05;
}

.poi-shadow.is-focused,
.poi-aura.is-focused,
.poi-ring.is-focused,
.poi-rim.is-focused,
.poi-texture.is-focused,
.poi-glint.is-focused,
.poi-city-core.is-focused,
.poi-city-sigil.is-focused {
  filter: drop-shadow(0 0 10px rgba(116, 227, 195, 0.52));
}

.poi-shadow.is-active,
.poi-aura.is-active {
  fill: rgba(255, 255, 255, 0.18);
  stroke: rgba(255, 255, 255, 0.82);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.48));
}

.poi-rim.is-active,
.poi-ring.is-active,
.poi-texture.is-active,
.poi-glint.is-active,
.poi-city-sigil.is-active,
.poi-city-core.is-active {
  stroke: rgba(255, 255, 255, 0.98);
  filter: drop-shadow(0 0 11px rgba(255, 255, 255, 0.6));
}

.poi-city-core.is-active,
.poi-city-sigil.is-active {
  stroke: rgba(255, 255, 255, 0.84);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.18));
}

.poi-shadow.is-dimmed,
.poi-aura.is-dimmed,
.poi-ring.is-dimmed,
.poi-rim.is-dimmed,
.poi-texture.is-dimmed,
.poi-glint.is-dimmed,
.poi-city-core.is-dimmed,
.poi-city-sigil.is-dimmed {
  opacity: 0.58;
}

.poi.poi-dimmed {
  opacity: 0.84;
  filter: saturate(0.86) brightness(0.95);
}

.poi.poi-battle-challenged {
  stroke: rgba(255, 168, 64, 0.95);
  stroke-width: 3;
  filter: drop-shadow(0 0 10px rgba(255, 150, 58, 0.75));
}

.poi.poi-battle-agreed {
  stroke: rgba(255, 118, 64, 0.98);
  stroke-width: 3.4;
  filter: drop-shadow(0 0 12px rgba(255, 92, 52, 0.82));
  animation: poiBurn 1.6s ease-in-out infinite;
}

.poi.active {
  animation: poiPulse 1.45s ease-in-out infinite;
  filter: drop-shadow(0 0 11px rgba(255, 255, 255, 0.98));
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 2.8;
}

.poi.poi-city.active {
  animation: none;
  transform: scale(1.08);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.22));
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 2.7;
}

@keyframes poiPulse {
  0% { transform: scale(1.12); }
  50% { transform: scale(1.24); }
  100% { transform: scale(1.12); }
}

@keyframes poiBurn {
  0% { filter: drop-shadow(0 0 10px rgba(255, 126, 52, 0.8)); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 74, 34, 0.95)); }
  100% { filter: drop-shadow(0 0 10px rgba(255, 126, 52, 0.8)); }
}

.panel {
  background:
    linear-gradient(
      150deg,
      rgba(var(--panel-tint-rgb, 9, 29, 33), 0.22),
      rgba(8, 27, 31, 0.9) 35%,
      rgba(7, 21, 28, 0.92)
    );
  color: #d2efe8;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 14px 16px;
  line-height: 1.4;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: inset 0 0 0 1px rgba(157, 230, 212, 0.06), 0 12px 28px rgba(0, 0, 0, 0.36);
  min-width: 0;
}

.panel-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.panel-title-row h2 {
  margin: 0;
}

.panel-title-faction {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(176, 247, 229, 0.58);
  background: rgba(8, 34, 39, 0.42);
  box-shadow: 0 0 10px rgba(106, 224, 197, 0.32);
  overflow: hidden;
}

.panel-title-faction img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel-title-faction-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.panel h2 {
  margin: 0 0 9px;
  font-size: 1.08rem;
  color: #e2fff8;
}

.panel p {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: #b4d8d3;
}

.faction-hero {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 8px 6px 4px;
}

.faction-hero-image {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(187, 245, 232, 0.55);
  box-shadow: 0 0 16px rgba(151, 232, 213, 0.28);
}

.faction-hero-dot {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 1px solid rgba(187, 245, 232, 0.55);
  box-shadow: 0 0 16px rgba(151, 232, 213, 0.28);
}

.faction-hero-name {
  font-size: 0.86rem;
  color: #d9f9f1;
  text-align: center;
}

.pill-row,
.faction-badge-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.overview-tab-row {
  margin-bottom: 8px;
}

.overview-section {
  margin-top: 10px;
  border: 1px solid rgba(130, 205, 190, 0.34);
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(8, 30, 34, 0.9), rgba(10, 40, 46, 0.74));
  padding: 9px;
}

.overview-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.overview-section-head h3 {
  margin: 0;
  font-size: 0.88rem;
  color: #e7fff8;
}

.overview-section-meta {
  font-size: 0.74rem;
  color: #9ecdc6;
}

.overview-section .region-lore-card {
  margin: 0;
}

.pill,
.faction-badge,
.action-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(123, 197, 186, 0.44);
  background: rgba(11, 46, 49, 0.9);
  color: #dcfff5;
  padding: 5px 10px;
  font-size: 0.79rem;
  max-width: 100%;
}

.scenario-chip {
  border: 1px solid rgba(129, 209, 191, 0.46);
  background: rgba(10, 43, 46, 0.92);
  color: #dcfff6;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  font: inherit;
}

.scenario-chip:hover {
  border-color: rgba(183, 255, 239, 0.76);
  background: rgba(14, 56, 60, 0.95);
}

.faction-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(10, 20, 26, 0.45);
  margin-right: 6px;
}

.faction-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(194, 247, 234, 0.45);
  margin-right: 7px;
  flex: 0 0 auto;
}

.faction-badge-interactive {
  cursor: pointer;
}

.faction-overview {
  display: grid;
  gap: 8px;
}

.faction-overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  border: 1px solid rgba(127, 198, 186, 0.35);
  border-radius: 10px;
  padding: 7px 8px;
  background: linear-gradient(135deg, rgba(8, 32, 36, 0.88), rgba(10, 41, 49, 0.76));
  box-shadow: inset 0 0 0 1px rgba(138, 229, 208, 0.08), 0 8px 18px rgba(0, 0, 0, 0.25);
}

.faction-overview-meta {
  font-size: 0.78rem;
  color: #b9deda;
}

.faction-overview-bars {
  display: grid;
  gap: 6px;
}

.faction-overview-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid rgba(129, 204, 190, 0.36);
  background: rgba(7, 33, 35, 0.65);
  overflow: hidden;
}

.faction-overview-bar-poi {
  height: 7px;
  opacity: 0.9;
}

.faction-overview-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 10px rgba(255, 255, 255, 0.22);
}

.control-banner,
.control-box,
.poi-control-item,
.action-info {
  border: 1px solid rgba(132, 197, 185, 0.38);
  border-radius: 11px;
  background: rgba(7, 33, 35, 0.78);
  padding: 9px 10px;
  min-width: 0;
}

.region-lore-card {
  border: 1px solid rgba(134, 215, 195, 0.38);
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(116, 227, 195, 0.18), rgba(12, 56, 57, 0.8));
  padding: 9px 10px;
  margin: 8px 0 10px;
  min-width: 0;
}

.region-lore-card strong {
  color: #ecfff9;
  display: block;
  margin-bottom: 4px;
}

.region-lore-card p {
  margin: 0;
  color: #d0ebe5;
  font-size: 0.88rem;
}

.control-banner strong,
.control-box h3 {
  color: #dffff8;
}

.panel-nav {
  display: flex;
  justify-content: flex-start;
}

.panel-back-btn {
  font-weight: 700;
  letter-spacing: 0.01em;
  border-color: rgba(170, 243, 223, 0.62);
  background: linear-gradient(130deg, rgba(14, 64, 62, 0.95), rgba(8, 38, 42, 0.95));
}

.control-box h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}

.control-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.control-row label {
  color: #b8dbd6;
  font-size: 0.84rem;
}

.control-row select {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid rgba(132, 197, 185, 0.45);
  background: rgba(7, 27, 30, 0.95);
  color: #d7f7f0;
  padding: 8px 10px;
}

.faction-choice-grid,
.control-choice-list {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.faction-choice-btn,
.control-choice-item {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(132, 197, 185, 0.55);
  background: rgba(7, 33, 35, 0.8);
  color: #e9fff9;
  padding: 8px 10px;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.control-choice-item .poi-name {
  font-size: 0.8rem;
  color: #b9dfd8;
}

.faction-choice-btn.active,
.control-choice-item.active {
  border-color: rgba(225, 255, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(225, 255, 248, 0.8), 0 0 14px rgba(180, 255, 236, 0.35);
}

.poi-control-list,
.faction-meter {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.ownership-bar {
  display: flex;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(129, 204, 190, 0.35);
  background: rgba(7, 33, 35, 0.7);
}

.ownership-segment {
  height: 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 8px rgba(255, 255, 255, 0.18);
}

.ownership-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ownership-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  border: 1px solid rgba(129, 204, 190, 0.35);
  background: rgba(7, 33, 35, 0.8);
  color: #dcf8f1;
}

.poi-control-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.poi-control-item-rich {
  gap: 10px;
}

.challenge-row {
  grid-template-columns: 1fr;
  gap: 8px;
}

.challenge-duel-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.challenge-vs {
  font-size: 0.74rem;
  color: #9ccac3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.duel-faction-card {
  display: grid;
  grid-template-rows: 52px auto;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.duel-faction-avatar,
.duel-faction-dot {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(182, 245, 231, 0.52);
  box-shadow: 0 0 0 1px rgba(182, 245, 231, 0.2), 0 0 10px rgba(0, 0, 0, 0.35);
}

.duel-faction-dot {
  background: var(--faction-accent, #73ddc0);
}

.duel-faction-name {
  font-size: 0.72rem;
  color: #dbfaf3;
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.poi-control-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.poi-sub {
  font-size: 0.76rem;
  color: #9dc7c0;
  overflow-wrap: anywhere;
}

button.poi-control-item {
  width: 100%;
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
  overflow: hidden;
}

.poi-name {
  color: #dffaf4;
  font-size: 0.87rem;
  overflow-wrap: anywhere;
}

.poi-owner-panel {
  overflow: hidden;
}

.poi-owner-row {
  margin-top: 8px;
}

.poi-owner-subtitle {
  margin-top: 10px;
  font-size: 0.82rem;
  color: #9fcfc7;
  font-weight: 700;
}

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

.poi-challenger-item {
  min-width: 0;
}

.poi-owner-empty {
  margin: 0;
  font-size: 0.82rem;
  color: #9fc8c1;
  grid-column: 1 / -1;
}

.faction-portrait-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  border-radius: 16px;
  border: 1px solid rgba(120, 203, 185, 0.46);
  border-left: 3px solid var(--faction-accent);
  background: linear-gradient(120deg, rgba(7, 33, 35, 0.92), rgba(10, 42, 45, 0.9));
  padding: 7px 10px;
  box-shadow: inset 0 0 0 1px rgba(211, 255, 246, 0.12);
}

.faction-portrait-avatar,
.faction-portrait-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.faction-portrait-avatar {
  object-fit: cover;
  border: 1px solid rgba(210, 255, 247, 0.56);
}

.faction-portrait-dot {
  border: 1px solid rgba(10, 20, 26, 0.48);
  box-shadow: 0 0 0 1px rgba(211, 255, 246, 0.22);
}

.faction-portrait-name {
  font-size: 0.88rem;
  color: #e4fff7;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faction-portrait-chip.is-owner {
  border-color: rgba(216, 255, 246, 0.76);
  box-shadow: inset 0 0 0 1px rgba(229, 255, 249, 0.3), 0 0 12px rgba(116, 227, 195, 0.26);
}

.battle-timeline-entry {
  border: 1px solid rgba(132, 197, 185, 0.38);
  border-radius: 12px;
  background: rgba(7, 33, 35, 0.82);
  padding: 9px 10px;
  display: grid;
  gap: 8px;
}

.battle-timeline-duel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.battle-vs {
  color: #9ec8c1;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.battle-timeline-result {
  font-size: 0.87rem;
  color: #dcfbf4;
  font-weight: 700;
}

.battle-timeline-scenario {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: #a9d0ca;
}

.battle-timeline-meta {
  font-size: 0.75rem;
  color: #8fb9b2;
}

.faction-meter-row {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.8rem;
}

.faction-meter-bar {
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(127, 197, 184, 0.33);
  background: rgba(127, 197, 184, 0.16);
  overflow: hidden;
}

.faction-meter-fill {
  height: 100%;
  border-radius: 999px;
}

#regions.overlay-hidden,
#pois.overlay-hidden,
#threat-arrows.overlay-hidden,
#region-labels.overlay-hidden,
#poi-labels.overlay-hidden {
  display: none;
}

.action-pill {
  min-height: 38px;
  cursor: pointer;
}

.action-pill.active {
  background: rgba(223, 255, 248, 0.9);
  color: #0e3a3d;
}

.action-info {
  margin-top: 8px;
  color: #bfe5de;
  min-height: 42px;
}

.poi-tooltip {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  background: rgba(7, 26, 28, 0.95);
  color: #ddfef8;
  border: 1px solid rgba(132, 237, 212, 0.45);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 0.78rem;
  line-height: 1.3;
  transform: translate(14px, 14px);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.33);
  display: none;
}

.scenario-tooltip {
  position: fixed;
  z-index: 45;
  pointer-events: none;
  max-width: min(420px, calc(100vw - 20px));
  background: rgba(6, 20, 25, 0.97);
  color: #ddfdf6;
  border: 1px solid rgba(129, 228, 204, 0.5);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42);
  display: none;
}

.scenario-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 12, 18, 0.58);
  padding: 14px;
}

.scenario-modal.open {
  display: flex;
}

.scenario-modal-card {
  width: min(680px, 100%);
  max-height: min(86dvh, 820px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(8, 31, 38, 0.98), rgba(6, 22, 31, 0.98));
  border: 1px solid rgba(122, 215, 193, 0.46);
  border-radius: 16px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
  padding: 14px 14px 16px;
  position: relative;
}

.scenario-modal-card h3 {
  margin: 0 28px 8px 0;
  color: #dffef6;
  font-size: 1rem;
}

.scenario-modal-card p,
#scenario-modal-body {
  margin: 0;
  color: #bfe4dc;
  font-size: 0.9rem;
  line-height: 1.45;
}

#scenario-modal-body p + p {
  margin-top: 8px;
}

.scenario-reference-card {
  border: 1px solid rgba(130, 209, 193, 0.36);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(9, 35, 42, 0.92), rgba(8, 29, 36, 0.9));
  padding: 10px;
  display: grid;
  gap: 8px;
}

.scenario-reference-meta {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ccfc8;
}

.scenario-reference-title {
  margin: 0;
  font-size: 0.98rem;
  color: #e8fff7;
  line-height: 1.25;
}

.scenario-reference-rule {
  margin: 0;
  font-size: 0.84rem;
  color: #d2ece7;
  line-height: 1.4;
  white-space: pre-wrap;
}

.scenario-reference-id {
  margin: 0;
  font-size: 0.75rem;
  color: #9cc8c1;
}

#scenario-modal-body .battle-choice-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

#scenario-modal-body .battle-choice {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(132, 197, 185, 0.55);
  background: rgba(7, 33, 35, 0.8);
  color: #e9fff9;
  padding: 8px 10px;
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

#scenario-modal-body .battle-choice.active {
  border-color: rgba(225, 255, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(225, 255, 248, 0.8), 0 0 14px rgba(180, 255, 236, 0.35);
}

#scenario-modal-body .duel-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#scenario-modal-body .battle-choice-duel {
  min-height: 86px;
  justify-content: center;
}

@media (max-width: 720px) {
  #scenario-modal-body .duel-grid {
    grid-template-columns: 1fr;
  }
}

.scenario-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(121, 201, 186, 0.44);
  background: rgba(10, 40, 44, 0.95);
  color: #d7fff5;
  font-size: 1.2rem;
  line-height: 1;
}

@media (min-width: 980px) {
  .app {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr;
  }

  .panel {
    min-height: 0;
  }
}

@media (max-width: 979px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    justify-items: center;
  }

  .app-shell {
    padding:
      calc(6px + env(safe-area-inset-top))
      calc(6px + env(safe-area-inset-right))
      calc(8px + env(safe-area-inset-bottom))
      calc(6px + env(safe-area-inset-left));
    gap: 6px;
    overflow: hidden;
  }

  .map-frame {
    min-height: 0;
    height: auto;
    padding: 4px;
    border-radius: 12px;
  }

  .map-wrap,
  .panel {
    width: min(100%, 760px);
    margin-inline: auto;
  }

  .map-viewport {
    aspect-ratio: auto;
    width: 100%;
    height: min(40dvh, 460px);
    max-height: none;
    border-radius: 10px;
  }

  body[data-viewport-profile="phone"][data-panel-mode="detail"] .map-viewport {
    max-height: 19dvh;
  }

  .panel {
    max-height: none;
    min-height: 0;
    padding: 8px 8px calc(12px + env(safe-area-inset-bottom));
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(8, 33, 37, 0.97), rgba(6, 21, 28, 0.96));
    backdrop-filter: blur(8px);
    overflow-x: hidden;
  }

  .panel::before {
    display: none;
  }

  .faction-meter-row {
    grid-template-columns: 96px 1fr auto;
    gap: 6px;
  }

  .control-choice-item,
  .scenario-chip,
  .poi-control-item {
    min-height: 44px;
  }

  .control-banner,
  .control-box,
  .poi-control-item,
  .action-info,
  .region-lore-card,
  .overview-section {
    max-width: 100%;
    overflow: hidden;
    border-radius: 10px;
    padding: 8px;
    margin-left: 0;
    margin-right: 0;
    min-width: 0;
  }

  .poi-control-item {
    grid-template-columns: 1fr;
  }

  .faction-badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .poi-challenger-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .faction-portrait-avatar,
  .faction-portrait-dot {
    width: 30px;
    height: 30px;
  }

  .faction-portrait-chip {
    border-radius: 12px;
    padding: 6px 8px;
    gap: 7px;
  }

  .faction-portrait-name {
    font-size: 0.83rem;
  }

  .battle-timeline-entry {
    border-radius: 10px;
    padding: 8px;
    gap: 6px;
  }

  .battle-timeline-duel {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 4px;
    align-items: start;
  }

  .battle-vs {
    justify-self: center;
    align-self: center;
  }

  .battle-timeline-result {
    font-size: 0.82rem;
    line-height: 1.28;
  }

  .battle-timeline-scenario {
    font-size: 0.74rem;
  }

  .battle-timeline-meta {
    font-size: 0.71rem;
  }

  .action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    min-width: 0;
  }

  .action-pill {
    width: 100%;
    justify-content: center;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .faction-badge-row {
    width: 100%;
    min-width: 0;
  }

  .faction-badge {
    max-width: 100%;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
  }

  .scenario-chip {
    width: 100%;
    min-height: 42px;
    text-align: center;
    justify-content: center;
  }

  .mobile-section {
    margin-top: 8px;
    border: 1px solid rgba(125, 196, 185, 0.36);
    border-radius: 10px;
    background: rgba(8, 30, 35, 0.72);
    overflow: hidden;
  }

  .mobile-section summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 10px;
    font-size: 0.84rem;
    color: #ccefe8;
    font-weight: 700;
    border-bottom: 1px solid rgba(125, 196, 185, 0.22);
  }

  .mobile-section summary::-webkit-details-marker {
    display: none;
  }

  .mobile-section > :not(summary) {
    margin: 8px;
  }

  .mobile-section.mobile-section-text {
    padding-bottom: 2px;
  }

  .mobile-section.mobile-section-text p {
    margin: 0 10px 8px;
    font-size: 0.84rem;
  }

  .scenario-tooltip {
    display: none !important;
  }

  .scenario-modal {
    align-items: center;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .scenario-modal-card {
    width: min(96vw, 680px);
    max-height: min(88dvh, 860px);
    border-radius: 14px;
    padding: 12px 12px 14px;
  }

  .challenge-duel-strip {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 4px;
    align-items: start;
  }

  .duel-faction-card {
    grid-template-rows: 36px auto;
    gap: 3px;
  }

  .duel-faction-avatar,
  .duel-faction-dot {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  .duel-faction-name {
    font-size: 0.62rem;
    line-height: 1.15;
    max-height: 2.3em;
    overflow: hidden;
  }

  .scenario-reference-card {
    border-radius: 10px;
    padding: 9px;
    gap: 7px;
  }

  .scenario-reference-title {
    font-size: 0.9rem;
  }

  .scenario-reference-rule {
    font-size: 0.8rem;
  }

  .scenario-reference-id {
    font-size: 0.72rem;
  }
}

body[data-viewport-profile="phone"] .masthead {
  padding: 2px 4px 3px;
  gap: 6px;
  align-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(3, 16, 23, 0.22);
  backdrop-filter: blur(3px);
}

body[data-viewport-profile="phone"] .header-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 0.8rem;
  padding: 0;
  flex: 0 0 auto;
}

body[data-viewport-profile="phone"] .kicker {
  display: none;
}

body[data-viewport-profile="phone"] .masthead h1 {
  margin: 0;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

body[data-viewport-profile="phone"] .masthead-main {
  min-width: 0;
  flex: 1;
}

body[data-viewport-profile="phone"] .masthead-actions {
  gap: 3px;
  flex-wrap: nowrap;
  min-width: 0;
}

body[data-viewport-profile="phone"] .header-icon-btn {
  width: 31px;
  height: 31px;
  border-radius: 9px;
}

body[data-viewport-profile="phone"] .subtitle {
  font-size: 0.7rem;
}

body[data-viewport-profile="phone"] .map-frame {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

body[data-viewport-profile="phone"] .map-ornament {
  display: none;
}

body[data-viewport-profile="phone"] .map-viewport {
  border-radius: 0;
  border: 0;
  width: calc(100% + 2px);
  margin-left: -1px;
  margin-right: -1px;
  height: var(--portrait-map-height, 40dvh);
  min-height: 28dvh;
  max-height: 72dvh;
}

body[data-viewport-profile="phone"][data-orientation="portrait"] .portrait-map-resizer {
  display: block;
  width: min(100%, 760px);
  margin: -10px auto -4px;
  height: 20px;
  position: sticky;
  top: 0;
  touch-action: none;
  z-index: 16;
}

body[data-viewport-profile="phone"][data-orientation="portrait"] .portrait-map-resizer::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  width: 98px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(152, 231, 215, 0.5);
  background: rgba(8, 34, 40, 0.42);
  box-shadow: inset 0 0 0 1px rgba(201, 255, 243, 0.14);
}

body[data-viewport-profile="phone"] .app-loading-card {
  width: min(96vw, 350px);
  padding: 16px 14px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .app {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  position: relative;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .app-shell {
  grid-template-rows: minmax(0, 1fr);
  padding:
    calc(4px + env(safe-area-inset-top))
    calc(4px + env(safe-area-inset-right))
    calc(4px + env(safe-area-inset-bottom))
    calc(4px + env(safe-area-inset-left));
  gap: 0;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .masthead {
  position: absolute;
  top: calc(4px + env(safe-area-inset-top));
  right: calc(4px + env(safe-area-inset-right));
  left: auto;
  z-index: 14;
  width: auto;
  padding: 2px;
  background: rgba(4, 17, 24, 0.22);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .masthead-main {
  display: none;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .masthead-actions {
  gap: 3px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .header-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 0.78rem;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .map-wrap {
  min-height: 0;
  grid-column: 1;
  grid-row: 1;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .map-frame {
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .map-viewport {
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  width: 100%;
  margin: 0;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-panel-mode="detail"] .map-viewport {
  max-height: none;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel {
  position: absolute;
  top: calc(40px + env(safe-area-inset-top));
  right: calc(6px + env(safe-area-inset-right));
  bottom: calc(6px + env(safe-area-inset-bottom));
  width: 33.333vw;
  max-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 12px);
  max-height: none;
  border-radius: 11px;
  z-index: 8;
  background: linear-gradient(180deg, rgba(6, 27, 35, 0.86), rgba(4, 19, 27, 0.88));
  backdrop-filter: blur(10px);
  overflow-x: hidden;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-density="compact"] .panel {
  width: 33.333vw;
  background: linear-gradient(180deg, rgba(6, 27, 35, 0.74), rgba(4, 19, 27, 0.76));
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-density="full"] .panel {
  width: 66.666vw;
  background: linear-gradient(180deg, rgba(6, 27, 35, 0.9), rgba(4, 19, 27, 0.92));
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-visible="hidden"] .panel {
  display: none;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 8px;
  padding: 0 0 4px;
  border-bottom: 1px solid rgba(132, 197, 185, 0.24);
}

.panel-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.panel-toolbar-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(145, 224, 208, 0.38);
  background: rgba(8, 32, 36, 0.28);
  color: rgba(220, 255, 248, 0.9);
  font-size: 0.76rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.panel-toolbar-btn.is-active {
  border-color: rgba(201, 255, 242, 0.75);
  background: rgba(16, 56, 62, 0.45);
  color: rgba(233, 255, 250, 0.98);
}

.panel-toolbar-btn:disabled {
  opacity: 0.36;
  cursor: default;
}

.panel-toolbar-back {
  width: 30px;
}

.panel-toolbar-home {
  width: 30px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .landscape-panel-toggle {
  top: calc(8px + env(safe-area-inset-top));
  right: calc(6px + env(safe-area-inset-right));
  width: 26px;
  height: 26px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-visible="shown"] .landscape-panel-toggle {
  display: none;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-visible="hidden"] .landscape-panel-toggle {
  display: inline-block;
  top: 50%;
  transform: translateY(-50%);
  right: calc(6px + env(safe-area-inset-right));
  width: 24px;
  height: 54px;
  border-radius: 10px;
  background: rgba(6, 28, 34, 0.34);
  border-color: rgba(180, 240, 226, 0.46);
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel-title-row {
  padding-right: 6px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-side="left"] .panel {
  left: calc(6px + env(safe-area-inset-left));
  right: auto;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-side="left"] .landscape-panel-toggle {
  left: calc(6px + env(safe-area-inset-left));
  right: auto;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-density="full"] .games-filter-row {
  flex-wrap: nowrap;
}

body[data-viewport-profile="phone"][data-orientation="landscape"][data-landscape-panel-density="full"] .games-filter-row .action-pill {
  flex: 1 1 0;
  justify-content: center;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel .overview-section {
  padding: 6px;
  margin-top: 6px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel .overview-section h3 {
  font-size: 0.96rem;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel .action-pill {
  min-height: 34px;
  font-size: 0.76rem;
  padding: 5px 6px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel .poi-control-item {
  min-height: 38px;
  padding: 6px;
}

body[data-viewport-profile="phone"][data-orientation="landscape"] .panel p {
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.panel-density-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid rgba(145, 224, 208, 0.38);
  background: rgba(8, 32, 36, 0.28);
  color: rgba(220, 255, 248, 0.82);
  font-size: 0.74rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.panel-density-btn.is-active {
  border-color: rgba(201, 255, 242, 0.75);
  background: rgba(16, 56, 62, 0.45);
  color: rgba(233, 255, 250, 0.98);
}

body[data-viewport-profile="tablet"] .map-frame {
  min-height: 56dvh;
}

body[data-viewport-profile="wide"] .app-shell {
  max-width: 1860px;
  margin: 0 auto;
  width: 100%;
}

@media (max-height: 980px) {
  .masthead {
    padding: 6px 12px 7px;
  }

  .kicker {
    font-size: 0.66rem;
  }

  .subtitle {
    font-size: 0.79rem;
  }

  .map-frame {
    min-height: 0;
  }

  .panel {
    padding: 12px 12px 14px;
  }
}
