/* ════════════════════════════════════════════════════════════════
   WINR v9 — Onboarding quiz styles.
   Matches the villa-form vibe (numbered steps, friendly tone, clear
   Back/Next nav) but in WINR's dark cinematic palette.
   ════════════════════════════════════════════════════════════════ */

.v9-onb-root {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
}
.v9-onb-root.open { pointer-events: auto; }
.v9-onb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.78);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  opacity: 0;
  transition: opacity 280ms ease-out;
}
.v9-onb-root.open .v9-onb-backdrop { opacity: 1; }

.v9-onb-card {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 64px);
  /* Glass: highly transparent, heavy blur, subtle gradient. Lets the live page
     show through faintly so the quiz feels layered ON the app, not over a
     blackout curtain. */
  background:
    linear-gradient(160deg, rgba(28,28,34,0.55), rgba(14,14,18,0.55)),
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255,0.08), transparent 60%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 24px;
  -webkit-backdrop-filter: blur(40px) saturate(140%);
  backdrop-filter: blur(40px) saturate(140%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.4),
    0 40px 100px rgba(0,0,0,0.7),
    0 0 80px rgba(255, 255, 255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 280ms ease-out;
}
/* Lighter backdrop so the page behind reads through the glass card */
.v9-onb-backdrop {
  background: rgba(6, 6, 8, 0.55);
}
.v9-onb-root.open .v9-onb-card { transform: translateY(0) scale(1); opacity: 1; }

/* Progress strip */
.v9-onb-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.v9-onb-progress-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-lo, #71717A);
  font-family: var(--font-mono, monospace);
}
.v9-onb-dots { display: flex; gap: 6px; }
.v9-dot {
  width: 28px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  transition: all 240ms ease-out;
}
.v9-dot.done   { background: rgba(255, 255, 255,0.45); }
.v9-dot.active {
  background: linear-gradient(90deg, #FFFFFF, #E0E0E4);
  box-shadow: 0 0 10px rgba(255, 255, 255,0.5);
  width: 36px;
}

/* Body — scrolls if step content is tall */
.v9-onb-body {
  padding: 28px 28px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  /* Stagger-fade content between step swaps */
  animation: v9StepFade 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes v9StepFade {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.v9-onb-body::-webkit-scrollbar { width: 6px; }
.v9-onb-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.v9-step-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: #FFFFFF;
  margin-bottom: 10px;
  font-family: var(--font-mono, monospace);
}
.v9-step-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.8px;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.15;
}
.v9-step-sub {
  font-size: 14px;
  color: var(--text-mid, #a3a3a8);
  line-height: 1.5;
  margin: 0 0 24px;
  max-width: 520px;
}

/* Footer — Back / Next */
.v9-onb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(0,0,0,0.25);
}
.v9-btn-back, .v9-btn-skip {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-mid, #a3a3a8);
  border-radius: 999px;
  cursor: pointer;
  transition: all 180ms ease-out;
}
.v9-btn-back:hover, .v9-btn-skip:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.04);
}
.v9-btn-next {
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, #FFFFFF 0%, #E0E0E4 100%);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 200ms ease-out;
  box-shadow: 0 8px 22px rgba(255, 255, 255,0.35);
}
.v9-btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 255, 255,0.5);
}
.v9-btn-next:active { transform: scale(0.97); }
.v9-btn-next.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

