:root {
  --night: #070b1d;
  --night-2: #0d1330;
  --card: rgba(17, 24, 52, .9);
  --card-solid: #121a3a;
  --line: rgba(184, 161, 255, .22);
  --text: #f4f1ff;
  --muted: #aeb6dc;
  --gold: #ffd166;
  --pink: #ff8fab;
  --mint: #7ae7c7;
  --violet: #b8a1ff;
  --blue: #8ecbff;
  --radius: 28px;
  --shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea {
  font: inherit;
  color: inherit;
}

button, a { -webkit-tap-highlight-color: transparent; }

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% -10%, #26306b 0%, transparent 60%),
    radial-gradient(90% 70% at 90% 20%, rgba(184, 161, 255, .22), transparent 55%),
    radial-gradient(80% 60% at 10% 85%, rgba(122, 231, 199, .12), transparent 60%),
    linear-gradient(180deg, #070b1d 0%, #0b1230 55%, #0a0f26 100%);
}

.stars {
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255, 255, 255, .95), transparent 60%),
    radial-gradient(1.2px 1.2px at 120px 90px, rgba(255, 255, 255, .7), transparent 60%),
    radial-gradient(1.8px 1.8px at 200px 40px, rgba(255, 241, 194, .9), transparent 60%),
    radial-gradient(1.1px 1.1px at 60px 160px, rgba(255, 255, 255, .6), transparent 60%),
    radial-gradient(1.4px 1.4px at 260px 210px, rgba(184, 161, 255, .8), transparent 60%);
  background-size: 300px 300px;
  opacity: .7;
  animation: starDrift 80s linear infinite;
}

.stars-2 {
  background-size: 520px 520px;
  opacity: .45;
  animation-duration: 120s;
  animation-direction: reverse;
}

@keyframes starDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-300px, 120px, 0); }
}

.moon {
  position: absolute;
  top: 8%;
  right: 9%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff9dc, #ffe29a 55%, #e6b85e);
  box-shadow: 0 0 40px rgba(255, 224, 138, .55), 0 0 120px rgba(255, 209, 102, .25);
  animation: moonFloat 9s ease-in-out infinite;
}

@keyframes moonFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.cloud {
  position: absolute;
  height: 90px;
  border-radius: 999px;
  background: radial-gradient(ellipse at 50% 60%, rgba(184, 161, 255, .2), transparent 70%);
  filter: blur(10px);
  opacity: .7;
  animation: cloudFloat 24s ease-in-out infinite;
}

.cloud-1 { width: 320px; top: 24%; left: -80px; }
.cloud-2 { width: 420px; top: 48%; right: -140px; animation-delay: -8s; }
.cloud-3 { width: 240px; top: 70%; left: 12%; animation-delay: -15s; }

@keyframes cloudFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -14px) scale(1.05); }
}

.sparkle {
  position: absolute;
  color: var(--gold);
  font-size: 18px;
  opacity: .8;
  animation: twinkle 3.6s ease-in-out infinite;
}

.sp-1 { top: 18%; left: 14%; animation-delay: -1s; }
.sp-2 { top: 32%; right: 18%; color: var(--pink); animation-delay: -2.2s; }
.sp-3 { top: 64%; left: 22%; color: var(--mint); animation-delay: -.6s; }
.sp-4 { top: 76%; right: 12%; animation-delay: -2.8s; }

@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}

