/* =====================================================================
   LoveMatch — Dark Luxury Design System (visual redesign)
   Shared tokens are mirrored in admin/admin.css so both surfaces match.
   No selectors, IDs, classes or data-attributes referenced by JS were
   renamed or removed — this file is presentation only.
   ===================================================================== */

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

:root {
  /* ── Background ── */
  --bg-1: #120a14;
  --bg-2: #1b0f22;
  --bg-3: #251329;
  --bg: var(--bg-1);

  /* ── Accent (pink) ── */
  --accent: #ff4f87;
  --accent-2: #ff77a9;
  --accent-3: #e9407a;
  --accent-light: #ff9dbf;
  --accent-glow: rgba(255, 79, 135, 0.42);

  /* ── Secondary (purple) ── */
  --purple: #8b5cf6;
  --purple-2: #a855f7;
  --purple-glow: rgba(139, 92, 246, 0.38);

  /* ── Surfaces ── */
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-bg-strong: rgba(255, 255, 255, 0.08);
  --bg-elevated: var(--glass-bg);
  --border: rgba(255, 255, 255, 0.1);
  --border-soft: rgba(255, 255, 255, 0.06);

  /* ── Text ── */
  --text: #ffffff;
  --text-muted: #c9b8d0;
  --text-soft: #b79bc2;
  --text-pink: #ffb3cd;

  /* ── Semantic ── */
  --success: #6ee7a8;
  --gold: #ffd479;
  --warn: #ff7a92;

  /* ── Effects ── */
  --blur: 20px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 70px rgba(20, 6, 24, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --shadow-glow: 0 18px 50px var(--accent-glow);
  --radius: 24px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  /* ── Gradients ── */
  --grad-accent: linear-gradient(135deg, var(--accent), var(--purple));
  --grad-accent-soft: linear-gradient(135deg, var(--accent-2), var(--purple-2));
  --grad-text: linear-gradient(120deg, #ffffff 0%, var(--accent-light) 55%, var(--purple-2) 100%);
}

html {
  font-size: 16px;
  color-scheme: dark;
  scroll-behavior: smooth;
}

[hidden] {
  display: none !important;
}

body {
  font-family: "Inter", "Noto Sans KR", system-ui, -apple-system, sans-serif;
  background: var(--bg-1);
  color: var(--text);
  min-height: 100svh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Slow drifting gradient wash behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -2;
  background:
    radial-gradient(45% 45% at 20% 18%, rgba(255, 79, 135, 0.22), transparent 60%),
    radial-gradient(40% 40% at 82% 12%, rgba(168, 85, 247, 0.2), transparent 60%),
    radial-gradient(55% 55% at 78% 88%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(45% 45% at 12% 82%, rgba(233, 64, 122, 0.16), transparent 60%);
  background-size: 200% 200%;
  filter: blur(10px);
  animation: gradientDrift 26s ease-in-out infinite alternate;
}

/* Base linear gradient between the three background tones. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 50%, var(--bg-3) 100%);
}

@keyframes gradientDrift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 50% 100%; }
}

/* ── Background hearts + particles ── */
.bg-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Faint dotted particle field. */
.bg-hearts::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 30%, transparent 80%);
  opacity: 0.5;
}

.floating-heart {
  position: absolute;
  bottom: -48px;
  left: var(--x);
  font-size: 1.4rem;
  opacity: 0;
  filter: drop-shadow(0 4px 12px var(--accent-glow));
  will-change: transform, opacity;
  animation: floatUp 11s ease-in infinite;
  animation-delay: var(--d);
}

@keyframes floatUp {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.55) rotate(-8deg); }
  12% { opacity: 0.55; }
  85% { opacity: 0.18; }
  100% { opacity: 0; transform: translate3d(14px, -102vh, 0) scale(1.15) rotate(10deg); }
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

/* ── Global chrome (back + language toggle) ── */
.global-chrome {
  position: fixed;
  z-index: 850;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: max(0.65rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right))
    0.55rem max(0.85rem, env(safe-area-inset-left));
  pointer-events: none;
}

.global-chrome > * {
  pointer-events: auto;
}

.global-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.global-back-btn:hover {
  background: var(--glass-bg-strong);
  border-color: rgba(255, 119, 169, 0.35);
  transform: translateY(-1px);
}

.global-back-btn:active { transform: translateY(0) scale(0.98); }

