:root {
  --bg: #0b1220;
  --panel: #0f1a2e;
  --panel-2: #0c1526;
  --text: #e7eefc;
  --muted: #9fb2d3;
  --border: rgba(255, 255, 255, 0.08);
  --accent: #ff2d55;
  --accent-2: #5ac8fa;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --left-pane-width: 360px;
  --bottom-pane-height: 240px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 900px at 10% 0%, rgba(90, 200, 250, 0.18), transparent 55%),
    radial-gradient(1200px 900px at 85% 0%, rgba(255, 45, 85, 0.12), transparent 55%), var(--bg);
  color: var(--text);
}

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
}
.btn:active {
  transform: translateY(1px);
}
.btn.pressed {
  transform: translateY(1px);
}
.btn-primary {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.9), rgba(90, 200, 250, 0.7));
  border-color: rgba(255, 255, 255, 0.18);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
}
.btn.comment-active {
  background: rgba(255, 45, 85, 0.22);
  border-color: rgba(255, 45, 85, 0.65);
}
.btn.comment-active:hover {
  background: rgba(255, 45, 85, 0.3);
  border-color: rgba(255, 45, 85, 0.75);
}

.btn.tool-active {
  background: rgba(255, 45, 85, 0.18);
  border-color: rgba(255, 45, 85, 0.7);
}
.btn.tool-active:hover {
  background: rgba(255, 45, 85, 0.26);
  border-color: rgba(255, 45, 85, 0.8);
}

.label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.label input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
}

.label-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.select {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  outline: none;
}

.page-login,
.page-dashboard {
  display: grid;
  place-items: center;
  /* Keep top breathing room for the title, but avoid huge empty space above the card */
  padding: 120px 28px 28px;
  position: relative;
  overflow: hidden;
}

.site-credit {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(231, 238, 252, 0.65);
  z-index: 50;
}
.site-credit a {
  color: rgba(255, 45, 85, 0.9);
  text-decoration: none;
  font-weight: 700;
}
.site-credit a:hover {
  text-decoration: underline;
}

.login-top {
  position: absolute;
  /* Nudge down to avoid clipping on smaller viewports / browser UI bars */
  top: 38px;
  left: 0;
  right: 0;
  z-index: 3;
  display: grid;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
  text-align: center;
}
.login-top-brand {
  font-family: "Bebas Neue", Impact, "Arial Black", system-ui, sans-serif;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 40px;
  line-height: 1.05;
  color: rgba(48, 209, 88, 0.98);
  text-shadow:
    0 0 18px rgba(48, 209, 88, 0.42),
    0 0 42px rgba(48, 209, 88, 0.22);
  position: relative;
}
.login-top-brand::after {
  content: "";
  display: block;
  width: min(520px, 86vw);
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  opacity: 0.55;
}
.login-top-tagline {
  font-family: "Neonderthaw", "Brush Script MT", "Apple Chancery", cursive;
  color: rgba(255, 45, 85, 0.95);
  font-size: 30px;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 14px rgba(255, 45, 85, 0.45),
    0 0 30px rgba(255, 45, 85, 0.18);
}
.login-card {
  width: min(360px, 100%);
  /* Slightly more opaque so background dancers stay visually "outside" the card */
  background: linear-gradient(180deg, rgba(15, 26, 46, 0.55), rgba(0, 0, 0, 0.28));
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  z-index: 2;
  /* Lift a bit so the page doesn't feel vertically empty */
  transform: translateY(-56px);
}

.login-card.puff {
  animation: puffOut 520ms ease forwards;
}
.login-card.puff::before,
.login-card.puff::after {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: var(--radius);
  pointer-events: none;
  background:
    radial-gradient(120px 80px at 30% 30%, rgba(255,255,255,0.35), transparent 70%),
    radial-gradient(160px 110px at 70% 40%, rgba(90,200,250,0.22), transparent 70%),
    radial-gradient(180px 120px at 55% 80%, rgba(255,45,85,0.18), transparent 70%);
  filter: blur(10px);
  opacity: 0;
  animation: smokePuff 520ms ease forwards;
}
.login-card.puff::after {
  inset: -40px;
  filter: blur(18px);
  animation-delay: 80ms;
}

