html, body { height: 100%; overscroll-behavior: none; }
body { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow-x: hidden; }

.bar {
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 16px) 16px 8px;
  max-width: 560px; margin: 0 auto;
  padding-right: 200px;              /* 오른쪽 위 테마 토글 자리 */
}
.progress { font-size: 18px; color: var(--dim); margin-right: auto; white-space: nowrap; }
.progress b { color: var(--fg); font-size: 22px; }
.mini-btn {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: var(--panel); border: 1px solid var(--line); color: var(--accent);
  display: grid; place-items: center; box-shadow: 0 2px 0 var(--shadow);
}
.mini-btn svg { width: 20px; height: 20px; }
.mini-btn:active { transform: translateY(2px); box-shadow: none; }
.mini-btn:disabled { opacity: .35; }
.meter { max-width: 528px; margin: 0 auto; height: 6px; border-radius: 3px; background: var(--panel2); margin-inline: 16px; }
@media (min-width: 560px) { .meter { margin-inline: auto; } }
.meter i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--t2); transition: width .2s; }

main { max-width: 560px; margin: 0 auto; padding: 12px 16px calc(env(safe-area-inset-bottom) + 20px); }
#quiz { display: flex; flex-direction: column; height: calc(100dvh - 90px - env(safe-area-inset-top)); }

.stack { position: relative; flex: 1; min-height: 320px; }
.card {
  position: absolute; inset: 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 6px 18px var(--shadow);
  padding: 22px 18px 18px;
  display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
  will-change: transform; touch-action: pan-y;
}
.card.back { transform: scale(.96) translateY(10px); opacity: .7; pointer-events: none; }
.card.fly { transition: transform .16s ease-out, opacity .16s; }
.card .stamp {
  position: absolute; top: 18px; padding: 4px 12px; border-radius: 10px;
  font-weight: 900; font-size: 18px; opacity: 0; border: 3px solid currentColor; pointer-events: none;
}
/* 오른쪽으로 밀면 왼쪽 위에 '몰라요', 왼쪽으로 밀면 오른쪽 위에 '알아요' */
.card .stamp.no { left: 18px; color: var(--warn); transform: rotate(-10deg); }
.card .stamp.yes { right: 18px; color: var(--accent); transform: rotate(10deg); }

.word { text-align: center; font-size: 52px; font-weight: 900; line-height: 1.5; margin: 14px 0 6px; word-break: keep-all; }
.word rt { font-size: 18px; font-weight: 700; color: var(--accent); }
.answer { text-align: center; }
.answer .r { font-size: 20px; color: var(--accent); font-weight: 700; }
.answer .m { font-size: 16px; color: var(--fg); margin-top: 2px; }
.answer .cover { font-size: 14px; color: var(--dim); padding-top: 12px; }
.marked { text-align: center; font-size: 13px; color: var(--warn); font-weight: 700; margin-top: 4px; }

.exs { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.exs li { background: var(--panel2); border-radius: 14px; padding: 10px 12px; }
.exs .src { font-size: 12px; color: var(--dim); }
.exs .line { font-size: 19px; line-height: 2; margin-top: 2px;
  user-select: text; -webkit-user-select: text; -webkit-touch-callout: default; }
.exs .spk { font-weight: 800; color: var(--accent); }
.exs rt { font-size: 12px; color: var(--fg); }
.exs .hl { background: var(--t1); border-radius: 4px; padding: 0 1px; }
.noex { text-align: center; color: var(--dim); font-size: 14px; margin-top: 24px; }

.hint { text-align: center; font-size: 13px; color: var(--dim); margin: 10px 0 8px; }
.actions { display: flex; gap: 12px; }
.act {
  flex: 1; border-radius: 18px; padding: 10px; border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 0 var(--shadow);
}
.act span { font-size: 28px; font-weight: 900; line-height: 1.1; }
.act small { font-size: 14px; font-weight: 700; }
.act.no { background: var(--t4); }
.act.yes { background: var(--t2); }
.act:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow); }

#result { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 24px; }
.score { margin: 0; font-size: 72px; font-weight: 900; line-height: 1; }
.score small { font-size: 24px; margin-left: 4px; }
.score-sub { margin: 0 0 8px; color: var(--dim); }
.miss-h { align-self: stretch; font-size: 17px; margin: 18px 0 0; }
.miss { align-self: stretch; list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.miss li { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.miss b { font-size: 20px; margin-right: 8px; }
.miss .r { color: var(--accent); }
.miss .m { display: block; font-size: 14px; color: var(--dim); }
