@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg:      #0a0d16;
  --surface: #121728;
  --surface2:#161d33;
  --elev:    #1b2340;
  --primary:   #7c78f2;
  --primary-2: #9d7bf6;
  --primary-ink:#0a0d16;
  --p-soft:  rgba(124,120,242,.12);
  --p-line:  rgba(124,120,242,.35);
  --p-glow:  rgba(124,120,242,.28);
  --ok:      #2dd4a7;
  --ok-soft: rgba(45,212,167,.12);
  --ok-line: rgba(45,212,167,.3);
  --danger:  #f2617a;
  --danger-soft: rgba(242,97,122,.1);
  --danger-line: rgba(242,97,122,.28);
  --warn:    #f5b13d;
  --warn-soft: rgba(245,177,61,.14);
  --text1: #eef1f8;
  --text2: #a0aac2;
  --text3: #626d88;
  --glass:  rgba(255,255,255,.03);
  --glass2: rgba(255,255,255,.06);
  --border: rgba(255,255,255,.08);
  --border2:rgba(255,255,255,.14);
  --shadow: 0 24px 60px rgba(0,0,0,.55);
  --r1: 1.25rem;
  --r2: .95rem;
  --r3: .7rem;
  --ease: cubic-bezier(.22,1,.36,1);
  --fast: 150ms;
  --med:  240ms;

  --c0: #0a0d16; --c1: #0e1322; --c2: #121728; --c3: #161d33;
  --cyan: #7c78f2; --cyan2: #9d7bf6; --pink: #f2617a; --purple: #9d7bf6;
  --glow1: rgba(124,120,242,.18); --glow2: rgba(45,212,167,.12); --glow3: rgba(157,123,246,.14);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(720px 480px at 50% -10%, rgba(124,120,242,.10), transparent 70%),
    radial-gradient(600px 400px at 100% 110%, rgba(45,212,167,.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(.75rem, 3vw, 1.5rem);
}

.dash-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text2) !important;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .01em;
  white-space: nowrap;
}

@media (min-width: 769px) {
  .dash-link { transition: all var(--med) var(--ease); }
  .dash-link:hover { background: var(--p-soft); border-color: var(--p-line); color: var(--text1) !important; transform: translateY(-1px); }
}

@media (max-width: 768px) {
  .dash-link { padding: .4rem .8rem; font-size: .72rem; top: .6rem; left: .6rem; }
  .dash-link:active { opacity: .75; }
}

#wizard {
  width: 100%;
  max-width: 460px;
  position: relative;
  z-index: 10;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, #0e1322 100%);
  border-radius: var(--r1);
  border: 1px solid var(--border2);
  padding: clamp(1.4rem, 4vw, 2.1rem);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  position: relative;
  overflow: hidden;
  animation: cardIn 500ms var(--ease) both;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary) 30%, var(--primary-2) 70%, transparent);
  opacity: .8;
}

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

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

.ld-spinner {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 300ms ease;
}

.ld-spinner.hidden { opacity: 0; pointer-events: none; }

.ld-ring {
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.08);
  border-top-color: var(--primary);
  border-right-color: var(--primary-2);
  animation: spin 850ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.lang-wrap { position: relative; display: flex; justify-content: flex-end; margin-bottom: .75rem; }

#langDropdown {
  display: flex; align-items: center; justify-content: center;
  padding: .55rem; border-radius: var(--r3);
  background: var(--glass2); border: 1px solid var(--border);
  color: var(--text2); cursor: pointer; line-height: 1;
}

@media (min-width: 769px) {
  #langDropdown { transition: all var(--fast) ease; }
  #langDropdown:hover { background: var(--elev); border-color: var(--border2); color: var(--text1); }
}

#langMenu {
  position: absolute; right: 0; top: calc(100% + .4rem);
  min-width: 11rem; max-height: 16rem; overflow-y: auto;
  background: var(--elev);
  border: 1px solid var(--border2);
  border-radius: var(--r3);
  box-shadow: 0 20px 50px rgba(0,0,0,.6);
  padding: .3rem 0; z-index: 999;
}

#langMenu.hidden { display: none !important; }

.lang-option {
  display: block; padding: .55rem 1rem;
  color: var(--text2); font-size: .82rem;
  text-decoration: none; cursor: pointer;
}

@media (min-width: 769px) {
  .lang-option { transition: background var(--fast) ease, color var(--fast) ease; }
  .lang-option:hover { background: var(--p-soft); color: var(--text1); }
}

