/* ============================================================
   LoL Champion Recommender — Stylesheet
   Theme: Dark navy + Runic gold (League of Legends aesthetic)
   ============================================================ */

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --bg-deep:      #080c18;
  --bg-dark:      #0d1117;
  --bg-card:      #111827;
  --bg-card-hover:#16213a;
  --bg-input:     #0f172a;

  --gold:         #C89B3C;
  --gold-light:   #f0d060;
  --gold-dim:     rgba(200, 155, 60, 0.25);
  --gold-border:  rgba(200, 155, 60, 0.4);

  --text-bright:  #F0E6D3;
  --text-main:    #c8bfa8;
  --text-dim:     #6b7280;

  --blue:         #0BC4E3;
  --blue-dim:     rgba(11, 196, 227, 0.15);
  --green:        #22c55e;
  --red:          #ef4444;
  --purple:       #a855f7;

  --radius:       10px;
  --radius-lg:    16px;
  --transition:   0.2s ease;

  --shadow-card:  0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold:  0 0 20px rgba(200,155,60,0.3);
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(200,155,60,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(11,196,227,0.04) 0%, transparent 60%);
}

h1, h2, h3 {
  font-family: 'Cinzel', serif;
  color: var(--text-bright);
  letter-spacing: 0.03em;
}

/* ── Site Header ─────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--gold-border);
  background: linear-gradient(180deg, rgba(200,155,60,0.06) 0%, transparent 100%);
  padding: 1.2rem 2rem;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-text {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.logo-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: auto;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Site Nav ─────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-bright);
  background: rgba(255,255,255,0.05);
}

.nav-link.active {
  color: var(--gold);
  background: var(--gold-dim);
}

.nav-link.coming-soon {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ── Hamburger button (hidden on desktop) ─────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile nav ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-header { padding: 1rem 1.25rem; }

  .header-inner { flex-wrap: wrap; align-items: center; gap: 0.5rem; }

  .hamburger { display: flex; }

  .theme-toggle { margin-left: 0; }

  .site-nav {
    display: none;
    order: 99;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--gold-border);
  }
  .site-nav.open { display: flex; }

  .nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}

.soon-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(200,155,60,0.2);
  color: var(--gold);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

/* ── Homepage Hero ────────────────────────────────────────── */
.home-hero {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 4rem 2rem 3.5rem;
  text-align: center;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(200,155,60,0.08) 0%, transparent 65%);
}

.home-hero-inner {
  max-width: 640px;
  margin: 0 auto;
}

.home-hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.home-hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text-bright);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.home-hero-sub {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 auto;
}

/* ── Homepage Game Cards ──────────────────────────────────── */
.home-games-section {
  padding: 3rem 2rem;
}

.home-games-inner {
  max-width: 900px;
  margin: 0 auto;
}

.home-section-label {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
}

.home-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 220px;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Background image layer */
.game-card-icon {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.game-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.4s ease;
}

/* Gradient overlay so text is always readable */
.game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(0,0,0,0.88) 100%
  );
  z-index: 1;
}

.game-card-content {
  position: relative;
  z-index: 2;
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.game-card-lol {
  border-color: var(--gold-border);
  cursor: pointer;
}

.game-card-lol:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

.game-card-lol:hover .game-card-icon img {
  transform: scale(1.05);
}

.game-card-ow {
  border-color: rgba(79, 172, 254, 0.35);
  cursor: pointer;
}

.game-card-ow:hover {
  border-color: #4facfe;
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(79, 172, 254, 0.25);
}

.game-card-ow:hover .game-card-icon img {
  transform: scale(1.05);
}

.ow-role-grid {
  grid-template-columns: repeat(3, minmax(0, 200px));
  justify-content: center;
}

.role-icon-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  /* Make white SVGs (OW) visible on dark bg; LoL icons are coloured so just dim slightly */
  filter: invert(0) brightness(0.85);
  transition: filter var(--transition);
}
.ow-role-grid .role-icon-img {
  filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(5deg);
}
.role-card:hover .role-icon-img,
.role-card.selected .role-icon-img {
  filter: brightness(1.1);
}
.ow-role-grid .role-card:hover .role-icon-img,
.ow-role-grid .role-card.selected .role-icon-img {
  filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(5deg) brightness(1.15);
}
body.light .ow-role-grid .role-icon-img {
  filter: brightness(0);
}
body.light .ow-role-grid .role-card:hover .role-icon-img,
body.light .ow-role-grid .role-card.selected .role-icon-img {
  filter: brightness(0) opacity(0.7);
}