/* ── Step 01 — role tile grid ── */
.v9-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.v9-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  color: #fff;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
}
.v9-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 100%, color-mix(in srgb, var(--tc) 22%, transparent) 0%, transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease-out;
}
.v9-tile:hover {
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
  background: rgba(255,255,255,0.05);
  transform: translateY(-2px);
}
.v9-tile:hover::after { opacity: 1; }
.v9-tile.selected {
  border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 8%, rgba(255,255,255,0.04));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 25%, transparent), 0 12px 28px color-mix(in srgb, var(--tc) 25%, transparent);
}
.v9-tile.selected::after { opacity: 1; }
.v9-tile-emoji { font-size: 24px; line-height: 1; }
.v9-tile-label { font-size: 15px; font-weight: 800; letter-spacing: -0.2px; }
.v9-tile-desc { font-size: 11px; color: var(--text-mid, #a3a3a8); line-height: 1.4; }
.v9-tile:active { transform: scale(0.97); }

/* ── Step 02 — title cards ── */
.v9-title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.v9-title-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.v9-title-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255,255,255,0.2);
}
.v9-title-card.selected {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(255, 255, 255,0.25), 0 14px 28px rgba(255, 255, 255,0.25);
}
.v9-title-bg {
  height: 110px;
  background-size: cover;
  background-position: center;
  position: relative;
}
.v9-title-bg.animated-kb { animation: v9KenBurns 18s ease-in-out infinite; }
@keyframes v9KenBurns {
  0%, 100% { background-size: 110%; background-position: 30% 30%; }
  50%      { background-size: 130%; background-position: 70% 70%; }
}
.v9-title-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(8,8,10,0.92) 100%);
}
.v9-title-name {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(8,8,10,0.6);
  color: #fff;
  position: relative;
  z-index: 1;
}
.v9-pick-chip {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #fff;
  z-index: 2;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.v9-title-card:active { transform: scale(0.98); }

/* ── Step 03 — emblem cards ── */
.v9-emblem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.v9-emblem-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  background: rgba(255,255,255,0.025);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.v9-emblem-card:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: rgba(255,255,255,0.18);
}
.v9-emblem-card.selected {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255,0.06);
  box-shadow: 0 0 0 2px rgba(255, 255, 255,0.2);
}
.v9-emblem-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 12px var(--glow-color, currentColor));
  animation: v9Breathe 3.4s ease-in-out infinite;
}
@keyframes v9Breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.06); opacity: 0.85; }
}
.v9-emblem-name { font-size: 11px; font-weight: 600; color: var(--text-mid, #a3a3a8); text-align: center; }
.v9-emblem-card:active { transform: scale(0.98); }

/* ── Step 04 — identity form ── */
.v9-form { display: flex; flex-direction: column; max-width: 480px; }
.v9-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-lo, #71717A);
  margin-bottom: 6px;
}
.v9-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 14px;
  color: #fff;
  font-family: inherit;
  outline: none;
  transition: all 180ms ease-out;
  box-sizing: border-box;
}
.v9-input::placeholder { color: var(--text-lo, #71717A); }
.v9-input:focus {
  border-color: rgba(255, 255, 255,0.6);
  background: rgba(255, 255, 255,0.04);
  box-shadow: 0 0 0 3px rgba(255, 255, 255,0.1);
}
textarea.v9-input { resize: vertical; min-height: 60px; line-height: 1.5; }
.v9-status-row { display: flex; gap: 8px; }
.v9-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid, #a3a3a8);
  cursor: pointer;
  text-transform: capitalize;
  transition: all 180ms ease-out;
}
.v9-status-pill.active {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255,0.08);
  color: #fff;
}
.v9-status-dot { width: 8px; height: 8px; border-radius: 50%; }
.v9-status-dot.online  { background: #39FF14; box-shadow: 0 0 6px rgba(57,255,20,0.6); }
.v9-status-dot.idle    { background: #fbbf24; box-shadow: 0 0 6px rgba(251,191,36,0.6); }
.v9-status-dot.offline { background: var(--text-lo, #71717A); }

/* ── Step 05 — connect tiles ── */
.v9-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.v9-source-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  cursor: pointer;
  color: #fff;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.v9-source-tile:hover {
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
  background: color-mix(in srgb, var(--tc) 6%, rgba(255,255,255,0.04));
  transform: translateY(-2px);
}
.v9-source-tile.selected {
  border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 12%, rgba(255,255,255,0.04));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc) 25%, transparent), 0 12px 28px color-mix(in srgb, var(--tc) 25%, transparent);
}
.v9-source-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tc);
}
.v9-source-icon svg { width: 28px; height: 28px; }
.v9-source-name { font-size: 13px; font-weight: 800; }
.v9-source-tile .v9-pick-chip {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--tc);
  font-size: 9px;
}
.v9-source-tile:active { transform: scale(0.97); }

