/* ==========================================================================
   UPLOAD WIZARD — Full-bleed step-by-step
   ==========================================================================
   Layout:
     [progress bar]   ← fixed 3px line at the very top of the viewport
     [topbar]         ← brand + exit, ~64px
     [stage]          ← flex-1, vertically centers each step
       [form]
         [step]       ← only one is `is-active`, the rest are hidden
   No nav / no footer on this page — the wizard owns the screen.
   ========================================================================== */

/* Global override: any `display: ...` rule we write below would normally
   beat the user-agent stylesheet's `[hidden] { display: none }` because
   class selectors win on equal specificity. We force the hidden attribute
   to always hide the element so the wizard's conditional show/hide logic
   (.wiz-subgroup, .wiz-thumb-preview, .wiz-success, etc.) just works. */
[hidden] { display: none !important; }

.wiz-body {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  /* keep the topbar from sliding under the progress bar */
  padding-top: 0;
}

.wiz-boot-banner {
  flex-shrink: 0;
  margin: 0;
  padding: 12px 32px;
  font-size: 0.88rem;
  line-height: 1.45;
  background: rgba(99, 102, 241, 0.12);
  border-bottom: 1px solid rgba(129, 140, 248, 0.25);
  color: var(--text-secondary);
}

.wiz-boot-banner[hidden] { display: none; }

.wiz-boot-banner strong {
  color: var(--text-primary);
  font-weight: 600;
}

.wiz-boot-banner-draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  background: rgba(255, 165, 2, 0.1);
  border-bottom-color: rgba(255, 165, 2, 0.28);
}

.wiz-draft-resume,
.wiz-draft-discard {
  border: none;
  background: transparent;
  color: var(--accent-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.wiz-draft-discard {
  color: var(--text-secondary);
  font-weight: 500;
}

.wiz-body.is-quick-mode .wiz-step[data-step-name="instructions"] .wiz-step-foot [data-wiz-next]::after,
.wiz-body.is-quick-mode .wiz-step[data-step-name="compat"] .wiz-step-foot [data-wiz-next]::after,
.wiz-body.is-quick-mode .wiz-step[data-step-name="details"] .wiz-step-foot [data-wiz-next]::after {
  content: none;
}

/* ----- Progress Bar (the only visible "where am I" indicator) -------------- */
.wiz-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 50;
  pointer-events: none;
}

.wiz-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, #ff5e8a));
  border-radius: 0 999px 999px 0;
  /* longer ease-out so the bar feels weighty as it advances */
  transition: width 520ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.04);
}

/* ----- Topbar (minimal: brand + exit) -------------------------------------- */
.wiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  flex-shrink: 0;
}

.wiz-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.wiz-brand img {
  height: 32px;
  width: auto;
  display: block;
}

.wiz-exit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.wiz-exit:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.wiz-exit-x {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ----- Stage (vertically centers the step) -------------------------------- */
.wiz-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  padding: 32px 24px 64px;
  overflow-x: hidden;
  position: relative;
}

@media (min-height: 800px) {
  /* on tall screens, give it more room to breathe by centering vertically */
  .wiz-stage { align-items: center; padding-top: 24px; padding-bottom: 96px; }
}

.wiz-form {
  width: 100%;
  max-width: 760px;
  display: block;
  position: relative;
}

/* ----- Step (no card chrome — the page IS the step) ----------------------- */
.wiz-step {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 32px;
  /* baseline state for animations */
  opacity: 1;
  transform: translateY(0);
  will-change: transform, opacity;
}

.wiz-step.is-active {
  display: flex;
}

.wiz-step[hidden] {
  display: none !important;
}

.wiz-step-inner {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

/* Step header — eyebrow / big title / lead description */
.wiz-step-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.wiz-step-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent-primary);
  opacity: 0.85;
}

.wiz-step-title {
  font-size: 2.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.15;
}

.wiz-step-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
  max-width: 56ch;
}

/* Step footer — Back / Continue */
.wiz-step-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.wiz-foot-spacer { display: inline-block; }

/* ==========================================================================
   FIELDS
   ========================================================================== */

.wiz-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.wiz-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wiz-req { color: var(--accent-primary); font-size: 0.8em; }
.wiz-opt { color: var(--text-tertiary); font-weight: 400; font-size: 0.8em; }
.wiz-hint { font-size: 0.78rem; color: var(--text-tertiary); margin: 4px 0 0; line-height: 1.45; }

