/* ============================================================
   심테 (SIMTE · simte.site) 디자인 시스템 — 다꾸 스티커북
   "문방구에서 산 스티커팩을 다이어리에 붙이는 기분"
   - 밝은 우유빛 종이 + 도트 노트 질감
   - 다이컷 스티커 카드 (잉크 아웃라인 + 흰 테두리 + 하드 섀도)
   - 마스킹테이프 마퀴, 형광펜 하이라이트
   ============================================================ */

/* ---------- 1. 전역 토큰 ---------- */
:root {
  --bg-0: #FFF7EA;        /* 종이: 우유빛 웜 화이트 */
  --bg-1: #FFFFFF;        /* 스티커 표면 */
  --bg-2: #F6ECDA;        /* 소프트 면 (썸네일·트랙) */
  --ink: #2A2140;         /* 잉크 (bg-0 대비 ≈12:1) */
  --ink-dim: #6A6082;     /* 보조 텍스트 (≈5:1) */
  --line: rgba(42, 33, 64, .22);

  /* 캔디 팔레트: 스티커 배경용(밝음) / 텍스트용(진함) / 파스텔 면 */
  --lime: #B7EC3E;   --lime-text: #4D7A00;   --lime-soft: #F0FAD4;
  --pink: #FF9CC7;   --pink-text: #D02F78;   --pink-soft: #FFE9F4;
  --cyan: #7BE0EF;   --cyan-text: #0B7C97;   --cyan-soft: #E1F7FB;
  --violet: #C9B9F6; --violet-text: #6B46D6; --violet-soft: #EFEAFD;

  /* 스티커 배경 위 글자는 항상 잉크 */
  --lime-ink: var(--ink);
  --pink-ink: var(--ink);
  --cyan-ink: var(--ink);

  --shadow-pop: 3px 4px 0 rgba(42, 33, 64, .9);

  /* 기본 테마 (테스트별 data-theme으로 덮어씀) */
  --theme: var(--violet);
  --theme-ink: var(--ink);
  --theme-text: var(--violet-text);
  --theme-soft: var(--violet-soft);
}

/* 테스트별 서브 테마 */
[data-theme="lime"] {
  --theme: var(--lime);
  --theme-ink: var(--ink);
  --theme-text: var(--lime-text);
  --theme-soft: var(--lime-soft);
}
[data-theme="pink"] {
  --theme: var(--pink);
  --theme-ink: var(--ink);
  --theme-text: var(--pink-text);
  --theme-soft: var(--pink-soft);
}
[data-theme="cyan"] {
  --theme: var(--cyan);
  --theme-ink: var(--ink);
  --theme-text: var(--cyan-text);
  --theme-soft: var(--cyan-soft);
}
[data-theme="violet"] {
  --theme: var(--violet);
  --theme-ink: var(--ink);
  --theme-text: var(--violet-text);
  --theme-soft: var(--violet-soft);
}

