@font-face {
  font-family: "Golos Text";
  src: url("/static/fonts/GolosText-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c1424;
  --bg-elev: #152238;
  --bg-card: #1a2a44;
  --bg-card-hover: #213454;
  --border: rgba(255, 255, 255, 0.09);
  --text: #f8fafc;
  --muted: #94a3b8;
  --orange: #ff7a1a;
  --orange-soft: rgba(255, 122, 26, 0.16);
  --snow: #60a5fa;
  --snow-soft: rgba(96, 165, 250, 0.16);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.16);
  --red: #f87171;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Golos Text", -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top right, #162847 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 20, 36, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img { height: 28px; width: auto; filter: brightness(0) invert(1); }
.brand-title { font-weight: 700; font-size: 15px; letter-spacing: 0.02em; }
.brand-sub { font-size: 12px; color: var(--muted); }

.top-widgets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.pill.orange { background: var(--orange-soft); border-color: rgba(255, 122, 26, 0.35); color: #ffb37a; }
.pill.snow { background: var(--snow-soft); border-color: rgba(96, 165, 250, 0.35); color: #bae6fd; }
.pill.day { background: rgba(255, 255, 255, 0.06); }

select, input, textarea, button {
  font-family: inherit;
  font-size: 14px;
}

.select-inline {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.nav {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 34, 56, 0.55);
}

.nav button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: 0.15s ease;
}
.nav button:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav button.active {
  background: var(--orange);
  color: #0c1424;
}
.nav .badge {
  margin-left: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.hero-map-wrap {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  background: #09101d;
}
.hero-map-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 74vh;
  object-fit: cover;
}
.city-layer-dim {
  position: relative;
  z-index: 1;
  transition: filter 1.1s ease;
}
.city-layer-bright {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  transition: opacity 1.1s ease;
}
.city-sparkles {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.sparkle-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff7ed 0%, #fbbf24 45%, rgba(255, 122, 26, 0) 75%);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.85);
  animation: twinkle 2.8s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.75); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* Интерактивные зоны зданий без постоянных текстовых плашек */
.building-zone {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 190, 90, 0.14) 0%, rgba(255, 122, 26, 0.04) 52%, transparent 74%);
  border: 1.5px solid transparent;
  border-radius: 26px;
  padding: 0;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
  animation: buildingBreathe 3.4s ease-in-out infinite;
}
@keyframes buildingBreathe {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 166, 61, 0.25)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 166, 61, 0.65)); }
}
.building-zone:hover,
.building-zone:focus-visible {
  outline: none;
  z-index: 9;
  background: radial-gradient(ellipse at center, rgba(255, 200, 100, 0.30) 0%, rgba(255, 122, 26, 0.12) 56%, transparent 78%);
  border-color: rgba(255, 180, 80, 0.72);
  box-shadow: 0 0 28px rgba(255, 140, 36, 0.55), inset 0 0 22px rgba(255, 215, 130, 0.22);
  transform: translate(-50%, -51%) scale(1.02);
}

/* Мягкая светящаяся точка-маячок на здании (показывает кликабельность без текста) */
.building-beacon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #ffd08a;
  box-shadow: 0 0 12px rgba(255, 150, 40, 0.95), 0 0 4px #fff;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.building-beacon::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 2px solid rgba(255, 190, 90, 0.8);
  animation: beaconRing 2.2s ease-out infinite;
}
@keyframes beaconRing {
  0% { transform: scale(0.6); opacity: 0.95; }
  100% { transform: scale(2.1); opacity: 0; }
}
.building-zone:hover .building-beacon {
  transform: translate(-50%, -50%) scale(1.25);
  background: #fff7ed;
}