.app {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 26px 20px 60px;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.brand {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .3px;
}

.brand-star {
  color: var(--gold);
  margin-right: 6px;
  text-shadow: 0 0 18px rgba(255, 209, 102, .8);
}

.top-note {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth {
  width: min(440px, 100%);
  margin: auto;
  padding: 30px 32px 34px;
  text-align: center;
}

.auth-art {
  display: grid;
  place-items: center;
  height: 120px;
  margin-bottom: 6px;
}

.book {
  position: relative;
  width: 130px;
  height: 86px;
  animation: bookFloat 4.5s ease-in-out infinite;
}

.book-page {
  position: absolute;
  top: 8px;
  width: 62px;
  height: 70px;
  background: linear-gradient(160deg, #fff8e7, #ffe7b5);
  border-radius: 6px 14px 14px 6px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, .25);
}

.book-page.left { left: 2px; transform: skewY(6deg); border-radius: 14px 6px 6px 14px; }
.book-page.right { right: 2px; transform: skewY(-6deg); }

.book-spine {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 4px;
  height: 74px;
  margin-left: -2px;
  background: #8a5a2b;
  border-radius: 4px;
}

.book-star {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a96b1f;
  font-size: 26px;
  animation: twinkle 2.6s ease-in-out infinite;
}

@keyframes bookFloat {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

h1, h2, h3 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.15;
  margin: 0;
}

.auth h1 {
  font-size: 28px;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 15px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field input,
.input-wrap input,
.input-wrap textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input:focus,
.input-wrap input:focus,
.input-wrap textarea:focus {
  border-color: rgba(184, 161, 255, .75);
  box-shadow: 0 0 0 4px rgba(184, 161, 255, .14);
  background: rgba(255, 255, 255, .09);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform .16s, box-shadow .2s, background .2s, opacity .2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #ffb35c);
  color: #2a1900;
  box-shadow: 0 14px 34px rgba(255, 209, 102, .28);
}

.btn-primary:hover {
  box-shadow: 0 18px 40px rgba(255, 209, 102, .4);
  transform: translateY(-1px);
}

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

.btn-ghost:hover { background: rgba(255, 255, 255, .1); }

.btn[disabled] { opacity: .5; cursor: default; }

.error {
  min-height: 18px;
  margin: 0;
  color: #ff9aa8;
  font-size: 13px;
}

.wizard {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: auto 0;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  transition: width .3s, background .3s;
}

.dot.active {
  width: 26px;
  background: var(--gold);
  box-shadow: 0 0 14px rgba(255, 209, 102, .7);
}

.question-card {
  padding: 30px 32px;
  animation: cardIn .35s ease both;
}

@keyframes cardIn {
  from { transform: translateY(12px) scale(.99); }
  to { transform: translateY(0) scale(1); }
}

.step-label {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.question-card h1 {
  font-size: clamp(24px, 5vw, 34px);
  margin-bottom: 10px;
}

.hint {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}

.input-wrap input,
.input-wrap textarea {
  font-size: 18px;
  padding: 16px 18px;
}

.input-wrap textarea {
  min-height: 110px;
  resize: vertical;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.actions .btn { flex: 1; }

.small-note {
  text-align: center;
  color: rgba(174, 182, 220, .75);
  font-size: 12px;
  margin: 0;
}

.progress-screen {
  margin: auto 0;
  text-align: center;
  padding: 10px 0;
}

.magic {
  position: relative;
  width: 190px;
  height: 190px;
  margin: 0 auto 22px;
}

.magic-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  margin: -42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7d6, #ffd166 55%, #ff9f43);
  color: #6b3b00;
  font-size: 34px;
  box-shadow: 0 0 50px rgba(255, 209, 102, .6), 0 0 120px rgba(255, 143, 171, .25);
  animation: corePulse 2.4s ease-in-out infinite;
}

@keyframes corePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.orbit {
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(184, 161, 255, .4);
  border-radius: 50%;
  animation: spin 9s linear infinite;
}

.orbit-2 {
  inset: 32px;
  border-color: rgba(122, 231, 199, .35);
  animation-duration: 6s;
  animation-direction: reverse;
}

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

.float-item {
  position: absolute;
  font-size: 22px;
  animation: floaty 3.4s ease-in-out infinite;
}

.fi-1 { top: 0; left: 12%; }
.fi-2 { top: 8%; right: 8%; animation-delay: -1s; }
.fi-3 { bottom: 12%; left: 6%; animation-delay: -2s; }
.fi-4 { bottom: 0; right: 16%; animation-delay: -.5s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-12px) rotate(8deg); }
}

.progress-screen h1 {
  font-size: clamp(26px, 6vw, 38px);
  margin-bottom: 10px;
}

.progress-line {
  min-height: 24px;
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 17px;
  font-weight: 600;
}

.stage-line {
  min-height: 20px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.progress-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--blue), var(--violet), var(--pink), var(--gold));
  background-size: 300% 100%;
  animation: shimmer 2.6s linear infinite;
  transition: width .6s ease;
}

@keyframes shimmer {
  to { background-position: -300% 0; }
}

.progress-spark {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 15px;
  text-shadow: 0 0 12px #fff;
  transition: left .6s ease;
}

.percent {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .08em;
}

.result {
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: cardIn .4s ease both;
}

.result-head { text-align: center; }