/* ---------- 2. @font-face (self-host) ---------- */
@font-face {
  font-family: 'Paperlogy';
  src: url('../fonts/Paperlogy-7Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Paperlogy';
  src: url('../fonts/Paperlogy-8ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Pretendard Variable';
  src: url('../fonts/PretendardVariable.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 3. 바디·글로벌 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Pretendard Variable', 'Pretendard', -apple-system, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  /* 한국어 자연 줄바꿈: 단어 중간에서 끊지 않음 (긴 URL 등은 break-word 폴백) */
  word-break: keep-all;
  overflow-wrap: break-word;
  color: var(--ink);
  background-color: var(--bg-0);
  /* 도트 노트 질감 */
  background-image: radial-gradient(rgba(42, 33, 64, .07) 1.1px, transparent 1.1px);
  background-size: 18px 18px;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* 장식 요소(마퀴 scale/rotate·데코 스티커 음수 offset)가 화면 밖으로 삐져나와
   documentElement.scrollWidth를 넘기는 것 차단. body의 overflow-x는 뷰포트로
   전파돼 root scrollWidth를 못 줄이므로, 전파 대상이 아닌 main에서 clip한다.
   clip은 반대축(overflow-y)을 auto로 강제하지 않아 세로 스크롤은 그대로. */
main { overflow-x: clip; }

/* (구) 네온 글로우 데코 — 스티커북에선 미사용 */
.bg-glow { display: none; }

/* hidden 속성은 어떤 display 규칙보다 우선 (inline-flex 버튼 등) */
[hidden] { display: none !important; }

img, svg, video { max-width: 100%; height: auto; }

/* 인라인 아이콘 (Iconify 베이크) — 부모 font-size로 스케일 */
svg.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -.125em;
  flex: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- 4. 타이포그래피 ---------- */
.hero-title {
  font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 3.5rem);
  letter-spacing: -0.02em;
  line-height: 1.18;
  text-wrap: balance;
  margin: 0;
}

.type-name {
  font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
  font-weight: 800;
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.22;
  text-wrap: balance;
  color: var(--theme-text);
  margin: 0;
}

.question-text {
  font-weight: 800;
  font-size: clamp(1.25rem, 5.5vw, 1.75rem);
  line-height: 1.35;
  text-wrap: balance;
  margin: 0;
}

.section-title {
  font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
  font-weight: 700;
  font-size: clamp(1.25rem, 5vw, 1.7rem);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.section-title__icon {
  flex: none;
  color: var(--theme-text);
}

.body-text {
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.text-dim { color: var(--ink-dim); }

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .02em;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1.4;
}

.badge--theme {
  background: var(--theme);
  color: var(--theme-ink);
  border: 1.5px solid var(--ink);
}

.badge--outline {
  background: var(--bg-1);
  color: var(--ink-dim);
  border: 1.5px solid var(--line);
}

/* 형광펜 하이라이트 (구 아웃라인 헤드라인) */
.outline-text {
  color: inherit;
  background-image: linear-gradient(transparent 56%, var(--lime) 56%, var(--lime) 94%, transparent 94%);
  padding: 0 .06em;
}

/* ---------- 5. 레이아웃·컨테이너 ---------- */
main {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.container {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.container--narrow {
  width: min(100%, 520px);
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.hero {
  padding-top: calc(48px + env(safe-area-inset-top));
  text-align: center;
}

/* 핫 카드: 데스크톱에서 과대 확장 방지 */
#hot-card .card {
  width: min(100%, 560px);
  margin-inline: auto;
}

/* ---------- 6. 그리드 (1→2→3열) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 7. 카드 = 다이컷 스티커 ---------- */
.card {
  display: block;
  background: var(--bg-1);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 16px;
  /* 흰 테두리(다이컷 림) + 잉크 오프셋 섀도 */
  box-shadow: 0 0 0 4px var(--bg-1), 5px 7px 0 rgba(42, 33, 64, .18);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 150ms ease-out, border-color 150ms ease-out, background-color 150ms ease-out;
}

/* 스티커 느낌: 카드마다 살짝 다른 회전 */
.card-grid .card:nth-child(3n+1) { transform: rotate(-1deg); }
.card-grid .card:nth-child(3n+2) { transform: rotate(.6deg); }
.card-grid .card:nth-child(3n)   { transform: rotate(-0.4deg); }

.card:hover {
  border-color: var(--theme-text);
  box-shadow: 0 0 0 4px var(--bg-1), 6px 9px 0 rgba(42, 33, 64, .22);
}

.card:active {
  transform: scale(.97) rotate(0deg);
  box-shadow: 0 0 0 4px var(--bg-1), 2px 3px 0 rgba(42, 33, 64, .2);
}

.card__thumb {
  aspect-ratio: 4 / 3;
  background: var(--bg-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__title {
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.35;
  margin: 0 0 8px;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .8125rem;
  color: var(--ink-dim);
}

/* ---------- 8. 버튼 = 캔디 청키 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 16px;
  transition: transform 100ms ease-out, box-shadow 100ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out;
}

/* CTA (시작·공유) */
.btn--cta {
  height: 56px;
  padding: 0 28px;
  background: var(--theme);
  color: var(--theme-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pop);
}

.btn--cta:active {
  transform: translate(2px, 3px);
  box-shadow: 1px 1px 0 rgba(42, 33, 64, .9);
}

/* 보조 (다시하기·다른 테스트) */
.btn--ghost {
  height: 48px;
  padding: 0 20px;
  background: var(--bg-1);
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--theme-text);
  color: var(--theme-text);
}

.btn--block {
  width: 100%;
}

/* ---------- 9. 진행바 ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--bg-2);
  border-bottom: 1.5px solid var(--line);
  z-index: 100;
  padding-top: env(safe-area-inset-top);
}

.progress__fill {
  height: 100%;
  width: 0%;
  background: var(--theme);
  transition: width 300ms ease-out;
}

.progress__label {
  position: fixed;
  top: calc(18px + env(safe-area-inset-top));
  right: 16px;
  z-index: 101;
  font-weight: 700;
  font-size: .8125rem;
  color: var(--ink-dim);
  background: var(--bg-1);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ---------- 10. 문항 화면 ---------- */
.question-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--theme);
  color: var(--theme-ink);
  border: 2px solid var(--ink);
  border-radius: 12px;
  transform: rotate(-8deg);
  box-shadow: var(--shadow-pop);
  font-weight: 700;
  font-size: .875rem;
  margin-bottom: 16px;
}

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

.choice {
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  background: var(--bg-1);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  text-align: left;
  transition: transform 100ms ease-out, border-color 150ms ease-out, background-color 150ms ease-out, color 150ms ease-out, box-shadow 150ms ease-out;
}

.choice:hover {
  border-color: var(--theme-text);
}

.choice:active {
  transform: scale(.98);
}

.choice.selected {
  background: var(--theme);
  color: var(--theme-ink);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-pop);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  margin-top: 20px;
  /* 종이 배경을 명시해 대비를 실제 배경(bg-0) 기준으로 확보 — 4.5:1 요건 */
  background: var(--bg-0);
  border: none;
  color: #453B63; /* ink-dim보다 진한 잉크 톤: bg-0 위 대비 ≈9.6:1 */
  font-weight: 700;
  font-size: .875rem;
}

.btn-back:hover { color: var(--theme-text); }

/* ---------- 11. 결과 카드 = 포토카드 (9:16 캡처 존) ---------- */
.result-card {
  width: min(100%, 320px);
  margin: 18px auto 0;
  aspect-ratio: 9 / 16;
  background: var(--bg-1);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 0 0 4px var(--bg-1), 6px 8px 0 rgba(42, 33, 64, .18);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  position: relative;
}

/* 마스킹테이프 조각 (포토카드 상단) */
.result-card::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 28px;
  transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--theme) 55%, #FFFFFF);
  opacity: .9;
  border-left: 2px dashed rgba(255, 255, 255, .8);
  border-right: 2px dashed rgba(255, 255, 255, .8);
  border-radius: 3px;
}

.result-card__emoji {
  font-size: 4.5rem;
  line-height: 1;
}

/* 유형 일러스트 (포토카드 메인 아트) */
.result-card__art {
  width: min(62%, 180px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  transform: rotate(-2deg);
}

/* 궁합 카드 소형 아트 */
.match-card__img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  display: block;
  margin: 0 auto 8px;
}

.result-card__summary {
  font-weight: 700;
  font-size: .9375rem;
  color: var(--ink);
  text-wrap: pretty;
  margin: 0;
}

.result-card__traits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.result-card__watermark {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--ink-dim);
}

/* 궁합 카드 */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.match-card {
  background: var(--bg-1);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}

/* ---------- 12. 마퀴 = 마스킹테이프 ---------- */
.marquee {
  background: var(--theme-soft);
  color: var(--ink);
  overflow: hidden;
  padding: 8px 0;
  font-weight: 800;
  font-size: .875rem;
  letter-spacing: .04em;
  border-top: 1.5px dashed rgba(42, 33, 64, .35);
  border-bottom: 1.5px dashed rgba(42, 33, 64, .35);
  transform: rotate(-1.2deg) scale(1.03);
}

.marquee-content {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
}

/* 콘텐츠 4반복 기준: -50%(=2반복) 이동 시 이음새 없이 루프 */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- 13. 스타버스트 ---------- */
.starburst {
  display: inline-block;
  color: var(--theme);
  animation: spin 8s linear infinite;
}

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

/* ---------- 14. 로고 = 스티커 칩 ---------- */
.chrome-logo {
  display: inline-block;
  font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  background: var(--pink);
  border: 2.5px solid var(--ink);
  border-radius: .35em;
  padding: .04em .28em .01em;
  transform: rotate(-2.5deg);
  box-shadow: 0 0 0 5px var(--bg-1), var(--shadow-pop);
}

/* ---------- 15. 스태거 리빌 ---------- */
@keyframes stagger-fade {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

.stagger {
  opacity: 0;
  animation: stagger-fade 600ms ease-out forwards;
  animation-delay: var(--delay, 0ms);
}

/* 로고 스티커는 회전 유지한 채 리빌 */
.chrome-logo.stagger {
  animation-name: stagger-fade-logo;
}

@keyframes stagger-fade-logo {
  0%   { opacity: 0; transform: rotate(-2.5deg) translateY(14px); }
  100% { opacity: 1; transform: rotate(-2.5deg) translateY(0); }
}

/* 결과 유형명 pop-in */
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(.9); }
  100% { opacity: 1; transform: scale(1); }
}