.wiz-input,
.wiz-textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.wiz-input:focus,
.wiz-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}
.wiz-input::placeholder,
.wiz-textarea::placeholder { color: var(--text-tertiary); }

.wiz-textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.wiz-code-input {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.85rem;
  min-height: 220px;
  background: rgba(0, 0, 0, 0.25);
}

.wiz-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.wiz-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 160ms ease, transform 120ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease;
  text-decoration: none;
  white-space: nowrap;
}
.wiz-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.wiz-btn-primary {
  background: var(--accent-primary);
  color: #fff;
}
.wiz-btn-primary:hover:not(:disabled) {
  background: var(--accent-primary);
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.wiz-btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}
.wiz-btn-success:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); }

.wiz-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}
.wiz-btn-ghost:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}

.wiz-btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
}

.wiz-arrow {
  font-size: 1.05em;
  display: inline-block;
  transition: transform 160ms ease;
}
.wiz-btn:hover .wiz-arrow { transform: translateX(2px); }
.wiz-btn-ghost:hover .wiz-arrow { transform: translateX(-2px); }

/* ==========================================================================
   STEP 0 — TYPE PICKER (4 squares)
   ========================================================================== */

.wiz-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 720px) {
  .wiz-type-grid { grid-template-columns: repeat(4, 1fr); }
}

.wiz-type-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, transform 140ms ease;
  user-select: none;
}
.wiz-type-card input { position: absolute; opacity: 0; pointer-events: none; }
.wiz-type-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.18); }
.wiz-type-card.is-selected {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 3px rgba(255, 100, 150, 0.12);
}

.wiz-type-card-icon {
  font-size: 2rem;
  line-height: 1;
}
.wiz-type-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.wiz-type-card-desc {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* ==========================================================================
   STEP 2 — PRICING (questions, choices, subgroups)
   ========================================================================== */

.wiz-question { display: flex; flex-direction: column; gap: 10px; }
.wiz-question-prompt {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
}

.wiz-choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wiz-choice {
  position: relative;
  padding: 14px 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 140ms ease, background 140ms ease;
  user-select: none;
}
.wiz-choice input { position: absolute; opacity: 0; pointer-events: none; }
.wiz-choice:hover { border-color: rgba(255, 255, 255, 0.16); }
.wiz-choice.is-selected {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.04);
}
.wiz-choice-name { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.wiz-choice-desc { color: var(--text-tertiary); font-size: 0.78rem; }

.wiz-subgroup {
  border-left: 2px solid rgba(255, 255, 255, 0.08);
  padding: 4px 0 4px 18px;
  margin-left: 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wiz-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .wiz-row-2,
  .wiz-choice-row { grid-template-columns: 1fr; }
}

.wiz-money { position: relative; }
.wiz-money-sym {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-weight: 500;
  pointer-events: none;
}
.wiz-money .wiz-input { padding-left: 28px; }

/* Premium tiers — each tier is a full card with name+price header
 * and per-tier includes/excludes textareas underneath. */
.wiz-tiers { display: flex; flex-direction: column; gap: 14px; }

.wiz-tier-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  transition: border-color 140ms ease, background 140ms ease;
}
.wiz-tier-card:hover { border-color: rgba(255, 255, 255, 0.16); }

.wiz-tier-head {
  display: grid;
  grid-template-columns: auto 1.4fr 1fr auto;
  gap: 8px;
  align-items: center;
}
.wiz-tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-primary, #6c5ce7);
  background: rgba(108, 92, 231, 0.12);
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 6px;
}
.wiz-tier-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.wiz-tier-features { margin: 0; }
.wiz-tier-features .wiz-textarea {
  min-height: 84px;
  font-size: 0.88rem;
}

@media (max-width: 720px) {
  .wiz-tier-head {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "badge name remove"
      "price price price";
  }
  .wiz-tier-badge { grid-area: badge; }
  .wiz-tier-name { grid-area: name; }
  .wiz-tier-price-wrap { grid-area: price; }
  .wiz-tier-remove { grid-area: remove; }
  .wiz-tier-body { grid-template-columns: 1fr; }
}

.wiz-tier-remove {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1rem;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.wiz-tier-remove:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }

/* ==========================================================================
   STEP 4 — INSTRUCTIONS BLOCKS
   ========================================================================== */

