/* ======================================================
   WHAT % NPC ARE YOU?: Styles (April Fools Edition)
   ====================================================== */

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

:root {
  --bg: #fef9ef;
  --bg-card: #ffffff;
  --bg-card-hover: #fff7e6;
  --surface: #f0ebe0;
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --text: #2d2a24;
  --text-muted: #7a7568;
  --text-dim: #a8a193;
  --accent: #ff6b35;
  --accent-glow: rgba(255, 107, 53, 0.25);
  --accent-light: #ff8c5a;
  --accent-gradient: linear-gradient(135deg, #ff6b35 0%, #ff3ea5 50%, #a855f7 100%);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 4px 30px var(--accent-glow);
  --font: 'Fredoka', 'M PLUS Rounded 1c', 'Nunito', -apple-system, sans-serif;
  --font-display: 'DynaPuff', 'Fredoka', 'Mochiy Pop One', 'Nunito', -apple-system, sans-serif;
  --font-script: 'Mochiy Pop One', 'DynaPuff', 'Fredoka', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255, 107, 53, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(255, 62, 165, 0.04) 0%, transparent 50%);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  position: relative;
  min-height: 100vh;
}

/* ---------- Particle Canvas ---------- */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

/* ---------- Phase System ---------- */
.phase {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s;
  z-index: 1;
  overflow-y: auto;
}

.phase.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ---------- LANDING ---------- */
.landing-container {
  text-align: center;
  max-width: 640px;
}

.badge {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 100px;
  background: rgba(255, 107, 53, 0.12);
  border: 2px dashed rgba(255, 107, 53, 0.4);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 28px;
  animation: wiggle 3s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}

.landing-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 40px;
  font-weight: 500;
}

.landing-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 48px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.landing-disclaimer {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 40px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 6px 28px var(--accent-glow);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 40px var(--accent-glow);
}

.btn-primary:hover::before {
  opacity: 1;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  color: var(--accent);
}

/* ---------- QUESTIONS ---------- */
.questions-container {
  width: 100%;
  max-width: 600px;
}

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

.progress-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.progress-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface);
  border-radius: 100px;
  margin-bottom: 40px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 100px;
  transition: width 0.5s ease;
  width: 0%;
}

/* Question card */
.question-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
  animation: bounce-in 0.5s ease;
}

@keyframes bounce-in {
  0% { opacity: 0; transform: translateY(30px) scale(0.95); }
  60% { transform: translateY(-5px) scale(1.01); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-number {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 12px;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 28px;
  color: var(--text);
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.option-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateX(4px);
}

.option-btn.selected {
  background: rgba(255, 107, 53, 0.1);
  border-color: var(--accent);
  color: var(--text);
}

.option-indicator {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  flex-shrink: 0;
  transition: var(--transition);
  position: relative;
}

.option-btn.selected .option-indicator {
  border-color: var(--accent);
  background: var(--accent);
}

.option-btn.selected .option-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* Slider */
.slider-wrapper {
  margin-bottom: 28px;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--surface);
  border-radius: 100px;
  outline: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 12px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.2s;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-value {
  text-align: center;
  margin-top: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.question-nav {
  display: flex;
  justify-content: flex-end;
}

.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

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

/* ---------- PROCESSING ---------- */
.processing-container {
  background: linear-gradient(180deg, #fffaf1 0%, #ffeed6 100%);
  border: 2px solid rgba(255, 107, 53, 0.25);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 30px rgba(255, 107, 53, 0.15);
  padding: 28px 24px;
  width: min(560px, 100%);
  min-height: 640px;
  display: flex;
  flex-direction: column;
  text-align: center;
  max-width: 560px;
}

.processing-icon {
  margin-bottom: 24px;
}

.spinner {
  width: 66px;
  height: 66px;
  border: 6px solid #ffd8ae;
  border-top-color: #ff6b35;
  border-right-color: #ff3ea5;
  border-left-color: #a855f7;
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
  margin: 0 auto;
  box-shadow: 0 8px 18px rgba(255, 107, 53, 0.2);
}

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

.processing-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
  font-weight: 700;
  color: #3d2819;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  transition: opacity 0.4s;
  line-height: 1.2;
  text-wrap: balance;
}

.processing-sub {
  font-size: 0.95rem;
  color: var(--text-muted);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-weight: 600;
  text-wrap: balance;
}

.processing-bar-track {
  width: 100%;
  height: 14px;
  background: #ffe6c8;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.processing-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: 100px;
  transition: width 0.3s ease;
}

.processing-details {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 107, 53, 0.18);
  border-radius: var(--radius-md);
  min-height: 240px;
  padding: 10px 12px;
  text-align: left;
}

.detail-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.3s;
  font-weight: 600;
}

.detail-line.active-step {
  color: var(--text);
}

.detail-line.completed-step {
  color: var(--success);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: background 0.3s;
}

#processing-joke {
  font-family: var(--font-script);
  color: #8f4d2e;
  font-size: 1rem;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 14px;
  text-wrap: balance;
}

