:root {
  /* Brand */
  --orange: #e36746;
  --orange-light: #f08b6d;
  --orange-deep: #b8462b;
  --orange-glow: rgba(227, 103, 70, 0.35);

  /* Highlights */
  --cream: #efdebf;
  --cream-muted: #c9b79c;

  /* Secondary accent */
  --teal: #2fb8b4;
  --teal-deep: #2f4442;
  --forest: #3f5d4d;

  /* Surfaces */
  --noir: #14151a;
  --noir-2: #1c1e24;
  --charcoal: #222026;
  --panel: #1e2428;
  --panel-hi: #262d32;

  /* Text */
  --text: #efdebf;
  --text-muted: #a89a82;
  --text-dim: #6e675c;
  --error: #e85a50;

  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 6px;
  --radius-lg: 10px;
  --max-width: 1080px;
  --transition: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--noir);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(227, 103, 70, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(47, 184, 180, 0.04) 0%, transparent 50%),
    linear-gradient(to bottom, var(--noir), #111216);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--noir); }
::-webkit-scrollbar-thumb { background: var(--orange-deep); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--orange); }

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(20, 21, 26, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(227, 103, 70, 0.12);
  padding: 12px 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.nav-mark {
  width: 32px; height: 32px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}

.nav-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.25em;
  color: var(--cream);
}

.nav-tag {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--orange);
  border: 1px solid var(--orange-deep);
  padding: 3px 8px;
  border-radius: 2px;
  margin-left: 4px;
}

/* ============================================
   STEP SWITCHING (simple fade-up, no portal)
   ============================================ */
.step { display: none; }
.step.active { display: block; animation: stepIn 0.35s ease forwards; }
.step.step-out { animation: stepOut 0.2s ease forwards; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes stepOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-6px); }
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.step-desc {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.95rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   PANEL — art-deco framed card used by steps 2-4
   ============================================ */
.panel {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  padding: 44px 36px 36px;
  background:
    linear-gradient(180deg, rgba(47, 68, 66, 0.25) 0%, rgba(28, 30, 36, 0.85) 100%),
    var(--panel);
  border: 1px solid rgba(227, 103, 70, 0.22);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(239, 222, 191, 0.06);
}

/* Brass corner brackets (art-deco motif) */
.panel::before,
.panel::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--orange);
  pointer-events: none;
}

.panel::before {
  top: 10px; left: 10px;
  border-right: none; border-bottom: none;
}

.panel::after {
  bottom: 10px; right: 10px;
  border-left: none; border-top: none;
}

.panel-mark {
  margin: 0 auto 16px;
  opacity: 0.85;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.4));
}

/* ============================================
   STEP 1 — HERO
   ============================================ */
.step-hero.active {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.05) contrast(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center 40%, rgba(20, 21, 26, 0.35) 0%, rgba(20, 21, 26, 0.78) 55%, var(--noir) 100%),
    linear-gradient(to bottom, rgba(20, 21, 26, 0.55), rgba(20, 21, 26, 0.95));
}

.souls-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 130px 0 80px;
  min-width: 0;
}

.hero-logo {
  width: clamp(160px, 28vw, 240px);
  margin: 0 auto 26px;
  filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.65));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--cream);
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--cream-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  padding: 0 8px;
  line-height: 1.6;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  overflow-wrap: break-word;
}

.hero-note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Recent invites activity feed (Steam-style) ---- */
.activity-feed {
  margin: 40px auto 0;
  max-width: 360px;
  text-align: left;
  background: rgba(20, 21, 26, 0.65);
  border: 1px solid rgba(239, 222, 191, 0.08);
  border-radius: var(--radius);
  padding: 12px 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.activity-head {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 66px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--cream-muted);
  opacity: 0;
  animation: activityIn 0.35s ease forwards;
}

.activity-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(47, 184, 180, 0.6);
}

.activity-item .who { color: var(--cream); font-weight: 500; }
.activity-item .when { color: var(--text-dim); font-size: 0.72rem; margin-left: auto; }

