/* 속독 훈련 · 정보처리 게임 화면 (js/views/drills.js · js/drills/*). 색은 app.css 토큰 (금빛 하나 + 맞음·틀림) */

/* ---------------------------------------------------------------- 허브: 오늘의 코스 · 빠른 시작 · 단계 */
.course { display: grid; gap: 14px; margin-bottom: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--gold-2) 14%, var(--surface)), var(--surface));
  border-color: color-mix(in srgb, var(--gold) 38%, var(--line)); }
.course-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.course-head > div { display: grid; gap: 4px; max-width: 640px; }
.course-head .chip { justify-self: start; background: var(--accent-strong); color: var(--on-accent); border: 0; }
.course-head h2 { font-size: 21px; }
.course-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.course-steps li { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; min-width: 0; }
.course-steps li.here { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.course-steps li.done { color: var(--muted); }
.course-dot { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--ink-2); }
.course-steps li.done .course-dot { background: var(--ok-bg); color: var(--ok-ink); }
.course-steps li.here .course-dot { background: var(--accent-strong); color: var(--on-accent); }
.course-name { display: inline-flex; align-items: center; gap: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course.compact .course-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.drill-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.quick-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.quick-card > div { flex: 1; display: grid; gap: 2px; min-width: 0; }
.quick-card .stat-icon { width: 40px; height: 40px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent-ink); }
.quick-card:hover { border-color: var(--accent); }

.stage { display: grid; gap: 10px; }
.stage-head { display: flex; gap: 12px; align-items: center; margin-top: 22px; }
.stage-head .sub { margin: 0 0 2px; }
.stage-head p { max-width: 720px; }
.stage-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  background: radial-gradient(circle, var(--glow), transparent 72%); }
.drill-card.reading { background: color-mix(in srgb, var(--gold-2) 6%, var(--surface)); }
.drill-honest { line-height: 1.5; }
.drill-next { color: var(--accent-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.level-meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.level-meter i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold-2), var(--brand)); }
.ability-bars { display: grid; gap: 8px; }
.ability-row { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 40px; gap: 10px; align-items: center; }
.drill-group { font-size: 15px; margin-top: 8px; color: var(--ink-2); }
.games .course-head h2 { font-size: 19px; }

@media (max-width: 820px) { .drill-quick { grid-template-columns: 1fr; } .course.compact .course-steps { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 560px) {
  .course-steps { grid-template-columns: 1fr 1fr; }
  .ability-row { grid-template-columns: 96px 1fr 34px; }
  .course-head .btn { width: 100%; }
}

/* 코스 진행 표시 (드릴 화면 위) */
.seq-badge { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: seq; }
.seq-badge li { counter-increment: seq; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.seq-badge li::before { content: counter(seq) ". "; }
.seq-badge li.done { background: var(--ok-bg); color: var(--ok-ink); }
.seq-badge li.here { background: var(--accent-strong); color: var(--on-accent); }

/* ---------------------------------------------------------------- 시야 피라미드 */
.pyr-stage { display: grid; gap: 6px; padding: 18px 0 8px; font-family: var(--read-font); font-size: 24px; font-weight: 800; position: relative; min-height: 40vh; align-content: center; overflow: hidden; }
.pyr-row { position: relative; display: grid; place-items: center; height: 1.6em; color: var(--muted); }
.pyr-row > span { grid-area: 1 / 1; width: 1.15em; text-align: center; }
.pyr-row.on { color: var(--ink); }
.pyr-c { width: 2px !important; height: 100%; background: color-mix(in srgb, var(--accent) 60%, transparent); }
.pyr-row.on .pyr-c { background: var(--accent); }

/* ---------------------------------------------------------------- 집중 준비 */
.breath-stage { min-height: 52vh; display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; }
.breath-orb { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fbe7b0, #d4a24a 65%, #a8782a); box-shadow: 0 0 40px var(--glow);
  transform: scale(0.7); transition: transform 4s ease-in-out; }
.breath-orb.in { transform: scale(1.25); transition-duration: 4s; }
.breath-orb.out { transform: scale(0.7); transition-duration: 6s; }
.breath-word { font-family: var(--serif); font-size: 26px; }
.breath-stage p { max-width: 420px; }

/* ---------------------------------------------------------------- 카드 놓기 (문장 붙잡기 · 문장 순서 · 읽기 폭) */
.arrange-answer { display: grid; gap: 6px; min-height: 52px; padding: 10px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--gold) 40%, var(--line)); background: var(--surface); }
.arrange-answer.words { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-family: var(--read-font); }
.arrange-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: inherit; font: inherit; font-family: var(--read-font); line-height: 1.5; }
.arrange-answer.words .arrange-item { align-items: center; padding: 6px 10px; font-size: 18px; font-weight: 700; }
.arrange-item.fixed { border-style: dashed; background: var(--surface-2); }
.arrange-no { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--accent-strong); color: var(--on-accent); font-family: var(--font); }
.arrange-slot { padding: 6px 4px; }
.arrange-pool { display: grid; gap: 8px; }
.arrange-pool.words { display: flex; flex-wrap: wrap; gap: 8px; }
.arrange-card { text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: inherit; font: inherit; font-family: var(--read-font); line-height: 1.55; }
.arrange-pool.words .arrange-card { font-size: 19px; font-weight: 700; padding: 8px 14px; }
.arrange-card:hover { border-color: var(--accent); }
.order-answer { min-height: 0; padding-top: 12px; }
.order-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-family: var(--read-font); line-height: 1.6; text-align: left; max-width: 640px; }

