:root {
  --bg-0: #030812;
  --bg-1: #061224;
  --bg-2: #0a1c38;
  --accent: #29c8ff;          /* سیانِ نئونی: خطوطِ HUD */
  --accent-2: #ffb020;        /* طلایی: سکه/جایزه */
  --blue: #2f7bff;
  --blue-2: #1252c4;
  --danger: #ff4a2b;          /* دکمه‌ی اصلیِ قرمز-نارنجی (مثلِ «وارد بازی شو») */
  --danger-2: #d81e1e;
  --violet: #a66bff;
  --accent-glow: rgba(41, 200, 255, 0.5);
  --ok: #37e07a;
  --err: #ff5c5c;
  --ink: #eaf4ff;
  --ink-dim: #8fa8c4;
  --glass: rgba(8, 22, 44, 0.72);
  --glass-border: rgba(41, 200, 255, 0.26);
  --panel-grad: linear-gradient(180deg, rgba(12, 34, 66, 0.88), rgba(4, 12, 28, 0.92));
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(41,200,255,0.035) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, rgba(41,200,255,0.035) 1px, transparent 1px) 0 0 / 46px 46px,
    radial-gradient(1200px 800px at 50% -10%, #0f2d5a 0%, var(--bg-1) 48%, var(--bg-0) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Vazirmatn", "Tahoma", sans-serif;
  overflow-x: hidden;
}

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.55;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.025) 0px,
    rgba(255,255,255,0.025) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: overlay;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 0 0 220px rgba(0,0,0,0.85);
}

.radar-sweep {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 1400px;
  height: 1400px;
  margin: -700px 0 0 -700px;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(41, 200, 255, 0.20) 0deg,
    rgba(41, 200, 255, 0.05) 25deg,
    transparent 70deg,
    transparent 360deg
  );
  animation: sweep 6s linear infinite;
  opacity: 0.6;
}
.radar-sweep::before,
.radar-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(41, 197, 255, 0.12);
}
.radar-sweep::before { inset: 18%; }
.radar-sweep::after { inset: 36%; }

@keyframes sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 16px;
}

.brand { text-align: center; }

.brand-badge { display: flex; justify-content: center; margin-bottom: 6px; }
.badge-icon { width: 74px; height: 74px; filter: drop-shadow(0 0 14px var(--accent-glow)); }
.badge-icon .ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0.85; }
.badge-icon .ring-2 { stroke: var(--accent-2); opacity: 0.6; animation: pulse-ring 2.4s ease-in-out infinite; }
.badge-icon .ring-dot { fill: var(--accent); }
.badge-icon .crosshair { stroke: rgba(255,255,255,0.35); stroke-width: 1; }

@keyframes pulse-ring {
  0%, 100% { r: 32; opacity: 0.6; }
  50% { r: 36; opacity: 0.15; }
}

.brand-title {
  position: relative;
  font-weight: 900;
  font-size: clamp(2rem, 6vw, 3.2rem);
  margin: 6px 0 2px;
  letter-spacing: 1px;
  background: linear-gradient(180deg, #ffffff 15%, #bfeaff 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px var(--accent-glow);
  animation: flicker 5s ease-in-out infinite;
}

@keyframes flicker {
  0%, 96%, 100% { filter: brightness(1); }
  97% { filter: brightness(1.4); }
  98% { filter: brightness(0.8); }
}

.brand-sub {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin: 0;
  letter-spacing: 0.5px;
}

.card {
  position: relative;
  width: min(420px, 92vw);
  background: var(--panel-grad);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 30px 60px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 0 46px rgba(41, 200, 255, 0.14);
  padding: 10px;
  animation: rise 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 14%; right: 14%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent);
}

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

.tabs {
  position: relative;
  display: flex;
  margin: 8px 8px 4px;
  background: rgba(3, 10, 22, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 4px;
}

.tab {
  flex: 1;
  z-index: 1;
  padding: 12px 0;
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.25s ease;
}
.tab.active { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.4); }

.tab-indicator {
  position: absolute;
  top: 4px;
  right: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  background: linear-gradient(180deg, #3d95ff, var(--blue-2));
  border: 1px solid rgba(140, 210, 255, 0.7);
  border-radius: 9px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 16px rgba(47, 123, 255, 0.55), inset 0 1px 0 rgba(255,255,255,0.35);
}
.tabs.on-register .tab-indicator {
  transform: translateX(-100%);
}

.panels { position: relative; padding: 22px 22px 26px; }

.panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fade-in 0.35s ease both;
}
.panel.active { display: flex; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 0.82rem; color: var(--ink-dim); }

.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(41,200,255,0.28);
  background: rgba(3, 10, 22, 0.75);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.field input::placeholder { color: rgba(255,255,255,0.25); }
.field input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(41,200,255,0.18), 0 0 16px rgba(41,200,255,0.25);
}
.field input.shake { animation: shake 0.4s ease; border-color: var(--err); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 40px; }
.pw-toggle {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  padding: 6px;
}
.pw-toggle:hover { opacity: 1; }

.form-msg {
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--err);
  transition: color 0.2s ease;
}
.form-msg.ok { color: var(--ok); }

.btn-launch {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 170, 130, 0.85);
  border-radius: 12px;
  padding: 14px 0;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 0 rgba(90, 0, 0, 0.55);
  background: linear-gradient(180deg, #ff6a3a 0%, var(--danger-2) 100%);
  cursor: pointer;
  box-shadow: 0 0 22px rgba(255, 74, 43, 0.5), 0 10px 22px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-launch:hover { transform: translateY(-1px); filter: brightness(1.1); box-shadow: 0 0 32px rgba(255, 74, 43, 0.75), 0 14px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.4); }
.btn-launch:active { transform: translateY(0); }
.btn-launch:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.5); }

.btn-glow {
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  left: -50%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  animation: glow-sweep 3.2s ease-in-out infinite;
}
@keyframes glow-sweep {
  0% { left: -50%; }
  50%, 100% { left: 130%; }
}

.foot-note {
  color: rgba(255,255,255,0.28);
  font-size: 0.78rem;
  letter-spacing: 0.4px;
}

/* Launch overlay shown briefly on success before redirect */
.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(3, 8, 18, 0.93);
  backdrop-filter: blur(6px);
}
.launch-overlay.show { display: flex; }

.missile {
  width: 10px;
  height: 44px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #fff, #ffb020 55%, var(--danger));
  box-shadow: 0 0 24px rgba(255, 120, 40, 0.7);
  animation: launch 1.1s cubic-bezier(.5,0,.6,1) infinite;
  position: relative;
}
.missile::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 50%;
  width: 3px;
  height: 30px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--accent), transparent);
  filter: blur(1px);
}
@keyframes launch {
  0% { transform: translateY(120px); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-160px); opacity: 0; }
}

.launch-text {
  color: var(--ink-dim);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

@media (max-width: 420px) {
  .panels { padding: 18px 16px 22px; }
}
