:root {
  --bg: #0C0C10;
  --surface: #14141A;
  --surface2: #1C1C24;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.14);
  --text: #F0EDE6;
  --text-dim: rgba(240,237,230,0.55);
  --text-muted: rgba(240,237,230,0.3);
  --accent: #F5A623;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow-y: auto; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.025; pointer-events: none; z-index: 9999;
}
.glow-top {
  position: fixed; top: -200px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 400px;
  background: radial-gradient(ellipse, rgba(245,166,35,0.07) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}

/* ── Mobile-first single-column layout ── */
.app-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh; padding: 0 0 60px;
}
.screen {
  width: 100%; max-width: 460px;
  padding: 0 20px 40px;
}

/* ── Lang switcher ── */
.lang-row {
  display: flex; justify-content: flex-end; padding: 16px 0 0;
}
.lang-switcher {
  display: flex; background: rgba(255,255,255,0.07); border-radius: 100px;
  padding: 3px; gap: 2px;
}
.lang-btn {
  padding: 5px 13px; border-radius: 100px; border: none;
  background: transparent; color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; line-height: 1;
}
.lang-btn:hover { color: var(--text-dim); }
.lang-btn.active { background: var(--surface2); color: var(--text); }

/* ── Header ── */
.hdr { text-align: center; padding: 20px 0 4px; }
.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.22em; color: var(--text-dim);
}
.tagline {
  margin-top: 10px; font-size: 14px; color: var(--text-muted);
  font-weight: 300; letter-spacing: 0.04em;
  max-width: 420px; margin-inline: auto; line-height: 1.6;
}

/* ── Form ── */
.form-section { margin-top: 26px; }
.section-label {
  font-size: 11px; letter-spacing: 0.12em; color: var(--text-muted);
  text-transform: uppercase; text-align: center; margin-bottom: 14px;
  font-weight: 500;
}

.age-row {
  display: flex; align-items: center; justify-content: center; gap: 28px;
}
.age-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border2); background: var(--surface);
  color: var(--text-dim); font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s; flex-shrink: 0;
  font-family: inherit;
}
.age-btn:hover { background: var(--surface2); color: var(--text); }
.age-btn:active { transform: scale(0.93); }
.age-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 88px; line-height: 1;
  color: var(--accent);
  cursor: pointer; min-width: 3ch; text-align: center; user-select: none;
  text-shadow: 0 0 80px color-mix(in srgb, var(--accent) 13%, transparent);
}
.age-num:hover { opacity: 0.85; }
.age-input {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 88px; line-height: 1;
  background: transparent; border: none;
  border-bottom: 3px solid var(--accent);
  outline: none; color: var(--accent); text-align: center; width: 4ch;
  -moz-appearance: textfield;
}
.age-input::-webkit-outer-spin-button,
.age-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.age-hint {
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
  letter-spacing: 0.06em; text-align: center;
}

