/* ================================================
   MONAR LAUNCHER — style.css
   Palette: #e63946 red · #1a1d29 navy · #0a0e1a bg
   ================================================ */

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

:root {
  --red:       #e63946;
  --red-dark:  #a4161a;
  --red-deep:  #8a0f14;
  --navy:      #1a1d29;
  --bg:        #0a0e1a;
  --bg2:       #0d1120;
  --glass:     rgba(20, 24, 40, 0.72);
  --border:    rgba(230, 57, 70, 0.22);
  --text:      #f1faee;
  --muted:     rgba(241, 250, 238, 0.45);
  --font:      'Inter', system-ui, sans-serif;
}

html { height: 100%; }

body {
  font-family: var(--font);
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text);
  overflow: hidden;
}

/* ── Matrix canvas ───────────────────────────── */
#matrixCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.06;
  pointer-events: none;
}

/* ── Ambient orbs ────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 12s ease-in-out infinite;
}
.orb-1 { width: 520px; height: 520px; background: radial-gradient(circle, rgba(230,57,70,.28) 0%, transparent 70%);
  top: -180px; left: -160px; animation-delay: 0s; }
.orb-2 { width: 380px; height: 380px; background: radial-gradient(circle, rgba(164,22,26,.22) 0%, transparent 70%);
  bottom: -120px; right: -100px; animation-delay: -5s; }
.orb-3 { width: 260px; height: 260px; background: radial-gradient(circle, rgba(230,57,70,.14) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -9s; }

@keyframes orbFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-30px) scale(1.06); }
}

/* ── Layout ──────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 48px 40px 40px;
  box-shadow:
    0 0 0 1px rgba(230,57,70,.08),
    0 8px 32px rgba(0,0,0,.55),
    0 0 80px rgba(230,57,70,.07);
  animation: cardIn .6s cubic-bezier(.16,1,.3,1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

/* Animated gradient border on card top edge */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(230,57,70,.55) 0%, transparent 50%, rgba(164,22,26,.35) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Step visibility ──────────────────────────── */
.step { display: none; }
.step.active {
  display: block;
  animation: fadeSlideIn .4s cubic-bezier(.16,1,.3,1) both;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ── Logo ────────────────────────────────────── */
.logo-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin: 0 auto 28px;
  animation: logoIn .9s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes logoIn {
  from { opacity: 0; transform: scale(.4) rotate(-12deg); }
  to   { opacity: 1; transform: none; }
}

.logo-halo {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,57,70,.18) 0%, transparent 70%);
  animation: haloBreath 3.5s ease-in-out infinite;
}

@keyframes haloBreath {
  0%, 100% { transform: scale(1); opacity: .7; }
  50%       { transform: scale(1.12); opacity: 1; }
}

.logo-svg {
  width: 148px;
  height: 148px;
  filter: drop-shadow(0 0 20px rgba(230,57,70,.45));
}

.logo-svg.small {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  display: block;
}