@keyframes puffOut {
  0% { opacity: 1; transform: translateY(-56px) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-82px) scale(1.05); filter: blur(6px); }
}
@keyframes smokePuff {
  0% { opacity: 0.0; transform: scale(0.98); }
  30% { opacity: 0.55; }
  100% { opacity: 0.0; transform: scale(1.08); }
}

.login-hub {
  position: relative;
  z-index: 3;
  width: min(760px, calc(100vw - 28px));
  transform: translateY(-56px);
  opacity: 0;
}
.login-hub.show {
  animation: hubIn 420ms ease forwards;
}
@keyframes hubIn {
  from { opacity: 0; transform: translateY(-74px); }
  to { opacity: 1; transform: translateY(-56px); }
}
.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.hub-tile {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 18px;
  text-align: left;
  background: linear-gradient(180deg, rgba(15, 26, 46, 0.55), rgba(0,0,0,0.28));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.hub-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
}
.hub-title {
  font-family: "Bebas Neue", Impact, "Arial Black", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
  font-size: 18px;
  color: rgba(48, 209, 88, 0.98);
  text-shadow:
    0 0 14px rgba(48, 209, 88, 0.35),
    0 0 26px rgba(48, 209, 88, 0.18);
}
.hub-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.hub-annotate { border-color: rgba(48, 209, 88, 0.55); }
.hub-detect { border-color: rgba(90, 200, 250, 0.55); }
.hub-music { border-color: rgba(255, 45, 85, 0.55); }
.hub-empty { opacity: 0.55; }

.hub-tile[data-disabled="1"] {
  cursor: default;
  opacity: 0.75;
}
.hub-tile[data-disabled="1"]:hover {
  transform: none;
  border-color: rgba(255,255,255,0.14);
}
.hub-tile[data-disabled="1"]::after {
  content: attr(data-badge);
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.75);
}
.login-header {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  justify-items: center;
  text-align: center;
}
.brand {
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: inherit;
}
.subtitle {
  color: var(--muted);
  font-size: 13px;
}
.form {
  display: grid;
  gap: 12px;
}
.hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.login-signup {
  margin-top: 12px;
  font-size: 12px;
  text-align: center;
}
.login-signup a {
  color: rgba(90, 200, 250, 0.95);
  text-decoration: none;
}
.login-signup a:hover {
  text-decoration: underline;
}

/* Login logo: open neon head with extra dancers */
.login-logo {
  display: grid;
  justify-items: center;
  margin-bottom: 2px;
}
.open-head {
  width: 132px;
  height: 110px;
  position: relative;
  filter: drop-shadow(0 18px 22px rgba(0,0,0,0.45));
}
.open-head-rim {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(48, 209, 88, 0.7);
  box-shadow: 0 0 22px rgba(48, 209, 88, 0.24);
  background: rgba(0,0,0,0.12);
}
.open-head-face {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 8px;
  border-radius: 56px 56px 46px 46px;
  border: 2px solid rgba(48, 209, 88, 0.55);
  box-shadow: 0 0 28px rgba(48, 209, 88, 0.18), inset 0 0 18px rgba(48, 209, 88, 0.08);
  background:
    radial-gradient(70px 55px at 40% 42%, rgba(48, 209, 88, 0.10), transparent 70%),
    rgba(0, 0, 0, 0.18);
  animation: headBob2 2.2s ease-in-out infinite;
}
.open-head-mouth {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 18px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(48, 209, 88, 0.45);
  opacity: 0.85;
}
.open-head-inner {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 2px;
  height: 54px;
  overflow: hidden;
  border-radius: 999px;
  pointer-events: none;
}
@keyframes headBob2 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.open-head-inner .mini-dancer {
  position: absolute;
  bottom: -4px;
  width: 42px;
  height: 64px;
  transform-origin: 50% 90%;
}
.open-head-inner .mini-dancer.left { left: 4px; animation: miniDanceL2 1.1s ease-in-out infinite; }
.open-head-inner .mini-dancer.right { right: 4px; animation: miniDanceR2 1.1s ease-in-out infinite; }
@keyframes miniDanceL2 { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg); } }
@keyframes miniDanceR2 { 0%,100% { transform: rotate(8deg); } 50% { transform: rotate(-10deg); } }