/* ── Pills (gender + content type) ── */
.pill-row {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.pill-btn {
  padding: 8px 20px; border-radius: 100px;
  border: 1px solid var(--border2); background: transparent;
  color: var(--text-dim); font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; letter-spacing: 0.02em;
}
.pill-btn:hover { color: var(--text); }
.pill-active-white {
  background: var(--text); color: var(--bg); border-color: var(--text);
}
.pill-active-accent {
  border-color: var(--accent); color: var(--text);
}

/* ── Mode bar (Random / Show all) ── */
.mode-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.mode-btn {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px; padding: 18px 14px;
  color: var(--text-dim); font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; letter-spacing: 0.02em;
}
.mode-btn:hover { background: var(--surface2); color: var(--text); }
.mode-btn.active {
  background: var(--surface2); border-color: var(--accent);
  color: var(--text); box-shadow: 0 0 0 1px var(--accent) inset;
}
.mode-btn-icon { font-size: 24px; line-height: 1; }
.mode-btn-sub {
  font-size: 11px; color: var(--text-muted); font-weight: 300;
  letter-spacing: 0.04em;
}

/* ── CTA ── */
.cta-btn {
  display: block; width: 100%; margin-top: 28px;
  padding: 18px; border-radius: 100px; border: none;
  font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
  color: #111; background: var(--accent);
  letter-spacing: 0.02em;
}
.cta-btn:hover { opacity: 0.88; }
.cta-btn:active { transform: scale(0.99); }
.cta-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.form-status { font-size: 12px; color: var(--text-muted); letter-spacing: 0.06em; text-align: center; margin-top: 12px; }
.form-status.error { color: #f87171; }

/* ── Results nav ── */
.results-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; margin-bottom: 14px;
}
.back-btn {
  background: none; border: none; color: var(--text-dim);
  font-family: 'Outfit', sans-serif; font-size: 14px; cursor: pointer;
  padding: 0; transition: color 0.15s, transform 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.back-btn:hover { color: var(--text); transform: translateX(-2px); }
.results-count-pill {
  font-size: 11px; letter-spacing: 0.1em; color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Age summary banner ── */
.age-summary {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 16px; padding: 18px 18px 14px; margin-bottom: 12px;
  animation: fadeUp 0.3s ease;
}
.summary-text {
  font-size: 14px; line-height: 1.65; color: var(--text-dim);
  font-weight: 300; margin-bottom: 0;
}
.summary-genres {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.genre-tag {
  font-size: 12px; font-weight: 400; color: var(--text-muted);
  border: 1px solid var(--border2); border-radius: 100px;
  padding: 4px 12px; letter-spacing: 0.03em;
}
.summary-skeleton {
  height: 13px; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  margin-bottom: 8px;
}
.summary-skeleton.short { width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Shuffle header ── */
.shuffle-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.shuffle-label {
  font-size: 12px; letter-spacing: 0.09em; color: var(--text-muted);
  text-transform: uppercase;
}
.shuffle-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text-dim); font-family: 'Outfit', sans-serif;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s;
}
.shuffle-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.22); }
.shuffle-btn-icon { font-size: 14px; line-height: 1; }

/* ── Hero card (single match in result list) ── */
.hero-card {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 16px; padding: 18px;
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 12px;
  animation: fadeUp 0.3s ease;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 14px 32px rgba(0,0,0,0.35);
}
.hero-card-avatar {
  width: 60px; height: 60px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-card-avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block;
}
.hero-card-info { flex: 1; min-width: 0; }
.hero-card-top {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.hero-name { font-size: 16px; font-weight: 700; color: var(--text); }
.type-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  padding: 3px 8px; border-radius: 6px; color: #fff;
  text-transform: uppercase;
}
.hero-meta {
  font-size: 13px; color: var(--text-dim); margin-bottom: 6px;
  word-break: break-word;
}
.hero-year { color: var(--text-muted); margin-left: 6px; }
.hero-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.6;
  font-weight: 300;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ── Slot card (random reveal) ── */
.slot-wrap { display: flex; justify-content: center; padding: 4px 0 0; }
.slot-card {
  width: 100%;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 16px; overflow: hidden;
  animation: fadeUp 0.3s ease both;
  transition: transform 0.18s ease, border-color 0.18s, box-shadow 0.18s;
  cursor: pointer; will-change: transform;
}
.slot-card.rolling { animation: slotPulse 0.55s ease-in-out infinite alternate; cursor: default; }
.slot-card.rolling .slot-card-poster img,
.slot-card.rolling .slot-card-poster-fallback { animation: slotBlur 0.18s ease both; }
.slot-card:not(.rolling):hover {
  transform: translateY(-3px);
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 22px 48px rgba(0,0,0,0.45);
}
@keyframes slotPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); transform: scale(1); }
  100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); transform: scale(1.012); }
}
@keyframes slotBlur {
  0% { filter: blur(6px); opacity: 0.5; transform: translateY(8px); }
  100% { filter: blur(0); opacity: 1; transform: translateY(0); }
}
.slot-card-poster {
  position: relative; width: 100%; height: 240px;
  overflow: hidden; background: var(--surface2);
}
.slot-card-poster img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block; transition: transform 0.4s ease;
}
.slot-card-poster-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 86px;
}
.slot-card-poster-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(20,20,26,0.95) 100%);
  pointer-events: none;
}
.slot-card-poster-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 6px;
  color: #fff; backdrop-filter: blur(4px);
}
.slot-card-body { padding: 18px 20px 20px; }
.slot-card-name { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.25; margin-bottom: 4px; }
.slot-card-show { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.slot-card-year { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.slot-card-context {
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
  font-weight: 300; border-top: 1px solid var(--border); padding-top: 12px;
}

.slot-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.slot-actions .cta-btn { margin-top: 0; padding: 14px 28px; font-size: 14px; width: auto; }
.secondary-btn {
  padding: 14px 24px; border-radius: 100px;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--border2);
  font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em; cursor: pointer;
  transition: all 0.15s;
}
.secondary-btn:hover { border-color: var(--text-dim); color: var(--text); background: var(--surface); }

/* ── Adjacent sections (older / soon to be) ── */
.adjacent-section { margin-top: 18px; animation: fadeUp 0.3s ease; }
.adjacent-header {
  display: flex; align-items: baseline; gap: 8px; padding: 0 2px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.adjacent-title { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.adjacent-age-range {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); padding: 2px 7px; border-radius: 100px;
  background: var(--surface2); border: 1px solid var(--border);
}
.adjacent-empty {
  font-size: 12px; color: var(--text-muted); font-weight: 300;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.adjacent-list { display: flex; flex-direction: column; gap: 6px; }

.adj-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s;
  animation: fadeUp 0.3s ease both;
}
.adj-row:hover {
  background: var(--surface2);
  border-color: var(--border2);
  transform: translateY(-1px);
}
.adj-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface2);
}
.adj-avatar img {
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  display: block;
}
.adj-name {
  font-size: 13px; font-weight: 600; color: var(--text); flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.adj-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.adj-source {
  font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 110px;
}
.adj-age-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 4px;
  background: var(--surface2); color: var(--text-muted);
  white-space: nowrap;
}

