:root {
  --cyan: #00ffc8;
  --violet: #7c3aed;
  --gold: #ffd700;
  --bg: #06080d;
  --bg-night: #020308;
  --text: #fff;
  --text-muted: rgba(255,255,255,0.85);
  --neon-warm: #ff7a00;
  --live-red: #ff2244;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Audiowide', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.6s;
}
.app { position: fixed; inset: 0; overflow: hidden; perspective: 1400px; }

/* Cinematic vignette */
.app::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 38%, transparent 0%, transparent 42%, rgba(0,0,0,0.5) 100%),
    radial-gradient(ellipse at 70% 70%, rgba(124,58,237,0.10), transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(0,255,200,0.06), transparent 55%);
  pointer-events: none;
  z-index: 7;
}
.app::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background: linear-gradient(to bottom,
    rgba(0,255,200,0.04),
    rgba(124,58,237,0.06) 40%,
    rgba(0,0,0,0.35) 100%);
  pointer-events: none;
  z-index: 7;
}

.bg-svg { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform; }
/* Floor — kept clean inside SVG itself, no overlay grid lines */
#floor3d {
  display: none; /* tiles now inside SVG */
  position: absolute;
  bottom: 0; left: -20%; width: 140%; height: 34%;
  background:
    linear-gradient(rgba(155,138,108,0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,138,108,0.55) 1px, transparent 1px),
    linear-gradient(150deg, #ede4d4 0%, #ddd1bc 35%, #e8dece 65%, #d5c9b2 100%);
  background-size: 80px 80px, 80px 80px, 100% 100%;
  transform-origin: top center;
  transform: perspective(550px) rotateX(70deg);
  z-index: 2; pointer-events: none;
  opacity: 0.88;
  overflow: hidden;
}
#floor3d::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, rgba(6,8,13,0.97) 100%);
  pointer-events: none;
}
.cz { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }

/* Header backdrop bar — keeps brand text legible */
.header-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.78), rgba(0,0,0,0.0));
  z-index: 28;
  pointer-events: none;
}

/* Brand top-left */
.brand {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 16px;
  display: flex; align-items: center; gap: 10px;
  z-index: 30;
  background: rgba(0,0,0,0.65);
  padding: 6px 12px 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(0,255,200,0.25);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.brand img {
  height: 36px; width: auto; border-radius: 6px;
  filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.5));
}
.brand-text {
  color: var(--gold); font-weight: 500; font-size: 12px;
  letter-spacing: 2.5px; font-family: 'Orbitron', monospace;
  display: flex; flex-direction: column; line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.brand-text .sub {
  color: var(--cyan); font-size: 9px; letter-spacing: 2px;
}

/* Right cluster — burger + mobile controls row */
.right-cluster {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 33;
}
.mob-badge-row {
  display: none; /* hidden desktop — shown mobile via media query */
  align-items: center;
  gap: 5px;
}
.mob-notif, .mob-mode {
  background: rgba(6,8,13,0.85);
  border: 1px solid rgba(0,255,200,0.3);
  border-radius: 8px;
  cursor: pointer;
  color: #e8e8e8;
  font-size: 16px;
  padding: 4px 7px;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s;
}
.mob-notif.enabled { border-color: var(--cyan); background: rgba(0,255,200,0.1); }
.mob-mode.night { color: #a78bfa; }
.mob-badge-row .live-badge {
  padding: 4px 8px;
  font-size: 7px;
}
.mobile-live-callout {
  position: fixed;
  top: calc(50px + env(safe-area-inset-top));
  right: 86px;
  z-index: 34;
  display: none;
  max-width: 150px;
  padding: 7px 9px;
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255,34,68,0.98), rgba(172,0,42,0.98));
  color: #fff;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.4px;
  text-align: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.42), 0 0 18px rgba(255,34,68,0.42);
  pointer-events: auto;
  cursor: pointer;
}
.mobile-live-callout::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 28px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: rgba(255,34,68,0.98);
  border-left: 1px solid rgba(255,255,255,0.82);
  border-top: 1px solid rgba(255,255,255,0.82);
}
.mobile-live-callout.show { display: block; }

/* Right utility cluster */
.utils {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px;
  display: flex; gap: 8px; z-index: 30; align-items: center;
  flex-wrap: wrap; justify-content: flex-end;
}
.util-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(6,8,13,0.9); padding: 7px 12px;
  border: 1px solid rgba(0,255,200,0.3); cursor: pointer;
  color: #9fb; font-size: 9px; font-family: 'Orbitron', monospace;
  letter-spacing: 1.5px; backdrop-filter: blur(8px);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: all 0.2s;
}
.util-btn:hover { border-color: var(--cyan); color: #fff; }
.util-btn.enabled { color: var(--gold); border-color: var(--gold); }

/* LIVE badge */
.live-badge.live-big {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: linear-gradient(135deg, rgba(40,40,40,0.85), rgba(20,20,20,0.85));
  border: 2px solid #555;
  cursor: pointer;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px;
  color: #ccc;
  border-radius: 999px;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.live-badge .live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #555;
  transition: all 0.3s;
}
.live-badge.live-big.on {
  background: linear-gradient(135deg, #ff2244, #cc0033);
  border-color: #fff; color: #fff;
  font-size: 13px; padding: 11px 22px;
  box-shadow: 0 0 30px rgba(255,34,68,0.7), 0 6px 20px rgba(0,0,0,0.5);
  animation: liveBigPulse 1.4s infinite;
}
.live-badge.live-big.on .live-dot {
  background: #fff;
  box-shadow: 0 0 12px #fff, 0 0 24px #ff2244;
  animation: liveDotPulse 0.9s infinite;
}
@keyframes liveBigPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(255,34,68,0.7), 0 6px 20px rgba(0,0,0,0.5); }
  50%      { transform: scale(1.04); box-shadow: 0 0 50px rgba(255,34,68,0.95), 0 6px 28px rgba(0,0,0,0.5); }
}
@keyframes liveDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.7; }
}