.open-head-inner .mini-dancer .head,
.open-head-inner .mini-dancer .body,
.open-head-inner .mini-dancer .arm,
.open-head-inner .mini-dancer .leg {
  position: absolute;
  background: rgba(48, 209, 88, 0.92);
  border: 1px solid rgba(48, 209, 88, 0.22);
  box-shadow: 0 0 18px rgba(48, 209, 88, 0.28);
}
.open-head-inner .mini-dancer .head {
  width: 16px; height: 16px;
  border-radius: 6px;
  left: 50%; top: 2px;
  transform: translateX(-50%);
}
.open-head-inner .mini-dancer .body {
  width: 22px; height: 28px;
  border-radius: 8px;
  left: 50%; top: 20px;
  transform: translateX(-50%);
}
.open-head-inner .mini-dancer .arm {
  width: 8px; height: 22px;
  border-radius: 10px;
  top: 22px;
  transform-origin: 50% 6px;
}
.open-head-inner .mini-dancer .arm.a1 { left: 2px; animation: miniArm1 0.55s ease-in-out infinite; }
.open-head-inner .mini-dancer .arm.a2 { right: 2px; animation: miniArm2 0.55s ease-in-out infinite; }
.open-head-inner .mini-dancer .leg {
  width: 9px; height: 26px;
  border-radius: 10px;
  top: 42px;
  transform-origin: 50% 6px;
}
.open-head-inner .mini-dancer .leg.l1 { left: 12px; animation: miniLeg1 0.7s ease-in-out infinite; }
.open-head-inner .mini-dancer .leg.l2 { right: 12px; animation: miniLeg2 0.7s ease-in-out infinite; }

/* Login neon dance scene (pure CSS, lightweight) */
.login-scene {
  position: absolute;
  inset: -40px;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 30% 30%, rgba(48, 209, 88, 0.22), transparent 60%),
    radial-gradient(900px 500px at 70% 40%, rgba(90, 200, 250, 0.18), transparent 60%),
    radial-gradient(700px 480px at 55% 75%, rgba(255, 45, 85, 0.16), transparent 62%);
  filter: saturate(1.2);
}
.login-scene .dance-floor {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 160vw;
  height: 260px;
  transform: translateX(-50%) perspective(700px) rotateX(58deg);
  background:
    linear-gradient(90deg, rgba(48, 209, 88, 0.0) 0%, rgba(48, 209, 88, 0.22) 50%, rgba(48, 209, 88, 0.0) 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 26px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.06) 0 2px, transparent 2px 26px);
  border: 1px solid rgba(48, 209, 88, 0.22);
  border-radius: 0;
  box-shadow: 0 40px 120px rgba(0,0,0,0.45);
  opacity: 0.9;
}
.login-scene .neon-haze {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 320px at 50% 65%, rgba(48, 209, 88, 0.14), transparent 70%),
    radial-gradient(520px 280px at 50% 65%, rgba(255, 255, 255, 0.06), transparent 70%);
  animation: hazePulse 3.6s ease-in-out infinite;
}
@keyframes hazePulse {
  0%, 100% { opacity: 0.72; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

.login-scene .dancer {
  position: absolute;
  bottom: 16px;
  width: 90px;
  height: 150px;
  transform-origin: 50% 90%;
  /* Keep subtle depth; the ground shadow does the real "standing on floor" work */
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.35));
}
.login-scene .dancer .dancer-inner {
  position: absolute;
  inset: 0;
}
.login-scene .dancer.right .dancer-inner {
  /* Mirror the character so they face the left dancer, without flipping the ground shadow */
  transform: scaleX(-1);
}
.login-scene .dancer::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 110px;
  height: 26px;
  z-index: 0;
  /* Make the shadow clearly visible and "on the floor" (simple 2D projection that reads well). */
  transform: translateX(-50%) scaleY(0.38) skewX(-10deg);
  background: radial-gradient(closest-side, rgba(0,0,0,0.72), rgba(0,0,0,0.0) 72%);
  filter: blur(1px);
  opacity: 1;
  animation: shadowPulse 1.2s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%, 100% { opacity: 0.85; transform: translateX(-50%) scale(1.0, 0.38) skewX(-10deg); }
  50% { opacity: 1; transform: translateX(-50%) scale(0.9, 0.32) skewX(-10deg); }
}

