/* 데일리네모 — 데일리도쿠와 같은 디자인 계열(초록 포인트). 한 화면 세로 앱: 홈 / 보관함 / 게임, 아래에서 올라오는 시트 */
:root {
  --bg: #F4F6F1;
  --card: #FFFFFF;
  --ink: #1E2A44;
  --sub: #6F778A;
  --line: #D8D2C5;
  --line-strong: #1E2A44;
  --accent: #12A06E;
  --accent-ink: #FFFFFF;
  --accent-soft: #DDF3E9;
  --peer: #EEF1F6;
  --same: #BFE8D5;
  --given: #1E2A44;
  --user: #0E8A5E;
  --error: #E5484D;
  --error-soft: #FDE8E8;
  --gold: #F2A900;
  --warm: #FFF4D6;
  --warm-ink: #8A5A00;
  --late: #95D8BA;
  --shadow: 0 2px 10px rgba(30,42,68,.06);
  --scale: 1;
  --top: max(var(--ncq-toss-top, 0px), var(--ncq-safe-top, env(safe-area-inset-top, 0px)));
  --bottom: max(var(--ncq-banner-bottom, 0px), var(--ncq-safe-bottom, env(safe-area-inset-bottom, 0px)));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161F; --card: #1B2130; --ink: #E7EBF3; --sub: #98A1B3; --line: #2E3647; --line-strong: #9AA6BE;
    --accent: #2FBF86; --accent-ink: #FFFFFF; --accent-soft: #173A2D; --peer: #222A3B; --same: #22553F;
    --given: #E7EBF3; --user: #6FD9AE; --error: #FF6B6F; --error-soft: #3A1F25; --gold: #F5B82E;
    --warm: #3A3018; --warm-ink: #F5CF7A; --late: #2F6B53; --shadow: 0 2px 10px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161F; --card: #1B2130; --ink: #E7EBF3; --sub: #98A1B3; --line: #2E3647; --line-strong: #9AA6BE;
  --accent: #2FBF86; --accent-ink: #FFFFFF; --accent-soft: #173A2D; --peer: #222A3B; --same: #22553F;
  --given: #E7EBF3; --user: #6FD9AE; --error: #FF6B6F; --error-soft: #3A1F25; --gold: #F5B82E;
  --warm: #3A3018; --warm-ink: #F5CF7A; --late: #2F6B53; --shadow: 0 2px 10px rgba(0,0,0,.3); color-scheme: dark;
}
:root.big { --scale: 1.14; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: calc(16px * var(--scale)); overscroll-behavior: none; user-select: none; -webkit-user-select: none; }
button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

#app { max-width: 520px; margin: 0 auto; height: 100%; position: relative; overflow: hidden; }
.screen { display: none; height: 100%; flex-direction: column; gap: 12px;
  padding: calc(var(--top) + 12px) max(16px, env(safe-area-inset-right, 0px)) calc(var(--bottom) + 12px) max(16px, env(safe-area-inset-left, 0px));
  overflow-y: auto; }
.screen.active { display: flex; }

.icon-btn { width: 44px; height: 44px; flex: none; border-radius: 12px; font-size: 22px; display: grid; place-items: center; }
.icon-btn:active { background: var(--peer); }

/* 시작 화면 */
#splash { justify-content: space-between; align-items: center; text-align: center; cursor: pointer;
  background: radial-gradient(120% 70% at 50% 30%, var(--accent-soft), var(--bg) 70%); }
.splash-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.splash-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(44vw, 172px); aspect-ratio: 1; margin-bottom: 18px;
  padding: 6px; border-radius: 22px; background: var(--line-strong); box-shadow: 0 12px 30px rgba(30,42,68,.18); }
.splash-grid span { display: grid; place-items: center; border-radius: 14px; background: var(--card); color: var(--given);
  font-size: calc(min(44vw, 172px) / 4.2); font-weight: 800; font-variant-numeric: tabular-nums;
  opacity: 0; transform: scale(.4); animation: tile-in .42s cubic-bezier(.2,1.5,.4,1) forwards; }
.splash-grid span.hl { background: var(--accent); color: var(--accent-ink); }
@keyframes tile-in { to { opacity: 1; transform: scale(1); } }
.splash-title { margin: 0; font-size: calc(2.6em); letter-spacing: -1px; opacity: 0; animation: rise .5s ease .55s forwards; }
.splash-title span { color: var(--accent); }
.splash-tag { margin: 0; color: var(--sub); font-size: 1em; opacity: 0; animation: rise .5s ease .7s forwards; }
.splash-today { margin-top: 14px; padding: 8px 14px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow);
  font-size: .94em; font-weight: 600; opacity: 0; animation: rise .5s ease .85s forwards; }