.global-back-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 79, 135, 0.4);
}

.global-back-icon {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem;
  margin-left: auto;
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
}

.lang-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.42rem 0.72rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.22s ease, background 0.22s ease, transform 0.18s ease, box-shadow 0.22s ease;
}

.lang-toggle-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.lang-toggle-btn.is-active {
  color: #fff;
  background: var(--grad-accent);
  box-shadow: 0 6px 18px var(--accent-glow);
}

.lang-toggle-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
}

body.lang-switching #app-content,
body.lang-switching #lang-screen,
body.lang-switching #wrapped-story .story-inner {
  animation: langFade 0.28s ease-out;
}

@keyframes langFade {
  0% { opacity: 0.72; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Layout ── */
.container {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
  padding: clamp(3.75rem, 11vw, 4.25rem) clamp(1rem, 4vw, 1.25rem) 3rem;
  padding-left: max(clamp(1rem, 4vw, 1.25rem), env(safe-area-inset-left));
  padding-right: max(clamp(1rem, 4vw, 1.25rem), env(safe-area-inset-right));
}

.header {
  text-align: center;
  margin-bottom: clamp(1.5rem, 5vw, 2rem);
  animation: fadeUp 0.6s ease-out both;
}

.header-icon {
  font-size: clamp(2.5rem, 9vw, 3.25rem);
  display: inline-block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 8px 24px var(--accent-glow));
  animation: pulse 2.6s ease-in-out infinite;
}

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

.header h1 {
  font-size: clamp(2rem, 8vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-size: clamp(0.92rem, 3.4vw, 1.05rem);
  max-width: 32ch;
  margin-inline: auto;
}

/* ── Cards ── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  padding: clamp(1.35rem, 5vw, 1.85rem);
  box-shadow: var(--shadow);
  position: relative;
}

/* Subtle top highlight on every glass card. */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ── Language picker ── */
.lang-card {
  text-align: center;
  margin-top: clamp(2rem, 14vh, 6rem);
  animation: fadeUp 0.6s ease-out both;
}

.lang-card .header-icon { margin-bottom: 1rem; }

.lang-title {
  font-size: clamp(1.4rem, 6vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.lang-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.85rem;
}

.lang-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 1.05rem 1.5rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.lang-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent-2);
  background: rgba(255, 79, 135, 0.1);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.lang-btn:active { transform: translateY(-1px) scale(0.99); }

.lang-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 79, 135, 0.35);
}

.lang-flag { font-size: 1.4rem; }

/* ── Form ── */
.form-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: fadeUp 0.6s ease-out both;
}

.person-section h2 {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 1.1rem;
}

body.lang-ko .person-section h2 {
  text-transform: none;
  letter-spacing: 0;
}

.field { margin-bottom: 1.1rem; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.field input {
  width: 100%;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 4px rgba(255, 79, 135, 0.18), 0 8px 24px rgba(255, 79, 135, 0.12);
}

.field input::placeholder {
  color: rgba(199, 184, 208, 0.4);
}

.field-error {
  font-size: 0.8rem;
  color: var(--warn);
  margin-top: 0.4rem;
  line-height: 1.35;
}

.field input.input-invalid,
.input-prefix.field-invalid {
  border-color: var(--warn);
}

.input-prefix.field-invalid {
  box-shadow: 0 0 0 4px rgba(255, 122, 146, 0.16);
}

.privacy-notice {
  margin: 0.85rem 0 0.35rem;
}

.privacy-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  cursor: pointer;
}

.privacy-consent input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.privacy-consent a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.privacy-consent a:hover {
  color: var(--text);
}

