/* 오늘의 칸 — 밝은 바탕 + 포인트 색 1개(초록). 말랑한 버튼(clay), 상태는 선·색·배경으로. Author: Seeknoter */
:root {
  --bg: #f7f4ef;
  --surface: #ffffff;
  --ink: #1f2a28;
  --muted: #56625e;
  --line: #ddd6cc;
  --given: #ece7df;
  --accent: #0e7a55;          /* 포인트 색(흰 글자 대비 5.3:1) */
  --accent-ink: #0a5c40;
  --accent-soft: #e2f3eb;
  --accent-mid: #a9dcc5;
  --late: #8a5a00;            /* 틀린 뒤 맞힌 칸 글자 */
  --bad: #c23b2e;             /* 틀림·기회 */
  --bad-soft: #fbe9e6;
  --radius: 12px;
  --chrome: 290px;            /* 판 밖(머리·막대·패드·안내·여백) 높이 */
  --gap: 4px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Noto Sans KR", "Apple SD Gothic Neo", monospace;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); }
html { overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
/* 2026-10-19 운영판 공통 헤더(#snx-hd — tools 사이트 make-dist 가 body 맨 앞에 넣음) 아래 남은 높이만 쓰도록 세로 flex. 헤더 없는 단독 실행은 그대로 */
body { display: flex; flex-direction: column; overflow: hidden; overscroll-behavior: none; word-break: keep-all; -webkit-tap-highlight-color: transparent; }
button, a, input, label { touch-action: manipulation; font: inherit; }
button { cursor: pointer; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 틀: 한 화면(100dvh) 안 ---------- */
.app {
  height: 100vh; height: 100dvh;
  flex: 1 1 auto; min-height: 0; width: 100%;   /* 헤더가 있으면 그만큼 줄어든다(2026-10-19) */
  max-width: 560px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: stretch;
  padding: max(6px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
  gap: 6px; overflow: hidden;
}
.top { display: flex; align-items: center; gap: 6px; min-height: 52px; }
.title { flex: 1; min-width: 0; }
.title h1 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.day-label { margin: 1px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 연습 판: 날짜 조각만 줄어들고 「· 기록 안 됨」은 늘 보인다 */
.day-label.practice { display: flex; gap: 4px; }
.day-label .dl-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.day-label .dl-tag { flex: none; color: var(--late); font-weight: 600; }
.icon-btn {
  width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--surface);
  display: inline-grid; place-items: center; color: var(--ink); text-decoration: none;
  box-shadow: 0 4px 10px rgba(70, 55, 40, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.05);
}
.icon-btn svg, .chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip {
  height: 44px; padding: 0 12px; border: 0; border-radius: 22px; background: var(--surface);
  display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 16px; color: var(--accent-ink);
  box-shadow: 0 4px 10px rgba(70, 55, 40, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.05);
  font-variant-numeric: tabular-nums;
}
.chip svg { fill: var(--accent-soft); stroke: var(--accent); }
.chip-unit { font-size: 13px; font-weight: 600; color: var(--muted); }
.chip.badge { box-shadow: 0 0 0 2px var(--accent), 0 4px 10px rgba(70, 55, 40, 0.08); }

.bar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.lives { display: flex; gap: 2px; }
.lives svg { width: 24px; height: 24px; }
.lives .heart { fill: var(--bad); stroke: var(--bad); stroke-width: 1.5; }
.lives .heart.lost { fill: transparent; stroke: #b9b0a5; }
.fx { flex: 1; min-width: 0; text-align: center; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; color: var(--ink); }
.fx .f-cell { font-weight: 800; color: var(--accent-ink); margin-right: 6px; }
.fx code { font-family: var(--mono); font-size: 12.5px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1px 4px; }
.fx .f-eq { margin: 0 6px 0 2px; font-weight: 700; color: var(--ink); }
.switch { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px 0 6px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 24px; border-radius: 12px; background: #d8d1c6; position: relative; transition: background-color 180ms var(--ease-out); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12); }
.switch-dot { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 180ms var(--ease-out); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 수식 보기 줄: 고른 칸의 행·열 수식(수식 보기를 켰을 때만) */
.fxline { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.fxline .f-cell { font-weight: 800; color: var(--accent-ink); font-family: var(--mono); }
.fxline code { font-family: var(--mono); font-size: 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 2px 5px; }
.fxline code b { color: var(--accent-ink); }

/* ---------- 판 ---------- */
.stage { flex: 1; min-height: 0; display: grid; place-items: center; }
.board {
  --c: min(calc((min(100vw, 560px) - 24px - 6 * var(--gap)) / 6.2), calc((100vh - var(--chrome) - 6 * var(--gap)) / 5.95), 66px);
  --c: min(calc((min(100vw, 560px) - 24px - 6 * var(--gap)) / 6.2), calc((100dvh - var(--chrome) - 6 * var(--gap)) / 5.95), 66px);
  --sumw: calc(var(--c) * 1.2);
  --sumh: calc(var(--c) * 0.95);
  --hd: 0px;
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(5, var(--c)) var(--sumw);
  grid-template-rows: repeat(5, var(--c)) var(--sumh);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.board.formula {
  --hd: 16px;
  --c: min(calc((min(100vw, 560px) - 24px - 16px - 7 * var(--gap)) / 6.5), calc((100vh - var(--chrome) - 16px - 7 * var(--gap)) / 6.15), 62px);
  --c: min(calc((min(100vw, 560px) - 24px - 16px - 7 * var(--gap)) / 6.5), calc((100dvh - var(--chrome) - 16px - 7 * var(--gap)) / 6.15), 62px);
  --sumw: calc(var(--c) * 1.5);
  --sumh: calc(var(--c) * 1.15);
  grid-template-columns: var(--hd) repeat(5, var(--c)) var(--sumw);
  grid-template-rows: var(--hd) repeat(5, var(--c)) var(--sumh);
}
.cell {
  --glow: 0;
  position: relative; border: 0; padding: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font-size: calc(var(--c) * 0.48); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  box-shadow: 0 0 0 calc(var(--glow) * 5px) rgba(14, 122, 85, 0.3), 0 2px 0 rgba(0, 0, 0, 0.05), inset 0 0 0 1.5px var(--line);
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}
.cell.given { background: var(--given); color: #3a4441; font-weight: 600; box-shadow: 0 0 0 calc(var(--glow) * 5px) rgba(14, 122, 85, 0.3), inset 0 0 0 1px #e2dbd0; }
.cell.empty { background: #fff; }
.cell.empty.cross { background: #eef7f2; box-shadow: 0 0 0 calc(var(--glow) * 5px) rgba(14, 122, 85, 0.3), inset 0 0 0 1.5px var(--accent-mid); }
.cell.first { color: var(--accent); }
.cell.late { color: var(--late); background: #fff8e8; }
.cell.miss { color: var(--bad); background: var(--bad-soft); box-shadow: inset 0 0 0 1.5px #efc2bc; }
.cell.sel { box-shadow: 0 0 0 calc(var(--glow) * 5px) rgba(14, 122, 85, 0.3), inset 0 0 0 3px var(--accent); background: #fff; z-index: 1; }
.cell.flash { background: var(--bad-soft); color: var(--bad); box-shadow: inset 0 0 0 3px var(--bad); } /* 누른 틀린 숫자가 빨갛게 보임(3회차 F7) */
/* 맞힌 뒤 자동으로 옮겨 간 칸: 바깥 고리가 두 번 퍼진다(3회차 F2) */
.cell.moved::after {
  content: ""; position: absolute; inset: -4px; border-radius: calc(var(--radius) + 4px);
  border: 3px solid var(--accent); pointer-events: none; animation: moved 0.5s ease-out 2;
}
@keyframes moved { from { transform: scale(0.9); opacity: 1; } to { transform: scale(1.12); opacity: 0.2; } }
.cell.hint::after {
  content: ""; position: absolute; inset: -3px; border-radius: calc(var(--radius) + 3px);
  border: 2px solid var(--accent); pointer-events: none; animation: hint 1.4s ease-in-out infinite;
}
@keyframes hint { 0%, 100% { transform: scale(0.96); opacity: 0.25; } 50% { transform: scale(1.04); opacity: 1; } }

.sum {
  --glow: 0;
  position: relative; border-radius: var(--radius);
  border: 2px dashed #c4bcb0; background: transparent; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: calc(var(--c) * 0.4); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
  box-shadow: 0 0 0 calc(var(--glow) * 5px) rgba(14, 122, 85, 0.3);
  transition: border-color 200ms var(--ease-out), background-color 200ms var(--ease-out), color 200ms var(--ease-out);
}
.sum.ok { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.sum.ok::after { /* 맞음 표시: 오른쪽 위 체크 배지(숫자를 가리지 않게) */
  content: ""; position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
  box-shadow: 0 0 0 2px var(--bg); z-index: 2;
}
.sum.row.hl, .sum.col.hl { border-color: var(--accent-mid); }
.sum .f { display: none; font-family: var(--mono); font-size: 10.5px; font-weight: 600; line-height: 1.15; color: var(--muted); text-align: center; letter-spacing: -0.02em; }
.sum.ok .f { color: var(--accent-ink); }
.board.formula .sum .f { display: block; }
.board.formula .sum { font-size: calc(var(--c) * 0.36); }
/* 수식 보기: 모서리 ✓ 배지가 좁은 열 합계 칸의 =SUM( 글자를 가리므로 숫자 옆 작은 ✓로 옮긴다(3회차 F3) */
.board.formula .sum.ok::after { display: none; }
.board.formula .sum.ok .v::after {
  content: ""; display: inline-block; width: 0.72em; height: 0.72em; margin-left: 2px; vertical-align: 0.04em; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 80% no-repeat;
}
/* 판 칸 크기 = 판 자리(.stage)의 실제 너비·높이에 맞춤(컨테이너 단위). 지원 안 하면 위 dvh 계산을 쓴다 */
@supports (container-type: size) {
  .stage { container-type: size; }
  .board { --c: min(calc((100cqw - 6 * var(--gap)) / 6.2), calc((100cqh - 6 * var(--gap)) / 5.95), 66px); }
  .board.formula { --c: min(calc((100cqw - 16px - 7 * var(--gap)) / 6.5), calc((100cqh - 16px - 7 * var(--gap)) / 6.15), 62px); }
}
.hd { display: none; align-self: center; justify-self: center; font-size: 12px; font-weight: 700; color: var(--muted); font-family: var(--mono); }
.board.formula .hd { display: block; }
.hd.on { color: var(--accent-ink); }

/* ---------- 숫자 패드(말랑한 버튼) ---------- */
.pad-zone { position: relative; }
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; touch-action: none; user-select: none; -webkit-user-select: none; }
.key {
  height: 52px; border: 0; border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4efe8 100%);
  font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px rgba(70, 55, 40, 0.12), inset 0 -3px 0 rgba(0, 0, 0, 0.06), inset 0 2px 0 #fff;
  transition: transform 120ms var(--ease-out), box-shadow 120ms var(--ease-out);
}
.key:active { transform: translateY(2px) scale(0.98); box-shadow: 0 2px 6px rgba(70, 55, 40, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.06); }
.key.next { font-size: 13px; font-weight: 700; color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.key.next svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pad.off .key { opacity: 0.45; }
.msg { margin: 0; min-height: 22px; font-size: 13px; color: var(--muted); text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.msg.bad { color: var(--bad); font-weight: 600; }
.msg.good { color: var(--accent-ink); font-weight: 600; }
.msg.tip { color: var(--accent-ink); font-weight: 600; }
.msg .link-btn { border: 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; padding: 0 12px; height: 32px; border-radius: 16px; }

.pad-zone.rules .pad, .pad-zone.rules + .msg { display: none; }
.rule-card {
  background: var(--surface); border-radius: 20px; padding: 10px 14px 12px;
  box-shadow: 0 12px 30px rgba(50, 40, 30, 0.18), inset 0 0 0 1px var(--line);
}
.rule-card h2 { margin: 0 0 4px; font-size: 14px; color: var(--accent-ink); }
.rule-card ol { margin: 0 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.rule-card .btn { width: 100%; }

/* ---------- 버튼 ---------- */
.btn {
  min-height: 48px; padding: 0 18px; border: 0; border-radius: 16px; font-size: 16px; font-weight: 700;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 6px 14px rgba(70, 55, 40, 0.1), inset 0 -3px 0 rgba(0, 0, 0, 0.06), inset 0 0 0 1px var(--line);
  transition: transform 120ms var(--ease-out);
}
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(14, 122, 85, 0.28), inset 0 -3px 0 rgba(0, 0, 0, 0.15); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 아래에서 올라오는 판(결과·달력) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(28, 24, 20, 0.38); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  width: min(560px, 100%); margin: 0 auto;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 8px 16px max(16px, env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(40, 30, 20, 0.2);
  display: flex; flex-direction: column; gap: 12px;
}
.sheet > * { flex-shrink: 0; }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: #d4ccc0; margin: 2px auto 0; flex: none; }
.res-title { margin: 4px 0 0; font-size: 22px; text-align: center; }
.res-sub { margin: -6px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--surface); border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 4px; }
.stat-k { font-size: 12px; color: var(--muted); }
.stat-v { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-v.hearts { color: var(--bad); letter-spacing: 1px; }
.stat-v.hearts .off { color: #c9c0b5; }

.streak-card {
  position: relative; overflow: hidden; border-radius: 22px; padding: 16px 18px; color: #fff;
  background: linear-gradient(120deg, #0b6747 0%, #0e7a55 35%, #2f9f74 70%, #6cc39c 100%);
  background-size: 220% 220%; animation: drift 14s ease-in-out infinite alternate;
  display: grid; grid-template-columns: 1fr auto; align-items: end; row-gap: 2px;
  box-shadow: 0 10px 24px rgba(14, 122, 85, 0.25);
}
@keyframes drift { from { background-position: 0% 40%; } to { background-position: 100% 60%; } }
.streak-k { grid-column: 1 / -1; font-size: 13px; font-weight: 600; opacity: 0.92; }
.streak-v { font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.streak-v small { font-size: 16px; font-weight: 700; margin-left: 4px; }
.streak-note { font-size: 13px; text-align: right; opacity: 0.95; }
.streak-note .medal { display: inline-block; background: rgba(255, 255, 255, 0.22); border-radius: 12px; padding: 3px 9px; font-weight: 700; }

.mini { display: grid; grid-template-columns: repeat(5, 20px); gap: 4px; justify-content: center; }
.mini i { width: 20px; height: 20px; border-radius: 5px; display: block; }
.mini .m-first { background: var(--accent); }
.mini .m-late { background: #e9b949; }
.mini .m-given { background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.mini .m-miss { background: var(--bad); }
.res-actions { display: flex; gap: 8px; } /* 공유 버튼이 숨으면(연습) 남은 버튼이 한 줄을 채운다 */
.res-actions .btn { flex: 1 1 0; min-width: 0; }
.share-note { margin: -4px 0 0; min-height: 18px; font-size: 13px; text-align: center; color: var(--accent-ink); font-weight: 600; }
.next { margin: 0; font-size: 13px; text-align: center; color: var(--muted); }
.related { margin: 0; font-size: 14px; text-align: center; }
.related a { color: var(--accent-ink); text-underline-offset: 3px; display: inline-block; padding: 8px 4px; }
.ad-slot { display: block; min-height: 100px; border-radius: 14px; background: var(--surface); padding: 6px; }
.ad-slot:empty { display: none; }
.ad-label { display: block; font-size: 11px; color: var(--muted); margin: 0 0 4px 2px; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ---------- 달력 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { margin: 0; font-size: 20px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-month { margin: 0; font-weight: 700; font-size: 15px; text-align: center; flex: 1; }
.cal-nav .icon-btn:disabled { opacity: 0.35; box-shadow: none; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid .wd { font-size: 12px; color: var(--muted); padding: 2px 0; }
.cal-day {
  height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--ink); width: 44px; justify-self: center;
  box-shadow: inset 0 0 0 1px var(--line);
}
.cal-day.done { background: var(--accent); color: #fff; box-shadow: none; }
.cal-day.fail { background: #f8d3cd; color: #a52a1f; box-shadow: inset 0 0 0 1.5px #eaa79d; } /* 실패 = 연한 빨강(초록 = 완료와 구분, 3회차 F4) */
.cal-day.pre { color: #b6ada2; box-shadow: none; } /* 첫 판 전 날짜: 흐리게(「안 함」 고리 없음, 3회차 F5) */
.cal-day.future { color: #b6ada2; box-shadow: none; cursor: default; }
.cal-day.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.cal-day.cur { outline: 3px dashed var(--accent); outline-offset: 2px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; justify-content: center; font-size: 13px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.sw.done { background: var(--accent); }
.sw.fail { background: #f3c4bd; box-shadow: inset 0 0 0 1px #e29a90; }
.sw.none { box-shadow: inset 0 0 0 1px #b9b0a5; }
.cal-help.cal-first { color: var(--ink); font-weight: 600; }
.cal-help, .privacy-note { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.answer { display: grid; grid-template-columns: repeat(5, 40px) 48px; gap: 4px; justify-content: center; }
.answer span { height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-variant-numeric: tabular-nums; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.answer .a-given { background: var(--given); font-weight: 600; }
.answer .a-blank { color: var(--accent); }
.answer .a-sum { background: transparent; border: 2px solid var(--accent-mid); box-shadow: none; color: var(--accent-ink); }
.answer .a-cap { grid-column: 1 / -1; height: auto; background: none; box-shadow: none; font-size: 13px; font-weight: 600; color: var(--muted); }
.noscript { padding: 24px; text-align: center; }

/* 좁은 화면(폴드 접힘·카톡 인앱 포함, 1279px 까지): 판이 한 화면 안에 들어오게 여백을 줄인다 */
@media (max-width: 1279px) {
  .app { gap: 5px; }
}
@media (max-height: 620px) {
  :root { --chrome: 256px; }
  .app { gap: 4px; }
  .top { min-height: 46px; }
  .bar { min-height: 40px; }
  .key { height: 46px; }
  .pad { gap: 6px; }
  .title h1 { font-size: 18px; }
  .day-label { font-size: 12px; }
  .fxline { display: none !important; } /* 낮은 화면: 합계 칸의 수식만 보이고 위 줄은 접는다 */
  /* 첫 방문 규칙 카드를 낮춰 판 칸이 44px 아래로 줄지 않게(360×560 기준) */
  .rule-card { padding: 8px 12px 10px; }
  .rule-card h2 { margin-bottom: 2px; }
  .rule-card ol { margin-bottom: 6px; line-height: 1.4; }
  .rule-card .btn { min-height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cell.hint::after { opacity: 1; transform: none; }
}
