:root {
  --bg-900: #030005;
  --bg-850: #08010a;
  --bg-800: #120216;
  --line: #4f1159;
  --line-soft: #320a3b;
  --magenta-100: #ffebf9;
  --magenta-200: #ffb8ef;
  --magenta-300: #ff85e7;
  --magenta-500: #ff29d7;
  --magenta-glow: rgba(255, 41, 215, 0.45);
  --text-main: #fcf5ff;
  --text-soft: #cdafd6;
  --surface: rgba(18, 4, 23, 0.65);
  --surface-strong: rgba(10, 2, 13, 0.85);
  --surface-glass: rgba(18, 4, 23, 0.3);
  --shadow-glow: 0 0 40px var(--magenta-glow);
  --shadow-sm: 0 4px 20px rgba(255, 41, 215, 0.15);
  --ok: #56f2b9;
  --warn: #ffd37b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 14% 14%, #3b0647 0%, transparent 40%),
    radial-gradient(circle at 85% 10%, #2f0436 0%, transparent 35%),
    linear-gradient(150deg, var(--bg-900), var(--bg-850) 55%, #050106);
  background-attachment: fixed;
  overflow-x: hidden;
  position: relative;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 184, 239, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 184, 239, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: -3;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(35px);
  pointer-events: none;
  z-index: -2;
}

.orb-1 {
  width: 320px;
  height: 320px;
  background: rgba(255, 41, 215, 0.18);
  top: 16vh;
  left: -90px;
  animation: drift 8s ease-in-out infinite;
}

.orb-2 {
  width: 380px;
  height: 380px;
  background: rgba(186, 21, 255, 0.15);
  right: -110px;
  top: 48vh;
  animation: drift 9s ease-in-out infinite reverse;
}

.topbar {
  min-height: 84px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 6vw;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 1, 8, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  mix-blend-mode: screen; /* Drops the black background */
  filter: drop-shadow(0 0 12px rgba(255, 41, 215, 0.5));
}

.brand-kicker {
  margin: 0;
  color: var(--magenta-200);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 184, 239, 0.3);
}

h1 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.15rem;
}

nav {
  display: flex;
  gap: 26px;
}

nav a {
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 600;
  position: relative;
  padding: 4px 0;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--magenta-500);
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--magenta-500);
}

nav a:hover {
  color: var(--magenta-100);
  text-shadow: 0 0 14px rgba(255, 133, 231, 0.7);
}

