/* ═══════════════════════════════════════════════════════════════════
   PANDUAN BERMAIN — scoped styles. Every selector starts with .pb- so
   nothing here can affect the existing landing page. The guide follows the
   landing page violet / fuchsia palette and its theme: dark tokens below,
   light overrides under :root[data-theme="light"] (mirrors style.css).
   ═══════════════════════════════════════════════════════════════════ */

.pb-root {
  --pb-bg: #0B0614;
  --pb-bg-2: #1E1033;
  --pb-surface: rgba(39, 20, 66, 0.55);
  --pb-surface-2: rgba(52, 26, 88, 0.7);
  --pb-surface-solid: #1A0D2E;
  --pb-border: rgba(196, 181, 253, 0.1);
  --pb-border-2: rgba(196, 181, 253, 0.18);
  --pb-txt: #F5F3FF;
  --pb-txt-2: #DDD6FE;
  --pb-txt-3: #B3A8D6;
  --pb-accent: #8B5CF6;
  --pb-accent-2: #D946EF;
  --pb-accent-txt: #C4B5FD;
  --pb-accent-soft: rgba(139, 92, 246, 0.11);
  --pb-accent-line: rgba(139, 92, 246, 0.36);
  --pb-win: #34D399;
  --pb-win-soft: rgba(52, 211, 153, 0.12);
  --pb-win-line: rgba(52, 211, 153, 0.42);
  --pb-lose: #FB7185;
  --pb-lose-soft: rgba(251, 113, 133, 0.12);
  --pb-lose-line: rgba(251, 113, 133, 0.42);
  /* RGB triplets for the translucent wells / panels / lines, swapped per theme */
  --pb-ink-rgb: 11, 6, 20;
  --pb-deep-rgb: 26, 13, 46;
  --pb-deep2-rgb: 59, 28, 100;
  --pb-line-rgb: 196, 181, 253;
  --pb-shell-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
  --pb-tile-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.25), 0 8px 18px rgba(0, 0, 0, 0.3);
  --pb-r-xl: 28px;
  --pb-r-lg: 22px;
  --pb-r-md: 16px;
  --pb-r-sm: 12px;
  --pb-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --pb-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --pb-font: var(--font, 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  --pb-mono: var(--mono, 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace);
  font-family: var(--pb-font);
}

/* Light theme — same values as style.css :root[data-theme="light"] */
:root[data-theme="light"] .pb-root {
  --pb-bg: #FAF5FF;
  --pb-bg-2: #EDE9FE;
  --pb-surface: rgba(255, 255, 255, 0.62);
  --pb-surface-2: rgba(255, 255, 255, 0.88);
  --pb-surface-solid: #FFFFFF;
  --pb-border: rgba(109, 40, 217, 0.10);
  --pb-border-2: rgba(109, 40, 217, 0.20);
  --pb-txt: #1E1B4B;
  --pb-txt-2: #36306B;
  --pb-txt-3: #5A548A;
  --pb-accent-txt: #6D28D9;
  --pb-accent-soft: rgba(139, 92, 246, 0.10);
  --pb-accent-line: rgba(109, 40, 217, 0.30);
  --pb-win: #059669;
  --pb-win-soft: rgba(5, 150, 105, 0.10);
  --pb-win-line: rgba(5, 150, 105, 0.36);
  --pb-lose: #E11D48;
  --pb-lose-soft: rgba(225, 29, 72, 0.08);
  --pb-lose-line: rgba(225, 29, 72, 0.32);
  --pb-ink-rgb: 255, 255, 255;
  --pb-deep-rgb: 250, 245, 255;
  --pb-deep2-rgb: 237, 233, 254;
  --pb-line-rgb: 109, 40, 217;
  --pb-shell-shadow: 0 40px 100px rgba(76, 29, 149, 0.22);
  --pb-tile-shadow: inset 0 -10px 18px rgba(109, 40, 217, 0.06), 0 8px 18px rgba(109, 40, 217, 0.12);
}
:root[data-theme="light"] .pb-backdrop {
  background: radial-gradient(ellipse at 30% 0%, rgba(139, 92, 246, 0.12), transparent 55%), rgba(30, 27, 75, 0.35);
}