.game-card-coming-soon {
  opacity: 0.5;
  cursor: default;
}

.game-card-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.game-card-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

.game-card-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: 0.2rem;
}

.game-card-cta.disabled {
  color: rgba(255,255,255,0.4);
}

/* ── Homepage How It Works ────────────────────────────────── */
.home-how {
  padding: 3rem 2rem 4rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.home-how-inner {
  max-width: 900px;
  margin: 0 auto;
}

.home-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 0;
}

.home-step {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.home-step-title {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.95rem;
}

.home-step-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* Light mode overrides for nav + homepage */
body.light .nav-link:hover { background: rgba(0,0,0,0.05); }
body.light .nav-link.active { background: var(--gold-dim); }
body.light .game-card { border-color: rgba(0,0,0,0.1); }
body.light .game-card-lol { border-color: var(--gold-border); }
body.light .home-hero { background-image: radial-gradient(ellipse at 50% 0%, rgba(154,111,30,0.08) 0%, transparent 65%); }
body.light .home-how { border-top-color: rgba(0,0,0,0.08); }

/* ── App Container ───────────────────────────────────────── */
.app-container {
  max-width: 860px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar-wrap {
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.step-dot span {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-dark);
  transition: all var(--transition);
}

.step-dot label {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--transition);
}

.step-dot.active span {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 12px rgba(200,155,60,0.4);
}

.step-dot.active label,
.step-dot.done label { color: var(--gold); }

.step-dot.done span {
  border-color: var(--gold);
  color: var(--bg-dark);
  background: var(--gold);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--text-dim);
  opacity: 0.3;
  max-width: 80px;
  margin-bottom: 20px;
}

/* ── Steps (show/hide) ───────────────────────────────────── */
.step {
  display: none;
  animation: fadeSlideIn 0.35s ease;
}

.step.active { display: block; }

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

/* ── Step Header ─────────────────────────────────────────── */
.step-header {
  margin-bottom: 2rem;
  text-align: center;
}

.step-header h2 {
  font-size: 1.8rem;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}

.step-header p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ── Role Grid ───────────────────────────────────────────── */
.role-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .role-grid { grid-template-columns: repeat(3, 1fr); }
}

.role-card {
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 1.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.role-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.role-card.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: var(--shadow-gold);
}

.role-icon { font-size: 2rem; }

.role-name {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.05em;
}

.role-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Tag Grid (Playstyle + Fantasy) ─────────────────────── */
.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.tag-card {
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.tag-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-card-hover);
}

.tag-card.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: 0 0 14px rgba(200,155,60,0.2);
}

.tag-card-nopref {
  border-style: dashed;
  opacity: 0.6;
}
.tag-card-nopref:hover { opacity: 1; }
.tag-card-nopref.selected { opacity: 1; }

.tag-icon { font-size: 1.5rem; }

.tag-name {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.9rem;
}

.tag-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── Form Group (Radio lists) ────────────────────────────── */
.form-group { }

.form-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
}

.radio-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-card-hover);
}

.radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.radio-card:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.radio-inner { display: flex; flex-direction: column; gap: 0.15rem; }

.radio-title {
  font-weight: 600;
  color: var(--text-bright);
  font-size: 0.9rem;
}

.radio-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ── Goal Grid ───────────────────────────────────────────── */
.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.goal-card {
  background: var(--bg-card);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  padding: 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.goal-card:hover {
  border-color: var(--gold-border);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.goal-card.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
  box-shadow: var(--shadow-gold);
}

.goal-icon { font-size: 2.2rem; }

.goal-title {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: var(--text-bright);
  font-weight: 600;
}

.goal-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Navigation Buttons ──────────────────────────────────── */
.step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.btn {
  padding: 0.65rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 700;
}

.btn-primary:hover { background: var(--gold-light); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #e8b84b 100%);
  color: var(--bg-deep);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.8rem 2rem;
  box-shadow: 0 4px 20px rgba(200,155,60,0.4);
}

.btn-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(200,155,60,0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255,255,255,0.1);
}

.btn-ghost:hover {
  border-color: var(--gold-border);
  color: var(--text-bright);
}

