/* 스도쿠 — 호두나무 책상 위 크림색 종이 퍼즐, 스탠드 불빛 */
/* ── AAA 공통 꾸밈(숫자 퍼즐 6개가 같은 사본을 쓴다 — 단추 · HUD 느낌 통일). 색은 --k1(주색) --k2(주색 어둠) --k3(곁색) ── */
.k-title { background: none; backdrop-filter: none; padding: 0; overflow: hidden; }
.k-title .k-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.k-wrap { position: relative; width: min(440px, 100%); max-height: 100%; overflow: visible; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 22px; text-align: center; scrollbar-width: none; }
.k-wrap::-webkit-scrollbar { display: none; }
.k-art { position: relative; animation: k-bob 3.2s ease-in-out infinite; }
@keyframes k-bob { 50% { transform: translateY(-7px); } }
.k-logo { position: relative; margin: 0; font-family: var(--logo, var(--title)); font-weight: 400; font-size: clamp(34px, 9.4vw, 62px); line-height: 1.08; letter-spacing: 0.01em; max-width: 100%; text-wrap: balance;
  color: var(--k2); -webkit-text-stroke: 12px var(--k2); filter: drop-shadow(0 6px 0 var(--k2)) drop-shadow(0 14px 18px rgba(0, 0, 0, 0.4)); }