.input-prefix {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.input-prefix span {
  padding: 0 0 0 1.05rem;
  color: var(--text-soft);
  font-weight: 500;
}

.input-prefix input {
  border: none;
  background: transparent;
  border-radius: 0;
  padding-left: 0.3rem;
  box-shadow: none !important;
}

.input-prefix input:focus {
  box-shadow: none !important;
  background: transparent;
}

.input-prefix:focus-within {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 4px rgba(255, 79, 135, 0.18), 0 8px 24px rgba(255, 79, 135, 0.12);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.5rem 0 1.1rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.divider span {
  font-size: 1.3rem;
  opacity: 0.85;
  filter: drop-shadow(0 2px 8px var(--accent-glow));
}

/* ── Buttons ── */
.btn-primary,
.btn-secondary,
.btn-share {
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, opacity 0.18s ease, filter 0.2s ease;
}

.btn-primary {
  width: 100%;
  margin-top: 0.65rem;
  padding: 1.05rem 1.5rem;
  background: var(--grad-accent);
  color: #fff;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 32px var(--accent-glow), 0 4px 12px var(--purple-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px var(--accent-glow), 0 8px 18px var(--purple-glow);
  filter: brightness(1.06);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(-1px) scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary:focus-visible,
.btn-share:focus-visible,
.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 0 6px var(--accent);
}

.btn-share {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--grad-accent-soft);
  color: #fff;
  box-shadow: 0 12px 32px var(--accent-glow);
}

.btn-share:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
  box-shadow: 0 18px 42px var(--accent-glow);
}

.btn-share:active { transform: translateY(-1px) scale(0.99); }

.btn-secondary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-light);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 79, 135, 0.12);
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.btn-secondary:active { transform: translateY(0) scale(0.99); }

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.5rem;
}

/* ── Loading overlay ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 120% at 50% 30%, rgba(37, 19, 41, 0.78), rgba(18, 10, 20, 0.92));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.loading-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Floating hearts inside the loading card. */
.loading-card::after {
  content: "💗 💞 💘";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  font-size: 0.8rem;
  letter-spacing: 1.2rem;
  text-align: center;
  opacity: 0.25;
  animation: pulse 2.4s ease-in-out infinite;
}

.loading-heart {
  font-size: 3.25rem;
  filter: drop-shadow(0 10px 26px var(--accent-glow));
  animation: heartBeat 1.2s ease-in-out infinite;
  margin-bottom: 1.1rem;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.18); }
  40% { transform: scale(0.96); }
  60% { transform: scale(1.1); }
}

.loading-message {
  font-size: 1.12rem;
  font-weight: 600;
  min-height: 1.6em;
  margin-bottom: 1.4rem;
  color: var(--text);
  transition: opacity 0.3s;
}

.loading-message.fade-in {
  animation: msgFade 0.45s ease-out;
}

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

.loading-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--purple-2));
  border-radius: var(--radius-pill);
  box-shadow: 0 0 18px var(--accent-glow);
  transition: width 0.5s ease-out;
}

/* ── Results ── */
.result-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  animation: fadeUp 0.55s ease-out;
}

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

.reveal-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.result-hero {
  text-align: center;
  padding: clamp(1.85rem, 7vw, 2.5rem) 1.5rem;
  box-shadow: var(--shadow-lg);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 79, 135, 0.16), transparent 65%),
    var(--glass-bg);
}

.score-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.score-ring-wrap {
  position: relative;
  width: clamp(170px, 52vw, 200px);
  height: clamp(170px, 52vw, 200px);
  margin: 0 auto 1.4rem;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 8px 28px var(--accent-glow));
}

.score-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 10;
}

.score-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke 0.4s;
}

.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-big {
  font-size: clamp(2.75rem, 13vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.result-title {
  font-size: clamp(1.35rem, 6vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}

.result-title.tier-meantToBe,
.result-title.tier-soulmates,
.result-title.tier-perfect {
  color: var(--accent);
}

.result-title.tier-great,
.result-title.tier-good {
  color: var(--success);
}

.result-title.tier-growing {
  color: var(--gold);
}

.result-title.tier-interesting,
.result-title.tier-opposites {
  color: var(--purple-2);
}

.score-ring-fill.tier-meantToBe,
.score-ring-fill.tier-soulmates,
.score-ring-fill.tier-perfect { stroke: var(--accent); }

.score-ring-fill.tier-great,
.score-ring-fill.tier-good { stroke: var(--success); }

.score-ring-fill.tier-growing { stroke: var(--gold); }

.score-ring-fill.tier-interesting,
.score-ring-fill.tier-opposites { stroke: var(--purple-2); }

.result-names {
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
}

.result-summary {
  font-size: 0.98rem;
  line-height: 1.7;
  color: var(--text);
}

.section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  margin-bottom: 1.1rem;
}

body.lang-ko .section-title {
  text-transform: none;
  letter-spacing: 0;
}

/* ── Breakdown ── */
.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.breakdown-label {
  font-size: 0.92rem;
  font-weight: 600;
}

.breakdown-pct {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--accent-light);
}

.breakdown-bar-track {
  height: 9px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.breakdown-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--purple-2));
  border-radius: var(--radius-pill);
  box-shadow: 0 0 14px rgba(255, 79, 135, 0.4);
  transition: width 0.05s linear;
}

