:root {
  --primary: #ff1a8c;
  --accent: #ffcc00;
  --bg: #08000f;
  --panel-bg: rgba(8,0,15,0.94);
  --text-body: rgba(255,255,255,0.78);
  --text-mid:  rgba(255,255,255,0.5);
  --text-dim:  rgba(255,255,255,0.3);
  --scan-opacity: 0.08;
  --glow-opacity: 0.3;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-x: hidden;
}

/* Static CRT scanlines (very subtle) */
body::before {
  content: '';
  position: fixed; inset: 0;
  background: repeating-linear-gradient(
    0deg, transparent, transparent 2px,
    rgba(0,0,0,0.06) 2px, rgba(0,0,0,0.06) 4px
  );
  pointer-events: none; z-index: 0;
}

/* Animated scan sweep */
.scan-sweep {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 40%, var(--accent) 60%, transparent 100%);
  animation: sweep-down 6s linear infinite;
  opacity: var(--scan-opacity);
  pointer-events: none; z-index: 0;
}
@keyframes sweep-down {
  0%   { transform: translateY(0);    opacity: 0; }
  5%   { opacity: var(--scan-opacity); }
  95%  { opacity: var(--scan-opacity); }
  100% { transform: translateY(100vh); opacity: 0; }
}

/* Ambient glow blobs */
.glow-blob {
  position: fixed; border-radius: 50%;
  pointer-events: none; z-index: 0;
  filter: blur(90px);
  opacity: var(--glow-opacity);
}
.glow-left  { width: 320px; height: 320px; top: 20%;    left: -100px; background: var(--primary); }
.glow-right { width: 280px; height: 280px; bottom: 15%; right: -80px; background: var(--accent); }

/* Portal card */
.portal-card {
  position: relative; z-index: 1;
  max-width: 520px; width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--primary);
  border-radius: 6px;
  padding: 32px 28px;
  box-shadow: 0 0 60px rgba(0,0,0,0.7), 0 0 30px rgba(255,26,140,0.1);
}
.portal-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: 6px 6px 0 0;
}

/* Logo + title */
.portal-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.portal-logo svg { width: 40px; height: 40px; color: var(--primary); flex-shrink: 0; }
.portal-logo-text {
  font-family: 'Rajdhani', 'Share Tech Mono', monospace;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 8px;
  line-height: 1;
}
.portal-subtitle {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 24px;
  padding-left: 54px;
}

/* Game title */
.game-title {
  font-size: 1rem;
  color: var(--text-body);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-align: center;
  min-height: 1.4em;
}

/* Stats row */
.stats-row {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  position: relative;
}
.stat-block + .stat-block::before {
  content: '';
  position: absolute; left: 0; top: 25%; bottom: 25%;
  width: 1px;
  background: rgba(255,255,255,0.1);
}
.stat-num {
  font-family: 'Orbitron', 'Share Tech Mono', monospace;
  font-size: 1.4rem;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Online row */
.online-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 28px;
  font-size: 0.78rem;
  color: var(--text-mid);
}
.online-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #555;
}
.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.offline { background: #ef4444; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.45} }

/* CTA buttons */
.btn {
  display: block; width: 100%;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 13px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-align: center;
  text-decoration: none;
  margin-bottom: 10px;
}
.btn:last-child { margin-bottom: 0; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: rgba(255,26,140,0.08);
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-primary:hover {
  background: rgba(255,26,140,0.2);
  box-shadow: 0 0 18px rgba(255,26,140,0.3);
}
.btn-accent {
  background: rgba(255,204,0,0.06);
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-accent:hover {
  background: rgba(255,204,0,0.15);
  box-shadow: 0 0 18px rgba(255,204,0,0.25);
}
.btn:active { transform: scale(0.98); }

/* Invite section */
#inviteSection { display: none; margin-bottom: 16px; }
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
input[type="text"], input[type="password"] {
  width: 100%;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  padding: 10px 12px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px;
  color: var(--primary);
  outline: none;
  transition: border-color 0.2s;
}
input:focus { border-color: var(--primary); }
input::placeholder { color: var(--text-dim); }

.status-msg {
  font-size: 0.75rem;
  text-align: center;
  margin-top: 8px;
  min-height: 18px;
}
.status-msg.error   { color: #ef4444; }
.status-msg.success { color: #22c55e; }
.status-msg.info    { color: #22d3ee; }

/* Footer */
.card-footer {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.dim-link {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  background: none; border: none;
  cursor: pointer;
  font-family: 'Share Tech Mono', monospace;
  padding: 0;
  transition: color 0.2s;
}
.dim-link:hover { color: var(--text-mid); }

.hidden { display: none !important; }
