:root {
  --bg: #0b0f14;
  --bg2: #121821;
  --card: #161d28;
  --card-hover: #1c2533;
  --border: #2a3545;
  --text: #e8eef7;
  --muted: #93a0b4;
  --accent: #5b9cff;
  --accent2: #3dd6c6;
  --voice: #7c6cff;
  --game: #3ecf8e;
  --warn: #f0b429;
  --danger: #ff6b7a;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
  /* Public design (overridden from /api/site via app.js) */
  --scene-bg-image: url("/bg.jpg");
  --scene-overlay: 0.18;
  --bubble-size: 7.25rem;
  --bubble-hover-scale: 1.16;
  --zone-label-opacity: 0;
  --nexus-glow: rgba(91, 156, 255, 0.22);
  --atomic-glow: rgba(236, 72, 153, 0.18);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(91,156,255,.12), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(61,214,198,.08), transparent 55%),
    var(--bg);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0.75rem 1rem 2rem; }
.wrap-wide { max-width: 1100px; }
.hero { text-align: center; padding: 0.75rem 0 0.25rem; }
.badge {
  display: inline-block; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent2); background: rgba(61,214,198,.12); border: 1px solid rgba(61,214,198,.25);
  padding: .25rem .7rem; border-radius: 999px; margin: 0 0 .75rem;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); margin: 0 0 .4rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0; }
.sub { color: var(--muted); margin: 0 0 1rem; }
.urls { display: flex; flex-direction: column; gap: .45rem; align-items: center; margin: 1rem 0 0; }
.url-line { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; justify-content: center; font-size: .9rem; color: var(--muted); }