html.pb-lock, html.pb-lock body { overflow: hidden; }

.pb-root svg {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

/* ═══ Overlay & shell ═══ */
.pb-root { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px; color: var(--pb-txt); }
.pb-root[hidden] { display: none; }
.pb-backdrop {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 0%, rgba(139, 92, 246, 0.1), transparent 55%), rgba(var(--pb-ink-rgb), 0.76);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 260ms ease;
}
.pb-shell {
  position: relative; isolation: isolate;
  width: min(1240px, 100%); height: min(900px, calc(100dvh - 48px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--pb-border-2); border-radius: var(--pb-r-xl);
  background:
    radial-gradient(900px 360px at 0% 0%, rgba(139, 92, 246, 0.08), transparent 60%),
    radial-gradient(700px 420px at 100% 100%, rgba(217, 70, 239, 0.06), transparent 60%),
    linear-gradient(180deg, var(--pb-bg-2), var(--pb-bg));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--pb-shell-shadow);
  opacity: 0; transform: translateY(16px) scale(0.985);
  transition: opacity 260ms ease, transform 460ms var(--pb-ease);
}
/* faint grid texture */
.pb-shell::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(var(--pb-line-rgb), 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(var(--pb-line-rgb), 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask: radial-gradient(ellipse at 70% 0%, #000, transparent 70%); mask: radial-gradient(ellipse at 70% 0%, #000, transparent 70%);
}
.pb-root.is-open .pb-backdrop { opacity: 1; }
.pb-root.is-open .pb-shell { opacity: 1; transform: none; }

/* ═══ Header ═══ */
.pb-header {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 20px 26px;
  border-bottom: 1px solid var(--pb-border);
  background: linear-gradient(180deg, rgba(var(--pb-deep-rgb), 0.9), rgba(var(--pb-deep-rgb), 0.55));
}
.pb-header-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 48px; height: 48px; border-radius: 15px;
  color: #FFFFFF;
  background: linear-gradient(140deg, var(--pb-accent), var(--pb-accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 24px rgba(139, 92, 246, 0.3);
}
.pb-header-icon svg { width: 23px; height: 23px; stroke-width: 2.1; }
.pb-header-text { flex: 1; min-width: 0; }
.pb-title {
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem); font-weight: 800; letter-spacing: 0.08em; line-height: 1.15;
  background: linear-gradient(100deg, var(--pb-txt) 30%, var(--pb-accent-txt));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pb-desc { margin-top: 4px; font-size: 0.9rem; color: var(--pb-txt-2); }
.pb-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; overflow: hidden; }
.pb-progress i {
  display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--pb-accent), var(--pb-accent-2));
  box-shadow: 0 0 10px var(--pb-accent);
  transition: transform 120ms linear;
}

.pb-icon-btn {
  display: grid; place-items: center; flex-shrink: 0;
  width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--pb-border-2); border-radius: 13px;
  color: var(--pb-txt-2); background: var(--pb-surface);
  cursor: pointer; transition: color 200ms ease, border-color 200ms ease, background 200ms ease, transform 300ms var(--pb-spring);
}
.pb-icon-btn:hover { color: var(--pb-txt); border-color: var(--pb-accent-line); background: var(--pb-surface-2); transform: rotate(90deg); }

.pb-root :is(button, a):focus-visible { outline: 2px solid var(--pb-accent); outline-offset: 2px; box-shadow: none; }

/* ═══ Body: nav + content ═══ */
.pb-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 0; }

