/* 영영게임 — "다꾸 단어장" 디자인
   모눈 노트 배경 + 마스킹테이프 붙인 카드 + 굵은 외곽선 스티커 + '참 잘했어요' 도장 */

:root {
  --paper: #FFF8E7;
  --paper-grid: rgba(47, 127, 209, 0.07);
  --card: #FFFFFF;
  --ink: #1F2A44;
  --ink-soft: #4A5674;
  --ink-faint: #8A93A8;
  --sun: #FFD54A;
  --sun-soft: #FFF1C2;
  --sun-deep: #E9A800;
  --mint: #79D9B8;
  --mint-soft: #DDF6EC;
  --mint-deep: #1F7A5E;
  --sky: #8CC8FF;
  --sky-soft: #E2F1FF;
  --sky-deep: #2563A6;
  --coral: #FF8B7B;
  --coral-soft: #FFE3DE;
  --coral-deep: #C23A28;
  --line: 2.5px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --pop-sm: 3px 3px 0 var(--ink);
  --radius: 18px;
  --radius-sm: 12px;
  --font-ko: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-title: 'Jua', 'Gowun Dodum', sans-serif;
  --font-en: 'Nunito', 'Gowun Dodum', sans-serif;
  --font-hand: 'Gaegu', 'Gowun Dodum', cursive;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-ko);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--paper-grid) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--paper-grid) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(12px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.screen { display: flex; flex-direction: column; gap: 18px; flex: 1; animation: rise-in .35s ease-out both; }
.en { font-family: var(--font-en); }
.hand { font-family: var(--font-hand); }
.muted { color: var(--ink-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 공통 부품 ---------- */

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }

.logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-title); font-size: 28px; letter-spacing: -0.5px; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  background: var(--sun); border: var(--line); border-radius: 12px 12px 12px 4px;
  box-shadow: var(--pop-sm);
  font-family: var(--font-en); font-weight: 900; font-size: 15px;
  transform: rotate(-6deg);
}