.discord-links {
  display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center;
  align-items: center; margin: 1rem 0 0;
}
.discord-links .btn-discord {
  background: rgba(88, 101, 242, .18);
  border-color: rgba(88, 101, 242, .45);
  color: #c5caff;
}
.discord-links .btn-discord:hover {
  background: rgba(88, 101, 242, .28);
  color: #e0e3ff;
  text-decoration: none;
}
.discord-links-label {
  width: 100%; text-align: center; font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .15rem; font-weight: 700;
}
code {
  font-family: Consolas, "Cascadia Mono", ui-monospace, monospace;
  font-size: .85em; background: rgba(255,255,255,.06); padding: .15rem .4rem; border-radius: 6px;
  word-break: break-all; color: #d7e3f5;
}
code.key { color: #ffd89a; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; box-shadow: var(--shadow);
}
.server-card { margin-bottom: 1rem; }
.server-card.muted { opacity: .78; }
.server-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.tag {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; padding: .2rem .5rem;
  border-radius: 999px; font-weight: 600;
}
.tag-voice { background: rgba(124,108,255,.18); color: #b8aeff; }
.tag-game { background: rgba(62,207,142,.15); color: #7eebbc; }
.tag-opt { background: rgba(240,180,41,.15); color: #ffd56a; }
.tag-cat { background: rgba(91,156,255,.15); color: #9bc2ff; }
.meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; align-items: baseline; }
.meta dt { color: var(--muted); font-size: .85rem; margin: 0; }
.meta dd { margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.btn {
  appearance: none; border: 1px solid var(--border); background: rgba(255,255,255,.04);
  color: var(--text); border-radius: 10px; padding: .55rem .9rem; font-size: .9rem;
  cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
}
.btn:hover { background: rgba(255,255,255,.08); text-decoration: none; color: var(--text); }
.btn-sm { padding: .25rem .55rem; font-size: .75rem; font-weight: 600; border-radius: 8px; }
.btn-primary { background: linear-gradient(135deg, #3d7eff, #5b9cff); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.06); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(255,107,122,.12); border-color: rgba(255,107,122,.35); color: #ffb0b8; }
.btn-danger:hover { background: rgba(255,107,122,.2); }
.hint { color: var(--muted); font-size: .85rem; margin: .5rem 0 0; }
.sep { color: var(--muted); margin: 0 .15rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 2rem; }
.toast {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: #1e293b; border: 1px solid var(--border); color: var(--text);
  padding: .55rem 1rem; border-radius: 999px; box-shadow: var(--shadow); z-index: 50;
}
.filters {
  display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; margin: 1.25rem 0 1rem;
}
.chip {
  border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--muted);
  border-radius: 999px; padding: .35rem .75rem; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.chip.active, .chip:hover { color: var(--text); border-color: var(--accent); background: rgba(91,156,255,.12); }
.section-label {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 1.5rem 0 .75rem; font-weight: 700;
}
.admin-bar {
  display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center;
  margin-bottom: 1.25rem;
}
.admin-bar h1 { font-size: 1.5rem; margin: 0; }
.grid-form { display: grid; gap: .75rem; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
}
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
input, select, textarea {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: .55rem .7rem; font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,156,255,.15);
}
textarea { min-height: 70px; resize: vertical; }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.login-box { max-width: 400px; margin: 3rem auto; }
.err { color: #ffb0b8; font-size: .9rem; margin: .5rem 0 0; }
.ok { color: #7eebbc; font-size: .9rem; margin: .5rem 0 0; }
.table-card { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  border-radius: 999px; padding: .4rem .85rem; cursor: pointer; font-weight: 600; font-size: .85rem;
}
.tab.active { color: var(--text); border-color: var(--accent); background: rgba(91,156,255,.12); }
.hidden { display: none !important; }
.checkline { flex-direction: row; align-items: center; gap: .5rem; }
.checkline input { width: auto; }
.empty {
  text-align: center; color: var(--muted); padding: 2rem 1rem; border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.admin-link { font-size: .8rem; opacity: .55; }
.admin-link:hover { opacity: 1; }

.credit-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; opacity: .85; }
.credit-link:hover { opacity: 1; color: var(--accent, #7dd3fc); }

/* ========== PUBLIC flowing scene (Admin stays plain) ========== */
body.public-page .filters { display: none; }
body.public-page .hero h1 { font-size: 1.55rem; margin: 0.15rem 0; }
body.public-page .hero .sub { margin: 0.2rem 0 0.4rem; font-size: 0.9rem; }
body.public-page .discord-links { margin-top: 0.35rem; gap: 0.35rem; }
body.public-page .discord-links-label { margin: 0 0 0.25rem; font-size: 0.75rem; }
body.public-page .wrap {
  max-width: 1200px;
  position: relative;
}

/* NEXUS-only scene: cool gradient + optional image via --scene-bg-image */
body.public-page {
  background-color: #05070c;
  background-image:
    linear-gradient(165deg, rgba(6,16,28,0.92) 0%, rgba(8,20,36,0.55) 42%, rgba(5,10,18,0.75) 100%),
    radial-gradient(ellipse 70% 55% at 22% 28%, rgba(61,214,198,0.14), transparent 58%),
    radial-gradient(ellipse 65% 50% at 78% 72%, rgba(91,156,255,0.12), transparent 60%),
    linear-gradient(180deg, rgba(5,7,12,var(--scene-overlay, .22)) 0%, rgba(5,7,12,calc(var(--scene-overlay, .22) * 0.2)) 28%, transparent 55%),
    var(--scene-bg-image, none);
  background-size: cover, cover, cover, cover, cover;
  background-position: center, center, center, center, center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.public-page .zone-label { opacity: var(--zone-label-opacity, 0); }
body.public-page .hero {
  position: relative;
  z-index: 1;
  padding: 0.85rem 1rem 0.55rem;
  margin: 0 auto 0.35rem;
  max-width: 36rem;
  border-radius: 1.1rem;
  background: rgba(8, 12, 20, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  text-shadow: 0 1px 10px rgba(0,0,0,.45);
}
body.public-page .foot {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(8, 12, 20, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
/* Stronger glass so bubbles stay readable on bright art */
body.public-page .bubble {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.28), transparent 42%),
    linear-gradient(160deg, rgba(12,18,28,.72), rgba(12,18,28,.55) 55%, rgba(255,255,255,.08));
  border-color: rgba(255,255,255,.28);
  box-shadow:
    0 8px 22px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.18);
}
body.public-page .bubble[data-side="nexus"] {
  background:
    radial-gradient(circle at 32% 28%, rgba(180,230,255,.25), transparent 42%),
    linear-gradient(160deg, rgba(10,30,55,.78), rgba(20,50,80,.58) 60%, rgba(125,211,252,.12));
  border-color: rgba(125,211,252,.45);
}
body.public-page .bubble[data-side="atomic"] {
  /* Atomic removed from this hub – same as NEXUS if any leftover */
  background:
    radial-gradient(circle at 32% 28%, rgba(180,230,255,.25), transparent 42%),
    linear-gradient(160deg, rgba(10,30,55,.78), rgba(20,50,80,.58) 60%, rgba(125,211,252,.12));
  border-color: rgba(125,211,252,.45);
}
body.public-page .bubble[data-side="other"] {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.2), transparent 42%),
    linear-gradient(160deg, rgba(20,24,32,.78), rgba(30,36,48,.58) 60%, rgba(148,163,184,.12));
}

/* One continuous stage — no bordered columns/cards */
.bubble-stage {
  position: relative;
  width: 100%;
  min-height: clamp(26rem, 58vh, 38rem);
  margin-top: 0.4rem;
  border: 0;
  background: transparent;
  overflow: visible;
  isolation: isolate;
}

/* Soft zone labels (faint, not boxed) */
.zone-label {
  position: absolute;
  margin: 0;
  font-size: clamp(0.7rem, 1.6vw, 0.85rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 0.28;
}
.zone-label-nexus {
  left: 6%;
  top: 4%;
  color: #7dd3fc;
}
.zone-label-atomic {
  right: 6%;
  top: 4%;
  text-align: right;
  color: #f9a8d4;
}
.zone-label-other {
  left: 50%;
  bottom: 3%;
  transform: translateX(-50%);
  color: #94a3b8;
  letter-spacing: 0.18em;
}

.empty-stage {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  border: 0;
  background: transparent;
  padding: 0;
}

/* True free-floating glass circles */
.bubble {
  --rx: 0px;
  --ry: 0px;
  --bs: 1;
  --layout-scale: 1;
  position: absolute;
  left: var(--bx, 0%);
  top: var(--by, 0%);
  width: calc(var(--bubble-size, 7.25rem) * var(--layout-scale, 1));
  height: calc(var(--bubble-size, 7.25rem) * var(--layout-scale, 1));
  margin: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.22), transparent 42%),
    linear-gradient(160deg, rgba(91,156,255,.18), rgba(61,214,198,.1) 55%, rgba(255,255,255,.04));
  border: 1.5px solid rgba(255,255,255,.18);
  box-shadow:
    0 6px 18px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.12);
  transform: translate(var(--rx), var(--ry)) scale(var(--bs));
  transition: transform .28s cubic-bezier(.22,.7,.3,1), box-shadow .2s ease, border-color .15s ease;
  overflow: visible;
  z-index: 1;
  will-change: transform;
}
.bubble[data-side="nexus"] {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.2), transparent 42%),
    linear-gradient(160deg, rgba(91,156,255,.22), rgba(125,211,252,.08) 60%, rgba(255,255,255,.04));
  border-color: rgba(125,211,252,.28);
}
.bubble[data-side="atomic"] {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.2), transparent 42%),
    linear-gradient(160deg, rgba(249,168,212,.2), rgba(244,114,182,.08) 60%, rgba(255,255,255,.04));
  border-color: rgba(249,168,212,.3);
}
.bubble[data-side="other"] {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.18), transparent 42%),
    linear-gradient(160deg, rgba(148,163,184,.16), rgba(100,116,139,.08) 60%, rgba(255,255,255,.04));
  border-color: rgba(148,163,184,.28);
}
.bubble.muted { opacity: .68; }
.bubble.active {
  border-color: rgba(61,214,198,.7);
  box-shadow:
    0 8px 28px rgba(61,214,198,.22),
    0 0 0 2px rgba(61,214,198,.25),
    inset 0 1px 0 rgba(255,255,255,.15);
  z-index: 5;
}
.bubble.is-grown {
  --bs: var(--bubble-hover-scale, 1.16);
  z-index: 6;
  border-color: rgba(125,211,252,.55);
  box-shadow:
    0 14px 32px rgba(0,0,0,.38),
    0 0 0 1px rgba(255,255,255,.12),
    inset 0 1px 0 rgba(255,255,255,.18);
}
.bubble[data-side="atomic"].is-grown {
  border-color: rgba(249,168,212,.6);
}
.bubble.is-repelled {
  z-index: 2;
}

