/* ==========================================================================
   PickTools / 픽툴즈 — 공통 스타일
   정적 사이트: 빌드 없음, 외부 의존성 없음.
   ========================================================================== */

:root {
  --bg: #f5f6fa;
  --bg-soft: #eef0f7;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --ink: #141926;
  --ink-2: #333c4f;
  --muted: #626d84;
  --line: #e3e7f0;
  --line-strong: #d2d8e6;
  --brand: #4f46e5;
  --brand-strong: #4338ca;
  --brand-soft: #eef0ff;
  --brand-ink: #312e81;
  --sky: #0ea5e9;
  --ok: #059669;
  --ok-soft: #e8f8f1;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --danger: #dc2626;
  --violet: #7c3aed;
  --amber: #d97706;
  --rose: #e11d48;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 9px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 12px 28px -16px rgba(17, 24, 39, .22);
  --shadow-lg: 0 2px 4px rgba(17, 24, 39, .04), 0 24px 48px -24px rgba(17, 24, 39, .28);
  --header-h: 62px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Noto Sans Mono CJK KR", monospace;
}

* , *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img, svg, canvas { max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.28; letter-spacing: -0.03em; margin: 0; }

button { font: inherit; color: inherit; }

::selection { background: #dcd9ff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 10px;
  transition: top .18s ease;
}
.skip:focus { top: 10px; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.04em;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, #6366f1 0%, #4f46e5 55%, #7c3aed 100%);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .55);
}
.brand-mark svg { width: 18px; height: 18px; display: block; }
.brand small {
  display: block; font-size: 10.5px; font-weight: 600; color: var(--muted);
  letter-spacing: .02em; line-height: 1; margin-top: 2px;
}
.brand-text { display: flex; flex-direction: column; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.site-nav a {
  color: var(--ink-2); font-size: 14.5px; font-weight: 600;
  padding: 7px 10px; border-radius: 9px;
}
.site-nav a:hover { background: var(--bg-soft); text-decoration: none; color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-switch {
  display: inline-flex; align-items: center; padding: 3px; gap: 2px;
  background: var(--bg-soft); border-radius: 999px; border: 1px solid var(--line);
}
.lang-switch button {
  border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--muted); padding: 5px 11px; border-radius: 999px;
  transition: background .15s ease, color .15s ease;
}
.lang-switch button.active { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow-sm); }
.lang-switch button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- 버튼 ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-line: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 9px 16px;
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-line); border-radius: 12px;
  font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary {
  --btn-bg: linear-gradient(135deg, #5b52f0, #4338ca);
  --btn-fg: #fff; --btn-line: transparent;
  box-shadow: 0 8px 18px -10px rgba(67, 56, 202, .8);
}
.btn-primary:hover { box-shadow: 0 10px 22px -10px rgba(67, 56, 202, .9); }

.btn-soft { --btn-bg: var(--brand-soft); --btn-fg: var(--brand-ink); --btn-line: #dcdcff; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-line: transparent; }
.btn-ghost:hover { background: var(--bg-soft); box-shadow: none; }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: #c3c9da; }
.chip.active, .chip[aria-pressed="true"] {
  background: var(--brand-soft); border-color: #c7c5ff; color: var(--brand-ink);
}
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 홈 히어로 ---------- */
.hero {
  position: relative;
  padding: 44px 0 26px;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 460px;
  background:
    radial-gradient(42% 58% at 18% 12%, rgba(99, 102, 241, .20), transparent 70%),
    radial-gradient(38% 52% at 82% 0%, rgba(14, 165, 233, .16), transparent 70%),
    radial-gradient(30% 40% at 60% 30%, rgba(168, 85, 247, .12), transparent 70%);
  pointer-events: none;
}
.hero > .container { position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .01em;
  color: var(--brand-ink); background: rgba(255, 255, 255, .8);
  border: 1px solid #ddd9ff; border-radius: 999px; padding: 6px 12px;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

.hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(28px, 6.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.2;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #4f46e5 10%, #7c3aed 48%, #0ea5e9 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead {
  margin: 0 0 22px; max-width: 620px;
  color: var(--muted); font-size: clamp(14.5px, 2.4vw, 17px);
}

.search-box {
  position: relative; max-width: 560px;
}
.search-box .icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--muted); pointer-events: none;
}
.search-box input {
  width: 100%; height: 54px; padding: 0 46px 0 46px;
  border-radius: 15px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-size: 16px; font-weight: 500;
  box-shadow: var(--shadow);
}
.search-box input::placeholder { color: #98a1b4; }
.search-box input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(79, 70, 229, .13), var(--shadow); }

.hero-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }

/* ---------- 도구 그리드 ---------- */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 34px 0 14px;
}
.section-head h2 { font-size: 20px; font-weight: 800; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.tool-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 18px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
  min-height: 148px;
}
.tool-card:hover {
  text-decoration: none; color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #d6d5ff;
}
.tool-icon {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; margin-bottom: 12px;
  background: var(--brand-soft); color: var(--brand-strong);
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-card[data-tool="pinball"] .tool-icon { background: #e7f1ff; color: #1d4ed8; }
.tool-card[data-tool="ladder"]  .tool-icon { background: #f1ecff; color: #6d28d9; }
.tool-card[data-tool="random"]  .tool-icon { background: #fff2e0; color: #c2410c; }
.tool-card[data-tool="timer"]   .tool-icon { background: #e3f5ff; color: #0369a1; }
.tool-card[data-tool="calc"]    .tool-icon { background: #e5f8f0; color: #047857; }
.tool-card[data-tool="charcount"] .tool-icon { background: #ffe8ef; color: #be123c; }

.tool-card h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 3px; }
.tool-card p { margin: 0; font-size: 12.8px; color: var(--muted); line-height: 1.5; }
.tool-card .arrow {
  position: absolute; right: 14px; top: 16px;
  color: #b9c0d2; transition: transform .16s ease, color .16s ease;
}
.tool-card:hover .arrow { transform: translateX(2px); color: var(--brand); }
.tool-card .kbd-tag {
  margin-top: auto; padding-top: 10px;
  font-size: 11px; font-weight: 700; color: #8b95aa;
}

.no-results {
  padding: 34px 18px; text-align: center; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); font-size: 14px;
}

/* ---------- 기능 소개 ---------- */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 26px;
}
.feature {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.feature .ficon {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--brand-strong); margin-bottom: 10px;
}
.feature .ficon svg { width: 18px; height: 18px; }
.feature h3 { font-size: 14.5px; font-weight: 800; margin-bottom: 4px; }
.feature p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---------- 광고 영역 ---------- */
.ad-slot {
  margin: 30px 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, #fbfbfe, #fbfbfe 10px, #f6f7fc 10px, #f6f7fc 20px);
  text-align: center;
  color: #9aa3b6; font-size: 12px;
}
.ad-slot .ad-label {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .12em;
  color: #aeb6c7; border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 1px 5px; margin-bottom: 6px;
}
.ad-slot p { margin: 0; }

/* PC 넓은 화면 양옆 사이드바 광고 레일 (1360px 이상에서만 노출) */
.ad-rail { display: none; }
@media (min-width: 1360px) {
  .ad-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    top: 84px;
    width: 160px;
    min-height: 600px;
    padding: 14px 10px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: repeating-linear-gradient(135deg, #fbfbfe, #fbfbfe 10px, #f6f7fc 10px, #f6f7fc 20px);
    color: #9aa3b6;
    font-size: 11.5px;
    line-height: 1.5;
    text-align: center;
    z-index: 10;
  }
  .ad-rail .ad-label {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .12em;
    color: #aeb6c7;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    padding: 1px 5px;
  }
  .ad-rail p { margin: 0; }
  .ad-rail--left { left: max(12px, calc(50% - 500px - 176px)); }
  .ad-rail--right { right: max(12px, calc(50% - 500px - 176px)); }
}

/* ---------- 도구 페이지 공통 ---------- */
.tool-page { padding: 22px 0 10px; }
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--brand-strong); }
.breadcrumb .sep { color: #c6cddb; }

.tool-head { margin-bottom: 18px; }
.tool-head h1 {
  font-size: clamp(24px, 5.2vw, 34px); font-weight: 800; letter-spacing: -0.04em;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tool-head h1 .t-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  flex: none;
}
.tool-head h1 .t-icon svg { width: 22px; height: 22px; }
.tool-head .lead { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; max-width: 680px; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.badge {
  font-size: 11.5px; font-weight: 700; color: #4b5568;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px;
}
.badge.ok { color: #047857; background: var(--ok-soft); border-color: #c7eddc; }

.app-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 18px;
}
.app-card + .app-card { margin-top: 14px; }

.app-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.app-bar .spacer { margin-left: auto; }
.app-bar .block { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.app-bar .block.grow { flex: 1 1 240px; }
.svg-holder { position: relative; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); letter-spacing: -0.01em;
}
.field .hint { font-size: 11.5px; color: var(--muted); font-weight: 500; }

.input, .select, textarea.input {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); color: var(--ink);
  font-size: 16px; font-weight: 600; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: #a3abbb; font-weight: 500; }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}
.input.num { text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
textarea.input { resize: vertical; min-height: 120px; line-height: 1.6; }

.segmented {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px;
}
.segmented button {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  font-size: 12.8px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.segmented button.active { background: var(--surface); color: var(--brand-strong); box-shadow: var(--shadow-sm); }
.segmented button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-soft); border-radius: 14px; border: 1px solid var(--line);
  margin-bottom: 16px; overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs .tab {
  flex: 1 1 auto; min-width: max-content;
  border: 0; background: transparent; cursor: pointer;
  padding: 9px 14px; border-radius: 11px;
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs .tab:hover { color: var(--ink); }
.tabs .tab[aria-selected="true"] {
  background: var(--surface); color: var(--brand-strong);
  box-shadow: var(--shadow-sm);
}
.tabs .tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

.result-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 13px;
  background: var(--brand-soft); border: 1px solid #dedcff;
  font-size: 13.5px; font-weight: 700; color: var(--brand-ink);
}
.result-strip .val { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }

.note {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px;
}
.note strong { color: var(--ink-2); }

/* ---------- 본문 글 ---------- */
.prose { margin-top: 34px; }
.prose h2 {
  font-size: 20px; font-weight: 800; margin: 30px 0 10px;
  letter-spacing: -0.03em;
}
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15.5px; font-weight: 800; margin: 20px 0 6px; }
.prose p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 20px; color: var(--ink-2); font-size: 14.5px; }
.prose li { margin-bottom: 6px; }
.prose li::marker { color: #a5aec2; }
.prose .lead-p { font-size: 15.5px; color: var(--ink-2); }

.use-cases {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 8px;
}
.use-case {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px;
}
.use-case .uc-emoji { font-size: 18px; line-height: 1; margin-bottom: 6px; display: block; }
.use-case h3 { margin: 0 0 3px; font-size: 13.5px; }
.use-case p { margin: 0; font-size: 12.5px; color: var(--muted); }

.faq { margin-top: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0; margin-bottom: 8px;
  overflow: hidden;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 44px 14px 16px;
  font-size: 14px; font-weight: 700; color: var(--ink); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 17px; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid #9aa4b8; border-bottom: 2px solid #9aa4b8;
  transform: rotate(45deg); transition: transform .18s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details[open] summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.faq .faq-body { padding: 12px 16px 14px; font-size: 13.8px; color: var(--ink-2); }
.faq .faq-body p { margin: 0; font-size: 13.8px; }

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 30px 0 36px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px;
}
.footer-brand .brand { margin-bottom: 10px; }
.footer-brand p { margin: 0; color: var(--muted); font-size: 12.8px; max-width: 300px; line-height: 1.6; }
.footer-col h4 {
  font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #98a1b4; margin: 4px 0 10px;
}
.footer-col a { display: block; color: var(--ink-2); font-size: 13px; padding: 3px 0; font-weight: 500; }
.footer-col a:hover { color: var(--brand-strong); }
.footer-bottom {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  color: #8d97ab; font-size: 12px;
}

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  z-index: 90; padding: 11px 18px; border-radius: 999px;
  background: rgba(20, 25, 38, .94); color: #fff;
  font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   사다리타기
   ========================================================================== */
.ladder-config { display: grid; gap: 12px; }
.stepper {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 3px;
}
.stepper button {
  width: 32px; height: 30px; border: 0; background: var(--surface); cursor: pointer;
  border-radius: 999px; font-size: 17px; font-weight: 700; color: var(--ink-2);
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.stepper button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.stepper .val { min-width: 46px; text-align: center; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }

.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }

.editor { display: grid; gap: 7px; margin-top: 14px; }
.editor-row {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
  align-items: center;
}
.editor-row .idx {
  width: 24px; height: 24px; border-radius: 8px; background: var(--bg-soft);
  color: var(--muted); font-size: 11.5px; font-weight: 800;
  display: grid; place-items: center; font-variant-numeric: tabular-nums;
}
.editor-head {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr); gap: 8px;
  font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 0 2px;
}
.editor-toggle { display: none; }

.ladder-stage {
  position: relative; margin-top: 18px;
  padding: 6px 4px;
  background: linear-gradient(180deg, #fbfbff, #f7f8fd);
  border: 1px solid var(--line); border-radius: 16px;
}
.ladder-wrap { position: relative; }
.ladder-labels {
  display: flex; align-items: flex-end; gap: 0;
  padding: 8px 2px;
}
.ladder-labels.bottom { align-items: flex-start; padding-top: 10px; }
.ladder-labels .lb {
  flex: 1 1 0; min-width: 0; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  padding: 0 2px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.3;
  border-radius: 8px;
}
.ladder-labels .lb small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); }
.ladder-labels.bottom.wrap .lb {
  white-space: normal; overflow: visible; text-overflow: clip;
  word-break: break-all; font-size: 10px; line-height: 1.2;
}
.ladder-labels .lb.done { color: var(--brand-strong); }
.ladder-labels .lb.pulse { animation: lbPulse .5s ease; }
@keyframes lbPulse { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }

.ladder-svg { display: block; width: 100%; height: clamp(250px, 46vw, 380px); }
.ladder-svg .line { stroke: #cbd2e2; stroke-width: 3; fill: none; stroke-linecap: round; }
.ladder-svg .rung { stroke: #b9c1d6; stroke-width: 3; stroke-linecap: round; }
.ladder-svg .trail {
  fill: none; stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  opacity: 0;
}
.ladder-svg .trail.show { opacity: 1; }

.ladder-runner {
  position: absolute; width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .22), 0 0 12px rgba(79, 70, 229, .55);
  pointer-events: none; opacity: 0; z-index: 2;
}
.ladder-runner.show { opacity: 1; }

.pair-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.pair {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; font-weight: 700;
  animation: fadeUp .3s ease both;
}
.pair .from { color: var(--ink-2); }
.pair .to { color: var(--brand-strong); }
.pair .arr { color: #aab2c5; font-size: 11px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   랜덤 뽑기
   ========================================================================== */
.roulette-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.wheel-box { position: relative; display: grid; place-items: center; padding: 6px 0; }
.wheel-box canvas { width: 100%; max-width: 340px; height: auto; display: block; -webkit-user-select: none; user-select: none; }
.wheel-pointer {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -2px);
  width: 0; height: 0; z-index: 3;
  border-left: 11px solid transparent; border-right: 11px solid transparent;
  border-top: 20px solid #312e81;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .2));
}
.spin-result {
  margin-top: 12px; min-height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--muted); text-align: center;
}
.spin-result.win {
  font-size: 20px; font-weight: 800; color: var(--brand-strong);
  animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes popIn { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

.item-list { display: grid; gap: 6px; }
.item-list .item-row { display: flex; gap: 6px; align-items: center; }
.item-list .item-row input { flex: 1 1 auto; }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--muted);
}
.icon-btn:hover { color: var(--danger); border-color: #f0c4c4; background: #fff6f6; }
.icon-btn svg { width: 15px; height: 15px; }

.draw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.draw-history {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; min-height: 34px;
}
.ball {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 800; color: #fff;
  background: var(--brand);
  box-shadow: inset 0 -2px 6px rgba(0, 0, 0, .15), 0 3px 8px -3px rgba(0, 0, 0, .3);
  animation: popIn .3s ease both;
  font-variant-numeric: tabular-nums;
}
.ball:nth-child(5n+1) { background: #4f46e5; }
.ball:nth-child(5n+2) { background: #0ea5e9; }
.ball:nth-child(5n+3) { background: #10b981; }
.ball:nth-child(5n+4) { background: #f59e0b; }
.ball:nth-child(5n+5) { background: #ec4899; }

.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.team-card {
  border: 1px solid var(--line); border-radius: 13px; padding: 12px;
  background: var(--surface-2);
}
.team-card h4 {
  font-size: 12px; font-weight: 800; color: var(--brand-strong);
  margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between;
}
.team-card h4 .cnt { color: var(--muted); font-weight: 600; font-size: 11px; }
.team-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.team-card li {
  font-size: 12.5px; font-weight: 600; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px;
}

/* ==========================================================================
   타이머
   ========================================================================== */
.timer-stage { display: grid; place-items: center; padding: 6px 0 12px; }
.timer-layout { display: grid; gap: 2px; }
.timer-dial { position: relative; width: min(78vw, 320px); aspect-ratio: 1; display: grid; place-items: center; }
.timer-dial svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-dial .ring-bg { fill: none; stroke: #eceef6; stroke-width: 10; }
.timer-dial .ring-fg {
  fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 603; stroke-dashoffset: 0;
  transition: stroke-dashoffset .25s linear, stroke .3s ease;
}
.timer-dial.break .ring-fg { stroke: var(--ok); }
.timer-dial.done .ring-fg { stroke: var(--danger); }
.timer-face { text-align: center; z-index: 1; }
.timer-time {
  font-size: clamp(38px, 13vw, 54px); font-weight: 800; letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink);
}
.timer-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-top: 4px; letter-spacing: .02em; text-transform: uppercase; }
.timer-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.timer-presets .chip { min-width: 0; padding: 7px 12px; }
.custom-time { display: flex; align-items: flex-end; gap: 6px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.custom-time .field { width: 78px; }
.custom-time .unit { font-size: 12px; font-weight: 700; color: var(--muted); padding-bottom: 12px; }
.timer-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.timer-actions .btn-primary { min-width: 140px; }
.sound-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sound-row .select { width: auto; min-height: 36px; padding: 4px 10px; font-size: 13px; font-weight: 600; }

.lap-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.lap-table th, .lap-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.lap-table th { font-size: 11.5px; color: var(--muted); font-weight: 700; }
.lap-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.pomo-track { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.pomo-dot { width: 9px; height: 9px; border-radius: 50%; background: #dde1ec; }
.pomo-dot.filled { background: var(--brand); }

/* ==========================================================================
   계산기
   ========================================================================== */
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.calc-inputs { display: grid; gap: 12px; }
.input-unit {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface);
  padding-right: 12px; transition: border-color .15s ease, box-shadow .15s ease;
}
.input-unit:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.input-unit .input {
  flex: 1 1 auto; width: auto; min-width: 0;
  border: 0; background: transparent; box-shadow: none; padding-right: 4px;
}
.input-unit .input:focus { border-color: transparent; box-shadow: none; }
.input-unit .suffix {
  flex: none; font-size: 12.5px; font-weight: 600; color: var(--muted);
  white-space: nowrap; pointer-events: none;
}
.money-out {
  background: linear-gradient(160deg, #f6f5ff, #f2f7ff);
  border: 1px solid #e0ddff; border-radius: 16px; padding: 18px;
}
.money-out .label { font-size: 12.5px; font-weight: 700; color: var(--brand-ink); }
.money-out .big {
  font-size: clamp(26px, 6.4vw, 34px); font-weight: 800; letter-spacing: -0.04em;
  color: var(--brand-strong); line-height: 1.2; margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
}
.money-out .sub { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.breakdown { margin-top: 14px; border-top: 1px solid var(--line); }
.breakdown .row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px dashed #e8ebf3;
  font-size: 13px;
}
.breakdown .row.total { border-bottom: 0; font-weight: 800; color: var(--ink); padding-top: 10px; }
.breakdown .row span:first-child { color: var(--muted); font-weight: 600; }
.breakdown .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; }
.breakdown .row.total span:first-child { color: var(--ink); }

.vat-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.vat-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.vat-box .k { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.vat-box .v { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -0.02em; }
.vat-box.hl { background: var(--brand-soft); border-color: #dedcff; }
.vat-box.hl .v { color: var(--brand-strong); }

/* ==========================================================================
   글자수 세기
   ========================================================================== */
.cc-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cc-editor { display: grid; gap: 10px; }
.cc-editor textarea { min-height: 260px; font-size: 16px; font-weight: 400; }
.cc-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 11px 12px;
}
.stat .k { font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.stat .v {
  font-size: 21px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.stat .v small { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.stat.hl { background: var(--brand-soft); border-color: #dedcff; }
.stat.hl .v { color: var(--brand-strong); }
.goal-block { margin-top: 12px; }
.goal-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.progress {
  height: 10px; border-radius: 999px; background: #eceef6; overflow: hidden;
}
.progress > i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #6366f1, #0ea5e9);
  border-radius: 999px; transition: width .25s ease;
}
.progress.over > i { background: linear-gradient(90deg, #f59e0b, #ef4444); }
.time-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }

/* ==========================================================================
   소개 / 개인정보
   ========================================================================== */
.doc-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 22px; padding: 26px 24px; box-shadow: var(--shadow-sm);
  margin-top: 18px;
}
.doc-card h2 { font-size: 18px; font-weight: 800; margin: 26px 0 10px; }
.doc-card h2:first-of-type { margin-top: 0; }
.doc-card h3 { font-size: 14.5px; font-weight: 800; margin: 18px 0 6px; }
.doc-card p, .doc-card li { font-size: 14px; color: var(--ink-2); }
.doc-card ul { padding-left: 20px; }
.doc-card .meta { font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 6px; }
.doc-card table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.doc-card th, .doc-card td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc-card th { background: var(--surface-2); font-weight: 700; }

/* ==========================================================================
   반응형
   ========================================================================== */
@media (max-width: 860px) {
  .roulette-layout { grid-template-columns: 1fr; }
  .calc-grid { grid-template-columns: 1fr; }
  .cc-layout { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .use-cases { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .container { padding: 0 14px; }
  .site-nav { display: none; }
  .hero { padding: 30px 0 20px; }
  .hero h1 { margin-top: 14px; }
  .app-card { padding: 14px; border-radius: 18px; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .tool-card { padding: 14px 13px 12px; min-height: 132px; border-radius: 16px; }
  .tool-icon { width: 36px; height: 36px; border-radius: 11px; margin-bottom: 9px; }
  .tool-icon svg { width: 19px; height: 19px; }
  .tool-card h3 { font-size: 14.5px; }
  .tool-card p { font-size: 12px; }
  .tool-card .kbd-tag { display: none; }
  .tool-card .arrow { display: none; }
  .doc-card { padding: 20px 16px; }
  .draw-grid { grid-template-columns: 1fr 1fr; }
  .vat-split { grid-template-columns: 1fr; }
  .stat .v { font-size: 19px; }
  .timer-actions .btn { flex: 1 1 0; min-width: 0; }
  .timer-presets .chip { padding: 6px 10px; font-size: 12.5px; }
  .custom-time .field { width: 68px; }
  .tabs .tab { padding: 8px 10px; font-size: 12.5px; }
  .app-bar { gap: 8px; }
  .editor-row, .editor-head { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
  .editor-row .idx { width: 20px; height: 20px; font-size: 10.5px; }
  .ladder-labels .lb { font-size: 10.5px; }
  .ladder-labels .lb small { display: none; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
  html { scroll-behavior: auto; }
}

/* 데스크톱 타이머 2단 배치 (다른 규칙보다 뒤에 와야 적용됨) */
@media (min-width: 900px) {
  .timer-layout { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 30px; align-items: start; }
  .timer-controls { padding-top: 8px; }
  .timer-dial { width: min(100%, 330px); }
  .timer-actions, .sound-row, .timer-presets, .custom-time, .pomo-track { justify-content: flex-start; }
  .timer-controls > #panel-timer, .timer-controls > #panel-pomo, .timer-controls > #panel-stopwatch { margin-top: 16px !important; }
  .timer-controls .note { margin-top: 12px; }
}

/* ==========================================================================
   핀볼 추첨 (마블 룰렛)
   ========================================================================== */
.pb-setup { display: grid; gap: 14px; }
.pb-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.pb-field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pb-clear {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 11.8px; font-weight: 700; color: var(--muted); text-decoration: underline;
}
.pb-clear:hover { color: var(--brand-strong); }
textarea.pb-names { min-height: 64px; resize: vertical; line-height: 1.55; font-size: 14.5px; }
.pb-hint { margin: 0; font-size: 11.8px; color: var(--muted); font-weight: 500; line-height: 1.5; }
.pb-options { display: grid; gap: 10px; align-content: start; }
.pb-opt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pb-opt .segmented { width: 100%; }
.pb-opt .segmented button { flex: 1 1 auto; text-align: center; }

.pb-stage { display: grid; gap: 14px; margin-top: 18px; }

.pb-board {
  position: relative; width: 100%; max-width: 470px; margin: 0 auto;
  border-radius: 18px; overflow: hidden; background: #04070e;
  border: 1px solid #1c2742;
  box-shadow: 0 18px 40px -22px rgba(8, 12, 30, .9), inset 0 0 0 1px rgba(56, 189, 248, .06);
}
.pb-view { position: relative; width: 100%; aspect-ratio: 100 / 152; }
.pb-view canvas { display: block; width: 100%; height: 100%; }

.pb-mini {
  position: absolute; left: 7px; top: 7px; width: 52px; height: 320px;
  border-radius: 12px; pointer-events: none;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .9);
}
.pb-mini-toggle {
  position: absolute; left: 8px; bottom: 8px; width: 30px; height: 30px; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(148, 163, 184, .38); border-radius: 9px;
  background: rgba(4, 8, 18, .72); color: #cbd5e1;
  -webkit-tap-highlight-color: transparent;
}
.pb-mini-toggle svg { width: 16px; height: 16px; }
.pb-mini-toggle.off { color: #64748b; border-color: rgba(148, 163, 184, .2); }

.pb-hud {
  position: absolute; right: 0; top: 0; pointer-events: none; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-end;
  font-variant-numeric: tabular-nums;
  padding: 8px 12px 18px 26px;
  border-radius: 0 18px 0 16px;
  background: linear-gradient(200deg, rgba(4, 7, 14, .82) 30%, rgba(4, 7, 14, .45) 70%, rgba(4, 7, 14, 0));
  text-shadow: 0 1px 6px rgba(0, 0, 0, .95), 0 0 12px rgba(0, 0, 0, .8);
}
.pb-hud-count {
  font-size: 11px; font-weight: 800; letter-spacing: .06em; color: #e2e8f0;
  opacity: .9; margin-bottom: 3px;
}
.pb-hud-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: flex-end;
}
.pb-hud-list li {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 4px;
  font-size: 11.5px; font-weight: 800; line-height: 1.42;
}
.pb-hud-list li[hidden] { display: none; }
.pb-hud-list li .n { font-size: 9.5px; font-weight: 700; opacity: .82; }
.pb-hud-list li .m { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-hud-list li.done .m { opacity: .62; }
.pb-hud-more { font-size: 10px; font-weight: 700; color: #94a3b8; line-height: 1.4; }

.pb-nth { display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.pb-nth[hidden] { display: none; }
.pb-nth input {
  width: 56px; padding: 4px 6px; text-align: center; font: inherit; font-weight: 800;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}

.pb-winner {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 2px;
  text-align: center; pointer-events: none; padding: 0 14px;
  background: radial-gradient(closest-side, rgba(7, 10, 20, .88), rgba(7, 10, 20, .58) 62%, rgba(7, 10, 20, 0));
  opacity: 0;
}
.pb-winner.show { animation: pbWin .55s cubic-bezier(.2, 1.3, .4, 1) both; }
.pb-winner-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .16em;
  color: #a5b4fc; text-transform: uppercase;
}
.pb-winner-name {
  font-size: clamp(30px, 9vw, 46px); font-weight: 900; letter-spacing: -.03em;
  line-height: 1.12; color: #fff; text-shadow: 0 0 24px currentColor; word-break: break-all;
}
.pb-winner-sub { font-size: 12.5px; font-weight: 700; color: #e2e8f0; opacity: .78; }
@keyframes pbWin {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: none; }
}

.pb-flash {
  position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0));
}
.pb-flash.on { animation: pbFlash .65s ease-out; }
@keyframes pbFlash { 0% { opacity: .85; } 100% { opacity: 0; } }

.pb-side {
  display: flex; flex-direction: column; gap: 9px; min-width: 0;
  border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 16px; padding: 12px 12px 14px;
}
.pb-side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pb-side-head h2 { margin: 0; }
.pb-count { font-size: 11.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pb-rank {
  list-style: none; margin: 0; padding: 0; min-height: 128px;
  display: flex; flex-direction: column; gap: 5px;
  max-height: 400px; overflow-y: auto; overscroll-behavior: contain;
}
.pb-row {
  display: grid; grid-template-columns: 20px 10px minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 6px 9px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-size: 12.5px;
}
.pb-row .pb-no {
  font-size: 11px; font-weight: 800; color: var(--muted);
  font-variant-numeric: tabular-nums; text-align: center;
}
.pb-row .pb-name {
  font-weight: 700; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pb-row .pb-st {
  font-size: 11.5px; font-weight: 700; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pb-row.done { border-color: #c7eddc; background: var(--ok-soft); }
.pb-row.done .pb-st { color: #047857; }
.pb-row.win {
  border-color: #cbb8ff; background: linear-gradient(180deg, #f5f0ff, #ece3ff);
  box-shadow: 0 8px 20px -14px rgba(109, 40, 217, .95);
  animation: lbPulse .6s ease;
}
.pb-row.win .pb-no, .pb-row.win .pb-name { color: var(--brand-strong); }
.pb-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, .05); flex: none;
}

.pb-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin-top: 14px;
}
.pb-actions .btn { width: 100%; padding-left: 8px; padding-right: 8px; }
.pb-actions .btn-primary, .pb-actions #pbStart { grid-column: 1 / -1; }

.pb-chip { gap: 7px; }
.pb-chip .pb-dot { width: 8px; height: 8px; }
.pb-chip.win { border-color: #cbb8ff; background: #f5f0ff; }
.pb-chip.win .to { color: var(--brand-strong); }

@media (min-width: 780px) {
  .pb-actions { display: flex; flex-wrap: wrap; }
  .pb-actions .btn { width: auto; }
  .pb-setup { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
  .pb-stage { grid-template-columns: minmax(0, 470px) minmax(0, 360px); gap: 18px; align-items: start; }
  .pb-view { aspect-ratio: 100 / 144; }
  .pb-mini { width: 56px; }
  .pb-hud-list li { font-size: 12px; }
  .pb-hud-list li .m { max-width: 130px; }
}
@media (max-width: 620px) {
  .pb-rank { max-height: none; }
  .pb-side { padding: 11px 10px 12px; }
  .pb-opt .segmented button { padding-left: 6px; padding-right: 6px; font-size: 12px; }
}