/* ── Empty / loading / error placeholders ── */
.empty {
  text-align: center; padding: 60px 20px 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; margin-top: 12px;
}
.empty-num {
  font-family: 'Bebas Neue', sans-serif; font-size: 90px;
  color: var(--border2); line-height: 1; display: block; margin-bottom: 16px;
}
.empty-text { font-size: 16px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--text-muted); font-weight: 300; }

/* ── Modal (character details) ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.78); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from {opacity:0} to {opacity:1} }
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 20px; overflow: hidden;
  width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.25s ease; position: relative;
}
@keyframes slideUp { from {transform:translateY(24px);opacity:0} to {transform:none;opacity:1} }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
  color: #fff; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; font-family: inherit;
}
.modal-close:hover { background: rgba(0,0,0,0.7); }
.modal-poster { position: relative; height: 260px; overflow: hidden; flex-shrink: 0; }
.modal-poster img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.modal-poster-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}
.modal-poster-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 20%, rgba(12,12,16,0.96) 100%);
  pointer-events: none;
}
.modal-poster-info {
  position: absolute; bottom: 18px; left: 20px; right: 20px;
}
.modal-poster-age-row {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px;
}
.modal-age {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 60px; line-height: 1; color: #fff;
}
.modal-age-label { font-size: 14px; color: rgba(255,255,255,0.55); font-weight: 300; }
.modal-poster-name {
  font-size: 22px; font-weight: 700; color: #fff; line-height: 1.2;
  margin-bottom: 4px;
}
.modal-poster-show {
  font-size: 13px; color: rgba(255,255,255,0.55); font-weight: 400;
}
.modal-body { padding: 20px 24px 28px; }
.modal-quote {
  font-size: 13px; color: var(--text-muted); line-height: 1.7;
  font-style: italic; border-left: 2px solid var(--border2);
  padding-left: 12px; margin-bottom: 18px;
}
.modal-tagline {
  font-size: 15px; line-height: 1.65; color: var(--text-dim);
  background: var(--surface2); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; font-weight: 300;
}
.modal-tagline strong { color: var(--text); font-weight: 600; }
.modal-tagline-show { color: var(--accent); font-style: normal; font-weight: 600; }

/* ── Share CTA button + dropdown ── */
.share-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px; border-radius: 100px; border: none;
  font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s, transform 0.1s;
  color: #111; background: var(--accent);
  letter-spacing: 0.02em;
}
.share-cta-btn:hover { opacity: 0.88; }
.share-cta-btn:active { transform: scale(0.99); }
.share-cta-icon { font-size: 18px; line-height: 1; }
.share-dropdown {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 14px; overflow: hidden;
  margin-top: 8px; animation: fadeUp 0.18s ease;
}
.share-option {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 15px 18px;
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text-dim); font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.15s, color 0.15s; text-align: left;
}
.share-option:last-child { border-bottom: none; }
.share-option:hover { background: var(--border); color: var(--text); }
.share-option-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; font-style: normal; color: #fff;
}
.share-icon-x { background: #000; border: 1px solid #333; font-family: serif; }
.share-icon-wa { background: #25D366; }
.share-icon-fb { background: #1877F2; font-family: 'Outfit', sans-serif; font-size: 18px; }

/* ── Responsive tweaks ── */
@media (max-width: 420px) {
  .screen { padding: 0 16px 36px; }
  .age-num, .age-input { font-size: 78px; }
  .pill-btn { padding: 7px 16px; font-size: 13px; }
  .mode-bar { gap: 10px; }
  .mode-btn { padding: 16px 12px; }
  .slot-card-poster { height: 200px; }
  .slot-card-name { font-size: 19px; }
  .hero-name { font-size: 15px; }
  .hero-meta, .hero-desc { font-size: 12.5px; }
  .adj-source { max-width: 90px; }
}