.bubble-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  padding: 0.85rem 0.65rem;
  outline: none;
}
.bubble-face:focus-visible {
  box-shadow: 0 0 0 3px rgba(91,156,255,.45);
  border-radius: 50%;
}

.bubble-title {
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.2;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  padding: 0 0.15rem;
}

.bubble-kind {
  font-size: 0.58rem !important;
  padding: 0.12rem 0.4rem !important;
  letter-spacing: .04em;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
}

.tag-off { background: rgba(248,113,113,.18); color: #fecaca; }

/* Touch: no hover grow/repulsion (JS also skips) */
@media (hover: none) {
  .bubble.is-grown { --bs: 1; }
}

@media (max-width: 640px) {
  .bubble-stage { min-height: clamp(30rem, 72vh, 44rem); }
  .bubble { width: 6.35rem; height: 6.35rem; }
  .bubble-title { font-size: 0.72rem; }
  .zone-label { opacity: 0.22; letter-spacing: 0.14em; }
}

/* --- Popover / floating detail panel --- */
.bubble-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 14, .55);
  backdrop-filter: blur(3px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.bubble-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.bubble-popover {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -48%) scale(.96);
  width: min(26rem, calc(100vw - 1.5rem));
  max-height: min(78vh, 32rem);
  overflow: auto;
  z-index: 45;
  background:
    linear-gradient(165deg, rgba(30,40,55,.97), rgba(18,24,33,.98));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 1.35rem;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(61,214,198,.12);
  padding: 1rem 1.1rem 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.bubble-popover.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.bubble-popover-head {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin-bottom: .65rem;
}
.bubble-popover-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  flex: 1 1 auto;
  line-height: 1.25;
}
.bubble-popover-badges {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin: 0 0 .55rem;
}
.bubble-popover-close {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bubble-popover-close:hover {
  background: rgba(255,107,122,.18);
  border-color: rgba(255,107,122,.4);
}

.bubble-popover .bubble-desc { margin: 0 0 .5rem; font-size: .88rem; }
.bubble-popover .meta { margin: .35rem 0; }
.bubble-popover .actions { margin-top: .75rem; }
.bubble-popover .hint { margin-top: .55rem; }

/* ===== Bubble layout editor (overlay only — no stage geometry change) ===== */
/* DO NOT alter .bubble-stage min-height, bubble size, gaps, or zone flow vs live */
body.layout-edit {
  /* no padding/min-height changes — pixel parity with live */
}
.layout-edit-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 0.28rem 0.75rem;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: #0b1220;
  background: linear-gradient(90deg, #7dd3fc, #f9a8d4);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  pointer-events: none;
}
body.layout-edit-mobile .layout-edit-banner {
  background: linear-gradient(90deg, #86efac, #7dd3fc);
}
.layout-edit-bar {
  position: fixed;
  left: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 60;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  background: rgba(11, 15, 20, 0.92);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  max-width: 1100px;
  margin: 0 auto;
}
.layout-edit-bar > * { pointer-events: auto; }
.layout-side-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted, #94a3b8);
}
.layout-side-label select {
  min-width: 6.5rem;
}
.layout-size-feedback {
  font-size: 0.78rem;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
  min-width: 4.5rem;
}
.layout-overlap-warn {
  color: #fbbf24;
  font-size: 0.8rem;
  font-weight: 600;
}
.layout-status {
  color: #94a3b8;
  font-size: 0.78rem;
  margin-left: auto;
}
body.layout-edit .bubble {
  cursor: grab;
  touch-action: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
body.layout-edit .bubble.is-dragging,
body.layout-edit .bubble.is-dragging .bubble-face,
body.layout-edit .bubble.is-resizing {
  cursor: grabbing;
}
body.layout-edit .bubble.layout-selected {
  outline: 2px dashed rgba(125, 211, 252, 0.95);
  outline-offset: 4px;
  z-index: 20;
}
body.layout-edit .bubble.is-grown,
body.layout-edit .bubble.is-repelled {
  --bs: 1;
  --rx: 0px;
  --ry: 0px;
}
.bubble-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(135deg, #7dd3fc, #5b9cff);
  border: 1px solid rgba(255,255,255,.55);
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: nwse-resize;
  z-index: 22;
  pointer-events: auto;
  touch-action: none;
}
.layout-add-panel {
  position: fixed;
  right: 0.75rem;
  top: 2.2rem;
  z-index: 61;
  width: min(18rem, calc(100vw - 1.5rem));
  max-height: min(55vh, 22rem);
  overflow: auto;
  background: rgba(11, 15, 20, 0.95);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  pointer-events: auto;
}
.layout-add-panel h4 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
}
.layout-add-panel .hint { margin: 0 0 0.5rem; font-size: 0.75rem; }
.layout-add-item {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0 0 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
}
.layout-add-item:hover { background: rgba(91,156,255,.15); border-color: rgba(91,156,255,.4); }
.layout-add-item small { display: block; color: var(--muted); font-size: 0.7rem; }
.layout-preview-wrap {
  margin-top: 0.75rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  overflow: hidden;
  background: #0b0f14;
  min-height: 70vh;
  position: relative;
}
.layout-iframe {
  display: block;
  width: 100%;
  height: min(78vh, 820px);
  border: 0;
  background: #0b0f14;
}
.layout-fs-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #0b0f14;
  display: flex;
  flex-direction: column;
}
.layout-fs-overlay[hidden] { display: none !important; }
.layout-fs-toolbar {
  flex: 0 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.75rem;
  background: rgba(11,15,20,.96);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.layout-fs-overlay .layout-iframe,
.layout-fs-overlay iframe {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}
.design-pane[hidden], .design-pane.hidden { display: none !important; }
.layout-pane-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0.75rem; }
.layout-mode-row { margin-bottom: 0.25rem; }
.layout-mode-toggle { display: inline-flex; gap: 0.25rem; margin-right: 0.35rem; }
.layout-mode-btn.active {
  background: rgba(125, 211, 252, 0.28) !important;
  border-color: rgba(125, 211, 252, 0.55) !important;
  color: #e8f7ff !important;
}
.layout-preview-wrap.is-mobile-preview {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.layout-preview-wrap.is-mobile-preview .layout-iframe {
  min-height: 720px;
  aspect-ratio: 9 / 16;
}

.design-subnav { display:flex; flex-wrap:wrap; gap:.45rem; margin:1rem 0 .5rem; }
.design-subnav .design-sub.active { outline:2px solid rgba(125,211,252,.55); }
/* === LIVE CHROME COMPACT + BUBBLE ABOVE (do not remove) === */
/* Header/Footer stay in place, smaller; bubbles always paint above them. */
body.public-page .wrap {
  padding-top: 0.35rem;
  padding-bottom: 0.75rem;
}
body.public-page .hero {
  z-index: 1;
  padding: 0.4rem 0.7rem 0.35rem;
  margin: 0 auto 0.15rem;
  max-width: 28rem;
  border-radius: 0.85rem;
}
body.public-page .hero .badge {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  padding: 0.12rem 0.5rem;
  margin: 0 0 0.25rem;
}
body.public-page .hero h1 {
  font-size: clamp(1.15rem, 2.8vw, 1.35rem);
  margin: 0.05rem 0;
  line-height: 1.15;
}
body.public-page .hero .sub {
  margin: 0.1rem 0 0.25rem;
  font-size: 0.75rem;
  line-height: 1.3;
}
body.public-page .discord-links {
  margin-top: 0.2rem;
  gap: 0.25rem;
}
body.public-page .discord-links-label {
  margin: 0 0 0.1rem;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
}
body.public-page .discord-links .btn-discord {
  padding: 0.28rem 0.65rem;
  font-size: 0.75rem;
  border-radius: 8px;
}
body.public-page .foot {
  z-index: 1;
  margin-top: 0.55rem;
  padding: 0.35rem 0.65rem;
  border-radius: 0.65rem;
  font-size: 0.72rem;
  line-height: 1.35;
}
body.public-page .foot p {
  margin: 0.12rem 0;
}
body.public-page .foot .admin-link {
  font-size: 0.7rem;
}

/* Bubble stage stacks above hero/footer so free-floating bubbles cover chrome */
body.public-page #projects,
body.public-page .bubble-stage {
  position: relative;
  z-index: 20;
}
body.public-page .bubble-stage {
  /* keep isolation for internal bubble layering; stage itself is above chrome */
  isolation: isolate;
  margin-top: 0.15rem;
}
body.public-page .bubble {
  z-index: 3;
}
body.public-page .bubble.active {
  z-index: 8;
}
body.public-page .bubble.is-grown {
  z-index: 9;
}
body.public-page .bubble.is-repelled {
  z-index: 4;
}
/* === END LIVE CHROME COMPACT === */
/* LIVE FILL STAGE retired: scene follows image */
/* After compact chrome: stage grows to fill viewport so no black void under content. */
html:has(body.public-page),
body.public-page {
  min-height: 100%;
  min-height: 100dvh;
}
body.public-page .wrap {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0.5rem;
  box-sizing: border-box;
}
body.public-page #projects {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.public-page .bubble-stage {
  flex: 1 1 auto;
  min-height: clamp(22rem, calc(100dvh - 11rem), 90dvh);
  min-height: clamp(22rem, calc(100vh - 11rem), 90vh);
  width: 100%;
}
body.public-page .foot {
  margin-top: auto;
  flex: 0 0 auto;
}
body.public-page .hero {
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  body.public-page .bubble-stage {
    min-height: clamp(24rem, calc(100dvh - 12rem), 88dvh);
    min-height: clamp(24rem, calc(100vh - 12rem), 88vh);
  }
}
/* === END LIVE FILL STAGE === */
/* === SCENE FROM IMAGE (do not remove) === */
/* Page size follows background image aspect; full artwork visible.
   Not forced into the viewport: if the scene is taller/wider than the window, the page scrolls. */