@media (max-width: 768px) {
  .lang-option:active { background: var(--glass2); }
}

#title {
  font-size: clamp(1.5rem, 5.5vw, 2.05rem);
  font-weight: 800;
  text-align: center;
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--text1);
  margin-bottom: clamp(.8rem, 2.5vw, 1.3rem);
}

.step-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: clamp(.9rem, 2.8vw, 1.4rem);
}

.step-circle {
  width: clamp(2.05rem, 5.5vw, 2.5rem);
  height: clamp(2.05rem, 5.5vw, 2.5rem);
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  background: var(--surface2);
  color: var(--text3);
  font-size: clamp(.78rem, 1.8vw, .9rem);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

@media (min-width: 769px) {
  .step-circle { transition: all var(--med) var(--ease); }
}

.step-circle.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 0 3px var(--p-soft), 0 4px 14px var(--p-glow);
  transform: scale(1.06);
}

.step-circle.done {
  border-color: transparent;
  color: var(--primary-ink);
  background: var(--ok);
  box-shadow: 0 3px 10px rgba(45,212,167,.25);
}

.step-circle.done::after {
  content: '✓';
  position: absolute;
  font-size: 1em;
  font-weight: 800;
}

.step-circle.done span { display: none; }

.step-line {
  flex: 1;
  max-width: 2.2rem;
  height: 2px;
  background: var(--border);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
  margin: 0 .2rem;
}

.step-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: inherit;
  transform: translateX(-100%);
}

@media (min-width: 769px) { .step-line::after { transition: transform 500ms var(--ease); } }
@media (max-width: 768px) { .step-line::after { transition: transform 320ms ease; } }

.step-line.active::after { transform: translateX(0); }

.hint-pill {
  width: 100%;
  padding: .6rem 1rem;
  border-radius: var(--r3);
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: clamp(.75rem, 2.2vw, .84rem);
  line-height: 1.5;
  text-align: center;
}

.hint-pill:empty { display: none !important; }

.input-wrap { position: relative; }

.input-wrap input {
  width: 100%;
  padding: .95rem 1rem;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--r3);
  color: var(--text1);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(.95rem, 2.8vw, 1.1rem);
  font-weight: 400;
  text-align: center;
  letter-spacing: .08em;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 769px) {
  .input-wrap input { transition: all var(--med) var(--ease); }
  .input-wrap input:focus { background: var(--elev); border-color: var(--primary); box-shadow: 0 0 0 3px var(--p-soft); }
}

@media (max-width: 768px) {
  .input-wrap input:focus { background: var(--elev); border-color: var(--primary); outline: none; }
}

.input-wrap input::placeholder { color: var(--text3); font-family: 'Outfit', sans-serif; letter-spacing: normal; }

.wait-timer { display: flex; flex-direction: column; gap: .4rem; }
.wait-timer-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: clamp(.72rem, 2vw, .82rem); font-weight: 600; letter-spacing: .01em;
}
.wait-timer-label { color: #34d399; display: flex; align-items: center; gap: .35rem; }
.wait-timer-label::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.9);
  animation: wtPulse 1.1s ease-in-out infinite;
}
.wait-timer-text { color: var(--text2); font-variant-numeric: tabular-nums; }
.wait-timer-track {
  height: .6rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.wait-timer-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #10b981, #34d399 55%, #6ee7b7);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(52,211,153,.55), inset 0 0 6px rgba(255,255,255,.15);
  transition: width 1000ms linear;
}
.wait-timer.ready .wait-timer-bar {
  background: linear-gradient(90deg, #059669, #34d399);
  box-shadow: 0 0 16px rgba(52,211,153,.8);
  animation: wtReady .5s var(--ease) both;
}
.wait-timer.ready .wait-timer-label { color: #6ee7b7; }
.wait-timer.ready .wait-timer-label::before { animation: none; box-shadow: 0 0 10px rgba(110,231,183,1); }
@keyframes wtPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes wtReady { from { transform: scaleY(.6); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .wait-timer-label::before, .wait-timer.ready .wait-timer-bar { animation: none; }
  .wait-timer-bar { transition: none; }
}

button, .btn-primary, .btn-secondary, .btn-ghost, .btn-discord {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: var(--r3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  letter-spacing: .01em;
  line-height: 1;
}

.btn-primary, #btnStart:not(:disabled), #btnNext:not(:disabled) {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%) !important;
  color: #fff !important;
  width: 100%;
  padding: 1rem;
  font-size: clamp(.9rem, 2.6vw, 1.02rem);
  font-weight: 700;
  letter-spacing: .02em;
  box-shadow: 0 6px 18px var(--p-glow);
}

@media (min-width: 769px) {
  .btn-primary, #btnStart:not(:disabled), #btnNext:not(:disabled) {
    transition: transform var(--med) var(--ease), box-shadow var(--med) var(--ease), filter var(--med) var(--ease) !important;
  }
  .btn-primary:hover, #btnStart:not(:disabled):hover, #btnNext:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px var(--p-glow) !important;
    filter: brightness(1.06);
  }
  .btn-primary:active, #btnStart:not(:disabled):active, #btnNext:not(:disabled):active {
    transform: translateY(0);
    transition: transform 80ms ease !important;
  }
}

