/* 캐모마일그레이 게임 허브 — 크고 또렷하게, 차분하고 따뜻한 색 */
:root {
  --bg: #fbf6e9;
  --surface: #fffdf7;
  --ink: #26261f;
  --muted: #55544b;
  --line: #bdb6a3;
  --grey: #ebe6d8;
  --primary: #44584c;
  --primary-ink: #ffffff;
  --accent: #f2c94c;
  --accent-ink: #26261f;
  --good: #2c6a3d;
  --bad: #a03a29;
  --user: #1d4f91;
  --focus: #1a5fb4;
  --radius: 16px;
  --tap: 56px;
  --pace: 1; /* 느리게 모드에서 2.2 */
  font-size: 21px; /* 기본: 크게 */
}
html[data-text='normal'] { font-size: 18px; }
html[data-text='large'] { font-size: 21px; }
html[data-text='xlarge'] { font-size: 25px; }
html.slow { --pace: 2.2; }
html.hc {
  --bg: #ffffff; --surface: #ffffff; --ink: #000000; --muted: #000000; --line: #000000; --grey: #ffffff;
  --primary: #000000; --accent: #ffd400; --good: #004d1a; --bad: #8a0000; --user: #00308f; --focus: #c2185b;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', system-ui, sans-serif;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
main:focus { outline: none; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: 0.8rem 1rem; z-index: 50; }
.skip-link:focus { left: 0; }

/* ── 버튼 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: var(--tap); min-width: var(--tap);
  padding: 0.5rem 1rem;
  font: inherit; font-weight: 700; color: var(--ink); text-decoration: none; text-align: center;
  background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
html.hc .btn { border-width: 3px; }
.btn:active { transform: translateY(1px); background: var(--grey); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:active { background: var(--ink); }
.btn.wide { display: flex; width: 100%; }
.btn[aria-pressed='true'], .btn[aria-checked='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn:disabled { opacity: 0.55; cursor: default; }

/* ── 위쪽 막대(항상 보임) ── */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 2px solid var(--line); padding: 0.4rem 0.6rem; }
.topbar-row { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap); }
.topbar-row .btn { flex: none; padding: 0.3rem 0.7rem; font-size: min(1rem, 5vw); }
.screen-title { flex: 1; font-size: min(1.2rem, 5.6vw); line-height: 1.25; text-align: center; }
.quickbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-top: 0.4rem; }
.btn.quick { padding: 0.2rem 0.3rem; font-size: min(0.9rem, 4.4vw); line-height: 1.2; }

.screen { flex: 1; padding: 1rem 0.75rem 2rem; display: flex; flex-direction: column; gap: 0.9rem; }
.footer { text-align: center; padding: 1rem; color: var(--muted); }
.lead, .hub-lead, .help { color: var(--muted); }
.section-title { font-size: 1.15rem; margin-top: 0.6rem; }
.notice { color: var(--muted); background: var(--grey); border-radius: var(--radius); padding: 0.8rem 1rem; }
html.hc .notice { border: 2px solid var(--line); }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.card h2 { font-size: 1.15rem; }
.chip { display: inline-flex; align-items: center; padding: 0.25rem 0.75rem; background: var(--grey); border: 2px solid var(--line); border-radius: 999px; font-weight: 700; }
.chip.accent, .badge { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); }
.badge { display: inline-block; padding: 0.1rem 0.6rem; border: 2px solid var(--ink); border-radius: 999px; font-size: 0.85rem; font-weight: 700; vertical-align: middle; }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.live { min-height: 1.6em; font-weight: 700; text-align: center; }
.empty { color: var(--muted); }