.pb-nav {
  min-height: 0; overflow-y: auto;
  padding: 18px 14px 18px 16px;
  border-right: 1px solid var(--pb-border);
  background: rgba(var(--pb-ink-rgb), 0.35);
  scrollbar-width: thin; scrollbar-color: rgba(var(--pb-line-rgb), 0.2) transparent;
}
.pb-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 12px; }
.pb-nav-heading { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pb-txt-3); }
.pb-nav-count { padding: 3px 8px; border-radius: 999px; font: 700 0.68rem/1 var(--pb-mono); color: var(--pb-accent-txt); background: var(--pb-accent-soft); border: 1px solid var(--pb-accent-line); }
.pb-nav-list { list-style: none; display: grid; gap: 4px; }
.pb-nav-item {
  position: relative;
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; min-height: 46px;
  border: 1px solid transparent; border-radius: 14px;
  background: transparent; color: var(--pb-txt-2);
  font: 600 0.9rem/1.2 var(--pb-font); text-align: left;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease, transform 250ms var(--pb-ease);
}
.pb-nav-item:hover { color: var(--pb-txt); background: rgba(var(--pb-line-rgb), 0.05); transform: translateX(2px); }
.pb-nav-num {
  display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  font: 700 0.72rem/1 var(--pb-mono); color: var(--pb-txt-3);
  background: rgba(var(--pb-line-rgb), 0.06); border: 1px solid var(--pb-border);
  transition: color 200ms ease, background 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
}
.pb-nav-label { flex: 1; min-width: 0; }
.pb-nav-soon { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pb-txt-3); padding: 3px 7px; border-radius: 999px; border: 1px dashed var(--pb-border-2); }
.pb-nav-item.is-empty .pb-nav-label { color: var(--pb-txt-3); }
.pb-nav-item.is-active {
  color: var(--pb-txt);
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.02));
  border-color: var(--pb-accent-line);
}
.pb-nav-item.is-active .pb-nav-num {
  color: #FFFFFF; border-color: transparent;
  background: linear-gradient(140deg, var(--pb-accent), var(--pb-accent-2));
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}

.pb-content {
  position: relative;
  min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 clamp(20px, 3.2vw, 48px) 36px;
  outline: none;
  scrollbar-width: thin; scrollbar-color: rgba(var(--pb-line-rgb), 0.2) transparent;
}
.pb-content-inner { max-width: 820px; margin: 0 auto; padding-top: 28px; }
.pb-content.pb-enter .pb-content-inner > * { animation: pb-in 520ms var(--pb-ease) both; }
.pb-content.pb-enter .pb-content-inner > :nth-child(2) { animation-delay: 60ms; }
.pb-content.pb-enter .pb-content-inner > :nth-child(3) { animation-delay: 110ms; }
.pb-content.pb-enter .pb-content-inner > :nth-child(n+4) { animation-delay: 150ms; }
@keyframes pb-in { from { opacity: 0; transform: translateY(10px); } }