@media (max-width: 768px) {
  .btn-primary:active, #btnStart:not(:disabled):active, #btnNext:not(:disabled):active {
    opacity: .85;
    transform: scale(.985);
  }
}

.btn-discord, #btnDiscord {
  background: #5865F2 !important;
  color: #fff !important;
  width: 100%;
  padding: .95rem 1rem;
  font-size: clamp(.88rem, 2.5vw, 1rem);
}

@media (min-width: 769px) {
  .btn-discord, #btnDiscord { transition: all var(--med) var(--ease) !important; }
  .btn-discord:hover, #btnDiscord:hover { transform: translateY(-2px); background: #4d5ae8 !important; box-shadow: 0 12px 28px rgba(88,101,242,.32) !important; }
}

@media (max-width: 768px) {
  .btn-discord:active, #btnDiscord:active { opacity: .85; }
}

.btn-ghost, #btnGuest {
  background: var(--surface2) !important;
  border: 1.5px solid var(--border2) !important;
  color: var(--text1) !important;
  width: 100%;
  padding: .9rem 1rem;
  font-size: clamp(.86rem, 2.4vw, .98rem);
}

@media (min-width: 769px) {
  .btn-ghost, #btnGuest { transition: all var(--fast) ease !important; }
  .btn-ghost:hover, #btnGuest:hover { background: var(--elev) !important; border-color: var(--p-line) !important; }
}

@media (max-width: 768px) {
  .btn-ghost:active, #btnGuest:active { opacity: .85; }
}

#btnLogoutStep1, #btnDiscordLogout, #btnRenewAccount {
  padding: .75rem 1.3rem;
  font-size: clamp(.9rem, 2.4vw, 1rem);
  border-radius: var(--r3);
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-weight: 600;
  letter-spacing: .01em;
  min-height: 2.6rem;
}

#btnLogoutStep1 {
  width: 100%;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
}

#btnDiscordLogout {
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  flex: 1;
}

#btnRenewAccount {
  background: var(--warn-soft);
  border: 1px solid rgba(245,177,61,.28);
  color: var(--warn);
  flex: 1;
}

#btnCancel {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1.2rem;
  min-height: 2.5rem;
  border-radius: var(--r3);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  color: var(--danger);
  font-weight: 600;
  font-size: clamp(.85rem, 2.3vw, .95rem);
  letter-spacing: .01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--fast) ease, border-color var(--fast) ease, transform var(--fast) ease;
}
#btnCancel:hover { background: rgba(229,72,77,.16); border-color: rgba(229,72,77,.5); }
#btnCancel:active { transform: scale(.98); }
#btnCancel svg { flex: 0 0 auto; opacity: .9; }

#btnStart:disabled, #btnNext:disabled {
  background: var(--surface2) !important;
  border: 1px solid var(--border) !important;
  color: var(--text3) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
  width: 100%;
  padding: 1rem !important;
  font-size: clamp(.88rem, 2.5vw, 1rem);
}

.spin-icon {
  width: 1rem; height: 1rem;
  stroke: currentColor;
  stroke-linecap: round;
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}

.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .55rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 700;
  letter-spacing: .02em;
}

.badge-premium { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(245,177,61,.28); }
.badge-normal  { background: var(--p-soft); color: var(--primary); border: 1px solid var(--p-line); }

#tosSection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem .9rem;
  border-radius: var(--r3);
  background: var(--glass);
  border: 1px solid var(--border);
}

#tosSection label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .4rem .3rem;
  font-size: clamp(.74rem, 2.1vw, .83rem);
  color: var(--text2);
  cursor: pointer;
  line-height: 1.9;
  text-align: center;
  width: 100%;
}

