:root {
  --bg: #14161c; --card: #1f222b; --line: #2e323d; --ink: #f2f3f5; --mute: #8b90a0;
  --accent: #ff8a3d; --good: #3ccf7a; --bad: #ff5c5c; --hl: #2a2f3c;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f6f6f3; --card: #ffffff; --line: #e3e3de; --ink: #17181c; --mute: #6c707c; --hl: #efeee9; --good: #16a35a; --bad: #e03b3b; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.4 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; }
body { padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); min-height: 100vh; }
#app { max-width: 520px; margin: 0 auto; }
button { font: inherit; color: inherit; cursor: pointer; }
h1 { font-size: 34px; margin: 28px 0 18px; letter-spacing: -0.5px; }
h1 span { display: block; font-size: 15px; font-weight: 500; color: var(--mute); letter-spacing: 0; }

.home { display: grid; gap: 12px; padding-bottom: 32px; }
.tile { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; position: relative; display: grid; gap: 2px; }
.tile b { font-size: 21px; }
.tile em { font-style: normal; color: var(--mute); font-size: 15px; }
.tile .stat { position: absolute; right: 16px; top: 18px; font-size: 14px; color: var(--accent); font-weight: 600; }
.tile .stat i { font-style: normal; color: var(--mute); font-weight: 400; }
.tile:active { transform: scale(0.99); }

.btn { background: var(--accent); color: #fff; border: 0; border-radius: 14px; padding: 14px 22px; font-weight: 600; font-size: 17px; }
.link { background: none; border: 0; color: var(--mute); padding: 10px 14px; font-size: 15px; }
.err { color: var(--bad); margin-top: 12px; }
.login { display: grid; gap: 12px; padding-top: 20px; }
.login p { color: var(--mute); margin: 0; }
.login input { font: inherit; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }

.drill { display: flex; flex-direction: column; min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.bar { display: flex; align-items: center; gap: 8px; padding: 10px 0 6px; }
.back { background: none; border: 0; font-size: 34px; line-height: 1; padding: 0 10px 4px 0; color: var(--mute); }
.title { font-weight: 600; flex: 1; }
.mic { width: 12px; height: 12px; border-radius: 50%; background: var(--line); transition: background .2s, box-shadow .1s; }
.mic.open { background: var(--mute); }
.mic.live { background: var(--good); box-shadow: 0 0 0 calc(var(--lv, 0) * 10px) color-mix(in srgb, var(--good) 30%, transparent); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: none; border-radius: 99px; padding: 5px 12px; font-size: 14px; color: var(--mute); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.clockbar { height: 4px; background: var(--accent); border-radius: 2px; width: 100%; transition: width 1s linear; margin-top: 4px; }

.stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.answer { min-height: 90px; text-align: center; }
.heard { min-height: 28px; text-align: center; color: var(--mute); font-size: 15px; }
.foot { display: flex; justify-content: center; gap: 16px; padding: 12px 0 24px; min-height: 64px; }

.ko { font-size: 34px; font-weight: 700; }
.ko.good { color: var(--good); }
.ko.small { font-size: 20px; color: var(--ink); }
.time { color: var(--accent); font-weight: 600; margin-top: 4px; }
.note { color: var(--accent); font-size: 15px; margin-top: 4px; }
.okc { color: var(--good); } .badc { color: var(--bad); }

.scene { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.emoji { font-size: 64px; line-height: 1; }
.tag { font-size: 44px; font-weight: 800; background: #ffd84a; color: #1a1a1a; padding: 10px 24px 10px 34px; border-radius: 10px 20px 20px 10px; position: relative; font-variant-numeric: tabular-nums; }
.tag::before { content: ''; position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--bg); }
.clock { width: 230px; height: 230px; color: var(--ink); }
.lcd { font: 700 76px/1 ui-monospace, "SF Mono", Menlo, monospace; background: #0c0d10; color: #ff6b4a; padding: 18px 28px; border-radius: 16px; letter-spacing: 2px; }
.cal { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; width: 180px; text-align: center; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.cal.wide { width: 260px; }
.cal-top { background: #e5484d; color: #fff; font-weight: 700; letter-spacing: 3px; padding: 8px; }
.cal-day { font-size: 82px; font-weight: 800; line-height: 1.15; padding: 6px 0 2px; font-variant-numeric: tabular-nums; }
.cal-word { font-size: 40px; font-weight: 800; padding: 26px 0; }
.cal-wd { color: var(--mute); font-weight: 700; letter-spacing: 2px; padding-bottom: 12px; }
.age .big { font-size: 80px; font-weight: 800; line-height: 1; }
.age .sub { color: var(--mute); }
.bus { display: flex; align-items: center; gap: 14px; background: #1f9d55; color: #fff; padding: 16px 28px; border-radius: 16px; }
.bus span { font-size: 46px; } .bus b { font-size: 72px; line-height: 1; font-variant-numeric: tabular-nums; }
.key { background: linear-gradient(135deg, #3b4252, #1c2029); color: #fff; width: 250px; height: 160px; border-radius: 14px; padding: 18px 22px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.key small { letter-spacing: 4px; opacity: .7; } .key b { font-size: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.elev { background: #0c0d10; color: #ff4b4b; border-radius: 14px; padding: 14px 34px; text-align: center; border: 6px solid #9aa0aa; }
.elev small { display: block; color: #ff4b4b; } .elev b { font: 700 80px/1 ui-monospace, Menlo, monospace; }
.phone { background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 30px 22px; text-align: center; width: 300px; }
.phone small { font-size: 34px; display: block; } .phone b { font-size: 32px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.q { text-align: center; padding: 0 8px; }
.qko { font-size: 34px; font-weight: 700; }
.qen { color: var(--mute); }
.cue { font-size: 36px; font-weight: 800; }
.score { color: var(--accent); font-weight: 700; font-size: 20px; }
.score.big { font-size: 80px; }

.replay { font-size: 64px; background: var(--card); border: 1px solid var(--line); border-radius: 50%; width: 150px; height: 150px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt { background: var(--card); border: 2px solid var(--line); border-radius: 14px; padding: 16px 6px; font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.opt.good { border-color: var(--good); color: var(--good); }
.opt.bad { border-color: var(--bad); color: var(--bad); }
.sys { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sysb { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 26px 6px; font-size: 22px; font-weight: 700; }
.sysb:active { background: var(--hl); }