/* Light bulb mode toggle */
.mode.bulb {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(6,8,13,0.85);
  padding: 5px 12px 5px 8px;
  border: 1px solid rgba(255,215,0,0.4);
  cursor: pointer;
  color: #ccc;
  font-family: 'Orbitron', monospace; font-size: 9px;
  letter-spacing: 1.5px;
  border-radius: 26px;
  transition: all 0.3s;
}
.mode.bulb .bulb-svg { width: 26px; height: 32px; }
.mode.bulb .bulb-glass { fill: #2a2a30; stroke: #555; transition: all 0.4s; }
.mode.bulb .bulb-filament { stroke: #444; transition: all 0.4s; }
.mode.bulb .bulb-rays { opacity: 0; transition: opacity 0.4s; }
.mode.bulb.night .bulb-glass {
  fill: #fff8c0; stroke: #caa066;
  filter: drop-shadow(0 0 8px #ffd700) drop-shadow(0 0 16px rgba(255,215,0,0.7));
}
.mode.bulb.night .bulb-filament { stroke: #ff9020; }
.mode.bulb.night .bulb-rays { opacity: 1; animation: bulbFlick 4s infinite; }
.mode.bulb.night {
  border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 20px rgba(255,215,0,0.35);
}
@keyframes bulbFlick {
  0%, 30%, 36%, 60%, 100% { opacity: 1; }
  32%, 35% { opacity: 0.5; }
  62% { opacity: 0.7; }
}
.bulb-label { font-size: 9px; }

.lang-btn {
  background: rgba(6,8,13,0.85);
  border: 1px solid rgba(0,255,200,0.3); cursor: pointer;
  color: #9fb; font-size: 9px; font-family: 'Orbitron', monospace;
  letter-spacing: 1.5px; padding: 7px 10px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.lang-btn:hover { border-color: var(--cyan); color: #fff; }

/* Burger button — hidden on desktop */
.burger {
  position: static; /* position controlled by .right-cluster */
  width: 44px; height: 44px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(0,255,200,0.45);
  border-radius: 10px;
  cursor: pointer;
  z-index: 32;
  display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.burger span {
  width: 22px; height: 2px;
  background: var(--cyan);
  border-radius: 1px;
  transition: all 0.3s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav — bigger, sitting on curtain */
.nav {
  position: absolute; top: 26%; left: 1%;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 30;
  width: 22%;
  max-width: 220px;
}
.tab {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 14px 22px 14px 18px;
  background:
    linear-gradient(135deg, rgba(6,10,16,0.62), rgba(23,16,36,0.52)),
    linear-gradient(90deg, rgba(255,215,0,0.13), rgba(0,255,200,0.1));
  border: 1px solid rgba(255,215,0,0.78);
  color: #fff7c2; cursor: pointer;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 14px; font-weight: 800;
  letter-spacing: 1.6px; text-transform: uppercase;
  transition: all 0.3s; backdrop-filter: blur(10px) saturate(1.25);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%);
  width: 100%;
  box-shadow:
    0 8px 22px rgba(0,0,0,0.48),
    inset 0 0 22px rgba(255,255,255,0.055),
    inset 0 0 0 1px rgba(255,255,255,0.12);
  text-shadow:
    0 2px 3px rgba(0,0,0,0.95),
    0 0 10px rgba(0,255,200,0.4);
}
.tab::before {
  content: ''; width: 8px; height: 8px;
  background: var(--gold); flex-shrink: 0;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  transition: all 0.3s;
}
.tab .num {
  font-size: 10px; color: var(--violet);
  letter-spacing: 1px; margin-left: auto;
  opacity: 0.85;
}
.tab:hover {
  border-color: var(--cyan); color: #fff;
  background:
    linear-gradient(135deg, rgba(4,18,22,0.96), rgba(38,22,62,0.93)),
    linear-gradient(90deg, rgba(0,255,200,0.18), rgba(255,215,0,0.12));
  transform: translateX(4px);
}
.tab:hover::before { background: var(--cyan); transform: scale(1.4); }
.tab.active {
  background:
    linear-gradient(135deg, rgba(0,255,200,0.36), rgba(124,58,237,0.45)),
    linear-gradient(90deg, rgba(0,0,0,0.7), rgba(0,0,0,0.45));
  border-color: var(--cyan); color: #ffffff;
  box-shadow:
    0 0 24px rgba(0,255,200,0.46),
    0 8px 24px rgba(0,0,0,0.55),
    inset 0 0 20px rgba(0,255,200,0.18);
}
.tab.active::before { background: var(--gold); animation: pulse 1.5s infinite; }
.tab.active .num { color: var(--gold); }
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.6; }
}

/* Particles, grid */
.particles { position: absolute; inset: 0; pointer-events: none; z-index: 22; }
.particle { position: absolute; width: 2px; height: 2px; border-radius: 50%; animation: drift linear infinite; }
@keyframes drift {
  0% { transform: translateY(100vh) translateX(0); opacity: 0; }
  10% { opacity: 0.5; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-20vh) translateX(20px); opacity: 0; }
}

.swayable {
  transform-origin: 40px 100px;
  animation: swayAnim 8s ease-in-out infinite alternate;
}
@keyframes swayAnim {
  0% { transform: rotate(0deg) skewX(0deg); }
  100% { transform: rotate(-0.5deg) skewX(-1.5deg); }
}

/* Serial lights vertical strand sway */
@keyframes serialSway {
  0%   { transform: rotate(0deg) translateX(0); }
  25%  { transform: rotate(2.5deg) translateX(2px); }
  50%  { transform: rotate(-1.8deg) translateX(-2px); }
  75%  { transform: rotate(1.2deg) translateX(1px); }
  100% { transform: rotate(0deg) translateX(0); }
}
.serial-strand { animation: serialSway 5s ease-in-out infinite; }

/* Notification tooltip near NOTIFS button */
.notif-tooltip {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(4px) scale(0.9);
  background: linear-gradient(135deg, #ff2244, #cc0033);
  color: #fff; padding: 8px 14px; border-radius: 8px;
  font-family: 'Orbitron', monospace; font-size: 10px; letter-spacing: 1px;
  white-space: nowrap; cursor: pointer; z-index: 40;
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow: 0 8px 20px rgba(255,34,68,0.4);
  opacity: 0; pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.4, 0.5, 1);
}
.notif-tooltip::before {
  content: ''; position: absolute; top: -6px; left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-bottom: 6px solid #ff2244;
}
.notif-tooltip.show { opacity: 1; transform: translateX(-50%) translateY(8px) scale(1); pointer-events: auto; }
.util-btn { position: relative; }

/* Install guide popup */
.install-guide {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: linear-gradient(135deg, rgba(6,8,13,0.97), rgba(18,12,28,0.97));
  border: 1px solid var(--cyan); border-radius: 16px;
  padding: 24px 28px; z-index: 95; min-width: 280px; max-width: 400px;
  opacity: 0; pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.4, 0.5, 1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.8), 0 0 30px rgba(0,255,200,0.15);
  backdrop-filter: blur(10px);
}
.install-guide.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.ig-title { font-family: 'Orbitron', monospace; font-size: 14px; color: var(--cyan); letter-spacing: 2px; margin-bottom: 16px; }
.ig-steps { list-style: none; counter-reset: steps; padding: 0; }
.ig-steps li {
  counter-increment: steps; padding: 8px 0 8px 36px; position: relative;
  font-size: 13px; color: #e8e8e8; border-bottom: 1px solid rgba(0,255,200,0.08);
  line-height: 1.4;
}
.ig-steps li::before {
  content: counter(steps); position: absolute; left: 0; top: 8px;
  width: 24px; height: 24px; background: var(--cyan); color: #000;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: 'Orbitron', monospace;
}
.ig-steps li:last-child { border-bottom: 0; }
.ig-steps strong { color: var(--gold); }
.ig-close {
  margin-top: 16px; width: 100%; padding: 10px;
  background: rgba(0,255,200,0.1); border: 1px solid var(--cyan);
  color: var(--cyan); font-family: 'Orbitron', monospace;
  font-size: 11px; cursor: pointer; border-radius: 6px; letter-spacing: 1px;
}
.ig-close:hover { background: var(--cyan); color: #000; }

/* Chair — reduce size when in about section to avoid blocking text */
/* about page: chair same as home page */

/* Reaction popup — circle-crop image, hides any bg color */
.reaction-popup img {
  width: 140px; height: 140px; object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(0,255,200,0.45);
  box-shadow: 0 0 22px rgba(0,255,200,0.18);
  background: #0d0f1a;
}

/* Mon-controls — clean centered row, no orphan absolutely-positioned buttons */
.mon-controls {
  position: absolute !important;
  left: 0; right: 0; bottom: 0;
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  z-index: 5;
  opacity: 0.85;
}
.mon-iframe:hover .mon-controls { opacity: 1; }
.mon-controls button {
  position: static !important;
  transform: none !important;
  width: 26px; height: 26px;
  font-size: 12px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(0,255,200,0.55);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.mon-controls button:hover {
  background: rgba(0,255,200,0.25); border-color: var(--cyan);
  transform: scale(1.08) !important;
}

/* Mobile header — clean single row, iOS safe-area aware */
@media (max-width: 768px) {
  /* Header backdrop grows with safe-area so dynamic island doesn't block content */
  .header-backdrop {
    height: calc(56px + env(safe-area-inset-top));
  }
  /* Brand: logo + text, left-anchored, fits within safe row */
  .brand {
    top: calc(8px + env(safe-area-inset-top));
    left: 10px; right: auto; transform: none;
    max-width: 140px;
    padding: 4px 8px 4px 6px;
  }
  .brand img { height: 26px; }
  .brand-text { font-size: 9px; letter-spacing: 1.5px; }
  .brand-text .sub { font-size: 7px; display: none; }
  /* Utils cluster: right side, burger on far right */
  .utils {
    top: calc(8px + env(safe-area-inset-top));
    right: 50px; left: auto;
    display: flex; align-items: center; gap: 3px;
    max-width: calc(100% - 180px);
    flex-wrap: nowrap; overflow: visible;
  }
  .utils .live-badge.live-big {
    font-size: 7px; padding: 3px 6px;
    letter-spacing: 0.5px; white-space: nowrap;
    gap: 4px;
  }
  .utils .live-badge.live-big .live-text,
  .utils .live-badge.live-big.on .live-text {
    display: inline;
    font-size: 7px;
  }
  .utils .live-badge.live-big .live-dot { width: 7px; height: 7px; }
  .utils .mode, .utils .lang-btn, .utils #notifBtn {
    flex-shrink: 0;
  }
  .utils .mode.bulb {
    width: 38px;
    height: 38px;
    padding: 3px;
  }
  .utils .mode.bulb .bulb-svg { width: 22px; height: 28px; }
  .utils #notifBtn { font-size: 7px; padding: 4px 6px; letter-spacing: 0.5px; }
  /* Burger: far right, safe-area aware */
  .burger {
    top: calc(8px + env(safe-area-inset-top));
    left: auto; right: 6px; transform: none;
    width: 40px; height: 40px;
  }
  .install-btn { display: none !important; }
}

@media (max-width: 600px) {
  /* Small mobile: controls live inside brand block, utils hidden */
  .header-backdrop { height: calc(56px + env(safe-area-inset-top)); }
  .brand {
    max-width: calc(100% - 115px); /* gap for right-cluster (controls + burger) */
  }
  /* Show mob controls in right-cluster next to burger */
  .mob-badge-row { display: flex !important; }
  /* Hide the desktop utils cluster entirely on small mobile */
  .utils { display: none !important; }
  .mob-badge-row .live-badge.live-big.on {
    padding: 4px 8px;
    font-size: 7px;
    gap: 4px;
  }
  .mobile-live-callout.show { display: block; }
  /* About / contact panels clear the brand header */
  .wall-about, .wall-contact {
    top: calc(76px + env(safe-area-inset-top));
    width: 90%;
    max-height: calc(100dvh - 130px - env(safe-area-inset-top));
    overflow-y: auto;
  }
  /* Reaction/notif popup: ensure visible on small screens */
  .reaction-popup { max-width: 92vw; }
  .notif-tooltip { max-width: 85vw; white-space: normal; font-size: 10px; }
}

@media (max-width: 480px) {
  /* Very small screens refinements */
  .header-backdrop { height: calc(92px + env(safe-area-inset-top)); }
  .utils .live-badge.live-big .live-text { display: none; }
  .utils .live-badge.live-big.on .live-text { display: none; }
  .mobile-live-callout {
    top: calc(52px + env(safe-area-inset-top));
    right: 76px;
    max-width: 135px;
    font-size: 8px;
    padding: 6px 8px;
  }
  .game-leaderboard-btn {
    top: calc(106px + env(safe-area-inset-top));
    right: 8px;
    padding: 7px 9px;
    font-size: 8px;
  }
  .game-level-title {
    top: calc(140px + env(safe-area-inset-top));
    max-width: 88vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .game-leaderboard-table {
    grid-template-columns: 34px minmax(0, 1fr) 62px 58px;
    font-size: 11px;
  }
  .game-leaderboard-cell { padding: 7px 6px; }
}

/* iOS PWA — ensure nav/content below safe-area-inset-bottom */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .nav-panel { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* Ball grab cursor */
.ball { cursor: grab; }
.ball:active { cursor: grabbing; }

/* SVG anim helpers */
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.twk  { animation: twinkle 1.5s infinite; }
.twk2 { animation: twinkle 2.2s infinite; animation-delay: -0.7s; }
.twk3 { animation: twinkle 1.8s infinite; animation-delay: -1.2s; }
@keyframes rgbStroke { 0% { stroke: #00ffc8; } 33% { stroke: #7c3aed; } 66% { stroke: #ffd700; } 100% { stroke: #00ffc8; } }
.rgbline { animation: rgbStroke 3s linear infinite; }
@keyframes rgbFill { 0% { fill: #7c3aed; } 33% { fill: #00ffc8; } 66% { fill: #ffd700; } 100% { fill: #7c3aed; } }
.rgbfill { animation: rgbFill 3s linear infinite; }
@keyframes fanSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.fanspin { animation: fanSpin 1.2s linear infinite; transform-origin: center; transform-box: fill-box; }

/* GALAXY back wall — hidden in day, shown in night */
#galaxyLayer { display: none; }
body.is-night #galaxyLayer { display: block; }
.neb1 { animation: nebDrift1 38s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.neb2 { animation: nebDrift2 46s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.neb3 { animation: nebDrift3 52s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes nebDrift1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(60px,-20px) scale(1.08); }
}
@keyframes nebDrift2 {
  0%, 100% { transform: translate(0,0) scale(1.05); }
  50%      { transform: translate(-50px,15px) scale(0.95); }
}
@keyframes nebDrift3 {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 1; }
  50%      { transform: translate(20px,30px) scale(1.1); opacity: 0.7; }
}
.star-twinkle  circle { animation: starTw 3.8s ease-in-out infinite; }
.star-twinkle2 circle { animation: starTw 5.0s ease-in-out infinite; animation-delay: -1.2s; }
@keyframes starTw {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.15; }
}
.shooter { animation: shoot 9s ease-in-out infinite; }
@keyframes shoot {
  0%, 88%   { opacity: 0; transform: translate(0,0); }
  90%       { opacity: 1; }
  100%      { opacity: 0; transform: translate(700px,400px); }
}

/* Curtain serial bulbs */
.bulb-wire { stroke: #2a2018; stroke-width: 2; stroke-linecap: round; opacity: 0.85; }
.cbulb     { filter: drop-shadow(0 0 8px currentColor); animation: bulbBlink 2.4s ease-in-out infinite; }
.cbulb-r { fill: #ff3344; color: #ff3344; }
.cbulb-y { fill: #ffd700; color: #ffd700; animation-delay: -0.6s; }
.cbulb-g { fill: #22ee66; color: #22ee66; animation-delay: -1.2s; }
.cbulb-b { fill: #44aaff; color: #44aaff; animation-delay: -1.8s; }
@keyframes bulbBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* NEON SIGN — proper layered glow with stylish font */
/* Boardless neon sign — codepen WNjXbr style */
#neonSign .neon-main {
  font-family: 'Pacifico', 'Brush Script MT', cursive;
  font-size: 80px;
  letter-spacing: 2px;
  animation: neonFlicker 7.4s infinite step-end;
}
#neonSign .neon-back {
  fill: none;
  stroke: #9b30ff;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px #9b30ff)
          drop-shadow(0 0 28px #5500aa);
}
#neonSign .neon-front {
  fill: #f0e0ff;
  filter: drop-shadow(0 0 4px #fff)
          drop-shadow(0 0 12px #9b30ff);
}
#neonSign .neon-divider {
  stroke: #00ffc8;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px #00ffc8)
          drop-shadow(0 0 20px #00b894);
  animation: neonFlickerSub 5.8s infinite step-end;
}
#neonSign .neon-sub {
  font-family: 'Audiowide', 'Orbitron', sans-serif;
  font-size: 15px;
  letter-spacing: 7px;
  fill: #ccfff5;
  filter: drop-shadow(0 0 6px #00ffc8)
          drop-shadow(0 0 18px #00b894);
  animation: neonFlickerSub 5.8s infinite step-end;
}
@keyframes neonFlicker {
  0%, 2%, 4%, 7%, 18%, 20%, 22%, 26%, 48%, 52%, 56%, 72%, 74%, 100% {
    opacity: 1;
  }
  3%, 19%, 49%, 73% {
    opacity: 0.34;
  }
  5%, 21%, 50%, 75% {
    opacity: 0.78;
  }
  23%, 24% {
    opacity: 0.12;
  }
}
@keyframes neonFlickerSub {
  0%, 12%, 15%, 32%, 36%, 63%, 67%, 100% { opacity: 1; }
  13%, 64% { opacity: 0.42; }
  34%, 35% { opacity: 0.16; }
}
#neonSign.lit .neon-main { animation: neonFlicker 6.2s infinite step-end; }
#neonSign.lit .neon-divider, #neonSign.lit .neon-sub { animation: neonFlickerSub 4.8s infinite step-end; }
body.is-night #neonSign .neon-main { animation: neonFlicker 6.2s infinite step-end !important; }
body.is-night #neonSign .neon-divider,
body.is-night #neonSign .neon-sub { animation: neonFlickerSub 4.8s infinite step-end !important; }
#neonSign.hidden { opacity: 0; pointer-events: none; transition: opacity 0.6s; }

/* Curtain fluid wind — multi-keyframe natural sway */
@keyframes curtainWind {
  0%   { transform: skewX(0deg) translateX(0); }
  15%  { transform: skewX(0.6deg) translateX(3px); }
  30%  { transform: skewX(-0.4deg) translateX(-2px); }
  45%  { transform: skewX(1deg) translateX(5px); }
  60%  { transform: skewX(-0.3deg) translateX(-1px); }
  75%  { transform: skewX(0.7deg) translateX(4px); }
  90%  { transform: skewX(-0.5deg) translateX(-2px); }
  100% { transform: skewX(0deg) translateX(0); }
}
@keyframes sway { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
.swayable { animation: curtainWind 7s cubic-bezier(0.45,0,0.55,1) infinite; transform-origin: top center; }
.glitch { animation: glitch 7s infinite; }
@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, 1px); }
}
.parallax { transition: transform 0.3s ease-out; will-change: transform; }

/* HUD / coords */
.hud {
  position: absolute; bottom: 12px; right: 12px;
  font-family: 'Orbitron', monospace; font-size: 8px; color: var(--cyan);
  z-index: 24; letter-spacing: 1.5px; background: rgba(0,0,0,0.5);
  padding: 5px 9px; border: 0.5px solid rgba(0,255,200,0.3);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.hud span { color: var(--gold); }
.coords { display: none; }

/* Intro */
.intro {
  position: absolute; inset: 0; background: var(--bg); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 18px;
  transition: opacity 0.8s, visibility 0.8s;
}
.mon-vid-list {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px;
  overflow-y: auto; height: 100%; position: absolute; inset: 0;
  background: rgba(10, 10, 15, 0.95); z-index: 1;
}
.mon-vid-list .vbtn {
  width: calc(50% - 4px); background: #000; border: 1px solid #333;
  color: #fff; border-radius: 4px; overflow: hidden;
  cursor: pointer; transition: all 0.2s;
  display: flex; flex-direction: column; text-align: left;
}
.mon-vid-list .vbtn:hover { border-color: var(--cyan); }
.mon-vid-list .vbtn img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.mon-vid-list .vbtn span { font-size: 10px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: sans-serif; }

/* duplicate mon-controls block removed — defined cleanly above */
.intro.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.intro img { width: 100px; height: 100px; border-radius: 16px; box-shadow: 0 0 30px rgba(255,0,50,0.5); }
.intro-bar {
  width: 200px; height: 2px; background: rgba(0,255,200,0.15);
  overflow: hidden; position: relative;
}
.intro-bar::after {
  content: ''; position: absolute; left: 0; top: 0; height: 100%;
  width: 30%; background: var(--cyan); animation: loadBar 1.6s ease-in-out forwards;
}
@keyframes loadBar { 0% { left: -30%; } 100% { left: 100%; } }
.intro-text {
  font-family: 'Orbitron', monospace; font-size: 9px; color: var(--gold);
  letter-spacing: 3px; text-transform: uppercase;
}

/* Big monitor (videos) */
.bigmon {
  position: absolute; left: 50%; top: 48%;
  transform: translate(-50%, -50%) scale(0); transform-origin: center;
  width: 64%; max-width: 760px; aspect-ratio: 16/9;
  z-index: 27; background: #000;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 40px rgba(0,255,200,0.4), inset 0 0 20px rgba(124,58,237,0.2);
  transition: transform 0.7s cubic-bezier(0.34, 1.4, 0.64, 1);
  overflow: hidden;
}
.bigmon.show { transform: translate(-50%, -50%) scale(1); }
.bigmon iframe { width: 100%; height: 100%; border: 0; display: block; }
.bigmon-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 28px;
  background: rgba(0,0,0,0.92); z-index: 5;
  display: flex; align-items: center; padding: 0 10px; gap: 6px;
  font-family: 'Orbitron', monospace; font-size: 9px; color: var(--cyan);
  letter-spacing: 1.5px; border-bottom: 1px solid var(--cyan);
}
.bigmon-bar .led {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff3333; animation: blink 1s infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0.2; } }
.addr-bar {
  flex: 1; padding: 2px 8px; background: rgba(0,255,200,0.08);
  border-radius: 3px; color: var(--gold);
  text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin: 0 6px;
}
.bigmon-close {
  cursor: pointer; color: #9fb; background: transparent;
  border: 0.5px solid rgba(0,255,200,0.4);
  padding: 2px 8px; font-family: 'Orbitron', monospace; font-size: 9px; letter-spacing: 1px;
}
.bigmon-close:hover { color: var(--gold); border-color: var(--gold); }

.vidlist {
  position: absolute; top: 32px; right: 6px; width: 170px;
  display: flex; flex-direction: column; gap: 4px; z-index: 6;
  max-height: calc(100% - 40px); overflow-y: auto; padding-right: 4px;
}
.vidlist::-webkit-scrollbar { width: 3px; }
.vidlist::-webkit-scrollbar-thumb { background: var(--cyan); }
.vbtn {
  display: flex; gap: 6px; padding: 4px;
  background: rgba(0,0,0,0.7); border: 0.5px solid rgba(0,255,200,0.3);
  color: #9fb; font-size: 9px; font-family: 'Orbitron', monospace; cursor: pointer;
  text-align: left; line-height: 1.2; letter-spacing: 0.3px; transition: all 0.2s;
  align-items: center; min-height: 36px;
}
.vbtn img { width: 50px; height: 28px; object-fit: cover; border-radius: 2px; flex-shrink: 0; }
.vbtn span { flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vbtn:hover { border-color: var(--cyan); color: #fff; background: rgba(0,255,200,0.15); }
.vbtn.playing { border-color: var(--gold); color: var(--gold); background: rgba(255,215,0,0.1); }
.vidlist-loading {
  padding: 14px 8px; color: var(--cyan); font-family: 'Orbitron', monospace;
  font-size: 10px; text-align: center; letter-spacing: 1px;
}

.monitor-hint {
  position: absolute; left: 50%; top: 26%;
  transform: translateX(-50%);
  font-family: 'Orbitron', monospace; font-size: 11px; color: var(--gold);
  background: rgba(0,0,0,0.85); padding: 8px 14px;
  border: 1px solid var(--gold); letter-spacing: 1.5px;
  z-index: 26; opacity: 0; pointer-events: none;
  transition: opacity 0.4s;
  border-radius: 6px;
}
.monitor-hint.show { opacity: 1; }

/* Live monitor iframe overlays */
.mon-iframe {
  position: absolute; z-index: 12; overflow: hidden; border-radius: 2px;
  box-shadow: inset 0 0 12px rgba(124,58,237,0.45), 0 0 18px rgba(0,255,200,0.18);
  background: #000;
  transform-origin: center;
  transition: opacity 0.5s, transform 0.5s;
  contain: layout paint;
}
.mon-iframe iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: auto; }
.social-screensaver {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  background: #000;
  z-index: 4;
  contain: layout paint;
}
.social-screensaver.show { display: block; }
.social-gallery-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translate3d(0,0,0);
  transition: transform 760ms cubic-bezier(0.22, 0.8, 0.2, 1);
}
.social-gallery-track img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.social-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 42px;
  border: 1px solid rgba(255,255,255,0.38);
  border-radius: 5px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}
.social-gallery-prev { left: 6px; }
.social-gallery-next { right: 6px; }
.social-screensaver:hover .social-gallery-nav,
.social-gallery-nav:focus-visible {
  opacity: 1;
}
.social-gallery-nav:hover {
  background: rgba(0,255,200,0.28);
  border-color: var(--cyan);
}
@media (hover: none) {
  .social-gallery-nav { opacity: 0.82; }
}
.mon-iframe.screen-broken {
  background: #000 url('/img/broken_monitor.svg') center / cover no-repeat !important;
  box-shadow: inset 0 0 16px rgba(255,255,255,0.18), 0 0 18px rgba(255,0,170,0.22);
}
.mon-iframe.screen-broken iframe,
.mon-iframe.screen-broken .social-screensaver,
.mon-iframe.screen-broken .mon-vid-list,
.mon-iframe.screen-broken .mon-controls {
  display: none !important;
}
.mon-iframe.live-monitor .mon-controls,
.mon-iframe.live-monitor .mon-vid-list {
  display: none !important;
}
.left-mon-iframe.monitor-fall-broken {
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: 29;
}
#leftMonGroup.monitor-fall-broken {
  transform-box: fill-box;
  transform-origin: 12% 96%;
}
.monitor-broken-svg-img {
  opacity: 0;
  pointer-events: none;
}
#leftMonGroup.monitor-screen-broken #leftMonBrokenImage,
#rightMonGroup.monitor-screen-broken #rightMonBrokenImage {
  opacity: 1;
}
#neonSign.neon-hit-fall .neon-main,
#neonSign.neon-hit-fall .neon-divider,
#neonSign.neon-hit-fall .neon-sub {
  animation: none !important;
  opacity: 0.2;
  transform-box: fill-box;
  transform-origin: center;
  transform: translateY(95px) rotate(8deg);
  transition: transform 760ms cubic-bezier(0.18, 0.82, 0.3, 1), opacity 760ms ease;
}
.mon-overlay-glow {
  position: absolute; inset: 0;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.05) 0%,
    rgba(255,255,255,0) 35%,
    rgba(255,255,255,0) 65%,
    rgba(0,0,0,0.18) 100%);
  pointer-events: none;
}
/* shorts buttons reset — they live inside .mon-controls now */
.shorts-mute, .shorts-next, .shorts-prev { position: static; }

/* Right monitor hotspot */
.right-mon-hotspot {
  position: absolute; left: 50%; top: 33%;
  width: 17%; height: 17%; z-index: 10;
  cursor: pointer;
}

/* Balls — bowling style */
.balls { position: absolute; inset: 0; pointer-events: none; z-index: 28; overflow: hidden; }
.ball {
  position: absolute; width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; pointer-events: auto;
  will-change: transform; transition: filter 0.2s;
  contain: layout paint;
  background: radial-gradient(circle at 30% 28%, rgba(255,255,255,0.55), rgba(0,0,0,0.05) 40%, rgba(0,0,0,0.55) 100%);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.55),
    inset -10px -10px 20px rgba(0,0,0,0.4),
    inset 8px 8px 16px rgba(255,255,255,0.18);
}
.ball:hover { filter: brightness(1.15) saturate(1.2); }
.ball-shadow {
  position: absolute; bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 70%; height: 10px; border-radius: 50%;
  background: rgba(0,0,0,0.5); filter: blur(4px); pointer-events: none;
}
.ball-logo {
  width: 56%; height: 56%; pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}
.ball-label {
  position: absolute; bottom: -22px; left: 50%;
  transform: translateX(-50%); font-size: 9px;
  font-family: 'Orbitron', monospace;
  color: var(--cyan); letter-spacing: 1.5px; white-space: nowrap;
  opacity: 0; transition: opacity 0.2s; text-transform: uppercase;
  pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.ball:hover .ball-label { opacity: 1; }
.ball-hit-fall {
  transform:
    translate3d(var(--ball-hit-x, 54px), var(--ball-hit-y, 90px), 0)
    rotate(var(--ball-hit-rot, 28deg)) !important;
  opacity: 0.82;
  transition: transform 1100ms cubic-bezier(0.16, 0.86, 0.24, 1), opacity 1100ms ease !important;
  transform-origin: 50% 100%;
  pointer-events: auto !important;
}

/* Chair — BIGGER, no white halo, 3D feel */
.social-hoop {
  position: absolute;
  right: 9.2%;
  top: 17.4%;
  width: 300px;
  height: 326px;
  z-index: 27;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.7);
  transform-origin: top right;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.sec-social .social-hoop {
  opacity: 1;
  transform: translateY(0) scale(0.7);
}
.hoop-backboard {
  position: absolute;
  right: 0;
  top: 0;
  width: 284px;
  height: 178px;
  border: 4px solid rgba(18,20,24,0.96);
  border-radius: 2px;
  background:
    linear-gradient(154deg, rgba(255,255,255,0.96) 0 58%, rgba(225,230,233,0.88) 59% 100%),
    #f4f6f6;
  box-shadow:
    0 18px 42px rgba(0,0,0,0.42),
    inset 0 0 0 6px rgba(255,255,255,0.92),
    inset 0 0 0 10px rgba(42,45,49,0.86);
}
.hoop-backboard::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 2px solid rgba(255,255,255,0.9);
  box-shadow: inset 0 0 0 2px rgba(30,34,38,0.18);
  pointer-events: none;
}
.hoop-square {
  position: absolute;
  left: 101px;
  top: 77px;
  width: 82px;
  height: 55px;
  border: 9px solid rgba(45,49,53,0.96);
  border-radius: 3px;
  background: rgba(240,243,244,0.72);
  box-shadow: 0 4px 0 rgba(0,0,0,0.22);
}
.hoop-rim {
  position: absolute;
  right: 42px;
  top: 151px;
  width: 210px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  overflow: visible;
  filter: drop-shadow(0 7px 8px rgba(0,0,0,0.48));
}
.hoop-rim::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 9px solid #e51417;
  border-top-color: #ff2f2b;
  border-bottom-color: #af090c;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 56%, rgba(255,255,255,0.2) 58%, rgba(255,255,255,0) 64%);
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.36),
    inset 0 -5px 8px rgba(0,0,0,0.32),
    0 0 18px rgba(255,42,24,0.38);
}
.hoop-rim::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -3px;
  width: 46px;
  height: 20px;
  transform: translateX(-50%);
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(#ff3730, #b9080b);
  box-shadow: inset 0 3px 0 rgba(255,255,255,0.3), 0 5px 8px rgba(0,0,0,0.24);
}
.social-hoop-score-zone {
  position: absolute;
  left: 38px;
  top: -18px;
  width: 134px;
  height: 74px;
  border-radius: 50%;
}
.hoop-net {
  position: absolute;
  left: 16px;
  top: 35px;
  width: 178px;
  height: 150px;
  transform-origin: 50% 0;
  pointer-events: none;
  opacity: 0.95;
  z-index: 1;
}
.hoop-net-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 6px 4px rgba(0,0,0,0.38));
}
.hoop-net-svg .net-lines path {
  fill: none;
  stroke: rgba(248,250,252,0.94);
  stroke-width: 5.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hoop-net-svg .net-lines path:nth-child(6),
.hoop-net-svg .net-lines path:nth-child(7),
.hoop-net-svg .net-lines path:nth-child(8),
.hoop-net-svg .net-lines path:nth-child(9) {
  stroke-width: 4.7;
  stroke: rgba(238,242,245,0.9);
}
.hoop-net-svg .net-lines path:nth-child(10),
.hoop-net-svg .net-lines path:nth-child(11),
.hoop-net-svg .net-lines path:nth-child(12) {
  stroke-width: 3.2;
  stroke: rgba(232,237,240,0.72);
}
.hoop-net-svg .net-knots circle {
  fill: #ffffff;
  stroke: rgba(150,160,168,0.56);
  stroke-width: 1;
}
.social-hoop.rim-hit .hoop-rim {
  animation: hoopRimShake 260ms ease;
}
.social-hoop.swish .hoop-rim {
  animation: hoopRimShake 560ms ease;
}
.social-hoop.swish .hoop-net {
  animation: netSwish 760ms cubic-bezier(0.18, 0.86, 0.24, 1);
}
.social-hoop-celebration {
  position: absolute;
  right: 6.8%;
  top: 16%;
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(72vw, 360px);
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(0,255,200,0.72);
  border-radius: 8px;
  background: rgba(4,8,14,0.86);
  box-shadow: 0 12px 28px rgba(0,0,0,0.42), 0 0 22px rgba(0,255,200,0.18);
  color: #fff;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.94);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.social-hoop-celebration::before,
.social-hoop-celebration::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: #ffd700;
}
.social-hoop-celebration::before {
  left: 10px;
  box-shadow:
    -22px -18px 0 #00ffc8,
    -14px 18px 0 #ff5a1f,
    8px -26px 0 #fff,
    20px 16px 0 #7c3aed;
}
.social-hoop-celebration::after {
  right: 10px;
  box-shadow:
    22px -18px 0 #00ffc8,
    14px 18px 0 #ff5a1f,
    -8px -26px 0 #fff,
    -20px 16px 0 #7c3aed;
}
.social-hoop-celebration.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.social-hoop-celebration.show::before {
  animation: hoopConfettiLeft 760ms ease-out forwards;
}
.social-hoop-celebration.show::after {
  animation: hoopConfettiRight 760ms ease-out forwards;
}
.social-hoop-celebration svg {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}
.neon-sparks {
  position: absolute;
  width: 4px;
  height: 4px;
  z-index: 43;
  pointer-events: none;
}
.neon-sparks span {
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd700;
  box-shadow: 0 0 12px #ff4d00, 0 0 20px rgba(0,255,200,0.42);
  animation: neonSparkBurst 820ms ease-out forwards;
}
@keyframes hoopRimShake {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(3px) rotate(2deg); }
  55% { transform: translateY(-1px) rotate(-2deg); }
  78% { transform: translateY(2px) rotate(1deg); }
}
@keyframes netSwish {
  0% { transform: skewX(0deg) scaleY(1); }
  28% { transform: skewX(-15deg) scaleY(1.22); }
  55% { transform: skewX(11deg) scaleY(0.92); }
  100% { transform: skewX(0deg) scaleY(1); }
}
@keyframes hoopConfettiLeft {
  0% { opacity: 0; transform: translate(0, -50%) scale(0.2); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-32px, -70%) scale(1); }
}
@keyframes hoopConfettiRight {
  0% { opacity: 0; transform: translate(0, -50%) scale(0.2); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(32px, -70%) scale(1); }
}
@keyframes neonSparkBurst {
  0% { opacity: 1; transform: translate(0,0) scale(1); }
  70% { opacity: 0.95; transform: translate(var(--sx), var(--sy)) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(var(--sx) * 1.2), calc(var(--sy) * 1.2)) scale(0.2); }
}