/* ═══ Category hero ═══ */
.pb-hero {
  position: relative; overflow: hidden;
  padding: 26px 28px 24px;
  border: 1px solid var(--pb-border-2); border-radius: var(--pb-r-lg);
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    radial-gradient(300px 200px at 0% 100%, rgba(217, 70, 239, 0.1), transparent 70%),
    linear-gradient(160deg, rgba(var(--pb-deep2-rgb), 0.75), rgba(var(--pb-deep-rgb), 0.75));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.pb-hero-mark {
  position: absolute; right: 18px; top: -18px; pointer-events: none;
  font: 800 clamp(6rem, 4rem + 6vw, 9rem)/1 var(--pb-mono); letter-spacing: -0.04em;
  color: transparent; -webkit-text-stroke: 1px rgba(var(--pb-line-rgb), 0.16);
}
.pb-crumb { position: relative; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pb-txt-3); }
.pb-crumb i { font-style: normal; margin: 0 4px; opacity: 0.5; }
.pb-crumb strong { color: var(--pb-accent-txt); font-family: var(--pb-mono); }
.pb-cat-title { position: relative; margin-top: 10px; font-size: clamp(1.7rem, 1.3rem + 1.5vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.pb-cat-desc { position: relative; margin-top: 10px; max-width: 60ch; font-size: 1rem; line-height: 1.65; color: var(--pb-txt-2); }
.pb-hero-meta { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pb-hero-meta span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; color: var(--pb-txt-2);
  background: rgba(var(--pb-ink-rgb), 0.45); border: 1px solid var(--pb-border-2);
}
.pb-hero-meta svg { width: 14px; height: 14px; color: var(--pb-accent); }

/* ═══ Sticky TOC ═══ */
.pb-toc {
  position: sticky; top: 0; z-index: 3;
  display: flex; gap: 6px; overflow-x: auto;
  margin: 18px calc(-1 * clamp(20px, 3.2vw, 48px)) 0; padding: 12px clamp(20px, 3.2vw, 48px);
  background: linear-gradient(180deg, rgba(var(--pb-deep-rgb), 0.96) 70%, rgba(var(--pb-deep-rgb), 0));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  scrollbar-width: none;
}
.pb-toc::-webkit-scrollbar { display: none; }
.pb-toc a {
  flex-shrink: 0;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--pb-border-2); background: var(--pb-surface-solid);
  color: var(--pb-txt-2); font-size: 0.78rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}
.pb-toc a:hover { color: var(--pb-txt); border-color: var(--pb-accent-line); }
.pb-toc a.is-active { color: #FFFFFF; border-color: transparent; background: linear-gradient(120deg, var(--pb-accent), var(--pb-accent-2)); }

/* ═══ Sections ═══ */
.pb-section { position: relative; margin-top: 30px; }
.pb-section--plain { margin-top: 22px; }
.pb-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 1.18rem; font-weight: 800; letter-spacing: -0.01em; }
.pb-section-title span {
  display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px;
  font: 700 0.74rem/1 var(--pb-mono); color: var(--pb-accent-txt);
  background: var(--pb-accent-soft); border: 1px solid var(--pb-accent-line);
}
.pb-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--pb-border-2), transparent); }
.pb-section-body { display: grid; gap: 14px; }