.splash-vs { background: var(--warm); color: var(--warm-ink); border-radius: 14px; padding: 10px 14px; font-size: .94em; font-weight: 600; opacity: 0; animation: rise .5s ease 1s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.splash-bottom { width: 100%; opacity: 0; animation: rise .5s ease 1s forwards; }
.splash-hint { margin: 10px 0 0; color: var(--sub); font-size: .82em; }

/* 홈 */
.home-top { display: flex; align-items: center; justify-content: space-between; padding-right: var(--ncq-toss-right, 0px); }
.top-actions { display: flex; gap: 2px; }
.logo { font-size: 1.65em; margin: 0; letter-spacing: -0.5px; }
.logo span { color: var(--accent); }
.today-card, .classic-card, .panel { background: var(--card); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.today-date { color: var(--sub); font-size: .94em; }
.today-title { font-size: 1.75em; font-weight: 800; margin: 2px 0 4px; }
.today-sub { color: var(--sub); font-size: .94em; margin-bottom: 14px; }
.vs-banner, .vs-line { background: var(--warm); color: var(--warm-ink); border-radius: 12px; padding: 10px 12px; font-size: .94em; margin-bottom: 10px; }
.vs-line { text-align: center; padding: 6px; margin: 0; }
.btn { display: block; width: 100%; border-radius: 14px; padding: 15px; font-size: 1.06em; font-weight: 700; margin-top: 8px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:active { filter: brightness(.92); }
.btn.big { font-size: 1.2em; padding: 17px; }
.btn.ghost { background: var(--peer); color: var(--ink); }
.btn.small { font-size: .85em; padding: 9px 12px; margin-top: 0; }
.btn.done { background: var(--accent-soft); color: var(--accent); }
.btn.warm { background: var(--gold); color: #2B1D00; margin-top: 0; width: auto; white-space: nowrap; font-size: .94em; padding: 12px 14px; }
.btn.danger { background: var(--error-soft); color: var(--error); }

.risk-card { display: flex; align-items: center; gap: 12px; background: var(--warm); color: var(--warm-ink); border-radius: 18px; padding: 14px 16px; }
.risk-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: .88em; }
.risk-text b { font-size: 1.1em; }

.streak-row { display: flex; justify-content: space-around; margin-top: 18px; text-align: center; }
.streak-row b { display: block; font-size: 1.5em; font-variant-numeric: tabular-nums; }
.streak-row small, .result-stats small { color: var(--sub); font-size: .82em; }
.week { display: flex; justify-content: space-between; margin-top: 16px; }
.week div { flex: 1; text-align: center; font-size: .75em; color: var(--sub); }
.week i { display: block; width: 28px; height: 28px; line-height: 28px; margin: 4px auto 0; border-radius: 50%;
  background: var(--peer); font-style: normal; font-size: 14px; color: transparent; }
.week i.on { background: var(--accent); color: var(--accent-ink); }
.week i.late { background: var(--late); color: var(--accent-ink); }
.week i.today { outline: 2px solid var(--accent); outline-offset: 1px; }

.ranking { margin-top: 16px; border-top: 1px solid var(--peer); padding-top: 14px; }
.ranking-title { font-weight: 800; margin-bottom: 8px; }
.ranking ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--peer); font-variant-numeric: tabular-nums; }
.ranking li.me { background: var(--accent-soft); font-weight: 700; }
.ranking li .pos { width: 22px; text-align: center; font-weight: 800; color: var(--sub); }
.ranking li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking li .tm { font-weight: 700; }

.month-strip { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); text-align: left; }
.month-strip span:first-child { font-weight: 700; white-space: nowrap; }
.month-strip .bar { flex: 1; height: 8px; border-radius: 4px; background: var(--peer); overflow: hidden; }
.month-strip .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.month-strip .go { color: var(--accent); font-weight: 700; white-space: nowrap; font-size: .9em; }

.section-title { font-size: 1.15em; font-weight: 800; margin-bottom: 12px; }
.section-title small { font-size: .7em; color: var(--sub); font-weight: 500; margin-left: 6px; }
.diff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.diff-btn { background: var(--peer); border-radius: 14px; padding: 14px 12px; text-align: left; }
.diff-btn b { display: block; font-size: 1.06em; }
.diff-btn small { color: var(--sub); font-size: .82em; }
.diff-btn:disabled { opacity: .45; }
.diff-btn:active:not(:disabled) { background: var(--same); }

