@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&display=swap');

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

:root {
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #0f0f12;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-elevated: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f0f0f2;
  --text-dim: rgba(240, 240, 242, 0.5);
  --accent: #F5B842;
  --accent-soft: rgba(245, 184, 66, 0.12);
  --accent-mid: rgba(245, 184, 66, 0.22);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.4);
  --success: #34d399;
  --danger: #f87171;
}

[data-theme="light"] {
  --bg: #f8f6f1;
  --surface: rgba(255, 255, 255, 0.6);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --surface-elevated: rgba(255, 255, 255, 0.7);
  --border: rgba(0, 0, 0, 0.06);
  --text: #1a1a1a;
  --text-dim: rgba(26, 26, 26, 0.45);
  --accent: #EF9F27;
  --accent-soft: rgba(239, 159, 39, 0.1);
  --accent-mid: rgba(239, 159, 39, 0.2);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.12);
  --success: #059669;
  --danger: #dc2626;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection {
  background: var(--accent-mid);
  color: var(--text);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ── Background Layer ── */

.bg-layer {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: -2;
  transition: background 0.4s ease;
}

.bg-layer::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, var(--accent-soft) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 90% 100%, var(--accent-soft) 0%, transparent 50%);
  opacity: 0.6;
  z-index: -1;
  transition: opacity 0.4s ease;
}

.bg-layer::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

/* ── Background Blobs ── */

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

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
}

.blob-1 {
  width: 500px; height: 500px;
  top: -150px; right: -100px;
  background: linear-gradient(135deg, var(--accent), var(--accent-mid));
  animation: blobFloat1 25s ease-in-out infinite;
}

.blob-2 {
  width: 400px; height: 400px;
  bottom: -100px; left: 5%;
  background: linear-gradient(135deg, #0d9488, #0f766e);
  animation: blobFloat2 30s ease-in-out infinite;
}

.blob-3 {
  width: 300px; height: 300px;
  top: 40%; left: 55%;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  animation: blobFloat3 20s ease-in-out infinite;
}

@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-60px, 100px) scale(1.1); }
  50% { transform: translate(40px, 60px) scale(0.9); }
  75% { transform: translate(-30px, -40px) scale(1.05); }
}

@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  30% { transform: translate(80px, -50px) scale(1.15); }
  60% { transform: translate(-40px, 60px) scale(0.85); }
  80% { transform: translate(50px, 30px) scale(1.1); }
}

@keyframes blobFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-50px, -70px) scale(0.9); }
  45% { transform: translate(60px, 40px) scale(1.2); }
  70% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ── Theme Toggle ── */

.theme-toggle {
  position: fixed;
  top: 24px; right: 24px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--surface-hover);
}

.theme-toggle svg {
  width: 22px; height: 22px;
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
  position: absolute;
  transition: opacity 0.3s, transform 0.3s;
}

.icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
.icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

[data-theme="dark"] .icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }

/* ── App Container ── */

#app-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 24px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* ── Page Transitions ── */

.page {
  display: none;
  flex-direction: column;
}

.page.active {
  display: flex;
  animation: pageIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.page.page-exit {
  display: flex;
  animation: pageOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

@keyframes pageOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* ── Welcome Page ── */

.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100%;
  padding: 8px 0;
}

.welcome-icon {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text);
  margin: 16px 0 8px;
}

.welcome-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.info-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
}

.feature-list li + li {
  border-top: 1px solid var(--border);
}

.fi {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  background: var(--accent-soft);
  color: var(--accent);
}

.ft {
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.fd {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 2px;
  text-align: left;
}

/* ── Buttons ── */

.btn-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 40px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: #000;
  background: var(--accent);
  border: none;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
  box-shadow: var(--shadow);
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  opacity: 0.9;
}

.btn-start:active { transform: translateY(0); }

.btn-nav {
  flex: 1;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-back {
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-back:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
  color: var(--text);
}

.btn-next {
  color: #000;
  background: var(--accent);
  box-shadow: var(--shadow);
}

.btn-next:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  opacity: 0.9;
}

.btn-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-submit {
  color: #000;
  background: var(--success);
  box-shadow: var(--shadow);
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  opacity: 0.9;
}