.pop-in {
  animation: pop-in 400ms ease-out both;
}

/* ---------- 16. 문항 전환 (페이드+슬라이드) ---------- */
@keyframes question-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-12px); }
}

@keyframes question-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.question-leaving {
  animation: question-out 120ms ease-out forwards;
}

.question-entering {
  animation: question-in 200ms ease-out both;
}

/* ---------- 17. 체커보드 스트립 ---------- */
.checker-strip {
  height: 8px;
  background: repeating-conic-gradient(var(--theme) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
  opacity: .5;
}

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

  html { scroll-behavior: auto; }

  .marquee-content { animation: none; }
  .starburst { animation: none; }
  .progress__fill { transition: none; }

  /* 전역 클릭 이펙트 비활성 (fx.js도 JS 측에서 no-op) */
  .fx-squish { animation: none; }
  .tap-spark { animation: none; display: none; }

  /* 컨페티 canvas 숨김 */
  #confetti-canvas { display: none !important; }
}

/* ---------- 19. :focus-visible 전역 ---------- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--theme-text);
  outline-offset: 2px;
}

/* ---------- 20. 유틸 ---------- */
.stack-8  > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }

.footer {
  margin-top: auto;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: .8125rem;
  color: var(--ink-dim);
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 12px;
  font-weight: 700;
}