/* 시간 재며 읽기 (요지 잡기 · 핵심어 잡기) */
.timed-read { display: grid; gap: 12px; padding-top: 6px; }
.timed-read .countdown { position: sticky; top: 64px; z-index: 5; }
.timed-read .reader { padding-bottom: 12px; font-size: 18px; line-height: 1.8; margin: 0; }

/* ---------------------------------------------------------------- 빨리 맞히는 판 */
.sprint { display: grid; gap: 14px; padding-top: 6px; }
.sprint-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.sprint-score { font-size: 20px; color: var(--accent-ink); }
.sprint-stage { border-radius: var(--radius); padding: 4px; transition: box-shadow 0.15s; }
.sprint-stage.hit { animation: hit 0.25s; }
.sprint-stage.miss { animation: miss 0.35s; }
@keyframes hit { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 60%, transparent); } to { box-shadow: none; } }
@keyframes miss { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 70%, transparent); } to { box-shadow: none; } }
.sprint-note { min-height: 1.5em; text-align: center; color: var(--bad); }
.cmp { display: grid; gap: 22px; justify-items: center; padding: 18px 0 8px; min-height: 40vh; align-content: center; }
.two-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 520px; }
.big-choice { padding: 18px 12px; font-size: 18px; border: 1.5px solid var(--line); background: var(--surface); }
.big-choice:hover { border-color: var(--accent); }
.key-hint { font-size: 13px; color: var(--muted); font-weight: 600; }
.lex-word { font-family: var(--read-font); font-size: clamp(34px, 8vw, 52px); font-weight: 800; min-height: 1.4em; text-align: center; }
.verify-sent { font-family: var(--read-font); font-size: clamp(22px, 4.6vw, 28px); font-weight: 700; line-height: 1.5; text-align: center; max-width: 560px; min-height: 3em; display: grid; place-items: center; }
.verify-sent.gone { color: transparent; text-shadow: 0 0 14px color-mix(in srgb, var(--ink) 30%, transparent); }
.rspan-target { color: var(--accent-ink); text-decoration: underline 3px color-mix(in srgb, var(--accent) 55%, transparent); text-underline-offset: 6px; }

/* 기호 바꾸기 */
.coding { display: grid; gap: 18px; justify-items: center; padding-top: 8px; }
.coding-key { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.coding-key.fresh { animation: pulse 0.6s 2; border-color: var(--accent); }
.coding-pair { display: grid; justify-items: center; gap: 2px; min-width: 40px; padding: 4px 2px; border-radius: 8px; background: var(--surface-2); }
.coding-pair b { font-size: 15px; }
.coding-now { width: 104px; height: 104px; border-radius: 22px; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--accent); color: var(--ink); }
.coding-pad { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 8px; width: 100%; max-width: 520px; }
.coding-pad .btn { padding: 14px 0; font-size: 20px; border: 1.5px solid var(--line); background: var(--surface); }
.sym { display: inline-grid; place-items: center; line-height: 0; }