.breakdown-explanation {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Strengths / Challenges ── */
.pill-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pill-list li {
  font-size: 0.93rem;
  font-weight: 500;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, rgba(255, 79, 135, 0.14), rgba(139, 92, 246, 0.1));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.challenge-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.challenge-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Advice & Luck ── */
.advice-card {
  background: linear-gradient(135deg, rgba(255, 79, 135, 0.14), rgba(139, 92, 246, 0.08));
  border-color: rgba(255, 79, 135, 0.25);
}

.result-advice {
  font-size: 1.02rem;
  line-height: 1.6;
}

.luck-card {
  background: linear-gradient(135deg, rgba(110, 231, 168, 0.1), rgba(255, 212, 121, 0.08));
  border-color: rgba(110, 231, 168, 0.2);
}

.luck-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.luck-score {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--gold);
  min-width: 3.5rem;
}

.luck-bar-track {
  flex: 1;
  height: 11px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.luck-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #ffe6a8);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 14px rgba(255, 212, 121, 0.45);
}

.luck-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.result-disclaimer {
  font-size: 0.75rem;
  color: rgba(199, 184, 208, 0.5);
  text-align: center;
  font-style: italic;
  padding: 0 0.5rem;
}

/* ── Footer & admin access ── */
.site-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem calc(2rem + env(safe-area-inset-bottom));
}

.admin-access-btn {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(199, 184, 208, 0.4);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-pill);
  transition: color 0.2s ease, background 0.2s ease;
}

.admin-access-btn:hover {
  color: var(--accent-light);
  background: rgba(255, 255, 255, 0.04);
}

/* ── Admin login modal ── */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.admin-modal[hidden] {
  display: none !important;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 6, 14, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.admin-modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(var(--blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.admin-modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  text-align: center;
}

.admin-modal-input {
  width: 100%;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 0.85rem;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.admin-modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 79, 135, 0.18);
}

.admin-login-error {
  font-size: 0.85rem;
  color: var(--warn);
  margin-bottom: 0.85rem;
  text-align: center;
}

.admin-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.admin-modal-actions .btn-primary,
.admin-modal-actions .btn-secondary {
  width: 100%;
  margin-top: 0;
}

.admin-modal-submit {
  padding: 0.85rem 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Toast notifications ── */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.4;
  color: #fff;
  background: rgba(30, 16, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-warning {
  background: linear-gradient(135deg, #c14a5c, #8a2f4a);
}

.toast-success {
  background: linear-gradient(135deg, #2f8a5b, #1f6b45);
}

/* ── Relationship type card ── */
.relationship-card {
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(139, 92, 246, 0.16), transparent 65%),
    var(--glass-bg);
}

.relationship-type-label {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(255, 79, 135, 0.22), rgba(139, 92, 246, 0.2));
  border: 1px solid var(--border);
  font-size: clamp(1.3rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  box-shadow: 0 8px 26px rgba(139, 92, 246, 0.2);
}

.special-message {
  margin-top: 1rem;
  font-size: clamp(0.92rem, 3.6vw, 1rem);
  font-style: italic;
  line-height: 1.55;
  color: var(--text-pink);
}

/* ── Crush success chance ── */
.chance-defs {
  position: absolute;
  width: 0;
  height: 0;
}

.chance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.4rem, 3vw, 1rem);
}

.chance-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.chance-ring-wrap {
  position: relative;
  width: clamp(78px, 25vw, 104px);
  height: clamp(78px, 25vw, 104px);
}

.chance-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 6px 18px var(--accent-glow));
}

.chance-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 9;
}

.chance-ring-fill {
  fill: none;
  stroke: url(#chance-grad);
  stroke-width: 9;
  stroke-linecap: round;
}

.chance-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.95rem, 4vw, 1.2rem);
  font-weight: 800;
  color: var(--text);
}

.chance-label {
  font-size: clamp(0.68rem, 2.7vw, 0.78rem);
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  color: var(--text-muted);
}

/* ── Secret message card ── */
.secret-card {
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 79, 135, 0.12), rgba(139, 92, 246, 0.1));
  border-color: rgba(255, 79, 135, 0.22);
}