.icon-btn {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px;
  background: var(--card); border: var(--line); border-radius: 14px;
  box-shadow: var(--pop-sm);
  font-size: 22px; line-height: 1;
  transition: transform .08s, box-shadow .08s;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 60px; padding: 12px 20px;
  border: var(--line); border-radius: var(--radius);
  background: var(--sun); box-shadow: var(--pop);
  font-family: var(--font-title); font-size: 22px;
  transition: transform .08s, box-shadow .08s, background .15s;
  touch-action: manipulation;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.mint { background: var(--mint); }
.btn.sky { background: var(--sky); }
.btn.white { background: var(--card); }
.btn.small { min-height: 48px; font-size: 18px; box-shadow: var(--pop-sm); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.card {
  position: relative;
  background: var(--card);
  border: var(--line); border-radius: var(--radius);
  box-shadow: var(--pop);
  padding: 20px;
}
/* 마스킹테이프 */
.tape::before {
  content: '';
  position: absolute; top: -13px; left: 50%;
  width: 96px; height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, rgba(255,139,123,.75) 0 8px, rgba(255,213,74,.75) 8px 16px);
  border-radius: 3px;
  box-shadow: 0 1px 0 rgba(31,42,68,.15);
}
.tape.mint-tape::before { background: repeating-linear-gradient(45deg, rgba(121,217,184,.8) 0 8px, rgba(226,241,255,.9) 8px 16px); }
.tape.sky-tape::before { background: repeating-linear-gradient(-45deg, rgba(140,200,255,.8) 0 8px, rgba(255,241,194,.9) 8px 16px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.chip.sun { background: var(--sun-soft); }
.chip.mint { background: var(--mint-soft); }
.chip.coral { background: var(--coral-soft); }
.chip.sky { background: var(--sky-soft); }

.badge-label { font-family: var(--font-hand); font-size: 20px; color: var(--ink-soft); line-height: 1.1; }

.section-title { font-family: var(--font-title); font-size: 22px; margin: 4px 0 0; }

.notice {
  border: 2px dashed var(--ink-faint); border-radius: var(--radius-sm);
  padding: 10px 14px; font-size: 15px; color: var(--ink-soft); background: rgba(255,255,255,.6);
}

/* ---------- 홈 ---------- */

.hero { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 8px; }
.hero .mascot { width: 112px; height: 112px; animation: bob 3.2s ease-in-out infinite; }
.bubble {
  position: relative;
  background: var(--card); border: var(--line); border-radius: 18px;
  padding: 12px 14px; font-size: 17px; line-height: 1.45;
  box-shadow: var(--pop-sm);
}
.bubble::before {
  content: ''; position: absolute; left: -11px; top: 50%;
  width: 18px; height: 18px; background: var(--card);
  border-left: var(--line); border-bottom: var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; }

.today-card { padding-top: 26px; text-align: center; }
.today-count { font-family: var(--font-en); font-weight: 900; font-size: 64px; line-height: 1; letter-spacing: -2px; }
.today-count small { font-family: var(--font-title); font-size: 22px; letter-spacing: 0; margin-left: 4px; }
.today-sub { margin: 8px 0 18px; color: var(--ink-soft); font-size: 16px; }
.done-stamp-mini { display: inline-block; margin-bottom: 10px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 96px; padding: 12px 6px;
  background: var(--card); border: var(--line); border-radius: var(--radius);
  box-shadow: var(--pop-sm);
  font-size: 15px; font-weight: 700; text-align: center; line-height: 1.25;
  transition: transform .08s, box-shadow .08s;
}
.tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tile .tile-icon { font-size: 30px; line-height: 1; }
.tile:nth-child(1) { background: var(--sun-soft); }
.tile:nth-child(2) { background: var(--sky-soft); }
.tile:nth-child(3) { background: var(--coral-soft); }
.tile:nth-child(4) { background: var(--mint-soft); }
.count-dot {
  position: absolute; top: -10px; right: -8px;
  min-width: 28px; height: 28px; padding: 0 6px;
  display: grid; place-items: center;
  background: var(--coral); border: 2px solid var(--ink); border-radius: 999px;
  font-family: var(--font-en); font-weight: 900; font-size: 14px;
}

/* ---------- 문제 ---------- */

.quiz-top { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 12px; }
.progress-track { height: 16px; background: var(--card); border: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--mint); border-right: var(--line); transition: width .3s ease; }
.progress-text { font-family: var(--font-en); font-weight: 800; font-size: 16px; min-width: 52px; text-align: right; }

.timer { display: grid; grid-template-columns: 1fr 34px; align-items: center; gap: 8px; }
.timer-track { height: 12px; background: rgba(31,42,68,.08); border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--sun); border-radius: 999px; transform-origin: left; }
.timer.hurry .timer-fill { background: var(--coral); }
.timer.hurry { animation: wiggle .5s ease-in-out infinite; }
.timer-num { font-family: var(--font-en); font-weight: 900; font-size: 18px; text-align: center; color: var(--coral-deep); visibility: hidden; }
.timer.hurry .timer-num { visibility: visible; }

.format-tag {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 10px;
  border: 2px solid var(--ink); border-radius: 8px;
  font-size: 15px; font-weight: 700;
  transform: rotate(-2deg);
}
.format-tag.definition { background: var(--sky-soft); }
.format-tag.cloze { background: var(--mint-soft); }

.q-card { padding: 30px 20px 24px; min-height: 172px; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.q-ask { font-family: var(--font-hand); font-size: 21px; color: var(--ink-soft); line-height: 1.1; }
.q-text { font-family: var(--font-en); font-weight: 700; font-size: clamp(21px, 6vw, 25px); line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.q-text.long { font-size: clamp(19px, 5.2vw, 22px); }
.blank {
  display: inline-block; min-width: 3.6em; margin: 0 2px;
  border-bottom: 4px solid var(--mint-deep);
  background: var(--mint-soft); border-radius: 6px 6px 0 0;
  text-align: center; color: transparent; line-height: 1.2;
}
.blank.filled { color: var(--mint-deep); font-weight: 900; padding: 0 6px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  min-height: 72px; padding: 10px 8px;
  background: var(--card); border: var(--line); border-radius: var(--radius);
  box-shadow: var(--pop-sm);
  font-family: var(--font-en); font-weight: 800; font-size: clamp(18px, 5vw, 21px); line-height: 1.2;
  overflow-wrap: anywhere;
  transition: transform .08s, box-shadow .08s, background .15s;
  touch-action: manipulation;
}
.choice:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.choice.right { background: var(--mint); }
.choice.wrong { background: var(--coral); animation: shake .35s; }
.choice.dim { opacity: .45; }
.choices.locked .choice { pointer-events: none; }

.spell { display: flex; flex-direction: column; gap: 12px; }
.slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 44px; }
.slot {
  width: 30px; height: 42px;
  display: grid; place-items: center;
  border-bottom: 3px solid var(--ink); background: rgba(255,255,255,.75); border-radius: 6px 6px 0 0;
  font-family: var(--font-en); font-weight: 900; font-size: 22px; text-transform: lowercase;
}
.slot.gap { width: 14px; border-bottom: none; background: none; }
.slot.on { background: var(--sun-soft); }
.slot.extra { color: var(--coral-deep); }
.spell-input {
  width: 100%; height: 60px; padding: 0 16px;
  border: var(--line); border-radius: var(--radius); background: var(--card);
  box-shadow: inset 0 3px 0 rgba(31,42,68,.06);
  font-family: var(--font-en); font-weight: 800; font-size: 24px; letter-spacing: 1px;
}
.spell-input:focus { outline: none; border-color: var(--sky-deep); box-shadow: 0 0 0 4px var(--sky-soft); }
.spell-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; }
.form-hint {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--sun-soft); border: 2px solid var(--ink); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 16px;
  animation: pop-in .3s ease-out;
}
.hint-box { background: var(--sky-soft); border: 2px dashed var(--sky-deep); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 16px; }
.hint-box .en { font-weight: 700; }