.k-logo::after { content: attr(data-t); position: absolute; inset: 0; -webkit-text-stroke: 0; color: transparent; background: linear-gradient(180deg, #fff 0%, #fff 42%, var(--k-logo2, #ffe08a) 100%); -webkit-background-clip: text; background-clip: text; }
.k-logo.long { font-size: clamp(30px, 7.6vw, 50px); }
.k-wrap > * { max-width: 100%; }
.k-sub { margin: -4px 0 0; font-size: 15px; font-weight: 700; color: rgba(255, 255, 255, 0.88); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); max-width: 340px; line-height: 1.4; }
.k-modes { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.k-modes button { flex: 1 1 0; min-width: 0; max-width: 140px; padding: 9px 4px 8px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, 0.13); color: #fff; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 4px 0 rgba(0, 0, 0, 0.25);
  display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.15; transition: transform 0.15s, background 0.15s; cursor: pointer; }
.k-modes button b { font-family: var(--title); font-weight: 400; font-size: 17px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.k-modes button small { font-size: 11px; font-weight: 700; opacity: 0.85; white-space: nowrap; }
.k-modes button.on { background: #fff; color: var(--k2); box-shadow: 0 0 0 3px var(--k3), 0 6px 0 rgba(0, 0, 0, 0.28); transform: translateY(-3px); }
.k-modes button:active { transform: translateY(1px); }
.k-best { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 14px 5px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.3); color: #ffe08a; font-weight: 800; font-size: 14px; box-shadow: inset 0 0 0 1.5px rgba(255, 224, 138, 0.35); margin: 0; }
.k-best svg { width: 22px; height: 22px; flex: none; fill: currentColor; }
.k-best.none { color: rgba(255, 255, 255, 0.78); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); }
/* 크고 도톰한 입체 단추 (눌림 · 반짝임 · 숨쉬기) */
.k-play.big-btn, .k-play { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: min(300px, 100%); min-height: 68px; margin: 6px 0 0; padding: 0 28px; border: 0; border-radius: 22px; overflow: hidden; cursor: pointer;
  font-family: var(--title); font-weight: 400; font-size: 30px; letter-spacing: 0.02em; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, var(--k-btn1, #7cf08f) 0%, var(--k-btn2, #22b85a) 100%); box-shadow: 0 8px 0 var(--k-btn3, #137a3a), 0 14px 26px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.55);
  animation: k-breathe 1.8s ease-in-out infinite; transition: transform 0.08s, box-shadow 0.08s; }
.k-play svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.25)); flex: none; }
.k-play::after { content: ''; position: absolute; top: -20%; bottom: -20%; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: skewX(-18deg); animation: k-shine 2.8s ease-in-out infinite; pointer-events: none; }
.k-play:active { transform: translateY(6px) scale(0.98) !important; box-shadow: 0 2px 0 var(--k-btn3, #137a3a), 0 6px 12px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.4); animation: none; }
@keyframes k-breathe { 50% { transform: scale(1.04); } }
@keyframes k-shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
.k-link { display: inline-block; border: 0; background: none; color: rgba(255, 255, 255, 0.8); font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 12px; text-decoration: none; cursor: pointer; }
.k-link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.k-link[hidden] { display: none; }
.k-row { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
/* HUD 알약: 아이콘 + 숫자 */
.k-pill { display: inline-flex; align-items: center; gap: 5px; min-width: 0; height: 40px; padding: 0 10px 0 5px; border-radius: 999px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14), 0 4px 10px rgba(0, 0, 0, 0.22); color: #fff; }
.k-pill .ic { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--ic, var(--k1)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.k-pill .ic svg { width: 17px; height: 17px; fill: #fff; }
.k-pill b { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-family: Fredoka, var(--title); font-weight: 600; font-size: 19px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.k-pill.bump { animation: k-bump 0.35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes k-bump { 40% { transform: scale(1.16); } }
/* 결과 카드 */
.k-card.panel { position: relative; width: min(380px, 100%); background: linear-gradient(180deg, var(--k-card1, #2b2f6b), var(--k-card2, #1a1d45)); color: #fff; border-radius: 28px; padding: 30px 22px 18px; margin-top: 40px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12), 0 28px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2); overflow: visible; animation: k-cardin 0.5s cubic-bezier(.2, 1.4, .4, 1); }
.overlay:has(.k-card) { overflow: auto; }
@keyframes k-cardin { from { transform: translateY(40px) scale(0.85); opacity: 0; } }
.k-card h2 { margin: 2px 0 2px; font-family: var(--logo, var(--title)); font-weight: 400; font-size: 40px; color: #fff; text-shadow: 0 4px 0 var(--k2), 0 8px 18px rgba(0, 0, 0, 0.35); }
.k-card p { color: rgba(255, 255, 255, 0.8); margin: 0 0 6px; }
.k-stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: -76px 0 4px; height: 86px; }
.k-stars i { width: 62px; height: 62px; display: grid; place-items: center; }
.k-stars i:nth-child(2) { width: 82px; height: 82px; transform: translateY(-10px); }
.k-stars svg { width: 100%; height: 100%; overflow: visible; }
.k-stars .bg { fill: #14163a; stroke: rgba(255, 255, 255, 0.25); stroke-width: 3; }
.k-stars .fg { fill: url(#kStarG); stroke: #b87400; stroke-width: 3; transform-origin: 50px 52px; transform: scale(0); }
.k-stars i.on .fg { animation: k-starin 0.5s cubic-bezier(.2, 1.8, .4, 1) forwards; }
@keyframes k-starin { 0% { transform: scale(2.2) rotate(-30deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.k-score { font-family: Fredoka, var(--title); font-weight: 600; font-size: 46px; line-height: 1.1; color: #fff; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }
.k-card .stats { margin: 10px 0 8px; }
.k-card .stats div { background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.k-card .stats b { color: #fff; font-family: Fredoka, var(--title); font-weight: 600; }
.k-card .stats span { color: rgba(255, 255, 255, 0.68); }
.k-ribbon { display: inline-block; margin: 4px auto 6px; padding: 6px 22px; font-family: var(--title); font-size: 18px; color: #4a2a00; background: linear-gradient(180deg, #ffe680, #ffb627); border-radius: 8px; box-shadow: 0 4px 0 #b86f00, 0 8px 16px rgba(0, 0, 0, 0.3); transform: rotate(-3deg); animation: k-rib 0.6s cubic-bezier(.2, 1.6, .4, 1) both 1.2s; }
.k-ribbon[hidden] { display: none; }
@keyframes k-rib { from { transform: scale(0) rotate(-20deg); } }
.k-next { font-size: 14px; font-weight: 700; color: #ffe08a !important; min-height: 1.4em; }
.k-card .k-play { width: 100%; font-size: 26px; min-height: 62px; margin-top: 10px; }
/* 처음 하는 사람 안내 손가락 */
.k-hand { position: fixed; z-index: 70; width: 58px; height: 58px; margin: -4px 0 0 -22px; pointer-events: none; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45)); }
.k-hand svg { width: 100%; height: 100%; }
.k-hand.tap svg { animation: k-tap 0.9s ease-in-out infinite; transform-origin: 40% 10%; }
@keyframes k-tap { 0%, 100% { transform: translate(0, 10px); } 45% { transform: translate(0, 0) scale(0.9); } }
.k-tapring { position: fixed; z-index: 69; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.8); pointer-events: none; animation: k-ring 0.9s ease-out infinite; }
@keyframes k-ring { 0%, 40% { transform: scale(0.3); opacity: 0; } 50% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.k-tip { position: fixed; z-index: 70; transform: translate(-50%, 0); max-width: 86vw; padding: 7px 14px; border-radius: 14px; background: #fff; color: #1c2140; font-weight: 800; font-size: 14px; text-align: center; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); pointer-events: none; animation: pop-in 0.3s ease-out; }
@media (prefers-reduced-motion: reduce) { .k-play, .k-art, .k-play::after { animation: none !important; } }
html:not([lang="ko"]) .k-modes button b, html:not([lang="ko"]) .k-play, html:not([lang="ko"]) .k-ribbon, html:not([lang="ko"]) .k-pill b { font-weight: 800; }
.k-play.k-sm { min-height: 50px; width: min(250px, 100%); font-size: 20px; margin-top: 2px; border-radius: 18px; animation: none; box-shadow: 0 6px 0 var(--k-btn3, #137a3a), 0 10px 18px rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.k-play.k-sm::after { display: none; }
.k-play.k-sm svg { width: 20px; height: 20px; }
.k-next:empty { display: none; }
@media (max-height: 600px) { .k-wrap { overflow: auto; } }

.stage { --k1: #d4952c; --k2: #4a2a12; --k3: #ffd36b; --k-logo2: #ffd98a; --k-btn1: #6be8b0; --k-btn2: #1fa877; --k-btn3: #0f6e4c; --k-card1: #5a3a22; --k-card2: #2e1c11;
  padding: 8px; background: #23160e; }
.sd-desk, .sd-tbg { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 55% at 28% 6%, rgba(255, 200, 120, 0.32), transparent 70%),
    repeating-linear-gradient(97deg, rgba(255, 230, 200, 0.03) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(93deg, rgba(0, 0, 0, 0.06) 0 1px, transparent 1px 23px),
    linear-gradient(160deg, #5a3824 0%, #3a2416 45%, #24160d 100%); }
.sd-desk .lamp, .sd-tbg .lamp { position: absolute; left: 10%; top: -30%; width: 60%; height: 90%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 150, 0.22), transparent); animation: sd-lamp 7s ease-in-out infinite; }
@keyframes sd-lamp { 50% { opacity: 0.65; transform: translateX(4%); } }
.sd { position: relative; z-index: 1; }

/* 제목 화면 */
.sd-tbg span { position: absolute; left: var(--x); bottom: -60px; font-family: Fredoka, var(--title); font-weight: 600; font-size: calc(44px * var(--s)); color: rgba(255, 236, 200, 0.13); animation: sd-rise var(--t) linear infinite; animation-delay: var(--dl); }
@keyframes sd-rise { to { transform: translateY(-120vh) rotate(40deg); } }
.sd-art { width: 210px; height: 120px; margin-top: 6px; }
.sd-art .sheet { position: absolute; left: 14px; top: 8px; width: 180px; height: 60px; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; padding: 3px; border-radius: 6px; transform: rotate(-6deg) scale(1.08);
  background: #6b4a2e; box-shadow: 0 14px 24px rgba(0, 0, 0, 0.45), 0 0 0 4px #fbf5e6; }
.sd-art .sheet i { display: grid; place-items: center; background: #fbf5e6; font-style: normal; font-family: Fredoka, var(--font); font-weight: 600; font-size: 13px; color: #2b2118; }
.sd-art .sheet i:nth-child(3n) { margin-right: 1px; }
.sd-art .sheet i.hot { background: #ffe28a; }
.sd-art .pencil { position: absolute; right: 2px; top: 64px; width: 96px; height: 13px; border-radius: 3px; transform: rotate(-28deg); background: linear-gradient(180deg, #ffd34d 0 33%, #f2b51c 33% 66%, #d99a0a 66%); box-shadow: 0 6px 10px rgba(0, 0, 0, 0.4); }
.sd-art .pencil::before { content: ''; position: absolute; left: -16px; top: 0; border: 6.5px solid transparent; border-right: 16px solid #f1d2a6; border-left: 0; }
.sd-art .pencil::after { content: ''; position: absolute; right: -10px; top: 0; width: 12px; height: 13px; border-radius: 0 4px 4px 0; background: linear-gradient(90deg, #c9c9c9 0 40%, #ff7f8f 40%); }
.sd-art .chip { position: absolute; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; font-style: normal; font-family: Fredoka, var(--font); font-weight: 600; font-size: 22px; color: #3a2a1c; background: linear-gradient(180deg, #fffaf0, #efe0bf); box-shadow: 0 5px 0 #b8986a, 0 10px 16px rgba(0, 0, 0, 0.35); }
.sd-art .c1 { left: -26px; top: 64px; transform: rotate(-12deg); animation: k-bob 2.6s ease-in-out infinite; }
.sd-art .c2 { right: -24px; top: -6px; transform: rotate(10deg); color: #2f55c9; animation: k-bob 3s ease-in-out infinite reverse; }
.sd-seg { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 420px; }
.sd-seg button { max-width: none; }
.sd-seg button small { color: #ffd36b; letter-spacing: 1px; }
.sd-seg button.on small { color: #d48a00; }

.sd { --cell: calc(var(--bs) / 9); display: grid; gap: 8px; width: var(--bs); grid-template-columns: var(--bs); grid-template-areas: 'hud' 'board' 'tools' 'pad'; }
.sd.land { width: auto; grid-template-columns: var(--bs) var(--sw); grid-template-rows: 1fr auto auto auto auto 1fr; grid-template-areas: 'board .' 'board hud' 'board tools' 'board pad' 'board keys' 'board .'; column-gap: 24px; row-gap: 12px; }

/* 위 점수판: 알약 */
.sd-hud { grid-area: hud; display: flex; gap: 5px; align-items: center; min-width: 0; }
.sd-hud .k-pill { flex: 1 1 0; }
.sd-hud .p-mis, .sd-hud .p-time { flex: 0 0 auto; }
.sd-hud .p-time b { min-width: 2.3em; }
.sd-hud .v-lv { font-family: var(--title); font-weight: 400; font-size: 17px; }
.sd-hud .p-mis.warn { box-shadow: inset 0 0 0 1.5px rgba(255, 120, 100, 0.6), 0 4px 10px rgba(0, 0, 0, 0.22); }
.sd-hud .p-mis.warn b { color: #ffb0a4; }
.hbtn { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; color: #fff; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: linear-gradient(180deg, #8a5a32, #5c3a20); box-shadow: 0 4px 0 #2e1b0e, inset 0 1px 0 rgba(255, 255, 255, 0.25); transition: transform 0.08s; }
.hbtn svg { width: 18px; height: 18px; fill: #ffe8c4; }
.b-newgame { background: linear-gradient(180deg, #6be8b0, #1fa877); box-shadow: 0 4px 0 #0f6e4c, inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.b-newgame svg { fill: #fff; }
.hbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 #2e1b0e; }

/* 판: 나무 액자 + 종이 */
.sd-board { grid-area: board; align-self: center; width: var(--bs); height: var(--bs); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; padding: 6px; border-radius: 16px; touch-action: none; transition: filter 0.2s;
  background: linear-gradient(135deg, #9a6a3e, #6b4423 50%, #4f3018); box-shadow: 0 2px 0 rgba(255, 220, 170, 0.35) inset, 0 -3px 0 rgba(0, 0, 0, 0.3) inset, 0 22px 44px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.4); }
.sd.blur .sd-board { filter: blur(10px); }
.box { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 1px; background: #d9c9a6; overflow: hidden; }
.box:nth-child(1) { border-top-left-radius: 10px; }
.box:nth-child(3) { border-top-right-radius: 10px; }
.box:nth-child(7) { border-bottom-left-radius: 10px; }
.box:nth-child(9) { border-bottom-right-radius: 10px; }
.cell { position: relative; background: #fcf7ea; display: grid; place-items: center; cursor: pointer; overflow: hidden; color: #2f55c9; font-family: Fredoka, var(--font); font-weight: 600; font-size: calc(var(--cell) * 0.6); line-height: 1; transition: background-color 0.15s; }
.cell::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, 0.5), transparent 60%); }
.cell .v { position: relative; z-index: 1; }
.cell.given { color: #2b2118; }
.cell.given .v { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); }
.cell.ok { color: #2f55c9; }
.cell.hinted { color: #0f9b77; }
.cell.hl { background: #f1e1bb; }
.cell.same { background: #f6d98a; }
.cell.clash { background: #f9d6cc; }
.cell.bad { color: #d23b30; background: #fbe1d8; }
.cell.sel { background: #ffe07a; box-shadow: inset 0 0 0 2.5px #b8770c; }
.cell.sel.bad { background: #ffc6b8; box-shadow: inset 0 0 0 2.5px #d23b30; }

/* 메모 */
.cell .nt { position: absolute; inset: 1px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); font-family: var(--font); font-weight: 700; font-size: calc(var(--cell) * 0.25); color: #8a7458; line-height: 1; pointer-events: none; }
.cell .nt i { font-style: normal; display: grid; place-items: center; visibility: hidden; border-radius: 4px; }
.cell .nt i.m { visibility: visible; }
.cell .nt i.on { background: #2f55c9; color: #fff; }

/* 움직임: 금빛 쓸기 · 톡 튐 · 흔들기 · 물결 */
.cell .fx { position: absolute; inset: -20%; z-index: 2; opacity: 0; pointer-events: none; background: linear-gradient(115deg, transparent 25%, rgba(255, 214, 80, 0.9) 45%, rgba(255, 250, 220, 0.95) 50%, rgba(255, 214, 80, 0.9) 55%, transparent 75%); mix-blend-mode: multiply; }
.cell .fx.go { animation: sd-sweep 0.6s ease-out; }
@keyframes sd-sweep { 0% { opacity: 1; transform: translateX(-70%); } 100% { opacity: 0.2; transform: translateX(70%); } }
.cell.lift { animation: sd-lift 0.45s cubic-bezier(.3, 1.6, .5, 1); z-index: 3; }
@keyframes sd-lift { 40% { transform: scale(1.14); background-color: #fff2b3; } }
.cell.press { animation: sd-press 0.18s ease-out; }
@keyframes sd-press { 40% { transform: scale(0.9); } }
.cell .v.pop { animation: sd-pop 0.36s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes sd-pop { 0% { transform: scale(0.2) rotate(-12deg); } 55% { transform: scale(1.28, 0.86); } 80% { transform: scale(0.95, 1.06); } }
.cell .v.shake { animation: sd-shake 0.36s; }
@keyframes sd-shake { 20% { transform: translateX(-5px) rotate(-6deg); } 40% { transform: translateX(5px) rotate(5deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.sd.won .cell .v { animation: sd-wave 0.7s ease-in-out calc(var(--d) * 45ms) both; }
.sd.won .cell .fx { animation: sd-sweep 0.9s ease-out calc(var(--d) * 45ms) both; }
.sd.won .cell { animation: sd-glow 0.9s ease-in-out calc(var(--d) * 45ms) both; }
@keyframes sd-wave { 40% { transform: translateY(-26%) scale(1.22); color: #b8770c; } }
@keyframes sd-glow { 40% { background-color: #fff0a8; } }
.sd.deal .box { animation: sd-deal 0.5s cubic-bezier(.2, 1.3, .4, 1) both; }
.sd.deal .box:nth-child(2) { animation-delay: 40ms; } .sd.deal .box:nth-child(3) { animation-delay: 80ms; }
.sd.deal .box:nth-child(4) { animation-delay: 60ms; } .sd.deal .box:nth-child(5) { animation-delay: 100ms; } .sd.deal .box:nth-child(6) { animation-delay: 140ms; }
.sd.deal .box:nth-child(7) { animation-delay: 120ms; } .sd.deal .box:nth-child(8) { animation-delay: 160ms; } .sd.deal .box:nth-child(9) { animation-delay: 200ms; }
@keyframes sd-deal { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } }

/* 도구 */
.sd-tools { grid-area: tools; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tool { position: relative; height: 56px; border: 0; border-radius: 16px; color: #ffe8c4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 700; line-height: 1.1; padding: 0 2px; min-width: 0; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 230, 200, 0.14), rgba(255, 230, 200, 0.05)); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 200, 0.14), 0 4px 0 rgba(0, 0, 0, 0.3); transition: transform 0.08s; }
.tool span { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tool:active { transform: translateY(3px); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 200, 0.14), 0 1px 0 rgba(0, 0, 0, 0.3); }
.tool .badge { position: absolute; top: 5px; left: calc(50% + 10px); font-style: normal; font-size: 10px; font-weight: 800; line-height: 1; background: #6b4a2e; color: #fff; padding: 3px 5px; border-radius: 8px; white-space: nowrap; }
.tool .badge[hidden] { display: none; }
.tool.on { background: linear-gradient(180deg, rgba(255, 211, 107, 0.3), rgba(255, 211, 107, 0.12)); color: #ffd36b; box-shadow: inset 0 0 0 2px rgba(255, 211, 107, 0.65), 0 4px 0 rgba(0, 0, 0, 0.3); }
.tool.on .badge { background: #ffd36b; color: #3a2410; }
.t-hint .badge { background: #3ee0b5; color: #10302a; }
@media (hover: hover) { .tool:hover { background: linear-gradient(180deg, rgba(255, 230, 200, 0.2), rgba(255, 230, 200, 0.08)); } .num:hover { filter: brightness(1.05); } }

/* 숫자판: 상아 조각 */
.sd-pad { grid-area: pad; display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.num { height: var(--ph); min-width: 0; border: 0; border-radius: 12px; color: #3a2a1c; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; cursor: pointer;
  background: linear-gradient(180deg, #fffaf0, #efe0bf); box-shadow: 0 5px 0 #a8875a, 0 8px 12px rgba(0, 0, 0, 0.35), inset 0 1px 0 #fff; transition: transform 0.08s, box-shadow 0.08s; }
.num b { font-family: Fredoka, var(--font); font-weight: 600; font-size: calc(var(--ph) * 0.5); }
.num small { font-size: 10px; font-weight: 800; color: #9c8160; margin-top: 2px; }
.num:active, .num.hit { transform: translateY(4px); box-shadow: 0 1px 0 #a8875a, 0 3px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 #fff; }
.num.hit { animation: sd-hit 0.2s ease-out; }
@keyframes sd-hit { 0% { transform: translateY(4px) scale(0.94); } 100% { transform: none; } }
.num.cur { background: linear-gradient(180deg, #fff3c2, #ffd36b); }
.num.gone { visibility: hidden; }
.sd-pad.notes .num { background: linear-gradient(180deg, #fffbe0, #f6e7a8); color: #8a6400; box-shadow: 0 5px 0 #c9a443, 0 8px 12px rgba(0, 0, 0, 0.3); }
.sd-pad.notes .num b { font-size: calc(var(--ph) * 0.4); }
.sd.land .sd-pad { grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sd.land .num { border-radius: 16px; }
.sd.land .num b { font-size: calc(var(--ph) * 0.48); }
.sd.land .num small { font-size: 12px; margin-top: 4px; }
.sd.land .sd-pad.notes .num b { font-size: calc(var(--ph) * 0.38); }
.sd-keys { grid-area: keys; display: none; margin: 0; font-size: 12px; line-height: 1.5; color: rgba(255, 232, 196, 0.55); text-align: center; }
.sd.land .sd-keys { display: block; }
.sd.land.tight .sd-keys { display: none; }
.sd.tight .tool { font-size: 11px; }

/* 겹 화면 */
.sd-panel .stats { grid-template-columns: repeat(3, 1fr); }
.sd-panel .stats b { font-size: 22px; }
.stage .overlay:not(.k-title) { background: rgba(28, 16, 8, 0.66); }