.wiz-instr {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiz-instr-empty {
  padding: 30px 18px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.88rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.wiz-instr-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.wiz-instr-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.wiz-instr-kind {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.wiz-instr-input {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.wiz-instr-text,
.wiz-instr-url {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
}
.wiz-instr-text { min-height: 44px; resize: vertical; line-height: 1.45; }
.wiz-instr-text:focus,
.wiz-instr-url:focus { outline: none; border-color: var(--accent-primary); }

.wiz-instr-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wiz-instr-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.wiz-instr-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-primary); }
.wiz-instr-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.wiz-instr-remove:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }

.wiz-instr-preview img,
.wiz-instr-preview iframe {
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  background: #000;
  display: block;
}
.wiz-instr-preview iframe { aspect-ratio: 16 / 9; max-height: none; height: 220px; }

.wiz-instr-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

/* ==========================================================================
   STEP 5 — COMPATIBILITY
   ========================================================================== */

.wiz-key {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 0.78em;
  font-weight: 600;
}
.wiz-key.works { background: rgba(34, 197, 94, 0.15); color: #4ade80; }
.wiz-key.broken { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.wiz-exec-input-wrap { position: relative; }

.wiz-game-input-wrap { position: relative; }

.wiz-game-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary, #1a1a1a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.wiz-game-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
}

.wiz-game-suggest-item:hover,
.wiz-game-suggest-item.is-active { background: rgba(255, 255, 255, 0.06); }

.wiz-game-suggest-name {
  font-size: 0.86rem;
  font-weight: 600;
}

.wiz-game-suggest-meta {
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

.wiz-game-status.is-ok { color: #4ade80; }
.wiz-game-status.is-error { color: #f87171; }
.wiz-game-status.is-loading { color: var(--text-secondary); }
.wiz-game-status.is-info { color: var(--text-secondary); }

.wiz-exec-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary, #1a1a1a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.wiz-exec-suggest-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 0.86rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wiz-exec-suggest-item:hover,
.wiz-exec-suggest-item.is-active { background: rgba(255, 255, 255, 0.06); }
.wiz-exec-suggest-item-count { color: var(--text-tertiary); font-size: 0.74rem; }

.wiz-compat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1.5px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}
.wiz-empty {
  width: 100%;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.82rem;
  align-self: center;
}

.wiz-compat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  transition: all 160ms ease;
}
.wiz-compat-pill.works {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
}
.wiz-compat-pill.broken {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}
.wiz-compat-pill-x {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.72rem;
  color: inherit;
  transition: background 140ms ease;
}
.wiz-compat-pill-x:hover { background: rgba(255, 255, 255, 0.16); }

/* ==========================================================================
   STEP 6 — DETAILS (thumb + tags)
   ========================================================================== */

.wiz-thumb-area {
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 28px 16px;
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.wiz-thumb-area:hover { border-color: var(--accent-primary); }
.wiz-thumb-area.is-dragging { border-color: var(--accent-primary); background: rgba(255, 255, 255, 0.04); }

.wiz-thumb-area--compact {
  padding: 18px 14px;
  min-height: 120px;
}

.wiz-thumb-confirm-field {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.wiz-thumb-nudge {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.35);
  color: #f5d76e;
}

.wiz-thumb-nudge.is-highlight {
  animation: wiz-thumb-nudge-pulse 1.2s ease 2;
}

@keyframes wiz-thumb-nudge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
  50% { box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.25); }
}

.wiz-review-thumb {
  cursor: pointer;
  transition: outline 160ms ease;
}
.wiz-review-thumb:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.wiz-thumb-icon { font-size: 2rem; margin-bottom: 6px; }
.wiz-thumb-text { font-weight: 600; color: var(--text-primary); font-size: 0.95rem; }
.wiz-thumb-hint { color: var(--text-tertiary); font-size: 0.78rem; margin-top: 4px; }

.wiz-thumb-preview {
  position: absolute;
  inset: 0;
  display: none;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0d10;
}
.wiz-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wiz-thumb-preview.is-visible { display: block; }
/* When a thumb is loaded we hide the icon/text/hint underneath so they
   don't peek through if the preview ever becomes partially transparent. */
.wiz-thumb-area.has-image .wiz-thumb-icon,
.wiz-thumb-area.has-image .wiz-thumb-text,
.wiz-thumb-area.has-image .wiz-thumb-hint { visibility: hidden; }

.wiz-thumb-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: background 140ms ease;
}
.wiz-thumb-remove:hover { background: rgba(0, 0, 0, 0.85); }

.wiz-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  min-height: 44px;
  align-items: center;
  cursor: text;
  transition: border-color 140ms ease;
}
.wiz-tags:focus-within { border-color: var(--accent-primary); }