nav a:hover::after {
  width: 100%;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-box span {
  color: var(--magenta-200);
  font-weight: 600;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.layout {
  width: 96vw;
  max-width: 1800px;
  margin: 44px auto 56px;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 30px;
  align-items: start;
}

.layout.is-authenticated {
  grid-template-columns: 1fr;
}

.layout.is-authenticated .info {
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.access,
.info {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.access:hover,
.info:hover {
  box-shadow: var(--shadow-glow), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.access {
  padding: 34px;
}

.chip {
  display: inline-block;
  margin: 0;
  background: rgba(255, 41, 215, 0.1);
  color: var(--magenta-200);
  border: 1px solid rgba(255, 41, 215, 0.3);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  box-shadow: 0 0 12px rgba(255, 41, 215, 0.15);
}

h2 {
  margin: 18px 0 10px;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.muted {
  margin: 0 0 24px;
  color: var(--text-soft);
  line-height: 1.55;
}

.btn {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 0 18px;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(90deg, #ff17c7, #ff59e1);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 23, 199, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(255, 23, 199, 0.5);
  filter: brightness(1.1);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
  transform: skewX(-20deg);
  transition: all 0.5s ease;
}

.btn-primary:hover::after {
  left: 150%;
}

.btn-secondary {
  background: rgba(255, 41, 215, 0.15);
  color: var(--magenta-100);
  border: 1px solid rgba(255, 41, 215, 0.4);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.btn-secondary:hover {
  background: rgba(255, 41, 215, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 41, 215, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-mini {
  min-height: 38px;
  font-size: 0.86rem;
  padding: 0 14px;
}

.link-btn {
  display: grid;
  place-items: center;
  text-decoration: none;
}

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 30px 0;
}

.disclaimer-title {
  margin: 0 0 12px;
  color: var(--magenta-200);
  font-weight: 700;
}

.disclaimer-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  display: grid;
  gap: 10px;
}

.info {
  padding: 28px;
  background: var(--surface-strong);
}

.info-head h3 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1.55rem;
}

.info-head p {
  margin: 8px 0 24px;
  color: var(--text-soft);
}

.division-stack {
  display: grid;
  gap: 20px;
}

.division-card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 20px;
  background: var(--surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.division-card h4 {
  margin: 0;
  color: var(--magenta-200);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.division-description {
  margin: 8px 0 16px;
  color: var(--text-soft);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.module-card {
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.module-card:hover {
  border-color: rgba(255, 41, 215, 0.4);
  background: rgba(255, 41, 215, 0.05);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.module-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.module-card h5 {
  margin: 0;
  font-size: 1rem;
}

.badge {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  color: var(--magenta-200);
  white-space: nowrap;
  background: rgba(255, 41, 215, 0.1);
}

.module-summary {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.4;
  font-size: 0.9rem;
  flex-grow: 1;
}

.module-lock {
  margin: 12px 0 0;
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--warn);
  font-weight: 600;
}

.module-open {
  margin-top: 14px;
  width: 100%;
  background: rgba(255, 41, 215, 0.15);
  color: var(--magenta-100);
  border: 1px solid rgba(255, 41, 215, 0.4);
}

.module-open:hover {
  background: rgba(255, 41, 215, 0.25);
  filter: brightness(1.1);
}

.module-card.is-open {
  border-color: rgba(86, 242, 185, 0.3);
  box-shadow: inset 0 0 0 1px rgba(86, 242, 185, 0.1);
}

.module-card.is-open:hover {
  border-color: rgba(86, 242, 185, 0.6);
  box-shadow: 0 8px 24px rgba(86, 242, 185, 0.15);
}

.module-card.is-open .module-lock {
  color: var(--ok);
}

.module-card.is-locked {
  opacity: 0.6;
  filter: grayscale(0.3);
}

.module-card.is-locked:hover {
  transform: none;
  border-color: var(--line-soft);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: none;
}

.module-card.is-locked .module-open {
  background: rgba(255, 255, 255, 0.05);
  color: #999;
  border-color: rgba(255, 255, 255, 0.1);
  cursor: not-allowed;
}

.module-card.is-locked .module-open:hover {
  background: rgba(255, 255, 255, 0.05);
}

.module-detail {
  margin-top: 20px;
  border: 1px solid rgba(255, 41, 215, 0.3);
  border-radius: 16px;
  padding: 24px;
  background: rgba(18, 4, 23, 0.95);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(20px);
}

.module-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.detail-division {
  margin: 0;
  color: var(--magenta-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
  font-weight: 600;
}

#detail-title {
  margin: 6px 0 0;
  font-family: "Sora", sans-serif;
  font-size: 1.4rem;
}

.detail-summary {
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.5;
}

.detail-content {
  margin-top: 18px;
  color: #dfd1f7;
  line-height: 1.6;
}

.detail-content h5 {
  margin: 0 0 10px;
  color: #f2dcff;
  font-size: 1rem;
}

.detail-content p {
  margin: 0 0 12px;
}

.detail-content ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.detail-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
}

.empty-state {
  border: 1px dashed var(--line-soft);
  border-radius: 14px;
  padding: 24px;
  color: var(--text-soft);
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-25px) scale(1.05);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .module-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 780px) {
  .module-detail-head {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: 16px 20px;
  }

  nav {
    gap: 18px;
    font-size: 0.95rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .layout {
    margin-top: 24px;
    width: 95vw;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .access,
  .info {
    padding: 20px;
    border-radius: 18px;
  }
}