body.public-page {
  --scene-w: 1712;
  --scene-h: 1152;
  --scene-aspect: calc(var(--scene-w) / var(--scene-h));
  background-color: #05070c !important;
  background-image: none !important;
  background-attachment: scroll !important;
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  display: block;
  padding: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.public-page .wrap.scene-frame,
body.public-page .wrap {
  /* Prefer full viewport width; height comes from image aspect â†’ may exceed viewport â†’ scroll */
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--scene-w) / var(--scene-h);
  height: auto;
  min-height: calc(100vw / var(--scene-aspect));
  max-height: none;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
  display: block;
  position: relative;
  overflow: visible;
  border-radius: 0;
  background-color: #05070c;
  background-image:
    linear-gradient(180deg, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.85)) 0%, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.2)) 22%, rgba(5,7,12,0) 48%),
    radial-gradient(ellipse 90% 40% at 50% 100%, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.35)) 0%, transparent 70%),
    var(--scene-bg-image, none);
  background-size: 100% 100%, 100% 100%, 100% 100%;
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}
/* Chrome overlays the image; does not shrink the bubble coordinate space */
body.public-page .hero {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  padding: 0.35rem 0.65rem 0;
  box-sizing: border-box;
  pointer-events: none;
}
body.public-page .hero a,
body.public-page .hero button,
body.public-page .hero #discords,
body.public-page .hero #welcome-strip,
body.public-page .hero .welcome-strip,
body.public-page .hero details,
body.public-page .hero summary {
  pointer-events: auto;
}
body.public-page .foot {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  margin-top: 0;
  padding: 0 0.65rem 0.4rem;
  box-sizing: border-box;
  pointer-events: none;
}
body.public-page .foot a,
body.public-page .foot button {
  pointer-events: auto;
}
/* Full-bleed stage = image coordinate system for --bx/--by percentages */
body.public-page #projects {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: block;
  min-height: 0;
  margin: 0;
  padding: 0;
}
body.public-page .bubble-stage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  flex: none !important;
  z-index: 20;
  isolation: isolate;
  pointer-events: none;
  overflow: visible;
}
body.public-page .bubble-stage .bubble,
body.public-page .bubble-stage .bubble-resize-handle {
  pointer-events: auto;
}
body.public-page .bubble-stage .empty-stage {
  pointer-events: none;
}
body.public-page .bubble {
  z-index: 3;
}
body.layout-edit.public-page .bubble-stage {
  pointer-events: auto;
}
/* Popovers / toasts may extend past the scene; allow document scroll to reach them */
body.public-page .bubble-popover {
  max-height: min(70vh, 28rem);
  overflow: auto;
}
/* === END SCENE FROM IMAGE === */
/* === SCROLLABLE PAGE OVERRIDE (do not remove) === */
html:has(body.public-page),
body.public-page {
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}
body.public-page.layout-edit-fullscreen,
body.public-page.layout-edit.layout-edit-fullscreen {
  /* fullscreen editor may still fill the iframe viewport */
  height: 100% !important;
  max-height: 100% !important;
  overflow: auto !important;
}
/* === END SCROLLABLE PAGE OVERRIDE === */
/* === DUAL LAYOUT (do not remove) === */
/* Mobile portrait: ONE artwork (1008x1792), Atomic top / NEXUS bottom.
   Two half panels are only bubble zones (no separate BG files). Desktop unchanged. */