.wiz-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 500;
}
.wiz-tag-x {
  width: 18px; height: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wiz-tag-x:hover { background: rgba(239, 68, 68, 0.3); color: #f87171; }

.wiz-tag-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 4px 0;
}
.wiz-tag-input::placeholder { color: var(--text-tertiary); }

/* ==========================================================================
   STEP 7 — REVIEW
   ========================================================================== */

.wiz-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 22px;
}
@media (max-width: 700px) {
  .wiz-review-grid { grid-template-columns: 1fr; }
}

.wiz-review-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
}
.wiz-review-thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
.wiz-review-thumb::before { content: 'No thumbnail'; }
.wiz-review-thumb.has-img {
  background-color: #0d0d10;
}
.wiz-review-thumb.has-img::before { content: ''; }

.wiz-review-body { padding: 14px; display: flex; flex-direction: column; gap: 6px; }

.wiz-review-type {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.wiz-review-type.local { background: #3498db; color: #fff; }
.wiz-review-type.universal { background: #2ecc71; color: #fff; }
.wiz-review-type.serverside { background: #e67e22; color: #fff; }
.wiz-review-type.serverside_executor { background: #6c5ce7; color: #fff; }

.wiz-review-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}
.wiz-review-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.wiz-review-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
}

.wiz-review-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.wiz-review-list > div {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.wiz-review-list > div:last-child { border-bottom: 0; }
.wiz-review-list dt {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.wiz-review-list dd {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-primary);
  line-height: 1.45;
  word-break: break-word;
}

.wiz-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  cursor: pointer;
}
.wiz-terms input { margin-top: 3px; }
.wiz-terms span {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.wiz-terms a { color: var(--accent-primary); }

/* ==========================================================================
   SUCCESS STATE
   ========================================================================== */

/* Hidden by default — revealed only after a successful publish.
   We avoid relying on the [hidden] attribute alone here because a flat
   `display: flex` rule would override the UA stylesheet. Showing is
   gated on the `is-active` class added by JS in revealSuccess(). */
.wiz-success {
  display: none;
  text-align: center;
  padding: 60px 24px;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.wiz-success.is-active { display: flex; }
.wiz-success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3);
}
.wiz-success-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-primary);
}
.wiz-success-text { margin: 0; color: var(--text-secondary); max-width: 420px; }
.wiz-success-share-label {
  margin: 8px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.wiz-success-share {
  display: flex;
  gap: 8px;
  width: min(100%, 480px);
  margin-top: 4px;
}
.wiz-success-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.wiz-success.is-first-publish .wiz-success-icon {
  background: linear-gradient(135deg, #a855f7, #6366f1);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.35);
}
.wiz-success-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 540px) {
  .wiz-topbar { padding: 14px 18px; }
  .wiz-stage { padding: 18px 18px 56px; }
  .wiz-step-title { font-size: 1.6rem; }
  .wiz-step-foot { flex-wrap: wrap; }
  .wiz-step-foot .wiz-btn { flex: 1; min-width: 130px; }
}

/* Reduced motion users get the progress bar to jump instead of slide */
@media (prefers-reduced-motion: reduce) {
  .wiz-progress-fill { transition: none; }
}

.wiz-label-optional {
  font-weight: 400;
  color: var(--text-tertiary);
  font-size: 0.85em;
}

.wiz-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  margin: 4px 0 16px;
}

.wiz-preview-grid[hidden] { display: none !important; }

.wiz-preview-tile {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wiz-preview-tile img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

@media (max-width: 768px) {
  .wiz-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

#sw-thumb-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #0d0d10;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: min(52vw, 280px);
  overflow: hidden;
}

#sw-thumb-preview[hidden] {
  display: none !important;
}

#sw-thumb-preview img {
  max-width: 100%;
  max-height: min(48vw, 260px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.wiz-preview-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.wiz-preview-remove:hover { background: rgba(0, 0, 0, 0.9); }
