:root {
  --bg: #020305;
  --cyan: #00f3ff;
  --magenta: #ff007a;
  --text: #f8fafc;
  --text-muted: #8896ab;
  --glass: rgba(6, 10, 18, 0.72);
  --glass-border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background: radial-gradient(circle at 50% 50%, #0a1122 0%, #020305 75%, #000002 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
}

#brain-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  cursor: grab;
  display: block;
}

#brain-canvas:active { cursor: grabbing; }

.film-grain {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

.ui-layer {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2rem 3.5rem;
  pointer-events: none;
}

.interactive { pointer-events: auto; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 9999px;
  padding: 0.85rem 2.2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.brand { display: flex; align-items: center; gap: 1rem; }
.brand-title {
  font-family: "Arial Black", Inter, ui-sans-serif, sans-serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 0.25em;
  color: #ffffff;
  text-transform: uppercase;
}

.brand-badge {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  color: var(--text-muted);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-indicator { display: flex; align-items: center; gap: 0.5rem; letter-spacing: 0.12em; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #00f3ff;
  box-shadow: 0 0 14px #00f3ff;
  animation: pulse-dot 1.8s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

.stage {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin: auto 0;
  position: relative;
}

.hemisphere-badge {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.8rem 2rem;
  width: 320px;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
}

.hemisphere-badge.left { border-left: 3px solid var(--cyan); }
.hemisphere-badge.left:hover, .hemisphere-badge.left.active {
  box-shadow: 0 0 45px rgba(0, 243, 255, 0.35);
  transform: translateX(8px);
  border-color: rgba(0, 243, 255, 0.6);
}

.hemisphere-badge.right { border-right: 3px solid var(--magenta); text-align: right; }
.hemisphere-badge.right:hover, .hemisphere-badge.right.active {
  box-shadow: 0 0 45px rgba(255, 0, 122, 0.35);
  transform: translateX(-8px);
  border-color: rgba(255, 0, 122, 0.6);
}

.badge-label { font-size: 0.65rem; letter-spacing: 0.28em; text-transform: uppercase; margin-bottom: 0.5rem; font-weight: 700; }
.badge-label.cyan { color: var(--cyan); text-shadow: 0 0 12px rgba(0,243,255,0.6); }
.badge-label.magenta { color: var(--magenta); text-shadow: 0 0 12px rgba(255,0,122,0.6); }
.badge-title { font-size: 1.25rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.badge-desc { font-size: 0.8rem; line-height: 1.55; color: var(--text-muted); margin-bottom: 1rem; }
.badge-data {
  display: flex; gap: 1rem; font-size: 0.7rem; letter-spacing: 0.1em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.8rem;
  color: var(--text-muted);
}
.hemisphere-badge.right .badge-data { justify-content: flex-end; }

.bottom-deck {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  width: 100%;
}

.hero-heading { text-align: center; }
.hero-title {
  font-family: "Arial Black", Inter, ui-sans-serif, sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff 40%, #90a5c2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.4rem;
}

.hero-title span { display: block; }

.hero-subtitle { font-size: 0.95rem; color: var(--text-muted); letter-spacing: 0.08em; }

.action-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.shock-btn {
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(16px);
  border-radius: 9999px;
  color: #fff;
  padding: 0.65rem 1.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.shock-btn:hover {
  background: #fff;
  color: #000;
  box-shadow: 0 0 35px rgba(255, 255, 255, 0.65);
  transform: scale(1.05);
}

.mode-bar { display: flex; gap: 0.5rem; }
.mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  color: var(--text-muted);
  padding: 0.45rem 1.1rem;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.25s ease;
}

.mode-btn:hover { border-color: #fff; color: #fff; }
.mode-btn.active {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
  color: #fff;
  font-weight: 600;
}

.canvas-hint {
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.legal-links a {
  color: #c7d2e2;
  text-decoration: none;
  border-bottom: 1px solid rgba(199, 210, 226, 0.35);
}

.legal-links a:hover,
.legal-links a:focus-visible {
  color: #fff;
  border-color: #fff;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .status-dot { animation: none; }
  * { scroll-behavior: auto !important; }
}

@media (max-width: 1100px) {
  body { overflow-x: hidden; overflow-y: auto; }
  .ui-layer {
    min-height: 100svh;
    height: auto;
    gap: 0.9rem;
    padding: 1rem;
  }
  header {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: 22px;
  }
  .brand-title { font-size: 1rem; }
  .brand-badge,
  .status-indicator { display: none; }
  .header-status { gap: 0; margin-left: auto; }
  .stage {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin: 0;
  }
  .hemisphere-badge {
    width: 100%;
    max-width: none;
    padding: 1rem 1.2rem;
    text-align: left !important;
  }
  .hemisphere-badge.right .badge-data { justify-content: flex-start; }
  .bottom-deck { gap: 0.8rem; }
  .hero-title { font-size: clamp(2rem, 12vw, 3.2rem); }
  .hero-subtitle { padding-inline: 0.5rem; font-size: 0.78rem; }
  .mode-bar { flex-wrap: wrap; justify-content: center; }
  .mode-btn { padding: 0.45rem 0.75rem; }
  .canvas-hint { max-width: 32rem; text-align: center; letter-spacing: 0.14em; line-height: 1.5; }
  footer { flex-direction: column; gap: 0.55rem; text-align: center; }
}