@keyframes activityIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  letter-spacing: 0.02em;
  padding: 12px 28px;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--orange-light), var(--orange-deep));
  color: #18110c;
  border: 1px solid var(--orange);
  box-shadow:
    0 4px 18px rgba(227, 103, 70, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow:
    0 6px 28px rgba(227, 103, 70, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-accent {
  background: linear-gradient(180deg, #3cd4d0, #1f8b87);
  color: #0b2322;
  border: 1px solid var(--teal);
  box-shadow:
    0 4px 18px rgba(47, 184, 180, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-accent:hover {
  filter: brightness(1.1);
  box-shadow:
    0 6px 28px rgba(47, 184, 180, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-lg {
  padding: 15px 40px;
  font-size: 1rem;
  min-width: 240px;
}

.btn-arrow { transition: transform var(--transition); }
.btn-primary:hover .btn-arrow,
.btn-accent:hover .btn-arrow { transform: translateX(3px); }

/* ============================================
   STEP 2 — LINK STEAM
   ============================================ */
.step-link { padding: 130px 0 80px; }

.input-group {
  text-align: left;
  margin-bottom: 24px;
}

.input-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.18em;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-mono);
  /* 16px minimum prevents iOS Safari auto-zoom on focus, which would
     leave subsequent steps permanently zoomed. */
  font-size: 16px;
  color: var(--text);
  background: rgba(20, 21, 26, 0.75);
  border: 1px solid rgba(239, 222, 191, 0.12);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.input::placeholder { color: var(--text-dim); font-size: 0.82rem; }

.input:focus {
  border-color: var(--orange);
  background: rgba(14, 15, 19, 0.95);
  box-shadow: 0 0 0 3px rgba(227, 103, 70, 0.14);
}

.input.error { border-color: var(--error); }

.input-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.5;
}

.input-hint .mono { font-family: var(--font-mono); color: var(--cream-muted); }

.input-error {
  font-size: 0.82rem;
  color: var(--error);
  margin-top: 8px;
  min-height: 20px;
  text-align: left;
}

/* ---- Status block (appears after submit) ---- */
.status-block {
  background: rgba(20, 21, 26, 0.6);
  border: 1px solid rgba(47, 68, 66, 0.5);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  text-align: left;
}

.status-block[hidden] { display: none; }

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-6px);
  animation: statusIn 0.35s ease forwards;
}

.status-line[data-delay="0"] { animation-delay: 0.2s; }
.status-line[data-delay="1"] { animation-delay: 1.1s; }
.status-line[data-delay="2"] { animation-delay: 2.0s; }
.status-line[data-delay="3"] { animation-delay: 2.9s; }

@keyframes statusIn {
  to { opacity: 1; transform: translateX(0); }
}

.status-line.done .spinner {
  border-color: var(--teal);
  border-top-color: transparent;
  animation: none;
  background:
    radial-gradient(circle at center, var(--teal) 0%, var(--teal) 30%, transparent 35%);
}

.status-line.done .status-text { color: var(--cream); }

.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--orange-deep);
  border-top-color: transparent;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

/* ============================================
   STEP 3 — QUEUE
   ============================================ */
.step-queue { padding: 130px 0 80px; }

.panel-queue { max-width: 560px; }

.queue-header {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(239, 222, 191, 0.08);
}

.queue-mark { opacity: 0.9; }

.queue-eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--orange);
  margin-bottom: 2px;
}

.queue-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--cream);
}

/* ---- Dial ---- */
.dial-wrap {
  max-width: 280px;
  margin: 0 auto 22px;
  text-align: center;
}

.dial {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 10px;
}

.dial-readout {
  padding-top: 4px;
  border-top: 1px solid rgba(239, 222, 191, 0.08);
}

.dial-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  margin-bottom: 4px;
  margin-top: 8px;
}

.dial-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.03em;
  text-shadow: 0 0 16px rgba(227, 103, 70, 0.3);
}

.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(20, 21, 26, 0.8);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(239, 222, 191, 0.06);
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange-deep), var(--orange), var(--orange-light));
  border-radius: 3px;
  transition: width 0.35s ease;
  box-shadow: 0 0 12px var(--orange-glow);
}