/* ---------------------------------------------------------------- 주변 시야 */
.ufov-box { position: relative; width: min(460px, 100%); aspect-ratio: 1; margin: 6px auto 4px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.ufov-scene { position: absolute; inset: 0; }
.ufov-item { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; line-height: 0; }
.ufov-item.c { color: var(--ink); }
.ufov-glyph { color: var(--ink); }
.ufov-glyph.target { color: var(--ink); }
.ufov-tri { font-size: 18px; line-height: 1; color: var(--ink-2); }
.ufov-fix { font-size: 28px; font-weight: 800; color: var(--accent); line-height: 1; }
.ufov-scene.mask { display: grid; grid-template-columns: repeat(8, 1fr); }
.ufov-scene.mask i { display: block; margin: 18%; border-top: 3px solid color-mix(in srgb, var(--ink) 55%, transparent); border-left: 3px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.ufov-pick { position: relative; width: min(340px, 86vw); aspect-ratio: 1; margin: 6px auto; border-radius: 50%; border: 1px dashed var(--line); display: grid; place-items: center; }
.ufov-dir { position: absolute; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font: inherit; font-weight: 800; }
.ufov-dir:hover { border-color: var(--accent); color: var(--accent-ink); }
.question .row-wrap { align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- N칸 전 기억 · 위치 순서 기억 · 다른 글자 찾기 */
.nback-letter { width: 132px; height: 132px; border-radius: 26px; display: grid; place-items: center; font-family: var(--read-font); font-size: 64px; font-weight: 800;
  background: var(--surface); border: 2px solid color-mix(in srgb, var(--gold) 45%, var(--line)); }
.nback-letter.ok { color: var(--ok-ink); font-size: 26px; border-color: var(--ok); }
.nback-letter.no { color: var(--bad); font-size: 22px; border-color: var(--bad); }
.corsi-board { position: relative; width: min(420px, 100%); aspect-ratio: 1; margin: 8px auto; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.corsi-block { position: absolute; width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 12px; border: 1.5px solid color-mix(in srgb, var(--gold) 40%, var(--line));
  background: var(--surface-2); transition: background 0.12s, box-shadow 0.12s; }
.corsi-block:disabled { opacity: 1; }
.corsi-block.on { background: linear-gradient(180deg, #f3d792, #c99a45); box-shadow: 0 0 18px var(--glow); }
.corsi-block.tap { background: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.odd-wrap { max-width: 480px; margin: 12px auto 0; width: 100%; }
.odd-grid { display: grid; gap: 5px; aspect-ratio: 1; }
.odd-cell { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-family: var(--read-font); font-weight: 700; font-size: clamp(14px, 4vw, 24px); padding: 0; }
.odd-cell.miss { animation: shake 0.25s; border-color: var(--bad); }
.is-game .drill-body { max-width: 640px; }
@media (max-width: 560px) {
  .cmp { gap: 16px; min-height: 34vh; }
  .big-choice { padding: 16px 8px; font-size: 16px; }
  .nback-letter { width: 112px; height: 112px; font-size: 54px; }
}

/* 휴대폰에서 빠르게 누르는 게임: 두 번 눌러 확대 · 글자 선택 · 길게 눌러 뜨는 메뉴가 끼어들지 않게 */
.drill .focus-body, .drill .focus-foot { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.drill button, .drill a.btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .big-choice:hover, .arrange-card:hover, .ufov-dir:hover, .choice-btn:hover { border-color: var(--line); color: inherit; }
}
.countdown-num { font-family: var(--serif); font-size: 72px; color: var(--accent-ink); line-height: 1; }
.countdown-num.tick { animation: pop 0.5s ease; }

/* 깜빡이는 낱말 잡기 · 펼쳐지는 문장 */
.catch-target { font-family: var(--read-font); font-size: clamp(34px, 8vw, 48px); font-weight: 800; color: var(--accent-ink); padding: 6px 22px; border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--gold) 45%, var(--line)); background: var(--surface); }
.catch-stream { min-width: 6em; }
.ur-stage { min-height: 36vh; }
.ur-line { font-family: var(--read-font); font-size: clamp(22px, 4.8vw, 30px); font-weight: 700; line-height: 1.9; max-width: 640px; text-align: left; padding: 0 8px; }
.ur-w { opacity: 0; border-radius: 6px; padding: 0 2px; transition: opacity 0.06s; }
.ur-w.on { opacity: 1; background: color-mix(in srgb, var(--hl) 45%, transparent); }
.ur-w.gone { opacity: 1; color: transparent; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--ink) 18%, transparent) 0 6px, transparent 6px 9px); }