.result-head h1 {
  font-size: clamp(28px, 6vw, 42px);
  margin: 4px 0 8px;
  background: linear-gradient(120deg, #fff, var(--gold) 45%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.player {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
}

.play-btn {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #ff9f43);
  color: #2a1900;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(255, 209, 102, .35);
  transition: transform .16s;
}

.play-btn:hover { transform: scale(1.04); }
.play-btn svg { width: 26px; height: 26px; fill: currentColor; }
.play-btn .icon-pause { display: none; }
.player.playing .icon-play { display: none; }
.player.playing .icon-pause { display: block; }

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

.player-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.player-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-time { color: var(--muted); flex: 0 0 auto; }

.seek {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  cursor: pointer;
  touch-action: none;
}

.seek-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold));
}

.seek-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, .8);
}

.result-actions {
  display: flex;
  gap: 12px;
}

.result-actions .btn { flex: 1; }

.expiry {
  margin: -4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.story {
  padding: 26px 30px 30px;
  font-size: 17px;
  line-height: 1.75;
}

.story p { margin: 0 0 14px; }
.story p:last-child { margin-bottom: 0; }

.story .narrator { color: #dfe4ff; }

.story .line {
  padding-left: 2px;
}

.story .who {
  color: var(--gold);
  font-weight: 700;
}

.story .speech { color: #fff; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(90vw, 460px);
  margin: 0;
  padding: 12px 18px;
  background: rgba(20, 26, 54, .95);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: 14px;
  z-index: 20;
}

@media (max-width: 640px) {
  .app { padding: 18px 14px 40px; }
  .top { margin-bottom: 22px; }
  .top-note { display: none; }
  .auth { padding: 24px 20px 26px; }
  .question-card { padding: 24px 20px; }
  .player { padding: 12px; gap: 12px; }
  .play-btn { width: 54px; height: 54px; }
  .story { padding: 20px 18px 24px; font-size: 16px; }
  .result-actions { flex-direction: column; }
  .actions { flex-direction: column-reverse; }
}

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

/* --- login and genre hub --- */
body {
  background: radial-gradient(90% 60% at 80% -10%, rgba(157, 178, 255, .12), transparent 60%), #0b0d12;
}

.bg-layers {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-layers .sky {
  position: absolute;
  display: none;
}

.rain, .grid-bg, .bokeh, .smoke {
  position: absolute;
  inset: 0;
  display: none;
}

.story-brand {
  position: fixed;
  top: 30px;
  left: 32px;
  z-index: 10;
  line-height: 1.45;
}

.story-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.45;
  white-space: nowrap;
}

.story-brand-logo::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: linear-gradient(135deg, #9db2ff, #7f8ff0);
  box-shadow: 0 0 0 4px rgba(157, 178, 255, .12);
}

.story-brand-logo a {
  color: inherit;
  text-decoration: none;
}

.story-brand-logo .sep {
  color: #626d82;
  font-weight: 400;
}

.story-brand-logo .muted {
  color: #e9edf6;
  font-weight: 500;
}

.app {
  width: min(980px, 100%);
  padding-top: 90px;
}

.auth {
  width: min(380px, 100%);
  margin: auto;
  padding: 26px;
  text-align: left;
  background: linear-gradient(180deg, #161a23, #1d2230);
  border: 1px solid #29303f;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.auth-hint {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.auth .field {
  color: #8f99ad;
}

.auth .field input {
  background: #10141c;
  border-color: #29303f;
  border-radius: 12px;
}

.auth .field input:focus {
  border-color: #9db2ff;
  box-shadow: 0 0 0 3px rgba(157, 178, 255, .14);
  background: #10141c;
}

.auth .btn-primary {
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(135deg, #9db2ff, #7f8ff0);
  color: #0b1026;
  box-shadow: 0 12px 28px rgba(127, 143, 240, .22);
}

.genre-screen {
  width: 100%;
  margin: 2vh auto 0;
}

.genre-head {
  text-align: center;
  margin-bottom: 26px;
}

.genre-head h1 {
  font-size: clamp(30px, 5vw, 44px);
  margin: 4px 0 8px;
}

.genre-sub {
  margin: 0 auto;
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.genre-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-height: 132px;
  padding: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(23, 28, 52, .94), rgba(14, 18, 38, .96));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 20px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .2s, box-shadow .2s;
}

.genre-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-accent), transparent 68%);
  opacity: .14;
  pointer-events: none;
}

.genre-card:hover {
  transform: translateY(-3px);
  border-color: var(--card-accent);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .32), 0 0 0 1px color-mix(in srgb, var(--card-accent) 40%, transparent);
}

.genre-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  color: var(--card-accent);
  font-size: 20px;
}

.genre-title {
  font-size: 19px;
  font-weight: 700;
}