/* 신규 유저 첫 판 */
.first-card { background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 20px; box-shadow: var(--shadow); }
.first-badge { display: inline-block; font-size: .78em; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.2); }
.first-title { font-size: 1.5em; font-weight: 800; margin: 8px 0 4px; }
.first-sub { margin: 0 0 6px; font-size: .94em; line-height: 1.5; opacity: .92; }
.first-card .btn.primary { background: var(--card); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.coach { background: var(--accent); color: var(--accent-ink); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.coach p { margin: 0; flex: 1; min-width: 0; font-size: .94em; line-height: 1.5; font-weight: 600; }
.coach .btn { width: auto; flex: none; background: var(--card); color: var(--accent); }
.cell.coach-cell { animation: coach-pulse 1.1s ease-in-out infinite; }
.tool.coach-tool { animation: coach-pulse 1.1s ease-in-out infinite; border-radius: 12px; }
@keyframes coach-pulse { 0%, 100% { box-shadow: inset 0 0 0 0 var(--gold); } 50% { box-shadow: inset 0 0 0 4px var(--gold); } }

/* 기록 · 보관함 */
.panel { padding: 16px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font-size: 1.1em; }
.cal-dow, .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-dow span { font-size: .75em; color: var(--sub); padding: 4px 0; }
.cal button, .cal span { aspect-ratio: 1; max-width: 100%; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; font-size: .94em; }
.cal button { background: var(--peer); }
.cal button.done { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.cal button.late { background: var(--late); color: var(--accent-ink); font-weight: 700; }
.cal button.today { outline: 2px solid var(--accent); outline-offset: 1px; }
.cal button:disabled { background: transparent; color: var(--line); }
.cal button small { font-size: .6em; line-height: 1; margin-top: 2px; letter-spacing: -1px; }
.cal button.open small { color: var(--sub); }
.cal-foot { text-align: center; margin-top: 10px; color: var(--sub); font-size: .9em; }
.cal-foot b { color: var(--ink); }
.cal-legend { display: flex; justify-content: center; gap: 14px; margin-top: 8px; font-size: .75em; color: var(--sub); flex-wrap: wrap; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg.done { background: var(--accent); } .lg.late { background: var(--late); } .lg.open { background: var(--peer); outline: 1px solid var(--line); }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { background: var(--peer); border-radius: 14px; padding: 12px 6px; text-align: center; font-size: .82em; }
.badge i { display: block; font-style: normal; font-size: 1.9em; margin-bottom: 4px; }
.badge.off { opacity: .35; filter: grayscale(1); }
.bests { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.bests div { background: var(--peer); border-radius: 12px; padding: 10px 4px; }
.bests b { display: block; font-variant-numeric: tabular-nums; }
.bests small { color: var(--sub); font-size: .78em; }

/* 게임 */
.game-top { display: flex; align-items: center; gap: 4px; padding-right: var(--ncq-toss-right, 0px); }
.game-info { flex: 1; text-align: center; min-width: 0; }
.game-mode { font-weight: 800; font-size: 1.06em; }
.game-meta { color: var(--sub); font-size: .94em; font-variant-numeric: tabular-nums; }
.game-meta .bad { color: var(--error); font-weight: 700; }
#game .board-wrap { margin-top: auto; }
.board { display: grid; grid-template-columns: repeat(9, 1fr); aspect-ratio: 1; width: 100%; max-width: 100%;
  border: 2.5px solid var(--line-strong); border-radius: 10px; overflow: hidden; background: var(--card); }
.cell { position: relative; display: grid; place-items: center; font-size: calc(clamp(22px, 7vw, 32px) * var(--scale)); font-weight: 500;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--user);
  font-variant-numeric: tabular-nums; transition: background .12s; }
.cell.lc { border-right: 0; }
.cell.lr { border-bottom: 0; }
/* 작은 판 (신규 유저 4×4·6×6) */
.board[data-size="4"] .cell { font-size: calc(clamp(34px, 12vw, 52px) * var(--scale)); }
.board[data-size="6"] .cell { font-size: calc(clamp(28px, 9vw, 42px) * var(--scale)); }
.board[data-size="4"] .notes { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); font-size: calc(clamp(12px, 3.6vw, 16px) * var(--scale)); }
.board[data-size="6"] .notes { grid-template-rows: repeat(2, 1fr); font-size: calc(clamp(11px, 3vw, 14px) * var(--scale)); }
.board[data-size="4"] .cell.br, .board[data-size="6"] .cell.br { border-right-width: 3px; }
.board[data-size="4"] .cell.bb, .board[data-size="6"] .cell.bb { border-bottom-width: 3px; }
.pad[data-size="4"], .pad[data-size="6"] { gap: 8px; }
.pad[data-size="4"] .num, .pad[data-size="6"] .num { background: var(--peer); }
.cell.br { border-right: 2px solid var(--line-strong); }
.cell.bb { border-bottom: 2px solid var(--line-strong); }
.cell.given { color: var(--given); font-weight: 700; }
.cell.peer { background: var(--peer); }
.cell.same { background: var(--same); }
.cell.hint-unit { background: var(--warm); }
.cell.hint-cell { background: var(--gold); color: #2B1D00; }
.cell.sel { background: var(--accent); color: var(--accent-ink) !important; }
.cell.wrong { color: var(--error); background: var(--error-soft); }
.cell.sel.wrong { background: var(--error); color: #fff !important; }
.cell.flash { animation: flash .5s ease; }
@keyframes flash { 0% { background: var(--accent-soft); } 50% { background: var(--same); } 100% { background: inherit; } }
.cell.pop { animation: pop .18s ease; }
@keyframes pop { 50% { transform: scale(1.18); } }
.notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); /* 칸 9개 고정: 숫자마다 자리가 정해져 있어요 */ font-size: calc(clamp(9px, 2.6vw, 12px) * var(--scale));
  color: var(--sub); font-weight: 600; }
.notes span { display: grid; place-items: center; min-height: 0; line-height: 1; }
.cell.sel .notes { color: var(--accent-ink); opacity: .85; }

.hint-box { background: var(--warm); color: var(--warm-ink); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.hint-box p { margin: 0; font-size: .94em; line-height: 1.5; color: var(--ink); }
.hint-actions { display: flex; gap: 8px; justify-content: flex-end; }
.hint-actions .btn { width: auto; }

.tools { display: flex; justify-content: space-between; }
.tool { position: relative; display: flex; flex-direction: column; align-items: center; font-size: .78em; color: var(--sub); padding: 6px 2px; border-radius: 12px; flex: 1; min-width: 0; }
.tool span { white-space: nowrap; }
.tool i { font-style: normal; font-size: 1.85em; color: var(--ink); line-height: 1.2; }
.tool:active { background: var(--peer); }
.tool.on i, .tool.on b { color: var(--accent); }
.tool em { position: absolute; top: 0; right: 10%; background: var(--accent); color: var(--accent-ink); font-style: normal; font-size: 11px;
  min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; padding: 0 4px; text-align: center; }
.tool em.ad { background: var(--gold); color: #2B1D00; }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-bottom: auto; }
.num { position: relative; font-size: calc(clamp(26px, 8vw, 36px) * var(--scale)); font-weight: 600; color: var(--user); padding: 6px 0 14px; border-radius: 12px; }
.num small { position: absolute; bottom: 2px; left: 0; right: 0; font-size: 11px; color: var(--sub); font-weight: 500; }
.num:active { background: var(--accent-soft); }
.num.used { visibility: hidden; }
.num.suggest { background: var(--warm); box-shadow: inset 0 0 0 2px var(--gold); }
.note-mode .num { color: var(--sub); }

/* 시트 */
.modal { position: absolute; inset: 0; background: rgba(10,14,24,.5); display: flex; align-items: flex-end; z-index: 10; }
.sheet { width: 100%; max-height: 100%; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0;
  padding: 22px max(20px, env(safe-area-inset-right, 0px)) calc(var(--bottom) + 18px) max(20px, env(safe-area-inset-left, 0px)); animation: up .25s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.result-stars { text-align: center; font-size: 2.3em; letter-spacing: 6px; }
.result-stars .off { filter: grayscale(1); opacity: .3; }
.result-title { text-align: center; font-size: 1.45em; font-weight: 800; margin: 4px 0 12px; text-wrap: balance; }
.result-stats { display: flex; justify-content: space-around; text-align: center; margin-bottom: 12px; }
.result-stats b { display: block; font-size: 1.35em; font-variant-numeric: tabular-nums; }
.share-img { display: block; width: auto; max-width: 100%; max-height: 34vh; margin: 0 auto 6px; border-radius: 14px; box-shadow: var(--shadow); }
.result-rank { text-align: center; color: var(--sub); font-size: .9em; margin: 4px 0; }
.dialog-title { font-size: 1.3em; font-weight: 800; margin-bottom: 8px; }
.dialog-body { color: var(--sub); font-size: 1em; line-height: 1.5; margin-bottom: 8px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--peer); color: var(--ink); }
.switch { width: 50px; height: 30px; flex: none; border-radius: 15px; background: var(--line); position: relative; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 23px; }
.seg { display: flex; background: var(--peer); border-radius: 10px; padding: 3px; }
.seg button { padding: 6px 10px; border-radius: 8px; font-size: .88em; color: var(--sub); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.name-input { width: 9em; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); text-align: right; user-select: text; -webkit-user-select: text; }

.toast { position: absolute; left: 50%; top: calc(var(--top) + 60px); transform: translateX(-50%); background: rgba(20,26,40,.92);
  color: #fff; padding: 10px 16px; border-radius: 20px; font-size: .94em; z-index: 20; white-space: nowrap; }

@media (max-height: 700px) {
  .screen { padding-top: calc(var(--top) + 6px); gap: 8px; }
  .num { padding: 2px 0 12px; }
  .tool { padding: 2px; }
  .today-title { font-size: 1.5em; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- 오늘의 네모로직 ---------- */
.nemo-card { background: var(--card); border-radius: 20px; padding: 16px 18px 18px; box-shadow: var(--shadow); }
.nemo-card-main { display: flex; gap: 14px; align-items: center; }
.nemo-card-title { font-size: 1.25em; font-weight: 800; }
.nemo-card-title em { font-style: normal; font-size: .58em; vertical-align: 3px; margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--gold); color: #2B1D00; }
.nemo-card-sub { color: var(--sub); font-size: .9em; margin-top: 2px; line-height: 1.4; }
.nemo-thumb { position: relative; flex: none; width: 58px; height: 58px; display: grid; grid-template-columns: repeat(10, 1fr); gap: 1px;
  padding: 4px; border-radius: 12px; background: var(--peer); }
.nemo-thumb i { border-radius: 1px; }
.nemo-thumb i.on { background: var(--line); }
.nemo-thumb b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: var(--accent); text-shadow: 0 0 6px var(--card); }
.nemo-thumb.solved { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }

.nemo-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.nemo-board { --cs: 30px; --lw: 60px; --th: 60px; --fs: 13px; display: grid; touch-action: none; user-select: none; -webkit-user-select: none;
  grid-template-columns: var(--lw) repeat(var(--n, 10), var(--cs)); grid-template-rows: var(--th) repeat(var(--n, 10), var(--cs)); }
.nemo-board .corner { border-right: 2.5px solid var(--line-strong); border-bottom: 2.5px solid var(--line-strong); }
.nemo-board .cc, .nemo-board .rc { display: flex; font-size: var(--fs); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; transition: color .2s, background .2s; }
.nemo-board .cc { flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 4px; line-height: 1.12;
  border-right: 1px solid var(--line); border-bottom: 2.5px solid var(--line-strong); }
.nemo-board .rc { justify-content: flex-end; align-items: center; gap: .42em; padding-right: 6px;
  border-bottom: 1px solid var(--line); border-right: 2.5px solid var(--line-strong); }
.nemo-board .cc.br { border-right: 2px solid var(--line-strong); }
.nemo-board .rc.bb { border-bottom: 2px solid var(--line-strong); }
.nemo-board .cc.hl, .nemo-board .rc.hl { background: var(--accent-soft); border-radius: 4px; }
.nemo-board .cc.ok, .nemo-board .rc.ok { color: var(--line); }
.nemo-board .nc { position: relative; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background .12s; }
.nemo-board .nc.br { border-right: 2px solid var(--line-strong); }
.nemo-board .nc.bb { border-bottom: 2px solid var(--line-strong); }
.nemo-board .nc.last-c { border-right: 2.5px solid var(--line-strong); }
.nemo-board .nc.last-r { border-bottom: 2.5px solid var(--line-strong); }
.nemo-board .nc.hl { background: var(--peer); }
.nemo-board .nc.f { background: var(--line-strong); }
.nemo-board .nc.x::after { content: "✕"; position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--cs) * .5); color: var(--sub); }
.nemo-board .nc.x.auto::after { opacity: .45; }
.nemo-board .nc.err.f { background: var(--error); }
.nemo-board .nc.err.x::after { color: var(--error); font-weight: 800; opacity: 1; }
.nemo-board .nc.hint-line { background: var(--warm); }
.nemo-board .cc.hint-line, .nemo-board .rc.hint-line { background: var(--warm); color: var(--warm-ink); }
.nemo-board .nc.hint-cell { box-shadow: inset 0 0 0 3px var(--gold); }
.nemo-board .nc.hint-cell.f { background: var(--line-strong); }
.nemo-board .nc.pop::after { animation: pop .2s ease; }
.nemo-board .nc.flash { animation: nemo-flash .5s ease; }
@keyframes nemo-flash { 40% { box-shadow: inset 0 0 0 calc(var(--cs) / 2) var(--accent-soft); } }
.nemo-board .nc.f.flash { animation: nemo-flash-f .5s ease; }
@keyframes nemo-flash-f { 40% { background: var(--accent); } }
.nemo-board .nc.shake { animation: shake .35s ease; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
/* 다 풀면 그림이 색으로 드러나요 */
.nemo-board.reveal .nc { transition: background .4s ease; }
.nemo-board.reveal .nc.f, .nemo-board.reveal .nc.err.f { background: var(--pc); }
.nemo-board.reveal .nc.x::after { opacity: 0; transition: opacity .3s; }
.nemo-board.reveal .cc, .nemo-board.reveal .rc { color: var(--line); }
.nemo-reveal { text-align: center; font-size: 1.3em; font-weight: 700; animation: rise .5s ease; }
.nemo-reveal span { font-size: 1.3em; vertical-align: -3px; }
.nemo-reveal b { color: var(--accent); }

.nemo-tools { display: flex; gap: 10px; align-items: stretch; margin-bottom: auto; }
.nemo-seg { flex: 1; display: flex; background: var(--peer); border-radius: 16px; padding: 4px; }
.nemo-seg button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 12px 6px;
  font-size: 1em; font-weight: 700; color: var(--sub); }
.nemo-seg button i { font-style: normal; font-size: 1.2em; }
.nemo-seg button i.sq { width: 18px; height: 18px; border-radius: 3px; background: var(--sub); }
.nemo-seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nemo-seg button.on i.sq { background: var(--line-strong); }
.nemo-tools .tool { flex: 0 0 72px; }
.nemo-rules p { margin: 8px 0; color: var(--ink); }
.rule-demo { display: flex; align-items: center; gap: 3px; justify-content: center; margin: 4px 0 10px; }
.rule-demo .rd-clue { font-weight: 800; margin-right: 8px; color: var(--ink); }
.rule-demo i { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 3px; display: grid; place-items: center; font-style: normal; color: var(--sub); }
.rule-demo i.f { background: var(--line-strong); border-color: var(--line-strong); }
.nemo-art { display: block; width: min(46vw, 190px); height: auto; aspect-ratio: 1; margin: 0 auto 12px; border-radius: 12px; background: var(--peer); padding: 6px; }
.nemo-share-preview { margin: 0 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--bg); font: inherit; font-size: .88em; line-height: 1.5;
  white-space: pre-wrap; text-align: center; color: var(--ink); user-select: text; -webkit-user-select: text; }
.game-meta .bad { color: var(--error); font-weight: 700; }

/* ======================================================================
   볼륨감 — 눌리는 버튼(아래 두께), 떠 있는 카드(겹 그림자 + 윗면 빛), 도톰한 판
   ====================================================================== */
:root {
  --edge: #D3CBBB;            /* 밝은 버튼·타일의 아래 두께 */
  --edge-accent: #0B7A52;     /* 파란 버튼의 아래 두께 */
  --edge-gold: #C98A00;
  --edge-danger: #F2B8BA;
  --hl: rgba(255,255,255,.85); /* 윗면 빛 */
  --card-2: #F8FAF6;          /* 카드 아래쪽 색 (위→아래 살짝 어두워짐) */
  --lift: 0 1px 0 var(--hl) inset, 0 1px 2px rgba(30,42,68,.06), 0 6px 14px rgba(30,42,68,.07), 0 18px 32px -18px rgba(30,42,68,.22);
  --key-bg: linear-gradient(180deg, #FFFFFF, #F4F1EA);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --edge: #0B0F17; --edge-accent: #145C40; --edge-gold: #8C6200; --edge-danger: #5A2830;
    --hl: rgba(255,255,255,.07); --card-2: #171C29;
    --lift: 0 1px 0 var(--hl) inset, 0 1px 2px rgba(0,0,0,.3), 0 8px 18px rgba(0,0,0,.35), 0 18px 32px -18px rgba(0,0,0,.6);
    --key-bg: linear-gradient(180deg, #232B3D, #1B2130);
  }
}
:root[data-theme="dark"] {
  --edge: #0B0F17; --edge-accent: #145C40; --edge-gold: #8C6200; --edge-danger: #5A2830;
  --hl: rgba(255,255,255,.07); --card-2: #171C29;
  --lift: 0 1px 0 var(--hl) inset, 0 1px 2px rgba(0,0,0,.3), 0 8px 18px rgba(0,0,0,.35), 0 18px 32px -18px rgba(0,0,0,.6);
  --key-bg: linear-gradient(180deg, #232B3D, #1B2130);
}

/* 떠 있는 카드 */
.today-card, .classic-card, .panel, .nemo-card, .month-strip {
  background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: var(--lift); }
.first-card { background: linear-gradient(160deg, #2FC08A, var(--accent) 55%, #0E8A5E);
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 -3px 0 rgba(0,0,0,.12) inset, 0 12px 26px -8px rgba(18,160,110,.55); }
.risk-card { box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 8px 18px -10px rgba(138,90,0,.45); }
.sheet { background: linear-gradient(180deg, var(--card), var(--card-2)); box-shadow: 0 -10px 30px rgba(10,14,24,.18); }

/* 눌리는 버튼: 아래 두께 4px, 누르면 내려가요 */
.btn { position: relative; transition: transform .08s ease, box-shadow .08s ease, filter .1s; }
.btn.primary { background: linear-gradient(180deg, #2FBF86, var(--accent)); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 4px 0 var(--edge-accent), 0 8px 16px -6px rgba(18,160,110,.5); }
.btn.ghost { background: var(--key-bg); box-shadow: 0 1px 0 var(--hl) inset, 0 0 0 1px var(--edge), 0 4px 0 var(--edge); }
.btn.done { box-shadow: 0 0 0 1px var(--same), 0 4px 0 var(--same); }
.btn.warm { background: linear-gradient(180deg, #FFC533, var(--gold)); box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 4px 0 var(--edge-gold); }
.btn.danger { box-shadow: 0 0 0 1px var(--edge-danger), 0 4px 0 var(--edge-danger); }
.first-card .btn.primary { background: var(--card); color: var(--accent); box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 18px -6px rgba(0,0,0,.25); }
.coach .btn { box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.btn:active:not(:disabled) { transform: translateY(3px); filter: none; }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--edge-accent), 0 3px 8px -4px rgba(18,160,110,.5); }
.btn.ghost:active:not(:disabled) { box-shadow: 0 0 0 1px var(--edge), 0 1px 0 var(--edge); }
.btn.warm:active:not(:disabled) { box-shadow: 0 1px 0 var(--edge-gold); }
.btn:disabled { box-shadow: 0 0 0 1px var(--edge); transform: none; }
.hint-actions .btn, .btn.small { box-shadow: 0 3px 0 var(--edge); }
.hint-actions .btn.primary { box-shadow: 0 3px 0 var(--edge-accent); }

/* 아이콘 버튼·난이도·보관함 칸도 도톰하게 */
.icon-btn { transition: transform .08s; }
.icon-btn:active { transform: translateY(2px); }
.diff-btn, .badge, .bests div, .ranking li { background: var(--key-bg); box-shadow: 0 1px 0 var(--hl) inset, 0 0 0 1px var(--edge), 0 3px 0 var(--edge); transition: transform .08s, box-shadow .08s; }
.diff-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 0 0 1px var(--edge), 0 1px 0 var(--edge); background: var(--same); }
.ranking li.me { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--same), 0 3px 0 var(--same); }
.badge.off { box-shadow: 0 0 0 1px var(--edge); }
.cal button { background: var(--key-bg); box-shadow: 0 0 0 1px var(--edge), 0 2px 0 var(--edge); }
.cal button.done { background: linear-gradient(180deg, #2FBF86, var(--accent)); box-shadow: 0 2px 0 var(--edge-accent); }
.cal button.late { box-shadow: 0 2px 0 var(--edge-accent); }
.cal button:disabled { box-shadow: none; }
.week i { box-shadow: inset 0 2px 3px rgba(30,42,68,.12); }
.week i.on, .week i.late { box-shadow: 0 2px 0 var(--edge-accent); }
.month-strip .bar { box-shadow: inset 0 1px 2px rgba(30,42,68,.15); }
.month-strip .bar i { background: linear-gradient(180deg, #3FCB94, var(--accent)); }
.seg { box-shadow: inset 0 1px 3px rgba(30,42,68,.12); }
.switch { box-shadow: inset 0 1px 3px rgba(0,0,0,.18); }
.switch::after { box-shadow: 0 2px 4px rgba(0,0,0,.25); }

/* 판: 종이 위에 놓인 두꺼운 판처럼 */
.board { border-radius: 14px; box-shadow: 0 1px 0 var(--hl) inset, 0 3px 0 var(--edge), 0 10px 24px -8px rgba(30,42,68,.28); }
.cell.sel { background: linear-gradient(180deg, #2FBF86, var(--accent)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.cell.sel.wrong { background: linear-gradient(180deg, #FF6B6F, var(--error)); }
.cell.hint-cell { background: linear-gradient(180deg, #FFC533, var(--gold)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }

/* 숫자판: 키캡 */
.pad { gap: 6px; }
.num { background: var(--key-bg); box-shadow: 0 1px 0 var(--hl) inset, 0 0 0 1px var(--edge), 0 4px 0 var(--edge); padding: 6px 0 16px; margin-bottom: 4px;
  transition: transform .06s ease, box-shadow .06s ease; }
.num:active { transform: translateY(3px); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--edge), 0 1px 0 var(--edge); }
.num.suggest { background: linear-gradient(180deg, #FFF4D6, #FFE7A3); box-shadow: 0 0 0 2px var(--gold), 0 4px 0 var(--edge-gold); }
.pad[data-size="4"] .num, .pad[data-size="6"] .num { background: var(--key-bg); }
@media (max-height: 700px) { .num { padding: 2px 0 13px; } }

/* 도구: 동그란 버튼 위에 아이콘 */
.tool i { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-size: 1.45em; margin-bottom: 3px;
  background: var(--key-bg); box-shadow: 0 1px 0 var(--hl) inset, 0 0 0 1px var(--edge), 0 3px 0 var(--edge); transition: transform .06s, box-shadow .06s; }
.tool:active { background: none; }
.tool:active i { transform: translateY(2px); box-shadow: 0 0 0 1px var(--edge), 0 1px 0 var(--edge); }
.tool.on i { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--same), 0 3px 0 var(--same); }
.tool em { top: -2px; right: calc(50% - 30px); box-shadow: 0 2px 0 var(--edge-accent); }
.tool em.ad { box-shadow: 0 2px 0 var(--edge-gold); }
@media (max-height: 700px) { .tool i { width: 40px; height: 40px; } }

/* 시작 화면 타일: 두께 있는 블록 */
.splash-grid { box-shadow: 0 6px 0 #0E1628, 0 18px 34px -10px rgba(30,42,68,.45); }
.splash-grid span { box-shadow: 0 1px 0 var(--hl) inset, 0 -3px 0 rgba(30,42,68,.12) inset; background: linear-gradient(180deg, var(--card), var(--card-2)); }
.splash-grid span.hl { background: linear-gradient(180deg, #3FCB94, var(--accent)); box-shadow: 0 -3px 0 rgba(0,0,0,.2) inset; }
.splash-today { box-shadow: var(--lift); }

/* 안내·힌트 상자도 살짝 떠 있게 */
.coach { box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 8px 18px -8px rgba(18,160,110,.6); }
.hint-box { box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 8px 18px -10px rgba(138,90,0,.4); }
.toast { box-shadow: 0 8px 20px rgba(10,14,24,.3); }

/* 네모로직 모드 */
.nemo-board { filter: drop-shadow(0 3px 0 var(--edge)) drop-shadow(0 10px 14px rgba(30,42,68,.16)); }
.nemo-board .nc.f { background: linear-gradient(180deg, #34425F, var(--line-strong)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); }
.nemo-seg { box-shadow: inset 0 1px 3px rgba(30,42,68,.12); }
.nemo-seg button.on { background: var(--key-bg); box-shadow: 0 0 0 1px var(--edge), 0 3px 0 var(--edge); }

@media (prefers-reduced-motion: reduce) { .btn:active, .num:active, .tool:active i, .diff-btn:active { transform: none; } }

/* ---------- 데일리네모 전용 ---------- */
/* 시작 화면: 날마다 바뀌는 5x5 픽셀 무늬 */
.splash-pixels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; width: min(44vw, 172px); aspect-ratio: 1; margin-bottom: 18px;
  padding: 8px; border-radius: 22px; background: var(--card); box-shadow: 0 6px 0 var(--edge), 0 18px 34px -10px rgba(30,42,68,.35); }
.splash-pixels i { border-radius: 6px; background: var(--peer); opacity: 0; transform: scale(.4); animation: tile-in .42s cubic-bezier(.2,1.5,.4,1) forwards; }
.splash-pixels i.on { background: linear-gradient(180deg, #2FBF86, var(--accent)); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }

/* 그림 미리보기 */
.nemo-thumb { display: block; padding: 4px; }
.nemo-thumb .px { display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); gap: 1px; width: 100%; height: 100%; }
.nemo-thumb .px i { border-radius: 1px; }
.nemo-thumb .px i.on { background: var(--line); }
.nemo-thumb.big { width: 76px; height: 76px; border-radius: 14px; }
.nemo-thumb.big b { font-size: 34px; }

/* 홈: 오늘의 그림 카드 */
.today-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.today-text { min-width: 0; }
.today-head .today-title { margin: 0 0 2px; }
.today-head .today-sub { margin: 0; }
.sister-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px dashed var(--line); color: var(--sub); font-size: .88em; line-height: 1.45; }
.sister-card b { color: var(--ink); font-size: 1.05em; }

/* 연습 그림 안내 */
.nemo-board .nc.coach-line { animation: coach-cell 1.1s ease-in-out infinite; }
.nemo-board .nc.coach-line.f { animation: none; }
@keyframes coach-cell { 50% { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); } }
.nemo-board .rc.coach-line { color: var(--accent); background: var(--accent-soft); border-radius: 4px; }

/* 보관함 */
.nemo-cal button small { font-size: .9em; letter-spacing: 0; }
.collection { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 8px; }
.col-item { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78em; color: var(--sub); text-align: center; }
.col-item .nemo-thumb { width: 100%; max-width: 72px; height: auto; aspect-ratio: 1; border-radius: 12px; }
.col-item.got span { color: var(--ink); font-weight: 600; }
.col-item .nemo-thumb b { font-size: 22px; color: var(--line); text-shadow: none; }
/* 칠한 칸 색: 밝은 화면은 진한 남색, 어두운 화면은 밝은 초록으로 대비를 지켜요 */
:root { --fill: #1E2A44; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fill: #4FD1A0; } }
:root[data-theme="dark"] { --fill: #4FD1A0; }
.nemo-board .nc.f, .nemo-board .nc.hint-cell.f { background: var(--fill); }
.rule-demo i.f { background: var(--fill); border-color: var(--fill); }
