:root {
  --bg-image: url('./assets/background.png');
  --bg-image-fallback: url('./assets/background.jpg');
  --base-0: #070d14;
  --base-1: #0b1623;
  --base-2: #112436;
  --ink-0: #f4f8ff;
  --ink-1: #c6d4e5;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #31d0aa;
  --accent-2: #58f6d0;
  --warn: #ffd166;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: var(--base-0);
  color: var(--ink-0);
}

body {
  font-family: "Space Grotesk", sans-serif;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bg-layer {
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background-color: rgb(31, 38, 48);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 0;
}

.bg-media {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 0;
}

.bg-dim {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.15);
  background-image: url('./assets/overlay.png');
  background-repeat: repeat;
  z-index: 1;
  pointer-events: none;
}

.noise {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.2;
}

.orb {
  position: absolute;
  z-index: 3;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  animation: drift 16s ease-in-out infinite;
}

.orb-a {
  width: 360px;
  height: 360px;
  top: -80px;
  right: -40px;
  background: #2ea8ff;
}

.orb-b {
  width: 280px;
  height: 280px;
  bottom: 4%;
  left: 8%;
  background: #31d0aa;
  animation-delay: -5s;
}

.orb-c {
  width: 230px;
  height: 230px;
  top: 36%;
  left: 46%;
  background: #ffd166;
  animation-delay: -9s;
}

.shell {
  position: relative;
  z-index: 4;
  width: min(1160px, 100%);
  max-height: 100%;
  margin: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-content: center;
  overflow: auto;
  padding: clamp(14px, 3vh, 32px) clamp(14px, 3vw, 32px);
}

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(10, 25, 39, 0.72), rgba(5, 15, 25, 0.84));
  backdrop-filter: blur(7px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.hero {
  grid-column: 1 / -1;
  padding: 28px;
}

.logo-wrap {
  width: 108px;
  height: 108px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.logo-wrap img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

h1,
h2 {
  margin: 0;
  font-family: Sora, sans-serif;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
  font-size: 1.04rem;
  color: var(--ink-1);
  margin-bottom: 10px;
}

#statusText {
  margin: 8px 0 18px;
  color: var(--ink-1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 7px;
}

#phaseText {
  color: var(--accent-2);
}

.progress-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background:
    linear-gradient(90deg, var(--accent), var(--accent-2));
  position: relative;
  transition: width 0.35s ease;
}

.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.5) 40%, transparent 70%);
  animation: shimmer 2s linear infinite;
}

.file-text {
  color: #a0b8ce;
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.join-hint {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: #ffdca2;
  line-height: 1.35;
}

.stats-grid {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
}

.stat-panel,
.message-panel {
  padding: 18px 20px;
}

.message-panel {
  grid-column: 1 / -1;
}

dl {
  margin: 0;
}

.row {
  display: grid;
  grid-template-columns: minmax(92px, 35%) minmax(0, 1fr);
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  gap: 10px;
}

.row:last-child {
  border-bottom: 0;
}

dt {
  color: #90a9be;
}

dd {
  margin: 0;
  color: var(--ink-0);
  font-weight: 600;
  word-break: break-word;
}

#serverMessage {
  margin: 2px 0 0;
  color: #d8e6f5;
  font-size: 1.02rem;
  line-height: 1.4;
}

.reveal-1,
.reveal-2,
.reveal-3 {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal 0.65s ease forwards;
}

.reveal-2 {
  animation-delay: 0.18s;
}

.reveal-3 {
  animation-delay: 0.34s;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(130%); }
}

@keyframes drift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(16px, -20px) scale(1.08);
  }
}

@media (max-width: 900px) {
  body {
    align-items: flex-start;
  }

  .shell {
    gap: 12px;
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .stats-grid {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .message-panel {
    grid-column: auto;
  }

  .hero {
    padding: 18px;
  }

  .row {
    grid-template-columns: 112px 1fr;
    gap: 8px;
  }
}

@media (max-width: 1200px) {
  .shell {
    width: min(1040px, 100%);
  }

  .stats-grid {
    grid-column: 1 / -1;
  }

  .message-panel {
    grid-column: 1 / -1;
  }
}

@media (max-height: 860px) {
  body {
  }

  .shell {
    gap: 10px;
    padding: 10px;
  }

  .hero {
    padding: 18px;
  }

  .logo-wrap {
    width: 88px;
    height: 88px;
    margin-bottom: 10px;
  }

  #statusText {
    margin: 6px 0 12px;
  }

  .stat-panel,
  .message-panel {
    padding: 14px 16px;
  }

  .row {
    padding: 6px 0;
  }
}

@media (max-height: 740px) {
  body {
    overflow: auto;
    align-items: flex-start;
  }

  .shell {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .stats-grid,
  .message-panel {
    grid-column: auto;
  }

  .orb {
    opacity: 0.2;
    filter: blur(30px);
  }
}