/* ── Brand text ──────────────────────────────── */
.brand {
  font-size: 2.8rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-align: center;
  background: linear-gradient(135deg, #ffffff 30%, var(--red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}

.brand-line {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .55em;
  text-align: center;
  color: var(--red);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.tagline {
  font-size: .9rem;
  font-weight: 400;
  color: var(--muted);
  text-align: center;
  margin-bottom: 36px;
  letter-spacing: .02em;
}

/* ── Epic Button ─────────────────────────────── */
.epic-btn {
  position: relative;
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 0 4px 24px rgba(230,57,70,.38), 0 0 0 1px rgba(230,57,70,.2);
  margin-bottom: 20px;
}

.epic-btn:hover {
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 8px 36px rgba(230,57,70,.55), 0 0 0 1px rgba(230,57,70,.35);
}

.epic-btn:active {
  transform: translateY(0) scale(.985);
}

.btn-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: shimmer 3s ease-in-out infinite 1s;
}

@keyframes shimmer {
  0%  { transform: translateX(-100%); }
  30% { transform: translateX(100%);  }
  100%{ transform: translateX(100%);  }
}

.btn-icon { flex-shrink: 0; }

/* ── Powered by ──────────────────────────────── */
.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .03em;
}

/* ── Geometric Triangle Spinner ──────────────── */
.tri-spinner {
  width: 64px;
  height: 64px;
  position: relative;
  margin: 0 auto 28px;
}

.tri {
  position: absolute;
  width: 0;
  height: 0;
  animation: triSpin 1.4s cubic-bezier(.455,.03,.515,.955) infinite;
}

.t1 {
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid var(--red);
  top: 0; left: 16px;
  animation-delay: 0s;
  transform-origin: 0 28px;
}
.t2 {
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid rgba(230,57,70,.5);
  top: 24px; left: 0;
  animation-delay: -.46s;
  transform-origin: 16px 28px;
}
.t3 {
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-bottom: 28px solid rgba(230,57,70,.25);
  top: 24px; left: 32px;
  animation-delay: -.92s;
  transform-origin: -16px 28px;
}

@keyframes triSpin {
  0%   { transform: rotate(0deg);   opacity: 1;   }
  50%  { transform: rotate(180deg); opacity: .6;  }
  100% { transform: rotate(360deg); opacity: 1;   }
}

.status-text {
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  letter-spacing: .04em;
  animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {
  0%, 100% { opacity: .6; }
  50%       { opacity: 1;  }
}

/* ── Success ─────────────────────────────────── */
.check-wrap {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
}

.checkmark-svg { width: 100%; height: 100%; }

.check-ring {
  animation: ringDraw .6s ease-out .1s both;
}
.check-mark {
  animation: checkDraw .4s ease-out .65s both;
}

@keyframes ringDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.success-h {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: .04em;
  background: linear-gradient(135deg, #fff 30%, var(--red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(230,57,70,.12);
  border: 1px solid rgba(230,57,70,.28);
  border-radius: 40px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--red);
  margin: 0 auto 24px;
  display: flex;
  justify-content: center;
  width: fit-content;
}

.next-box {
  background: rgba(10,14,26,.55);
  border: 1px solid rgba(230,57,70,.12);
  border-radius: 14px;
  padding: 20px;
}

.next-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

.next-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.next-row:last-child { margin-bottom: 0; }

.next-num {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 800; color: #fff;
}

.next-row strong { font-size: .9rem; color: var(--text); }
.next-row p { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ── Error ───────────────────────────────────── */
.err-icon { width: 88px; height: 88px; margin: 0 auto 18px; animation: errShake .5s ease .2s both; }

@keyframes errShake {
  0%,100% { transform: none; }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

.err-title {
  font-size: 1.45rem; font-weight: 800; text-align: center;
  color: var(--text); margin-bottom: 10px;
}
.err-msg {
  font-size: .88rem; color: var(--muted); text-align: center; margin-bottom: 24px;
}
.retry-btn {
  width: 100%; padding: 14px;
  background: transparent;
  border: 1px solid rgba(230,57,70,.4);
  border-radius: 12px;
  color: var(--red);
  font-family: var(--font); font-size: .95rem; font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.retry-btn:hover {
  background: rgba(230,57,70,.1);
  transform: translateY(-1px);
}

/* ── Confetti pieces ─────────────────────────── */
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.2s ease-out both;
  pointer-events: none;
}
@keyframes confettiFall {
  from { opacity: 1; transform: translateY(-20px) rotate(0deg); }
  to   { opacity: 0; transform: translateY(80px) rotate(360deg); }
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 500px) {
  .card { padding: 36px 24px 32px; border-radius: 22px; }
  .brand { font-size: 2.2rem; }
  .logo-wrap { width: 120px; height: 120px; }
  .logo-svg  { width: 120px; height: 120px; }
}