/* ── 허브 ── */
.hook-card {
  display: flex; flex-direction: column; gap: 0.35rem; align-items: flex-start;
  padding: 1.1rem; border-radius: calc(var(--radius) + 4px);
  background: var(--primary); color: var(--primary-ink); text-decoration: none;
  border: 3px solid var(--primary);
}
.hook-badge { background: var(--accent); color: var(--accent-ink); font-weight: 700; padding: 0.15rem 0.7rem; border-radius: 999px; }
.hook-title { font-size: 1.45rem; font-weight: 800; line-height: 1.3; }
.hook-go { align-self: stretch; margin-top: 0.4rem; min-height: var(--tap); display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); border-radius: var(--radius); font-weight: 800; }
.tile-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem; text-align: center;
  min-height: 9.5rem; height: 100%; padding: 0.9rem 0.5rem;
  background: var(--surface); color: var(--ink); text-decoration: none;
  border: 2px solid var(--line); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 3px 0 var(--line);
}
html.hc .tile { border-width: 3px; }
.tile:active { transform: translateY(2px); box-shadow: none; }
.tile-icon { font-size: 2.6rem; line-height: 1.1; }
.tile-name { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.tile-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.35; }
.together { display: flex; gap: 0.8rem; align-items: center; padding: 1rem; background: var(--grey); border: 2px dashed var(--line); border-radius: var(--radius); }
.together-title { font-weight: 800; font-size: 1.15rem; }
.together-desc { color: var(--muted); }
.hub-links { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 339px) { .tile-grid, .hub-links { grid-template-columns: 1fr; } }

/* ── 고르기 버튼 묶음, 설정 ── */
.segmented { border: 0; margin: 0; padding: 0; min-width: 0; }
.segmented legend { font-weight: 800; padding: 0; margin-bottom: 0.4rem; }
.seg-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0.5rem; }
.seg-row .btn { padding: 0.4rem 0.3rem; }
.setting-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.8rem 1rem; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); }
.setting-text { flex: 1; }
.setting-label { font-weight: 800; }
.setting-desc { color: var(--muted); font-size: 0.9rem; }
.btn.switch { flex: none; min-width: 5.2rem; }
.size-choices { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.8rem; }
.sample-normal { font-size: 18px; }
.sample-large { font-size: 21px; }
.sample-xlarge { font-size: 25px; }

/* ── 알림, 대화 상자 ── */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%);
  width: min(92vw, 560px); padding: 0.9rem 1.1rem; z-index: 60;
  background: var(--ink); color: var(--bg); border-radius: var(--radius); font-weight: 700; text-align: center;
  transition: transform calc(0.25s * var(--pace)) ease; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.dialog-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 15, 0.6); display: flex; align-items: center; justify-content: center; padding: 0.75rem; overflow-y: auto; }