/* text */
.pb-p { font-size: 0.97rem; line-height: 1.72; color: var(--pb-txt-2); }
.pb-root strong { color: var(--pb-txt); font-weight: 700; }
.pb-ref {
  display: inline; padding: 1px 7px; border-radius: 6px;
  font-size: 0.9em; font-weight: 600; color: var(--pb-accent-txt);
  background: var(--pb-accent-soft); border: 1px solid rgba(139, 92, 246, 0.22);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* lists */
.pb-list { list-style: none; display: grid; gap: 8px; font-size: 0.96rem; line-height: 1.65; color: var(--pb-txt-2); }
.pb-list li { position: relative; padding-left: 22px; }
.pb-list li::before { content: ""; position: absolute; left: 4px; top: 0.62em; width: 7px; height: 7px; border-radius: 2px; transform: rotate(45deg); background: linear-gradient(140deg, var(--pb-accent), var(--pb-accent-2)); }
.pb-list--ol { counter-reset: pb-ol; gap: 10px; }
.pb-list--ol li { counter-increment: pb-ol; padding: 14px 16px 14px 54px; border-radius: var(--pb-r-md); background: var(--pb-surface); border: 1px solid var(--pb-border); }
.pb-list--ol li::before {
  content: counter(pb-ol); left: 14px; top: 13px; width: 26px; height: 26px; border-radius: 8px; transform: none;
  display: grid; place-items: center; font: 700 0.78rem/1 var(--pb-mono); color: #FFFFFF;
}
.pb-list--check li { padding: 10px 12px 10px 40px; border-radius: 12px; background: rgba(var(--pb-ink-rgb), 0.45); }
.pb-list--check li::before {
  left: 13px; top: 50%; width: 16px; height: 16px; border-radius: 50%; transform: translateY(-50%);
  background: var(--pb-win-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334D399' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: inset 0 0 0 1px var(--pb-win-line);
}

/* table */
.pb-table-wrap { overflow-x: auto; border: 1px solid var(--pb-border-2); border-radius: var(--pb-r-md); background: var(--pb-surface); }
.pb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pb-table th { padding: 11px 16px; text-align: left; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pb-accent-txt); background: rgba(139, 92, 246, 0.06); border-bottom: 1px solid var(--pb-border-2); white-space: nowrap; }
.pb-table td { padding: 11px 16px; color: var(--pb-txt); border-bottom: 1px solid var(--pb-border); font-variant-numeric: tabular-nums; }
.pb-table tbody tr:last-child td { border-bottom: none; }

/* ═══ Digit tiles (struktur & nomor keluar) ═══ */
.pb-tiles { display: flex; gap: 10px; flex-wrap: wrap; }
.pb-tile { display: grid; justify-items: center; gap: 7px; }
.pb-tile-face {
  position: relative; overflow: hidden;
  display: grid; place-items: center;
  width: 58px; height: 66px; border-radius: 16px;
  font: 800 1.7rem/1 var(--pb-mono); color: var(--pb-txt);
  background: linear-gradient(180deg, rgba(var(--pb-deep2-rgb), 0.8), rgba(var(--pb-deep-rgb), 0.95));
  border: 1px solid var(--pb-border-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), var(--pb-tile-shadow);
}
.pb-tile-face::after { content: ""; position: absolute; left: 6px; right: 6px; top: 4px; height: 40%; border-radius: 12px 12px 30px 30px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent); pointer-events: none; }
.pb-tile-name { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; color: var(--pb-accent-txt); }
.pb-tiles--sm { gap: 8px; }
.pb-tiles--sm .pb-tile-face { width: 46px; height: 52px; border-radius: 13px; font-size: 1.35rem; }
.pb-tile.is-hit .pb-tile-face {
  color: #FFFFFF; border-color: transparent;
  background: linear-gradient(160deg, #C4B5FD, var(--pb-accent) 55%, var(--pb-accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 3px rgba(139, 92, 246, 0.18), 0 10px 24px rgba(139, 92, 246, 0.35);
}
.pb-tone-win .pb-tile.is-hit .pb-tile-face { background: linear-gradient(160deg, #BBF7D0, var(--pb-win) 60%, #10B981); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 3px rgba(52, 211, 153, 0.18), 0 10px 24px rgba(52, 211, 153, 0.32); color: #032417; }
.pb-tone-lose .pb-tile.is-hit .pb-tile-face { background: linear-gradient(160deg, #FECDD3, var(--pb-lose) 60%, #E11D48); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 0 0 3px rgba(251, 113, 133, 0.18), 0 10px 24px rgba(251, 113, 133, 0.3); color: #3B0712; }
.pb-content.pb-enter .pb-tile { animation: pb-tile-in 560ms var(--pb-spring) both; animation-delay: calc(180ms + var(--i, 0) * 70ms); }
@keyframes pb-tile-in { from { opacity: 0; transform: translateY(10px) scale(0.85); } }

.pb-structure {
  display: flex; align-items: center; gap: 18px 22px; flex-wrap: wrap;
  padding: 18px 20px; border-radius: var(--pb-r-md);
  border: 1px solid var(--pb-border-2);
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.07), rgba(var(--pb-deep-rgb), 0.4));
}
.pb-structure-label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pb-txt-2); }
.pb-structure-label svg { color: var(--pb-accent); }

/* ═══ Cards (kriteria, shio) ═══ */
.pb-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.pb-cards--compact { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pb-card {
  position: relative; overflow: hidden;
  padding: 16px 18px; border-radius: var(--pb-r-md);
  border: 1px solid var(--pb-border-2); background: var(--pb-surface);
  transition: border-color 220ms ease, transform 300ms var(--pb-ease), background 220ms ease;
}
.pb-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--pb-accent), var(--pb-accent-2)); opacity: 0.8; }
.pb-card:hover { border-color: var(--pb-accent-line); background: var(--pb-surface-2); transform: translateY(-2px); }
.pb-card-title { display: block; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--pb-accent-txt); }
.pb-card-text { margin-top: 6px; font-size: 0.93rem; line-height: 1.55; color: var(--pb-txt); }
.pb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pb-chips span { min-width: 30px; padding: 4px 6px; border-radius: 7px; text-align: center; font: 600 0.76rem/1 var(--pb-mono); color: var(--pb-txt); background: rgba(var(--pb-ink-rgb), 0.55); border: 1px solid var(--pb-border); }

