body.pb-body { font-family: 'Quicksand', sans-serif; margin: 0; background: #070b18; color: #e8eefc; -webkit-tap-highlight-color: transparent; }
.pb-body * { box-sizing: border-box; font-family: inherit; }
[hidden] { display: none !important; }
#beta-report-trigger { display: none !important; }

.pb-page { display: flex; justify-content: center; padding: 6px 8px 10px; min-height: 0; }
.pb-wrap { --pbw: 400px; width: var(--pbw); max-width: 100%; display: flex; flex-direction: column; gap: 6px; }

/* ---------- HUD ---------- */
.pb-hud { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 6px; }
.pb-pill { background: linear-gradient(180deg, #121a33, #0d1428); border: 1px solid #243055; border-radius: 12px; padding: 5px 10px 4px; line-height: 1.05; min-width: 0; }
.pb-pill b { display: flex; align-items: center; gap: 6px; font-size: 22px; font-weight: 700; letter-spacing: .5px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pb-pill small { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 1px; color: #7f8db8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-lbl { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px; color: #7f8db8; white-space: nowrap; }
.pb-score b { color: #7dd3fc; }
.pb-dot { width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe3b0, #ff8a1f 60%, #d95d00); box-shadow: 0 0 8px #ff8a1f; flex: none; }
.pb-balls b { color: #f8fafc; }
.pb-balls.pb-low b { color: #fb7185; }
.pb-pill.pb-flash { animation: pbflash .5s ease; }
@keyframes pbflash { 0% { box-shadow: 0 0 0 0 #7dd3fc99; } 100% { box-shadow: 0 0 0 10px #7dd3fc00; } }

/* ---------- stage ---------- */
.pb-stage { position: relative; width: var(--pbw); max-width: 100%; border-radius: 16px; overflow: hidden; border: 1px solid #243055; background: #0b1226; box-shadow: 0 10px 30px #0008; }
#pbCanvas { display: block; width: 100%; touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; }

.pb-bar { display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; }
.pb-chip { background: #131c38; color: #cfe0ff; border: 1px solid #2a3868; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: 12px; letter-spacing: 1px; cursor: pointer; white-space: nowrap; min-height: 36px; }
.pb-chip:hover { background: #1b2750; }
.pb-chip:active { transform: scale(.97); }
.pb-chip:focus-visible, .pb-btn:focus-visible, .pb-mode:focus-visible, .pb-tog:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
.pb-bar .pb-chip { flex: 1 1 0; max-width: 140px; }

/* ---------- overlays ---------- */
.pb-ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; overflow-y: auto; padding: 12px; z-index: 5; }
.pb-ov > :first-child { margin-top: auto; }
.pb-ov > :last-child { margin-bottom: auto; }
.pb-start { background: radial-gradient(circle at 50% 30%, #14235acc, #070b18f2 70%); backdrop-filter: blur(3px); }
.pb-pause, .pb-over { background: #070b18e6; backdrop-filter: blur(3px); }
.pb-opts { background: #0a1022; z-index: 8; }                 /* OPAQUE: no ghosting */
.pb-count { background: #070b1899; justify-content: center; pointer-events: none; z-index: 7; }
.pb-count b { font-size: 96px; color: #fff; text-shadow: 0 0 30px #38bdf8; animation: pbpop .9s ease-out infinite; }
@keyframes pbpop { 0% { transform: scale(1.5); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(.9); opacity: .2; } }

.pb-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
.pb-kicker { font-size: 11px; letter-spacing: 3px; font-weight: 700; color: #7dd3fc; }
.pb-title { margin: 0; font-size: 40px; line-height: 1; letter-spacing: 2px; font-weight: 700; background: linear-gradient(180deg, #fff, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pb-tag { margin: 0; color: #a9b8e0; font-size: 14px; font-weight: 600; }
.pb-h2 { margin: 0; font-size: 26px; letter-spacing: 2px; text-align: center; }
.pb-desc { margin: 0; min-height: 36px; color: #cfe0ff; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.pb-bestline { margin: 0; color: #ffd37a; font-size: 12.5px; font-weight: 700; letter-spacing: .5px; min-height: 16px; }
.pb-bigscore { margin: 0; font-size: 44px; font-weight: 700; color: #7dd3fc; }

.pb-btn { background: #16214a; color: #eaf2ff; border: 1px solid #2f4086; border-radius: 14px; padding: 13px 16px; font-weight: 700; font-size: 15px; letter-spacing: 1.5px; cursor: pointer; }
.pb-btn:hover { background: #1d2b60; }
.pb-btn:active { transform: scale(.98); }
.pb-primary { background: linear-gradient(180deg, #38bdf8, #0ea5e9); border-color: #7dd3fc; color: #04122b; box-shadow: 0 6px 18px #0ea5e955; }
.pb-primary:hover { background: linear-gradient(180deg, #5cc9fa, #1fb0f5); }
.pb-ghost { background: transparent; color: #8ea0d4; font-size: 12px; padding: 9px; }

/* mode picker */
.pb-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pb-mode { background: #111a38; color: #b9c8ee; border: 2px solid #26356b; border-radius: 12px; padding: 10px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.pb-mode b { font-size: 14px; letter-spacing: 1px; white-space: nowrap; }
.pb-opts .pb-modes { gap: 4px; }
.pb-opts .pb-mode { padding: 10px 2px; }
.pb-mode small { font-size: 10.5px; color: #7f8db8; font-weight: 700; white-space: nowrap; }
.pb-mode[aria-checked="true"] { background: linear-gradient(180deg, #1a3b6e, #12305c); border-color: #38bdf8; color: #fff; box-shadow: 0 0 14px #38bdf855; }
.pb-mode[aria-checked="true"] small { color: #bfe3ff; }

/* options rows */
.pb-optscroll { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.pb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #101933; border: 1px solid #1f2c58; border-radius: 12px; padding: 9px 12px; }
.pb-rowcol { flex-direction: column; align-items: stretch; }
.pb-rowlbl { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #dbe6ff; }
.pb-rowlbl small { color: #7f8db8; font-weight: 600; letter-spacing: 0; font-size: 11px; }
.pb-tog { min-width: 64px; background: #1a2447; color: #8ea0d4; border: 1px solid #2a3868; border-radius: 999px; padding: 7px 12px; font-weight: 700; font-size: 12px; letter-spacing: 1px; cursor: pointer; white-space: nowrap; }
.pb-tog[aria-pressed="true"] { background: #0e7490; color: #fff; border-color: #22d3ee; }
.pb-skins { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-skin { border: 2px solid #26356b; border-radius: 10px; padding: 6px 9px; font-size: 11.5px; font-weight: 700; color: #cfe0ff; background: #111a38; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.pb-skin i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.pb-skin[aria-pressed="true"] { border-color: #38bdf8; background: #16315c; }
.pb-skin[disabled] { opacity: .55; cursor: not-allowed; }
#trophy-list { text-align: left; max-height: 260px; overflow-y: auto; background: #0d1530; border: 1px solid #1f2c58; border-radius: 12px; padding: 8px; font-size: 13px; }

/* toast */
.pb-toast { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); background: #0b1226ee; border: 1px solid #38bdf8; color: #e8f6ff; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; letter-spacing: .5px; z-index: 9; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- responsive ---------- */
.pb-wrap.tight .pb-pill b { font-size: 18px; }
.pb-wrap.tight .pb-pill { padding: 4px 8px 3px; }
.pb-wrap.tight .pb-title { font-size: 32px; }
.pb-wrap.tight .pb-card { gap: 8px; }
.pb-wrap.compact .pb-pill small { display: none; }
.pb-wrap.compact .pb-pill b { font-size: 18px; }
.pb-wrap.compact .pb-tag, .pb-wrap.compact .pb-kicker { display: none; }
.pb-wrap.compact .pb-title { font-size: 28px; }
.pb-wrap.compact .pb-card { gap: 6px; }
.pb-wrap.compact .pb-btn { padding: 9px 12px; }
.pb-wrap.compact .pb-chip { padding: 6px 10px; min-height: 32px; }

/* narrow stages: keep the three mode buttons inside the card */
.pb-wrap.tight .pb-mode b, .pb-wrap.compact .pb-mode b { font-size: 11px; letter-spacing: 0; }
.pb-wrap.tight .pb-mode small, .pb-wrap.compact .pb-mode small { font-size: 9.5px; }

/* short landscape: playfield left, HUD + buttons in a right column */
.pb-wrap.land { width: auto; max-width: none; display: grid; grid-template-columns: auto 170px; grid-template-rows: auto 1fr; column-gap: 10px; row-gap: 6px; align-items: start; }
.pb-wrap.land .pb-stage { grid-column: 1; grid-row: 1 / span 2; }
.pb-wrap.land .pb-hud { grid-column: 2; grid-row: 1; grid-template-columns: 1fr; }
.pb-wrap.land .pb-bar { grid-column: 2; grid-row: 2; flex-direction: column; align-self: end; }
.pb-wrap.land .pb-bar .pb-chip { max-width: none; flex: none; }
.pb-wrap.land .pb-pill small { display: none; }
.pb-wrap.land .pb-pill b { font-size: 18px; }

@media (prefers-reduced-motion: reduce) {
  .pb-count b, .pb-pill.pb-flash { animation: none; }
}