/* 우리 반 낱말 매칭 — 스타일 */
:root {
  --bg: #fff7ec;
  --ink: #1f2340;
  --muted: #5b6080;
  --purple: #7c3aed;
  --pink: #ec4899;
  --orange: #f97316;
  --yellow: #facc15;
  --green: #16a34a;
  --sky: #0ea5e9;
  --red: #dc2626;
  --card: #ffffff;
  --line: #e7e2f3;
  --radius: 18px;
  --shadow: 0 6px 0 rgba(31, 35, 64, .12), 0 10px 24px rgba(31, 35, 64, .10);
  --font-fun: 'Jua', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --font-body: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 10%, #ffe4f1 0 120px, transparent 121px),
    radial-gradient(circle at 92% 18%, #dff3ff 0 150px, transparent 151px),
    radial-gradient(circle at 80% 95%, #fff3c4 0 170px, transparent 171px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--font-fun); font-weight: 400; margin: 0; }

.loading-screen { display: grid; place-items: center; min-height: 60vh; font-family: var(--font-fun); font-size: 28px; color: var(--muted); }

/* ---------- 공통 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 22px;
  font-family: var(--font-fun); font-size: 20px; line-height: 1.2;
  background: var(--purple); color: #fff;
  box-shadow: 0 4px 0 rgba(0,0,0,.18);
  transition: transform .08s, box-shadow .08s, filter .15s;
  min-height: 48px;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn:disabled { background: #b8b5c9 !important; color: #fff !important; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.big { font-size: 26px; padding: 16px 34px; border-radius: 18px; min-height: 62px; }
.btn.small { font-size: 16px; padding: 7px 14px; min-height: 38px; border-radius: 11px; }
.btn.pink { background: var(--pink); }
.btn.orange { background: var(--orange); }
.btn.green { background: var(--green); }
.btn.sky { background: var(--sky); }
.btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(31,35,64,.15); border: 2px solid var(--line); }

/* ---------- 상단 바 ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; background: #fff; box-shadow: 0 3px 0 var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-family: var(--font-fun); font-size: 22px; color: var(--purple); }
.topbar .spacer { flex: 1; }
.me-chip {
  font-family: var(--font-fun); font-size: 20px;
  background: linear-gradient(135deg, #fde68a, #fbcfe8); color: var(--ink);
  border: 3px solid #fff; outline: 2px solid #f9a8d4; border-radius: 999px; padding: 6px 16px;
  box-shadow: 0 3px 0 rgba(0,0,0,.1);
}

.page { max-width: 1100px; margin: 0 auto; padding: 22px 18px 80px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h2 { font-size: 30px; flex: 1; min-width: 200px; }

/* ---------- 로그인 ---------- */
.login { max-width: 980px; margin: 0 auto; padding: 28px 16px 60px; text-align: center; }
.logo { font-size: clamp(34px, 7vw, 58px); color: var(--purple); text-shadow: 3px 3px 0 #fde68a; }
.login .sub { font-family: var(--font-fun); font-size: 24px; color: var(--muted); margin: 6px 0 24px; }
.num-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.num-btn {
  border: 0; border-radius: 20px; padding: 14px 6px; min-height: 92px;
  font-family: var(--font-fun); font-size: 34px; color: #fff;
  box-shadow: 0 6px 0 rgba(0,0,0,.18); transition: transform .08s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1;
}
.num-btn small { font-size: 16px; opacity: .95; margin-top: 4px; font-family: var(--font-body); font-weight: 700; }
.num-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.teacher-link { margin-top: 34px; }

/* ---------- 게임 목록 ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.game-card {
  text-align: left; border: 0; border-radius: var(--radius); padding: 20px; background: #fff; box-shadow: var(--shadow);
  border-top: 10px solid var(--c, var(--purple)); display: flex; flex-direction: column; gap: 10px; min-height: 160px;
  transition: transform .12s;
}
.game-card:hover { transform: translateY(-3px) rotate(-.4deg); }
.game-card h3 { font-size: 26px; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere; }
.game-card .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 15px; }
.tag { display: inline-block; background: #f1ecff; color: #4c1d95; border-radius: 999px; padding: 3px 11px; font-weight: 700; font-size: 15px; }
.tag.yellow { background: #fef3c7; color: #92400e; }
.tag.green { background: #dcfce7; color: #166534; }
.tag.pink { background: #fce7f3; color: #9d174d; }
.game-card .best { margin-top: auto; font-family: var(--font-fun); font-size: 20px; color: var(--orange); }
.game-card .best.none { color: var(--muted); font-size: 17px; }
.empty { text-align: center; padding: 50px 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); font-family: var(--font-fun); font-size: 22px; color: var(--muted); }

/* ---------- 매칭 게임 ---------- */
.play {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; background: var(--bg); z-index: 30; overflow: hidden;
}
.test-banner {
  background: repeating-linear-gradient(45deg, #fde047 0 18px, #facc15 18px 36px);
  color: #422006; font-family: var(--font-fun); font-size: 18px; text-align: center; padding: 6px 10px; flex: none;
}
.play-bar {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 46px;
  background: #fff; box-shadow: 0 2px 0 var(--line); position: relative;
}
.play-bar .exit { border: 0; background: #f1f0f7; color: var(--ink); border-radius: 10px; width: 34px; height: 34px; font-size: 18px; flex: none; }
.play-title { font-family: var(--font-fun); font-size: 17px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.chips { display: flex; gap: 6px; flex: none; }
.chip { font-family: var(--font-fun); font-size: 15px; border-radius: 999px; padding: 3px 10px; color: #fff; animation: pop .3s; white-space: nowrap; }
.chip.combo { background: linear-gradient(135deg, #f97316, #ec4899); }
.chip.speed { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.score-badge {
  font-family: var(--font-fun); font-size: 18px; background: var(--purple); color: #fff;
  border-radius: 999px; padding: 4px 14px; flex: none; min-width: 74px; text-align: center; transition: transform .15s;
}
.score-badge.bump { transform: scale(1.25); }
.speed-bar { position: absolute; left: 0; bottom: -2px; height: 4px; background: linear-gradient(90deg, #22d3ee, #6366f1); border-radius: 0 4px 4px 0; transition: width .2s linear; }

.board-wrap { flex: 1; min-height: 0; position: relative; padding: 8px; }
.board-wrap.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.board { display: grid; justify-content: center; align-content: center; width: 100%; height: 100%; }
.board-wrap.scroll .board { height: auto; min-height: 100%; }

.mcard {
  position: relative; border: 0; padding: 0; border-radius: 14px;
  box-shadow: 0 4px 0 rgba(31,35,64,.18); transition: transform .12s, box-shadow .12s, opacity .4s, background .2s;
  color: var(--ink); overflow: hidden;
}
.mcard.term { background: #e0f2fe; border: 3px solid #7dd3fc; }
.mcard.answer { background: #fef9c3; border: 3px solid #fde047; }
.mcard .fit { position: absolute; display: flex; align-items: center; justify-content: center; }
.mcard .txt {
  max-width: 100%; text-align: center; font-family: var(--font-fun); line-height: 1.2;
  word-break: keep-all; white-space: pre-wrap;
}
.mcard .txt.wrap-any { overflow-wrap: anywhere; word-break: break-all; }
.mcard:hover { transform: translateY(-2px); }
.mcard.selected { transform: translateY(-4px) scale(1.03); border-color: var(--purple); box-shadow: 0 0 0 4px #c4b5fd, 0 8px 0 rgba(31,35,64,.2); background: #ede9fe; }
.mcard.right { background: #bbf7d0 !important; border-color: #22c55e !important; animation: pop .35s; }
.mcard.wrong { background: #fecaca !important; border-color: #ef4444 !important; animation: shakeX .35s; }
.mcard.done { opacity: 0; pointer-events: none; transform: scale(.85); }
.mcard.hint { animation: wiggle .7s ease-in-out infinite; border-color: #f59e0b; box-shadow: 0 0 0 4px #fde68a, 0 4px 0 rgba(31,35,64,.18); }
.mcard .hint-ico { position: absolute; top: 2px; right: 4px; font-size: 18px; line-height: 1; }

.start-overlay, .result-overlay {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; text-align: center; background: var(--bg); overflow-y: auto;
}
.start-overlay h1 { font-size: clamp(32px, 7vw, 60px); color: var(--purple); word-break: keep-all; text-shadow: 3px 3px 0 #fde68a; }
.rules { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 22px; text-align: left; font-size: 17px; max-width: 520px; }
.rules li { margin: 4px 0; }

.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.float-pts { position: absolute; font-family: var(--font-fun); font-size: 30px; color: var(--green); text-shadow: 2px 2px 0 #fff; animation: floatUp 1s forwards; white-space: nowrap; transform: translate(-50%, -50%); }
.float-pts.minus { color: var(--red); }
.big-fx { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-family: var(--font-fun); font-size: clamp(36px, 9vw, 84px); white-space: nowrap; animation: bigFx 1s forwards; -webkit-text-stroke: 2px #fff; paint-order: stroke fill; }
.big-fx.combo { color: #f97316; text-shadow: 4px 4px 0 #7c3aed; }
.big-fx.speed { color: #0ea5e9; text-shadow: 4px 4px 0 #1e3a8a; top: 56%; font-size: clamp(28px, 7vw, 60px); }
.big-fx.wrong { color: #dc2626; text-shadow: 3px 3px 0 #fff; font-size: clamp(22px, 5vw, 36px); top: 50%; -webkit-text-stroke: 0; }
.big-fx.hintfx { color: #b45309; font-size: clamp(24px, 6vw, 44px); top: 30%; }
.play.shake { animation: shakeScreen .4s; }

/* ---------- 결과 ---------- */
.result-overlay { justify-content: flex-start; padding-top: 30px; }
.result-overlay h1 { font-size: clamp(30px, 6vw, 52px); color: var(--purple); word-break: keep-all; }
.final-score { font-family: var(--font-fun); font-size: clamp(44px, 11vw, 96px); color: var(--orange); text-shadow: 4px 4px 0 #fde68a; line-height: 1.1; animation: pop .6s; }
.final-sub { font-family: var(--font-fun); font-size: 26px; color: var(--pink); }
.new-best { font-family: var(--font-fun); font-size: 22px; background: var(--yellow); color: #713f12; padding: 4px 16px; border-radius: 999px; animation: wiggle 1s infinite; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.board-box { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; width: min(520px, 100%); text-align: left; }
.board-box h3 { font-size: 24px; margin-bottom: 8px; text-align: center; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; font-size: 19px; }
.rank-row:nth-child(odd) { background: #faf8ff; }
.rank-row .rk { font-family: var(--font-fun); width: 64px; font-size: 21px; }
.rank-row .no { flex: 1; font-weight: 700; }
.rank-row .sc { font-family: var(--font-fun); color: var(--orange); }
.rank-row.mine { background: #fde68a !important; outline: 3px solid #f59e0b; }
.rank-gap { text-align: center; color: var(--muted); }
.notice-box { background: #fef9c3; border: 3px dashed #eab308; color: #422006; border-radius: var(--radius); padding: 16px 20px; font-size: 19px; max-width: 520px; }
.confetti { position: fixed; top: -20px; z-index: 60; pointer-events: none; font-size: 22px; animation: fall linear forwards; }

/* ---------- 내 기록 ---------- */
.rec-group { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.rec-group h3 { font-size: 23px; margin-bottom: 8px; }
.rec-line { display: flex; gap: 12px; padding: 6px 10px; border-radius: 10px; align-items: center; flex-wrap: wrap; }
.rec-line .d { color: var(--muted); font-size: 16px; min-width: 120px; }
.rec-line .s { font-family: var(--font-fun); font-size: 20px; }
.rec-line.best { background: #fef3c7; }

/* ---------- 교사 ---------- */
.teacher-bar { background: linear-gradient(90deg, #4c1d95, #7c3aed); color: #fff; }
.teacher-bar .brand { color: #fff; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 0; background: rgba(255,255,255,.16); color: #fff; font-family: var(--font-fun); font-size: 18px; padding: 8px 16px; border-radius: 12px; }
.tab.on { background: #fff; color: #4c1d95; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.panel h3 { font-size: 24px; margin-bottom: 10px; }
.row-list { display: flex; flex-direction: column; gap: 10px; }
.g-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: #faf8ff; border: 2px solid var(--line); }
.g-row .t { flex: 1; min-width: 180px; }
.g-row .t b { font-family: var(--font-fun); font-weight: 400; font-size: 22px; display: block; word-break: keep-all; overflow-wrap: anywhere; }
.g-row .t span { font-size: 15px; color: var(--muted); }
.g-row .acts { display: flex; gap: 6px; flex-wrap: wrap; }

label.fld { display: block; font-weight: 700; margin: 12px 0 6px; }
.inp, .sel, .area {
  width: 100%; border: 2px solid #d8d2ea; border-radius: 12px; padding: 10px 12px; background: #fff; color: var(--ink); font-size: 18px;
}
.inp:focus, .sel:focus, .area:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px #ddd6fe; }
.area { min-height: 170px; resize: vertical; font-family: var(--font-body); line-height: 1.6; }
.help { color: var(--muted); font-size: 15px; margin-top: 6px; }
.status-line { margin: 12px 0 6px; font-weight: 700; }
.status-line.ok { color: var(--green); }
.status-line.bad { color: var(--red); }
.err-list { margin: 4px 0 10px; padding: 10px 14px 10px 30px; background: #fef2f2; border: 2px solid #fecaca; color: #991b1b; border-radius: 12px; font-size: 16px; }
.warn-line { color: #b45309; font-size: 16px; font-weight: 700; }

.ptable { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.ptable th { text-align: left; font-size: 15px; color: var(--muted); padding: 0 8px; }
.ptable td { padding: 0 4px; vertical-align: top; }
.ptable td.n { width: 40px; text-align: center; color: var(--muted); font-weight: 700; padding-top: 10px; }
.ptable td.x { width: 48px; }
.cell { width: 100%; border: 2px solid transparent; background: #f5f3ff; border-radius: 10px; padding: 8px 10px; font-size: 17px; color: var(--ink); }
.cell:hover { border-color: #ddd6fe; }
.cell:focus { outline: none; border-color: var(--purple); background: #fff; }
tr.bad .cell { background: #fee2e2; }
.row-err { color: #b91c1c; font-size: 14px; padding: 2px 6px 0; }
.del-btn { border: 0; background: #fee2e2; color: #b91c1c; border-radius: 10px; width: 40px; height: 40px; font-size: 18px; font-weight: 700; }
.del-btn:hover { background: #fecaca; }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stat { background: #f5f3ff; border-radius: 14px; padding: 10px 16px; min-width: 130px; }
.stat b { display: block; font-family: var(--font-fun); font-weight: 400; font-size: 28px; color: var(--purple); }
.stat span { font-size: 14px; color: var(--muted); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 190px) 1fr; gap: 10px; align-items: center; font-size: 16px; }
.bar-row .lb { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #f1f0f7; border-radius: 999px; height: 30px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; color: #fff; font-family: var(--font-fun); font-size: 16px; min-width: 52px; transition: width .6s; }
.sort-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.seg { border: 2px solid #d8d2ea; background: #fff; color: var(--ink); border-radius: 10px; padding: 6px 12px; font-weight: 700; font-size: 15px; }
.seg.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 16px; min-width: 640px; }
.dtable th { background: #f5f3ff; text-align: left; padding: 10px; font-size: 15px; color: #4c1d95; white-space: nowrap; }
.dtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable tr.main td { font-weight: 700; }
.dtable tr.main.top td:first-child { color: var(--orange); }
.dtable tr.sub td { background: #fcfbff; font-size: 15px; color: var(--muted); }
.dtable tr.sub.best td { color: #92400e; background: #fffbeb; }
.lnk { border: 0; background: none; color: var(--purple); font-weight: 700; text-decoration: underline; padding: 0; font-size: 15px; }
.ok-msg { color: var(--green); font-weight: 700; margin-top: 8px; }
.bad-msg { color: var(--red); font-weight: 700; margin-top: 8px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline .inp { width: 120px; }
.names-area { min-height: 320px; }
.pin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }

.demo-flag { position: fixed; left: 10px; bottom: 10px; z-index: 90; background: #1f2340; color: #fff; font-size: 13px; padding: 5px 10px; border-radius: 8px; opacity: .85; pointer-events: none; }

/* ---------- 팝업 (항상 또렷한 대비) ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(17, 12, 40, .62);
  display: flex; align-items: center; justify-content: center; padding: 16px; animation: fadeIn .15s;
}
.modal {
  background: #ffffff !important; color: #111827 !important; border-radius: 22px; padding: 24px 22px 20px;
  width: min(440px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.35); border: 4px solid #7c3aed; animation: pop .25s;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-family: var(--font-fun); font-size: 26px; color: #4c1d95 !important; margin-bottom: 8px; }
.modal p { margin: 0 0 12px; color: #111827 !important; font-size: 18px; word-break: keep-all; }
.modal .inp { background: #ffffff !important; color: #111827 !important; border-color: #a78bfa; font-size: 26px; text-align: center; letter-spacing: 6px; }
.modal .m-err { color: #b91c1c !important; background: #fee2e2; border-radius: 10px; padding: 8px 12px; font-weight: 700; margin-top: 10px; font-size: 16px; }
.modal .m-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal .btn { color: #ffffff !important; }
.modal .btn.ghost { background: #f3f4f6 !important; color: #111827 !important; border-color: #d1d5db; }

/* ---------- 토스트 ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1f2340; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.25); animation: pop .25s; max-width: 90vw; text-align: center; }
.toast.bad { background: #b91c1c; }

/* ---------- 애니메이션 ---------- */
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); } 20% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -190%) scale(1); } }
@keyframes bigFx { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-8deg); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(3deg); } 70% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(.95); } }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes shakeScreen { 0%,100% { transform: translate(0,0); } 15% { transform: translate(-10px, 4px); } 30% { transform: translate(9px, -4px); } 45% { transform: translate(-7px, 3px); } 60% { transform: translate(6px, -2px); } 80% { transform: translate(-3px, 1px); } }
@keyframes wiggle { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-3deg) scale(1.03); } 75% { transform: rotate(3deg) scale(1.03); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (max-width: 600px) {
  body { font-size: 17px; }
  .page { padding: 16px 12px 70px; }
  .page-head h2 { font-size: 25px; }
  .num-grid { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
  .num-btn { min-height: 76px; font-size: 28px; }
  .topbar { padding: 10px 12px; }
  .topbar .brand { font-size: 19px; }
  .me-chip { font-size: 17px; padding: 5px 12px; }
  .play-title { font-size: 15px; }
  .chip { font-size: 13px; padding: 2px 8px; }
  .score-badge { font-size: 16px; padding: 3px 10px; min-width: 60px; }
  .panel { padding: 16px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .mcard.hint { animation: none; }
  .new-best { animation: none; }
}