@media (max-height: 760px) {
  .login-card {
    transform: translateY(-30px);
  }
  .login-scene .dance-floor {
    bottom: -14px;
  }
  .login-scene .dancer {
    bottom: 10px;
  }
}
.login-scene .dancer.left { left: 12%; animation: danceLeft 1.2s ease-in-out infinite; }
.login-scene .dancer.right { right: 12%; left: auto; animation: danceRight 1.2s ease-in-out infinite; }

/* Slightly closer to the center so they read as "facing each other" rather than corner stickers */
@media (min-width: 980px) {
  .login-scene .dancer.left { left: 18%; }
  .login-scene .dancer.right { right: 18%; }
}

@keyframes danceLeft {
  0%,100% { transform: perspective(900px) rotateY(18deg) rotate(-6deg); }
  50% { transform: perspective(900px) rotateY(18deg) rotate(8deg); }
}
@keyframes danceRight {
  0%,100% { transform: perspective(900px) rotateY(-18deg) rotate(7deg); }
  50% { transform: perspective(900px) rotateY(-18deg) rotate(-9deg); }
}

.login-scene .dancer .dancer-inner .head,
.login-scene .dancer .dancer-inner .body,
.login-scene .dancer .dancer-inner .arm,
.login-scene .dancer .dancer-inner .leg {
  position: absolute;
  background: rgba(48, 209, 88, 0.9);
  border: 1px solid rgba(48, 209, 88, 0.25);
  box-shadow: 0 0 22px rgba(48, 209, 88, 0.35);
}
.login-scene .dancer .dancer-inner .head {
  width: 32px; height: 32px;
  border-radius: 10px;
  left: 50%; top: 0;
  transform: translateX(-50%);
}
.login-scene .dancer .dancer-inner .head::after {
  /* A tiny "nose" highlight so the characters read as facing inward. */
  content: "";
  position: absolute;
  right: 4px;
  top: 12px;
  width: 9px;
  height: 6px;
  border-radius: 10px;
  background: rgba(48, 209, 88, 0.95);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.55);
  opacity: 0.9;
}
.login-scene .dancer .dancer-inner .body {
  width: 46px; height: 56px;
  border-radius: 12px;
  left: 50%; top: 36px;
  transform: translateX(-50%);
}
.login-scene .dancer .dancer-inner .arm {
  width: 14px; height: 48px;
  border-radius: 12px;
  top: 44px;
  transform-origin: 50% 8px;
}
.login-scene .dancer .dancer-inner .arm.a1 { left: 10px; animation: arm1 0.6s ease-in-out infinite; }
.login-scene .dancer .dancer-inner .arm.a2 { right: 10px; animation: arm2 0.6s ease-in-out infinite; }
@keyframes arm1 { 0%,100% { transform: rotate(-30deg); } 50% { transform: rotate(20deg); } }
@keyframes arm2 { 0%,100% { transform: rotate(25deg); } 50% { transform: rotate(-25deg); } }

.login-scene .dancer .dancer-inner .leg {
  width: 16px; height: 58px;
  border-radius: 12px;
  top: 90px;
  transform-origin: 50% 10px;
}
.login-scene .dancer .dancer-inner .leg.l1 { left: 28px; animation: leg1 0.8s ease-in-out infinite; }
.login-scene .dancer .dancer-inner .leg.l2 { right: 28px; animation: leg2 0.8s ease-in-out infinite; }
@keyframes leg1 { 0%,100% { transform: rotate(10deg); } 50% { transform: rotate(-16deg); } }
@keyframes leg2 { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(16deg); } }
.flash {
  margin: 10px 0;
  border: 1px solid rgba(255, 45, 85, 0.35);
  background: rgba(255, 45, 85, 0.12);
  padding: 10px 12px;
  border-radius: 12px;
}