/* 피드백 시트 */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(31,42,68,.25); z-index: 20; animation: fade-in .2s; }
.sheet {
  position: fixed; left: 50%; bottom: 0; z-index: 21;
  width: min(480px, 100%);
  transform: translateX(-50%);
  background: var(--card);
  border: var(--line); border-bottom: none; border-radius: 26px 26px 0 0;
  padding: 22px 20px calc(20px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px;
  max-height: 88dvh; overflow-y: auto;
  animation: sheet-up .28s cubic-bezier(.2,.9,.3,1.2);
}
.sheet.good { background: var(--mint-soft); }
.sheet.bad { background: var(--coral-soft); }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head .mascot { width: 64px; height: 64px; flex: none; }
.sheet-title { font-family: var(--font-title); font-size: 26px; line-height: 1.2; }
.answer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: var(--line); border-radius: var(--radius-sm); padding: 10px 12px 10px 16px; }
.answer-word { font-family: var(--font-en); font-weight: 900; font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.answer-base { font-size: 15px; color: var(--ink-soft); }
.diff { font-family: var(--font-en); font-weight: 800; font-size: 20px; letter-spacing: 1px; }
.diff .ok { color: var(--mint-deep); }
.diff .wrong, .diff .missing { color: var(--coral-deep); text-decoration: underline 3px; text-underline-offset: 4px; }
.diff .extra { color: var(--ink-faint); text-decoration: line-through; }
.learn-box { background: rgba(255,255,255,.75); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.learn-box .label { font-family: var(--font-hand); font-size: 18px; color: var(--ink-soft); line-height: 1; }
.learn-box .en { font-size: 18px; font-weight: 700; line-height: 1.45; }
.learn-box mark { background: linear-gradient(transparent 55%, var(--sun) 55%); color: inherit; font-weight: 900; padding: 0 2px; }

.speak-btn { flex: none; }

/* 쉬었다 온 화면 가림 */
.cover { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--paper); text-align: center; padding: 24px; }

/* ---------- 결과 ---------- */

.result-hero { text-align: center; padding-top: 30px; }
.score { font-family: var(--font-en); font-weight: 900; font-size: 72px; line-height: 1; letter-spacing: -2px; }
.score small { font-size: 30px; color: var(--ink-soft); }
.stamp {
  display: inline-grid; place-items: center;
  width: 120px; height: 120px;
  border: 5px double var(--coral-deep); border-radius: 50%;
  color: var(--coral-deep); background: rgba(255,227,222,.45);
  font-family: var(--font-title); font-size: 22px; line-height: 1.15; text-align: center;
  transform: rotate(-14deg);
  animation: stamp .5s cubic-bezier(.3,1.6,.5,1) .25s both;
}
.stamp.small { width: 70px; height: 70px; font-size: 13px; border-width: 4px; animation: none; }
.word-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 14px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 999px;
  font-family: var(--font-en); font-weight: 800; font-size: 17px;
}
.word-chip button { border: none; background: var(--sky-soft); border-radius: 999px; width: 32px; height: 32px; font-size: 16px; }