.dot.active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.dot.completed {
  background: var(--success);
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px var(--accent-glow); transform: scale(1); }
  50% { box-shadow: 0 0 18px var(--accent-glow); transform: scale(1.3); }
}

/* ---------- CAPTCHA ---------- */
.captcha-container {
  width: 100%;
  max-width: 560px;
}

.captcha-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.captcha-icon {
  width: 52px;
  height: 52px;
  background: rgba(255, 107, 53, 0.1);
  border: 2px solid rgba(255, 107, 53, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.captcha-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.captcha-sub {
  font-size: 0.88rem;
  color: #8a5d40;
}

.captcha-frame-wrapper {
  width: 100%;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255, 247, 233, 0.92) 0%, rgba(255, 238, 215, 0.85) 100%);
  border: 2px solid rgba(255, 107, 53, 0.24);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
  display: flex;
  align-items: stretch;
}

.captcha-frame-wrapper > .captcha-game {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100%;
}

.captcha-stage {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  height: auto;
  flex: 1;
  padding: 22px;
  background: linear-gradient(180deg, rgba(255, 250, 238, 0.98) 0%, rgba(255, 241, 224, 0.9) 100%);
}

.captcha-panel {
  width: min(100%, 520px);
  background: var(--bg-card);
  border: 2px solid rgba(255, 107, 53, 0.23);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.14);
}

.checkbox-panel {
  width: min(100%, 360px);
  min-height: 84px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  user-select: none;
  transition: box-shadow 0.2s, transform 0.2s;
}

.checkbox-panel:hover {
  transform: translateY(-1px);
}

.checkbox-indicator {
  width: 30px;
  height: 30px;
  border: 2px solid #e3a577;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffaf5;
  flex-shrink: 0;
  transition: all 0.3s;
}

.checkbox-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #ffd7b7;
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.checkbox-label {
  flex: 1;
  font-family: var(--font);
  font-size: 0.95rem;
  color: #603c29;
  font-weight: 600;
}

.checkbox-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.checkbox-brand span {
  font-family: var(--font);
  font-size: 0.45rem;
  color: #b36d46;
  letter-spacing: 0.5px;
}

.phrase-panel {
  padding: 16px;
}

.phrase-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: #c2693b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.phrase-sub {
  margin-top: 8px;
  font-family: var(--font);
  font-size: 0.94rem;
  color: #6e412d;
  line-height: 1.45;
}

.phrase-target {
  margin-top: 12px;
  background: #fff3e5;
  border: 1px dashed #eeaf80;
  border-radius: 10px;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  color: #6f3f2b;
  word-break: break-word;
}

.phrase-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.phrase-input {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid #e4af86;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.92rem;
  color: #5c3824;
  background: #fffaf4;
}

.phrase-input:focus {
  outline: none;
  border-color: rgba(255, 107, 53, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.16);
}

.phrase-btn {
  padding: 10px 14px;
  border: 2px solid rgba(255, 107, 53, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #ffeed9 100%);
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  color: #6a3f29;
}

.phrase-btn:hover {
  border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.16);
}

.phrase-status {
  margin-top: 10px;
  min-height: 22px;
  font-family: var(--font);
  font-size: 0.84rem;
  color: #8a5637;
}

.phrase-meta {
  margin-top: 8px;
  font-family: var(--font);
  font-size: 0.78rem;
  color: #9a6648;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phrase-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #e28f60;
  display: inline-block;
}

.captcha-container.tetris-mode {
  max-width: 1120px;
}

.captcha-container.checkbox-mode .captcha-frame-wrapper {
  min-height: 180px;
}

.captcha-container.phrase-mode .captcha-frame-wrapper {
  min-height: 0;
}

.captcha-container.tetris-mode .captcha-header {
  margin-bottom: 14px;
}

.captcha-container.tetris-mode .captcha-frame-wrapper {
  min-height: 560px;
}