.footer-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.footer-nav a:hover { color: var(--theme-text); }

/* ============================================================
   21. 인터랙티브 업그레이드 (데코·티커·룰렛·도감·리포트)
   ============================================================ */

/* ---------- 떠다니는 데코 스티커 ---------- */
.deco-host { position: relative; }

.deco-sticker {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  opacity: .85;
  animation: deco-float 5s ease-in-out infinite alternate;
}

.deco-sticker--slow { animation-duration: 7.5s; }

@keyframes deco-float {
  from { transform: translateY(0) rotate(var(--rot, 0deg)); }
  to   { transform: translateY(-9px) rotate(calc(var(--rot, 0deg) + 7deg)); }
}

/* ---------- LIVE 티커 ---------- */
.live-ticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  background: var(--bg-1);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px 5px 10px;
  box-shadow: 2px 3px 0 rgba(42, 33, 64, .25);
  font-size: .8125rem;
  font-weight: 700;
}

.live-ticker__label {
  color: #E03131;
  font-weight: 800;
  font-size: .6875rem;
  letter-spacing: .1em;
}

.live-ticker__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF4D4D;
  flex: none;
  animation: live-pulse 1.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .3; }
}

.live-ticker__img {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  object-fit: cover;
  flex: none;
}

.live-ticker__text {
  transition: opacity 200ms ease-out;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-ticker__text.swap { opacity: 0; }

/* ---------- 랜덤 테스트 뽑기 룰렛 ---------- */
.roulette {
  text-align: center;
  padding: 24px 18px 20px;
  width: min(100%, 560px);
  margin-inline: auto;
}

.roulette__window {
  width: 104px;
  height: 104px;
  margin: 0 auto 12px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--theme-soft);
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--bg-1), 3px 4px 0 rgba(42, 33, 64, .18);
  transform: rotate(-2deg);
}