@media (max-width: 720px) and (orientation: portrait),
       (orientation: portrait) and (max-width: 1024px),
       (max-width: 480px) {

  body.public-page {
    --bubble-size: clamp(4.5rem, 17vw, 5.75rem);
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    overflow-x: hidden !important;
    overflow-y: auto !important;
    display: block !important;
    min-height: 100svh;
  }

  body.public-page .wrap.scene-frame,
  body.public-page .wrap {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    background-image: none !important;
    background-color: #05070c !important;
  }

  body.public-page .hero {
    position: relative !important;
    inset: auto !important;
    z-index: 5;
    max-width: none !important;
    margin: 0 !important;
    padding: max(0.55rem, env(safe-area-inset-top, 0px)) 0.75rem 0.4rem !important;
    border-radius: 0 !important;
    pointer-events: auto !important;
    text-align: center;
  }

  body.public-page .hero h1 {
    font-size: clamp(1.25rem, 6.5vw, 1.65rem) !important;
    line-height: 1.2 !important;
  }

  body.public-page .hero .sub {
    font-size: clamp(0.8rem, 3.4vw, 0.92rem) !important;
  }

  body.public-page .discord-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem !important;
  }

  body.public-page .discord-links .btn-discord {
    min-height: 2.5rem;
    touch-action: manipulation;
  }

  body.public-page #projects {
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto !important;
    z-index: 20;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Only hide desktop stage when JS confirmed mobile-split mode */
  body.public-page.layout-mobile #projects > .bubble-stage:not([data-half]) {
    display: none !important;
  }

  /* One portrait artwork (Atomic top / NEXUS bottom). Halves are only bubble zones. */
  body.public-page .mobile-split {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
    position: relative !important;
    aspect-ratio: 1008 / 1792 !important;
    min-height: calc(100vw * 1792 / 1008) !important;
    overflow: hidden !important;
    background-color: #05070c;
    background-repeat: no-repeat !important;
    background-size: 100% 100% !important;
    background-position: center center !important;
    background-image:
      linear-gradient(180deg, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.28)) 0%, rgba(5,7,12,0) 18%, rgba(5,7,12,0) 82%, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.22)) 100%),
      none;
  }

  body.public-page .mobile-half {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    flex: 1 1 50% !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
    background: transparent !important;
    background-image: none !important;
  }

  body.public-page .mobile-half.mobile-atomic {
    order: 1;
  }

  body.public-page .mobile-half.mobile-nexus {
    order: 2;
  }

  body.public-page .mobile-half .bubble-stage {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    background: transparent !important;
  }

  body.public-page .mobile-half .bubble {
    position: absolute !important;
    left: var(--bx, 0%) !important;
    top: var(--by, 0%) !important;
    right: auto !important;
    bottom: auto !important;
    width: calc(var(--bubble-size, 5rem) * var(--layout-scale, 1)) !important;
    height: calc(var(--bubble-size, 5rem) * var(--layout-scale, 1)) !important;
    max-width: none !important;
    max-height: none !important;
    flex: none !important;
    margin: 0 !important;
    pointer-events: auto !important;
    transform: translate(var(--rx, 0px), var(--ry, 0px)) scale(var(--bs, 1)) !important;
  }

  body.public-page .mobile-half .zone-label {
    display: block !important;
    opacity: 0.22 !important;
    font-size: 0.65rem !important;
  }

  body.public-page .foot {
    position: relative !important;
    inset: auto !important;
    z-index: 5;
    margin: 0 !important;
    padding: 0.5rem 0.75rem max(0.65rem, env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 0 !important;
    pointer-events: auto !important;
  }

  body.public-page .bubble-popover {
    width: min(26rem, calc(100vw - 1.25rem)) !important;
    max-height: min(75svh, 30rem) !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  body.public-page .bubble-popover.open {
    transform: translate(-50%, -50%) !important;
  }

  body.public-page .bubble-face {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
}
/* === END DUAL LAYOUT === */

/* === MOBILE LANDSCAPE BG (do not remove) === */
/* Handy Querformat: full horizontal art (NEXUS left / Atomic right). Not the portrait cut. */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1100px) {
  body.public-page.layout-mobile-landscape {
    --bubble-size: clamp(3.6rem, 12vmin, 5.25rem);
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.public-page.layout-mobile-landscape .wrap.scene-frame,
  body.public-page.layout-mobile-landscape .wrap {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 1712 / 1152 !important;
    height: auto !important;
    min-height: calc(100vw * 1152 / 1712) !important;
    margin: 0 auto !important;
    background-color: #05070c !important;
    background-image:
      linear-gradient(180deg, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.85)) 0%, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.2)) 22%, rgba(5,7,12,0) 48%),
      radial-gradient(ellipse 90% 40% at 50% 100%, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.35)) 0%, transparent 70%),
      none;
    background-size: 100% 100%, 100% 100%, 100% 100% !important;
    background-position: center, center, center !important;
    background-repeat: no-repeat !important;
  }

  body.public-page.layout-mobile-landscape .mobile-split {
    display: none !important;
  }

  body.public-page.layout-mobile-landscape .hero {
    position: absolute !important;
    left: 0; right: 0; top: 0;
    z-index: 5;
    padding: 0.4rem 0.75rem !important;
    pointer-events: auto !important;
  }

  body.public-page.layout-mobile-landscape .hero h1 {
    font-size: clamp(1.05rem, 4.2vw, 1.45rem) !important;
  }

  body.public-page.layout-mobile-landscape .foot {
    position: absolute !important;
    left: 0; right: 0; bottom: 0;
    z-index: 5;
    padding: 0.35rem 0.75rem max(0.45rem, env(safe-area-inset-bottom, 0px)) !important;
  }

  body.public-page.layout-mobile-landscape #projects {
    position: absolute !important;
    inset: 0 !important;
    z-index: 20;
  }

  body.public-page.layout-mobile-landscape .bubble-stage {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
  }

  body.public-page.layout-mobile-landscape .bubble {
    position: absolute !important;
    left: var(--bx, 0%) !important;
    top: var(--by, 0%) !important;
  }
}
/* === END MOBILE LANDSCAPE BG === */