.btn-submit:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-share {
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: #000;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: transform 0.3s, box-shadow 0.3s, opacity 0.3s;
  box-shadow: var(--shadow);
}

.btn-share:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  opacity: 0.9;
}

.btn-restart {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}

.btn-restart:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
  color: var(--text);
}

/* ── Quiz Page ── */

.quiz-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.dim-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  background: var(--accent-soft);
  color: var(--accent);
}

/* ── Progress Ring ── */

.progress-ring {
  width: 44px; height: 44px;
  position: relative;
  flex-shrink: 0;
}

.progress-ring svg {
  transform: rotate(-90deg);
  width: 100%; height: 100%;
}

.progress-ring circle {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
}

.progress-ring .track { stroke: var(--border); }

.progress-ring .fill {
  stroke: var(--accent);
  transition: stroke-dashoffset 0.5s ease-out;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text-dim);
}

/* ── Question Area ── */

.question-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  padding: 4px 12px;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  min-height: 300px;
}

.question-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  will-change: transform, opacity;
}

.q-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.q-text {
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-weight: 500;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 28px;
}

.q-or {
  font-size: 12px;
  color: var(--text-dim);
  margin: 8px 0;
  font-weight: 500;
}

/* ── Choice Cards ── */

.choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-card {
  position: relative;
  padding: 18px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.choice-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.choice-card:active {
  transform: scale(0.97);
  transition-duration: 0.08s;
}

.choice-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow);
}

.choice-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--text-dim);
  transition: color 0.3s;
}

.choice-card.selected .choice-label { color: var(--accent); }

.choice-text {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text);
}

.choice-check {
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.choice-card.selected .choice-check {
  opacity: 1;
  transform: scale(1);
  background: var(--accent);
  color: #000;
}

/* ── Quiz Slider ── */

.slider-wrap {
  margin-top: 6px;
  padding: 0 4px;
}

.slider-track {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
}

.slider-track input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  position: relative;
  z-index: 2;
  touch-action: none;
}

.slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  border: 3px solid var(--bg);
}

.slider-track input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 16px rgba(245, 184, 66, 0.35);
}

.slider-track input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.2);
  box-shadow: 0 4px 20px rgba(245, 184, 66, 0.45);
}

.slider-track input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  border: 3px solid var(--bg);
}

.slider-track input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.2);
  box-shadow: 0 4px 20px rgba(245, 184, 66, 0.45);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.slider-labels span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.15s;
}

.slider-labels span.active {
  color: var(--accent);
  font-weight: 600;
}

.slider-value {
  text-align: center;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  height: 18px;
}

/* ── Quiz Nav ── */

.quiz-nav {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  margin-top: auto;
}

/* ── Swipe Hint ── */

.swipe-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 0 2px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.5;
  animation: hintPulse 2.5s ease-in-out infinite;
}

.swipe-hint-arrow {
  font-size: 13px;
  opacity: 0.6;
}

@media (hover: none) and (pointer: coarse) {
  .swipe-hint { display: flex; }
}

@keyframes hintPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.6; }
}

/* ── Question Slide Animation ── */

.slide-left-enter { opacity: 0; transform: translateX(40px); }
.slide-left-leave { opacity: 0; transform: translateX(-40px); }
.slide-right-enter { opacity: 0; transform: translateX(-40px); }
.slide-right-leave { opacity: 0; transform: translateX(40px); }

.question-content {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Result Page ── */

.result-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: clip;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: clip;
  padding: 0 4px 24px;
}

/* Poster Card */

.poster-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 8px 0 20px;
  animation: posterEnter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.poster-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-soft) 0%, transparent 50%, var(--accent-soft) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.poster-content {
  position: relative;
  padding: 32px 24px 28px;
  text-align: center;
}

.poster-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.poster-type {
  font-family: var(--font-display);
  font-size: clamp(3rem, 16vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  animation: numberPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.poster-name {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dim);
  margin: 4px 0 24px;
}

.poster-dims {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}

.poster-dim {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
}

.poster-dim-left,
.poster-dim-right {
  width: 20px;
  text-align: center;
  transition: color 0.3s;
}

.poster-dim-left.active,
.poster-dim-right.active { color: var(--accent); }

.poster-dim-left:not(.active),
.poster-dim-right:not(.active) {
  color: var(--text-dim);
  opacity: 0.5;
}

.poster-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface);
  overflow: hidden;
}