.tetris-captcha {
  height: 100%;
  border-radius: var(--radius-lg);
  border: 2px solid rgba(255, 107, 53, 0.28);
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 107, 53, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 88% 15%, rgba(168, 85, 247, 0.09) 0%, transparent 36%),
    linear-gradient(180deg, rgba(255, 250, 238, 0.99) 0%, rgba(255, 241, 224, 0.96) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.tetris-captcha-head {
  text-align: center;
}

.tetris-goal-strip {
  width: min(720px, 100%);
  background: linear-gradient(180deg, rgba(255, 249, 238, 0.98) 0%, rgba(255, 242, 224, 0.98) 100%);
  border: 2px solid rgba(255, 107, 53, 0.33);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(255, 107, 53, 0.12);
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px 12px;
}

.tetris-captcha-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  color: #402716;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.01em;
}

.tetris-captcha-sub {
  font-family: var(--font-script);
  font-size: 0.9rem;
  color: #956747;
  margin-top: 4px;
}

.tetris-captcha-layout {
  width: 100%;
  max-width: 720px;
  display: flex;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
  flex-wrap: nowrap;
}

.tetris-canvas-shell {
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 20px;
  background: linear-gradient(145deg, #ff8f6b, #ff6b35 42%, #d74fb4 100%);
  border: 2px solid rgba(255, 180, 130, 0.82);
  box-shadow: 0 14px 28px rgba(211, 86, 49, 0.28);
}

.tetris-canvas {
  display: block;
  width: min(58vw, 460px);
  max-width: 460px;
  height: auto;
  border-radius: 12px;
  border: 2px solid rgba(255, 225, 195, 0.88);
  background: #0e1728;
}

.tetris-side-label {
  font-family: var(--font-script);
  font-size: 0.95rem;
  color: var(--accent);
  line-height: 1;
}

.tetris-side-goal {
  font-family: var(--font-display);
  font-size: 1.95rem;
  line-height: 1;
  font-weight: 800;
  color: #2f261f;
}

.tetris-side-goal-sub {
  font-size: 0.86rem;
  color: #996545;
}

.tetris-status {
  min-height: 0;
  font-size: 0.82rem;
  color: #87563a;
  line-height: 1.35;
  grid-column: 1 / -1;
}

.tetris-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.tetris-btn {
  padding: 8px 12px;
  border: 2px solid rgba(255, 107, 53, 0.34);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #ffeed9 100%);
  color: #5d341f;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.tetris-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.18);
}

.tetris-touch-controls {
  display: none;
  width: min(720px, 100%);
}

.tetris-touch-btn {
  min-height: 40px;
  padding: 8px 8px;
  border: 2px solid rgba(255, 107, 53, 0.32);
  border-radius: 11px;
  background: linear-gradient(180deg, #fffdf8 0%, #ffeed8 100%);
  color: #5c341f;
  font-family: var(--font);
  font-size: 0.68rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: var(--transition);
}

.tetris-touch-btn:hover {
  border-color: rgba(255, 107, 53, 0.5);
  box-shadow: 0 5px 14px rgba(255, 107, 53, 0.18);
}

.tetris-touch-btn:active {
  transform: translateY(1px) scale(0.98);
}

.tetris-touch-btn-place {
  background: linear-gradient(180deg, #ffbca0 0%, #ff8f60 100%);
  color: #3e2112;
}

.tetris-legend {
  margin-top: 2px;
  display: grid;
  width: min(720px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tetris-legend-item {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #7f543a;
  background: #fff8ee;
  border: 1px solid rgba(255, 107, 53, 0.26);
  border-radius: 9px;
  padding: 5px 7px;
  line-height: 1.2;
}

.tetris-legend-item kbd {
  font-family: var(--font-display);
  font-size: 0.66rem;
  line-height: 1;
  color: #5a311d;
  background: #fff4e7;
  border: 1px solid rgba(255, 107, 53, 0.2);
  border-radius: 7px;
  padding: 4px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 88px;
  text-align: center;
}

.tetris-legend-item span {
  color: #7a4f35;
}

.captcha-note {
  font-size: 0.78rem;
  color: #9b6a49;
  text-align: center;
  font-weight: 500;
}

/* ---------- RESULT ---------- */
.result-container {
  text-align: center;
  max-width: 560px;
  animation: bounce-in 0.8s ease;
  margin: auto;
  padding: 40px 0;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.result-badge {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 100px;
  background: rgba(34, 197, 94, 0.1);
  border: 2px dashed rgba(34, 197, 94, 0.4);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 32px;
  animation: wiggle 2s ease-in-out infinite;
}

/* Circular progress */
.result-circle-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 28px;
}

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

.result-circle-bg {
  fill: none;
  stroke: var(--surface);
  stroke-width: 10;
}

.result-circle-fg {
  fill: none;
  stroke: url(#circle-gradient);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 534;
  stroke-dashoffset: 534;
  transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.result-percent-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.result-percent-num {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-percent-sign {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-muted);
  align-self: center;
  margin-left: 2px;
}

.result-label {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
  font-weight: 500;
}

/* Trait cards */
.result-traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 32px;
}

.trait-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  animation: bounce-in 0.5s ease;
  animation-fill-mode: backwards;
  transition: var(--transition);
}

.trait-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.trait-card:nth-child(1) { animation-delay: 0.1s; }
.trait-card:nth-child(2) { animation-delay: 0.2s; }
.trait-card:nth-child(3) { animation-delay: 0.3s; }
.trait-card:nth-child(4) { animation-delay: 0.4s; }

.trait-icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.trait-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 4px;
}

.trait-value {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

/* Confidence */
.result-confidence {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 32px;
}

.confidence-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-weight: 600;
}

.confidence-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 100px;
  overflow: hidden;
}

.confidence-bar-fill {
  height: 100%;
  background: var(--success);
  border-radius: 100px;
  width: 0%;
  transition: width 1.5s ease;
}

.confidence-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}

/* Actions */
.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.result-footer {
  font-size: 1rem;
  color: var(--text-muted);
  opacity: 0;
  animation: fade-in-late 1s ease 2s forwards;
  font-weight: 600;
}

.result-credit {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 10px;
  opacity: 0;
  animation: fade-in-late 1s ease 2.4s forwards;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@keyframes fade-in-late {
  to { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .phase {
    padding: 12px;
  }

  .landing-subtitle {
    font-size: 0.98rem;
    margin-bottom: 28px;
  }

  .questions-container {
    max-width: 100%;
  }

  .question-card {
    padding: 24px 16px;
    border-radius: 18px;
  }

  .question-text {
    font-size: 1.05rem;
    margin-bottom: 20px;
  }

  .option-btn {
    padding: 12px 12px;
    gap: 10px;
    font-size: 0.9rem;
  }

  .question-nav {
    justify-content: center;
  }

  .btn-next {
    width: 100%;
    justify-content: center;
  }

  .landing-stats {
    flex-direction: column;
    gap: 16px;
  }

  .result-traits {
    grid-template-columns: 1fr;
  }

  .captcha-container.checkbox-mode .captcha-frame-wrapper {
    min-height: 200px;
  }

  .captcha-header {
    gap: 10px;
    margin-bottom: 14px;
  }

  .captcha-icon {
    width: 44px;
    height: 44px;
  }

  .captcha-title {
    font-size: 1.03rem;
  }

  .captcha-sub {
    font-size: 0.8rem;
  }

  .captcha-stage {
    padding: 14px;
  }

  .phrase-row {
    align-items: stretch;
  }

  .phrase-input {
    min-width: 0;
    width: 100%;
  }

  .phrase-btn {
    width: 100%;
    justify-content: center;
  }

  .captcha-container.tetris-mode .captcha-frame-wrapper {
    min-height: 0;
  }

  .tetris-canvas {
    width: min(78vw, 340px) !important;
  }

  .processing-container {
    min-height: 620px;
    padding: 20px 14px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn-primary,
  .result-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

}

@media (max-width: 980px) {
  .captcha-container.tetris-mode {
    max-width: 760px;
  }

  .captcha-container.tetris-mode .captcha-frame-wrapper {
    min-height: 0;
  }

  .tetris-captcha-layout {
    flex-wrap: wrap;
  }

  .tetris-captcha-sub {
    display: none;
  }

  .tetris-goal-strip {
    width: min(560px, 100%);
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tetris-legend {
    display: none;
  }

  .tetris-touch-controls {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    position: static;
  }

  .tetris-touch-btn-place {
    grid-column: auto;
  }

  .tetris-canvas {
    width: min(92vw, 460px);
  }
}

@media (max-width: 600px) {
  .tetris-goal-strip {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 11px;
  }

  .tetris-touch-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #tetris-touch-place {
    grid-column: 1 / -1;
  }
}

/* Hidden skip zone, bottom-right corner */
#skip-zone {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 48px;
  height: 48px;
  z-index: 999;
  cursor: default;
  opacity: 0;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 8px;
  z-index: 2;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  pointer-events: none;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  pointer-events: auto;
}

.site-footer a:hover {
  text-decoration: underline;
}
