:root { color-scheme: light; --bg: #fff8f0; --ink: #3d3550; --muted: #756c8b; --surface: #fff; --pink: #ff8fb1; --pink-deep: #c73f78; --line: #eee3d8; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; -webkit-font-smoothing: antialiased; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#app { max-width: 560px; min-height: 100dvh; margin: 0 auto; padding: 20px 16px 28px; display: flex; flex-direction: column; }
.loading { text-align: center; padding: 60px 0; color: var(--muted); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.home-link { color: var(--muted); font-size: 14px; text-decoration: none; }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; }
h1 { font-size: 38px; margin: 22px 0 4px; letter-spacing: 0; }
.lead { margin: 0 0 20px; color: var(--muted); }
.mix-btn { width: 100%; border: 0; border-radius: 18px; background: #ffe6a8; font-weight: 800; font-size: 18px; padding: 18px; margin-bottom: 14px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { text-align: left; border: 0; border-radius: 20px; padding: 16px; min-height: 150px; display: flex; flex-direction: column; }
.tile .e { font-size: 34px; }
.tile strong { font-size: 18px; margin-top: auto; }
.tile span:last-child { font-size: 13px; color: #5d5470; margin-top: 3px; }
.section { font-size: 19px; margin: 24px 0 12px; }
.foot { margin-top: auto; padding-top: 26px; text-align: center; font-size: 14px; }
.foot a { color: var(--pink-deep); font-weight: 700; }
.back { border: 0; background: var(--surface); border-radius: 12px; padding: 8px 13px; font-weight: 600; }
h2 { font-size: 26px; margin: 22px 0 16px; }
.q { font-weight: 700; margin: 18px 0 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 15px; }
.opts button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.opts button:disabled { opacity: .4; cursor: default; }
.primary { width: 100%; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 800; padding: 16px; margin-top: 24px; }
.secondary { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; font-weight: 700; padding: 14px; margin-top: 10px; }
.play-title { font-weight: 800; text-align: center; flex: 1; min-width: 0; }
.progress { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--muted); font-size: 14px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); }
.stage { flex: 1; display: flex; align-items: stretch; min-height: 390px; perspective: 1200px; touch-action: pan-y; }
.card { position: relative; width: 100%; border: 0; padding: 0; background: none; transform-style: preserve-3d; transition: transform .38s ease; }
.card.open { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 26px; text-align: center; }
.face.back-side { transform: rotateY(180deg); background: var(--surface); box-shadow: 0 8px 26px rgba(61, 53, 80, .12); }
.face .big { font-size: 74px; }
.face .tap { font-weight: 700; color: #5d5470; }
.question { font-size: 26px; font-weight: 800; line-height: 1.42; word-break: keep-all; overflow-wrap: anywhere; }
.second { font-size: 16px; color: var(--muted); line-height: 1.45; }
.versus { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.versus .choice { width: 100%; border-radius: 18px; padding: 18px 12px; }
.versus .vs { font-weight: 900; color: var(--muted); }
.controls { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }
.controls button { border: 0; border-radius: 16px; padding: 15px; font-weight: 800; background: var(--surface); }
.controls button:last-child { background: var(--ink); color: #fff; }
.tools { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.tools button { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 7px 11px; }
.done { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.done .big { font-size: 64px; }
.done a { color: var(--pink-deep); font-weight: 700; display: inline-block; margin-top: 22px; }
/* 광고 (ads.js 가 funarchive.app 에서만 body.ads-on 을 붙인다). 좁은 화면은 아래 띠배너, 넓은 화면은 양옆 */
.rail, .mbanner { display: none; }
body.ads-on .mbanner { display: flex; justify-content: center; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; min-height: 54px; padding: 2px 0 calc(2px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
body.ads-on #app { padding-bottom: calc(28px + 58px + env(safe-area-inset-bottom)); }
@media (min-width: 1000px) and (min-height: 640px) {
  body.ads-on .mbanner { display: none; }
  body.ads-on #app { padding-bottom: 28px; }
  body.ads-on .rail { display: block; position: fixed; top: 50%; transform: translateY(-50%); width: 160px; height: 600px; }
  body.ads-on .rail.left { left: calc(50% - 280px - 32px - 160px); }
  body.ads-on .rail.right { right: calc(50% - 280px - 32px - 160px); }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } }
@media (max-width: 360px) { h1 { font-size: 32px; } .question { font-size: 22px; } }
