:root {
  --bg-1: #03020a;
  --bg-2: #090d24;
  --bg-3: #180d2c;

  --text: #f7f1ff;
  --muted: #cdbfe3;

  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #03020a;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 12% 8%, rgba(151, 48, 230, 0.26) 0%, rgba(101, 39, 188, 0.14) 18%, transparent 41%),
    radial-gradient(ellipse at 30% 16%, rgba(222, 63, 170, 0.18) 0%, rgba(126, 43, 168, 0.11) 22%, transparent 46%),
    radial-gradient(ellipse at 78% 14%, rgba(0, 185, 235, 0.20) 0%, rgba(36, 92, 218, 0.12) 24%, transparent 48%),
    radial-gradient(ellipse at 88% 30%, rgba(87, 255, 172, 0.11) 0%, rgba(39, 194, 154, 0.07) 22%, transparent 45%),
    radial-gradient(ellipse at 89% 30%, rgba(255, 169, 88, 0.08) 0%, rgba(240, 87, 160, 0.06) 22%, transparent 44%),
    radial-gradient(ellipse at 59% 39%, rgba(43, 112, 255, 0.12) 0%, rgba(86, 58, 193, 0.09) 24%, transparent 50%),
    radial-gradient(ellipse at 38% 54%, rgba(80, 255, 185, 0.09) 0%, rgba(31, 150, 134, 0.06) 24%, transparent 50%),
    radial-gradient(ellipse at 25% 72%, rgba(96, 59, 235, 0.13) 0%, rgba(174, 48, 224, 0.07) 26%, transparent 53%),
    radial-gradient(ellipse at 74% 78%, rgba(226, 64, 163, 0.09) 0%, rgba(80, 62, 190, 0.07) 30%, transparent 57%),
    linear-gradient(135deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.74) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(255, 255, 255, 0.42) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(160, 205, 255, 0.36) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(190, 255, 220, 0.24) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(255, 255, 255, 0.16) 0 1px, transparent 1.6px);
  background-size: 82px 82px, 137px 137px, 211px 211px, 263px 263px, 317px 317px;
  background-position: 10px 15px, 48px 83px, 120px 30px, 75px 185px, 190px 160px;
  opacity: 0.42;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 70, 210, 0.20), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(0, 235, 255, 0.18), transparent 26%),
    radial-gradient(circle at 72% 68%, rgba(105, 255, 190, 0.16), transparent 24%),
    radial-gradient(circle at 28% 78%, rgba(165, 95, 255, 0.18), transparent 25%),
    radial-gradient(circle at 52% 42%, rgba(85, 120, 255, 0.12), transparent 30%),
    linear-gradient(
      120deg,
      rgba(255, 0, 255, 0.10),
      rgba(0, 255, 255, 0.10),
      rgba(110, 255, 185, 0.08),
      rgba(255, 255, 120, 0.05),
      rgba(255, 90, 200, 0.08),
      rgba(95, 130, 255, 0.10)
    );
  background-size: 180% 180%, 180% 180%, 180% 180%, 180% 180%, 220% 220%, 400% 400%;
  background-position: 0% 50%, 100% 50%, 70% 20%, 20% 80%, 50% 50%, 0% 50%;
  mix-blend-mode: screen;
  filter: blur(34px);
  opacity: 0.65;
  animation: auroraShift 20s ease infinite, colorGlowPulse 12s ease-in-out infinite;
  z-index: 0;
  transform: scale(1.08);
}

.page {
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 68px 0 54px;
  position: relative;
  z-index: 2;
}

.hero {
  text-align: center;
  margin-bottom: 46px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 8px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.subtitle {
  width: min(680px, 100%);
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 205px));
  gap: 34px 22px;
  align-items: start;
  justify-content: center;
  justify-items: center;
  margin-top: 44px;
}

.portal {
  --c1: #6eeeff;
  --c2: #2b84ff;
  --c3: #e8fbff;
  --c4: #693cff;
  --c5: #180f3d;

  width: min(100%, 205px);
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: transform 220ms ease, filter 220ms ease;
}

.portal:hover {
  transform: translateY(-8px) scale(1.03);
  filter: brightness(1.08);
}

.portal:focus-visible {
  outline: 3px solid white;
  outline-offset: 8px;
  border-radius: 50%;
}

.portal-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: 50%;
  overflow: visible;
}