.chair {
  position: absolute; bottom: 0; left: -600px;
  width: 38%; max-width: 480px; z-index: 26;
  transition: left 1.1s cubic-bezier(0.32, 1.4, 0.5, 1),
              opacity 0.6s;
  pointer-events: none;
}
.chair img {
  width: 100%; height: auto; display: block;
  object-fit: contain;
  filter: drop-shadow(0 16px 48px rgba(0,0,0,0.75));
}
.chair.in { left: 8%; animation: chairBob 4s ease-in-out infinite; }
.chair.out { left: -600px; opacity: 0; }
@keyframes chairBob {
  0%, 100% { transform: rotateY(-3deg) rotateX(2deg) translateY(0); }
  50%      { transform: rotateY(3deg)  rotateX(-1deg) translateY(-4px); }
}

/* In-game overrides */
.in-game .chair, .in-game #leftMonIframeWrap, .in-game #rightMonIframeWrap {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.5s;
}
.in-game #gameContainer { display: block !important; }
#gameContainer { contain: layout paint; }
.game-start-bar {
  min-width: min(86vw, 620px);
  padding: 16px 22px 14px;
  border: 1px solid rgba(0,255,200,0.75);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,0.88) 14%, rgba(4,12,18,0.94) 50%, rgba(0,0,0,0.88) 86%, rgba(0,0,0,0)),
    linear-gradient(180deg, rgba(0,255,200,0.14), rgba(124,58,237,0.16));
  box-shadow:
    0 14px 38px rgba(0,0,0,0.62),
    0 0 28px rgba(0,255,200,0.28),
    inset 0 0 22px rgba(0,255,200,0.08);
  text-align: center;
}
.game-start-title {
  font-family: Orbitron, monospace;
  font-size: clamp(16px, 3vw, 28px);
  color: #00ffc8;
  letter-spacing: 4px;
  text-shadow: 0 0 18px #00ffc8, 0 2px 4px #000;
  animation: neonPulse 1.5s ease-in-out infinite;
}
.game-start-sub {
  margin-top: 9px;
  font-family: Orbitron, monospace;
  font-size: 12px;
  color: #ffd700;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px #000, 0 0 12px rgba(255,215,0,0.55);
}
.game-leaderboard-btn {
  position: absolute;
  top: calc(70px + env(safe-area-inset-top));
  right: 16px;
  z-index: 36;
  padding: 8px 12px;
  border: 1px solid rgba(255,215,0,0.72);
  border-radius: 7px;
  background: rgba(0,0,0,0.72);
  color: #ffd700;
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255,215,0,0.18);
}
.game-leaderboard-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}
.game-level-title {
  position: absolute;
  top: calc(110px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 29;
  padding: 5px 12px;
  border: 1px solid rgba(0,255,200,0.38);
  border-radius: 6px;
  background: rgba(0,0,0,0.62);
  color: #d7fff6;
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 1.6px;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(0,255,200,0.5);
}
.game-level-title.level-pop {
  animation: levelPop 1.4s cubic-bezier(0.18, 0.85, 0.25, 1);
}
@keyframes levelPop {
  0% { transform: translateX(-50%) scale(0.72); opacity: 0; }
  18% { transform: translateX(-50%) scale(1.12); opacity: 1; }
  72% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.96); opacity: 0.92; }
}
.game-leaderboard-modal {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.72);
}
.game-leaderboard-modal.show { display: flex; }
.game-leaderboard-panel {
  width: min(92vw, 440px);
  max-height: min(82vh, 560px);
  overflow: auto;
  position: relative;
  padding: 24px 22px 20px;
  border: 1px solid rgba(0,255,200,0.6);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(4,8,13,0.98), rgba(20,11,34,0.98));
  box-shadow: 0 24px 70px rgba(0,0,0,0.78), 0 0 28px rgba(0,255,200,0.16);
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.game-leaderboard-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--cyan);
  font-size: 22px;
  cursor: pointer;
}
.game-leaderboard-kicker {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 2px;
}
.game-leaderboard-panel h2 {
  margin: 6px 0 16px;
  color: #ffd700;
  font-size: 20px;
  letter-spacing: 2px;
}
.game-register-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
  margin-bottom: 10px;
}
.game-register-form input {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(0,255,200,0.45);
  border-radius: 6px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}