#tosCheckbox {
  accent-color: var(--primary);
  cursor: pointer;
  width: 1rem; height: 1rem;
  flex-shrink: 0;
}

#tosSection a {
  color: var(--primary) !important;
  text-decoration: none;
  font-weight: 600;
  padding: .1rem .3rem;
  border-radius: .25rem;
  white-space: nowrap;
}

@media (min-width: 769px) {
  #tosSection a { transition: all var(--fast) ease; }
  #tosSection a:hover { background: var(--p-soft); }
}

#boundBanner {
  padding: 1.1rem;
  border-radius: var(--r2);
  background: var(--p-soft);
  border: 1px solid var(--p-line);
}

.bound-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .75rem;
}

.bound-info p {
  font-size: .83rem;
  color: var(--text2);
  margin-bottom: .2rem;
}

.bound-info strong { color: var(--text1); font-size: .9rem; }

.bound-actions { display: flex; gap: .5rem; flex-wrap: wrap; width: 100%; }

.step-hdr {
  text-align: center;
  font-size: clamp(1rem, 3vw, 1.2rem);
  font-weight: 700;
  color: var(--text1);
  letter-spacing: .01em;
}

.step-acct {
  text-align: center;
  font-size: .88rem;
  color: var(--text2);
}

.step-acct strong {
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary);
  font-weight: 600;
}

.result-inner {
  padding: 1.7rem 1.4rem;
  border-radius: var(--r2);
  background: linear-gradient(180deg, var(--ok-soft), rgba(45,212,167,.03));
  border: 1px solid var(--ok-line);
  text-align: center;
  animation: resultReveal 500ms var(--ease) both;
  box-shadow: 0 10px 34px rgba(45,212,167,.1);
  position: relative;
  overflow: hidden;
}

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

.result-badge {
  font-size: 2.75rem;
  margin-bottom: .5rem;
  display: inline-block;
  animation: badgeBounce 700ms var(--ease) both;
  position: relative; z-index: 1;
}

@keyframes badgeBounce {
  0%   { opacity: 0; transform: scale(.4); }
  60%  { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}

.result-title, .result-row { position: relative; z-index: 1; }

.result-title {
  font-size: clamp(1.2rem, 3.5vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ok);
  margin-bottom: 1rem;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .8rem;
  border-radius: .6rem;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  margin-bottom: .5rem;
  gap: .5rem;
}

.result-label { font-size: .82rem; color: var(--text2); font-weight: 500; flex: 0 0 auto; }
.result-val { font-size: .88rem; color: var(--text1); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: 'JetBrains Mono', monospace; font-size: .82rem !important; }
.mt-4 { margin-top: 1rem !important; }

.tier-pill {
  display: inline-block;
  margin: 0 auto 1rem;
  padding: .32rem .9rem;
  border-radius: 999px;
  font-size: .7rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  position: relative; z-index: 1;
}
.tier-free {
  color: var(--primary);
  background: var(--p-soft);
  border: 1px solid var(--p-line);
}
.tier-vip {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid rgba(245,177,61,.4);
  box-shadow: 0 0 16px rgba(245,177,61,.18);
}

.result-countdown {
  position: relative; z-index: 1;
  margin-top: .9rem;
  padding: 1rem .75rem 1.15rem;
  border-radius: var(--r3);
  background: linear-gradient(180deg, var(--ok-soft), rgba(45,212,167,.02));
  border: 1px solid var(--ok-line);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
}
.rc-label {
  font-size: .7rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text2);
}
.rc-time {
  font-size: clamp(1.7rem, 8vw, 2.4rem) !important;
  font-weight: 700; line-height: 1;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}

.err-code {
  margin-top: .75rem;
  font-size: .72rem; color: var(--text3); letter-spacing: .02em;
}
.err-code-val {
  font-family: 'JetBrains Mono', monospace;
  color: var(--danger); font-weight: 600;
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: .4rem;
  padding: .12rem .5rem; margin-left: .4rem;
}

#ad-slot-top, #ad-slot-bottom { display: flex; justify-content: center; overflow: hidden; max-width: 100%; margin: .5rem auto; }
#ad-slot-top iframe, #ad-slot-bottom iframe { max-width: 100%; }

.card-footer {
  margin-top: 1.2rem;
  padding-top: .9rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  text-align: center;
}

.discord-pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  background: rgba(88,101,242,.14);
  border: 1px solid rgba(88,101,242,.28);
  color: #aab2ff !important;
  font-weight: 600; font-size: .84rem;
  text-decoration: none;
}

