/* 시간표 · 과목 · 교실 칠판 · 도장 · 자판 */

/* ---------- 공통 버튼 ---------- */
.btn { font-family: var(--title); font-size: 18px; padding: 10px 20px; border-radius: 14px; border: 0; box-shadow: 0 4px 0 rgba(0,0,0,.15); transition: transform .1s; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.15); }
.btn.primary { background: #ff8a5c; color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.big-btn { font-family: var(--title); font-size: 24px; padding: 12px 34px; border-radius: 16px; border: 0; background: #ffc83d; color: #5a3d00; box-shadow: 0 5px 0 #d89c12; margin-top: 8px; }
.big-btn:hover { filter: brightness(1.05); }
.back-btn { font-family: var(--title); font-size: 16px; padding: 7px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink2); flex: none; }
.back-btn:hover { background: #fff6e6; }
.link-btn { border: 0; background: none; color: #e86a3a; font: inherit; font-weight: 700; text-decoration: underline; padding: 0; }
kbd { font-family: var(--title); font-size: .9em; background: #fff; color: var(--ink); border: 1px solid #d6c7b4; border-bottom-width: 3px; border-radius: 6px; padding: 0 6px; }

/* ---------- 📅 시간표 (코르크 게시판) ---------- */
#grade { overflow: auto; }
.cork { min-height: 100%; padding: 70px 20px 30px; display: grid; place-items: start center; position: relative;
  background: radial-gradient(circle at 20% 30%, rgba(0,0,0,.05) 0 2px, transparent 3px) 0 0/22px 22px,
              radial-gradient(circle at 70% 60%, rgba(255,255,255,.12) 0 2px, transparent 3px) 0 0/30px 30px, #c99a63;
  box-shadow: inset 0 0 0 18px #9b6b3d, inset 0 0 0 22px #7e5530, inset 0 0 60px rgba(0,0,0,.25); }
.tt-paper { position: relative; width: min(980px, 100%); background: #fffdf6; border-radius: 6px; padding: 24px 26px 18px; box-shadow: 0 14px 34px rgba(60,30,0,.35); transform: rotate(-.4deg); }
.tt-pin { position: absolute; top: -10px; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9a9a, #e04848); box-shadow: 0 4px 6px rgba(0,0,0,.3); }
.tt-pin.p1 { left: 30px; } .tt-pin.p2 { right: 30px; background: radial-gradient(circle at 35% 35%, #9ad1ff, #3b82d6); }
.tt-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tt-head h2 { font-family: var(--title); font-size: 32px; font-weight: 400; margin: 0; color: #e86a3a; flex: 1; text-align: center; }
.tt-tip { font-family: 'Gaegu', var(--title); font-size: 20px; font-weight: 700; color: #4fa3e3; transform: rotate(4deg); }
.tt-grid { display: grid; grid-template-columns: 64px repeat(5, 1fr); gap: 8px; }
.tt-day { font-family: var(--title); font-size: 20px; text-align: center; padding: 6px 0; background: #ffe3d1; border-radius: 10px; color: #c2562f; }
.tt-period { font-family: var(--title); font-size: 15px; color: var(--ink2); display: grid; place-items: center; background: #f3ece0; border-radius: 10px; }
.tt-cell { position: relative; min-height: 112px; border: 3px solid color-mix(in srgb, var(--sc) 40%, #fff); border-radius: 16px; background: color-mix(in srgb, var(--sc) 12%, #fff);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; transition: transform .15s, box-shadow .15s; color: var(--ink); }
.tt-cell:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 10px 20px color-mix(in srgb, var(--sc) 35%, transparent); border-color: var(--sc); }
.tt-cell.empty { border: 2px dashed #e6dccd; background: transparent; font-size: 26px; color: var(--ink2); }
.tt-cell.empty:hover { transform: none; box-shadow: none; }
.tt-cell.empty small { font-family: 'Gaegu'; font-size: 16px; }
.tt-icon { font-size: 34px; line-height: 1; }
.tt-cell b { font-family: var(--title); font-size: 21px; font-weight: 400; color: color-mix(in srgb, var(--sc) 70%, #3b2f2a); }
.tt-cell small { font-size: 12px; color: var(--ink2); }
.tt-cell em { position: absolute; top: 6px; right: 8px; font-style: normal; font-size: 11px; background: #fff; border-radius: 6px; padding: 0 5px; color: var(--ink2); }
.tt-stamps { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 90%; }
.tt-stamps i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #e2554a; background: rgba(226,85,74,.15); }
.tt-foot { margin: 14px 4px 0; font-size: 14px; color: var(--ink2); text-align: center; }
.cork-note { position: absolute; font-family: 'Gaegu'; font-weight: 700; font-size: 20px; padding: 14px 16px; background: #fff59d; box-shadow: 0 8px 14px rgba(0,0,0,.25); line-height: 1.3; }
.cork-note.n1 { left: 34px; top: 80px; transform: rotate(-6deg); }
.cork-note.n2 { right: 34px; bottom: 40px; transform: rotate(5deg); background: #c8f0ff; font-size: 17px; }
@media (max-width: 1260px) { .cork-note { display: none; } }
@media (max-width: 700px) {
  .tt-grid { grid-template-columns: 40px repeat(5, 1fr); gap: 4px; } .tt-cell { min-height: 84px; } .tt-icon { font-size: 24px; } .tt-cell b { font-size: 15px; }
  .tt-cell small { display: none; } .tt-head h2 { font-size: 22px; } .tt-tip { display: none; } .tt-paper { padding: 18px 10px; }
}

/* ---------- 교실 배경 ---------- */
.room-host { position: absolute; inset: 0; }
.room-host .room { width: 100%; height: 100%; display: block; }
.room-host.dim::after { content: ''; position: absolute; inset: 0; background: rgba(255,250,240,.35); }

/* ---------- 📚 과목 (종류 → 묶음) ---------- */
#pick { overflow: auto; }
.pick-panel { position: relative; width: min(980px, calc(100% - 32px)); margin: 70px auto 30px; background: rgba(255,253,246,.96); border-radius: 26px; padding: 22px 24px 26px;
  border: 5px solid #fff; box-shadow: 0 18px 50px rgba(60,40,20,.25); }
.pick-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pick-head h2 { font-family: var(--title); font-size: 30px; font-weight: 400; margin: 0; color: color-mix(in srgb, var(--sc) 75%, #3b2f2a); }
.pick-head h2 span { font-size: 34px; }
.kind-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 18px; }
.kind-tab { border: 3px solid #eadcc9; background: #fff; border-radius: 16px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); transition: transform .12s; }
.kind-tab:hover { transform: translateY(-2px); border-color: var(--sc); }
.kind-tab span { font-size: 24px; } .kind-tab b { font-family: var(--title); font-size: 20px; font-weight: 400; } .kind-tab small { font-size: 12px; color: var(--ink2); }
.kind-tab.on { background: var(--sc); border-color: var(--sc); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--sc) 70%, #000); }
.kind-tab.on small { color: rgba(255,255,255,.9); }
.kind-tab[data-k="t"]:not(.on) { background: #fff8db; border-color: #ffd86b; }
.set-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.set-card { position: relative; text-align: left; border: 0; border-radius: 18px; padding: 16px 18px 14px 18px; background: #fff; color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 25%, #fff), 0 6px 0 color-mix(in srgb, var(--sc) 25%, #fff); transition: transform .12s, box-shadow .12s; }
.set-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--sc), 0 9px 0 color-mix(in srgb, var(--sc) 50%, #fff); }
.set-card b { font-family: var(--title); font-size: 22px; font-weight: 400; display: block; margin: 0 60px 6px 40px; min-height: 30px; }
.set-no { position: absolute; left: 16px; top: 15px; width: 30px; height: 30px; border-radius: 50%; background: var(--sc); color: #fff; font-family: var(--title); font-size: 17px; display: grid; place-items: center; }
.set-card p { margin: 0 0 8px; font-size: 14px; color: var(--ink2); line-height: 1.5; min-height: 42px; }
.set-card small { font-size: 13px; color: color-mix(in srgb, var(--sc) 70%, #3b2f2a); font-weight: 700; }
.mini-stamp { position: absolute; right: 10px; top: 8px; font-family: var(--title); font-size: 12px; color: #e2554a; border: 2.5px solid #e2554a; border-radius: 50%; width: 58px; height: 58px;
  display: grid; place-items: center; text-align: center; line-height: 1.1; padding: 4px; transform: rotate(-14deg); opacity: .85; background: rgba(255,255,255,.6); }
.mini-stamp.lv3 { color: #d48a00; border-color: #e8a10c; }
.attack-card { display: flex; gap: 22px; align-items: center; background: linear-gradient(135deg, #fff8db, #fff); border: 3px solid #ffd86b; border-radius: 22px; padding: 24px 28px; }
.ac-icon { font-size: 80px; filter: drop-shadow(0 6px 10px rgba(255,180,0,.5)); animation: bob2 1.6s ease-in-out infinite; }
@keyframes bob2 { 50% { transform: translateY(-6px) rotate(-6deg); } }
.attack-card h3 { font-family: var(--title); font-size: 28px; margin: 0 0 6px; font-weight: 400; }
.attack-card p { margin: 0 0 6px; line-height: 1.6; }
.ac-meta { font-size: 14px; color: var(--ink2); }
@media (max-width: 700px) { .kind-tabs { grid-template-columns: repeat(3, 1fr); } .kind-tab small { display: none; } .attack-card { flex-direction: column; text-align: center; } }

/* ---------- ✏️ 교실 칠판 ---------- */
#play { overflow: hidden; }
.board-wrap { position: absolute; left: 50%; top: 4vh; transform: translateX(-50%); width: min(1060px, calc(100% - 32px)); z-index: 2; }
.board { position: relative; height: clamp(250px, 46vh, 470px); border-radius: 6px; padding: 18px 28px 20px; color: var(--chalk);
  background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.08), transparent 60%), radial-gradient(ellipse at 80% 90%, rgba(255,255,255,.05), transparent 50%), var(--board);
  border: 16px solid #b07a43; box-shadow: 0 16px 30px rgba(60,40,20,.35), inset 0 0 40px rgba(0,0,0,.35), inset 0 0 0 2px rgba(0,0,0,.15);
  display: flex; flex-direction: column; font-family: var(--title); }
.board::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 20% 70%, rgba(255,255,255,.05) 0 60px, transparent 130px), radial-gradient(circle at 70% 30%, rgba(255,255,255,.04) 0 80px, transparent 170px),
    repeating-linear-gradient(170deg, transparent 0 18px, rgba(255,255,255,.012) 18px 20px); }
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 17px; color: rgba(246,243,232,.75); border-bottom: 2px dashed rgba(246,243,232,.25); padding-bottom: 8px; }
.bh-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bh-stats { display: flex; gap: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bh-stats b { color: #ffe9a8; font-weight: 400; }
.board-date { position: absolute; right: 18px; bottom: 6px; font-size: 14px; color: rgba(246,243,232,.45); }
.board-body { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: 6px 0; }
/* 글자: 아직 = 흐린 분필, 맞음 = 하얀 분필, 틀림 = 빨간 분필, 지금 칠 자리 = 노란 밑줄 */
.board .ch { position: relative; transition: color .08s; }
.board .ch.pending { color: rgba(246,243,232,.42); }
.board .ch.ok { color: #fffef6; text-shadow: 0 0 1px #fff, 0 0 6px rgba(255,255,255,.35); }
.board .ch.wrong { color: #ff8a80; text-shadow: 0 0 6px rgba(255,90,80,.6); }
.board .ch.now { color: rgba(246,243,232,.75); }
.board .ch.now::after { content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 4px; border-radius: 2px; background: #ffd84d; animation: blink 1s steps(2) infinite; }
.board .ch.extra { color: #ff8a80; font-size: .7em; }
@keyframes blink { 50% { opacity: .2; } }
.board[data-kind="w"] .board-body { align-items: center; text-align: center; }
.w-done { min-height: 34px; display: flex; gap: 14px; justify-content: center; font-size: 22px; color: rgba(246,243,232,.55); flex-wrap: wrap; }
.w-done span::after { content: ' ✓'; color: #9be7a8; }
.w-now { font-size: clamp(42px, 7vh, 74px); margin: 12px 0; letter-spacing: 2px; }
.w-next { display: flex; gap: 20px; justify-content: center; font-size: 24px; color: rgba(246,243,232,.55); flex-wrap: wrap; }
.board[data-kind="s"] .line { margin: 6px 0; font-size: 22px; line-height: 1.4; }
.board[data-kind="s"] .line.done { color: rgba(246,243,232,.45); }
.board[data-kind="s"] .line.done::before { content: '✓ '; color: #9be7a8; }
.board[data-kind="s"] .line.now { font-size: clamp(28px, 4.4vh, 42px); margin: 12px 0; }
.board[data-kind="s"] .line.next { color: rgba(246,243,232,.35); }
.para { margin: 0; font-size: clamp(21px, 3.1vh, 30px); line-height: 1.75; word-break: keep-all; }
.para .done { color: #fffef6; opacity: .85; }
.para .next { color: rgba(246,243,232,.36); }
.para .cur { background: rgba(255,255,255,.06); border-radius: 6px; box-shadow: 0 0 0 6px rgba(255,255,255,.06); }
.para-no { margin-top: 8px; font-size: 15px; color: rgba(246,243,232,.5); text-align: right; }
/* 분필 받침 */
.ledge { position: relative; height: 22px; margin: -4px -10px 0; background: linear-gradient(#c48b4f, #8f5d2e); border-radius: 0 0 8px 8px; box-shadow: 0 8px 14px rgba(0,0,0,.25); }
.chalk { position: absolute; top: -6px; height: 9px; width: 46px; border-radius: 4px; background: #f6f3e8; box-shadow: 0 2px 2px rgba(0,0,0,.2); }
.chalk.c1 { left: 64%; transform: rotate(-4deg); } .chalk.c2 { left: 69%; width: 30px; background: #ffd1dc; } .chalk.c3 { left: 73%; width: 38px; background: #fff3a6; transform: rotate(6deg); }
.eraser { position: absolute; right: 8%; top: -16px; width: 70px; height: 20px; border-radius: 4px; background: linear-gradient(#ffcf6b 0 45%, #7b6457 45%); box-shadow: 0 3px 4px rgba(0,0,0,.25); }
/* 불꽃 콤보 (분필 받침 위) */
.flame-holder { position: absolute; left: 12%; top: 0; width: 0; height: 0; }
.flame { position: absolute; left: 0; bottom: 4px; width: 0; height: 0; transform: translateX(-50%); transform-origin: 50% 100%; pointer-events: none;
  transition: width .35s, height .35s, opacity 1.5s ease-out, transform 1.5s ease-out; }
.flame i { display: block; width: 100%; height: 100%; border-radius: 50% 50% 50% 50% / 75% 75% 25% 25%;
  background: radial-gradient(ellipse at 50% 82%, #fff 0 16%, var(--f1) 34%, var(--f2) 62%, transparent 78%); transform-origin: 50% 100%; animation: flick .11s ease-in-out infinite alternate; }
@keyframes flick { from { transform: scale(.92, .88); } to { transform: scale(1.06, 1.08); } }
.flame[data-l="1"] { width: 30px; height: 46px; --f1: #fb923c; --f2: #ef4444; }
.flame[data-l="2"] { width: 38px; height: 62px; --f1: #fdba74; --f2: #f97316; }
.flame[data-l="3"] { width: 46px; height: 80px; --f1: #fde047; --f2: #f59e0b; }
.flame[data-l="4"] { width: 54px; height: 96px; --f1: #bfdbfe; --f2: #2563eb; }
.flame[data-l="5"] { width: 62px; height: 112px; --f1: #e9d5ff; --f2: #9333ea; }
.flame[data-l="6"] { width: 72px; height: 130px; --f1: #fef08a; --f2: #ec4899; }
.flame[data-l] i { filter: drop-shadow(0 0 8px var(--f2)) drop-shadow(0 0 16px var(--f1)); }
.flame[data-l="6"] i { background: radial-gradient(ellipse at 50% 82%, #fff 0 14%, transparent 30%), linear-gradient(0deg, #f43f5e, #f59e0b 25%, #84cc16 45%, #06b6d4 65%, #8b5cf6 85%, transparent);
  animation: flick .11s ease-in-out infinite alternate, rainbow 1s linear infinite; }
@keyframes rainbow { to { filter: drop-shadow(0 0 10px #f0abfc) hue-rotate(360deg); } }
.flame.out { opacity: 0; transform: translateX(-50%) scale(.2); }
.flame.boost i { animation: flick .11s ease-in-out infinite alternate, boost .6s ease-out; }
@keyframes boost { 35% { transform: scale(1.45, 1.6); } }
.flame b { position: absolute; left: 50%; bottom: 30%; width: 5px; height: 5px; border-radius: 50%; background: var(--f1); box-shadow: 0 0 6px var(--f2); opacity: 0; display: none; }
.flame[data-l="3"] b, .flame[data-l="4"] b, .flame[data-l="5"] b, .flame[data-l="6"] b { display: block; animation: spark .9s linear infinite; }
.flame b:nth-of-type(1) { --sx: -26px; } .flame b:nth-of-type(2) { --sx: 22px; animation-delay: .22s; }
.flame b:nth-of-type(3) { --sx: -12px; animation-delay: .45s; } .flame b:nth-of-type(4) { --sx: 30px; animation-delay: .68s; }
@keyframes spark { 0% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(calc(-50% + var(--sx)), -80px) scale(.3); opacity: 0; } }
.combo-badge { position: absolute; left: calc(12% + 46px); top: -40px; padding: 4px 12px; border-radius: 999px; font-family: var(--title); font-size: 17px; color: #fff; background: #ef4444; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.combo-badge[data-l="2"] { background: #f97316; } .combo-badge[data-l="3"] { background: #f59e0b; } .combo-badge[data-l="4"] { background: #2563eb; }
.combo-badge[data-l="5"] { background: #9333ea; } .combo-badge[data-l="6"] { background: linear-gradient(90deg, #f43f5e, #f59e0b, #22c55e, #06b6d4, #8b5cf6); }
.combo-badge.bump { animation: bump .18s ease-out; } @keyframes bump { 50% { transform: scale(1.18); } }
.combo-badge.broke { background: #94a3b8; animation: fadeAway 1.2s ease-out forwards; }
@keyframes fadeAway { 60% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }
.combo-burst { position: fixed; z-index: 35; left: 0; right: 0; top: 14%; text-align: center; pointer-events: none; font-family: var(--title); font-size: 54px; color: #fff; opacity: 0;
  text-shadow: 0 0 12px var(--bc, #f97316), 0 0 30px var(--bc, #f97316), 0 6px 18px rgba(0,0,0,.5); }
.combo-burst.show { animation: burst 1.3s ease-out; }
@keyframes burst { 0% { opacity: 0; transform: scale(.4); } 15% { opacity: 1; transform: scale(1.15); } 30% { transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
.start-tip { position: absolute; left: 50%; top: calc(4vh + clamp(250px, 46vh, 470px) + 34px); transform: translateX(-50%); font-family: var(--title); font-size: 18px; color: #fff;
  background: #ff8a5c; padding: 6px 18px; border-radius: 999px; border: 3px solid #fff; transition: opacity .4s; pointer-events: none; z-index: 3; white-space: nowrap; }
.start-tip.gone { opacity: 0; }
/* 책상 + 공책 */
.desk { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px 14px; display: flex; flex-direction: column; align-items: center; z-index: 2;
  background: linear-gradient(#e2b47e, #c8925a 40%, #b47d48); box-shadow: 0 -6px 0 #f0c896, 0 -12px 30px rgba(60,30,0,.25); }
.desk::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 120px, rgba(0,0,0,.04) 120px 122px); pointer-events: none; }
.notebook { position: relative; width: min(900px, 100%); background: #fffefa; border-radius: 6px 14px 14px 6px; padding: 10px 18px 8px 34px; transform: rotate(-.4deg);
  box-shadow: 0 6px 0 #e9e1d0, 0 10px 20px rgba(0,0,0,.2); background-image: linear-gradient(90deg, transparent 22px, #ffb3b3 22px 24px, transparent 24px); }
.nb-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--ink2); margin-bottom: 6px; }
.nb-btns { display: flex; gap: 6px; flex: none; }
.nb-btn { font-family: var(--title); font-size: 14px; border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 3px 10px; color: var(--ink2); }
.nb-btn.on { background: #4fa3e3; color: #fff; border-color: #4fa3e3; }
.type-box { width: 100%; font-family: var(--title); font-size: 30px; padding: 8px 14px; border: 3px solid #d6e6f5; border-radius: 12px; outline: none; color: var(--ink); background: #fff; transition: border-color .15s; }
.type-box.long { font-size: 24px; }
.type-box:focus { border-color: #4fa3e3; box-shadow: 0 0 0 4px rgba(79,163,227,.2); }
.type-host[data-state="wrong"] .type-box { border-color: #ef5350; background-color: #fff5f5; }
.type-host[data-state="done"] .type-box { border-color: #5cc28a; }
.type-box.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.wrong-hint { min-height: 24px; font-size: 15px; color: #c0392b; padding-top: 4px; }
.wrong-hint b.want { color: #2f7d4f; background: #e3f6ea; border-radius: 6px; padding: 0 5px; }
.wrong-hint b.got { color: #c0392b; background: #fde7e7; border-radius: 6px; padding: 0 5px; }
.kb-host { margin-top: 10px; background: rgba(40, 30, 20, .82); border-radius: 14px; padding: 6px 8px 8px; width: min(760px, 100%); position: relative; }
.kb-cap { color: #f3e9dc; font-size: 13px; min-height: 20px; padding: 0 4px 4px; }
.kb-cap .kb-ch { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 6px; background: #fff; color: #222; text-align: center; font-family: var(--title); }
@media (max-height: 760px) { #play .kb-host { display: none !important; } }

/* ---------- 자판 그림 (keyboard.js) ---------- */
[data-f$="5"] { --fc: #ec4899; } [data-f$="4"] { --fc: #a855f7; } [data-f$="3"] { --fc: #3b82f6; } [data-f$="2"] { --fc: #22c55e; } [data-f$="1"] { --fc: #94a3b8; }
.kb { --kh: clamp(34px, 5.6vh, 52px); user-select: none; }
.kb-board { background: rgba(40,30,20,.85); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.kb-row { display: flex; gap: 6px; }
.key { position: relative; flex-basis: 0; min-width: 0; height: var(--kh); border-radius: 9px; background: color-mix(in srgb, var(--fc, #cbd5e1) 24%, #fff);
  border-bottom: 4px solid var(--fc, #94a3b8); color: #222; display: grid; place-items: center; font-family: var(--title); font-size: calc(var(--kh) * .42); transition: transform .12s, background .12s, box-shadow .12s; }
.key small { position: absolute; top: 3px; left: 6px; font-size: calc(var(--kh) * .24); color: #6b5a50; }
.key.mod { font-size: calc(var(--kh) * .27); color: #555; }
.key[data-f=""] { background: #d9d0c4; border-bottom-color: #b3a796; color: #7a6d62; }
.key .bump { position: absolute; bottom: 5px; left: 50%; width: 12px; height: 3px; margin-left: -6px; border-radius: 2px; background: #555; opacity: .6; }
.key.mark { box-shadow: 0 0 0 3px #fbbf24; }
.key.on { z-index: 1; background: var(--fc, #ff8a5c); color: #fff; border-bottom-color: rgba(0,0,0,.25); transform: translateY(-3px) scale(1.08);
  box-shadow: 0 0 0 3px #fff, 0 0 22px 4px var(--fc, #ff8a5c); animation: keyGlow 1s ease-in-out infinite; }
.key.on small { color: #fff; }
@keyframes keyGlow { 50% { box-shadow: 0 0 0 3px #fff, 0 0 34px 10px var(--fc, #ff8a5c); } }
.key.down { transform: translateY(2px); filter: brightness(.85); }
.key.hit { background: #22c55e; color: #fff; transform: translateY(2px); }
.key.miss { background: #ef4444; color: #fff; transform: translateY(2px); }
.kb-hands { display: flex; justify-content: center; gap: 22%; margin-top: calc(var(--kh) * -.9); pointer-events: none; }
.hand { height: clamp(110px, 19vh, 170px); overflow: visible; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.hand .palm { fill: #fde3c8; stroke: #e5b48a; stroke-width: 2; }
.hand [data-f] { fill: color-mix(in srgb, var(--fc) 32%, #fde3c8); stroke: #e5b48a; stroke-width: 2; transition: fill .15s; }
.hand [data-f].on { fill: var(--fc); stroke: #fff; stroke-width: 4; }
.kb-small { --kh: 24px; }
.kb-small .kb-board { background: none; padding: 0; gap: 3px; }
.kb-small .kb-row { gap: 3px; }
.kb-small .key { border-radius: 5px; border-bottom-width: 2px; }
.kb-small .key small { display: none; }
.kb-small .key .bump { bottom: 2px; height: 2px; }
.kb-small .key.on { transform: translateY(-1px) scale(1.12); box-shadow: 0 0 0 2px #fff, 0 0 12px 3px var(--fc, #ff8a5c); animation: none; }

/* ---------- 🔔 결과 + 도장 ---------- */
.result { text-align: center; }
.r-bell { font-family: var(--title); font-size: 22px; color: #e8a10c; animation: ding .8s ease-out; }
@keyframes ding { 0% { transform: rotate(-10deg) scale(.7); opacity: 0; } 40% { transform: rotate(8deg) scale(1.1); opacity: 1; } 100% { transform: none; } }
.r-title { font-family: var(--title); font-size: 22px; margin: 4px 0 6px; }
.stamp-zone { height: 150px; display: grid; place-items: center; }
.stamp { width: 136px; height: 136px; border-radius: 50%; border: 6px solid #e2554a; color: #e2554a; display: grid; place-items: center; align-content: center; gap: 2px;
  font-family: var(--title); transform: rotate(-12deg); background: radial-gradient(circle, rgba(226,85,74,.06), rgba(226,85,74,.12)); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 7px #e2554a;
  animation: stampIn .5s .75s cubic-bezier(.3,1.7,.5,1) both; }
.stamp span { font-size: 21px; line-height: 1.15; padding: 0 12px; word-break: keep-all; } .stamp small { font-size: 12px; opacity: .85; }
.stamp.lv3 { border-color: #e8a10c; color: #d48a00; box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 7px #e8a10c; background: radial-gradient(circle, rgba(255,200,60,.15), rgba(255,200,60,.3)); }
.stamp.lv3 span::before { content: '⭐'; display: block; font-size: 22px; }
@keyframes stampIn { 0% { transform: scale(3) rotate(-30deg); opacity: 0; } 60% { transform: scale(.92) rotate(-10deg); opacity: 1; } 100% { transform: scale(1) rotate(-12deg); opacity: 1; } }
.r-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.r-stats div { background: #fff; border-radius: 14px; padding: 8px 4px; border: 2px solid var(--line); }
.r-stats small { display: block; font-size: 12px; color: var(--ink2); } .r-stats b { font-family: var(--title); font-size: 22px; font-weight: 400; }
.r-full { font-family: var(--title); font-size: 18px; color: #fff; background: linear-gradient(90deg, #f43f5e, #f59e0b, #22c55e, #06b6d4, #8b5cf6); border-radius: 999px; padding: 4px 14px; display: inline-block; }
.r-next { font-size: 14px; color: var(--ink2); }
.r-rank { margin: 10px 0 4px; min-height: 30px; }
.r-btns { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.rk-title { font-family: var(--title); font-size: 17px; margin-bottom: 4px; }
.rk-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.rk-list li { display: flex; gap: 10px; align-items: center; padding: 5px 10px; border-radius: 10px; font-size: 15px; }
.rk-list li:nth-child(odd) { background: #fff6e8; }
.rk-list li.me { background: #fff1b8; font-weight: 700; }
.rk-list span { width: 28px; text-align: center; font-family: var(--title); } .rk-list b { flex: 1; font-weight: 700; } .rk-list em { font-style: normal; font-family: var(--title); color: #e86a3a; }
.rk-list.big li { font-size: 17px; padding: 8px 12px; }
.rk-msg { font-size: 14px; color: var(--ink2); margin: 6px 0 0; }
.rk-empty { text-align: center; color: var(--ink2); padding: 20px 0; }
.rank-board .rk-sel { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.rank-board select { font-family: var(--font); font-size: 15px; padding: 6px 8px; border-radius: 10px; border: 2px solid var(--line); background: #fff; flex: 1 1 120px; }
.rk-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.rk-tabs button { flex: 1; font-family: var(--title); font-size: 16px; padding: 6px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.rk-tabs button.on { background: #ffc83d; border-color: #ffc83d; }
.rk-body { min-height: 120px; }
.rk-note { font-size: 12px; color: var(--ink2); text-align: center; }
.m-title { font-family: var(--title); font-size: 26px; font-weight: 400; margin: 0 0 8px; text-align: center; }
.m-text { font-size: 15px; line-height: 1.6; color: var(--ink2); text-align: center; }
.field { display: block; font-size: 14px; color: var(--ink2); margin: 10px 0; }
.field input { display: block; width: 100%; margin-top: 4px; font-family: var(--title); font-size: 22px; padding: 8px 12px; border-radius: 12px; border: 3px solid var(--line); outline: none; }
.field input:focus { border-color: #4fa3e3; }
.m-err { min-height: 20px; color: #c0392b; font-size: 14px; text-align: center; }
@media (max-width: 520px) { .r-stats { grid-template-columns: repeat(2, 1fr); } }