.game-register-form button {
  padding: 10px 12px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: rgba(0,255,200,0.14);
  color: var(--cyan);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 800;
  cursor: pointer;
}
.game-register-form button[type="submit"],
.game-register-form .game-guest-btn {
  grid-column: span 1;
}
.game-register-form .game-guest-btn {
  border-color: rgba(255,215,0,0.65);
  background: rgba(255,215,0,0.12);
  color: #ffe780;
}
.game-register-status {
  min-height: 18px;
  color: #ffd700;
  font-size: 12px;
  margin-bottom: 10px;
}
.game-logout-btn {
  width: 100%;
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 80, 80, 0.72);
  border-radius: 6px;
  background: rgba(255, 80, 80, 0.12);
  color: #ffb8b8;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.game-logout-btn[hidden] {
  display: none !important;
}
.game-leaderboard-table {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 82px 74px;
  border: 1px solid rgba(0,255,200,0.32);
  border-radius: 7px;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.25;
}
.game-leaderboard-cell {
  padding: 9px 10px;
  min-width: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
  color: #f5fbff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-leaderboard-cell:nth-child(4n) { border-right: 0; }
.game-leaderboard-head {
  background: rgba(0,255,200,0.2);
  color: #bffff4;
  font-weight: 800;
  letter-spacing: 0;
}
.game-leaderboard-rank { color: #ffd700; font-weight: 800; text-align: center; }
.game-leaderboard-name { color: #ffffff; font-weight: 700; }
.game-leaderboard-empty {
  grid-column: 1 / -1;
  padding: 14px;
  color: #ffd700;
  text-align: center;
}
@media (max-width: 480px) {
  .game-register-form {
    grid-template-columns: 1fr;
  }
  .game-register-form button[type="submit"],
  .game-register-form .game-guest-btn {
    grid-column: 1;
  }
  .game-leaderboard-btn {
    top: calc(106px + env(safe-area-inset-top));
    right: 8px;
    padding: 7px 9px;
    font-size: 8px;
  }
  .game-level-title {
    top: calc(140px + env(safe-area-inset-top));
    max-width: 88vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Pets */
.cats-layer { position: absolute; inset: 0; pointer-events: none; z-index: 25; contain: layout paint; }
.pet {
  position: absolute; pointer-events: none;
  transform-origin: center bottom;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.65));
  transition: filter 0.3s;
  transform-style: preserve-3d;
  contain: layout paint;
  left: 0;
  top: 0;
  will-change: transform;
}
.pet svg { width: 130px; height: 110px; display: block; }
.pet-dog svg { width: 160px; height: 120px; }
.pet-shadow {
  position: absolute; bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 70%; height: 10px;
  background: rgba(0,0,0,0.5); border-radius: 50%;
  filter: blur(5px); pointer-events: none;
}

/* Wall about — cinematic glass panel */
.wall-about, .wall-contact {
  position: absolute; left: 50%; top: 12%;
  transform: translate(-50%, 30px) scale(0.92) rotateX(8deg);
  transform-origin: center top;
  width: 70%; max-width: 720px;
  z-index: 24; opacity: 0; pointer-events: none;
  transition: opacity 0.7s ease, transform 0.9s cubic-bezier(0.22, 1.4, 0.36, 1);
  text-align: center;
}
.wall-about.show, .wall-contact.show {
  opacity: 1; transform: translate(-50%, 0) scale(1) rotateX(0); pointer-events: auto;
}
.wall-about {
  background:
    linear-gradient(135deg, rgba(6,8,13,0.92), rgba(18,12,28,0.88)),
    radial-gradient(ellipse at 30% 0%, rgba(255,215,0,0.18), transparent 50%);
  border: 1px solid rgba(0,255,200,0.55);
  border-radius: 18px;
  padding: 36px 40px 32px;
  box-shadow:
    0 30px 60px rgba(0,0,0,0.7),
    0 0 50px rgba(0,255,200,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 36px rgba(124,58,237,0.12);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  overflow: hidden;
}
.wall-about::before {
  content: ''; position: absolute; top: -120px; left: 50%;
  width: 6px; height: 240px;
  background: linear-gradient(to bottom, rgba(255,215,0,0.7), transparent);
  filter: blur(18px); transform: translateX(-50%);
  pointer-events: none; animation: beamPulse 3.5s ease-in-out infinite;
}
@keyframes beamPulse {
  0%, 100% { opacity: 0.4; width: 6px; }
  50%      { opacity: 0.85; width: 10px; }
}
.wall-about::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0;
  height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  animation: aboutScan 4s linear infinite; pointer-events: none;
}
@keyframes aboutScan {
  0%   { transform: translateY(0);   opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(360px); opacity: 0; }
}
.wall-about.show .wall-eyebrow { animation: aboutFadeUp 0.6s 0.15s both; }
.wall-about.show .wall-h1      { animation: aboutFadeUp 0.7s 0.30s both; }
.wall-about.show .wall-p       { animation: aboutFadeUp 0.7s 0.55s both; }
.wall-about.show .wall-cta     { animation: aboutFadeUp 0.6s 0.85s both; }
@keyframes aboutFadeUp {
  from { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);   filter: blur(0); }
}
.wall-eyebrow {
  display: inline-block;
  font-family: 'Orbitron', monospace; font-size: 11px;
  color: var(--cyan); letter-spacing: 4px; padding: 6px 14px;
  border: 1px solid var(--cyan); margin-bottom: 16px;
  text-transform: uppercase;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.wall-h1 {
  font-size: 38px; font-weight: 600; line-height: 1.05;
  margin: 0 0 18px; letter-spacing: -0.5px; color: #fff;
  font-family: 'Audiowide', system-ui, sans-serif;
}
.wall-h1 span {
  color: var(--cyan);
  /* gradient text where supported, fallback to solid cyan */
  background: linear-gradient(135deg, var(--cyan) 0%, var(--gold) 60%, var(--violet) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
@supports not (-webkit-background-clip: text) {
  .wall-h1 span { -webkit-text-fill-color: unset; color: var(--cyan); }
}
.wall-p {
  font-size: 16px; line-height: 1.7;
  color: #ffffff; margin: 0 auto 18px;
  max-width: 600px; padding: 0 16px;
  font-weight: 400; text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  font-family: 'Segoe UI', system-ui, sans-serif;
}
.wall-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; background: transparent; color: var(--cyan);
  border: 1px solid var(--cyan); font-size: 12px; cursor: pointer;
  font-weight: 600; letter-spacing: 2px;
  font-family: 'Orbitron', monospace;
  text-transform: uppercase; transition: all 0.25s;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.wall-cta:hover { background: var(--cyan); color: var(--bg); }
.wall-cta::after { content: '→'; transition: transform 0.2s; }
.wall-cta:hover::after { transform: translateX(4px); }

/* Contact form — own panel so SEND MESSAGE doesn't overlay anything */
.wall-contact {
  background: linear-gradient(135deg, rgba(6,8,13,0.92), rgba(18,12,28,0.88));
  border: 1px solid rgba(0,255,200,0.45);
  border-radius: 16px;
  padding: 16px 16px 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.65), 0 0 30px rgba(0,255,200,0.12);
  backdrop-filter: blur(8px);
}
.contact-form {
  display: grid; gap: 8px; max-width: 420px; margin: 0 auto;
  padding: 12px 12px 14px; background: rgba(0,0,0,0.35);
  border: 1px solid rgba(0,255,200,0.2);
  border-radius: 10px;
}
.contact-form input, .contact-form textarea {
  background: rgba(0,0,0,0.55); border: 1px solid rgba(0,255,200,0.25);
  color: var(--text); padding: 10px 12px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 13px; outline: none; transition: all 0.2s;
  width: 100%; border-radius: 6px;
}
.contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--cyan); background: rgba(0,255,200,0.05);
}
.contact-form textarea { resize: vertical; min-height: 90px; }
.contact-form .field { transition: transform 0.6s cubic-bezier(0.5, 1.6, 0.5, 1), opacity 0.5s; }
.contact-form.flying .field {
  animation: fieldDrop 1.2s cubic-bezier(0.5, 1.6, 0.5, 1) forwards;
}
.contact-form.flying .field:nth-child(2) { animation-delay: 0.1s; }
.contact-form.flying .field:nth-child(3) { animation-delay: 0.2s; }
.contact-form.flying .field:nth-child(4) { animation-delay: 0.3s; }
.contact-form.flying .field:nth-child(5) { animation-delay: 0.4s; }
@keyframes fieldDrop {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  40%  { transform: translateY(120px) rotate(-8deg); }
  60%  { transform: translateY(80px) rotate(-12deg); }
  80%  { transform: translateY(160px) rotate(-18deg); }
  100% { transform: translateY(240px) rotate(-24deg); opacity: 0; filter: blur(12px); }
}
.contact-form.flying .submit-btn { animation: fieldDrop 1.2s cubic-bezier(0.5, 1.6, 0.5, 1) forwards; animation-delay: 0.5s; }
.submit-btn {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--bg); padding: 12px;
  font-family: 'Orbitron', monospace;
  font-weight: 700; letter-spacing: 2px; cursor: pointer;
  border: 0; border-radius: 6px;
  transition: filter 0.2s;
}
.submit-btn:hover { filter: brightness(1.2); }
.contact-status {
  font-family: 'Orbitron', monospace; font-size: 11px;
  color: var(--gold); min-height: 18px; text-align: center;
  letter-spacing: 1px;
}

/* Reaction popup */
.reaction-popup {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 90; max-width: 380px; width: 80%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.4, 0.64, 1), opacity 0.3s;
  opacity: 0;
}
.reaction-popup.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.reaction-popup img {
  width: 140px; height: 140px; object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(0,255,200,0.45);
  box-shadow: 0 0 22px rgba(0,255,200,0.18);
  background: #0d0f1a;
}
.reaction-msg {
  font-family: 'Audiowide', 'Orbitron', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 8px 18px;
  line-height: 1.5;
  letter-spacing: 0.5px;
  background: rgba(0,0,0,0.72);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
  max-width: 320px;
}