/* ═══ Example card ═══ */
.pb-example {
  --tone: var(--pb-accent); --tone-soft: var(--pb-accent-soft); --tone-line: var(--pb-accent-line);
  position: relative; display: grid; gap: 14px;
  padding: 18px 20px 20px; border-radius: var(--pb-r-lg);
  border: 1px solid var(--pb-border-2);
  background: linear-gradient(165deg, rgba(var(--pb-deep2-rgb), 0.6), rgba(var(--pb-deep-rgb), 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.pb-example.pb-tone-win { --tone: var(--pb-win); --tone-soft: var(--pb-win-soft); --tone-line: var(--pb-win-line); }
.pb-example.pb-tone-lose { --tone: var(--pb-lose); --tone-soft: var(--pb-lose-soft); --tone-line: var(--pb-lose-line); }
.pb-example::before { content: ""; position: absolute; left: 20px; right: 20px; top: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--tone), transparent); opacity: 0.7; }
.pb-example-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pb-example-tag { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pb-txt); background: rgba(var(--pb-line-rgb), 0.08); border: 1px solid var(--pb-border-2); }
.pb-badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px 5px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; color: var(--tone); background: var(--tone-soft); border: 1px solid var(--tone-line); }
.pb-badge svg { width: 14px; height: 14px; stroke-width: 2.6; }
.pb-result { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--pb-r-md); background: rgba(var(--pb-ink-rgb), 0.5); border: 1px solid var(--pb-border); }
.pb-result-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pb-txt-3); }

.pb-rows { display: grid; gap: 6px; }
.pb-rows div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 14px; border-radius: 12px; background: rgba(var(--pb-ink-rgb), 0.5); border: 1px solid var(--pb-border); }
.pb-rows dt { color: var(--pb-txt-2); font-size: 0.88rem; font-weight: 600; }
.pb-rows dd { color: var(--pb-txt); font: 700 0.92rem/1.45 var(--pb-mono); text-align: right; }
.pb-rows dd .pb-ref { font-family: var(--pb-font); font-weight: 600; }

/* ═══ Formula ═══ */
.pb-formula {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--pb-r-md);
  border: 1px solid var(--pb-accent-line);
  background: linear-gradient(120deg, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.03));
}
.pb-example .pb-formula { border-color: var(--tone-line); background: linear-gradient(120deg, var(--tone-soft), rgba(var(--pb-ink-rgb), 0.3)); }
.pb-formula-icon { display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 11px; color: var(--pb-accent-txt); background: rgba(var(--pb-ink-rgb), 0.55); border: 1px solid var(--pb-border-2); }
.pb-example .pb-formula-icon { color: var(--tone); }
.pb-formula-body { display: grid; gap: 6px; min-width: 0; }
.pb-formula-label { font-size: 0.88rem; line-height: 1.55; color: var(--pb-txt-2); }
.pb-formula-expr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 700 1rem/1.5 var(--pb-mono); color: var(--pb-txt); }
.pb-f-op { color: var(--pb-accent-txt); font-weight: 800; padding: 0 2px; }
.pb-example .pb-f-op { color: var(--tone); }
.pb-f-paren { color: var(--pb-txt-3); }
.pb-f-ref { padding: 4px 10px; border-radius: 8px; font: 600 0.86rem/1.4 var(--pb-font); color: var(--pb-txt); background: rgba(var(--pb-ink-rgb), 0.6); border: 1px solid var(--pb-border-2); }