.poster-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 1s ease-out 0.3s;
}

.poster-dim-pct {
  font-size: 10px;
  color: var(--text-dim);
  width: 32px;
  text-align: right;
}

/* Trait Tags */

.traits-section { margin-bottom: 16px; }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.trait-tag {
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.2s;
}

.trait-tag:hover {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
  color: var(--accent);
}

/* Dimension Card (result) */

.dim-card { padding: 20px; }

.dim-row { padding: 14px 0; }

.dim-row + .dim-row {
  border-top: 1px solid var(--border);
}

.dim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.letter {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}

.letter.active {
  background: var(--accent);
  color: #000;
}

.letter.inactive {
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
}

.vs {
  font-size: 11px;
  color: var(--text-dim);
  margin: 0 4px;
}

.dim-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

.bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.8s ease-out;
}

.pct-row {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-display);
}

.pct-left { color: var(--accent); }
.pct-right { color: var(--text-dim); }

/* Tabs */

.tabs {
  display: flex;
  gap: 4px;
  margin: 20px 0 12px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.tab-btn.active {
  background: var(--accent);
  color: #000;
  box-shadow: 0 2px 8px rgba(245, 184, 66, 0.25);
}

.tab-btn:not(.active):hover {
  color: var(--text);
  background: var(--surface-hover);
}

.tab-content {
  min-height: 120px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tab-exit {
  opacity: 0;
  transform: translateY(-8px);
}

.tab-enter {
  animation: tabEnter 0.25s ease both;
}

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

.tab-card { padding: 20px; }

.tab-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
}

/* Glass Card */

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Compatible List */

.compatible-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.compatible-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.compatible-item:hover {
  border-color: var(--accent-mid);
  background: var(--accent-soft);
}

.compatible-type {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--accent);
  min-width: 48px;
}

.compatible-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
}

/* Interpretation Card */

.interp-card {
  padding: 20px;
  margin-top: 16px;
}

.interp-text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-dim);
}

/* Actions */

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

/* ── Footer ── */

.footer {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  padding: 14px 0 8px;
  line-height: 1.6;
}

.footer a {
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.3s;
}

.footer a:hover { color: var(--accent); }

/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  max-width: 360px;
  width: 100%;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s ease-out;
}

.modal-overlay.show .modal-box {
  transform: scale(1) translateY(0);
}

.modal-box h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-box p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.modal-buttons {
  display: flex;
  gap: 8px;
}

.modal-buttons button {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.modal-btn-cancel {
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.modal-btn-cancel:hover { background: var(--surface-hover); }

.modal-btn-confirm {
  background: var(--accent);
  color: #000;
  border: none;
}

.modal-btn-confirm:hover { opacity: 0.85; }

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  background: var(--accent);
  color: #000;
  box-shadow: var(--shadow);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ── Animations ── */

.fade-up { animation: fadeUp 0.4s ease-out both; }
.d1 { animation-delay: 0.08s; }
.d2 { animation-delay: 0.16s; }
.d3 { animation-delay: 0.24s; }
.d4 { animation-delay: 0.32s; }
.d5 { animation-delay: 0.40s; }

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

@keyframes posterEnter {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes numberPop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ── Responsive ── */

@media (max-width: 480px) {
  .btn-start {
    padding: 12px 32px;
    font-size: 15px;
  }

  .choice-card { padding: 14px 16px; }
  .choice-text { font-size: 13px; }

  .poster-content { padding: 24px 16px 20px; }
  .dim-card { padding: 16px; }
  .tabs { margin: 16px 0 10px; }
  .tab-btn { font-size: 11px; padding: 8px 4px; }

  .theme-toggle {
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    width: 40px; height: 40px;
  }

  .theme-toggle svg { width: 18px; height: 18px; }
}

@media (min-width: 768px) {
  .choices {
    flex-direction: row;
    gap: 14px;
  }

  .choices > * { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .blob { animation: none !important; }
  .swipe-hint { animation: none; }
}
