@charset "UTF-8";

/* ===== Variables ===== */
:root {
  --bg: #FFF8F5;
  --bg2: #FFF0EB;
  --fg: #2D1F1A;
  --fg2: #6B4C3F;
  --muted: #A8877A;
  --card: #FFFFFF;
  --border: #F0D5C9;
  --accent: #E8654A;
  --pink: #FF8899;
  --pink-soft: #FFB3C1;
  --blue: #7799CC;
  --blue-soft: #A8C8E8;
  --glow1: rgba(255,136,153,0.15);
  --glow2: rgba(119,153,204,0.12);
  --shadow: 0 4px 24px rgba(45,31,26,0.06);
  --shadow-lg: 0 8px 40px rgba(45,31,26,0.1);
}

[data-theme="dark"] {
  --bg: #1A1215;
  --bg2: #221A1E;
  --fg: #F5E6E0;
  --fg2: #C4A99E;
  --muted: #8A6E64;
  --card: #2A2024;
  --border: #3E2E34;
  --accent: #F07A5F;
  --pink: #FF9DAA;
  --pink-soft: #E08090;
  --blue: #99BBEE;
  --blue-soft: #809EC0;
  --glow1: rgba(255,157,170,0.08);
  --glow2: rgba(153,187,238,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
}

/* ===== Reset & Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.5s, color 0.5s;
}

/* ===== Background Decoration ===== */
.bg-deco {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-deco .blob {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
  animation: blobFloat 12s ease-in-out infinite alternate;
}
.bg-deco .blob:nth-child(1) {
  width: 400px; height: 400px;
  background: var(--glow1); top: -10%; left: -5%;
}
.bg-deco .blob:nth-child(2) {
  width: 350px; height: 350px;
  background: var(--glow2); bottom: -10%; right: -5%;
  animation-delay: -4s;
}
.bg-deco .blob:nth-child(3) {
  width: 250px; height: 250px;
  background: var(--glow1); top: 50%; left: 60%;
  animation-delay: -8s;
}
@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, -40px) scale(1.15); }
}

/* ===== Particles ===== */
.particles {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}
.particle {
  position: absolute; border-radius: 50%; opacity: 0.4;
  animation: particleDrift linear infinite;
}
@keyframes particleDrift {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.4; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ===== Topbar ===== */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: flex-end; align-items: center;
  padding: 16px 24px;
}
.theme-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--card);
  color: var(--fg); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s; box-shadow: var(--shadow);
}
.theme-btn:hover { transform: scale(1.1); border-color: var(--accent); }

/* ===== Container & Pages ===== */
.container {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto;
  padding: 60px 20px 40px; min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.page { display: none; width: 100%; }
.page.active { display: flex; flex-direction: column; align-items: center; }

/* ===== Start Page ===== */
.start-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 20px;
  background: linear-gradient(135deg, var(--pink), var(--blue));
  color: #fff; font-size: 13px; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 24px;
  animation: badgePulse 3s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,136,153,0.3); }
  50% { box-shadow: 0 0 20px 4px rgba(255,136,153,0.15); }
}
.start-title {
  font-family: 'Noto Serif SC', serif; font-weight: 900;
  font-size: clamp(32px, 7vw, 52px); line-height: 1.2;
  text-align: center; margin-bottom: 8px;
}
.start-title .pink { color: var(--pink); }
.start-title .blue { color: var(--blue); }
.start-subtitle {
  font-size: 15px; color: var(--muted); text-align: center;
  margin-bottom: 36px; line-height: 1.7; max-width: 400px;
}
.chars-preview {
  display: flex; gap: 32px; margin-bottom: 40px; align-items: center;
}
.char-card {
  width: 120px; text-align: center; transition: transform 0.4s;
}
.char-card:hover { transform: translateY(-6px); }
.char-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid; overflow: hidden;
}
.char-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%;
}
.char-avatar.pink-avatar {
  border-color: var(--pink);
}
.char-avatar.blue-avatar {
  border-color: var(--blue);
}
.char-name { font-weight: 700; font-size: 14px; }
.char-role { font-size: 12px; color: var(--muted); margin-top: 2px; }
.vs-text {
  font-family: 'Noto Serif SC', serif; font-weight: 900;
  font-size: 22px; color: var(--accent); opacity: 0.6;
}

/* ===== Buttons ===== */
.btn-primary {
  padding: 14px 48px; border: none; border-radius: 50px;
  font-size: 17px; font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif; cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--accent));
  color: #fff; box-shadow: 0 4px 20px rgba(232,101,74,0.3);
  transition: all 0.3s; position: relative; overflow: hidden;
}
.btn-primary::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 0; height: 0; background: rgba(255,255,255,0.2);
  border-radius: 50%; transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(232,101,74,0.4);
}
.btn-primary:hover::after { width: 300px; height: 300px; }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  margin-top: 12px; padding: 12px 36px;
  border: 2px solid var(--border); border-radius: 50px;
  background: var(--card); color: var(--fg);
  font-size: 15px; font-weight: 600;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer; transition: all 0.3s;
}
.btn-secondary:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(0); }

