:root {
  --bg: #fffaf2;
  --fg: #1f2933;
  --muted: #52606d;
  --primary: #2b6cb0;
  --same: #2f855a;
  --diff: #b7791f;
  --rec: #c53030;
  --card: #ffffff;
  --line: #d9d4ca;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  font: 1.15rem/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 480px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
section { display: flex; flex-direction: column; gap: 14px; min-height: calc(100dvh - 40px); }
section[hidden] { display: none; }
h1 { font-size: 1.6rem; margin: 8px 0 0; text-align: center; }
h2 { font-size: 1.2rem; margin: 8px 0 0; }
.sub { color: var(--muted); text-align: center; margin: 0; }

button {
  font: inherit; font-weight: 600; min-height: 60px; padding: 12px 16px;
  border: 2px solid var(--line); border-radius: 18px; background: var(--card); color: var(--fg);
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
button:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
button:disabled { opacity: .45; }
.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.quiet { background: transparent; border-color: transparent; color: var(--muted); text-decoration: underline; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.card { background: var(--card); border-radius: 24px; padding: 28px 20px; text-align: center; border: 2px solid var(--line); }
.big-emoji { font-size: 6rem; line-height: 1.1; text-align: center; }
.dots { text-align: center; color: var(--muted); letter-spacing: 4px; margin: 0; }

.menu { display: flex; flex-direction: column; align-items: center; font-size: 1.4rem; min-height: 110px; }
.menu span { font-size: 2.4rem; }
.menu small { font-size: .95rem; font-weight: 400; color: var(--muted); }
.menu.quiet { min-height: 60px; flex-direction: row; justify-content: center; gap: 8px; font-size: 1.1rem; }
.menu.quiet span { font-size: 1.4rem; }
.shelf { font-size: 2rem; text-align: center; word-break: break-all; }

.hold { position: relative; overflow: hidden; min-height: 120px; font-size: 1.3rem; }
.hold .fill { position: absolute; inset: 0; width: 0; background: #bee3f8; }
.hold.holding .fill { width: 100%; transition: width 3s linear; }
.hold .label { position: relative; }

.bar { position: relative; height: 34px; background: #ece6da; border-radius: 17px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: #68d391; transition: width .3s; }
.bar-text { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; }
.prompt { font-size: 1.4rem; text-align: center; margin: 4px 0; }
.choices { display: flex; gap: 14px; }
.choice { flex: 1; font-size: 5.5rem; min-height: 190px; border-width: 4px; }
.choice.answer { border-color: var(--same); background: #c6f6d5; animation: pulse .6s 2; }

.word { text-align: center; }
.word-text { font-size: 2.6rem; font-weight: 800; letter-spacing: 4px; }
.recording { background: var(--rec); border-color: var(--rec); color: #fff; }
.rec-on { color: var(--rec); font-weight: 800; text-align: center; margin: 0; animation: blink 1s infinite; }
.judge-q { text-align: center; color: var(--muted); margin: 6px 0 0; }
.same { background: var(--same); border-color: var(--same); color: #fff; min-height: 76px; }
.diff { background: var(--diff); border-color: var(--diff); color: #fff; min-height: 76px; }

.pop { animation: pulse .8s 3; }
.notice { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 448px;
  background: #fefcbf; border: 2px solid #d69e2e; border-radius: 14px; padding: 10px 14px; text-align: center; }

.summary { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 4px 14px; }
table { width: 100%; border-collapse: collapse; background: var(--card); font-size: 1rem; }
th, td { border: 1px solid var(--line); padding: 6px; text-align: center; }
.recs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.recs li { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; font-size: 1rem; }
.recs li span { flex: 1; }
.recs button { min-height: 48px; min-width: 52px; padding: 4px; }

@keyframes pulse { 50% { transform: scale(1.06); } }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