.v9-skip-link {
  background: transparent;
  border: none;
  color: var(--text-mid, #a3a3a8);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
  transition: color 180ms ease-out;
}
.v9-skip-link:hover { color: #fff; text-decoration: underline; }

/* ── Step 06 — generated WINR pass card ── */
.v9-pass-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 8px auto 14px;
  height: 240px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--pass) 35%, rgba(255,255,255,0.08));
  box-shadow:
    0 24px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 0 60px color-mix(in srgb, var(--pass) 20%, transparent);
  isolation: isolate;
  animation: v9PassEntrance 720ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes v9PassEntrance {
  from { opacity: 0; transform: translateY(40px) rotateX(-6deg) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) rotateX(0) scale(1); }
}
.v9-pass-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.6) saturate(1.1);
}
.v9-pass-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(8,8,10,0.5) 0%, rgba(8,8,10,0.95) 100%);
}
.v9-pass-glow {
  position: absolute;
  right: -60px; bottom: -80px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, color-mix(in srgb, var(--pass) 50%, transparent) 0%, transparent 65%);
  filter: blur(20px);
}
.v9-pass-content {
  position: absolute;
  inset: 0;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1;
  color: #fff;
}
.v9-pass-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--pass);
  font-family: var(--font-mono, monospace);
  text-shadow: 0 0 12px color-mix(in srgb, var(--pass) 40%, transparent);
}
.v9-pass-name {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.8px;
  margin-top: 6px;
  text-shadow: 0 4px 20px rgba(0,0,0,0.6);
}
.v9-pass-title-chip {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  align-self: flex-start;
  backdrop-filter: blur(8px);
}
.v9-pass-emblem {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 18px var(--glow-color, currentColor));
  animation: v9Breathe 3s ease-in-out infinite;
}
.v9-pass-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.v9-pass-verify {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.v9-pass-verify-muted { color: var(--text-lo, #71717A); border-style: dashed; }
.v9-pass-id {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  letter-spacing: 1.5px;
}
.v9-pass-bio {
  text-align: center;
  font-size: 14px;
  color: var(--text-mid, #a3a3a8);
  font-style: italic;
  max-width: 480px;
  margin: 4px auto 0;
  line-height: 1.5;
}

/* ── Step 05 — theme/skin picker ── */
.v9-skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.v9-skin-tile {
  position: relative;
  height: 110px;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  overflow: hidden;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  transition: all 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.v9-skin-tile:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255,255,255,0.2);
}
.v9-skin-tile.selected {
  border-color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(255, 255, 255,0.25), 0 14px 28px rgba(255, 255, 255,0.25);
}
.v9-skin-tile.locked {
  filter: grayscale(0.6) brightness(0.7);
  cursor: not-allowed;
}
.v9-skin-tile.locked:hover {
  filter: grayscale(0.3) brightness(0.85);
}
.v9-skin-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(8,8,10,0.2) 30%, rgba(8,8,10,0.85) 100%);
  pointer-events: none;
}
.v9-skin-name {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.v9-skin-tag {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
  border-radius: 999px;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
.v9-skin-tag.free {
  background: rgba(57,255,20,0.18);
  color: #39FF14;
  border: 1px solid rgba(57,255,20,0.35);
}
.v9-skin-tag.locked {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.18);
}
.v9-skin-tile.selected .v9-pick-chip {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 2;
}
.v9-upsell-note {
  font-size: 12px;
  color: var(--text-mid, #a3a3a8);
  text-align: center;
  margin-top: 4px;
}
.v9-upsell-note a {
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.v9-upsell-note a:hover { text-decoration: underline; }

/* Tablet/mobile breakpoints */
@media (max-width: 720px) {
  .v9-onb-card { max-height: calc(100vh - 32px); }
  .v9-step-title { font-size: 22px; }
  .v9-onb-body { padding: 22px 18px 18px; }
  .v9-onb-progress, .v9-onb-foot { padding-left: 18px; padding-right: 18px; }
  .v9-pass-card { height: 200px; }
  .v9-pass-name { font-size: 24px; }
  .v9-skin-tile { height: 90px; }
}