.queue-status {
  font-size: 0.9rem;
  color: var(--cream-muted);
  text-align: center;
  min-height: 22px;
}

/* ============================================
   STEP 4 — READY
   ============================================ */
.step-ready { padding: 130px 0 80px; }

.panel-ready { max-width: 540px; }

.ready-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--teal);
  background: rgba(47, 184, 180, 0.08);
  border: 1px solid rgba(47, 184, 180, 0.22);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 18px;
}

.ready-dot {
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--teal);
  animation: readyPulse 1.8s ease infinite;
}

@keyframes readyPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--teal); }
  50%      { opacity: 0.5; box-shadow: 0 0 16px var(--teal); }
}

.ready-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
}

.ready-desc {
  font-size: 0.95rem;
  color: var(--cream-muted);
  margin-bottom: 28px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

/* ---- Steam-style friend card ---- */
.friend-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 26px;
  background: linear-gradient(180deg, #232a30, #1a1f24);
  border: 1px solid rgba(239, 222, 191, 0.1);
  border-radius: 4px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(239, 222, 191, 0.06);
}

.friend-avatar {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 3px;
  background: linear-gradient(135deg, #3a4148, #20252a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border: 1px solid rgba(47, 184, 180, 0.35);
  position: relative;
}

.friend-avatar::after {
  content: '';
  position: absolute;
  right: -2px; bottom: -2px;
  width: 12px; height: 12px;
  background: var(--teal);
  border: 2px solid var(--panel);
  border-radius: 50%;
}

.friend-body { flex: 1; min-width: 0; }

.friend-name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--cream);
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--teal);
}

.status-online {
  width: 7px; height: 7px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--teal);
  flex-shrink: 0;
}

.friend-game {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--orange);
  padding: 4px 10px;
  background: rgba(227, 103, 70, 0.08);
  border: 1px solid rgba(227, 103, 70, 0.22);
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ready-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ============================================
   LOCKER MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 500px;
  height: 80vh;
  max-height: 680px;
  background: var(--panel);
  border: 1px solid rgba(227, 103, 70, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: scale(0.94) translateY(16px);
  transition: transform 0.3s ease;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(227, 103, 70, 0.15);
}

/* Brass corners on modal too */
.modal-content::before,
.modal-content::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid var(--orange);
  pointer-events: none;
  z-index: 2;
}

.modal-content::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.modal-content::after  { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.modal-overlay.open .modal-content { transform: scale(1) translateY(0); }

.modal-close {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 10;
  background: rgba(28, 30, 36, 0.95);
  border: 1px solid rgba(227, 103, 70, 0.3);
  border-radius: 3px;
  width: 34px; height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cream-muted);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--orange);
  color: #18110c;
  border-color: var(--orange);
}

#locker-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: var(--noir);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 28px 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(239, 222, 191, 0.05);
  line-height: 1.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 520px) {
  .navbar-inner { gap: 8px; }
  .nav-word { font-size: 0.95rem; letter-spacing: 0.2em; }
  .nav-tag { font-size: 0.6rem; padding: 2px 6px; }

  .hero-content { padding: 110px 0 60px; }
  .hero-logo { width: 160px; }

  .panel { padding: 36px 22px 28px; }

  .btn-lg { padding: 14px 28px; font-size: 0.95rem; min-width: 0; width: 100%; }

  .friend-card { flex-wrap: wrap; }
  .friend-game { order: 3; margin-left: auto; }

  .dial-wrap { max-width: 220px; }
  .dial-value { font-size: 1.15rem; }
}

@media (max-width: 380px) {
  .step-title { font-size: 1.35rem; }
  .ready-title { font-size: 1.35rem; }
  /* Keep input at 16px (iOS zoom trigger). Shrink padding only. */
  .input { padding: 12px 14px; }
  .input::placeholder { font-size: 0.72rem; }
}

@media (max-width: 360px) {
  .nav-tag { display: none; }
  .nav-word { font-size: 0.9rem; letter-spacing: 0.18em; }
  .hero-content { padding: 100px 0 50px; }
  .hero-note { padding: 0 8px; }
}

@media (min-width: 1200px) {
  .hero-content { padding: 170px 0 100px; }
}

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