/* note */
.pb-note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--pb-r-md); border: 1px solid var(--pb-border-2); background: var(--pb-surface); }
.pb-note svg { color: var(--pb-accent); margin-top: 2px; }
.pb-note p { font-size: 0.92rem; line-height: 1.6; color: var(--pb-txt-2); }

/* code */
.pb-code {
  display: grid; overflow-x: auto; padding: 12px 0;
  border: 1px solid var(--pb-border-2); border-radius: var(--pb-r-md);
  background: rgba(var(--pb-ink-rgb), 0.72);
  font: 600 0.92rem/1.9 var(--pb-mono); color: var(--pb-accent-txt); letter-spacing: 0.02em;
  counter-reset: pb-line;
}
.pb-code span { counter-increment: pb-line; padding: 0 18px 0 0; white-space: pre; }
.pb-code span::before { content: counter(pb-line); display: inline-block; width: 40px; margin-right: 14px; padding-right: 10px; text-align: right; color: var(--pb-txt-3); border-right: 1px solid var(--pb-border); opacity: 0.7; }

/* image */
.pb-figure { margin: 0; }
.pb-figure-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--pb-border-2); border-radius: var(--pb-r-md); overflow: hidden; background: var(--pb-surface); cursor: zoom-in; transition: border-color 200ms ease; }
.pb-figure-btn:hover { border-color: var(--pb-accent-line); }
.pb-figure img { display: block; width: 100%; height: auto; }
.pb-figure figcaption { margin-top: 8px; font-size: 0.82rem; color: var(--pb-txt-3); text-align: center; }

/* ═══ Empty state ═══ */
.pb-empty {
  margin-top: 22px; padding: 52px 24px; text-align: center;
  border: 1px dashed var(--pb-border-2); border-radius: var(--pb-r-lg);
  background: var(--pb-surface);
}
.pb-empty-icon { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; color: var(--pb-accent); background: var(--pb-accent-soft); border: 1px solid var(--pb-accent-line); }
.pb-empty-icon svg { width: 26px; height: 26px; }
.pb-empty-title { margin-top: 16px; font-weight: 800; font-size: 1.05rem; }
.pb-empty-sub { margin-top: 4px; font-size: 0.88rem; color: var(--pb-txt-3); }

/* ═══ Pager ═══ */
.pb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--pb-border); }
.pb-pager-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; min-height: 64px;
  border: 1px solid var(--pb-border-2); border-radius: var(--pb-r-md);
  background: var(--pb-surface); color: var(--pb-txt);
  font: 700 0.98rem/1.25 var(--pb-font); text-align: left;
  cursor: pointer; transition: border-color 200ms ease, transform 250ms var(--pb-ease), background 200ms ease;
}
.pb-pager-btn:hover { border-color: var(--pb-accent-line); background: var(--pb-surface-2); transform: translateY(-2px); }
.pb-pager-btn span { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pb-pager-btn small { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--pb-txt-3); }
.pb-pager-btn svg { color: var(--pb-accent); transition: transform 250ms var(--pb-ease); }
.pb-pager-prev:hover svg { transform: translateX(-3px); }
.pb-pager-next:hover svg { transform: translateX(3px); }
.pb-pager-next { grid-column: 2; text-align: right; }

/* ═══ Footer ═══ */
.pb-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap;
  padding: 14px 26px;
  border-top: 1px solid var(--pb-border);
  background: rgba(var(--pb-ink-rgb), 0.6);
}
.pb-back {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 16px;
  border: 1px solid var(--pb-border-2); border-radius: 999px;
  background: var(--pb-surface); color: var(--pb-txt);
  font: 600 0.84rem/1 var(--pb-font); cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}