.secret-message-text {
  font-size: clamp(1.05rem, 4.5vw, 1.25rem);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 1.15rem;
  color: var(--text);
}

.btn-copy {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-light);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.7rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-copy:hover {
  background: rgba(255, 79, 135, 0.12);
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.btn-copy:active { transform: translateY(0) scale(0.98); }

.btn-copy:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 79, 135, 0.35);
}

/* ── Download story card button ── */
.btn-story {
  width: 100%;
  padding: 1.05rem 1.5rem;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--grad-accent);
  box-shadow: 0 14px 36px var(--accent-glow), 0 4px 12px var(--purple-glow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.25s ease, filter 0.2s ease;
}

.btn-story:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
  box-shadow: 0 20px 46px var(--accent-glow), 0 8px 18px var(--purple-glow);
}

.btn-story:active { transform: translateY(-1px) scale(0.99); }

.btn-story:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 0 0 6px var(--accent);
}

/* =====================================================================
   Wrapped-style story experience
   ===================================================================== */
.wrapped-story {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  height: 100svh;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 20% 12%, rgba(255, 79, 135, 0.28), transparent 60%),
    radial-gradient(80% 60% at 82% 88%, rgba(139, 92, 246, 0.26), transparent 60%),
    linear-gradient(160deg, #1a0c1f 0%, #2a0a1d 50%, #1d1029 100%);
  padding:
    max(0.65rem, env(safe-area-inset-top))
    max(0.9rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(0.9rem, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.wrapped-story.active {
  opacity: 1;
  visibility: visible;
}

.story-defs { position: absolute; width: 0; height: 0; }

/* Floating hearts inside the story */
.story-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.story-heart {
  position: absolute;
  bottom: -40px;
  left: var(--x);
  font-size: 1.5rem;
  opacity: 0;
  filter: drop-shadow(0 6px 16px var(--accent-glow));
  will-change: transform, opacity;
  animation: storyHeartUp 9s ease-in infinite;
  animation-delay: var(--d);
}

@keyframes storyHeartUp {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(0.6); }
  15% { opacity: 0.5; }
  100% { opacity: 0; transform: translate3d(10px, -106svh, 0) scale(1.2); }
}

/* Segmented progress bars */
.story-progress {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 5px;
  padding: 0.35rem 0.25rem 0.6rem;
  flex-shrink: 0;
}

.story-seg {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.story-seg-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-light), #fff);
  box-shadow: 0 0 10px var(--accent-glow);
}

.story-skip {
  position: relative;
  z-index: 3;
  align-self: flex-end;
  margin: -0.2rem 0.1rem 0.1rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.4rem 1rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.story-skip:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.story-skip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 79, 135, 0.4);
}

/* Screens stage */
.story-screens {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.story-screen {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(28px, 0, 0) scale(0.985);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.5s ease;
  pointer-events: none;
  overflow-y: auto;
}

.story-screen.is-past {
  transform: translate3d(-28px, 0, 0) scale(0.985);
}

.story-screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
}

.story-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
  margin: auto;
}

/* Per-screen entrance animation (children rise in) */
.story-screen.is-active.animate-in .story-inner > * {
  animation: storyRise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.story-screen.is-active.animate-in .story-inner > *:nth-child(2) { animation-delay: 0.08s; }
.story-screen.is-active.animate-in .story-inner > *:nth-child(3) { animation-delay: 0.16s; }
.story-screen.is-active.animate-in .story-inner > *:nth-child(4) { animation-delay: 0.24s; }

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

.story-emoji {
  display: block;
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  filter: drop-shadow(0 10px 28px var(--accent-glow));
  margin-bottom: 0.4rem;
}

.story-emoji-lg { font-size: clamp(3.2rem, 16vw, 4.6rem); }

.story-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-light);
  margin-bottom: 1.1rem;
}

body.lang-ko .story-eyebrow { text-transform: none; letter-spacing: 0.04em; }

.story-title-xl {
  font-size: clamp(1.85rem, 8.5vw, 2.7rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.story-names {
  font-size: clamp(1.05rem, 4.6vw, 1.3rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.6rem;
}

.story-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  animation: storyPulse 2.2s ease-in-out infinite;
}

@keyframes storyPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Score screen */
.story-score-ring-wrap {
  position: relative;
  width: clamp(220px, 64vw, 300px);
  height: clamp(220px, 64vw, 300px);
  margin: 0 auto 1.4rem;
}

.story-score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 10px 34px var(--accent-glow));
}