.genre-tagline {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.genre-card:last-child:nth-child(odd) {
  grid-column: span 2;
}

.wizard, .result, .progress-screen {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* --- genre atmospheres --- */
.theme-children { background: #070b1d; }
.theme-children .sky { display: block; }

.theme-detective {
  --gold: #e0a44b;
  --pink: #c98a5a;
  --mint: #8fbf9f;
  --blue: #8aa4c8;
  --violet: #b08d6a;
  --card: rgba(20, 18, 15, .94);
  --line: rgba(224, 164, 75, .22);
  background: #0b0c0e;
}

.theme-detective .rain {
  display: block;
  background: repeating-linear-gradient(105deg, transparent 0 13px, rgba(224, 164, 75, .075) 13px 14px);
  animation: rainMove 1.4s linear infinite;
  opacity: .7;
}

@keyframes rainMove {
  to { transform: translate3d(-40px, 80px, 0); }
}

.theme-detective .question-card,
.theme-detective .story,
.theme-detective .player,
.theme-detective .auth {
  border-radius: 6px;
  border-color: rgba(224, 164, 75, .25);
}

.theme-detective h1,
.theme-detective .question-card h1,
.theme-detective .genre-head h1,
.theme-detective .result-head h1,
.theme-detective .story {
  font-family: Georgia, "Times New Roman", serif;
}

.theme-detective .btn-primary {
  background: linear-gradient(135deg, #e0a44b, #b8742f);
  color: #1a1005;
  box-shadow: 0 14px 30px rgba(224, 164, 75, .22);
}

.theme-scifi {
  --gold: #66e0ff;
  --pink: #9d8cff;
  --mint: #77ffcf;
  --blue: #66c8ff;
  --violet: #9d8cff;
  --card: rgba(8, 20, 38, .9);
  --line: rgba(102, 224, 255, .22);
  background: #040a14;
}

.theme-scifi .grid-bg {
  display: block;
  background-image:
    linear-gradient(rgba(102, 224, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 224, 255, .08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  animation: gridMove 14s linear infinite;
}

@keyframes gridMove {
  to { background-position: 0 54px, 54px 0; }
}

.theme-scifi h1,
.theme-scifi .question-card h1,
.theme-scifi .genre-head h1,
.theme-scifi .result-head h1 {
  letter-spacing: .02em;
}

.theme-scifi .btn-primary {
  background: linear-gradient(135deg, #66e0ff, #2a8fd6);
  color: #04121c;
  box-shadow: 0 14px 30px rgba(102, 224, 255, .22);
}

.theme-scifi .question-card,
.theme-scifi .story,
.theme-scifi .player {
  border-color: rgba(102, 224, 255, .25);
  box-shadow: 0 24px 70px rgba(0, 30, 60, .45);
}

.theme-romance {
  --gold: #ff9eb5;
  --pink: #ff7f9f;
  --mint: #ffc9d6;
  --blue: #d9a7ff;
  --violet: #c48cff;
  --card: rgba(40, 18, 36, .9);
  --line: rgba(255, 158, 181, .22);
  background: #170d1b;
}

.theme-romance .bokeh { display: block; }

.bokeh i {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 158, 181, .28), transparent 68%);
  filter: blur(2px);
  animation: bokehFloat 11s ease-in-out infinite;
}

.bokeh i:nth-child(1) { left: 8%; top: 18%; }
.bokeh i:nth-child(2) { right: 12%; top: 10%; width: 200px; height: 200px; animation-delay: -3s; }
.bokeh i:nth-child(3) { left: 18%; bottom: 12%; width: 170px; height: 170px; animation-delay: -6s; }
.bokeh i:nth-child(4) { right: 18%; bottom: 20%; animation-delay: -4s; }
.bokeh i:nth-child(5) { left: 45%; top: 42%; width: 110px; height: 110px; animation-delay: -8s; }

@keyframes bokehFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -24px) scale(1.12); }
}

.theme-romance h1,
.theme-romance .question-card h1,
.theme-romance .genre-head h1,
.theme-romance .result-head h1,
.theme-romance .story {
  font-family: Georgia, "Times New Roman", serif;
}

.theme-romance .btn-primary {
  background: linear-gradient(135deg, #ff9eb5, #d96a91);
  color: #2a0d18;
  box-shadow: 0 14px 34px rgba(255, 158, 181, .24);
}

.theme-adult {
  --gold: #c9a86a;
  --pink: #a85566;
  --mint: #a9b8a0;
  --blue: #8a9bb8;
  --violet: #a77a8a;
  --card: rgba(24, 18, 20, .95);
  --line: rgba(201, 168, 106, .24);
  background: #0d0a0c;
}

.theme-adult .smoke {
  display: block;
  background:
    radial-gradient(60% 50% at 20% 80%, rgba(201, 168, 106, .1), transparent 70%),
    radial-gradient(50% 40% at 80% 20%, rgba(168, 85, 102, .14), transparent 70%);
  animation: smokeMove 12s ease-in-out infinite;
}

@keyframes smokeMove {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .9; }
  50% { transform: translate(-16px, -20px) scale(1.08); opacity: .6; }
}

.theme-adult h1,
.theme-adult .question-card h1,
.theme-adult .genre-head h1,
.theme-adult .result-head h1,
.theme-adult .story {
  font-family: Georgia, "Times New Roman", serif;
}

.theme-adult .question-card,
.theme-adult .story,
.theme-adult .player {
  border-radius: 8px;
  border-color: rgba(201, 168, 106, .28);
}

.theme-adult .btn-primary {
  background: linear-gradient(135deg, #c9a86a, #a8793f);
  color: #1a1208;
  box-shadow: 0 14px 32px rgba(201, 168, 106, .2);
}

.theme-children .magic-core { background: radial-gradient(circle at 35% 30%, #fff7d6, #ffd166 55%, #ff9f43); }
.theme-detective .magic-core { background: radial-gradient(circle at 35% 30%, #fff4d8, #e0a44b 55%, #8a4d1d); }
.theme-scifi .magic-core { background: radial-gradient(circle at 35% 30%, #e9ffff, #66e0ff 55%, #1b6ea8); }
.theme-romance .magic-core { background: radial-gradient(circle at 35% 30%, #fff0f4, #ff9eb5 55%, #b34d70); }
.theme-adult .magic-core { background: radial-gradient(circle at 35% 30%, #fff4dd, #c9a86a 55%, #7a3d3f); color: #2a1805; }

.theme-detective .step-label,
.theme-detective .progress-line,
.theme-detective .story .who { color: #e0a44b; }
.theme-scifi .step-label,
.theme-scifi .progress-line,
.theme-scifi .story .who { color: #66e0ff; }
.theme-romance .step-label,
.theme-romance .progress-line,
.theme-romance .story .who { color: #ff9eb5; }
.theme-adult .step-label,
.theme-adult .progress-line,
.theme-adult .story .who { color: #c9a86a; }

@media (max-width: 720px) {
  .story-brand { top: 20px; left: 16px; }
  .app { padding-top: 64px; }
  .genre-grid { grid-template-columns: 1fr; }
  .genre-card:last-child:nth-child(odd) { grid-column: auto; }
  .genre-card { min-height: 112px; }
  .auth { padding: 22px 20px; }
}

/* login must match files/remote exactly */
.auth {
  width: 100%;
  max-width: 380px;
  line-height: 1.45;
  padding: 28px 24px 32px;
  background: linear-gradient(180deg, #161a23, #11141b);
  border: 1px solid #29303f;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  text-align: left;
}

.auth-hint {
  margin: 0 0 20px;
  color: #8f99ad;
  font-size: 14px;
  line-height: 1.45;
}

.login-form {
  display: block;
}

.auth .field {
  display: block;
  margin: 0 0 14px;
  color: #8f99ad;
  font-size: 13px;
  font-weight: 600;
}

.auth .field span {
  display: block;
}

.auth .field input {
  display: block;
  width: 100%;
  height: 46px;
  margin-top: 7px;
  padding: 0 14px;
  background: #090c12;
  border: 1px solid #29303f;
  border-radius: 11px;
  color: #e9edf6;
  font-size: 16px;
  outline: none;
}

.auth .field input:focus {
  border-color: #9db2ff;
  box-shadow: 0 0 0 3px rgba(157, 178, 255, .16);
}

.auth .btn-primary {
  width: 100%;
  min-height: 42px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: linear-gradient(180deg, #9db2ff, #7f8ff0);
  color: #0a0f1f;
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  margin: 0;
}

.auth .btn-primary:hover {
  filter: brightness(1.06);
  transform: none;
}

.auth .error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #ff9aa8;
  font-size: 13px;
}

body.auth-mode .app {
  padding-top: 0;
  padding-bottom: 0;
}

.auth .field input:focus {
  background: #090c12;
}

.small-note.adult-note {
  align-self: center;
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(201, 168, 106, .38);
  border-radius: 999px;
  background: rgba(201, 168, 106, .08);
  color: #c9a86a;
  font-size: 12px;
  letter-spacing: .02em;
}