.pb-back:hover { border-color: var(--pb-accent-line); color: var(--pb-accent-txt); }
.pb-footer-info { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.pb-footer-info p { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--pb-txt-3); }
.pb-footer-info svg { width: 15px; height: 15px; color: var(--pb-accent-2); }

/* ═══ Image zoom ═══ */
.pb-zoom { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 56px 16px 16px; background: rgba(var(--pb-ink-rgb), 0.94); cursor: zoom-out; animation: pb-fade 200ms ease both; }
.pb-zoom[hidden] { display: none; }
.pb-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--pb-r-sm); }
.pb-zoom-close { position: absolute; top: 14px; right: 14px; }
@keyframes pb-fade { from { opacity: 0; } }

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
  .pb-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .pb-nav { overflow: visible; padding: 10px 0; border-right: none; border-bottom: 1px solid var(--pb-border); }
  .pb-nav-head { display: none; }
  .pb-nav-list {
    display: flex; gap: 8px; overflow-x: auto; padding: 0 16px; scroll-padding-inline: 16px;
    scrollbar-width: none;
    -webkit-mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  }
  .pb-nav-list::-webkit-scrollbar { display: none; }
  .pb-nav-list li { flex-shrink: 0; }
  .pb-nav-item { width: auto; gap: 8px; padding: 5px 14px 5px 5px; min-height: 42px; border-color: var(--pb-border); border-radius: 999px; background: var(--pb-surface); white-space: nowrap; font-size: 0.84rem; }
  .pb-nav-item:hover { transform: none; }
  .pb-nav-num { width: 30px; height: 30px; border-radius: 50%; }
  .pb-nav-soon { display: none; }
}

@media (max-width: 640px) {
  .pb-root { padding: 0; }
  .pb-shell { width: 100%; height: 100dvh; border-radius: 0; border: none; }
  .pb-header { padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 12px; }
  .pb-header-icon { width: 40px; height: 40px; border-radius: 12px; }
  .pb-desc { font-size: 0.8rem; }
  .pb-content { padding: 0 14px 26px; }
  .pb-content-inner { padding-top: 16px; }
  .pb-toc { margin-inline: -14px; padding-inline: 14px; }
  .pb-hero { padding: 20px 18px 18px; }
  .pb-hero-mark { right: 10px; top: auto; bottom: -16px; font-size: 5.5rem; }
  .pb-example { padding: 16px 14px 16px; }
  .pb-structure { padding: 14px; }
  .pb-tile-face { width: 52px; height: 60px; font-size: 1.5rem; }
  .pb-tiles--sm .pb-tile-face { width: 42px; height: 48px; font-size: 1.2rem; }
  .pb-rows div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .pb-rows dd { text-align: left; }
  .pb-formula { align-items: flex-start; padding: 12px; gap: 10px; }
  .pb-formula-icon { width: 32px; height: 32px; }
  .pb-formula-expr { font-size: 0.92rem; }
  .pb-list--ol li { padding: 12px 12px 12px 48px; }
  .pb-pager { grid-template-columns: 1fr; }
  .pb-pager-next { grid-column: auto; }
  .pb-pager > span:empty { display: none; }
  .pb-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); flex-direction: column; align-items: stretch; gap: 8px; }
  .pb-back { justify-content: center; }
  .pb-footer-info { justify-content: center; gap: 4px 14px; }
  .pb-footer-info p { font-size: 0.74rem; }
}

@media (prefers-reduced-motion: reduce) {
  .pb-backdrop, .pb-shell, .pb-pager-btn, .pb-card, .pb-icon-btn, .pb-nav-item, .pb-progress i { transition: none; }
  .pb-zoom,
  .pb-content.pb-enter .pb-content-inner > *, .pb-content.pb-enter .pb-tile { animation: none; }
  .pb-icon-btn:hover { transform: none; }
}