.story-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 12; }

.story-ring-fill {
  fill: none;
  stroke: url(#story-grad);
  stroke-width: 12;
  stroke-linecap: round;
}

.story-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(3.4rem, 17vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.story-score-type {
  font-size: clamp(1.35rem, 6vw, 1.75rem);
  font-weight: 800;
  color: var(--text-pink);
}

/* Relationship type screen */
.story-type-label {
  display: inline-block;
  padding: 0.85rem 1.8rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(255, 79, 135, 0.3), rgba(139, 92, 246, 0.28));
  border: 1px solid rgba(255, 182, 205, 0.45);
  font-size: clamp(1.7rem, 8vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  box-shadow: 0 14px 44px rgba(139, 92, 246, 0.32);
}

.story-type-special {
  margin-top: 1.3rem;
  font-size: clamp(1rem, 4.4vw, 1.15rem);
  font-style: italic;
  line-height: 1.6;
  color: var(--text-pink);
}

/* Love statistics screen */
.story-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1rem, 5vw, 1.6rem);
  margin-top: 0.4rem;
}

.story-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.story-stat-ring-wrap {
  position: relative;
  width: clamp(92px, 30vw, 120px);
  height: clamp(92px, 30vw, 120px);
}

.story-stat-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 6px 18px var(--accent-glow));
}

.story-stat-bg { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 9; }

.story-stat-fill {
  fill: none;
  stroke: url(#story-grad);
  stroke-width: 9;
  stroke-linecap: round;
}

.story-stat-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.05rem, 4.6vw, 1.35rem);
  font-weight: 800;
  color: #fff;
}

.story-stat-label {
  font-size: clamp(0.74rem, 3.1vw, 0.88rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-muted);
}

/* Message screen */
.story-message-text {
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.story-secret-text {
  font-size: clamp(0.98rem, 4.2vw, 1.12rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-pink);
  background: linear-gradient(135deg, rgba(255, 79, 135, 0.14), rgba(139, 92, 246, 0.12));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
}

/* Share screen */
.story-share-inner { max-width: 400px; }

.story-share-preview {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.25rem;
  margin-bottom: 0.9rem;
  box-shadow: var(--shadow);
}

.story-share-names {
  font-size: clamp(1rem, 4.4vw, 1.2rem);
  font-weight: 600;
  color: var(--text);
}

.story-share-score {
  font-size: clamp(2.8rem, 14vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.story-share-type {
  font-size: clamp(1.05rem, 4.6vw, 1.3rem);
  font-weight: 800;
  color: var(--text-pink);
}

.story-share-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.story-share-screen .result-actions { margin-top: 0; }

/* Ghost button (See full results) */
.btn-ghost {
  width: 100%;
  padding: 0.9rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-2);
  transform: translateY(-2px);
}

.btn-ghost:active { transform: translateY(0) scale(0.99); }
.btn-ghost:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 79, 135, 0.35);
}

/* Bottom nav controls */
.story-nav {
  position: relative;
  z-index: 3;
  display: flex;
  gap: 0.7rem;
  width: 100%;
  max-width: 520px;
  margin: 0.4rem auto 0;
  flex-shrink: 0;
}

.story-nav-btn {
  flex: 1;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.18s ease, opacity 0.2s ease;
}

.story-nav-next {
  background: var(--grad-accent);
  border-color: transparent;
  box-shadow: 0 10px 28px var(--accent-glow);
}

.story-nav-btn:hover { transform: translateY(-2px); }
.story-nav-btn:active { transform: translateY(0) scale(0.99); }
.story-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.story-nav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.7), 0 0 0 6px var(--accent);
}

/* ── Responsive ── */
@media (max-width: 400px) {
  .container { padding-top: 3.65rem; }
  .global-back-label { display: none; }
  .global-back-btn { padding: 0.45rem 0.65rem; }
  .lang-toggle-btn { padding: 0.4rem 0.55rem; font-size: 0.72rem; }
  .pill-list li { padding: 0.6rem 0.85rem; }
}