/* === HANDY LAYOUT EDITOR (force portrait split on wide admin viewports) === */
body.public-page.layout-edit.layout-mobile,
body.public-page.layout-edit-mobile {
  --bubble-size: clamp(4.5rem, 17vw, 5.75rem);
  padding: 2.5rem 0 5.5rem !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: block !important;
  min-height: 100svh;
  background: #05070c !important;
}

body.public-page.layout-edit.layout-mobile .wrap.scene-frame,
body.public-page.layout-edit.layout-mobile .wrap,
body.public-page.layout-edit-mobile .wrap.scene-frame,
body.public-page.layout-edit-mobile .wrap {
  width: min(100%, 420px) !important;
  max-width: 420px !important;
  aspect-ratio: auto !important;
  height: auto !important;
  min-height: auto !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
  background-image: none !important;
  background-color: #05070c !important;
}

body.public-page.layout-edit.layout-mobile .hero,
body.public-page.layout-edit-mobile .hero {
  position: relative !important;
  inset: auto !important;
  z-index: 5;
  max-width: none !important;
  margin: 0 !important;
  padding: 0.55rem 0.75rem 0.4rem !important;
  border-radius: 0 !important;
  pointer-events: auto !important;
  text-align: center;
}

body.public-page.layout-edit.layout-mobile #projects,
body.public-page.layout-edit-mobile #projects {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.public-page.layout-edit.layout-mobile #projects > .bubble-stage:not([data-half]),
body.public-page.layout-edit-mobile #projects > .bubble-stage:not([data-half]) {
  display: none !important;
}

body.public-page.layout-edit.layout-mobile .mobile-split,
body.public-page.layout-edit-mobile .mobile-split,
body.public-page.layout-mobile .mobile-split {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  gap: 0 !important;
  position: relative !important;
  aspect-ratio: 1008 / 1792 !important;
  min-height: calc(100% * 1792 / 1008) !important;
  overflow: hidden !important;
  background-color: #05070c;
  background-repeat: no-repeat !important;
  background-size: 100% 100% !important;
  background-position: center center !important;
  background-image:
    linear-gradient(180deg, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.28)) 0%, rgba(5,7,12,0) 18%, rgba(5,7,12,0) 82%, rgba(5,7,12,calc(var(--scene-overlay, .18) * 0.22)) 100%),
    none;
}

body.public-page.layout-edit.layout-mobile .mobile-half,
body.public-page.layout-edit-mobile .mobile-half,
body.public-page.layout-mobile .mobile-half {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  flex: 1 1 50% !important;
  min-height: 0 !important;
  height: auto !important;
  aspect-ratio: auto !important;
  overflow: hidden !important;
  background: transparent !important;
  background-image: none !important;
}

body.public-page.layout-edit.layout-mobile .mobile-half.mobile-atomic,
body.public-page.layout-edit-mobile .mobile-half.mobile-atomic { order: 1; }
body.public-page.layout-edit.layout-mobile .mobile-half.mobile-nexus,
body.public-page.layout-edit-mobile .mobile-half.mobile-nexus { order: 2; }

body.public-page.layout-edit.layout-mobile .mobile-half .bubble-stage,
body.public-page.layout-edit-mobile .mobile-half .bubble-stage,
body.public-page.layout-mobile .mobile-half .bubble-stage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  pointer-events: none !important;
  overflow: hidden !important;
  background: transparent !important;
}

body.public-page.layout-edit.layout-mobile .mobile-half .bubble,
body.public-page.layout-edit-mobile .mobile-half .bubble,
body.public-page.layout-mobile .mobile-half .bubble {
  position: absolute !important;
  left: var(--bx, 0%) !important;
  top: var(--by, 0%) !important;
  right: auto !important;
  bottom: auto !important;
  width: calc(var(--bubble-size, 5rem) * var(--layout-scale, 1)) !important;
  height: calc(var(--bubble-size, 5rem) * var(--layout-scale, 1)) !important;
  max-width: none !important;
  max-height: none !important;
  flex: none !important;
  margin: 0 !important;
  pointer-events: auto !important;
  transform: translate(var(--rx, 0px), var(--ry, 0px)) scale(var(--bs, 1)) !important;
}

body.public-page.layout-edit.layout-mobile .mobile-half .zone-label,
body.public-page.layout-edit-mobile .mobile-half .zone-label {
  display: block !important;
  opacity: 0.35 !important;
  font-size: 0.7rem !important;
}

body.public-page.layout-edit.layout-mobile .foot,
body.public-page.layout-edit-mobile .foot {
  position: relative !important;
  inset: auto !important;
  z-index: 5;
  margin: 0 !important;
  padding: 0.5rem 0.75rem 0.65rem !important;
  border-radius: 0 !important;
  pointer-events: auto !important;
}

body.public-page.layout-edit.layout-mobile .bubble-stage,
body.public-page.layout-edit-mobile .bubble-stage {
  pointer-events: auto !important;
}
/* === END HANDY LAYOUT EDITOR === */