.roulette__window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.roulette.spinning .roulette__window {
  animation: roulette-wobble 240ms ease-in-out infinite alternate;
}

@keyframes roulette-wobble {
  from { transform: rotate(-3.5deg) scale(1); }
  to   { transform: rotate(2.5deg) scale(1.04); }
}

.roulette__name {
  font-weight: 800;
  font-size: 1rem;
  min-height: 1.6em;
  margin: 0 0 14px;
}

/* ---------- 참여 스탯 칩 ---------- */
.stat-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.stat-chip {
  background: var(--bg-1);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 12px 20px 10px;
  box-shadow: var(--shadow-pop);
  text-align: center;
  min-width: 100px;
}

.stat-chip:nth-child(1) { transform: rotate(-1.5deg); }
.stat-chip:nth-child(2) { transform: rotate(1deg); }
.stat-chip:nth-child(3) { transform: rotate(-0.6deg); }

.stat-chip__num {
  display: block;
  font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.2;
}

.stat-chip:nth-child(1) .stat-chip__num { color: var(--pink-text); }
.stat-chip:nth-child(2) .stat-chip__num { color: var(--lime-text); }
.stat-chip:nth-child(3) .stat-chip__num { color: var(--cyan-text); }

.stat-chip__label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-dim);
}

/* ---------- 유형 도감 스트립 ---------- */
.dex {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 4px 18px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.dex::-webkit-scrollbar { display: none; }

.dex-item {
  flex: none;
  width: 92px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  scroll-snap-align: start;
}

.dex-item img {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  background: var(--theme-soft);
  box-shadow: 0 0 0 3px var(--bg-1), 3px 4px 0 rgba(42, 33, 64, .15);
  object-fit: cover;
  transition: transform 120ms ease-out;
}

.dex-item:nth-child(odd) img { transform: rotate(-2deg); }
.dex-item:nth-child(even) img { transform: rotate(1.6deg); }
.dex-item:hover img { transform: rotate(0deg) scale(1.06); }

.dex-item span {
  display: block;
  font-size: .6875rem;
  font-weight: 700;
  margin-top: 7px;
  line-height: 1.3;
}

/* ---------- HOT 코너 배지 ---------- */
.card { position: relative; }

.corner-badge {
  position: absolute;
  top: -12px;
  right: -6px;
  z-index: 2;
  background: var(--pink);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 800;
  font-size: .75rem;
  letter-spacing: .08em;
  transform: rotate(8deg);
  box-shadow: var(--shadow-pop);
}

/* ---------- 유형 미리보기 (인트로) ---------- */
.type-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 10px;
}

.type-preview__item {
  width: 62px;
  text-align: center;
}

.type-preview__item img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: var(--theme-soft);
  object-fit: cover;
  box-shadow: 2px 3px 0 rgba(42, 33, 64, .16);
}

.type-preview__item:nth-child(odd) img { transform: rotate(-2.5deg); }
.type-preview__item:nth-child(even) img { transform: rotate(2deg); }

.type-preview__item span {
  display: block;
  font-size: .625rem;
  font-weight: 700;
  color: var(--ink-dim);
  margin-top: 5px;
  line-height: 1.3;
}

