/* 칼퇴런 디자인
   - 배경: 어두운 사무실 밤(gray-950) + 시트 격자 무늬 + 아래쪽 퇴근 노을(amber)
   - 강조색은 amber 하나(시계·주요 버튼). 직급마다 고유 색(--tier)은 배지·빛에만
   - 간격 4px 단위, 모서리 카드 16~20px / 버튼 999px(알약) / 시트 10px */
:root {
  --bg: #0b0f19;
  --panel: #111827;
  --panel-2: #1f2937;
  --glass: rgba(17, 24, 39, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --faint: #6b7280;
  --amber: #fbbf24;
  --amber-ink: #1c1300;
  --red: #f43f5e;
  --green: #34d399;
  --blue: #38bdf8;
  --paper: #fbfaf6;
  --paper-head: #ebe7dd;
  --paper-line: #dcd7cb;
  --ink: #1f2430;
  --font: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --mono: 'SF Mono', 'JetBrains Mono', 'Consolas', 'D2Coding', monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body { margin: 0; height: 100%; }
body {
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
  background:
    radial-gradient(ellipse 80% 45% at 50% 110%, rgba(251, 146, 60, 0.18), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% -10%, rgba(56, 189, 248, 0.08), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 96px 28px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) 0 0 / 96px 28px,
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
button {
  font: inherit; cursor: pointer; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04);
  color: var(--text); border-radius: 6px; padding: 8px 16px; font-weight: 600; font-size: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease);
}
button:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.24); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.3; cursor: default; }
button.primary { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); box-shadow: 0 8px 24px -8px rgba(251, 191, 36, 0.6); }
button.primary:hover { background: #fcd34d; }
button.ghost { background: transparent; }
button.link { background: none; border: none; color: var(--faint); text-decoration: underline; text-underline-offset: 3px; padding: 0; font-weight: 500; font-size: 12px; }
button.link:hover { color: var(--muted); }
kbd {
  font-family: var(--mono); font-size: 11.5px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--text); white-space: nowrap;
}

/* ---------- 화면 전환 ---------- */
#title-screen, #game-screen { display: none; height: 100%; }
body[data-screen='title'] #title-screen { display: flex; }
body:not([data-screen='title']) #game-screen { display: flex; }
.overlay, #countdown { display: none; }
body[data-screen='brief'] #brief-overlay,
body[data-screen='result'] #result-overlay { display: flex; }
body[data-screen='countdown'] #countdown { display: flex; }

/* =====================================================================
   타이틀: 가로 직급 사다리
   ===================================================================== */
#title-screen { flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px 0 16px; position: relative; overflow: hidden; }
.title-top { text-align: center; transition: opacity 0.3s, transform 0.4s var(--ease); }
#title-screen.promo .title-top { opacity: 0; transform: scale(0.92); }
.logo { font-size: 64px; font-weight: 900; letter-spacing: -0.04em; line-height: 1; }
.logo span, .brand span { color: var(--amber); }
.logo span { text-shadow: 0 0 32px rgba(251, 191, 36, 0.45); }
.tagline { color: var(--muted); margin: 12px 0 0; font-size: 15px; letter-spacing: -0.01em; }

.career { width: 100%; }
.track-viewport {
  position: relative; width: 100%; height: 392px; overflow: hidden; perspective: 1400px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
}
.track { position: absolute; top: 28px; left: 0; display: flex; gap: 48px; transition: transform 0.75s var(--ease); will-change: transform; }
.track.instant { transition: none; }

/* 진급선 */
.rail { position: absolute; top: 316px; height: 2px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
.rail i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: linear-gradient(90deg, rgba(52, 211, 153, 0.5), var(--green) 70%, var(--amber)); box-shadow: 0 0 12px rgba(52, 211, 153, 0.6); transition: width 0.8s var(--ease); }
.rail.flash i { animation: railFlash 0.9s ease-out; }
@keyframes railFlash { 30% { box-shadow: 0 0 30px 4px rgba(251, 191, 36, 0.9); } }

.node { width: 272px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; cursor: pointer; --d: 1; }
.rk-card {
  position: relative; width: 100%; height: 300px; padding: 24px 20px 20px; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 60%), var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.6);
  transform-origin: 50% 100%;
  transform: scale(calc(1 - var(--d) * 0.13)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  opacity: calc(1 - var(--d) * 0.28);
  transition: transform 0.6s var(--ease), opacity 0.6s var(--ease), border-color 0.3s, box-shadow 0.4s;
  backdrop-filter: blur(10px);
}
.node.focus .rk-card { transition: transform 0.18s ease-out, opacity 0.6s var(--ease), border-color 0.3s, box-shadow 0.4s; }
.node:not(.focus):hover .rk-card { opacity: calc(1 - var(--d) * 0.28 + 0.15); }
.rk-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--tier) 28%, transparent), transparent 62%); }
.node.focus .rk-glow { opacity: 1; }