/* === GUEST OPTIMIZE PACK === */
/* Welcome strip – compact, does not block the scene */
.welcome-strip {
  margin: 0.55rem auto 0;
  max-width: 36rem;
  text-align: center;
  pointer-events: auto;
}
.welcome-strip[hidden] { display: none !important; }
.welcome-line {
  margin: 0;
  font-size: clamp(0.78rem, 2.4vw, 0.9rem);
  color: rgba(226, 232, 240, 0.88);
  line-height: 1.35;
}
.welcome-kicker {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(61, 214, 198, 0.16);
  color: #9af0e6;
  border: 1px solid rgba(61, 214, 198, 0.28);
}
.welcome-details {
  margin: 0.35rem auto 0;
  max-width: 22rem;
  text-align: left;
  background: rgba(8, 12, 18, 0.45);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 0.2rem 0.65rem 0.35rem;
}
.welcome-details summary {
  cursor: pointer;
  font-weight: 650;
  font-size: 0.82rem;
  color: #e8eef7;
  list-style: none;
  padding: 0.35rem 0;
}
.welcome-details summary::-webkit-details-marker { display: none; }
.welcome-details summary::after {
  content: " ▾";
  opacity: 0.55;
  font-size: 0.75em;
}
.welcome-details[open] summary::after { content: " ▴"; }
.welcome-steps {
  margin: 0 0 0.35rem 1.1rem;
  padding: 0;
  font-size: 0.78rem;
  color: rgba(200, 210, 224, 0.92);
  line-height: 1.45;
}
.welcome-steps li { margin: 0.15rem 0; }