/* ---------- 베스트 댓글 말풍선 (인트로) ---------- */
.comments {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment {
  max-width: 88%;
  align-self: flex-start;
  background: var(--bg-1);
  border: 1.5px solid var(--ink);
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: 2px 3px 0 rgba(42, 33, 64, .15);
}

.comment--right {
  align-self: flex-end;
  background: var(--theme-soft);
  border-radius: 16px 4px 16px 16px;
}

.comment__meta {
  display: block;
  font-size: .6875rem;
  font-weight: 700;
  color: var(--ink-dim);
  margin-top: 4px;
}

/* ---------- 진행 마일스톤 (플레이) ---------- */
.milestone {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  vertical-align: 16px;
  background: var(--theme-soft);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: .75rem;
  font-weight: 800;
  color: var(--theme-text);
}

.milestone[hidden] { display: none; }

/* ---------- 선택 스파클 (플레이) ---------- */
.tap-spark {
  position: fixed;
  margin: -8px 0 0 -8px;
  pointer-events: none;
  z-index: 500;
  color: var(--theme-text);
  font-size: 15px;
  line-height: 1;
  animation: spark-fly 450ms ease-out forwards;
}

@keyframes spark-fly {
  from { transform: translate(0, 0) scale(1); opacity: 1; }
  to   { transform: translate(var(--dx, 0px), var(--dy, -24px)) scale(.2); opacity: 0; }
}

/* ---------- 과몰입 리포트 (결과) ---------- */
.report {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-1);
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: 0 0 0 4px var(--bg-1), 4px 6px 0 rgba(42, 33, 64, .16);
}

.report-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .8125rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.report-row__val {
  font-family: 'Paperlogy', 'Pretendard Variable', sans-serif;
  font-weight: 800;
  font-size: 1.0625rem;
  color: var(--theme-text);
}

.report-track {
  height: 14px;
  background: var(--bg-2);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}

.report-fill {
  height: 100%;
  background: var(--theme);
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(var(--sx, 0));
  animation: bar-grow 900ms 150ms cubic-bezier(.2, .8, .3, 1) both;
}

@keyframes bar-grow {
  from { transform: scaleX(0); }
}

.report-note {
  font-size: .6875rem;
  color: var(--ink-dim);
  margin: 8px 0 0;
}

/* ---------- 케미 게이지 (궁합 카드) ---------- */
.chem { margin-top: 10px; }

.chem-label {
  display: flex;
  justify-content: space-between;
  font-size: .6875rem;
  font-weight: 800;
  color: var(--ink-dim);
  margin-bottom: 4px;
}

.chem-track {
  height: 10px;
  background: var(--bg-2);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.chem-fill {
  height: 100%;
  background: var(--theme);
  border-radius: 999px;
  transform-origin: left;
  transform: scaleX(var(--sx, 0));
  animation: bar-grow 900ms 250ms cubic-bezier(.2, .8, .3, 1) both;
}

.chem--bad .chem-fill { background: #FF6B6B; }

/* ============================================================
   22. 사이클 2 — 필터 칩·카테고리 배지·전역 클릭 이펙트
   ============================================================ */

/* ---------- 카테고리 필터 칩 (가로 스크롤, role=group) ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 14px;
  margin: 0 -4px 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.chips::-webkit-scrollbar { display: none; }

.chip-filter {
  flex: none;
  min-height: 44px;
  padding: 8px 18px;
  background: var(--bg-1);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  font-weight: 800;
  font-size: .875rem;
  letter-spacing: .02em;
  transition: transform 100ms ease-out, background-color 150ms ease-out, color 150ms ease-out, box-shadow 100ms ease-out;
}

.chip-filter:active {
  transform: translate(2px, 3px);
  box-shadow: 1px 1px 0 rgba(42, 33, 64, .9);
}

/* 선택(pressed) 상태: 테마 배경 스티커 */
.chip-filter[aria-pressed="true"] {
  background: var(--theme);
  color: var(--theme-ink);
}

/* ---------- 카드 카테고리 배지 ---------- */
.badge-category {
  background: var(--theme-soft);
  color: var(--theme-text);
  border: 1.5px solid var(--ink);
}

/* ---------- 전역 클릭 스퀴시 (fx.js가 .fx-squish 토글) ---------- */
@keyframes fx-squish {
  0%   { transform: scale(1); }
  45%  { transform: scale(.93); }
  100% { transform: scale(1); }
}

.fx-squish {
  animation: fx-squish 120ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .fx-squish { animation: none; }
  .deco-sticker { animation: none; }
}