.portal-vortex {
  position: absolute;
  inset: -5%;
  width: 110%;
  height: 110%;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
  filter:
    drop-shadow(0 0 12px var(--c1))
    drop-shadow(0 0 28px var(--c2))
    drop-shadow(0 0 42px var(--c4));
  opacity: 0.98;
}

.portal-aura {
  position: absolute;
  inset: -3%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--c1), transparent 42%),
    radial-gradient(circle at 34% 24%, var(--c4), transparent 38%),
    radial-gradient(circle at 72% 76%, var(--c2), transparent 34%);
  filter: blur(28px);
  opacity: 0.34;
  z-index: 0;
  animation: portalBreathe 14s ease-in-out infinite;
}

.portal-swirl,
.portal-mist {
  display: none;
}

.portal-core {
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 42%, rgba(255, 255, 255, 0.08), transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(20, 22, 54, 0.95), rgba(5, 8, 18, 0.99) 72%);
  box-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.08),
    inset 0 0 48px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(0, 0, 0, 0.28);
  z-index: 2;
}

.portal-label {
  position: absolute;
  inset: 25%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 10px;
  background: rgba(8, 10, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
  z-index: 4;
}

.portal-label strong {
  display: block;
  margin: 0 0 6px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  font-size: clamp(0.82rem, 1.18vw, 0.96rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.portal-label small {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1.1;
}

/* Broken portal wooden board */
.broken-portal .portal-core {
  inset: 25%;
}

.portal-broken-board {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  z-index: 5;
  width: 126px;
  max-width: 72%;
  min-height: 72px;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  border-radius: 10px;
  background:
    linear-gradient(180deg, #9a6939 0%, #7a4a25 46%, #603719 100%);
  border: 2px solid #412312;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 225, 184, 0.32),
    inset 0 -2px 0 rgba(67, 33, 14, 0.45);
}

.portal-broken-board::before {
  content: "";
  position: absolute;
  inset: 7px 10px;
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 229, 190, 0.08), rgba(0, 0, 0, 0.04)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 214, 160, 0.07) 0 14px,
      rgba(96, 55, 25, 0.03) 14px 28px
    );
  pointer-events: none;
}

.board-main,
.board-sub {
  position: relative;
  z-index: 2;
  display: block;
  white-space: nowrap;
  color: #fff1d7;
  text-shadow: 0 1px 1px rgba(55, 28, 12, 0.7);
}

.board-main {
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
}

.board-sub {
  font-size: 0.58rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.92;
}

.board-nail {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #f7f7f7 0%, #aeb3ba 38%, #676f79 75%, #505761 100%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.55),
    0 1px 2px rgba(0, 0, 0, 0.35);
  z-index: 3;
}

.board-nail-left {
  top: 10px;
  left: 12px;
  transform: rotate(18deg);
}

.board-nail-right {
  top: 8px;
  right: 14px;
  transform: rotate(-13deg);
}

/* Small top-left status badge */
.status-card {
  position: fixed;
  top: 18px;
  left: 18px;
  width: 245px;
  padding: 12px 13px;
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(13, 16, 38, 0.78), rgba(22, 18, 52, 0.58));
  backdrop-filter: blur(16px);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.30),
    inset 0 0 20px rgba(255, 255, 255, 0.04);
  z-index: 20;
}

.status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.status-kicker {
  display: none;
}

.status-card h2 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1;
}

.status-refresh {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease;
}

.status-refresh:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.status-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-name strong,
.status-name small {
  display: block;
}

.status-name strong {
  font-size: 0.82rem;
  line-height: 1.1;
}

.status-name small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.1;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 12px #facc15;
}

.status-pill {
  min-width: 72px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.status-checking {
  background: rgba(250, 204, 21, 0.14);
  color: #fde68a;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.18);
}

.status-online {
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  box-shadow: 0 0 14px rgba(34, 197, 94, 0.32);
}

.status-offline {
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.30);
}

.status-note {
  margin: 8px 0 0;
  color: rgba(247, 241, 255, 0.56);
  font-size: 0.65rem;
  text-align: left;
}

.footer {
  margin-top: 42px;
  text-align: center;
  color: rgba(247, 241, 255, 0.6);
  font-size: 0.95rem;
}