/* ── Loading ─────────────────────────────────────────────── */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 6rem 2rem;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 4px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-text {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Results ─────────────────────────────────────────────── */
.results-header {
  text-align: center;
  margin-bottom: 2rem;
}

.results-header h2 { font-size: 1.8rem; }

.results-header p {
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* Champion Card */
.champion-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition);
}

.champion-card:hover { transform: translateY(-2px); }

.champion-card.rank-1 { border-color: var(--gold); box-shadow: 0 0 30px rgba(200,155,60,0.25); }
.champion-card.rank-2 { border-color: rgba(192,192,192,0.4); }
.champion-card.rank-3 { border-color: rgba(205,127,50,0.4); }

/* Card top strip */
.card-rank-strip {
  padding: 0.5rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.rank-1 .card-rank-strip { background: linear-gradient(90deg, rgba(200,155,60,0.25), transparent); color: var(--gold); }
.rank-2 .card-rank-strip { background: linear-gradient(90deg, rgba(180,180,180,0.1), transparent); color: #c0c0c0; }
.rank-3 .card-rank-strip { background: linear-gradient(90deg, rgba(180,100,30,0.15), transparent); color: #cd7f32; }

/* Card body */
.card-body {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0;
}

@media (max-width: 560px) {
  .card-body { grid-template-columns: 1fr; }
}

.card-portrait {
  position: relative;
  background: var(--bg-deep);
  align-self: start;
  overflow: hidden;
}

.card-portrait img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}

.card-portrait-fallback {
  width: 96px;
  height: 96px;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.card-info {
  padding: 1rem 1.4rem;
}

.card-name {
  font-family: 'Cinzel', serif;
  font-size: 1.3rem;
  color: var(--text-bright);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.tag-pill {
  background: var(--bg-input);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 99px;
  padding: 0.15rem 0.7rem;
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.tag-pill.gold { border-color: var(--gold-border); color: var(--gold); background: var(--gold-dim); }
.tag-pill.blue   { border-color: rgba(11,196,227,0.3); color: var(--blue); background: var(--blue-dim); }
.tag-pill.purple { border-color: rgba(160,100,240,0.35); color: #c084fc; background: rgba(160,100,240,0.12); }

/* Score bar */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.score-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 0.8s ease;
}

.score-label {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 600;
  white-space: nowrap;
}

/* Card sections */
.card-section {
  padding: 1rem 1.4rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.card-section-title {
  font-size: 0.7rem;
  font-family: 'Cinzel', serif;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-section-body {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.65;
}

/* Difficulty badge */
.diff-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diff-easy   { background: rgba(34,197,94,0.15);  color: var(--green); border: 1px solid rgba(34,197,94,0.3); }
.diff-medium { background: rgba(234,179,8,0.15);  color: #eab308;      border: 1px solid rgba(234,179,8,0.3); }
.diff-hard   { background: rgba(239,68,68,0.15);  color: var(--red);   border: 1px solid rgba(239,68,68,0.3); }

/* Results Actions */
.results-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ── Mode Toggle (Quiz / Find Similar) ───────────────────── */
.mode-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.mode-toggle-inner {
  display: flex;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 99px;
  padding: 4px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 1.25rem;
  border-radius: 99px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.84rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

@media (max-width: 500px) {
  .mode-toggle-inner { border-radius: 12px; flex-wrap: wrap; justify-content: center; }
  .mode-btn { font-size: 0.78rem; padding: 0.4rem 0.9rem; }
}

.mode-btn.active {
  background: var(--gold);
  color: #1a1208;
  font-weight: 600;
}

/* ── Why Not X — Explain Section ────────────────────────── */
.explain-wrap {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.explain-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--text-bright);
  margin-bottom: 0.35rem;
}

.explain-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 1.1rem;
}

.explain-card {
  margin-top: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.explain-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.explain-portrait {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.explain-header-info {
  flex: 1;
}

.explain-header-name {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--text-bright);
  margin-bottom: 0.2rem;
}

.explain-header-score {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.explain-header-score strong {
  color: var(--gold);
}

.explain-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.explain-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

.explain-row .explain-icon {
  flex-shrink: 0;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.explain-row.matched { color: var(--text); }
.explain-row.missed  { color: var(--text-dim); }

/* ── Find Similar Section ────────────────────────────────── */
.similar-section {
  display: none;
}

.similar-search-wrap {
  text-align: center;
  margin-bottom: 2.5rem;
}

.similar-search-wrap h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}

.similar-search-wrap p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-bottom: 1.4rem;
}

.search-input-wrap {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.2rem;
  color: var(--text-bright);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--transition);
}

.search-input:focus {
  border-color: var(--gold-border);
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  list-style: none;
  margin: 0;
  padding: 4px;
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
}

.search-dropdown-item {
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background var(--transition);
}

.search-dropdown-item:hover,
.search-dropdown-item.focused {
  background: var(--bg-card-hover);
  color: var(--text-bright);
}

.search-dropdown-item img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Similar results header (shows target champion/hero) */
.similar-target-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  margin-bottom: 2rem;
  box-shadow: 0 0 24px rgba(200,155,60,0.12);
}

.similar-target-portrait {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.similar-target-info h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.similar-target-info p {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 2rem;
}

/* ── Theme Toggle Button ─────────────────────────────────── */
.theme-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
}

/* ── Light Mode ──────────────────────────────────────────── */
/* Applied by adding class="light" to <body> via JS toggle.  */
body.light {
  --bg-deep:      #f0ece4;
  --bg-dark:      #e8e2d8;
  --bg-card:      #ffffff;
  --bg-card-hover:#fdf6e8;
  --bg-input:     #ede8de;

  --gold:         #9a6f1e;
  --gold-light:   #c49030;
  --gold-dim:     rgba(154, 111, 30, 0.12);
  --gold-border:  rgba(154, 111, 30, 0.35);

  --text-bright:  #1a1108;
  --text-main:    #3d3018;
  --text-dim:     #7a6a50;

  --blue:         #0080a0;
  --blue-dim:     rgba(0, 128, 160, 0.1);
  --green:        #1a7a3a;
  --red:          #c0392b;
  --purple:       #7b2fbe;

  --shadow-card:  0 2px 16px rgba(0,0,0,0.1);
  --shadow-gold:  0 0 16px rgba(154,111,30,0.2);
}

body.light {
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(154,111,30,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0,128,160,0.04) 0%, transparent 60%);
}

body.light .site-header {
  background: linear-gradient(180deg, rgba(154,111,30,0.08) 0%, transparent 100%);
}

body.light .site-footer {
  border-top-color: rgba(0,0,0,0.08);
}

body.light .step-nav {
  border-top-color: rgba(0,0,0,0.08);
}

body.light .card-section {
  border-top-color: rgba(0,0,0,0.07);
}

body.light .role-card,
body.light .tag-card,
body.light .goal-card,
body.light .radio-card {
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

body.light .champion-card {
  border-color: rgba(0,0,0,0.1);
}

body.light .champion-card.rank-1 {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(154,111,30,0.18);
}

body.light .champion-card.rank-2 { border-color: rgba(120,120,120,0.4); }
body.light .champion-card.rank-3 { border-color: rgba(160,90,20,0.35); }

body.light .rank-1 .card-rank-strip { background: linear-gradient(90deg, rgba(154,111,30,0.15), transparent); }
body.light .rank-2 .card-rank-strip { background: linear-gradient(90deg, rgba(120,120,120,0.08), transparent); color: #808080; }
body.light .rank-3 .card-rank-strip { background: linear-gradient(90deg, rgba(160,90,20,0.1), transparent); color: #a05a14; }

body.light .btn-ghost {
  border-color: rgba(0,0,0,0.15);
  color: var(--text-dim);
}

body.light .btn-ghost:hover {
  border-color: var(--gold);
  color: var(--text-bright);
}

body.light .step-dot span {
  background: var(--bg-dark);
}

body.light .diff-easy   { background: rgba(26,122,58,0.1);  border-color: rgba(26,122,58,0.25); }
body.light .diff-medium { background: rgba(180,120,0,0.1);  color: #8a6000; border-color: rgba(180,120,0,0.25); }
body.light .diff-hard   { background: rgba(192,57,43,0.1);  border-color: rgba(192,57,43,0.25); }

body.light .tag-pill {
  background: var(--bg-input);
  border-color: rgba(0,0,0,0.1);
  color: var(--text-dim);
}

body.light .score-bar-track { background: rgba(0,0,0,0.08); }

body.light .card-portrait { background: var(--bg-input); }

/* ══════════════════════════════════════════════════════════
   RANDOMIZER
   ══════════════════════════════════════════════════════════ */

.randomizer-section {
  display: none;
  padding: 0 0 3rem;
}

.rand-inner {
  max-width: 540px;
  margin: 0 auto;
  text-align: center;
}

.rand-header {
  margin-bottom: 2rem;
}

.rand-header h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 0.4rem;
}

.rand-header p {
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

/* ── Role Picker ─────────────────────────────────────────── */
.rand-role-picker {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.rand-role-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim);
  padding: 0.45rem 1.1rem;
  border-radius: 99px;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.rand-role-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.rand-role-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1208;
  font-weight: 600;
}

body.light .rand-role-btn {
  background: var(--bg-input);
  border-color: rgba(0,0,0,0.12);
  color: var(--text-dim);
}

body.light .rand-role-btn.active {
  background: var(--gold);
  color: #1a1208;
}

/* ── Wheel ───────────────────────────────────────────────── */
.rand-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Canvas + spin button stacked in the same space */
.rand-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
}

.rand-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
  filter: drop-shadow(0 0 32px rgba(200,151,58,0.18)) drop-shadow(0 8px 24px rgba(0,0,0,0.55));
}

/* ── Spin button — centred over the hub ─────────────────── */
/* Width is overridden dynamically by JS (computeLayout) — this is just the empty-state fallback */
.rand-spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 220, 100, 0.55);
  background: var(--gold);
  color: #1a1208;
  font-family: 'Cinzel', serif;
  font-size: clamp(0.7rem, 2.5vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(200,151,58,0.55), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  z-index: 2;
  line-height: 1;
  padding: 0;
}

.rand-spin-btn:not(:disabled):hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 28px rgba(200,151,58,0.75), inset 0 1px 0 rgba(255,255,255,0.25);
}

.rand-spin-btn:not(:disabled):active {
  transform: translate(-50%, -50%) scale(0.95);
}

.rand-spin-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

/* ── Modal overlay ───────────────────────────────────────── */
.rand-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
  animation: rand-fade-in 0.22s ease forwards;
}

.rand-modal-overlay.rand-modal-closing {
  animation: rand-fade-out 0.24s ease forwards;
}

.rand-modal-dialog {
  background: var(--bg-card);
  border: 1px solid rgba(200, 151, 58, 0.35);
  border-radius: 1.1rem;
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(200,151,58,0.12);
  animation: rand-slide-up 0.28s ease forwards;
  text-align: center;
}

.rand-modal-closing .rand-modal-dialog {
  animation: rand-slide-down 0.22s ease forwards;
}

.rand-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.9rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 0.35rem;
  transition: color 0.15s, background 0.15s;
}

.rand-modal-close:hover {
  color: var(--text-main);
  background: rgba(200, 151, 58, 0.12);
}

@keyframes rand-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes rand-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes rand-slide-up {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
@keyframes rand-slide-down {
  from { opacity: 1; transform: translateY(0)    scale(1);    }
  to   { opacity: 0; transform: translateY(20px) scale(0.97); }
}

/* ── Reveal content (inside modal) ──────────────────────── */
.rand-reveal-eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  margin-bottom: 0.9rem;
}

.rand-reveal-splash-wrap {
  position: relative;
  border-radius: 0.85rem;
  overflow: hidden;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 2px rgba(200,151,58,0.35);
}

/* League splash arts are wide (16:9) */
.rand-reveal-splash-wrap--wide {
  aspect-ratio: 16 / 9;
}

/* OW portraits are square-ish */
.rand-reveal-splash-wrap--square {
  aspect-ratio: 1 / 1;
  max-width: 340px;
}

.rand-reveal-splash {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.rand-reveal-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.25rem 1.1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
}

.rand-reveal-name {
  font-family: 'Cinzel', serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

.rand-role {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(0,0,0,0.45);
  padding: 0.15rem 0.55rem;
  border-radius: 0.25rem;
  border: 1px solid rgba(200,151,58,0.4);
}

.rand-reveal-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Light mode overrides ────────────────────────────────── */
body.light #rand-wheel-canvas {
  filter: drop-shadow(0 0 20px rgba(180,130,20,0.22)) drop-shadow(0 6px 18px rgba(0,0,0,0.25));
}

body.light .rand-modal-overlay {
  background: rgba(0, 0, 0, 0.55);
}

body.light .rand-modal-dialog {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(200,151,58,0.2);
}