/* ---------- 5일 계획 ---------- */

.btn-col { display: flex; flex-direction: column; gap: 12px; }
.tracker { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); position: relative; }
.tracker::before { content: ''; position: absolute; left: 10%; right: 10%; top: 17px; height: 3px; background: rgba(31,42,68,.15); border-radius: 2px; }
.tracker li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tracker .dot {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 2.5px solid var(--ink-faint); border-radius: 50%; background: var(--card);
  font-family: var(--font-en); font-weight: 900; font-size: 16px; color: var(--ink-faint);
}
.tracker .cap { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.tracker li.done .dot { background: var(--mint); border-color: var(--ink); color: var(--ink); }
.tracker li.done .cap { color: var(--ink-soft); }
.tracker li.now .dot { background: var(--sun); border-color: var(--ink); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); transform: scale(1.12); }
.tracker li.now .cap { color: var(--ink); }
.steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -6px 0 16px; }
.step { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font-size: 14px; font-weight: 700; }
.step b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sky-soft); border: 1.5px solid var(--ink); font-family: var(--font-en); font-size: 12px; }
.step.on { background: var(--sun-soft); }
.step.on b { background: var(--sun); }
.stage-line { font-size: 15px; color: var(--ink-soft); margin-top: -8px; }
.stage-line b { color: var(--ink); }

.ko-card { align-items: center; text-align: center; }
.ko-word { display: flex; align-items: center; justify-content: center; gap: 12px; }
.ko-word .en { font-weight: 900; font-size: clamp(34px, 10vw, 44px); line-height: 1.1; overflow-wrap: anywhere; }
.spell-input.ko { font-family: var(--font-ko); font-weight: 700; font-size: 22px; letter-spacing: 0; }
.answer-word.ko { font-family: var(--font-title); font-weight: normal; font-size: 28px; }

.praise { background: var(--sun-soft); display: flex; flex-direction: column; gap: 14px; }
.praise-head { display: flex; gap: 12px; align-items: flex-start; }
.praise-head p { margin: 0 0 6px; font-size: 17px; line-height: 1.5; }
.praise-head p:first-child { font-weight: 700; }
.quote { margin: 0; background: var(--card); border: 2px dashed var(--ink-faint); border-radius: var(--radius-sm); padding: 14px 16px; }
.quote blockquote { margin: 0; }
.quote .en { margin: 0; font-weight: 800; font-size: 18px; line-height: 1.4; }
.quote-ko { margin: 4px 0 0; font-family: var(--font-hand); font-size: 21px; line-height: 1.3; color: var(--ink-soft); }
.quote figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-faint); text-align: right; }

/* ---------- 오답 노트·도장판·부모 ---------- */