/* Тултип появляется только при наведении */
.building-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  background: rgba(12, 20, 36, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 122, 26, 0.75);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
  text-align: center;
}
.building-tip strong { display: block; font-size: 13px; }
.building-tip span { display: block; font-size: 11px; color: var(--muted); }
.building-zone:hover .building-tip,
.building-zone:focus-visible .building-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Спотлайт-туториал как в мобильных играх */
.tour-layer {
  position: absolute;
  inset: 0;
  z-index: 25;
  overflow: hidden;
  border-radius: 20px;
}
.tour-spotlight {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 24px;
  border: 2.5px solid #ff9a3c;
  box-shadow: 0 0 0 9999px rgba(5, 10, 20, 0.76), 0 0 36px rgba(255, 140, 36, 0.85);
  transition: left 0.35s ease, top 0.35s ease, width 0.35s ease, height 0.35s ease;
  pointer-events: none;
  animation: spotPulse 1.8s ease-in-out infinite;
}
@keyframes spotPulse {
  0%, 100% { border-color: #ff9a3c; }
  50% { border-color: #fff3d6; }
}
.tour-card {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  width: min(520px, calc(100vw - 32px));
  background: linear-gradient(180deg, #162642 0%, #0f1b30 100%);
  border: 1.5px solid rgba(255, 122, 26, 0.7);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
}
.tour-card h3 { margin: 4px 0 6px; font-size: 18px; }
.tour-card p { margin: 0 0 14px; color: #cbd5e1; font-size: 14px; line-height: 1.45; }
.tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.pill.clickable {
  cursor: pointer;
  transition: 0.15s ease;
}
.pill.clickable:hover {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(5, 10, 20, 0.76);
  backdrop-filter: blur(7px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal-window {
  position: relative;
  width: 100%;
  max-width: 1060px;
  max-height: 88vh;
  background: linear-gradient(180deg, #132036 0%, #0e1729 100%);
  border: 1px solid rgba(255, 122, 26, 0.32);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.16s ease-out;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(12, 20, 36, 0.88);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.15s ease;
}
.modal-close:hover {
  background: var(--orange);
  color: #0c1424;
  border-color: var(--orange);
}

.modal-body {
  overflow-y: auto;
  padding: 24px 26px 26px;
}
.modal-body .section-head {
  padding-right: 46px;
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(12, 20, 36, 0.86);
  backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 122, 26, 0.75);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.hotspot:hover {
  transform: translate(-50%, -56%) scale(1.04);
  background: var(--orange);
  color: #0c1424;
  box-shadow: 0 0 28px rgba(255, 122, 26, 0.55);
}
.hotspot strong { display: block; font-size: 13px; letter-spacing: 0.02em; }
.hotspot span { display: block; font-size: 11px; opacity: 0.82; }

.hotspot-mailbox {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 98px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.hotspot-mailbox:hover {
  transform: translate(-50%, -52%) scale(1.04);
  border-color: rgba(255, 122, 26, 0.75);
  box-shadow: 0 0 24px rgba(255, 122, 26, 0.45);
}
.hotspot-mailbox .mb-label {
  background: rgba(12, 20, 36, 0.88);
  backdrop-filter: blur(6px);
  border: 1.5px solid rgba(255, 122, 26, 0.8);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateY(10px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
  transition: background 0.18s ease, color 0.18s ease;
}
.hotspot-mailbox:hover .mb-label {
  background: var(--orange);
  color: #0c1424;
}

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.section-head h2 { margin: 0; font-size: 24px; }
.section-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 15px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  background: var(--orange);
  color: #0c1424;
  transition: 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: var(--border); }
.btn.snow { background: var(--snow); color: #0c1424; }
.btn.green { background: var(--green); color: #062111; }
.btn.danger { background: rgba(248, 113, 113, 0.16); color: #fecaca; border-color: rgba(248, 113, 113, 0.35); }
.btn.sm { padding: 6px 11px; font-size: 13px; }

.input, .textarea {
  width: 100%;
  background: rgba(12, 20, 36, 0.65);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
}
.textarea { min-height: 76px; resize: vertical; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tag.open { background: var(--orange-soft); color: #ffb37a; }
.tag.approved { background: var(--green-soft); color: #86efac; }
.tag.pending { background: rgba(250, 204, 21, 0.18); color: #fde047; }
.tag.rejected { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }
.tag.locked { background: rgba(148, 163, 184, 0.15); color: var(--muted); }
.tag.snow { background: var(--snow-soft); color: #bae6fd; }

.advent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.advent-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: 0.15s ease;
}
.advent-cell.available { border-color: rgba(255, 122, 26, 0.6); background: rgba(255, 122, 26, 0.1); }
.advent-cell.opened { border-color: rgba(34, 197, 94, 0.45); background: rgba(34, 197, 94, 0.08); }
.advent-cell.locked { opacity: 0.45; cursor: not-allowed; }
.advent-day { font-size: 24px; font-weight: 800; }

.progress-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 10px 0 14px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7a1a, #fbbf24);
  border-radius: 999px;
}

.quiz-options { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.quiz-opt {
  text-align: left;
  background: rgba(12, 20, 36, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.quiz-opt:hover { border-color: var(--orange); background: rgba(255, 122, 26, 0.12); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  background: #0f1d35;
  border: 1px solid var(--orange);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  max-width: 360px;
  font-size: 14px;
  display: none;
}
.toast.show { display: block; }

.ach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}
.ach-chip.unlocked {
  border-color: rgba(255, 122, 26, 0.5);
  background: var(--orange-soft);
}

.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }

.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 14px;
  align-items: start;
}
.chat-sidebar { display: flex; flex-direction: column; gap: 8px; }
.chat-chan {
  text-align: left;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: 0.15s ease;
}
.chat-chan:hover { background: var(--bg-card-hover); }
.chat-chan.active { border-color: var(--orange); background: rgba(255, 122, 26, 0.12); }
.chat-chan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 14px; }
.chat-chan-desc { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.chat-main { display: flex; flex-direction: column; min-height: 460px; max-height: 68vh; }
.chat-feed {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 2px;
  margin-bottom: 10px;
}
.chat-msg {
  background: rgba(12, 20, 36, 0.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
}
.chat-msg.mine { border-color: rgba(255, 122, 26, 0.4); background: rgba(255, 122, 26, 0.08); }
.chat-msg-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.chat-msg-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.45; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea { margin: 0; min-height: 46px; max-height: 120px; }

@media (max-width: 720px) {
  .hotspot { padding: 5px 8px; }
  .hotspot strong { font-size: 11px; }
  .hotspot span { display: none; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-main { max-height: 60vh; }
}

/* ===== Полноэкранный игровой экран (Вариант 2: Остров + мини-док) ===== */
body.city-mode {
  overflow: hidden;
  height: 100dvh;
  background: #070d1b;
}
body.city-mode .topbar {
  display: none;
}
body.city-mode .container {
  max-width: none;
  margin: 0;
  padding: 0;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

.city-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: #070d1b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.city-viewport::-webkit-scrollbar { display: none; }

.city-stage {
  position: relative;
  flex-shrink: 0;
  /* Точные пропорции city_hero.webp (1440x804) — хотспоты всегда совпадают со зданиями */
  width: max(100vw, calc(100dvh * 1440 / 804));
  height: max(100dvh, calc(100vw * 804 / 1440));
  background: #09101d;
}
.city-stage .city-layer-dim,
.city-stage .city-layer-bright {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: fill;
  display: block;
}
.city-stage .tour-layer {
  border-radius: 0;
}

.city-vignette {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(6, 11, 23, 0.62) 0%,
    rgba(6, 11, 23, 0) 20%,
    rgba(6, 11, 23, 0) 80%,
    rgba(6, 11, 23, 0.56) 100%
  );
}

.city-snow {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 12;
  pointer-events: none;
}

/* HUD-слой поверх карты */
.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.hud-layer button,
.hud-layer select,
.hud-layer label,
.hud-layer a,
.hud-interactive {
  pointer-events: auto;
}

/* Левый верх: компактный логотип */
.hud-brand {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  left: 18px;
  padding: 7px 13px;
  border-radius: 12px;
  background: rgba(10, 18, 34, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.hud-brand img {
  height: 18px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
}

/* Центральный остров сверху */
.hud-island {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 27, 50, 0.88), rgba(10, 17, 34, 0.92));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 196, 110, 0.36);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.54), inset 0 1px 0 rgba(255, 224, 170, 0.22);
  max-width: calc(100vw - 24px);
}
.island-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  color: #fff;
  transition: transform 0.14s ease, filter 0.14s ease;
  white-space: nowrap;
}
.island-seg:hover { filter: brightness(1.12); transform: translateY(-1px); }
.island-seg.mandarin {
  background: rgba(255, 122, 26, 0.24);
  border-color: rgba(255, 138, 43, 0.48);
}
.island-seg.snow {
  background: rgba(96, 165, 250, 0.22);
  border-color: rgba(125, 190, 255, 0.44);
}
.island-seg .sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #fdba74;
}
.island-div {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin: 0 2px;
  flex-shrink: 0;
}
.island-day {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
}
.island-day .timer {
  font-size: 11.5px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.island-select {
  background: transparent;
  color: #f8fafc;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 2px;
  outline: none;
}
.island-select option {
  background: #101b32;
  color: #f8fafc;
}
.island-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.island-user:hover { background: rgba(255, 255, 255, 0.13); }
.island-av {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 122, 26, 0.25);
  border: 1px solid rgba(255, 160, 70, 0.5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* Правый верх: утилитарные кнопки */
.hud-actions {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.hud-btn {
  position: relative;
  height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 18, 34, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.hud-btn:hover {
  background: rgba(20, 34, 62, 0.88);
  border-color: rgba(255, 196, 110, 0.45);
}
.hud-btn.sq {
  width: 36px;
  padding: 0;
  justify-content: center;
}
.hud-badge {
  background: #ff7a1a;
  color: #0c1424;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
}

/* Нижний мини-док (десктоп + мобильный контейнер) */
.hud-bottom-wrap {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 24px);
}
.hud-event-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  border-radius: 999px;
  background: rgba(10, 18, 34, 0.84);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 196, 110, 0.28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.52);
}
.dock-bell {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.dock-bell:hover { background: rgba(255, 255, 255, 0.16); }
.dock-bell.has-dot::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff7a1a;
  border: 1.5px solid #0c1424;
}
.dock-event-text {
  font-size: 13px;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}
.dock-event-text strong { color: #fff; }
.dock-event-sub { display: none; }
.dock-cta {
  padding: 7px 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #ff8a2b, #ff6b00);
  color: #0c1424;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(255, 122, 26, 0.35);
  transition: filter 0.15s ease;
}
.dock-cta:hover { filter: brightness(1.08); }

/* Мобильный подбар и нижний таб-бар (скрыты на десктопе) */
.hud-mobile-subbar,
.mobile-tabbar {
  display: none;
}

/* Адаптация под узкие экраны и вертикальные телефоны */
@media (max-width: 1080px) {
  .hud-brand { display: none; }
  .hud-btn .btn-txt { display: none; }
  .hud-btn { padding: 0 10px; }
}

@media (max-width: 760px) {
  .city-viewport {
    justify-content: flex-start;
  }
  .city-vignette {
    background: linear-gradient(
      180deg,
      rgba(6, 11, 23, 0.76) 0%,
      rgba(6, 11, 23, 0) 24%,
      rgba(6, 11, 23, 0) 72%,
      rgba(6, 11, 23, 0.86) 100%
    );
  }

  /* Верхняя строка 1: Остров во всю ширину */
  .hud-island {
    top: max(10px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    border-radius: 20px;
    justify-content: space-between;
    padding: 6px 8px;
  }
  .hud-island .island-day,
  .hud-island .island-div {
    display: none;
  }
  .hud-island .island-user {
    order: -1;
    padding: 4px 9px 4px 5px;
    font-size: 12.5px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hud-island .island-counters {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .island-seg {
    padding: 5px 10px;
    font-size: 12.5px;
  }
  .island-seg .sub { font-size: 10.5px; }

  /* Десктопные кнопки справа скрываем — они переезжают в .hud-mobile-subbar */
  .hud-actions { display: none; }

  /* Верхняя строка 2: дата слева + компактные иконки справа */
  .hud-mobile-subbar {
    position: fixed;
    top: calc(max(10px, env(safe-area-inset-top)) + 52px);
    left: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .m-day-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: #f8fafc;
    background: rgba(10, 18, 34, 0.74);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.13);
  }
  .m-day-chip .timer {
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
  }
  .m-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .m-sq-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(10, 18, 34, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }
  .m-sq-btn .hud-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 9.5px;
    padding: 0 4px;
  }

  /* Нижний блок на мобилке: карточка события + таб-бар */
  .hud-bottom-wrap {
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    transform: none;
    max-width: none;
    align-items: stretch;
  }
  .hud-event-dock {
    border-radius: 18px;
    padding: 9px 10px 9px 12px;
    justify-content: space-between;
  }
  .dock-event-text {
    flex: 1;
    min-width: 0;
    max-width: none;
    white-space: normal;
    line-height: 1.25;
    font-size: 12px;
  }
  .dock-event-text .dock-inline-label { display: none; }
  .dock-event-text strong {
    display: block;
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dock-event-sub {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
  }
  .dock-cta {
    padding: 7px 11px;
    font-size: 11.5px;
    flex-shrink: 0;
  }

  .mobile-tabbar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 7px 4px;
    border-radius: 18px;
    background: rgba(10, 18, 34, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  }
  .m-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
  }
  .m-tab .ico { font-size: 16px; line-height: 1.1; }
  .m-tab.active { color: #ff9f43; }

  /* Модалка на телефоне — аккуратный bottom-sheet / full-width */
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal-window { max-height: 86dvh; border-radius: 20px; }
  .modal-body { padding: 18px 16px 22px; }
  .tour-card { bottom: 14px; padding: 14px 16px; }
  .toast { left: 12px; right: 12px; bottom: 148px; max-width: none; }
}

/* ===== Экран регистрации и входа ===== */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(10, 18, 34, 0.7);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.auth-tab {
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.auth-tab.active {
  background: var(--orange);
  color: #0c1424;
}
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.field-hint {
  font-size: 12.5px;
  line-height: 1.4;
  color: #cbd5e1;
  margin: -4px 0 14px;
}
.field-hint.important {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 122, 26, 0.12);
  border: 1px solid rgba(255, 138, 43, 0.34);
  color: #fed7aa;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.avatar-btn {
  height: 58px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: rgba(12, 20, 36, 0.65);
  font-size: 32px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.avatar-btn:hover {
  border-color: rgba(255, 146, 60, 0.6);
  transform: translateY(-2px);
}
.avatar-btn.selected {
  border-color: var(--orange);
  background: rgba(255, 122, 26, 0.22);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.2);
  transform: scale(1.04);
}
@media (max-width: 760px) {
  .auth-grid { grid-template-columns: 1fr !important; }
  .auth-hero img { max-height: 190px; }
  .avatar-btn { height: 54px; font-size: 28px; }
}