.sparkle {
  position: fixed;
  width: var(--sparkle-size);
  height: var(--sparkle-size);
  left: var(--sparkle-left);
  top: var(--sparkle-top);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle, var(--sparkle-color) 0%, rgba(255, 255, 255, 0.46) 34%, transparent 78%);
  box-shadow:
    0 0 7px var(--sparkle-color),
    0 0 15px var(--sparkle-color);
  opacity: 0;
  animation:
    sparkleWander calc(var(--sparkle-duration) * 2.4) ease-in-out infinite,
    sparkleFade calc(var(--sparkle-fade) * 1.7) ease-in-out infinite;
  animation-delay: var(--sparkle-delay);
}

@keyframes sparkleWander {
  0% {
    transform: translate3d(0, -12vh, 0) scale(0.62);
  }

  13% {
    transform: translate3d(calc(var(--sparkle-drift) * 0.45), 6vh, 0) scale(0.9);
  }

  29% {
    transform: translate3d(calc(var(--sparkle-drift) * -0.85), 24vh, 0) scale(0.72);
  }

  47% {
    transform: translate3d(calc(var(--sparkle-drift) * 1.15), 45vh, 0) scale(1);
  }

  66% {
    transform: translate3d(calc(var(--sparkle-drift) * -0.55), 63vh, 0) scale(0.78);
  }

  83% {
    transform: translate3d(calc(var(--sparkle-drift) * 0.95), 88vh, 0) scale(0.88);
  }

  100% {
    transform: translate3d(calc(var(--sparkle-drift) * -1.25), 115vh, 0) scale(0.64);
  }
}

@keyframes sparkleFade {
  0%, 100% {
    opacity: 0;
  }

  12% {
    opacity: 0.18;
  }

  31% {
    opacity: 0.72;
  }

  48% {
    opacity: 0.34;
  }

  67% {
    opacity: 0.92;
  }

  84% {
    opacity: 0.24;
  }
}

@keyframes auroraShift {
  0% {
    background-position:
      0% 50%,
      100% 50%,
      70% 20%,
      20% 80%,
      50% 50%,
      0% 50%;
  }

  50% {
    background-position:
      100% 50%,
      0% 50%,
      30% 70%,
      80% 25%,
      60% 40%,
      100% 50%;
  }

  100% {
    background-position:
      0% 50%,
      100% 50%,
      70% 20%,
      20% 80%,
      50% 50%,
      0% 50%;
  }
}

@keyframes colorGlowPulse {
  0%, 100% {
    opacity: 0.52;
    filter: blur(30px) hue-rotate(0deg) saturate(1);
  }

  50% {
    opacity: 0.78;
    filter: blur(38px) hue-rotate(55deg) saturate(1.35);
  }
}

@keyframes portalBreathe {
  0%, 100% {
    transform: scale(0.96);
    opacity: 0.28;
  }

  50% {
    transform: scale(1.06);
    opacity: 0.44;
  }
}

@media (max-width: 700px) {
  .page {
    padding-top: 92px;
  }

  .portal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 18px;
  }

  .portal {
    width: min(100%, 190px);
  }

  .portal-label {
    inset: 24%;
    padding: 10px 8px;
  }

  .portal-label strong {
    font-size: 0.76rem;
  }

  .portal-label small {
    font-size: 0.54rem;
  }

  .portal-broken-board {
    width: 118px;
    min-height: 68px;
    padding: 11px 10px 9px;
  }

  .board-main {
    font-size: 0.67rem;
  }

  .board-sub {
    font-size: 0.54rem;
  }

  .status-card {
    top: 12px;
    left: 12px;
    width: 220px;
    padding: 10px 11px;
  }

  .status-card h2 {
    font-size: 0.82rem;
  }

  .status-refresh {
    font-size: 0.66rem;
    padding: 4px 8px;
  }

  .status-name small {
    max-width: 98px;
  }

  .status-pill {
    min-width: 66px;
    font-size: 0.62rem;
  }
}

@media (max-width: 430px) {
  .page {
    width: min(94%, 420px);
    padding: 96px 0 34px;
  }

  .portal {
    width: min(100%, 175px);
  }

  .portal-broken-board {
    width: 110px;
  }

  .board-main {
    font-size: 0.62rem;
  }

  .board-sub {
    font-size: 0.5rem;
  }

  .status-card {
    width: 205px;
  }

  .status-name small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sparkle,
  body::after,
  .portal-aura,
  .portal-vortex {
    animation: none;
  }
}