.list { display: flex; flex-direction: column; gap: 12px; }
.note-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 14px 14px 14px 18px; }
.note-word { font-family: var(--font-en); font-weight: 900; font-size: 22px; }
.note-def { grid-column: 1 / -1; font-family: var(--font-en); font-size: 16px; color: var(--ink-soft); line-height: 1.4; }
.note-meta { display: flex; gap: 6px; align-items: center; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.calendar .dow { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.day { aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; font-family: var(--font-en); font-weight: 800; font-size: 15px; background: rgba(255,255,255,.7); border: 2px solid transparent; }
.day.today { border-color: var(--ink); }
.day.stamped { background: var(--sun); border: 2px solid var(--ink); position: relative; }
.day.stamped::after { content: '★'; position: absolute; right: 2px; bottom: -2px; font-size: 13px; color: var(--coral-deep); }
.day.empty { background: none; }
.month-nav { display: flex; align-items: center; justify-content: space-between; }
.month-nav strong { font-family: var(--font-title); font-size: 22px; font-weight: normal; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); text-align: center; font-size: 13px; font-weight: 700; line-height: 1.25; }
.badge .b-icon { font-size: 30px; line-height: 1; }
.badge.locked { opacity: .4; filter: grayscale(1); border-style: dashed; }

.lesson-pick { display: flex; flex-direction: column; gap: 12px; }
.lesson-btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; text-align: left; padding: 16px; }
.lesson-no { font-family: var(--font-en); font-weight: 900; font-size: 15px; background: var(--sun); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 8px; }
.lesson-title { font-family: var(--font-en); font-weight: 800; font-size: 18px; line-height: 1.25; }
.meter { height: 10px; background: rgba(31,42,68,.08); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; background: var(--mint); border-radius: 999px; }

.parent dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; }
.parent dt { color: var(--ink-soft); }
.parent dd { margin: 0; font-weight: 700; font-family: var(--font-en); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { min-height: 46px; border: none; border-right: 2px solid var(--ink); background: var(--card); font-weight: 700; font-size: 16px; }
.seg button:last-child { border-right: none; }
.seg button[aria-pressed="true"] { background: var(--sun); }
.setting { display: flex; flex-direction: column; gap: 8px; }
.setting-label { font-weight: 700; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.parent textarea { width: 100%; min-height: 96px; border: 2px solid var(--ink); border-radius: var(--radius-sm); padding: 10px; font-family: monospace; font-size: 13px; background: var(--card); }
.claim-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1.5px dashed rgba(31,42,68,.15); }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 10px; font-size: 15px; }
.bar-item .meter { margin: 0; height: 14px; border: 2px solid var(--ink); }

/* 다이얼로그 */
dialog {
  width: min(400px, calc(100% - 32px));
  border: var(--line); border-radius: 22px; box-shadow: var(--pop);
  padding: 22px; background: var(--card); color: var(--ink);
}
dialog::backdrop { background: rgba(31,42,68,.35); }
dialog h2 { font-family: var(--font-title); font-weight: normal; font-size: 24px; margin: 0 0 8px; }
dialog p { margin: 0 0 16px; }
dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
dialog input { width: 100%; height: 56px; border: var(--line); border-radius: var(--radius-sm); font-family: var(--font-en); font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 14px; }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 40;
  transform: translate(-50%, 20px); opacity: 0;
  max-width: calc(100% - 32px);
  background: var(--ink); color: #fff; border-radius: 14px;
  padding: 12px 18px; font-size: 16px; text-align: center;
  pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 꽃가루 */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; animation: fall linear forwards; }

/* ---------- 움직임 ---------- */

@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes wiggle { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
@keyframes stamp { from { opacity: 0; transform: rotate(-14deg) scale(2.2); } to { opacity: 1; transform: rotate(-14deg) scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

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

@media (max-width: 360px) {
  .tiles { gap: 8px; }
  .tile { font-size: 13px; min-height: 88px; }
  .hero { grid-template-columns: 92px 1fr; }
  .hero .mascot { width: 92px; height: 92px; }
}

/* 집중 학습 */
.focus-intro p { font-size: 15px; line-height: 1.5; }
.focus-ask { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.focus-hints { display: flex; flex-direction: column; gap: 8px; }
.focus-hints:empty { display: none; }
.focus-missed { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.focus-missed li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--ink-faint); }
.focus-missed li:last-child { border-bottom: none; }
.focus-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.focus-retry { color: var(--coral-deep); font-weight: 700; font-size: 15px; }