/* Sticky note */
.sticky-note {
  position: absolute; top: 12%; right: 8%;
  width: 90px; height: 90px;
  background: linear-gradient(135deg, #ffea7c, #ffc83d);
  color: #1a1100; z-index: 30; cursor: pointer;
  transform: rotate(-6deg) translateY(-300px) scale(0.6);
  opacity: 0; pointer-events: none;
  transition: transform 1s cubic-bezier(0.34, 1.4, 0.5, 1), opacity 0.5s;
  box-shadow: 0 8px 16px rgba(0,0,0,0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: 'Orbitron', monospace; padding: 6px;
}
.sticky-note.show { transform: rotate(-6deg) translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.sticky-note:hover { transform: rotate(0deg) translateY(-2px) scale(1.05); }
.sticky-note .icon,
.sticky-note .sticky-icon { font-size: 24px; }
.sticky-note .count,
.sticky-note .sticky-badge {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #ff3344; color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.sticky-note .label,
.sticky-note .sticky-label {
  font-size: 7px; letter-spacing: 1px; margin-top: 2px;
  text-transform: uppercase; opacity: 0.6;
}

.sticky-popup {
  position: absolute; top: 22%; right: 6%;
  width: 280px; max-height: 60vh; overflow-y: auto;
  background: linear-gradient(135deg, #ffea7c, #ffc83d);
  color: #1a1100; z-index: 31;
  padding: 14px; opacity: 0; pointer-events: none;
  transform: scale(0.7) translateY(-20px);
  transform-origin: top right;
  transition: all 0.4s cubic-bezier(0.34, 1.4, 0.5, 1);
  box-shadow: 0 12px 24px rgba(0,0,0,0.5);
  font-family: 'Orbitron', monospace;
}
.sticky-popup.show { opacity: 1; pointer-events: auto; transform: scale(1) translateY(0); }
.sticky-popup-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  font-weight: 700; padding-bottom: 6px;
  border-bottom: 1px solid rgba(26,17,0,0.2); margin-bottom: 8px;
}
.sticky-popup-close {
  cursor: pointer; background: transparent; border: 0;
  font-size: 14px; color: #1a1100; font-weight: 700;
}
.sticky-msg {
  font-size: 11px; line-height: 1.4; padding: 6px 0;
  border-bottom: 1px dashed rgba(26,17,0,0.2);
}
.sticky-msg:last-child { border-bottom: 0; }
.sticky-msg-meta { font-size: 8px; opacity: 0.6; margin-bottom: 2px; }
.sticky-popup-clear {
  margin-top: 8px; padding: 4px 8px; background: rgba(0,0,0,0.15);
  border: 0; cursor: pointer;
  font-family: 'Orbitron', monospace; font-size: 9px;
  letter-spacing: 1px; text-transform: uppercase; color: #1a1100;
  width: 100%;
}

/* Install button */
.install-btn {
  position: absolute; bottom: 14%; right: 6%;
  z-index: 26; padding: 10px 16px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: var(--bg); border: 0; cursor: pointer;
  font-family: 'Orbitron', monospace; font-weight: 700; letter-spacing: 1.5px;
  font-size: 11px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: all 0.2s; display: none;
}
.install-btn.show { display: block; }
#installBtn.install-btn.show { display: block; }
.install-btn:hover { transform: translateY(-2px); }
.install-btn::before { content: '⬇ '; }

/* Live notif toast */
.notif-toast {
  position: fixed; left: 50%; top: 18%;
  transform: translate(-50%, -40px) scale(0.9);
  background: linear-gradient(135deg, #ff2244, #cc0033);
  color: #fff; padding: 14px 20px;
  border-radius: 14px; border: 2px solid #fff;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 13px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  z-index: 95;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 14px 30px rgba(255,34,68,0.5), 0 0 24px rgba(255,34,68,0.4);
  opacity: 0; pointer-events: none;
  transition: all 0.5s cubic-bezier(0.34, 1.4, 0.5, 1);
  max-width: 90vw;
}
.notif-toast.show {
  opacity: 1; transform: translate(-50%, 0) scale(1);
  pointer-events: auto; cursor: pointer;
}
.notif-toast .ndot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px #fff;
  animation: liveDotPulse 0.9s infinite;
}

/* Tablet */
@media (max-width: 1024px) {
  .nav { width: 30%; }
  .tab { font-size: 13px; padding: 11px 16px; }
  .wall-h1 { font-size: 28px; }
  .wall-p { font-size: 14px; }
  .utils {
    right: 74px;
    max-width: calc(100% - 250px);
  }
  .mode.bulb {
    width: 42px;
    height: 42px;
    padding: 4px;
    justify-content: center;
  }
  .mode.bulb .bulb-label { display: none; }
  .mode.bulb .bulb-svg { width: 24px; height: 30px; }
}

/* === Tablet + Mobile: hamburger drawer instead of horizontal nav === */
@media (max-width: 1024px) {
  .burger { display: flex; }
  .nav {
    position: fixed; top: 0; right: -100%;
    bottom: 0; left: auto; width: 78%; max-width: 320px;
    height: 100%;
    background: linear-gradient(160deg, rgba(6,8,13,0.98), rgba(20,12,30,0.98));
    backdrop-filter: blur(8px);
    border-left: 1px solid rgba(0,255,200,0.3);
    transform: none;
    flex-direction: column;
    padding: 80px 18px 24px;
    gap: 14px;
    transition: right 0.4s cubic-bezier(0.4, 1.4, 0.5, 1);
    z-index: 36;
    box-shadow: -20px 0 40px rgba(0,0,0,0.6);
  }
  .nav.open { right: 0; }
  .tab {
    width: 100%; padding: 14px 18px;
    font-size: 14px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    border-radius: 10px;
  }
  .social-hoop {
    right: 8.5%;
    top: 17.6%;
    transform: translateY(-8px) scale(0.62);
  }
  .sec-social .social-hoop {
    transform: translateY(0) scale(0.62);
  }
}

body.menu-open .mob-badge-row {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

/* === Mobile-only adjustments === */
@media (max-width: 768px) {
  /* Hide visual clutter */
  .grid { opacity: 0.3; }
  .hud, .coords { display: none; }
  /* Pets — keep but smaller */
  .pet svg { width: 80px; height: 70px; }
  .pet-dog svg { width: 100px; height: 80px; }

  .brand img { height: 28px; }
  .brand-text { font-size: 9px; letter-spacing: 1.5px; }
  .brand-text .sub { font-size: 7px; }
  .brand { padding: 4px 10px 4px 6px; }

  /* utils position handled in primary 768px block above */
  .util-btn, .lang-btn { font-size: 7.5px; padding: 5px 7px; letter-spacing: 1px; }
  .live-badge.live-big { font-size: 8px; padding: 4px 8px; border-width: 1px; }
  .live-badge.live-big.on { font-size: 9px; padding: 5px 10px; }
  .mode.bulb { padding: 3px 8px 3px 4px; }
  .mode.bulb .bulb-svg { width: 22px; height: 28px; }
  .bulb-label { font-size: 8px; }

  .wall-about, .wall-contact { width: 92%; top: calc(72px + env(safe-area-inset-top)); padding: 18px 16px; max-height: calc(100dvh - 120px); overflow-y: auto; }
  .wall-h1 { font-size: 22px; }
  .wall-p { font-size: 13px; line-height: 1.55; }

  .bigmon { width: 96%; top: 38%; }
  .vidlist { width: 110px; }
  .vbtn { font-size: 8px; padding: 3px; }
  .vbtn img { width: 36px; height: 22px; }

  .chair { width: 55%; max-width: 260px; bottom: 0; }
  .chair.in { left: 2%; }

  .ball { width: 56px; height: 56px; }
  .social-hoop {
    left: 50%;
    right: auto;
    top: 9.2%;
    transform: translate(-50%, -8px) scale(0.46);
    transform-origin: top center;
  }
  .sec-social .social-hoop {
    transform: translate(-50%, 0) scale(0.46);
  }
  .social-hoop-celebration {
    right: 3%;
    top: 13%;
    font-size: 10px;
  }

  @media (min-width: 700px) {
    .social-hoop {
      left: auto;
      right: 6%;
      top: 17%;
      transform: translateY(-8px) scale(0.58);
      transform-origin: top right;
    }
    .sec-social .social-hoop {
      transform: translateY(0) scale(0.58);
    }
  }

  .install-btn { font-size: 9px; padding: 8px 12px; bottom: 78px; right: 4%; }
  .sticky-note { width: 56px; height: 56px; right: 4%; top: 6%; }
  .sticky-note .icon { font-size: 16px; }
  .sticky-note .label { font-size: 6px; }
  .sticky-popup { right: 4%; width: 240px; top: 16%; }

  .notif-toast { font-size: 11px; padding: 10px 14px; }

  /* Right monitor hotspot — bigger touch target */
  .right-mon-hotspot { width: 30%; height: 18%; left: 35%; top: 30%; }
}

@media (max-width: 480px) {
  .wall-h1 { font-size: 18px; }
  .wall-about, .wall-contact { width: 92%; padding: 16px; top: calc(72px + env(safe-area-inset-top)); }
  .wall-h1 { font-size: 18px; }
  .wall-p { font-size: 12px; }
  .tab { font-size: 10px; padding: 10px 14px 10px 12px; }
  .ball { width: 48px !important; height: 48px !important; }
}

.game-over-screen.show { display: flex !important; }
.game-over-emoji {
  width: 116px;
  height: 116px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255,215,0,0.72);
  box-shadow: 0 0 28px rgba(255,215,0,0.26);
}
.game-over-score {
  margin: 0;
  color: #fff;
  font-size: 15px;
  letter-spacing: 1.4px;
}
.game-over-rank {
  min-height: 18px;
  margin: -6px 0 0;
  color: #00ffc8;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-align: center;
  text-shadow: 0 0 14px rgba(0,255,200,0.45);
}

/* Mobile performance — simplify heavy elements */
@media (max-width: 768px) {
  .ball { will-change: auto; transition: none !important; }
  .fanspin { animation-duration: 3s !important; }
  .rgbfill, .rgbline { animation: none !important; }
  .bulb-wire { display: none; }
  .pet { filter: none !important; }
  .pet-shadow { filter: none !important; opacity: 0.28; }
}

/* Natural night mode — room lit by screens/RGB only */
body.is-night .bg-svg rect[fill="url(#wallD)"] { fill: url(#wallN); }
body.is-night #neonSign { filter: brightness(1.2) drop-shadow(0 0 18px #7c3aed); }
body.is-night #serialLights { filter: brightness(1.5); }
body.is-night #floor3d { opacity: 0.35; }
body.is-night .brand { text-shadow: 0 0 12px var(--cyan); }
/* Night floor tiles: dimmer + cyan grout */
body.is-night #floorTiles polygon { fill-opacity: 0.45; }

#installBtn:not(.show) { display: none; }

@media (max-width:768px) {
  /* Mobile — kill expensive animations */
  .serial-strand, .star-twinkle, .star-twinkle2,
  .shooter, .neon-halo, #printerPaper,
  #winGlow { animation: none !important; }
  #galaxyLayer { display: none !important; }
  .serial-strand { opacity: 0.8; }
  .particles { display: none !important; }
}

/* Mobile perf: hide expensive 500-polygon perspective floor, show simple rect */
@media (max-width: 768px) {
  #floorTiles { display: none; }
}

/* === GPU/thermal perf: kill backdrop-filter on mobile (single biggest mobile heater) === */
@media (max-width: 768px) {
  .brand,
  .util-btn,
  .tab,
  .install-guide,
  .wall-about,
  .wall-contact,
  .reaction-msg,
  .nav,
  .mob-notif,
  .mob-mode {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* === Hide curtain + serial lights on small mobile screens (off-canvas anyway) === */
@media (max-width: 600px) {
  #curtainGroup,
  #serialLights { display: none !important; }
}

/* === Drop will-change from .bg-svg (permanent GPU layer); keep on .parallax only === */
.bg-svg { will-change: auto; }

/* === Honor user's OS-level reduce-motion preference === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .particles { display: none !important; }
  #galaxyLayer { display: none !important; }
  .fanspin, .star-twinkle, .star-twinkle2,
  .shooter, .serial-strand, .swayable { animation: none !important; }
  .fanspin { animation: fanSpin 3s linear infinite !important; }
}