.hex {
  width: 72px; height: 80px; display: grid; place-content: center; text-align: center; line-height: 1;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, color-mix(in srgb, var(--tier) 100%, #fff 25%), color-mix(in srgb, var(--tier) 70%, #000 30%));
  color: #0b0f19; font-weight: 900; font-size: 30px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.hex small { display: block; font-size: 10px; letter-spacing: 0.12em; font-weight: 800; opacity: 0.7; margin-bottom: 2px; }
.rk-name { font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin-top: 14px; line-height: 1.1; }
.rk-boss { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 6px; min-height: 22px; }
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.rk-stats { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rk-stats div { padding: 10px 0; }
.rk-stats div + div { border-left: 1px solid var(--line); }
.rk-stats small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.rk-stats b { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rk-foot { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; width: 100%; }
.cta { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 6px; background: var(--amber); color: var(--amber-ink); font-weight: 800; font-size: 14px; box-shadow: 0 8px 24px -8px rgba(251, 191, 36, 0.7); }
.cta kbd { background: rgba(0, 0, 0, 0.12); border-color: rgba(0, 0, 0, 0.2); color: var(--amber-ink); }
.cta.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; font-weight: 600; padding: 7px 14px; font-size: 13px; }
.node:not(.focus) .cta { opacity: 0; }
.rk-best { display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 700; }
.rk-best .g { font-size: 18px; font-weight: 900; width: auto; }
.lock-msg { color: var(--faint); font-size: 12.5px; line-height: 1.4; }
.lock-icon { font-size: 18px; filter: grayscale(1); display: inline-block; }
.rk-ribbon { position: absolute; top: 18px; right: -40px; transform: rotate(40deg); background: var(--green); color: #022c1d; font-size: 11px; font-weight: 800; padding: 4px 44px; letter-spacing: 0.02em; }

/* 상태별 */
.node.current.focus .rk-card {
  border-color: color-mix(in srgb, var(--tier) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier) 30%, transparent), 0 32px 80px -24px color-mix(in srgb, var(--tier) 55%, transparent);
}
.node.cleared .rk-card { background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 60%), rgba(17, 24, 39, 0.6); }
.node.cleared .rk-name, .node.cleared .hex { opacity: 0.6; }
.node.locked .rk-card { border-style: dashed; border-color: rgba(255, 255, 255, 0.12); background: rgba(17, 24, 39, 0.5); }
.node.locked .hex { background: #1f2937; color: #4b5563; }
.node.locked .rk-name { color: #4b5563; }
.node.locked .rk-stats b { color: #4b5563; }

/* 진급선 위 점 */
.node-dot { width: 14px; height: 14px; border-radius: 50%; margin-top: 10px; background: #1f2937; border: 2px solid #374151; position: relative; z-index: 1; transition: all 0.4s; }
.node.cleared .node-dot { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.node.current .node-dot { background: var(--amber); border-color: var(--amber); }
.node.current .node-dot::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--amber); animation: ping 1.6s ease-out infinite; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.8); opacity: 0; } }
.node-label { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--faint); transition: color 0.3s; }
.node.focus .node-label { color: var(--text); }

/* 움직임 */
.rk-card.shake { animation: shakeX 0.4s; }
@keyframes shakeX { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.rk-card.bump-l { animation: bumpL 0.3s; }
.rk-card.bump-r { animation: bumpR 0.3s; }
@keyframes bumpL { 40% { translate: 14px 0; } }
@keyframes bumpR { 40% { translate: -14px 0; } }
.node.launch .rk-card { scale: 1.05; filter: brightness(1.25); transition: scale 0.25s var(--ease), filter 0.25s; }
.node.stamped .rk-card::after {
  content: '완료'; position: absolute; top: 46%; left: 50%; translate: -50% -50%; rotate: -14deg;
  border: 4px double var(--red); color: var(--red); border-radius: 6px; padding: 4px 16px;
  font-size: 34px; font-weight: 900; letter-spacing: 0.1em; background: rgba(11, 15, 25, 0.6);
  animation: stamp 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.node.unlocking .lock-icon { animation: unlockPop 0.42s ease-in forwards; }
@keyframes unlockPop { 30% { transform: rotate(-20deg) scale(1.3); filter: none; } 60% { transform: rotate(16deg) scale(1.5); } to { transform: scale(2.4); opacity: 0; } }
.node.unlocking .rk-card { border-color: var(--amber); box-shadow: 0 0 60px -10px rgba(251, 191, 36, 0.8); }
.node.flip .rk-card { animation: flipIn 0.7s var(--ease); }
@keyframes flipIn { from { transform: rotateY(90deg) scale(0.9); filter: brightness(2.2); } to { transform: rotateY(0) scale(1); filter: none; } }

.career-nav { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 4px; }
.nav-btn { width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; display: grid; place-items: center; }
#career-dots { display: flex; gap: 6px; align-items: center; }
#career-dots i { width: 8px; height: 8px; border-radius: 6px; background: #374151; cursor: pointer; transition: width 0.3s var(--ease), background 0.3s; }
#career-dots i.cleared { background: rgba(52, 211, 153, 0.6); }
#career-dots i.current { background: rgba(251, 191, 36, 0.6); }
#career-dots i.on { width: 24px; background: var(--text); }

#promo-banner { position: absolute; left: 50%; top: max(24px, calc(50% - 300px)); translate: -50% 0; text-align: center; pointer-events: none; opacity: 0; z-index: 40; }
#promo-banner small { display: block; font-size: 14px; font-weight: 900; letter-spacing: 0.5em; color: var(--amber); }
#promo-banner b { display: block; font-size: 44px; font-weight: 900; letter-spacing: -0.03em; margin-top: 4px;
  background: linear-gradient(90deg, #fde68a, #fbbf24, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 24px rgba(251, 191, 36, 0.5)); }
#promo-banner.show { animation: banner 1.9s var(--ease) forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateY(16px) scale(0.85); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
#fx-layer i { position: fixed; width: 8px; height: 12px; border-radius: 2px; animation: confetti 1s cubic-bezier(0.15, 0.6, 0.4, 1) forwards; }
@keyframes confetti { to { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); opacity: 0; } }

#practice { min-height: 0; }
#practice details { width: min(760px, calc(100vw - 32px)); margin: 4px auto 0; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
#practice summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 120px; overflow-y: auto; }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 10px; font-size: 12.5px; font-weight: 500; border-radius: 6px; }
.chip b { color: var(--amber); }
.chip em { font-style: normal; color: var(--faint); font-size: 11px; }
.chip.done b { color: var(--green); }

.title-help { color: var(--faint); font-size: 13px; margin: 10px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.title-help i { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin: 0 6px; }
.title-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; color: var(--faint); font-size: 12px; margin-top: 10px; align-items: center; }
.title-foot .legal-link, .shop-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.title-foot .legal-link:hover, .shop-note a:hover { color: var(--text); }
.lang-pick { display: inline-flex; align-items: center; gap: 6px; }
.lang-pick select { background: transparent; color: var(--faint); border: 1px solid currentColor; border-radius: 6px; font: inherit; padding: 2px 6px; cursor: pointer; }
.lang-pick select:hover, .lang-pick select:focus-visible { color: var(--text, #e5e7eb); }
.lang-pick option { background: #111827; color: #e5e7eb; }
.ime-note:empty { display: none; }
.g { display: inline-block; width: 24px; text-align: center; margin-right: 2px; font-weight: 900; }
.g-S { color: var(--amber); } .g-A { color: var(--green); } .g-B { color: var(--blue); } .g-C, .g-F { color: var(--red); }

/* =====================================================================
   게임 화면
   ===================================================================== */
#game-screen { flex-direction: column; position: relative; }
#hud {
  position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(11, 15, 25, 0.75); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.hud-left { display: flex; gap: 16px; align-items: center; min-width: 0; }
.brand { font-weight: 900; font-size: 20px; letter-spacing: -0.03em; flex-shrink: 0; }
.hud-task { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
#task-title { color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stage-dots { display: flex; gap: 3px; }
#stage-dots:empty { display: none; }
#stage-dots i { width: 18px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); transition: background 0.3s; }
#stage-dots i.done { background: var(--green); }
#stage-dots i.now { background: var(--amber); animation: blink 1.2s ease-in-out infinite; }
.hud-mid { display: flex; align-items: center; gap: 12px; }
#clock {
  font-family: var(--mono); font-size: 30px; font-weight: 700; color: #e8edf5; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(232, 237, 245, 0.18);
  padding: 2px 14px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1);
  transition: color 0.4s, background 0.4s, border-color 0.4s;
}
#clock.soon { color: #fb923c; background: rgba(251, 146, 60, 0.1); border-color: rgba(251, 146, 60, 0.45); text-shadow: 0 0 22px rgba(251, 146, 60, 0.55); }
#clock.late { color: #fff; background: var(--red); border-color: var(--red); text-shadow: 0 0 22px rgba(255, 255, 255, 0.5); animation: clockPulse 1s ease-out infinite; }
@keyframes clockPulse { 0% { transform: scale(1.12); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); } 70% { transform: scale(1); box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); } 100% { transform: scale(1); } }
#overtime { background: var(--red); color: #fff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 6px; }
@keyframes blink { 50% { opacity: 0.55; } }
.hud-right { display: flex; justify-content: flex-end; gap: 18px; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; align-items: baseline; }
.hud-right b { color: var(--text); font-size: 17px; font-weight: 700; }
#split { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 3px 10px; border-radius: 6px; }
#split:empty { display: none; }
#split.ahead { background: rgba(52, 211, 153, 0.12); }
#split.behind { background: rgba(244, 63, 94, 0.12); }
.ahead { color: var(--green); }
.behind { color: var(--red); }

#play-area { flex: 1; display: flex; gap: 16px; padding: 16px; min-height: 0; }
#sheet { flex: 1; display: flex; flex-direction: column; min-width: 0; border-radius: 8px; overflow: hidden; background: var(--paper); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 60px -12px rgba(0, 0, 0, 0.7); }
#sheet.disabled { filter: saturate(0.7); }

/* 수식 입력줄 */
.fbar { display: flex; align-items: stretch; border-bottom: 1px solid var(--paper-line); background: #fff; color: var(--ink); height: 34px; }
.namebox { width: 88px; display: flex; align-items: center; justify-content: center; border-right: 1px solid var(--paper-line); font-family: var(--mono); font-size: 13px; }
.fx { width: 36px; display: flex; align-items: center; justify-content: center; color: #8b8676; font-style: italic; font-weight: 700; border-right: 1px solid var(--paper-line); }
.formula { flex: 1; display: flex; align-items: center; padding: 0 10px; font-family: var(--mono); font-size: 14px; white-space: pre; overflow: hidden; cursor: text; }

/* 격자 */
.grid-scroll { flex: 1; overflow: auto; position: relative; }
.grid-inner { position: relative; width: max-content; }
table.grid { border-collapse: collapse; table-layout: fixed; color: var(--ink); font-size: 14px; }
.grid th, .grid td { height: 26px; border: 1px solid var(--paper-line); padding: 0 6px; white-space: nowrap; overflow: hidden; }
.grid thead th { position: sticky; top: 0; z-index: 5; background: var(--paper-head); font-weight: 600; font-size: 12px; color: #6d6859; cursor: s-resize; }
.grid th.rh { position: sticky; left: 0; z-index: 4; background: var(--paper-head); font-weight: 600; font-size: 12px; color: #6d6859; text-align: center; cursor: e-resize; }
.grid th.corner { left: 0; z-index: 6; }
.grid th.hl { background: #ffe2a3; color: #5a3f00; }
.grid td { cursor: cell; font-variant-numeric: tabular-nums; }
.grid td.num { text-align: right; }
.grid td.bool { text-align: center; }
.grid td.err { color: #d0342c; text-align: center; font-weight: 600; }
.grid td.fml { color: #11407a; }
.grid td.insel { background: rgba(251, 191, 36, 0.16); }
.grid td.mark-todo { background: repeating-linear-gradient(-45deg, #fff6dc, #fff6dc 5px, #fffaf0 5px, #fffaf0 10px); }
.grid td.mark-bad { background: #ffe1df; }
.grid td.mark-ok { background: #dff7e9; }
.grid td.mark-tampered { background: #ffd0cc; outline: 1px solid #d0342c; }
.grid td.insel.mark-ok, .grid td.insel.mark-todo, .grid td.insel.mark-bad { box-shadow: inset 0 0 0 999px rgba(251, 191, 36, 0.16); }

.box { position: absolute; pointer-events: none; display: none; z-index: 3; }
.sel-box { border: 2px solid #e08a00; }
.copy-box { border: 2px dashed #2a7de1; animation: march 0.6s linear infinite; }
.point-box { border: 2px dashed #8a4fff; background: rgba(138, 79, 255, 0.08); }
@keyframes march { 50% { border-color: #9cc4f5; } }

.editor {
  position: absolute; z-index: 7; border: 2px solid #e08a00; outline: none; padding: 0 5px;
  font: 14px var(--font); color: var(--ink); background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.editor.idle { opacity: 0; pointer-events: none; caret-color: transparent; }

/* 채우기 핸들 */
.fill-handle { position: absolute; z-index: 6; width: 8px; height: 8px; background: #e08a00; border: 1px solid #fff; cursor: crosshair; display: none; }
#sheet.disabled .fill-handle { display: none !important; }
.fill-box { border: 2px dashed #e08a00; background: rgba(224, 138, 0, 0.06); }

/* 함수 자동완성 · 인수 힌트 */
.ac-list {
  position: absolute; z-index: 9; display: none; min-width: 260px; background: #fff; color: var(--ink);
  border: 1px solid #cfc9bb; border-radius: 6px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); overflow: hidden; font-size: 13px;
}
.ac-list [data-i] { display: flex; gap: 10px; align-items: baseline; padding: 5px 10px; cursor: pointer; }
.ac-list [data-i] b { font-family: var(--mono); min-width: 96px; }
.ac-list [data-i] span { color: #7a7465; font-size: 12px; }
.ac-list [data-i].on { background: #ffe2a3; }
.ac-list .ac-foot { padding: 4px 10px; font-size: 11px; color: #8b8676; background: #f4f1ea; border-top: 1px solid #e6e1d5; }
.arg-hint {
  position: absolute; z-index: 9; display: none; white-space: nowrap; background: #fffbe8; color: var(--ink);
  border: 1px solid #e6d9a8; border-radius: 6px; padding: 4px 10px; font: 12.5px var(--mono); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.arg-hint u { text-decoration: none; font-weight: 800; background: #ffe2a3; border-radius: 3px; padding: 0 2px; }
.arg-hint span { font-family: var(--font); color: #8b8676; margin-left: 10px; }

/* 업무 패널 */
#task-panel { width: 320px; flex-shrink: 0; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 10px; padding: 18px; overflow-y: auto; display: flex; flex-direction: column; }
#task-panel h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
#task-panel h3 small { color: var(--amber); font-size: 12px; font-weight: 800; background: rgba(251, 191, 36, 0.1); padding: 2px 8px; border-radius: 6px; }
#task-msg { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; line-height: 1.55; padding: 8px 10px; background: rgba(255, 255, 255, 0.03); border-radius: 4px 6px 6px 6px; }
#task-msg b { color: var(--faint); font-weight: 700; margin-right: 4px; }
#task-goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
#task-goals li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: start; font-size: 15px; font-weight: 600; color: #fff; line-height: 1.4; padding: 9px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.12); transition: all 0.3s; }
#task-goals li em { font-style: normal; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
#task-goals .check { width: 18px; height: 18px; border: 2px solid #4b5563; border-radius: 6px; display: grid; place-items: center; font-size: 11px; margin-top: 1px; transition: all 0.25s var(--ease); }
#task-goals li.done { color: var(--faint); background: rgba(52, 211, 153, 0.06); border-color: rgba(52, 211, 153, 0.2); }
#task-goals li.done .check { background: var(--green); border-color: var(--green); color: #022c1d; transform: scale(1.1); }
#task-warn { color: var(--red); font-size: 13px; }
#task-warn:empty, #hint-text:empty { display: none; }
#hint-text { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.3); border-radius: 6px; padding: 10px 12px; font-size: 13px; line-height: 1.55; font-family: var(--mono); }
.task-buttons { display: flex; gap: 8px; margin: 14px 0; }
.task-buttons button { flex: 1; font-size: 13px; padding: 7px; }
.keyref { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.keyref summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--faint); letter-spacing: 0.03em; list-style: none; display: flex; align-items: center; gap: 6px; }
.keyref summary::-webkit-details-marker { display: none; }
.keyref summary::before { content: '▸'; transition: transform 0.2s; }
.keyref[open] summary::before { transform: rotate(90deg); }
.keyref summary:hover { color: var(--muted); }
.keyref h4 { margin: 14px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--faint); }
.keyref dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; font-size: 12.5px; }
.keyref dt { font-family: var(--mono); color: var(--text); font-size: 11.5px; }
.keyref dd { margin: 0; color: var(--muted); }
#task-tips dt { color: var(--amber); }
.ime-note { font-size: 11.5px; color: var(--faint); margin-top: 12px; line-height: 1.5; }

/* 겹쳐 뜨는 창 */
.overlay { position: absolute; inset: 0; z-index: 20; align-items: center; justify-content: center; background: rgba(5, 8, 14, 0.7); backdrop-filter: blur(6px); padding: 16px; animation: fadeIn 0.2s ease-out; }
.card {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 50%), var(--panel);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 28px; width: min(540px, 100%); max-height: 100%; overflow-y: auto;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8); animation: cardIn 0.35s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.brief-head { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; align-items: center; margin-bottom: 18px; }
.brief-head .hex { grid-row: span 2; width: 56px; height: 62px; font-size: 22px; }
.brief-head .hex small { font-size: 8px; }
.brief-head span { color: color-mix(in srgb, var(--tier, var(--amber)) 100%, #fff 20%); font-size: 13px; font-weight: 800; }
.brief-head h2 { margin: 0; font-size: 24px; letter-spacing: -0.03em; line-height: 1.25; }
.chat { display: flex; gap: 12px; margin-bottom: 8px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(160deg, #475569, #1e293b); display: grid; place-items: center; font-weight: 800; font-size: 17px; flex-shrink: 0; border: 1px solid var(--line-strong); }
.boss-name { font-size: 12px; color: var(--faint); margin-bottom: 4px; font-weight: 600; }
.bubble { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 4px 10px 10px 10px; padding: 11px 15px; line-height: 1.55; font-size: 14.5px; }
.card h4 { margin: 18px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--faint); }
#brief-goals { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
#brief-goals li { padding: 8px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 6px; font-size: 14px; }
#brief-tips { border-collapse: collapse; font-size: 13.5px; }
#brief-tips td { padding: 4px 14px 4px 0; }
#brief-tips td:last-child { color: var(--muted); }
#brief-par { color: var(--muted); font-size: 13px; margin: 18px 0 0; padding: 12px 14px; border-radius: 8px; background: rgba(251, 191, 36, 0.06); border: 1px solid rgba(251, 191, 36, 0.15); line-height: 1.5; }
#brief-par b { color: var(--text); }
.card-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.card-buttons .primary { padding: 10px 22px; }

#countdown { position: absolute; inset: 0; z-index: 20; align-items: center; justify-content: center; font-size: 180px; font-weight: 900; color: var(--amber); background: rgba(5, 8, 14, 0.5); backdrop-filter: blur(2px); text-shadow: 0 0 60px rgba(251, 191, 36, 0.6); font-variant-numeric: tabular-nums; }
#countdown.pop { animation: pop 0.6s ease-out; }
@keyframes pop { from { transform: scale(1.8); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

/* 결과 */
.card.result { width: min(620px, 100%); }
.res-top { display: flex; gap: 22px; align-items: center; }
.grade { font-size: 96px; font-weight: 900; line-height: 1; width: 120px; text-align: center; animation: stamp 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); text-shadow: 0 0 40px currentColor; }
.grade.g-F { font-size: 54px; }
@keyframes stamp { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.res-time { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.res-clock { color: var(--muted); font-size: 14px; }
.res-best { margin-top: 6px; font-size: 13px; color: var(--faint); font-weight: 600; }
.res-best.new { color: var(--amber); }
.res-line { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 4px 10px 10px 10px; padding: 11px 15px; margin: 20px 0 14px; }
.res-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.res-stats div { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; }
.res-stats span { display: block; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.res-stats b { font-size: 19px; font-variant-numeric: tabular-nums; }
#res-splits { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
#res-splits th { color: var(--faint); font-weight: 600; text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
#res-splits td { padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
#res-splits td:nth-child(2) { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#res-splits tr.miss td { color: var(--faint); }
#res-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
#res-badges span { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.25); color: var(--green); border-radius: 6px; padding: 4px 12px; font-size: 13px; font-weight: 600; }

/* 업무 사이 안내 */
#next-overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(5, 8, 14, 0.5); backdrop-filter: blur(3px); z-index: 30; }
#next-overlay.show { display: flex; animation: fadeIn 0.15s ease-out; }
.next-card { background: var(--panel); border: 1px solid rgba(251, 191, 36, 0.5); border-radius: 12px; padding: 24px 40px; text-align: center; min-width: 320px; box-shadow: 0 30px 80px -20px rgba(251, 191, 36, 0.35); animation: slideIn 0.45s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(60px); } }
.next-label { color: var(--faint); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; margin-top: 14px; }
#next-count { font-size: 30px; font-weight: 900; color: var(--amber); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
#next-title { font-size: 17px; font-weight: 700; margin-top: 2px; }
#next-split { display: inline-block; font-size: 13px; font-weight: 800; padding: 4px 12px; border-radius: 6px; }
#next-split.ahead { background: rgba(52, 211, 153, 0.12); }
#next-split.behind { background: rgba(244, 63, 94, 0.12); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* 남은 시간 막대 */
#timebar { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: rgba(255, 255, 255, 0.05); }
#timebar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--green), #6ee7b7); transition: background 0.3s; box-shadow: 0 0 10px rgba(52, 211, 153, 0.5); }
#timebar.warn i { background: linear-gradient(90deg, #fb923c, var(--amber)); box-shadow: 0 0 12px rgba(251, 146, 60, 0.7); }
#timebar.warn, #timebar.danger { height: 5px; }
#timebar.danger i { background: var(--red); animation: blink 0.5s steps(2) infinite; }
@keyframes shake { 25% { transform: translateX(-1px); } 75% { transform: translateX(1px); } }

@media (max-width: 860px) {
  #play-area { flex-direction: column; }
  #task-panel { width: auto; max-height: 34vh; }
  .hud-right { gap: 8px; }
  #clock { font-size: 22px; }
  .logo { font-size: 48px; }
}
@media (max-height: 700px) {
  .logo { font-size: 44px; }
  .tagline { margin-top: 6px; }
  .track-viewport { height: 380px; }
  .track { top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* =====================================================================
   온라인: 사원증 · 랭킹
   ===================================================================== */
.title-corner { position: absolute; top: 16px; right: 20px; display: flex; gap: 8px; z-index: 5; }
.corner-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; background: var(--glass); backdrop-filter: blur(10px); font-size: 13px; }
#btn-board { padding-left: 14px; }
.me-avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: linear-gradient(160deg, #fde68a, #f59e0b); color: var(--amber-ink); }
#me-chip.noname { border-color: rgba(251, 191, 36, 0.5); color: var(--amber); animation: nudge 2.4s ease-in-out infinite; }
#me-chip.noname .me-avatar { background: rgba(251, 191, 36, 0.15); color: var(--amber); }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(-2px); } }
button.sm { padding: 5px 12px; font-size: 12.5px; }

.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 14, 0.72); backdrop-filter: blur(8px); }
.modal.show { display: flex; animation: fadeIn 0.2s ease-out; }

/* 사원증 */
.idcard {
  position: relative; width: min(460px, 100%); border-radius: 12px; overflow: visible;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.08), transparent 45%), var(--panel);
  border: 1px solid var(--line-strong); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8);
  animation: dropIn 0.6s var(--ease);
}
@keyframes dropIn { from { transform: translateY(-80px) rotate(-4deg); opacity: 0; } 60% { transform: translateY(6px) rotate(1deg); opacity: 1; } }
.id-strap { position: absolute; top: -60px; left: 50%; width: 26px; height: 72px; translate: -50% 0; border-radius: 4px; background: repeating-linear-gradient(180deg, #f59e0b 0 8px, #fbbf24 8px 16px); box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.9); z-index: -1; }
.id-head { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 22px; border-radius: 12px 12px 0 0; background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(251, 146, 60, 0.06)); border-bottom: 1px solid var(--line); }
.id-head span { font-weight: 900; letter-spacing: -0.02em; }
.id-head small { color: var(--amber); font-size: 10.5px; font-weight: 800; letter-spacing: 0.2em; }
.id-body { display: flex; gap: 18px; padding: 22px; }
.id-photo { width: 88px; height: 108px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; font-size: 40px; font-weight: 900; color: var(--amber-ink); background: linear-gradient(160deg, #fde68a, #f59e0b); box-shadow: inset 0 -20px 30px rgba(0, 0, 0, 0.15); }
.id-fields { flex: 1; min-width: 0; }
.id-fields label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.id-fields label small { font-weight: 500; color: var(--faint); margin-left: 4px; }
.id-row { display: flex; gap: 6px; }
#id-input {
  flex: 1; min-width: 0; font: inherit; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 12px; outline: none; user-select: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#id-input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.dice { width: 46px; padding: 0; border-radius: 8px; font-size: 20px; }
.dice:active { transform: rotate(-30deg) scale(0.9); }
.id-status { min-height: 20px; margin: 8px 0 0; font-size: 13px; font-weight: 700; }
.id-status.ok { color: var(--green); }
.id-status.bad { color: var(--red); }
.id-status.wait { color: var(--faint); }
.id-rule { margin: 4px 0 0; font-size: 11.5px; color: var(--faint); }
/* 구글 로그인 (사원증 안) */
.id-account { margin: -6px 22px 16px; padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); }
.id-acc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.id-account[hidden], .id-acc-row[hidden] { display: none; }
.id-acc-note { font-size: 12.5px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.id-acc-note small { color: var(--faint); }
.g-dot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #fff; color: #4285f4; font-size: 11px; font-weight: 900; vertical-align: -3px; }
.google-btn { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; padding: 7px 14px; border-radius: 6px; background: #fff; color: #1f1f1f; border: 0; font-weight: 700; font-size: 13px; }
.google-btn:disabled { opacity: 0.6; }
.id-acc-msg { margin: 6px 0 0; font-size: 12px; color: var(--red); }
.id-acc-msg:empty { display: none; }
@media (max-width: 420px) { .id-acc-row { flex-direction: column; align-items: stretch; text-align: center; } .id-acc-note { white-space: normal; } .google-btn { justify-content: center; } }
.id-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 22px 20px; }
.id-foot .card-buttons { margin-top: 0; }
.id-mode { font-size: 11.5px; color: var(--faint); }
.id-mode.firebase { color: var(--green); }
.id-mode.offline { color: var(--red); }
.idcard.issued::after {
  content: '발급'; position: absolute; right: 26px; top: 64px; rotate: -12deg; border: 4px double var(--red); color: var(--red);
  border-radius: 6px; padding: 2px 14px; font-size: 28px; font-weight: 900; letter-spacing: 0.1em; animation: stamp 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

/* 랭킹 */
.board {
  width: min(560px, 100%); max-height: min(720px, 100%); display: flex; flex-direction: column; border-radius: 12px; padding: 22px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 45%), var(--panel);
  border: 1px solid var(--line-strong); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8); animation: cardIn 0.35s var(--ease);
}
.board-head { display: flex; align-items: center; justify-content: space-between; }
.board-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.board-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 16px 0 12px; padding-bottom: 2px; }
.tab { flex-shrink: 0; padding: 6px 12px 6px 6px; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.tab b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: color-mix(in srgb, var(--tier) 25%, transparent); color: var(--tier); }
.tab.on { background: color-mix(in srgb, var(--tier) 16%, transparent); border-color: color-mix(in srgb, var(--tier) 60%, transparent); }
.tab.on b { background: var(--tier); color: #0b0f19; }
.board-me { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 8px; background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.2); font-size: 13.5px; }
.board-me strong { color: var(--amber); font-size: 16px; }
.board-me .pct { color: var(--amber); font-weight: 800; font-size: 13px; }
.board-list { list-style: none; margin: 10px 0 0; padding: 0; overflow-y: auto; flex: 1; min-height: 120px; }
.board-list li { display: grid; grid-template-columns: 40px 1fr auto 96px; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 6px; font-variant-numeric: tabular-nums; animation: rowIn 0.35s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-12px); } }
.board-list li:nth-child(even):not(.me) { background: rgba(255, 255, 255, 0.02); }
.board-list li.me { background: rgba(251, 191, 36, 0.12); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.4); }
.board-list .pos { text-align: center; font-weight: 800; color: var(--muted); }
.board-list .top .pos { font-size: 20px; }
.board-list .who { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-list .who em { font-style: normal; font-size: 11px; color: var(--amber-ink); background: var(--amber); border-radius: 6px; padding: 1px 7px; }
.board-list .av { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.board-list .top1 .av { background: linear-gradient(160deg, #fde68a, #f59e0b); color: var(--amber-ink); }
.board-list .top2 .av { background: linear-gradient(160deg, #e5e7eb, #9ca3af); color: #111827; }
.board-list .top3 .av { background: linear-gradient(160deg, #fdba74, #c2410c); color: #1c1300; }
.board-list .g { width: auto; }
.board-list .t { text-align: right; font-weight: 700; }
.board-list .t small { color: var(--faint); font-weight: 500; }
.board-list .gap { display: block; text-align: center; color: var(--faint); padding: 2px; }
.board-list .empty { display: block; text-align: center; color: var(--muted); padding: 40px 10px; line-height: 1.7; }
.board-note { margin: 12px 0 0; font-size: 11.5px; color: var(--faint); text-align: center; }

/* 결과 화면 순위 */
.res-rank:empty { display: none; }
.res-rank { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: 8px; background: rgba(251, 191, 36, 0.07); border: 1px solid rgba(251, 191, 36, 0.2); font-size: 14px; animation: cardIn 0.4s var(--ease); }
.res-rank strong { color: var(--amber); font-size: 18px; }
.res-rank em { font-style: normal; color: var(--amber); font-weight: 800; font-size: 12.5px; margin-left: 6px; }
.res-rank .muted { color: var(--faint); }

/* 피벗 테이블 */
#sheet { position: relative; }
.pv-btn {
  display: flex; align-items: center; gap: 6px; padding: 0 14px; border: 0; border-left: 1px solid var(--paper-line);
  background: #fff; color: #5a3f00; font: 700 13px var(--font); cursor: pointer;
}
.pv-btn span { font-size: 15px; color: #e08a00; }
.pv-btn:hover { background: #fff6dc; }
#sheet.disabled .pv-btn { pointer-events: none; opacity: 0.5; }
.pv-dlg {
  position: absolute; top: 44px; right: 14px; z-index: 30; width: 340px; padding: 16px; border-radius: 8px;
  background: var(--panel); color: var(--text); border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7); display: none;
}
.pv-dlg.show { display: block; animation: pvIn 0.18s var(--ease); }
@keyframes pvIn { from { opacity: 0; transform: translateY(-6px); } }
.pv-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.pv-head b { font-size: 15px; }
.pv-src { font: 12px var(--mono); color: var(--muted); }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pv-grid select, .pv-grid input {
  height: 34px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text);
  font: 14px var(--font); padding: 0 8px; outline: none; user-select: text;
}
.pv-grid input { font-family: var(--mono); text-transform: uppercase; }
.pv-grid select:focus, .pv-grid input:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
.pv-msg { min-height: 18px; margin: 10px 0 4px; font-size: 12px; color: var(--red); }
.pv-foot { display: flex; align-items: center; gap: 8px; }
.pv-keys { flex: 1; font-size: 11px; color: var(--faint); }
.pv-foot button { height: 32px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font: 600 13px var(--font); cursor: pointer; }
.pv-foot .pv-ok { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.pv-foot button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.sheet-flash {
  position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 31; padding: 8px 14px; border-radius: 6px;
  background: var(--panel); color: var(--text); font-size: 13px; opacity: 0; pointer-events: none;
}
.sheet-flash.show { animation: flashMsg 1.8s var(--ease); }
@keyframes flashMsg { 10%, 80% { opacity: 1; } }

/* 테스트 모드: 전체 문제 목록 */
.all-btn {
  display: block; margin: 6px auto 0; padding: 8px 16px; border-radius: 6px; border: 1px dashed var(--line-strong);
  background: var(--glass); color: var(--muted); font: 500 13px var(--font); cursor: pointer;
}
.all-btn b { color: var(--amber); font-weight: 700; }
.all-btn:hover { color: var(--text); border-color: var(--amber); }
.all-panel {
  width: min(860px, 100%); height: min(760px, calc(100vh - 32px)); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7);
}
.all-head { display: flex; align-items: baseline; gap: 12px; padding: 16px 20px 10px; }
.all-head b { font-size: 18px; }
.all-head span { flex: 1; color: var(--faint); font-size: 13px; }
.all-close { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.all-tabs { display: flex; gap: 6px; padding: 0 20px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.all-tabs button {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--muted); font: 600 13px var(--font); cursor: pointer;
}
.all-tabs button.on, .all-tabs button:hover { color: var(--tier); border-color: var(--tier); }
.all-list { flex: 1; overflow-y: auto; padding: 4px 20px 24px; position: relative; }
.all-list section { padding-top: 16px; }
.all-list h3 { margin: 0; font-size: 16px; color: var(--tier); display: flex; align-items: baseline; gap: 10px; }
.all-list h3 small { color: var(--faint); font-size: 12px; font-weight: 500; }
.all-list p { margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.all-item {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin-bottom: 4px; text-align: left;
  border-radius: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); color: var(--text); font-family: var(--font); cursor: pointer;
}
.all-item:hover { border-color: var(--tier); background: rgba(255, 255, 255, 0.05); }
.all-item .no { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--panel-2); color: var(--tier); font-weight: 800; font-size: 12px; }
.all-item.done .no { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.all-item .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.all-item .tx b { font-size: 14px; font-weight: 600; }
.all-item .tx small { color: var(--faint); font: 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.all-item em { font-style: normal; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 문제 하나 전부 보기 */
.all-detail { display: none; flex: 1; min-height: 0; flex-direction: column; }
.all-panel.detail .all-list { display: none; }
.all-panel.detail .all-detail { display: flex; }
.all-panel { width: min(1080px, 100%); height: calc(100vh - 32px); }
.dt-top { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.dt-top button, .dt-foot button {
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  font: 600 13px var(--font); cursor: pointer;
}
.dt-top button:hover, .dt-foot button:hover { color: var(--text); border-color: var(--amber); }
.dt-id { color: var(--tier); font-weight: 800; font-size: 13px; }
.dt-title { flex: 1; font-size: 16px; }
.dt-top em { font-style: normal; color: var(--faint); font-size: 13px; }
.dt-top .dt-go { background: var(--amber); color: var(--amber-ink); border-color: var(--amber); }
.dt-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; user-select: text; }
.dt-body section { margin-top: 16px; }
.dt-body h4 { margin: 0 0 6px; font-size: 13px; color: var(--amber); }
.dt-body h4 small { color: var(--faint); font-weight: 500; margin-left: 6px; }
.dt-body section.bad h4 { color: var(--red); }
.dt-msg { margin: 0; color: var(--text); font-size: 14px; line-height: 1.6; }
.dt-goals, .dt-tips { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.8; }
.dt-goals small { color: var(--faint); }
.dt-tips code, .dt-sol code { font-family: var(--mono); color: #fde68a; }
.dt-scroll { max-height: 420px; overflow: auto; border-radius: 6px; border: 1px solid var(--line); scrollbar-width: thin; }
.dt-scroll::-webkit-scrollbar { display: block; width: 8px; height: 8px; }
.dt-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 4px; }
.dt-grid { border-collapse: collapse; font-size: 12.5px; background: var(--paper); color: var(--ink); }
.dt-grid th, .dt-grid td { border: 1px solid var(--paper-line); padding: 3px 8px; white-space: nowrap; height: 22px; }
.dt-grid thead th { position: sticky; top: 0; background: var(--paper-head); color: #6d6859; font-size: 11px; z-index: 1; }
.dt-grid tbody th { position: sticky; left: 0; background: var(--paper-head); color: #6d6859; font-size: 11px; text-align: center; }
.dt-grid td.n { text-align: right; font-variant-numeric: tabular-nums; }
.dt-grid td.ans { background: #dff7e9; color: #0b5c37; font-weight: 600; }
.dt-sol { display: flex; flex-direction: column; gap: 2px; max-height: 220px; overflow: auto; padding: 8px 10px; border-radius: 6px; background: var(--panel-2); font-size: 12.5px; scrollbar-width: thin; }
.dt-sol span { display: flex; gap: 10px; }
.dt-sol b { width: 44px; flex: none; color: var(--muted); font-family: var(--mono); font-weight: 600; }
.dt-foot { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line); }
.dt-foot button { max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 시트 탭 */
.sheet-tabs { display: none; align-items: stretch; gap: 2px; height: 32px; padding: 0 8px; background: var(--paper-head); border-top: 1px solid var(--paper-line); }
.sheet-tabs button {
  border: 0; border-radius: 0 0 6px 6px; padding: 0 16px; margin-top: -1px; background: transparent; color: #6d6859;
  font: 600 12.5px var(--mono); cursor: pointer;
}
.sheet-tabs button:hover { background: rgba(255, 255, 255, 0.5); }
.sheet-tabs button.on { background: #fff; color: #11407a; box-shadow: inset 0 -3px 0 #e08a00; }
.sheet-tabs button.home:not(.on) { color: #e08a00; }
.sheet-tabs .tab-keys { margin-left: auto; align-self: center; font-size: 11px; color: #9a9483; }
.editor.away { opacity: 0; pointer-events: none; }

/* =====================================================================
   26.48: 직무 팩 · 업무 지시서 · 점수 · 마감 연출
   ===================================================================== */
/* 타이틀: 직무 팩 탭 */
.pack-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 18px auto 4px; padding: 0 16px; max-width: 900px; }
.pack-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 6px; font-size: 14px; font-weight: 700; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted); }
.pack-tab small { font-size: 11.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.pack-tab:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.pack-tab.on { color: var(--amber-ink); background: var(--amber); border-color: var(--amber); box-shadow: 0 8px 30px -8px rgba(251, 191, 36, 0.6); }
.pack-tab.on small { color: rgba(28, 19, 0, 0.65); }
.pack-tab.soon:not(.on) { opacity: 0.6; }
.pack-desc { text-align: center; color: var(--faint); font-size: 13px; margin: 4px 0 0; min-height: 1.2em; }
.rk-stats .plus { font-style: normal; font-size: 13px; color: #fb923c; margin-left: 2px; }

/* 업무 지시서: 지금 할 일 카드 */
.mission { position: relative; padding: 14px 14px 12px; border-radius: 10px; background: linear-gradient(180deg, rgba(251, 191, 36, 0.14), rgba(251, 191, 36, 0.05)); border: 2px solid rgba(251, 191, 36, 0.75); box-shadow: 0 10px 34px -14px rgba(251, 191, 36, 0.5); }
.mission.flash { animation: missionFlash 0.6s ease-out; }
@keyframes missionFlash { 0% { background: rgba(251, 191, 36, 0.55); transform: scale(1.03); box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.35); } 100% { transform: scale(1); } }
.m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#m-count { font-size: 13px; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
#m-count b { font-size: 17px; color: #fff; }
#m-total { display: inline-block; }
#m-combo { font-size: 13px; font-weight: 900; color: #fb923c; }
.m-title { font-size: 22px; font-weight: 800; line-height: 1.3; color: #fff; letter-spacing: -0.02em; margin-bottom: 10px; word-break: keep-all; }
.m-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.m-chips:empty { display: none; }
.m-chips .chip { font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--amber); background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(251, 191, 36, 0.35); border-radius: 6px; padding: 2px 7px; }
.next-task { margin-top: 10px; font-size: 12.5px; color: var(--faint); opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-task:empty { display: none; }
.next-task small { font-size: 11px; font-weight: 700; border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; margin-right: 4px; }
.task-buttons button small { font-size: 11px; opacity: 0.65; }
/* 새 업무: 채울 칸 반짝 */
.mflash .grid td.mark-todo, .mflash .grid td.mark-bad { animation: cellFlash 0.6s ease-out; }
@keyframes cellFlash { 0% { box-shadow: inset 0 0 0 999px rgba(251, 191, 36, 0.75); } 100% { box-shadow: inset 0 0 0 999px rgba(251, 191, 36, 0); } }

/* HUD: 콤보 · 점수 · 소리 */
.hud-right { align-items: center; }
.hud-right .stat { white-space: nowrap; }
.hud-right .combo { color: var(--faint); transition: color 0.2s; }
.hud-right .combo.hot { color: #fb923c; }
.hud-right .combo.hot b { color: #fb923c; }
.hud-right .combo.broke { animation: comboBreak 0.45s ease-out; }
@keyframes comboBreak { 20%, 60% { transform: translateX(-4px); color: var(--red); } 40%, 80% { transform: translateX(4px); } }
.hud-right .score { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.hud-right .score small { font-size: 10.5px; color: var(--faint); }
.hud-right .score .sc-line small { font-size: 11px; }
.hud-right .score b { color: var(--amber); }
#sc-parts { white-space: nowrap; }
.mute { padding: 4px 8px; font-size: 15px; border-radius: 6px; background: transparent; border: 1px solid var(--line); line-height: 1; }
.mute.off { opacity: 0.55; }
#stage-dots i.extra { background: rgba(251, 146, 60, 0.25); }
#stage-dots i.extra.done { background: var(--green); }
#stage-dots i.extra.now { background: #fb923c; }
#stage-dots i.grow { animation: dotGrow 0.6s var(--ease) both; }
@keyframes dotGrow { from { width: 0; opacity: 0; } }
#combo-pop { position: fixed; right: 360px; top: 74px; z-index: 40; pointer-events: none; font-weight: 900; font-size: 18px; color: #fb923c; opacity: 0; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
#combo-pop.bad { color: var(--red); }
#combo-pop.show { animation: comboPop 1.1s ease-out; }
@keyframes comboPop { 0% { opacity: 0; transform: translateY(10px) scale(0.8); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }

/* 돌발 업무 */
#boss-toast { position: fixed; top: 76px; right: 20px; z-index: 45; pointer-events: none; display: flex; gap: 10px; align-items: flex-start; max-width: 320px; padding: 12px 16px 12px 12px; border-radius: 10px; background: #fff; color: #111827; box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6); transform: translateX(120%); opacity: 0; transition: transform 0.45s var(--ease), opacity 0.3s; }
#boss-toast.show { transform: none; opacity: 1; }
#boss-toast b { font-size: 12.5px; color: #6b7280; }
#boss-toast p { margin: 2px 0 0; font-size: 16px; font-weight: 800; line-height: 1.35; }
#next-overlay.surprise .next-card { border-color: #fb923c; box-shadow: 0 30px 80px -20px rgba(251, 146, 60, 0.6); animation: surpriseIn 0.5s var(--ease); }
#next-overlay.surprise #next-title { color: #fb923c; font-size: 20px; }
@keyframes surpriseIn { 0% { transform: scale(0.8) rotate(-2deg); opacity: 0; } 60% { transform: scale(1.06) rotate(1deg); opacity: 1; } 100% { transform: none; } }
.roll { position: relative; display: inline-block; min-width: 1.4em; height: 1.15em; overflow: hidden; vertical-align: bottom; text-align: left; }
.roll s, .roll b { position: absolute; left: 0; top: 0; text-decoration: none; }
.roll s { animation: rollOut 0.5s 0.5s var(--ease) both; }
.roll b { color: #fb923c; animation: rollIn 0.5s 0.5s var(--ease) both; }
@keyframes rollOut { to { transform: translateY(-110%); opacity: 0; } }
@keyframes rollIn { from { transform: translateY(110%); opacity: 0; } to { transform: none; opacity: 1; } }

/* 마감 연출 (클릭을 막지 않음) */
#vignette, #big-count, #deadline-banner, #boss-toast, #combo-pop { pointer-events: none; }
#vignette { position: fixed; inset: 0; z-index: 35; opacity: 0; box-shadow: inset 0 0 160px 40px rgba(244, 63, 94, 0.55); }
#vignette.on { animation: vignetteBlink 1s ease-out; }
@keyframes vignetteBlink { 0% { opacity: 1; } 100% { opacity: 0.15; } }
body:not(.danger) #vignette { display: none; }
#big-count { position: fixed; left: 50%; top: 50%; z-index: 36; transform: translate(-50%, -50%); font-family: var(--mono); font-size: min(34vh, 260px); font-weight: 900; line-height: 1; color: rgba(244, 63, 94, 0.32); text-shadow: 0 0 60px rgba(244, 63, 94, 0.4); }
#big-count.pop { animation: bigPop 1s ease-out both; }
@keyframes bigPop { 0% { transform: translate(-50%, -50%) scale(1.35); opacity: 0.2; } 15% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(0.92); opacity: 0.55; } }
#deadline-banner { position: fixed; left: 50%; top: 84px; z-index: 44; transform: translate(-50%, -30px); opacity: 0; padding: 12px 26px; border-radius: 6px; font-size: 20px; font-weight: 900; color: #1c1300; background: linear-gradient(90deg, #fb923c, var(--amber)); box-shadow: 0 18px 50px -10px rgba(251, 146, 60, 0.7); transition: transform 0.4s var(--ease), opacity 0.3s; }
#deadline-banner.show { transform: translate(-50%, 0); opacity: 1; animation: bannerShake 0.5s 0.35s; }
@keyframes bannerShake { 25% { transform: translate(-50%, 0) rotate(-2deg); } 75% { transform: translate(-50%, 0) rotate(2deg); } }

/* 결과: 점수 내역 */
.res-score { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin: 14px 0; padding: 14px; border-radius: 10px; background: rgba(251, 191, 36, 0.06); border: 1px solid rgba(251, 191, 36, 0.25); }
.res-score:empty { display: none; }
.rs-total { text-align: center; padding: 0 10px; }
.rs-total small { display: block; font-size: 11.5px; color: var(--faint); font-weight: 700; }
.rs-total b { font-size: 34px; font-weight: 900; color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.rs-parts { display: grid; gap: 5px; font-size: 13px; }
.rs-parts div { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline; }
.rs-parts small { color: var(--faint); font-size: 11.5px; }
.rs-parts b { font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }

/* 랭킹 v2 */
.board-tabs .tab { --tier: var(--amber); }
.board-tabs .tab b { font-size: 13px; background: transparent; }
.board-tabs .tab.on b { background: transparent; color: inherit; }
.board-tabs, .board-sub { flex-shrink: 0; }
.board-sub { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 10px; }
.board-sub .chip { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.board-sub .chip.on { background: rgba(251, 191, 36, 0.16); border-color: rgba(251, 191, 36, 0.6); color: var(--amber); }
.board-sub .sub-note { font-size: 12px; color: var(--faint); }
.board-list .sc { text-align: right; font-weight: 800; color: var(--amber); font-variant-numeric: tabular-nums; }
.board-list .t { font-size: 12px; color: var(--faint); font-weight: 600; }
.board-list .crown { font-size: 14px; }
#me-chip.crowned .me-avatar { position: relative; }
#me-chip.crowned .me-avatar::after { content: '👑'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 13px; }
.idcard.crowned .id-photo { position: relative; }
.idcard.crowned .id-photo::after { content: '👑'; position: absolute; top: -18px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 24px; }

@media (max-width: 860px) {
  #combo-pop { right: 20px; }
  .hud-right .score small#sc-parts { display: none; }
  .m-title { font-size: 19px; }
}
html[lang='en'] .node.stamped .rk-card::after { content: 'CLEAR'; }
#title-screen.promo .pack-tabs, #title-screen.promo .pack-desc { opacity: 0; transition: opacity 0.3s; }

/* 26.48.04: 조건부 서식 · 차트 · 목표값 찾기 */
.tool-btns { display: flex; align-items: stretch; }
.tool-btns .pv-btn, .tool-btns .tb-btn { border-left: 1px solid var(--paper-line); }
.tb-btn { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border: 0; background: transparent; color: var(--ink); font: 600 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.tb-btn span { font-size: 14px; color: #e08a00; }
.tb-btn:hover { background: #fff6dc; }
#sheet.disabled .tb-btn { pointer-events: none; opacity: 0.5; }
.tool-grid { grid-template-columns: 1fr 1.5fr 1fr; }
.tool-grid input.fml { text-transform: none; }
.tool-note { margin-top: 8px; font-size: 11.5px; color: var(--faint); line-height: 1.5; }
.chart-dock { position: absolute; right: 14px; bottom: 44px; z-index: 6; display: none; flex-direction: column; gap: 8px; pointer-events: none; }
.chart-dock.show { display: flex; }
.chart-card { border-radius: 6px; box-shadow: 0 12px 34px -8px rgba(15, 23, 42, 0.45), 0 0 0 1px rgba(15, 23, 42, 0.08); opacity: 0.96; animation: pvIn 0.25s var(--ease); line-height: 0; }
.chord-tip { position: absolute; left: 50%; top: 42px; z-index: 8; transform: translateX(-50%); display: none; padding: 6px 12px; border-radius: 6px; background: #111827; color: #f9fafb; font-size: 12.5px; font-weight: 600; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.5); pointer-events: none; white-space: nowrap; }
.chord-tip.show { display: block; animation: pvIn 0.15s var(--ease); }
.chord-tip kbd { font: 700 11px var(--mono); background: #374151; border-radius: 4px; padding: 1px 5px; }
.chord-tip span { color: var(--amber); }
.grid td.cf-red { background: #ffd9d6; color: #9b1c1c; }
.grid td.cf-yellow { background: #fff1b8; color: #7a5200; }
.grid td.cf-green { background: #d3f5df; color: #14532d; }
.grid td.cf-blue { background: #dbeafe; color: #1e3a8a; }
@media (max-width: 1100px) { .tb-btn { padding: 0 7px; font-size: 0; } .tb-btn span { font-size: 15px; } }
.tool-dlg { width: min(580px, calc(100% - 28px)); }
.tool-grid > label { min-width: 0; }
.tool-grid select, .tool-grid input { width: 100%; min-width: 0; }
.dt-note { margin: 6px 0 0; font-size: 12.5px; color: var(--amber); }

/* 팩 이용권 상점 */
.shop { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 12px; padding: 20px; background: var(--panel); border: 1px solid var(--line-strong); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8); animation: fadeIn 0.2s ease-out; }
.shop-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.shop-head h3 { margin: 0 0 2px; font-size: 18px; }
.shop-head small { color: var(--faint); font-size: 12px; }
.shop-all { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 10px; background: linear-gradient(120deg, rgba(251, 191, 36, 0.18), rgba(251, 146, 60, 0.06)); border: 1px solid rgba(251, 191, 36, 0.35); }
.shop-all b { font-size: 15px; }
.shop-all small, .shop-list small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.shop-save { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: var(--amber); color: var(--amber-ink); font-size: 11px; font-weight: 800; }
.shop-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.shop-list li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.shop-list li.focus { border-color: rgba(251, 191, 36, 0.5); }
.shop-list .pk-icon { font-size: 20px; text-align: center; }
.shop-owned { color: var(--green); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.shop-login { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 8px; background: rgba(56, 189, 248, 0.08); font-size: 12.5px; color: var(--muted); }
.shop-msg { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--amber); }
.shop-msg:empty { display: none; }
.shop-note { margin: 12px 0 0; font-size: 11.5px; color: var(--faint); }
.node.paid .rk-card { border-color: rgba(251, 191, 36, 0.3); background: rgba(17, 24, 39, 0.6); }
.node.paid .hex { background: #1f2937; color: #6b7280; }
.cta.buy { box-shadow: none; background: rgba(251, 191, 36, 0.14); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.4); }
@media (max-width: 420px) { .shop-login { flex-direction: column; align-items: stretch; text-align: center; } }

/* =====================================================================
   26.48.16: 선 대신 면 — 어두운 화면의 테두리 상자를 없애고 배경 단계로 나눔
   (시트 격자·선택 상자 같은 스프레드시트 선은 그대로)
   ===================================================================== */
:root {
  --line: transparent; --line-strong: transparent;
  --fill-0: #121826; --fill-1: #182031; --fill-2: #212a3d; --fill-3: #2b354b;
}
button { border-color: transparent; background: var(--fill-2); }
button:hover { border-color: transparent; background: var(--fill-3); }
button.primary, button.primary:hover { border-color: transparent; box-shadow: none; }
kbd { border-color: transparent; background: rgba(255, 255, 255, 0.1); }
.cta { box-shadow: none; }
.cta kbd { border-color: transparent; }
.cta.ghost { background: var(--fill-2); border: 0; }
.cta.buy { background: rgba(251, 191, 36, 0.16); border: 0; }

/* 레벨 카드 */
.rk-card { background: var(--fill-1); border-color: transparent; box-shadow: none; backdrop-filter: none; }
.node.current.focus .rk-card { border-color: transparent; box-shadow: none; background: color-mix(in srgb, var(--tier) 13%, var(--fill-1)); }
.node.cleared .rk-card { background: var(--fill-0); }
.node.locked .rk-card, .node.paid .rk-card { border-color: transparent; background: var(--fill-0); }
.node.unlocking .rk-card { border-color: transparent; box-shadow: none; background: color-mix(in srgb, var(--amber) 22%, var(--fill-1)); }
.rk-stats { border: 0; gap: 4px; }
.rk-stats div { background: rgba(255, 255, 255, 0.045); border-radius: 6px; }
.rk-stats div + div { border-left: 0; }
.node.cleared .node-dot { box-shadow: none; }
.pack-tab { background: var(--fill-1); border-color: transparent; }
.pack-tab:hover { border-color: transparent; background: var(--fill-2); }
.pack-tab.on { border-color: transparent; box-shadow: none; }
.corner-btn { background: var(--fill-1); backdrop-filter: none; }
#me-chip.noname { border-color: transparent; background: rgba(251, 191, 36, 0.14); }
.all-btn { border: 0; background: var(--fill-1); }

/* 게임 화면 */
#hud { background: var(--fill-0); backdrop-filter: none; border-bottom: 0; }
#clock { border-color: transparent; background: var(--fill-2); text-shadow: none; }
#clock.soon { border-color: transparent; background: rgba(251, 146, 60, 0.16); text-shadow: none; }
#clock.late { border-color: transparent; }
#task-panel { background: var(--fill-0); backdrop-filter: none; border: 0; }
#task-goals li { border-color: transparent; background: var(--fill-2); }
#task-goals li.done { border-color: transparent; background: rgba(52, 211, 153, 0.1); }
#task-goals .check { border: 0; background: var(--fill-3); }
#hint-text { border: 0; background: rgba(251, 191, 36, 0.12); }
#task-msg { background: var(--fill-1); }
.keyref { border-top: 0; }
#timebar i { box-shadow: none; }
#timebar.warn i { box-shadow: none; }

/* 창 */
.card, .idcard, .board, .all-panel, .shop { border-color: transparent; background: var(--panel); }
.id-head { border-bottom: 0; background: rgba(251, 191, 36, 0.14); }
#id-input { border-color: transparent; background: var(--fill-2); }
#id-input:focus { border-color: transparent; box-shadow: none; background: var(--fill-3); }
.tab.on { border-color: transparent; }
.board-me { border: 0; background: rgba(251, 191, 36, 0.1); }
.board-list li.me { box-shadow: none; background: rgba(251, 191, 36, 0.16); }
.board-sub .chip.on { border-color: transparent; background: rgba(251, 191, 36, 0.18); }
#res-splits th, #res-splits td { border-bottom: 0; }
#res-splits tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.035); }
.shop-all { border: 0; background: rgba(251, 191, 36, 0.14); }
.shop-list li { border: 0; background: var(--fill-1); }
.shop-list li.focus { border-color: transparent; background: rgba(251, 191, 36, 0.12); }
#next-overlay.surprise .next-card { border-color: transparent; box-shadow: none; background: color-mix(in srgb, #fb923c 18%, var(--panel)); }
.all-tabs { border-bottom: 0; }
.all-tabs button { border: 0; background: var(--fill-1); }
.all-tabs button.on, .all-tabs button:hover { background: color-mix(in srgb, var(--tier) 16%, var(--fill-1)); }
.all-item { border: 0; background: var(--fill-1); }
.all-item:hover { background: var(--fill-2); }
.dt-top { border-bottom: 0; background: var(--fill-1); }
.dt-foot { border-top: 0; background: var(--fill-1); }
.dt-top button:hover, .dt-foot button:hover { border-color: transparent; }
.pv-grid select:focus, .pv-grid input:focus { border-color: transparent; box-shadow: none; background: var(--fill-3); }
.node-dot { border-color: transparent; background: var(--fill-3); }
.lang-pick select { border-color: transparent; background: var(--fill-1); }
#brief-par, .res-rank, .res-score, .mission { border-color: transparent !important; }
#res-badges span { border-color: transparent; background: rgba(52, 211, 153, 0.14); }
.next-card { border-color: transparent; box-shadow: none; }
.m-chips .chip { border-color: transparent; }
.mission { background: rgba(251, 191, 36, 0.13); }
#brief-par, .res-rank, .res-score { background: rgba(251, 191, 36, 0.1); }
.mission { box-shadow: none; }
.pv-btn, .tb-btn, .tool-btns .pv-btn, .tool-btns .tb-btn { border: 0; border-radius: 0; background: transparent; }
.pv-btn:hover, .tb-btn:hover { background: #f3ecd9; }
#sheet { box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.7); }