/* Status badges */
.tag-status {
  font-size: 0.58rem !important;
  padding: 0.1rem 0.38rem !important;
  letter-spacing: 0.03em;
  border-radius: 999px;
}
.tag-status-online { background: rgba(52, 211, 153, 0.18); color: #a7f3d0; }
.tag-status-maint { background: rgba(251, 191, 36, 0.2); color: #fde68a; }
.tag-status-lan { background: rgba(96, 165, 250, 0.2); color: #bfdbfe; }
.tag-status-hidden { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.bubble-status {
  font-size: 0.52rem !important;
  padding: 0.08rem 0.32rem !important;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}
.bubble.status-maintenance { box-shadow: 0 0 0 1.5px rgba(251, 191, 36, 0.35); }
.bubble.status-lan { box-shadow: 0 0 0 1.5px rgba(96, 165, 250, 0.35); }

/* Popover: primary actions first, clearer labels */
.bubble-popover .actions-primary {
  margin: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.bubble-popover .actions-primary .btn {
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
}
.bubble-desc-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(154, 240, 230, 0.9);
  margin-right: 0.25rem;
}
.bubble-popover .meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* Discord: larger tap targets */
.btn-discord {
  min-height: 2.5rem;
  padding: 0.55rem 1rem !important;
  font-size: 0.9rem !important;
}
.discord-links {
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Friendly empty / error */
.empty-friendly {
  margin: 1.5rem auto;
  max-width: 22rem;
  text-align: center;
  padding: 1rem 1.1rem;
  background: rgba(8,12,18,0.55);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1rem;
}
.empty-friendly p { margin: 0.25rem 0; }
.empty-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(200,210,224,0.75);
  font-size: 0.9rem;
  text-align: center;
  pointer-events: none;
}
#load-err {
  text-align: center;
  margin: 0.75rem auto;
  max-width: 28rem;
}

/* Footer tagline */
.foot-tagline {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.78rem;
  color: rgba(180, 195, 215, 0.75);
}

/* Mobile bubble readability – avoid clipped titles */
@media (max-width: 640px) {
  .bubble { width: 6.1rem; height: 6.1rem; }
  .bubble-face {
    padding: 0.55rem 0.42rem !important;
    gap: 0.18rem !important;
  }
  .bubble-title {
    font-size: 0.62rem !important;
    line-height: 1.15 !important;
    -webkit-line-clamp: 3 !important;
    padding: 0 0.1rem !important;
  }
  .bubble-kind {
    font-size: 0.5rem !important;
    padding: 0.08rem 0.28rem !important;
  }
  .btn-discord {
    min-height: 2.65rem;
    min-width: 8.5rem;
  }
  .welcome-strip {
    margin-top: 0.4rem;
    padding: 0 0.35rem;
  }
}

/* Portrait split: keep titles readable */
@media (max-width: 720px) and (orientation: portrait),
       (orientation: portrait) and (max-width: 1024px),
       (max-width: 480px) {
  body.public-page .mobile-half .bubble-face {
    padding: 0.45rem 0.35rem !important;
  }
  body.public-page .mobile-half .bubble-title {
    font-size: clamp(0.52rem, 2.8vw, 0.68rem) !important;
    -webkit-line-clamp: 3 !important;
  }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bubble.is-grown,
  .bubble.is-repelled {
    --rx: 0px !important;
    --ry: 0px !important;
    --bs: 1 !important;
  }
  .bubble-backdrop,
  .bubble-popover {
    transition: none !important;
  }
}

/* === NEXUS-ONLY SINGLE SCENE === */
/* Disable Atomic/NEXUS split chrome completely */
.mobile-split,
.mobile-half,
.mobile-atomic,
.mobile-nexus {
  display: contents;
}
body.public-page .mobile-split {
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
}
body.public-page .mobile-half {
  display: none !important;
}

/* Compact mobile = single full-viewport stage (no half art) */
body.public-page.layout-mobile {
  --bubble-size: clamp(5.4rem, 18vw, 6.6rem);
}
body.public-page.layout-mobile .wrap.scene-frame,
body.public-page.layout-mobile .wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-height: 100dvh !important;
  height: auto !important;
  aspect-ratio: auto !important;
  margin: 0 auto !important;
  background-image: none !important; /* inherit body NEXUS gradient; no split JPG */
  background-color: transparent !important;
}
body.public-page.layout-mobile #projects {
  position: relative !important;
  min-height: clamp(28rem, 62vh, 44rem);
  z-index: 2;
}
body.public-page.layout-mobile .bubble-stage {
  position: relative !important;
  width: 100% !important;
  min-height: clamp(28rem, 62vh, 44rem) !important;
  height: auto !important;
  inset: auto !important;
}
body.public-page.layout-mobile .hero {
  position: relative !important;
  z-index: 5;
  margin: 0.5rem auto 0.35rem !important;
}
body.public-page.layout-mobile .foot {
  position: relative !important;
  z-index: 5;
  margin-top: 1rem !important;
}
body.public-page.layout-mobile .zone-label-atomic {
  display: none !important;
}

/* Landscape phones: same single scene, no dual landscape art */
body.public-page.layout-mobile-landscape .wrap.scene-frame,
body.public-page.layout-mobile-landscape .wrap {
  background-image: none !important;
  aspect-ratio: auto !important;
  min-height: 100dvh !important;
}

/* Layout editor mobile: single stage, not Atomic/NEXUS halves */
body.public-page.layout-edit.layout-mobile .mobile-split,
body.public-page.layout-edit-mobile .mobile-split {
  display: block !important;
}
body.public-page.layout-edit.layout-mobile .mobile-half,
body.public-page.layout-edit-mobile .mobile-half {
  display: none !important;
}
body.public-page.layout-edit.layout-mobile .bubble-stage,
body.public-page.layout-edit-mobile .bubble-stage {
  position: relative !important;
  width: 100% !important;
  min-height: 70vh !important;
  background-image: none !important;
}

/* Hide Atomic zone label everywhere on public */
.zone-label-atomic { display: none !important; }


/* === CLICK FIX HEADER/FOOTER (2026-09-28) === */
body.public-page .hero,
body.public-page .foot {
  z-index: 30 !important;
}
body.public-page #projects,
body.public-page .bubble-stage {
  z-index: 20;
}
body.public-page .bubble-stage {
  pointer-events: none !important;
}
body.public-page .bubble-stage .bubble,
body.public-page .bubble-stage .bubble-resize-handle {
  pointer-events: auto !important;
}
body.public-page .bubble-stage .empty-stage {
  pointer-events: none !important;
}
body.layout-edit.public-page .bubble-stage {
  pointer-events: auto !important;
}
body.public-page .hero a,
body.public-page .hero button,
body.public-page .hero #discords,
body.public-page .hero #welcome-strip a,
body.public-page .hero #welcome-strip button,
body.public-page .hero #welcome-strip details,
body.public-page .hero #welcome-strip summary,
body.public-page .foot a,
body.public-page .foot button {
  pointer-events: auto !important;
  position: relative;
  z-index: 31;
}

/* === CARDS MODE PUBLIC (2026-09-28) — no bubble scene on live page === */
body.public-page.cards-mode {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  padding: 1rem 1rem 2rem;
  background-color: #05070c;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
}
body.public-page.cards-mode .wrap,
body.public-page.cards-mode .wrap.scene-frame {
  position: relative !important;
  width: min(960px, 100%) !important;
  max-width: 960px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  aspect-ratio: auto !important;
  min-height: 0 !important;
  height: auto !important;
  inset: auto !important;
  background-image: none !important;
  background-color: transparent !important;
  display: block !important;
  overflow: visible !important;
  z-index: auto !important;
}
body.public-page.cards-mode .hero,
body.public-page.cards-mode .foot {
  position: relative !important;
  inset: auto !important;
  z-index: 5 !important;
  pointer-events: auto !important;
  max-width: none !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center;
}
body.public-page.cards-mode .hero {
  padding: 0.85rem 1rem 0.5rem !important;
  margin-bottom: 0.35rem !important;
}
body.public-page.cards-mode .hero a,
body.public-page.cards-mode .hero button,
body.public-page.cards-mode .foot a,
body.public-page.cards-mode .foot button {
  pointer-events: auto !important;
  position: relative;
  z-index: 6;
}
body.public-page.cards-mode .discord-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 0.55rem;
  pointer-events: auto !important;
}
body.public-page.cards-mode .discord-links-label {
  width: 100%;
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #9aa7b8);
}
body.public-page.cards-mode .btn-discord {
  pointer-events: auto !important;
}
body.public-page.cards-mode .welcome-strip {
  margin: 0.65rem auto 0;
  max-width: 36rem;
  pointer-events: auto !important;
}
body.public-page.cards-mode #projects,
body.public-page.cards-mode .bubble-stage {
  position: relative !important;
  inset: auto !important;
  z-index: 1 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: auto !important;
  display: block !important;
}
body.public-page.cards-mode .filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin: 1.1rem 0 0.85rem;
  position: relative;
  z-index: 2;
}
body.public-page.cards-mode .chip {
  border: 1px solid var(--border, rgba(255,255,255,.14));
  background: rgba(255,255,255,.03);
  color: var(--muted, #9aa7b8);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
body.public-page.cards-mode .chip.active,
body.public-page.cards-mode .chip:hover {
  color: var(--text, #e8eef7);
  border-color: var(--accent, #5b9cff);
  background: rgba(91,156,255,.12);
}
body.public-page.cards-mode .section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted, #9aa7b8);
  margin: 1.35rem 0 0.75rem;
  font-weight: 700;
  grid-column: 1 / -1;
}
body.public-page.cards-mode .card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 720px) {
  body.public-page.cards-mode .card-grid {
    grid-template-columns: 1fr 1fr;
  }
}
body.public-page.cards-mode .server-card {
  margin-bottom: 0;
  background: rgba(16, 22, 32, 0.88);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 1.05rem 1.15rem;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
}
body.public-page.cards-mode .server-card.muted { opacity: 0.78; }
body.public-page.cards-mode .server-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin-bottom: 0.65rem;
}
body.public-page.cards-mode .server-head h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.25;
}
body.public-page.cards-mode .meta {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
}
body.public-page.cards-mode .meta dt {
  color: var(--muted, #9aa7b8);
  font-size: 0.85rem;
  margin: 0;
}
body.public-page.cards-mode .meta dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
body.public-page.cards-mode .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
body.public-page.cards-mode .tag-status-online { background: rgba(62,207,142,.15); color: #7eebbc; }
body.public-page.cards-mode .tag-status-maint { background: rgba(240,180,41,.18); color: #ffd56a; }
body.public-page.cards-mode .tag-status-lan { background: rgba(91,156,255,.18); color: #9bc2ff; }
body.public-page.cards-mode .tag-status-hidden { background: rgba(160,160,160,.18); color: #c0c0c0; }
body.public-page.cards-mode .foot {
  margin-top: 1.75rem !important;
  padding: 0.75rem 0.5rem !important;
}
body.public-page.cards-mode .bubble,
body.public-page.cards-mode .bubble-popover,
body.public-page.cards-mode .bubble-backdrop,
body.public-page.cards-mode .empty-stage,
body.public-page.cards-mode .mobile-half,
body.public-page.cards-mode .zone-label,
body.public-page.cards-mode .zone-label-atomic {
  display: none !important;
}
