/* =========================================================
   Nestworld — design system
   Palette: daylight sky + meadow greens + volt lime + ultraviolet + signal coral
   Type: Unbounded (display) · Manrope (text) · JetBrains Mono (numbers)
   ========================================================= */
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Unbounded"; src: url("../fonts/unbounded-latin-900-normal.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f5f8fd;
  --bg-2: #eaf1fb;
  --bg-3: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --line: rgba(23, 33, 58, 0.09);
  --line-2: rgba(23, 33, 58, 0.16);
  --text: #17213a;
  --muted: #5b6585;
  --dim: #8a92ad;
  --volt: #c6f432;
  --volt-ink: #17210a;
  --accent: #6a3cf0;
  --violet: #7c4dff;
  --cyan: #0ea5d8;
  --coral: #ff5d73;
  --green: #22a06b;
  --gold: #ffb020;
  --silver: #b9c4d6;
  --bronze: #e98a4b;
  --radius: 18px;
  --notch: 10px;
  --header-h: 68px;
  --font-display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --font-text: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --shadow: 0 18px 50px -18px rgba(30, 50, 110, 0.28), 0 2px 6px rgba(30, 50, 110, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 90% -10%, rgba(124, 77, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 25%, rgba(14, 165, 216, 0.10), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(95, 199, 101, 0.10), transparent 60%);
  color: var(--text);
  font: 400 16px/1.6 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #4a1fd6; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 900; }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: var(--font-mono); font-size: 0.92em; background: rgba(106, 60, 240, 0.08); color: var(--accent); padding: 0.1em 0.4em; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--volt); color: var(--volt-ink); padding: 10px 14px; border-radius: 10px; font-weight: 800; }
.skip-link:focus { top: 12px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.mono, .num { font-family: var(--font-mono); }
.fine { font-size: 0.82rem; color: var(--muted); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.eyebrow { font: 700 0.72rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent); margin: 0 0 0.9rem; display: flex; align-items: center; gap: 8px; }
.hl { color: var(--accent); text-shadow: none; background: linear-gradient(90deg, #6a3cf0, #0ea5d8); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- buttons ---------- */
.btn {
  --c: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  font: 800 0.92rem/1 var(--font-text); letter-spacing: 0.01em;
  color: var(--c); text-decoration: none; cursor: pointer;
  border: 0; border-radius: 0;
  clip-path: polygon(var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch));
  transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:focus-visible { outline-offset: 2px; border-radius: 0; }
.btn-volt { background: var(--volt); color: var(--volt-ink); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18); }
.btn-volt:hover { background: #d4ff4f; color: var(--volt-ink); filter: drop-shadow(0 6px 12px rgba(120, 170, 0, 0.35)); }
.btn-ghost { background: rgba(23, 33, 58, 0.07); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-ghost:hover { background: rgba(124, 77, 255, 0.12); color: var(--accent); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 0.84rem; --notch: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: rgba(255, 255, 255, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid transparent; transition: border-color 0.2s, background 0.2s; }
.site-header.is-scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, 0.94); }
.header-inner { height: 100%; display: flex; align-items: center; gap: 24px; width: min(1440px, 100% - 32px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark { width: 32px; height: 32px; filter: drop-shadow(0 4px 8px rgba(30, 50, 110, 0.25)); }
.brand-name { font: 900 1.08rem/1 var(--font-display); letter-spacing: 0.02em; }
.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 8px 12px; border-radius: 10px; transition: color 0.15s, background 0.15s; }
.main-nav a:hover { color: var(--text); background: rgba(23, 33, 58, 0.06); }
.main-nav a[aria-current="page"] { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; width: 44px; height: 44px; border: 0; background: rgba(23, 33, 58, 0.06); border-radius: 12px; cursor: pointer; padding: 0 12px; flex-direction: column; justify-content: center; gap: 4px; }
.nav-toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.demo-banner { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 16px; font-size: 0.82rem; color: #3a2600; background: repeating-linear-gradient(-45deg, #ffe08a 0 14px, #ffe9a8 14px 28px); text-align: center; }
.demo-banner[hidden] { display: none; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #1a1300; flex: none; animation: blink 1.4s infinite; }

/* ---------- map stage ---------- */
.map-stage {
  position: relative; display: grid; grid-template: 1fr / 1fr;
  height: calc(100svh - var(--header-h)); min-height: 600px; max-height: 1000px;
  overflow: hidden; border-bottom: 1px solid var(--line);
  background: #5fb8ec;
}
.map-stage > * { grid-area: 1 / 1; }
.map-canvas { position: relative; z-index: 0; min-height: 0; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.map-svg:active { cursor: grabbing; }
.map-ocean, .map-waves { pointer-events: all; }
.map-sphere { fill: rgba(255, 255, 255, 0.12); stroke: rgba(255, 255, 255, 0.75); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.map-graticule { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.6; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.country { stroke: #ffffff; stroke-width: 0.7; stroke-linejoin: round; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill 0.4s ease; }
.country:hover { filter: brightness(0.94) saturate(1.25); stroke-width: 1.4; }
.country.is-selected { stroke: var(--accent); stroke-width: 2.6; filter: saturate(1.2) brightness(1.03); }
.tiny { stroke: #fff; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.tiny.is-selected { stroke: var(--accent); stroke-width: 2.4; }
.country-label { font-family: var(--font-text); font-weight: 800; fill: #23314f; stroke: rgba(255, 255, 255, 0.9); paint-order: stroke; stroke-linejoin: round; letter-spacing: 0.04em; text-transform: uppercase; pointer-events: none; opacity: 0; transition: opacity 0.25s; }
.country-label.is-on { opacity: 0.85; }
.mini-house { cursor: pointer; transition: filter 0.15s; }
.mini-house:hover { filter: drop-shadow(0 0 2px #fff) brightness(1.1); }

.marker { cursor: pointer; }
.marker-inner { transition: transform 0.25s ease; }
.marker-hex { stroke: var(--accent); stroke-width: 1.6; }
.marker.is-top .marker-hex { stroke: #ffffff; stroke-width: 2; }
.marker-glow { fill: rgba(23, 33, 58, 0.28); transform: translateY(2px); filter: url(#nw-glow); }
.marker-roof { fill: none; stroke: var(--coral); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.marker-count { font: 700 10px var(--font-mono); fill: #17213a; pointer-events: none; }
.marker-count.is-hidden { display: none; }
.marker:hover .marker-hex, .marker.is-selected .marker-hex { stroke: var(--coral); stroke-width: 2.6; }
.map-markers.is-faded .marker { opacity: 0.6; transition: opacity 0.2s; }
.map-markers.is-faded .marker:hover, .map-markers.is-faded .marker.is-selected { opacity: 0.85; }
.marker.is-bump .marker-inner > * { animation: bump 0.8s cubic-bezier(.3,1.8,.5,1); transform-box: fill-box; transform-origin: center; }
.fx-ring { fill: none; stroke: #ffffff; stroke-width: 2.5; animation: sonar 1.6s ease-out forwards; transform-box: fill-box; transform-origin: center; opacity: 0; }
.fx-drop { animation: drop 1.9s cubic-bezier(.25,1.6,.45,1) forwards; }
@keyframes sonar { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(6); opacity: 0; } }
@keyframes drop { 0% { transform: translateY(-60px); opacity: 0; } 25% { opacity: 1; } 45% { transform: translateY(-14px); } 80% { transform: translateY(-14px); opacity: 1; } 100% { transform: translateY(-30px); opacity: 0; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes blink { 50% { opacity: 0.25; } }

.map-loading { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: #fff; font-weight: 700; gap: 16px; z-index: 3; }
.loader-hex { width: 54px; height: 54px; margin: 0 auto; background: #fff; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); animation: spin 1.4s cubic-bezier(.6,0,.4,1) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.map-tooltip { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; min-width: 180px; padding: 10px 12px; background: rgba(255, 255, 255, 0.97); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); opacity: 0; transition: opacity 0.12s; font-size: 0.85rem; }
.map-tooltip.is-visible { opacity: 1; }
.tt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tt-flag { font-size: 1.2rem; }
.tt-row { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-family: var(--font-mono); font-size: 0.78rem; }
.tt-rank { color: var(--accent); }
.tt-empty { font-family: var(--font-text); }
.tt-tier { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tt-tier span { font: 700 0.66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; color: #17213a; padding: 4px 7px; border-radius: 6px; background: var(--tc); box-shadow: inset 0 0 0 1px rgba(23, 33, 58, 0.12); }
.tt-tier em { font-style: normal; font-size: 0.72rem; color: var(--muted); }
.tt-bar { height: 6px; border-radius: 4px; background: rgba(23, 33, 58, 0.08); margin-top: 6px; overflow: hidden; }
.tt-bar i { display: block; height: 100%; background: linear-gradient(90deg, #a3e07f, #25a374); border-radius: 4px; }

/* HUD */
.hud { z-index: 2; margin: 20px; }
.glass, .hud-intro, .hud-search .search-box, .hud-stats, .hud-legend, .hud-feed, .hud-controls {
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow);
}
.hud-intro { align-self: start; justify-self: start; max-width: 420px; padding: 24px 26px; border-radius: var(--radius); position: relative; overflow: hidden; }
.hud-intro::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--green), var(--violet)); }
.hud-intro h1 { margin-bottom: 0.4em; }
.hud-sub { color: var(--muted); margin-bottom: 18px; }
.hud-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.hud-stats { align-self: end; justify-self: start; display: flex; border-radius: 16px; overflow: hidden; }
.stat-chip { padding: 14px 20px; display: flex; flex-direction: column; gap: 2px; min-width: 120px; }
.stat-chip + .stat-chip { border-left: 1px solid var(--line); }
.stat-num { font: 700 1.5rem/1.1 var(--font-mono); color: var(--text); }
.stat-chip:first-child .stat-num { color: var(--green); }
.stat-lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

.hud-search { align-self: start; justify-self: end; width: 330px; position: relative; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 48px; background: transparent; border: 0; color: var(--text); font: 600 0.95rem var(--font-text); outline: none; }
.search-box:focus-within { border-color: var(--accent); }
.search-results { list-style: none; margin: 8px 0 0; padding: 6px; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); max-height: 360px; overflow: auto; }
.search-results li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.search-results li em { margin-left: auto; font: 500 0.75rem var(--font-mono); color: var(--muted); font-style: normal; white-space: nowrap; }
.search-results li:hover, .search-results li[aria-selected="true"] { background: rgba(124, 77, 255, 0.1); }
.search-results .sr-none { color: var(--muted); cursor: default; }
.sr-flag { font-size: 1.2rem; }

.hud-controls { align-self: end; justify-self: end; margin-bottom: 92px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; }
.ctrl { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: var(--text); font: 700 1.3rem/1 var(--font-mono); cursor: pointer; }
.ctrl + .ctrl { border-top: 1px solid var(--line); }
.ctrl:hover { background: rgba(124, 77, 255, 0.1); color: var(--accent); }

.hud-legend { align-self: end; justify-self: end; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border-radius: 14px; max-width: 560px; font-size: 0.74rem; color: var(--muted); }
.legend-title { font: 700 0.66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--text); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-item i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(23, 33, 58, 0.18); }
.legend-item em { font-style: normal; font-family: var(--font-mono); color: var(--dim); }

.hud-feed { align-self: end; justify-self: start; margin-bottom: 108px; width: 420px; padding: 12px; border-radius: 16px; }
.hud-feed:empty { display: none; }
.feed-title { font: 700 0.66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 2px 4px 8px; }
.feed-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; background: transparent; color: var(--text); text-align: left; border-radius: 10px; cursor: pointer; font: inherit; }
.feed-item:hover { background: rgba(23, 33, 58, 0.06); }
.feed-item:first-of-type { animation: slideIn 0.5s ease; }
.feed-item span { display: flex; flex-direction: column; min-width: 0; }
.feed-item strong { font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-item em { font-style: normal; font-size: 0.74rem; color: var(--muted); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } }

/* ---------- country panel ---------- */
.panel { background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line-2); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.country-panel { z-index: 5; justify-self: end; align-self: stretch; width: 410px; margin: 16px; border-radius: 22px; position: relative; display: flex; flex-direction: column; min-height: 0; transform: translateX(110%); opacity: 0; transition: transform 0.35s cubic-bezier(.2,.9,.3,1), opacity 0.25s; }
.country-panel.is-open { transform: none; opacity: 1; }
.country-panel[hidden] { display: none; }
.panel-open .hud-feed, .panel-open .hud-search, .panel-open .hud-controls, .panel-open .hud-legend { visibility: hidden; opacity: 0; }
.panel-grip { display: none; }
.panel-scroll { overflow-y: auto; padding: 22px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.panel-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 12px; border: 0; background: rgba(23, 33, 58, 0.08); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.panel-close:hover { background: var(--coral); color: #fff; }
.cp-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; padding-right: 40px; }
.cp-flag { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.cp-head h2 { font-size: 1.35rem; margin: 0 0 6px; }
.cp-sub { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; }
.cp-sub strong { color: var(--text); }
.tier-pill { display: inline-block; font: 700 0.64rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; padding: 5px 8px; border-radius: 6px; color: #17213a; background: var(--tc); box-shadow: inset 0 0 0 1px rgba(23, 33, 58, 0.15); vertical-align: middle; }
.tier-pill.tier-0 { color: var(--muted); }
.tier-pill.tier-4, .tier-pill.tier-5 { color: #fff; }
.cp-stats { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cp-stat { background: rgba(23, 33, 58, 0.04); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-height: 84px; }
.cp-stat .num { font-size: 1.25rem; font-weight: 700; }
.cp-stat.big .num { font-size: 1.9rem; color: var(--green); }
.cp-stat .num.up { color: var(--cyan); }
.cp-stat .lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.ring-stat { align-items: flex-start; }
.ring { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(23, 33, 58, 0.08); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray 0.8s; }
.ring-txt { font: 700 1.05rem var(--font-mono); }
.cp-block { background: rgba(23, 33, 58, 0.03); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.cp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.84rem; font-weight: 700; margin-bottom: 8px; }
.cp-row.small { font-size: 0.74rem; color: var(--muted); margin: 8px 0 0; font-weight: 600; }
.cp-row h3 { margin: 0; font-size: 0.95rem; }
.progress { height: 12px; border-radius: 8px; background: rgba(23, 33, 58, 0.07); overflow: hidden; position: relative; }
.progress i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #a3e07f, var(--tc, var(--green))); position: relative; transition: width 0.8s cubic-bezier(.2,.9,.3,1); min-width: 6px; }
.progress i::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(23, 33, 58, 0.18) 0 6px, transparent 6px 12px); animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 17px 0; } }
.cp-rival { margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(90deg, #fff0f2, #f3eeff); border: 1px solid rgba(255, 93, 115, 0.35); font-size: 0.88rem; }
.spark { width: 100%; height: 56px; display: block; }
.spark rect { fill: #a3e07f; }
.spark rect.today { fill: var(--green); }
.cp-founders { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.mini-res { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(23, 33, 58, 0.03); color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.mini-res:hover { border-color: var(--accent); }
.mini-res .lbl { grid-column: 1 / -1; font: 700 0.62rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: #b7791f; margin-bottom: 6px; }
.mini-res svg { grid-row: 2 / 4; }
.mini-res strong { font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-res em { font-style: normal; font-size: 0.72rem; color: var(--muted); }
.cp-hood h3 { font-size: 1rem; }
.hood-search { width: 100%; height: 42px; padding: 0 12px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: #ffffff; color: var(--text); font: 600 0.88rem var(--font-text); }
.hood-search:focus { border-color: var(--accent); outline: none; }
.hood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-bottom: 10px; }
.hood-card { display: flex; flex-direction: column; align-items: center; padding: 8px 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, #e3f4ff, #ffffff 80%); color: var(--text); cursor: pointer; min-width: 0; font: inherit; transition: transform 0.15s, border-color 0.15s; }
.hood-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.hood-card strong { font-size: 0.74rem; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hood-card em { font: 500 0.68rem var(--font-mono); color: var(--muted); font-style: normal; }
.hood-none { grid-column: 1 / -1; color: var(--muted); font-size: 0.88rem; }
.cp-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.cp-empty { text-align: center; padding: 10px 6px; }
.cp-empty-art { opacity: 0.45; filter: grayscale(0.6); }
.cp-empty p { color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-alt { background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 36px; }

/* rankings */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(23, 33, 58, 0.05); border: 1px solid var(--line); margin-bottom: 30px; }
.tab { border: 0; background: transparent; color: var(--muted); font: 800 0.85rem var(--font-text); padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.tab.is-active { background: var(--accent); color: #fff; box-shadow: 0 6px 14px -6px rgba(106, 60, 240, 0.6); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; margin-bottom: 26px; }
.podium-card { --pc: var(--silver); position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 28px 18px 0; border: 1px solid var(--line); border-radius: 22px 22px 0 0; background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 16%, transparent), rgba(23, 33, 58, 0.02) 75%); color: var(--text); cursor: pointer; font: inherit; overflow: hidden; transition: transform 0.2s; }
.podium-card:hover { transform: translateY(-4px); }
.podium-card.place-1 { --pc: var(--gold); padding-top: 40px; box-shadow: 0 20px 50px -20px rgba(255, 176, 32, 0.55); }
.podium-card.place-3 { --pc: var(--bronze); }
.medal { position: relative; width: 48px; height: 48px; display: grid; place-items: center; }
.medal svg { position: absolute; inset: 0; fill: var(--pc); filter: drop-shadow(0 0 12px color-mix(in srgb, var(--pc) 60%, transparent)); }
.medal b { position: relative; font: 900 1.15rem var(--font-display); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pc-flag { font-size: 3rem; line-height: 1.1; }
.pc-name { font: 700 1.05rem var(--font-display); }
.pc-count { color: var(--muted); font-size: 0.85rem; }
.pc-count .num { color: var(--text); font-size: 1.35rem; font-weight: 700; }
.pc-base { display: block; width: calc(100% + 36px); height: 26px; margin-top: 14px; background: var(--pc); opacity: 0.85; }
.place-1 .pc-base { height: 52px; }
.place-2 .pc-base { height: 36px; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board-row { width: 100%; display: grid; grid-template-columns: 44px 36px minmax(0, 1.4fr) minmax(60px, 1fr) 80px 92px; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(23, 33, 58, 0.025); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.board-row:hover { background: #ffffff; border-color: rgba(124, 77, 255, 0.45); box-shadow: var(--shadow); }
.br-rank { font: 700 0.95rem var(--font-mono); color: var(--muted); }
.br-flag { font-size: 1.5rem; }
.br-name { font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.br-bar { height: 8px; border-radius: 6px; background: rgba(23, 33, 58, 0.06); overflow: hidden; }
.br-bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #a3e07f, #25a374); }
.br-count { font: 700 1rem var(--font-mono); text-align: right; }
.br-delta { font: 500 0.78rem var(--font-mono); color: var(--dim); text-align: right; }
.br-delta.up { color: var(--green); }
.board-empty { padding: 30px; text-align: center; border: 1px dashed var(--line-2); border-radius: 18px; display: grid; gap: 6px; color: var(--muted); }
.board-empty strong { color: var(--text); font-family: var(--font-display); }
.board-more { text-align: center; margin-top: 20px; }

/* how to play */
.steps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: s; }
.step { position: relative; padding: 24px; border-radius: 22px; border: 1px solid var(--line); background: rgba(23, 33, 58, 0.03); overflow: hidden; }
.step::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; background: radial-gradient(circle, rgba(14, 165, 216, 0.18), transparent 70%); }
.step-num { font: 900 0.8rem var(--font-mono); color: var(--accent); letter-spacing: 0.1em; margin-bottom: 14px; }
.step-art svg { width: 72px; height: 72px; margin-bottom: 14px; }
.step p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.tier-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.tier-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, color-mix(in srgb, var(--tc) 30%, transparent), transparent 70%); font-size: 0.8rem; color: var(--muted); }
.tier-card strong { color: var(--text); font-family: var(--font-display); font-size: 0.9rem; }
.tier-gem { width: 22px; height: 22px; background: var(--tc); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); margin-bottom: 6px; box-shadow: 0 0 20px var(--tc); }

/* builder */
.builder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center; margin-bottom: clamp(56px, 8vw, 100px); }
.builder-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 18px; }
.field { display: grid; gap: 6px; font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #ffffff; color: var(--text); font: 600 1rem var(--font-text); text-transform: none; letter-spacing: 0; }
.field textarea { padding: 12px 14px; min-height: 110px; resize: vertical; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.field select option { background: #fff; color: var(--text); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15); }
.builder-traits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.builder-traits div { padding: 10px 12px; border-radius: 12px; background: rgba(23, 33, 58, 0.04); border: 1px solid var(--line); }
.builder-traits dt { font: 700 0.64rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.builder-traits dd { margin: 2px 0 0; font-weight: 700; display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid rgba(255, 255, 255, 0.3); }
.builder-stage, .hd-stage { position: relative; display: grid; place-items: center; min-height: 380px; border-radius: 28px; background: linear-gradient(180deg, #7cc8f5 0%, #b8e4ff 55%, #e6f6ff 100%); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.builder-stage::before, .hd-stage::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(60px 22px at 18% 22%, #fff 60%, transparent 62%), radial-gradient(40px 18px at 26% 18%, #fff 60%, transparent 62%), radial-gradient(70px 24px at 78% 14%, #fff 60%, transparent 62%), radial-gradient(44px 18px at 86% 10%, #fff 60%, transparent 62%), radial-gradient(120px 60px at 92% 6%, rgba(255, 228, 120, 0.9) 30%, transparent 32%); opacity: 0.9; animation: drift 30s linear infinite alternate; }
@keyframes drift { to { transform: translateX(-30px); } }
.stage-glow { position: absolute; left: -10%; right: -10%; bottom: -30%; height: 55%; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #8fdc7a, #5fc765 60%, #3fae5a); }
.stage-house { position: relative; }
.stage-house svg { width: min(300px, 70vw); height: auto; filter: drop-shadow(0 16px 18px rgba(30, 70, 40, 0.35)); }
.stage-plate { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; padding: 8px 18px; border-radius: 12px; background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line-2); white-space: nowrap; max-width: 92%; }
.stage-plate strong { font-family: var(--font-display); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stage-plate span { font-size: 0.76rem; color: var(--muted); }
.nw-house.is-animated { animation: float 4s ease-in-out infinite; }
.nw-house.is-animated .nw-smoke circle { animation: smoke 3s ease-in infinite; transform-box: fill-box; transform-origin: center; }
.nw-house.is-animated .nw-smoke circle:nth-child(2) { animation-delay: 0.6s; }
.nw-house.is-animated .nw-smoke circle:nth-child(3) { animation-delay: 1.2s; }
.nw-house.is-animated .nw-pennant { animation: wave 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes smoke { 0% { transform: translateY(6px) scale(0.6); opacity: 0; } 30% { opacity: 0.7; } 100% { transform: translateY(-10px) scale(1.4); opacity: 0; } }
@keyframes wave { 50% { transform: scaleX(0.82) skewY(4deg); } }

/* join card */
.join-card { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; padding: clamp(24px, 4vw, 44px); border-radius: 28px; background: linear-gradient(120deg, #efe9ff, #e3f5ff 60%, #effbe3); border: 1px solid rgba(124, 77, 255, 0.25); box-shadow: var(--shadow); position: relative; overflow: hidden; scroll-margin-top: calc(var(--header-h) + 20px); }
.join-card::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 240px; height: 240px; background: var(--violet); opacity: 0.08; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.join-list { margin: 0 0 18px; padding-left: 1.2em; display: grid; gap: 10px; }
.join-list li::marker { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }
.join-actions { display: flex; flex-direction: column; gap: 10px; justify-content: center; position: relative; z-index: 1; }
.comment-preview { padding: 16px; border-radius: 16px; background: #ffffff; border: 1px dashed var(--line-2); display: grid; gap: 6px; }
.cp-label { font: 700 0.64rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.comment-preview code { font-size: 1.05rem; background: none; padding: 0; word-break: break-word; }

/* FAQ */
.faq-wrap { max-width: 860px; }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: rgba(23, 33, 58, 0.03); transition: border-color 0.2s, background 0.2s; }
.faq details[open] { border-color: rgba(124, 77, 255, 0.4); background: #ffffff; box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 56px 18px 20px; font-weight: 800; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(124, 77, 255, 0.1); color: var(--accent); font: 700 1.1rem var(--font-mono); transition: transform 0.2s; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

/* footer */
.site-footer { padding: 56px 0 28px; border-top: 1px solid var(--line); background: #eaf0f9; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid nav { display: grid; gap: 8px; align-content: start; }
.footer-grid h3 { font-size: 0.72rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.footer-grid nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.92rem; }
.footer-grid nav a:hover { color: var(--accent); }
.footer-tag { color: var(--muted); margin-top: 12px; }
.footer-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--dim); }

/* ---------- dialogs ---------- */
dialog { color: var(--text); padding: 0; border: 0; background: transparent; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
dialog::backdrop { background: rgba(23, 33, 58, 0.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog[open] { animation: pop 0.3s cubic-bezier(.2,1.3,.4,1); }
@keyframes pop { from { transform: scale(0.94) translateY(10px); opacity: 0; } }
.house-dialog { width: 760px; }
.hd-inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); max-height: calc(100dvh - 24px); overflow-y: auto; }
.hd-stage { border-radius: 0; border: 0; min-height: 340px; }
.hd-stage svg { position: relative; width: 240px; height: auto; filter: drop-shadow(0 16px 18px rgba(30, 70, 40, 0.35)); }
.hd-info { padding: 30px 28px 24px; }
.hd-info h2 { font-size: 1.45rem; word-break: break-word; padding-right: 30px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.badge { font: 700 0.66rem/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 6px 9px; border-radius: 8px; }
.badge-gold { background: var(--gold); color: #3a2600; }
.badge-violet { background: var(--violet); color: #fff; }
.badge-volt { background: #dcfce7; color: #166534; box-shadow: inset 0 0 0 1px #86efac; }
.badge-warn { background: #fff4d6; color: #8a5a00; box-shadow: inset 0 0 0 1px #e0a100; }
.hd-facts { display: grid; gap: 10px; margin: 0 0 20px; }
.hd-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.hd-facts dt { color: var(--muted); }
.hd-facts dd { margin: 0; font-weight: 700; text-align: right; }
.hd-facts em { color: var(--muted); font-style: normal; font-weight: 500; }
.hd-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.onboard { width: 520px; }
.ob-inner { position: relative; background: var(--panel-solid); border: 1px solid var(--line-2); border-radius: 26px; padding: 28px; box-shadow: var(--shadow); overflow: hidden; }
.ob-inner::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, #5fc765, var(--violet), var(--cyan)); }
.ob-slide { display: none; text-align: center; animation: obIn 0.35s ease; }
.ob-slide.is-active { display: block; }
@keyframes obIn { from { opacity: 0; transform: translateX(16px); } }
.ob-art { height: 170px; display: grid; place-items: center; margin: 4px 0 18px; border-radius: 20px; background: linear-gradient(180deg, #bfe7ff, #eaf7ff); }
.ob-art svg { height: 150px; width: auto; }
.ob-slide h2 { font-size: 1.35rem; }
.ob-slide p { color: var(--muted); margin: 0 auto; max-width: 40ch; }
.ob-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 26px; gap: 12px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots button { width: 10px; height: 10px; border-radius: 6px; border: 0; background: rgba(23, 33, 58, 0.18); cursor: pointer; padding: 0; transition: width 0.25s, background 0.25s; }
.ob-dots button.is-active { width: 28px; background: var(--accent); }
.ob-btns { display: flex; gap: 8px; }

/* toasts */
.toast-zone { position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #ffffff; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 0.88rem; transform: translateY(20px); opacity: 0; transition: transform 0.35s cubic-bezier(.2,1.3,.4,1), opacity 0.3s; pointer-events: auto; }
.toast.is-in { transform: none; opacity: 1; }
.toast em { display: block; font-style: normal; font: 500 0.72rem var(--font-mono); color: var(--green); }
.toast-arrival { border-color: rgba(34, 160, 107, 0.5); }
.toast-ok { border-color: rgba(34, 160, 107, 0.5); }
.toast-warn { border-color: rgba(255, 93, 115, 0.6); }
.toast-house { flex: none; }

/* ---------- document pages (legal etc.) ---------- */
.doc-hero { padding: clamp(48px, 7vw, 88px) 0 28px; border-bottom: 1px solid var(--line); }
.doc-hero p { color: var(--muted); max-width: 70ch; }
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding: 40px 0 90px; }
.doc-toc { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; display: grid; gap: 2px; font-size: 0.86rem; }
.doc-toc p { font: 700 0.66rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 0 0 8px; }
.doc-toc a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; }
.doc-toc a:hover { color: var(--text); border-left-color: var(--accent); background: rgba(23, 33, 58, 0.04); }
.doc { max-width: 76ch; }
.doc h2 { font-size: 1.25rem; margin-top: 2.2em; padding-top: 0.4em; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { font-size: 1rem; margin-top: 1.6em; }
.doc p, .doc li { color: #2e3854; }
.doc ul, .doc ol { padding-left: 1.3em; display: grid; gap: 6px; margin: 0 0 1em; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1.4em; font-size: 0.9rem; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border: 1px solid var(--line-2); vertical-align: top; }
.doc th { background: rgba(23, 33, 58, 0.05); font-weight: 800; }
.ph { background: #fff4d6; color: #8a5a00; border: 1px dashed #e0a100; border-radius: 6px; padding: 0 5px; font-family: var(--font-mono); font-size: 0.86em; white-space: normal; }
.callout { padding: 16px 18px; border-radius: 16px; margin: 0 0 1.4em; border: 1px solid var(--line-2); background: rgba(23, 33, 58, 0.04); font-size: 0.92rem; }
.callout strong:first-child { display: block; font-family: var(--font-display); font-size: 0.86rem; margin-bottom: 4px; }
.callout-draft { border-color: #f2c94c; background: #fffaeb; }
.callout-draft strong:first-child { color: #9a6200; }
.callout-info { border-color: rgba(33, 198, 232, 0.5); background: rgba(33, 198, 232, 0.06); }
.confirm { display: inline-block; font: 700 0.62rem/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: #1a1300; background: var(--gold); border-radius: 5px; padding: 3px 6px; vertical-align: 2px; margin-right: 4px; }
.updated { font: 500 0.8rem var(--font-mono); color: var(--dim); }

/* request form */
.form-card { padding: clamp(20px, 4vw, 34px); border-radius: 24px; border: 1px solid var(--line-2); background: var(--panel-solid); display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.choice-group { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border: 0; padding: 0; margin: 0; }
.choice-group legend { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; height: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #ffffff; cursor: pointer; font-weight: 700; font-size: 0.9rem; }
.choice span small { display: block; font-weight: 500; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.choice input:checked + span { border-color: var(--accent); background: rgba(124, 77, 255, 0.06); box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.12); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-error { color: var(--coral); font-weight: 700; font-size: 0.88rem; margin: 0; }
.output-box { white-space: pre-wrap; font: 500 0.82rem/1.55 var(--font-mono); background: #f3f6fb; border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; color: #2e3854; max-height: 320px; overflow: auto; }

/* ---------- responsive ---------- */
@media (max-height: 840px) { .hud-feed { display: none; } }
@media (max-width: 1180px) and (min-width: 761px) {
  .panel-open .hud-intro, .panel-open .hud-stats { visibility: hidden; opacity: 0; }
}
@media (max-width: 1180px) {
  .hud-feed { display: none; }
  .hud-legend { max-width: 360px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .tier-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
  .main-nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0; margin: 0; padding: 12px 16px 20px; background: rgba(255, 255, 255, 0.98); border-bottom: 1px solid var(--line); transform: translateY(-10px); opacity: 0; visibility: hidden; transition: 0.2s; }
  .main-nav a { padding: 14px 12px; font-size: 1.05rem; }
  .nav-open .main-nav { transform: none; opacity: 1; visibility: visible; }
  .nav-toggle { display: flex; }
  .header-actions .btn-ghost span { display: none; }
  .hud-intro { max-width: 360px; padding: 20px; }
  .hud-legend { display: none; }
  .hud-controls { margin-bottom: 20px; }
  .builder-grid, .join-card { grid-template-columns: 1fr; }
  .doc-layout { grid-template-columns: 1fr; gap: 24px; }
  .doc-toc { position: static; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
}
@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .header-actions .btn-volt { display: none; }
  .map-stage { display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto minmax(340px, 56svh) auto; grid-template-areas: "intro" "search" "canvas" "stats"; height: auto; min-height: 0; max-height: none; background: transparent; }
  .map-stage > * { grid-area: auto; }
  .hud { margin: 0 12px; }
  .hud-intro h1 { font-size: 1.6rem; }
  .hud-sub { font-size: 0.92rem; margin-bottom: 14px; }
  .demo-banner { font-size: 0.74rem; padding: 6px 12px; }
  .hud-intro { grid-area: intro; max-width: none; margin-top: 14px; background: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 10px 6px 4px; }
  .hud-intro::before { display: none; }
  .hud-search { grid-area: search; width: auto; justify-self: stretch; margin-bottom: 12px; z-index: 4; }
  .map-canvas { grid-area: canvas; border-block: 1px solid var(--line); }
  .hud-controls { grid-area: canvas; align-self: end; justify-self: end; margin: 12px; }
  .hud-stats { grid-area: stats; justify-self: stretch; margin: 12px; }
  .stat-chip { flex: 1; min-width: 0; padding: 12px; }
  .stat-num { font-size: 1.2rem; }
  .stat-lbl { font-size: 0.62rem; }
  .country-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; margin: 0; max-height: 56dvh; border-radius: 24px 24px 0 0; transform: translateY(100%); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .panel-grip { display: block; width: 44px; height: 5px; border-radius: 4px; background: rgba(23, 33, 58, 0.25); margin: 10px auto 0; }
  .panel-scroll { padding: 16px; }
  .panel-open .hud-search, .panel-open .hud-controls { visibility: visible; opacity: 1; }
  .cp-stat.big .num { font-size: 1.5rem; }
  .podium { gap: 8px; }
  .podium-card { padding: 18px 8px 0; border-radius: 16px 16px 0 0; }
  .podium-card.place-1 { padding-top: 26px; }
  .pc-flag { font-size: 2.1rem; }
  .pc-name { font-size: 0.78rem; }
  .pc-count { font-size: 0.72rem; }
  .pc-count .num { font-size: 1rem; }
  .podium-card .tier-pill { font-size: 0.56rem; padding: 4px 5px; }
  .medal { width: 38px; height: 38px; }
  .board-row { grid-template-columns: 30px 28px minmax(0, 1fr) auto; gap: 8px; padding: 12px; }
  .br-bar { grid-column: 3 / -1; grid-row: 2; }
  .br-delta { display: none; }
  .br-name .tier-pill { display: none; }
  .steps, .tier-strip { grid-template-columns: 1fr 1fr; }
  .step { padding: 18px; }
  .builder-form, .builder-traits, .form-grid { grid-template-columns: 1fr; }
  .builder-stage { min-height: 320px; }
  .hd-inner { grid-template-columns: 1fr; }
  .hd-stage { min-height: 240px; }
  .hd-stage svg { width: 190px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .choice-group { grid-template-columns: 1fr; }
  .toast-zone { bottom: 12px; }
  .panel-open .toast-zone { bottom: auto; top: calc(var(--header-h) + 8px); }
}
@media (max-width: 420px) {
  .steps, .tier-strip { grid-template-columns: 1fr; }
  .cp-stats { grid-template-columns: 1fr 1fr; }
  .cp-stat.big { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---------- request lookup & roster editor ---------- */
.lookup-hit { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(23, 33, 58, 0.03); margin-top: 8px; }
.lookup-hit .btn { margin-top: 8px; }
.admin-layout { display: grid; gap: 20px; padding: 36px 0 90px; }
.admin-layout .callout { margin: 0; }
.h3 { font-size: 1.05rem; margin: 0; }
.form-actions.full { grid-column: 1 / -1; }
.bulk summary { cursor: pointer; font-weight: 800; color: var(--accent); }
.bulk[open] summary { margin-bottom: 10px; }
.admin-bar { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.admin-bar .hood-search { max-width: 320px; margin: 0; }
.table-wrap { overflow-x: auto; }
.roster { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.roster th, .roster td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster th { color: var(--muted); font: 700 0.68rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; }
.roster tr.is-dup td { background: rgba(255, 200, 74, 0.06); }
.roster .btn { min-height: 32px; }
@media (max-width: 760px) { .doc-toc { display: none; } .doc-layout { padding-top: 28px; } }

/* ---------- house studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.studio-preview { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 14px; }
.studio-preview .builder-stage { min-height: 400px; }
.code-card { padding: 16px; border-radius: 20px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; gap: 12px; }
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.design-code { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em; padding: 6px 12px; border-radius: 10px; }
.code-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code-card .fine { margin: 0; }
.studio-panel { padding: 20px; border-radius: 24px; background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.studio-panel .builder-form { margin: 0 0 16px; }
.studio-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.studio-tab { flex: none; border: 1px solid var(--line-2); background: #fff; color: var(--muted); font: 800 0.84rem var(--font-text); padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s; }
.studio-tab:hover { color: var(--accent); border-color: var(--accent); }
.studio-tab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.studio-tab.is-event { color: #9a6200; border-color: #f2c94c; background: #fffaeb; }
.studio-tab.is-event.is-active { background: linear-gradient(90deg, #ffb020, #ff7a45); color: #fff; border-color: transparent; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.opt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; border-radius: 16px; border: 2px solid var(--line); background: linear-gradient(180deg, #dff1ff, #ffffff 75%); color: var(--text); font: inherit; cursor: pointer; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.opt:hover { transform: translateY(-2px); border-color: rgba(106, 60, 240, 0.45); }
.opt.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106, 60, 240, 0.15); }
.opt.is-on::after { content: "✓"; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 0.72rem; display: grid; place-items: center; font-weight: 800; }
.opt strong { font-size: 0.8rem; text-align: center; }
.opt .lock { display: inline-flex; align-items: center; gap: 4px; font-style: normal; font-size: 0.68rem; font-weight: 700; color: #9a6200; background: #fff4d6; padding: 3px 7px; border-radius: 999px; text-align: center; }
.opt .lock .ico { width: 11px; height: 11px; }
.opt.is-locked { background: linear-gradient(180deg, #fff3d6, #ffffff 75%); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--text); font: 700 0.82rem var(--font-text); cursor: pointer; }
.swatch i { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(23, 33, 58, 0.15), 0 2px 4px rgba(23, 33, 58, 0.15); }
.swatch:hover { border-color: rgba(106, 60, 240, 0.45); }
.swatch.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106, 60, 240, 0.15); }
.event-note { font-size: 0.86rem; color: #5a4300; background: #fffaeb; border: 1px solid #f2c94c; border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; }
.apply-steps { list-style: none; padding: 0; margin: 28px 0 clamp(56px, 8vw, 96px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.apply-steps li { display: flex; gap: 14px; padding: 18px; border-radius: 20px; background: var(--panel-solid); border: 1px solid var(--line); }
.apply-steps strong { font-family: var(--font-display); font-size: 0.95rem; }
.apply-steps p { margin: 4px 0 0; font-size: 0.88rem; color: var(--muted); }
.apply-num { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: #fff; font: 800 0.95rem var(--font-mono); }
.badge-event { background: linear-gradient(90deg, #ffb020, #ff7a45); color: #fff; }
.mini-code { font-size: 0.78rem; padding: 2px 6px; }

/* animated details on houses */
.nw-house.is-animated .nw-bulb { animation: twinkle 1.2s ease-in-out infinite alternate; }
.nw-house.is-animated .nw-balloon { animation: bob 3s ease-in-out infinite; transform-box: fill-box; }
.nw-house.is-animated .nw-burst { animation: burst 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.nw-house.is-animated .nw-burst:nth-child(2) { animation-delay: 0.8s; }
.nw-house.is-animated .nw-burst:nth-child(3) { animation-delay: 1.5s; }
@keyframes twinkle { to { opacity: 0.35; } }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes burst { 0% { transform: scale(0.2); opacity: 0; } 20% { opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.1); opacity: 0; } }

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .studio-preview { position: static; }
  .apply-steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .studio-preview .builder-stage { min-height: 300px; }
  .studio-panel { padding: 14px; }
  .opt-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .opt svg { width: 64px; height: 64px; }
  .opt strong { font-size: 0.7rem; }
  .opt .lock { font-size: 0.6rem; }
  .swatches { grid-template-columns: repeat(2, 1fr); }
}

/* request page design preview & admin design tools */
.design-wrap { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.design-preview { display: flex; align-items: center; gap: 10px; max-width: 360px; }
.design-preview .fine, .design-preview .form-error { margin: 0; }
.roster td svg { vertical-align: middle; }
.roster .cell-design { display: flex; align-items: center; gap: 6px; }
.roster .badge { margin-right: 4px; }
.edit-dialog { width: 520px; }
.edit-inner { background: #fff; border: 1px solid var(--line-2); border-radius: 22px; padding: 22px; display: grid; gap: 14px; box-shadow: var(--shadow); }
.item-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.item-checks label { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 0.86rem; cursor: pointer; }
.item-checks input { accent-color: var(--accent); width: 16px; height: 16px; }
@media (max-width: 760px) { .design-wrap { grid-template-columns: 1fr; } .item-checks { grid-template-columns: 1fr; } }
.form-card > * { min-width: 0; }
.admin-layout { min-width: 0; } .admin-layout > * { min-width: 0; }
.table-wrap { position: relative; }

/* =========================================================
   House studio v2
   ========================================================= */
.studio { grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.studio-preview .builder-stage { min-height: 480px; }
.builder-stage, .hd-stage { background: linear-gradient(180deg, #7cc8f5 0%, #b3e1fb 48%, #e3f5ff 74%, #d9f2e6 100%); transition: background 0.5s ease; }
.stage-glow { left: -12%; right: -12%; bottom: -34%; height: 58%; background: radial-gradient(ellipse at 50% 22%, #9be38a 0%, #6fd06f 42%, #47b15f 75%); box-shadow: 0 -2px 0 rgba(255, 255, 255, 0.35) inset; }
.stage-house { position: relative; z-index: 1; margin-top: -10px; }
.stage-house svg { width: min(360px, 78vw); height: auto; filter: drop-shadow(0 18px 18px rgba(20, 60, 40, 0.28)); }
.stage-house.is-pop svg { animation: housePop 0.38s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes housePop { 0% { transform: scale(0.96) translateY(4px); opacity: 0.6; } 100% { transform: none; opacity: 1; } }
.stage-plate { z-index: 2; box-shadow: 0 8px 20px -10px rgba(23, 33, 58, 0.35); }
.stage-toggle { position: absolute; top: 14px; right: 14px; z-index: 3; border: 0; border-radius: 999px; padding: 8px 14px; font: 800 0.8rem var(--font-text); color: #17213a; background: rgba(255, 255, 255, 0.86); box-shadow: 0 4px 12px -4px rgba(23, 33, 58, 0.35); cursor: pointer; transition: background 0.2s, color 0.2s, transform 0.15s; }
.stage-toggle:hover { transform: translateY(-1px); }
.stage-toggle[aria-pressed="true"] { background: #2b2d55; color: #ffe08a; }
.stage-theme { position: absolute; top: 14px; left: 14px; z-index: 3; padding: 7px 12px; border-radius: 999px; background: var(--accent); color: #fff; font: 800 0.76rem var(--font-text); box-shadow: 0 6px 14px -6px rgba(106, 60, 240, 0.7); }
.stage-theme::before { content: "✨ "; }
/* night sky */
.builder-stage.is-night, .hd-stage.is-night { background: linear-gradient(180deg, #121a3d 0%, #24306b 55%, #3a4a8a 80%, #2d4a5e 100%); }
.builder-stage.is-night::before, .hd-stage.is-night::before { background-image: radial-gradient(1.4px 1.4px at 12% 18%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 28% 8%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 46% 22%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 64% 12%, #fff 50%, transparent 52%), radial-gradient(1.5px 1.5px at 78% 28%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 36% 34%, #fff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 58% 40%, #fff 50%, transparent 52%), radial-gradient(26px 26px at 86% 13%, #fff6d6 48%, transparent 51%), radial-gradient(70px 70px at 86% 13%, rgba(255, 246, 214, 0.25) 30%, transparent 70%); animation: none; opacity: 1; }
.builder-stage.is-night .stage-glow, .hd-stage.is-night .stage-glow { background: radial-gradient(ellipse at 50% 22%, #3d7a5a 0%, #2f6650 45%, #234d40 80%); }
.builder-stage.is-night .stage-house svg, .hd-stage.is-night svg { filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45)); }

/* code card + summary */
.code-card { gap: 14px; }
.design-code { font-size: 1rem; letter-spacing: 0.04em; word-break: break-all; }
.studio-summary, .hd-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-chip { border: 1px solid var(--line-2); background: #f6f8fd; color: var(--text); font: 700 0.74rem var(--font-text); padding: 5px 10px; border-radius: 999px; }
button.sum-chip { cursor: pointer; transition: border-color 0.15s, color 0.15s, background 0.15s; }
button.sum-chip:hover { border-color: var(--accent); color: var(--accent); background: #fff; }
.hd-summary { margin: -4px 0 16px; }

/* panel navigation */
.studio-panel { padding: 22px; }
.studio-groups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: #eef2fa; margin-bottom: 12px; }
.studio-group { border: 0; background: transparent; color: var(--muted); font: 800 0.88rem var(--font-text); padding: 11px 6px; border-radius: 12px; cursor: pointer; transition: background 0.2s, color 0.2s, box-shadow 0.2s; }
.studio-group:hover { color: var(--accent); }
.studio-group.is-active { background: #fff; color: var(--accent); box-shadow: 0 4px 12px -6px rgba(23, 33, 58, 0.35); }
.studio-group.is-event { color: #b06b00; }
.studio-group.is-event.is-active { background: linear-gradient(90deg, #ffb020, #ff7a45); color: #fff; }
.studio-tabs { margin-bottom: 6px; padding-bottom: 8px; }
.studio-tab { padding: 8px 13px; font-size: 0.8rem; }
.studio-options { min-height: 200px; }
.studio-section + .studio-section { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-family: var(--font-text); font-size: 0.95rem; font-weight: 800; margin: 4px 0 12px; }
.sec-current { font: 700 0.74rem var(--font-mono); color: var(--accent); background: rgba(106, 60, 240, 0.08); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.studio-hint { font-size: 0.84rem; color: var(--muted); margin: -4px 0 12px; }
.opt-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.opt { padding: 6px 6px 10px; gap: 4px; border-width: 2px; background: #fff; animation: optIn 0.25s ease both; }
.opt-art { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 12px; background: linear-gradient(180deg, #cfeafc, #eef8ff 70%, #e3f6e6); overflow: hidden; }
.opt-art svg { width: 100%; height: 100%; }
.opt strong { font-size: 0.78rem; line-height: 1.25; }
.opt.is-on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(106, 60, 240, 0.16), 0 10px 20px -12px rgba(106, 60, 240, 0.6); }
.opt.is-on strong { color: var(--accent); }
.opt.is-on::after { top: 10px; right: 10px; width: 22px; height: 22px; box-shadow: 0 0 0 2px #fff; }
.opt.is-locked .opt-art { background: linear-gradient(180deg, #ffeccc, #fff8ea 70%, #f3f0dc); }
.opt-theme em { font-style: normal; font-size: 0.7rem; color: var(--muted); text-align: center; line-height: 1.3; padding: 0 2px; }
.opt-grid-themes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@keyframes optIn { from { opacity: 0; transform: translateY(4px); } }
.swatches { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.swatch { padding: 7px 9px; transition: border-color 0.15s, transform 0.15s; }
.swatch:hover { transform: translateY(-1px); }
.swatch i { width: 28px; height: 28px; position: relative; }
.swatch.is-on i::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 0.8rem; font-weight: 900; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.swatch.is-on { color: var(--accent); }

/* house dialog */
.hd-stage { min-height: 380px; align-content: end; padding-bottom: 34px; }
.hd-house { position: relative; z-index: 1; }
.hd-house svg { width: min(340px, 72vw); height: auto; filter: drop-shadow(0 18px 18px rgba(20, 60, 40, 0.28)); }
.house-dialog { width: 820px; }

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; }
  .studio-preview .builder-stage { min-height: 400px; }
}
@media (max-width: 760px) {
  /* preview stays on screen while scrolling through options */
  .studio { gap: 12px; }
  .studio-preview { display: contents; }
  .studio-preview .builder-stage { order: 1; position: sticky; top: calc(var(--header-h) + 4px); z-index: 6; min-height: 0; height: 236px; border-radius: 20px; align-content: start; padding-top: 4px; }
  .studio-panel { order: 2; padding: 12px; border-radius: 20px; }
  .code-card { order: 3; }
  .stage-house svg { width: 205px; }
  .stage-plate span { display: none; }
  .stage-plate { bottom: 8px; padding: 4px 12px; }
  .stage-plate strong { font-size: 0.82rem; }
  .stage-plate span { font-size: 0.68rem; }
  .stage-toggle { top: 10px; right: 10px; padding: 6px 11px; }
  .stage-theme { top: 10px; left: 10px; padding: 5px 10px; font-size: 0.7rem; }
  .studio-groups { grid-template-columns: repeat(4, auto); overflow-x: auto; }
  .studio-group { font-size: 0.8rem; padding: 10px 10px; white-space: nowrap; }
  .opt-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .opt-grid-themes { grid-template-columns: repeat(2, 1fr); }
  .opt svg { width: 100%; height: 100%; }
  .opt strong { font-size: 0.7rem; }
  .swatches { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .swatch { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 0.7rem; text-align: center; }
  .hd-stage { min-height: 280px; }
  .hd-house svg { width: 240px; }
  .house-dialog { width: auto; }
}

/* ---------- plots & find-my-house ---------- */
.free-plot { fill: rgba(255, 255, 255, 0.6); stroke: var(--accent); stroke-dasharray: 1.2 0.8; cursor: pointer; transition: fill 0.15s; }
.free-plot:hover { fill: #ffffff; }
.mini-house.is-mine { filter: drop-shadow(0 0 1.5px #c6f432) drop-shadow(0 0 1px #17213a); }
.fx-ring-find { stroke: var(--accent); stroke-width: 3; }
.map-markers.is-faded .marker.is-selected { display: none; }

/* ---------- find my house ---------- */
.find-form { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--accent); box-shadow: 0 10px 24px -14px rgba(106, 60, 240, 0.6); margin: 4px 0 10px; }
.find-at { font: 800 1.05rem var(--font-mono); color: var(--accent); }
.find-form input { flex: 1; min-width: 0; height: 40px; border: 0; outline: none; background: transparent; font: 700 1rem var(--font-text); color: var(--text); }
.find-form input::-webkit-search-cancel-button { display: none; }
.find-form .btn { flex: none; }
.find-msg { font-size: 0.86rem; line-height: 1.5; padding: 10px 12px; border-radius: 12px; margin: 0 0 12px; }
.find-msg.is-found { background: #ecfdf3; border: 1px solid #86efac; color: #14532d; }
.find-msg.is-missing { background: #fff7e6; border: 1px solid #f2c94c; color: #5a4300; }
.find-msg strong { display: block; margin-bottom: 2px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.hud-cta .btn-sm { min-height: 36px; }

/* ---------- account box in the studio ---------- */
.account-box { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #f1ecff, #eaf8ff); border: 1px solid rgba(106, 60, 240, 0.25); }
.acct-head { display: flex; gap: 10px; align-items: flex-start; }
.acct-head strong { font-family: var(--font-display); font-size: 0.92rem; }
.acct-head p { margin: 2px 0 0; font-size: 0.84rem; color: var(--muted); }
.acct-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff; box-shadow: 0 4px 10px -6px rgba(23, 33, 58, 0.4); font-size: 1rem; color: var(--accent); font-weight: 900; }
.acct-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acct-actions .btn-volt { flex: 1 1 180px; }
.acct-empty { margin: 0; font-size: 0.88rem; }
.account-box .fine { margin: 0; }
.dev-login { display: flex; gap: 6px; }
.dev-login input { flex: 1; min-width: 0; height: 38px; border-radius: 10px; border: 1px dashed #e0a100; padding: 0 10px; font: 600 0.9rem var(--font-text); background: #fffaeb; }
.dev-note { color: #8a5a00 !important; }
@media (max-width: 760px) {
  .find-form { padding-left: 10px; }
  .find-form .btn { padding: 0 10px; font-size: 0.78rem; }
}

.import-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.import-list li.ok { color: #14532d; }
.import-list li.skip { color: var(--muted); }
.import-actions { display: grid; gap: 12px; }
.server-publish { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: #f1ecff; }
.free-plot.is-zone { fill: #c6f432; stroke: #17213a; stroke-dasharray: none; animation: plotPulse 1.6s ease-in-out infinite; }
@keyframes plotPulse { 50% { opacity: 0.55; } }

/* ---------- build a house from your @ ---------- */
.find-msg.is-claim { background: #f6f3ff; border: 1px solid rgba(106, 60, 240, 0.3); color: var(--text); }
.find-msg.is-claim > span { display: block; color: var(--muted); margin-bottom: 10px; }
.claim { display: grid; gap: 10px; }
.claim .field select { min-height: 42px; font-size: 0.92rem; }
.zone-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.zone-chip { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; padding: 0 8px; border-radius: 10px; border: 1.5px solid var(--line-2); background: #fff; color: var(--text); font: 700 0.8rem var(--font-text); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.zone-chip .ico { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.zone-chip:hover { border-color: var(--accent); }
.zone-chip.is-on { border-color: var(--accent); background: var(--accent); color: #fff; }
.claim .check { font-size: 0.8rem; }
.claim-demo { margin: 0; color: #8a5a00 !important; }
.claim-alt { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--muted); }
.hud-intro { max-height: calc(100% - 40px); overflow-y: auto; }
.map-stage.is-finding .hud-feed { display: none; }
@media (min-width: 761px) { .map-stage.is-finding .hud-stats { display: none; } }

/* ---------- my house on this device ---------- */
.welcome-back { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; padding: 10px 12px; margin: 2px 0 10px; border-radius: 16px; background: linear-gradient(135deg, #ecfdf3, #eef8ff); border: 1px solid #86efac; animation: optIn 0.35s ease both; }
.wb-house { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; background: #fff; box-shadow: 0 4px 10px -6px rgba(23, 33, 58, 0.4); }
.wb-text { display: grid; min-width: 0; }
.wb-text strong { font-family: var(--font-display); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-text span { font-size: 0.78rem; color: var(--muted); }
.wb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wb-actions .link-btn { font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.ctrl-home { color: var(--green); }
.home-tag { display: inline-block; vertical-align: middle; font: 800 0.7rem var(--font-text); color: #14532d; background: #dcfce7; border: 1px solid #86efac; padding: 3px 8px; border-radius: 999px; }
.mini-house.is-mine { filter: drop-shadow(0 0 2px #c6f432) drop-shadow(0 0 2px #22a06b); }

/* ---------- house card extras ---------- */
.badge-mint { background: #dcfce7; color: #166534; box-shadow: inset 0 0 0 1px #86efac; }
.badge-sky { background: #e0f2fe; color: #075985; box-shadow: inset 0 0 0 1px #7dd3fc; }
.hd-near { margin: -4px 0 16px; }
.hd-near-title { font: 700 0.66rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 8px; }
.hd-near-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.near-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(180deg, #e3f4ff, #fff 80%); color: var(--text); font: inherit; cursor: pointer; min-width: 0; transition: border-color 0.15s, transform 0.15s; }
.near-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.near-card span { font-size: 0.68rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- points ---------- */
.owner-box { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #fff8e1, #fff1d6); border: 1px solid #f2c94c; }
.owner-head { display: flex; align-items: center; gap: 10px; }
.owner-head > div { display: grid; flex: 1; min-width: 0; }
.owner-head strong { font-family: var(--font-display); font-size: 0.92rem; }
.owner-head span { font-size: 0.82rem; color: #6b4e00; }
.owner-head b { font-size: 1.05rem; color: #17213a; }
.coin { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; box-shadow: 0 4px 10px -6px rgba(120, 80, 0, 0.6); font-size: 1.1rem; }
.owner-locks { list-style: none; margin: 0; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.7); display: grid; gap: 4px; font-size: 0.84rem; }
.owner-locks li { display: flex; justify-content: space-between; gap: 10px; }
.owner-locks li.sum { border-top: 1px dashed #e0c070; padding-top: 4px; font-weight: 800; }
.owner-box .fine { margin: 0; }
.earn summary { cursor: pointer; font-weight: 800; font-size: 0.84rem; color: #6b4e00; }
.earn ul { margin: 8px 0; padding-left: 1.1em; display: grid; gap: 4px; font-size: 0.84rem; }
.account-box.is-muted { display: none; }
.opt .price { font-style: normal; font: 800 0.68rem var(--font-mono); color: #6b4e00; background: #fff4d6; border: 1px solid #f2c94c; padding: 2px 7px; border-radius: 999px; }
.opt .price.is-owned { color: #166534; background: #dcfce7; border-color: #86efac; }
.pts-chip { border: 1px solid #f2c94c; background: #fff8e1; color: #6b4e00; font: 800 0.78rem var(--font-mono); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.pts-chip:hover { background: #fff1c2; }
.hd-points { margin: -4px 0 16px; padding: 12px; border-radius: 14px; background: #fffaeb; border: 1px solid #f2c94c; }
.pts-total { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.84rem; color: #6b4e00; }
.pts-total b { font-size: 1.5rem; color: #17213a; }
.pts-total .coin { width: 30px; height: 30px; font-size: 0.95rem; }
.pts-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; margin: 0; font-size: 0.8rem; }
.pts-list div { display: flex; justify-content: space-between; gap: 8px; }
.pts-list dt { color: var(--muted); }
.pts-list dd { margin: 0; font: 700 0.8rem var(--font-mono); }
.keybox { margin-top: 10px; }
.keybox summary { cursor: pointer; font-weight: 800; font-size: 0.82rem; color: var(--accent); }
.key-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-row code { word-break: break-all; font-size: 0.78rem; }
.key-form { display: grid; gap: 8px; padding: 12px; margin: 0 0 10px; border-radius: 14px; background: #f6f3ff; border: 1px solid rgba(106, 60, 240, 0.3); }
.key-form .fine { margin: 0; }
@media (max-width: 420px) { .pts-list { grid-template-columns: 1fr; } }
@media (min-width: 761px) { .hd-stage { align-self: start; position: sticky; top: 0; height: min(calc(100dvh - 24px), 620px); min-height: 0; } }

/* ---------- make upgrades easy to find ---------- */
.studio-panel .owner-box { margin-bottom: 14px; }
.upgrade-hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-bottom: 14px; border-radius: 14px; background: #fff8e1; border: 1px solid #f2c94c; }
.upgrade-hint p { margin: 0; font-size: 0.84rem; color: #5a4300; }
.upgrade-hint .coin { width: 30px; height: 30px; font-size: 0.95rem; }
.upgrade-btn { gap: 6px; }
.upgrade-btn .pts-chip { padding: 2px 7px; font-size: 0.72rem; }

/* ---------- house levels ---------- */
.ladder { margin: -4px 0 16px; padding: 12px; border-radius: 14px; background: linear-gradient(135deg, #f1ecff, #eaf8ff); border: 1px solid rgba(106, 60, 240, 0.25); display: grid; gap: 10px; }
.ladder .hd-near-title { margin: 0; }
.ladder-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.rung { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.7); border: 1.5px solid transparent; text-align: center; min-width: 0; }
.rung svg { width: 100%; height: auto; }
.rung strong { font-size: 0.6rem; line-height: 1.15; }
.rung span { font: 700 0.6rem var(--font-mono); color: var(--muted); }
.rung.is-current { border-color: var(--accent); background: #fff; }
.rung.is-current span { color: var(--accent); }
.rung.is-done span { color: var(--green); }
.rung.is-next { border-color: #f2c94c; border-style: dashed; }
.rung.is-locked svg { filter: grayscale(0.8) opacity(0.45); }
.ladder .fine { margin: 0; }
.ladder-top { margin: 0; font-weight: 800; text-align: center; }
@media (max-width: 760px) { .ladder-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rung strong { font-size: 0.66rem; } }

/* ==========================================================
   Upgrade your house (right below the map)
   ========================================================== */
.upgrade-section { background: linear-gradient(180deg, #f3efff 0%, #eef8ff 60%, transparent 100%); scroll-margin-top: var(--header-h); }
.upgrade-me { scroll-margin-top: calc(var(--header-h) + 16px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; padding: clamp(18px, 3vw, 32px); border-radius: 28px; background: #fff; border: 1px solid rgba(124, 77, 255, 0.22); box-shadow: var(--shadow); margin-bottom: 22px; }
.upgrade-me h3 { font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.7rem); margin: 4px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.upgrade-me .eyebrow { margin: 0; }
.upgrade-me p { margin: 0 0 14px; }
.um-art { display: grid; place-items: center; width: clamp(150px, 22vw, 220px); aspect-ratio: 1; border-radius: 24px; background: linear-gradient(180deg, #7cc8f5 0%, #b3e1fb 55%, #d9f2e6 100%); }
.um-art[role="button"] { cursor: pointer; }
.um-art svg { width: 88%; height: auto; filter: drop-shadow(0 12px 14px rgba(23, 33, 58, 0.2)); }
.um-lvl { font: 800 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.1em; padding: 5px 9px; border-radius: 999px; background: var(--violet); color: #fff; }
.um-points { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.um-points b { font-size: clamp(1.8rem, 4vw, 2.4rem); color: #17213a; }
.um-points span:last-child { color: var(--muted); font-weight: 700; }
.um-bar { height: 10px; border-radius: 999px; background: #eef0f6; overflow: hidden; margin-bottom: 14px; max-width: 460px; }
.um-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9ad81c, var(--volt)); }
.upgrade-me .btn-upgrade { max-width: 460px; font-size: 1.02rem; padding: 14px 18px; }
.upgrade-me .fine { margin: 10px 0 0; }
.level-track { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.lvl { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 10px 6px 12px; border-radius: 18px; background: #fff; border: 1.5px solid var(--line); min-width: 0; }
.lvl-art { width: 100%; display: grid; place-items: center; }
.lvl-art svg { width: min(92px, 100%); height: auto; }
.lvl-no { font: 700 0.62rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.lvl strong { font-size: 0.86rem; line-height: 1.2; }
.lvl-cost { font: 800 0.78rem var(--font-mono); color: #6b4e00; }
.lvl.is-current { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15); }
.lvl.is-current .lvl-cost { color: var(--violet); }
.lvl.is-next { border-color: #9ad81c; background: #f8ffe6; }
.lvl.is-done { opacity: 0.75; }
.lvl.is-done .lvl-cost { color: #2f8f3a; }
.earn-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.earn-tile { display: grid; gap: 4px; padding: 14px; border-radius: 16px; background: #fffaeb; border: 1px solid #f2d78a; font-size: 0.86rem; color: #5a4a20; }
.earn-tile b { font: 800 1.3rem var(--font-display); color: #17213a; }
.upgrade-fine { margin-top: 12px; }
@media (max-width: 900px) {
  .level-track { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .earn-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .upgrade-me { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .upgrade-me h3, .um-points { justify-content: center; }
  .um-bar, .upgrade-me .btn-upgrade { margin-left: auto; margin-right: auto; }
}

/* ---------- upgrade box at the top of the country panel ---------- */
.cp-upgrade { display: grid; gap: 10px; margin: 0 0 14px; padding: 14px; border-radius: 18px; background: linear-gradient(135deg, #f1ecff, #eaf8ff); border: 1.5px solid rgba(124, 77, 255, 0.35); }
.cp-upgrade.is-other { display: block; font-size: 0.9rem; padding: 12px 14px; }
.cp-upgrade.is-visitor strong { font-family: var(--font-display); font-size: 1rem; }
.cp-upgrade.is-visitor > span { font-size: 0.88rem; color: var(--muted); }
.cp-upgrade .form-error { margin: 0; }
.cpu-login { display: flex; gap: 8px; }
.cpu-login input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); font: inherit; background: #fff; }
.cpu-top { display: flex; align-items: center; gap: 12px; }
.cpu-art { flex: none; display: grid; place-items: center; width: 84px; height: 84px; padding: 0; border: 0; border-radius: 16px; background: linear-gradient(180deg, #7cc8f5, #d9f2e6); cursor: pointer; }
.cpu-art svg { width: 78px; height: auto; }
.cpu-info { display: grid; gap: 2px; min-width: 0; }
.cpu-eyebrow { font: 700 0.64rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--violet); }
.cpu-info strong { font-family: var(--font-display); font-size: 1rem; line-height: 1.2; overflow-wrap: anywhere; }
.cpu-pts b { font-size: 1.35rem; color: #17213a; }
.cp-upgrade .um-bar { margin: 0; max-width: none; }
.cp-upgrade .btn-upgrade { padding: 12px 14px; }
.cp-upgrade .fine { margin: 0; }
.cpu-track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.cpu-lvl { display: grid; justify-items: center; gap: 1px; padding: 4px 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.75); border: 1.5px solid transparent; font: 700 0.62rem var(--font-mono); color: #6b4e00; }
.cpu-lvl svg { width: 36px; height: auto; }
.cpu-lvl.is-current { border-color: var(--violet); color: var(--violet); }
.cpu-lvl.is-next { border-color: #9ad81c; background: #f8ffe6; }
.cpu-lvl.is-done { color: #2f8f3a; opacity: 0.8; }
.cpu-lvl.is-locked { opacity: 0.6; }
.cpu-earn { display: flex; flex-wrap: wrap; gap: 6px; }
.cpu-earn .btn { flex: 1 1 auto; justify-content: center; }
.cpu-earn small { font-weight: 600; opacity: 0.7; }
.cpu-done { display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 12px; background: #eafbe7; color: #2f8f3a; font-weight: 800; font-size: 0.85rem; }
.cpu-invited { margin: 0; }

/* ---------- @username under houses when zoomed in ---------- */
.house-tag { cursor: pointer; font-family: var(--font-text); font-weight: 800; fill: #17213a; stroke: rgba(255, 255, 255, 0.95); paint-order: stroke; stroke-linejoin: round; }
.house-tag.is-mine { fill: #4a1fd0; font-size: 1.15em; }
/* close-up: no CSS filters on the (huge) country shapes */
svg.is-deep .country, svg.is-deep .country:hover, svg.is-deep .country.is-selected { filter: none; }
svg.is-deep .map-graticule { display: none; }
svg.is-deep .map-markers, svg.is-deep .map-tiny { display: none; }

/* ==========================================================
   Phones: the map is the page. Compact cards float over it.
   ========================================================== */
.ctrl-search { display: none; }
@media (max-width: 760px) {
  .map-stage { display: grid; grid-template: 1fr / 1fr; grid-template-areas: none; height: calc(100svh - var(--header-h)); min-height: 460px; max-height: 920px; background: #5fb8ec; }
  .map-stage > * { grid-area: 1 / 1; }
  .map-canvas { border: 0; }
  .hud { margin: 10px; }
  /* top card: title + @ search */
  .hud-intro { align-self: start; justify-self: stretch; z-index: 3; margin: 10px; padding: 12px 12px 12px; max-width: none; max-height: calc(100% - 96px); overflow-y: auto; overscroll-behavior: contain;
    background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(255, 255, 255, 0.7); border-radius: 18px; box-shadow: 0 10px 30px rgba(23, 33, 58, 0.16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .hud-intro .eyebrow { display: none; }
  .hud-intro h1 { font-size: clamp(0.8rem, 3.75vw, 1.12rem); line-height: 1.2; margin: 0 0 10px; letter-spacing: -0.01em; }
  .hud-sub, .hud-cta { display: none; }
  .hud-intro .find-form { margin: 0; }
  .hud-intro .welcome-back { margin-bottom: 10px; }
  .hud-intro .find-msg { margin-top: 10px; }
  /* country / player search: behind the 🔍 control */
  .hud-search { display: none; align-self: start; justify-self: stretch; width: auto; margin: 10px; z-index: 5; }
  .map-stage.show-search .hud-search { display: block; }
  .map-stage.show-search .hud-intro { visibility: hidden; }
  .ctrl-search { display: grid; }
  /* bottom: slim stats bar + controls */
  .hud-stats { grid-area: 1 / 1; align-self: end; justify-self: start; margin: 10px; max-width: calc(100% - 82px); border-radius: 14px; }
  .stat-chip { flex: 0 1 auto; padding: 7px 11px; }
  .stat-num { font-size: 1rem; }
  .stat-lbl { font-size: 0.55rem; letter-spacing: 0.06em; }
  .hud-controls { grid-area: 1 / 1; align-self: end; justify-self: end; margin: 10px; }
  .hud-legend, .hud-feed { display: none; }
  .map-stage.is-finding .hud-stats { display: none; }
  .panel-open .hud-stats { visibility: hidden; }
}
@media (max-width: 760px) and (max-height: 640px) {
  .hud-intro h1 { display: none; }
}

/* ---------- map performance on phones ---------- */
.map-canvas { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.map-svg { transform-origin: 0 0; }
@media (max-width: 760px) {
  .map-canvas { background: linear-gradient(180deg, #8fd3fb, #5fb8ec); }
  .map-svg { will-change: transform; }
  /* SVG filters and CSS filters are redrawn over the whole map on every frame: too slow on phones */
  .map-land { filter: none; }
  .marker-glow { filter: none; opacity: 0.6; }
  .country, .country:hover, .country.is-selected { filter: none; transition: none; }
  .map-graticule { display: none; }
  .mini-house.is-mine { filter: none; }
  /* no live blur behind the floating cards (Safari re-blurs it on every map frame) */
  .hud-intro, .hud-search .search-box, .hud-stats, .hud-controls { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(255, 255, 255, 0.96); }
}

/* ==========================================================
   The Moon
   ========================================================== */
.map-stage, .map-canvas { background: #12153a; }
@media (max-width: 760px) { .map-stage { background: #12153a; } .map-canvas { background: radial-gradient(circle at 50% 45%, #232864, #0b0d26 75%); } }
.map-sphere { fill: #c9ccd6; stroke: rgba(225, 230, 255, 0.85); stroke-width: 1.4; }
.map-graticule { stroke: rgba(40, 46, 90, 0.16); stroke-dasharray: none; }
.country { stroke: rgba(255, 255, 255, 0.85); }
.map-craters { pointer-events: none; }
.moon-mare { fill: rgba(70, 72, 110, 0.13); stroke: none; }
.moon-crater { fill: rgba(60, 62, 100, 0.12); stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.6; vector-effect: non-scaling-stroke; }
.country-label { fill: #232850; }
.live-dot { background: #8c69ef; }
.claim-hint { margin: -4px 0 4px; }