@media (min-width: 769px) {
  .discord-pill { transition: all var(--med) ease; }
  .discord-pill:hover { background: rgba(88,101,242,.22); transform: translateY(-1px); }
}

.footer-text { font-size: .77rem; color: var(--text3); }
.footer-text a { color: var(--primary) !important; text-decoration: none; }

.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.hidden { display: none !important; }

.ad-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(6,9,18,.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: adGateFade 220ms var(--ease) both;
}
@keyframes adGateFade { from { opacity: 0; } to { opacity: 1; } }

.ad-gate-card {
  background: linear-gradient(180deg, var(--surface), #0e1322);
  border: 1px solid var(--border2);
  border-radius: var(--r1);
  padding: 2rem 1.5rem;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
  animation: adGateSlide 360ms var(--ease) both;
  position: relative;
  overflow: hidden;
}

.ad-gate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--primary-2), transparent);
  opacity: .8;
}
@keyframes adGateSlide { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.ad-gate-icon { font-size: 2.5rem; margin-bottom: .75rem; line-height: 1; }
.ad-gate-title { font-size: 1.2rem; font-weight: 700; color: var(--text1); margin-bottom: .4rem; }
.ad-gate-desc { font-size: .85rem; color: var(--text2); margin-bottom: 1.25rem; line-height: 1.45; }

.ad-gate-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: var(--r2);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform var(--fast), box-shadow var(--fast), filter var(--fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 6px 20px var(--p-glow);
}
.ad-gate-btn:hover { filter: brightness(1.06); box-shadow: 0 10px 28px var(--p-glow); }
.ad-gate-btn:active { transform: scale(.97); }

.ad-gate-timer {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.ad-gate-progress {
  width: 100%;
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.ad-gate-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  border-radius: 3px;
  transition: width 1s linear;
}
.ad-gate-countdown {
  font-size: .8rem;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
}

.ad-gate-continue {
  width: 100%;
  padding: .95rem;
  border: none;
  border-radius: var(--r2);
  background: var(--ok);
  color: var(--primary-ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: transform var(--fast), opacity var(--fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: adGateFade 300ms var(--ease) both;
}
.ad-gate-continue:disabled { opacity: .35; cursor: not-allowed; }
.ad-gate-continue:not(:disabled):active { transform: scale(.96); }
.text-center { text-align: center; }
.w-full { width: 100%; }

.ab-popup {
  background: var(--surface) !important;
  border: 1px solid var(--border2) !important;
  border-radius: var(--r2) !important;
  width: min(94vw, 500px) !important;
  max-height: calc(95vh - 2rem) !important;
  display: flex !important; flex-direction: column !important;
  padding: 1.2rem !important;
  overflow: visible !important;
}

.ab-html {
  max-height: 52vh !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  padding-right: .2rem !important;
  flex: 1 1 auto !important;
}

.ab-inner { display: flex; flex-direction: column; gap: .7rem; }

.ab-yt {
  position: relative; width: 100%; aspect-ratio: 16/9;
  border-radius: .6rem; overflow: hidden;
}

.ab-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.ab-steps { display: flex; flex-direction: column; gap: .4rem; }

.ab-detail {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: .55rem;
  padding: .5rem .7rem;
  cursor: pointer;
  font-size: .8rem;
}

.ab-detail summary {
  font-weight: 600; font-size: .82rem; list-style: none;
  display: flex; align-items: center; gap: .4rem;
  color: var(--text1);
}

.ab-detail summary::-webkit-details-marker { display: none; }

.ab-detail[open] summary::before { content: '▾ '; }
.ab-detail:not([open]) summary::before { content: '▸ '; color: var(--primary); }

.ab-detail p { margin: .35rem 0 0 1.1rem; color: var(--text2); line-height: 1.5; }

.ab-extra { font-size: .76rem; color: var(--text3); text-align: center; padding: .35rem; border-top: 1px solid var(--border); margin-top: .2rem; }

.ab-popup .swal2-actions {
  flex: 0 0 auto !important;
  position: sticky !important; bottom: 0 !important;
  background: var(--surface) !important;
  border-top: 1px solid var(--border) !important;
  padding: .65rem 0 0 !important;
  margin: .5rem 0 0 !important;
  gap: .4rem !important;
  z-index: 10 !important;
}

.swal2-container {
  z-index: 10000 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
}

.swal2-popup {
  background: var(--surface) !important;
  border: 1px solid var(--border2) !important;
  border-radius: var(--r2) !important;
  color: var(--text1) !important;
  padding: 1.4rem !important;
  max-width: 480px !important; width: 90% !important;
  max-height: calc(100vh - 2rem) !important;
  overflow-y: auto !important;
}

.swal2-title { color: var(--text1) !important; font-size: clamp(1rem,3.5vw,1.3rem) !important; font-weight: 700 !important; margin-bottom: .6rem !important; }
.swal2-html-container { color: var(--text2) !important; font-size: clamp(.8rem,2.2vw,.9rem) !important; line-height: 1.55 !important; }
.swal2-actions { margin-top: 1.1rem !important; padding-top: .75rem !important; border-top: 1px solid var(--border) !important; gap: .5rem !important; flex-wrap: wrap !important; }
.swal2-confirm { background: linear-gradient(135deg, var(--primary), var(--primary-2)) !important; color: #fff !important; border: 0 !important; border-radius: var(--r3) !important; padding: .7rem 1.5rem !important; font-weight: 700 !important; font-size: .88rem !important; }
@media (min-width: 769px) { .swal2-confirm { transition: all var(--med) ease !important; } .swal2-confirm:hover { filter: brightness(1.06) !important; transform: translateY(-1px) !important; } }
.swal2-cancel { background: var(--surface2) !important; border: 1px solid var(--border2) !important; border-radius: var(--r3) !important; padding: .7rem 1.5rem !important; color: var(--text1) !important; font-size: .88rem !important; }
.swal2-loader { border-color: var(--primary) transparent var(--primary-2) transparent !important; }
.swal2-icon.swal2-error { border-color: var(--danger) !important; color: var(--danger) !important; }
.swal2-icon.swal2-warning { border-color: var(--warn) !important; color: var(--warn) !important; }
.swal2-icon.swal2-success { border-color: var(--ok) !important; color: var(--ok) !important; }

@media (max-width: 768px) {
  .swal2-container { padding: .5rem !important; }
  .swal2-popup { padding: 1rem !important; width: calc(100% - 1rem) !important; }
  .swal2-actions { flex-direction: column !important; }
  .swal2-confirm, .swal2-cancel { width: 100% !important; margin: 0 !important; }
  .ab-popup { width: calc(100vw - .8rem) !important; }
  .ab-html { max-height: 44vh !important; }
  .ab-popup .swal2-confirm, .ab-popup .swal2-cancel { width: 100% !important; }
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--p-line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.step-fade-in { animation: stepFade 350ms var(--ease) both; }
@keyframes stepFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#btnStart:not(:disabled), #btnNext:not(:disabled) { animation: btnReady 400ms var(--ease) both; }
@keyframes btnReady { from { opacity: .7; transform: scale(.98); } to { opacity: 1; transform: none; } }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.ld-spinner { flex-direction: column; gap: 1rem; }
.ld-text { color: var(--text2); font: 500 .85rem system-ui, sans-serif; letter-spacing: .02em; }

@supports (-webkit-touch-callout: none) {
  * { -webkit-tap-highlight-color: transparent; }
  .card, button, input { -webkit-transform: translateZ(0); transform: translateZ(0); }
  .swal2-container, .swal2-popup { -webkit-overflow-scrolling: touch !important; }
}

@media (max-width: 640px) {
  .card { border-radius: 1.1rem; padding: 1.1rem 1rem 1.3rem; }
  .step-circle { width: 1.7rem !important; height: 1.7rem !important; font-size: .66rem !important; }
  .step-line { max-width: 1rem !important; }
  #title { letter-spacing: -.03em; }
  .btn-primary, .btn-discord, .btn-ghost,
  #btnStart, #btnNext, #btnDiscord, #btnGuest { padding: .85rem .9rem !important; font-size: .88rem !important; }
  #btnLogoutStep1, #btnDiscordLogout, #btnRenewAccount { padding: .7rem 1rem; font-size: .88rem; min-height: 2.4rem; }
  .bound-actions { flex-direction: column; }
  .dash-link { font-size: .68rem; padding: .35rem .7rem; }
}

@media (max-width: 380px) {
  .step-circle { width: 1.5rem !important; height: 1.5rem !important; font-size: .6rem !important; }
  .step-line { max-width: .6rem !important; }
  #title { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

#title {
  background: linear-gradient(100deg, var(--text1) 0%, var(--primary-2) 64%, var(--primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