@media (max-height: 700px) {
  .story-score-ring-wrap { width: clamp(180px, 52vw, 240px); height: clamp(180px, 52vw, 240px); }
  .story-stat-ring-wrap { width: clamp(80px, 26vw, 104px); height: clamp(80px, 26vw, 104px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  body::before { animation: none; }
  .toast {
    transition: opacity 0.2s ease;
    transform: none;
  }
  .toast-visible { transform: none; }

  .story-heart { animation: none; display: none; }
  .story-hint { animation: none; opacity: 0.7; }
  .story-screen {
    transition: opacity 0.2s ease, visibility 0.2s ease;
    transform: none;
  }
  .story-screen.is-past,
  .story-screen.is-active { transform: none; }
  .story-screen.is-active.animate-in .story-inner > * { animation: none; }
}

/* =====================================================================
   Rizz Coach — floating DM helper (isolated feature)
   ===================================================================== */

.rizz-coach-fab {
  position: fixed;
  z-index: 900;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.85rem 1.15rem;
  font-family: inherit;
  font-size: clamp(0.88rem, 2.8vw, 0.98rem);
  font-weight: 700;
  color: #fff;
  background: var(--grad-accent);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 14px 36px var(--accent-glow), 0 0 0 1px rgba(255, 255, 255, 0.12);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  animation: rizzFabPulse 3s ease-in-out infinite;
}

.rizz-coach-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 44px var(--accent-glow);
}

.rizz-coach-fab:active { transform: translateY(0) scale(0.98); }
.rizz-coach-fab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 0 6px var(--accent);
}

@keyframes rizzFabPulse {
  0%, 100% { box-shadow: 0 14px 36px var(--accent-glow); }
  50% { box-shadow: 0 16px 42px rgba(255, 79, 135, 0.55); }
}

.rizz-coach-panel {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  pointer-events: none;
}

.rizz-coach-panel.rizz-open { pointer-events: auto; }

.rizz-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 4, 12, 0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.rizz-coach-panel.rizz-open .rizz-backdrop { opacity: 1; }

.rizz-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(88vh, 720px);
  margin: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(37, 19, 41, 0.96), rgba(18, 10, 20, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--blur));
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@media (min-width: 520px) {
  .rizz-coach-panel {
    align-items: flex-end;
    padding: 1.25rem;
    padding-bottom: max(5.5rem, calc(1.25rem + env(safe-area-inset-bottom)));
  }
  .rizz-sheet {
    border-radius: var(--radius);
    max-height: min(78vh, 640px);
    transform: translateY(16px) scale(0.96);
    opacity: 0;
  }
  .rizz-coach-panel.rizz-open .rizz-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.rizz-coach-panel.rizz-open .rizz-sheet { transform: translateY(0); }

.rizz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.65rem;
  border-bottom: 1px solid var(--border-soft);
}

.rizz-title {
  font-size: 1.05rem;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rizz-close {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.rizz-close:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

.rizz-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.rizz-step { display: flex; flex-direction: column; gap: 0.85rem; }

.rizz-fade-in { animation: fadeUp 0.38s ease-out both; }

.rizz-welcome {
  font-size: clamp(1.05rem, 3.5vw, 1.2rem);
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
}

.rizz-q {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-pink);
  line-height: 1.4;
}

.rizz-options {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.rizz-options-count {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.rizz-option {
  padding: 0.8rem 0.95rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.rizz-option:hover {
  border-color: var(--accent-2);
  background: var(--glass-bg-strong);
  transform: translateY(-2px);
}

.rizz-option:active { transform: translateY(0); }

.rizz-primary,
.rizz-secondary {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.rizz-primary {
  color: #fff;
  background: var(--grad-accent);
  box-shadow: 0 10px 28px var(--accent-glow);
}

.rizz-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.rizz-primary:hover,
.rizz-secondary:hover { transform: translateY(-2px); }

.rizz-back {
  margin-top: 0.25rem;
  padding: 0.55rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

.rizz-loading {
  text-align: center;
  color: var(--text-muted);
  font-weight: 600;
}

.rizz-loading-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.rizz-loading-fill {
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--grad-accent);
  animation: rizzLoadBar 1.2s ease-in-out infinite;
}

@keyframes rizzLoadBar {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.rizz-results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(42vh, 320px);
  overflow-y: auto;
}

.rizz-results li {
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  background: var(--glass-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.rizz-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

body.rizz-coach-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .rizz-coach-fab { animation: none; }
  .rizz-sheet { transition: opacity 0.2s ease; }
  .rizz-loading-fill { animation: none; width: 100%; }
}