.dialog { width: min(100%, 520px); max-height: 100%; overflow-y: auto; background: var(--bg); border: 3px solid var(--ink); border-radius: calc(var(--radius) + 4px); padding: 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.dialog h2 { font-size: 1.4rem; line-height: 1.3; text-align: center; }
.dialog h2:focus { outline: none; }
.dialog-body { display: flex; flex-direction: column; gap: 0.4rem; }
.dialog-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.result-line { text-align: center; font-size: 1.1rem; }

/* ── 스도쿠 ── */
/* 판은 화면 너비를 거의 다 씁니다(양옆 4px 씩만 남김). .sd-scroll 이 화면 양옆 여백을 지우고, 크게 볼 때는 옆으로 밀 수 있게 합니다. */
.sd-scroll {
  margin: 0 -0.75rem; padding: 8px 0; overflow-x: auto; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch; display: flex;
}
.sd-scroll.zoomed { padding: 10px 6px 14px; scroll-padding: 0 56px; }
.sd-scroll.zoomed .sd-board { --w: max(min(100vw - 8px, 560px), calc(var(--n) * 48px + 8px)); }
.sd-board {
  --w: min(100vw - 8px, 560px);
  flex: none;
  width: var(--w); height: var(--w); margin: 0 auto;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr);
  border: 4px solid var(--ink); border-radius: 6px; background: var(--surface);
}
.sd-cell {
  position: relative; min-width: 0; min-height: 0; padding: 0; margin: 0;
  font: inherit; font-weight: 800; font-size: calc(var(--w) / var(--n) * 0.56); line-height: 1;
  color: var(--user); background: var(--surface);
  border: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  touch-action: manipulation;
}
.sd-cell.bt { border-top: 3px solid var(--ink); }
.sd-cell.bl { border-left: 3px solid var(--ink); }
.sd-cell.given { color: var(--ink); background: var(--grey); }
.sd-cell > * { pointer-events: none; }
/* 고른 칸과 같은 가로줄·세로줄·상자 */
.sd-cell.peer { background: #f3e6b3; }
.sd-cell.given.peer { background: #e3d7a8; }
/* 고른 칸과 같은 숫자 */
.sd-cell.same { background: #f2c94c; box-shadow: inset 0 0 0 3px var(--ink); }
/* 고른 칸: 칸보다 크게 떠오르는 굵은 테두리 */
.sd-cell.sel {
  background: #cfe0f7; z-index: 3; border-radius: 6px;
  transform: scale(1.22); font-size: calc(var(--w) / var(--n) * 0.6);
  box-shadow: 0 0 0 4px var(--focus), 0 3px 10px rgba(0, 0, 0, 0.4);
}
.sd-cell.conflict { color: var(--bad); background: #f7d5cd; text-decoration: underline wavy; text-decoration-thickness: 2px; }
.sd-cell.conflict.sel { background: #f7d5cd; }
html.hc .sd-cell.given { background: #e2e2e2; }
html.hc .sd-cell.peer { background: #fff6c2; }
html.hc .sd-cell.same { background: #ffd400; }
html.hc .sd-cell.sel { background: #fff; box-shadow: 0 0 0 5px var(--focus), 0 0 0 8px #000; }
.sd-num.match { box-shadow: inset 0 0 0 4px var(--focus); }
.sd-zoom-hint { text-align: center; }
html.hc .sd-cell.conflict { background: #ffd0d0; box-shadow: inset 0 0 0 3px var(--bad); }
.sd-cell:focus-visible { outline-offset: -4px; z-index: 2; }
.sd-notes { position: absolute; inset: 6%; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; justify-items: center; font-size: calc(var(--w) / var(--n) * 0.26); font-weight: 700; color: var(--muted); line-height: 1; }
.sd-n4 .sd-notes { grid-template-columns: repeat(2, 1fr); }
.sd-pad { display: grid; gap: 0.5rem; width: min(100%, 560px); margin: 0 auto; }
.sd-pad9 { grid-template-columns: repeat(5, 1fr); }
.sd-pad6 { grid-template-columns: repeat(6, 1fr); }
.sd-pad4 { grid-template-columns: repeat(4, 1fr); }
.sd-num { font-size: 1.6rem; min-height: 64px; padding: 0; }
.sd-num.used-up { opacity: 0.45; }
.sd-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; width: min(100%, 560px); margin: 0 auto; }
.screen-sudoku > .btn.wide { width: min(100%, 560px); margin: 0 auto; }

/* ── 블록 퍼즐 ── */
.score { font-size: 1.15rem; font-weight: 700; }
.score-num { font-size: 1.7rem; }
.chip.combo { background: var(--accent); border-color: var(--ink); }
.bk-board {
  --w: min(100vw - 1.5rem, 520px);
  width: var(--w); height: var(--w); margin: 0 auto;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); gap: 2px;
  padding: 4px;
}
/* 판 테두리는 칸마다 그립니다. 그래야 막힌 칸(없는 자리)이 빠진 판 모양이 그대로 보입니다. */
.bk-cell { min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 4px; background: var(--surface); cursor: pointer; touch-action: manipulation; transition: background-color calc(0.15s * var(--pace)); box-shadow: 0 0 0 2px var(--ink); }
.bk-cell.blocked { visibility: hidden; box-shadow: none; cursor: default; }
.bk-cell.preview { background: #9fc3a9; box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 3px var(--ink); }
/* 돌 타일: 회색 돌 모양(빗금 + 굵은 테두리). 그 줄을 지우면 깨집니다. */
.bk-cell.stone, .stone-sample {
  background: #8f8f87 repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 255, 255, 0.28) 5px 7px);
  box-shadow: 0 0 0 2px var(--ink), inset 0 0 0 3px #4d4d47, inset 0 -5px 0 rgba(0, 0, 0, 0.25);
  cursor: default;
}
html.hc .bk-cell.stone, html.hc .stone-sample { background-color: #555; box-shadow: 0 0 0 2px #000, inset 0 0 0 4px #000; }
.stone-sample { display: inline-block; width: 1.1em; height: 1.1em; border-radius: 4px; vertical-align: -0.15em; margin-right: 0.2em; }
.goal { width: min(100%, 520px); margin: 0 auto; display: flex; flex-direction: column; gap: 0.3rem; }
.goal-text { font-weight: 800; }
.goal-now { font-weight: 700; color: var(--muted); }
.goal-bar { height: 18px; background: var(--grey); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.goal-fill { display: block; height: 100%; background: var(--good); transition: width calc(0.3s * var(--pace)) ease; }
.bk-cell.flash { animation: bk-flash calc(0.6s * var(--pace)) ease-out; }
@keyframes bk-flash { 0% { background: var(--accent); transform: scale(0.8); } 100% { background: var(--surface); transform: scale(1); } }
.bk-cell:focus-visible { outline-offset: -3px; }
.c1 { background: #c8553d; } .c2 { background: #d99a1c; } .c3 { background: #4f8a73; } .c4 { background: #44699e; }
.c5 { background: #8662a3; } .c6 { background: #c56f3c; } .c7 { background: #5f6660; }
.bk-cell.filled { box-shadow: 0 0 0 2px var(--ink), inset 0 -4px 0 rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
html.hc .bk-cell.filled, html.hc .bk-block { box-shadow: 0 0 0 2px #000, inset 0 0 0 3px #000; }
.bk-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; width: min(100%, 520px); margin: 0 auto; }
.bk-slot {
  min-height: 7.2rem; padding: 0.4rem; display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.bk-slot:disabled { background: var(--grey); border-style: dashed; cursor: default; }
.bk-slot.selected { border: 4px solid var(--ink); background: var(--accent); }
.bk-slot.dragging .bk-piece { opacity: 0.25; }
.bk-piece { --u: min(1.25rem, 5.2vw); display: grid; grid-template-columns: repeat(var(--w), var(--u)); grid-template-rows: repeat(var(--h), var(--u)); gap: 2px; pointer-events: none; }
.bk-block { border-radius: 4px; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.25); }
.bk-ghost { position: fixed; left: 0; top: 0; z-index: 30; grid-template-columns: repeat(var(--w), 1fr); grid-template-rows: repeat(var(--h), 1fr); opacity: 0.9; pointer-events: none; }
.bk-options { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 0.5rem; }

/* ── 한글 퀴즈 ── */
.quiz-question { font-size: 1.35rem; line-height: 1.5; white-space: pre-line; }
.quiz-question:focus { outline: none; }
.quiz-hint { background: var(--grey); border-left: 6px solid var(--accent); padding: 0.7rem 0.9rem; border-radius: 8px; }
.choices { display: flex; flex-direction: column; gap: 0.6rem; }
.btn.choice { width: 100%; justify-content: flex-start; text-align: left; min-height: 64px; font-size: 1.1rem; }
.choice-num { flex: none; width: 2rem; height: 2rem; display: inline-flex; align-items: center; justify-content: center; border: 2px solid currentColor; border-radius: 50%; }
.choice-text { flex: 1; }
.choice-mark { flex: none; font-size: 0.85rem; }
.btn.choice:disabled { opacity: 1; }
.btn.choice:disabled:not(.right):not(.wrong) { color: var(--muted); background: var(--grey); }
.btn.choice.right { background: #dcefdc; border: 4px solid var(--good); color: var(--ink); }
.btn.choice.wrong { background: #f7ddd7; border: 4px dashed var(--bad); color: var(--ink); }
.quiz-feedback, .quiz-after { display: flex; flex-direction: column; gap: 0.6rem; }
.verdict { font-size: 1.25rem; font-weight: 800; }
.verdict.ok { color: var(--good); }
.verdict.no { color: var(--bad); }
.explain { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; }
.stamp { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; font-size: 0.8rem; color: var(--muted); }
.stamp-mark { width: 100%; max-width: 3rem; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: 50%; font-size: 1.4rem; }
.stamp.on .stamp-mark { background: var(--accent); border: 3px solid var(--ink); color: var(--ink); }

/* ── 카드 짝 맞추기 ── */
/* 카드는 줄(.mc-row)마다 놓습니다. 한 장의 너비(--cw)는 칸 수(--cols)로 정해지고, 짧은 줄은 가운데로 모여 어긋나게 놓입니다.
   cards-levels.js 의 cardWidthAt 과 같은 식입니다(양옆 여백 합 24px, 사이 6px). 줄이 많으면 화면을 아래로 내려서 봅니다. */
.mc-grid {
  --gap: 6px;
  --gw: min(100vw - 24px, 560px);
  --cw: calc((var(--gw) - (var(--cols) - 1) * var(--gap)) / var(--cols));
  width: var(--gw); align-self: center; flex: none;
  display: flex; flex-direction: column; gap: var(--gap); perspective: 900px;
}
.mc-row { display: flex; justify-content: center; gap: var(--gap); }
.mc-gap { flex: none; width: var(--cw); }
.mc-card { flex: none; width: var(--cw); aspect-ratio: 1; min-width: 0; padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius); touch-action: manipulation; }
.mc-cols3 .mc-card { aspect-ratio: 4 / 5; }
.mc-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform calc(0.4s * var(--pace)) ease; }
.mc-card.up .mc-inner { transform: rotateY(180deg); }
.mc-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid var(--ink); }
.mc-back { background: var(--primary); color: var(--accent); font-size: calc(var(--cw) * 0.4); }
.mc-front { background: var(--surface); transform: rotateY(180deg); font-size: calc(var(--cw) * 0.58); line-height: 1; }
.mc-cols5 .mc-face { border-width: 2px; border-radius: 10px; }
/* 잠긴 카드: 회색 뒷면에 자물쇠와 '잠김' 글자. 짝을 정해진 수만큼 찾으면 열립니다. */
.mc-lock { display: none; flex-direction: column; align-items: center; line-height: 1.1; }
.mc-lock-icon { font-size: calc(var(--cw) * 0.36); }
.mc-lock-text { font-size: max(0.7rem, calc(var(--cw) * 0.2)); font-weight: 800; }
.mc-card.locked .mc-flower { display: none; }
.mc-card.locked .mc-lock { display: flex; }
.mc-card.locked .mc-back { background: var(--grey); color: var(--ink); border-style: dashed; }
.mc-card.locked { cursor: default; }
html.hc .mc-card.locked .mc-back { background: #fff; border-width: 4px; }
.seg-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.seg-wrap .btn { padding: 0.4rem 0.3rem; }
.mc-card.matched .mc-front { background: #dcefdc; border-color: var(--good); border-width: 5px; }
html.hc .mc-card.matched .mc-front { background: #fff; border-style: double; border-width: 8px; }

/* ── 단계(이어서 하기, 단계 목록, 결과) ── */
.level-summary { align-self: flex-start; }
.btn.continue-btn { flex-direction: column; gap: 0.15rem; min-height: 5.2rem; padding: 0.8rem 1rem; border-width: 3px; }
.continue-main { font-size: 1.45rem; font-weight: 800; line-height: 1.3; }
.continue-sub { font-size: 0.95rem; font-weight: 700; opacity: 0.92; }
.level-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
@media (min-width: 560px) { .level-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 319px) { .level-grid { grid-template-columns: repeat(2, 1fr); } }
.btn.level-btn { width: 100%; height: 100%; min-height: 6rem; flex-direction: column; gap: 0.1rem; padding: 0.5rem 0.2rem; line-height: 1.25; }
.level-num { font-size: 1.15rem; font-weight: 800; }
.level-desc { font-size: max(14px, 0.8rem); font-weight: 700; color: var(--muted); }
.level-status { font-size: 0.9rem; font-weight: 800; }
.btn.level-btn.cleared { background: #dcefdc; border-color: var(--good); }
.btn.level-btn.cleared .level-status { color: #8a5a00; letter-spacing: 0.05em; }
.btn.level-btn.current { background: var(--accent); color: var(--accent-ink); border: 4px solid var(--ink); }
.btn.level-btn.current .level-desc { color: var(--accent-ink); }
.btn.level-btn.locked { background: var(--grey); color: var(--muted); border-style: dashed; cursor: default; }
html.hc .btn.level-btn.cleared { background: #fff; border-width: 4px; }
html.hc .btn.level-btn.cleared .level-status { color: #000; }
html.hc .btn.level-btn.locked { opacity: 1; }
.result-stars { text-align: center; font-size: 2.2rem; line-height: 1.2; color: #8a5a00; letter-spacing: 0.1em; }
html.hc .result-stars { color: #000; }

/* ── 내 기록 ── */
.records { width: 100%; border-collapse: collapse; }
.records th, .records td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.records thead th { color: var(--muted); font-size: 0.9rem; }

/* ── 애니메이션 줄이기 ── */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; }

@media (min-width: 700px) {
  .tile-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .screen { padding: 1.2rem 1rem 2.5rem; }
}