/* ===== Quiz Page ===== */
.progress-wrap { width: 100%; margin-bottom: 28px; }
.progress-info {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 500;
}
.progress-bar {
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--border); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--pink), var(--blue));
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
}
.question-card {
  width: 100%; background: var(--card); border-radius: 20px;
  padding: 32px 28px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  animation: cardIn 0.5s cubic-bezier(0.4,0,0.2,1);
}
@keyframes cardIn {
  0% { opacity: 0; transform: translateY(30px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.question-label {
  font-size: 12px; font-weight: 700; color: var(--accent);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px;
}
.question-text {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(18px, 4vw, 22px); font-weight: 700;
  line-height: 1.6; margin-bottom: 28px; color: var(--fg);
}
.options { display: flex; flex-direction: column; gap: 12px; }
.option-btn {
  width: 100%; min-height: 48px; padding: 16px 20px;
  border: 2px solid var(--border); border-radius: 14px;
  background: var(--bg); color: var(--fg);
  font-size: 15px; font-family: 'Noto Sans SC', sans-serif;
  font-weight: 500; cursor: pointer; text-align: left;
  transition: all 0.3s; line-height: 1.5;
}
.option-btn:hover {
  border-color: var(--accent); background: var(--bg2);
  transform: translateX(4px);
}
.option-btn:active {
  transform: translateX(2px) scale(0.99);
  border-color: var(--accent); background: var(--bg2);
}
.option-btn.multi-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255,136,153,0.1), rgba(119,153,204,0.1));
  box-shadow: 0 2px 12px rgba(232,101,74,0.2);
}
.option-btn.multi-selected::before {
  content: '✓ ';
  color: var(--accent);
  font-weight: 700;
}
.option-btn.disabled {
  pointer-events: none; opacity: 0.5;
}

/* ===== Confirm Button ===== */
.confirm-btn {
  width: 100%; margin-top: 16px; padding: 14px 24px;
  border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  cursor: pointer;
  background: linear-gradient(135deg, var(--pink), var(--accent));
  color: #fff;
  box-shadow: 0 4px 20px rgba(232,101,74,0.3);
  transition: all 0.3s;
}
.confirm-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(232,101,74,0.4);
}
.confirm-btn:active:not(:disabled) {
  transform: translateY(0);
}
.confirm-btn:disabled {
  background: var(--border);
  color: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ===== Result Page ===== */
.result-card {
  width: 100%; background: var(--card); border-radius: 24px;
  padding: 40px 28px; box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); text-align: center;
  animation: cardIn 0.6s cubic-bezier(0.4,0,0.2,1);
}
.result-ribbon {
  display: inline-block; padding: 4px 16px; border-radius: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-bottom: 20px;
}
.result-ribbon.love-ribbon { background: rgba(255,136,153,0.15); color: #D4566A; }
.result-ribbon.saki-ribbon { background: rgba(119,153,204,0.15); color: #4A7AB5; }
.result-ribbon.even-ribbon { background: rgba(232,101,74,0.15); color: var(--accent); }
.result-ribbon.dual0-ribbon {
  background: linear-gradient(135deg, rgba(255,179,193,0.15), rgba(168,200,232,0.15));
  color: var(--muted);
}
.result-type {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(28px, 6vw, 40px); font-weight: 900;
  margin-bottom: 6px; line-height: 1.3;
}
.result-type .pink { color: var(--pink); }
.result-type .blue { color: var(--blue); }
.result-type .accent { color: var(--accent); }
.result-type .pink-soft { color: var(--pink-soft); }
.result-type .blue-soft { color: var(--blue-soft); }
.result-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.result-bar-wrap { margin: 24px 0 8px; }
.result-bar-labels {
  display: flex; justify-content: space-between;
  font-size: 13px; font-weight: 700; margin-bottom: 8px;
}
.result-bar-labels .lb-pink { color: var(--pink); }
.result-bar-labels .lb-blue { color: var(--blue); }
.result-bar {
  width: 100%; height: 16px; border-radius: 8px;
  background: var(--border); overflow: hidden; display: flex;
}
.result-bar .seg-pink {
  background: linear-gradient(90deg, #FF8899, #FFB3C1);
  height: 100%; border-radius: 8px 0 0 8px;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.result-bar .seg-blue {
  background: linear-gradient(90deg, #A8C8E8, #7799CC);
  height: 100%; border-radius: 0 8px 8px 0;
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.result-pct {
  font-size: 13px; color: var(--muted); margin-top: 6px;
  display: flex; justify-content: space-between;
}
.result-desc {
  margin-top: 24px; font-size: 15px; line-height: 1.8;
  color: var(--fg2); text-align: left; padding: 20px;
  background: var(--bg); border-radius: 14px; border: 1px solid var(--border);
}
.result-detail-title {
  font-weight: 700; font-size: 13px; color: var(--muted);
  margin-top: 20px; margin-bottom: 8px; letter-spacing: 1px;
}
.result-breakdown {
  display: flex; flex-wrap: wrap; gap: 6px;
  justify-content: center; margin-bottom: 28px;
}
.bd-dot {
  width: 14px; height: 14px; border-radius: 50%;
  transition: transform 0.3s;
}
.bd-dot:hover { transform: scale(1.4); }
.bd-dot.pink-dot { background: var(--pink); }
.bd-dot.blue-dot { background: var(--blue); }
.bd-dot.neutral-dot { background: var(--muted); }
.bd-dot.an1-dot { background: var(--pink); }
.bd-dot.an0-dot { background: var(--pink-soft); }
.bd-dot.sk1-dot { background: var(--blue); }
.bd-dot.sk0-dot { background: var(--blue-soft); }

/* ===== Animations ===== */
.fade-out { animation: fadeOut 0.3s forwards; }
@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-20px); }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .container { padding: 50px 16px 30px; }
  .question-card { padding: 24px 20px; }
  .result-card { padding: 28px 20px; }
  .chars-preview { gap: 20px; }
  .char-card { width: 100px; }
  .char-avatar { width: 64px; height: 64px; }
}
