/* Belt Breaker — page shell. Everything is prefixed bb-. */
.bb { display: flex; flex-direction: column; color: #dfe9ff; --bb-hud: 48px; --bb-a: #7df9ff; --bb-b: #ffb86b; }
.bb-stage { position: relative; width: 100%; height: min(78vh, 680px); min-height: 360px; background: #03050c; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
@media (max-width: 600px) { .bb-stage { height: auto; aspect-ratio: 3 / 4; max-height: 76vh; min-height: 0; } }
#bb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }

.bb-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--bb-hud); display: flex; align-items: center; gap: 12px; padding: 0 8px 0 14px; z-index: 3; pointer-events: none; }
.bb-hud > button { pointer-events: auto; }
.bb-stat { display: flex; flex-direction: column; line-height: 1; min-width: 62px; }
.bb-k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #7f93bd; margin-bottom: 3px; }
.bb-stat b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 14px rgba(125,249,255,0.45); }
.bb-combo { display: flex; flex-direction: column; gap: 4px; width: 54px; opacity: 0.4; transition: opacity .2s; }
.bb-combo.is-on { opacity: 1; }
.bb-combo b { font-size: 16px; font-weight: 900; line-height: 1; color: var(--bb-b); text-shadow: 0 0 12px rgba(255,184,107,0.6); }
.bb-combo.is-max b { color: #ff5fd2; text-shadow: 0 0 14px rgba(255,95,210,0.8); }
.bb-combo i { display: block; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.bb-combo i span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--bb-b), #ff5fd2); border-radius: 2px; }
.bb-where { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #9fb4de; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bb-sp { flex: 1 1 0; }
.bb-hulls { display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.bb-hullrow { display: flex; gap: 3px; }
.bb-hullrow i { width: 9px; height: 14px; border-radius: 2px 2px 4px 4px; background: var(--bb-a); box-shadow: 0 0 8px rgba(125,249,255,0.7); }
.bb-hullrow.p2 i { background: var(--bb-b); box-shadow: 0 0 8px rgba(255,184,107,0.7); height: 9px; }
.bb-hullrow.p1.duo i { height: 9px; }
.bb-hullrow i.off { background: rgba(255,255,255,0.14); box-shadow: none; }
.bb-bank { display: flex; align-items: center; gap: 4px; color: #ffd166; font-variant-numeric: tabular-nums; }
.bb-bank svg { width: 15px; height: 15px; }
.bb-bank b { font-size: 15px; font-weight: 800; min-width: 18px; }
.bb-tool { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid #1c2b4a; background: rgba(11,19,40,0.8);
  color: #bcd0f5; cursor: pointer; padding: 0; touch-action: manipulation; }
.bb-tool svg { width: 19px; height: 19px; }
@media (hover: hover) { .bb-tool:hover:not(:disabled) { border-color: var(--bb-a); color: #fff; } }
.bb-tool:focus-visible { outline: 2px solid var(--bb-a); outline-offset: 2px; }
.bb-tool:disabled { opacity: 0.35; cursor: default; }
#bb-sound .bb-off { display: none; }
#bb-sound[aria-pressed="true"] .bb-on { display: none; }
#bb-sound[aria-pressed="true"] .bb-off { display: inline; }

.bb-boss[hidden] { display: none; }
.bb-boss { position: absolute; left: 50%; top: calc(var(--bb-hud) + 4px); transform: translateX(-50%); width: min(62%, 420px); z-index: 2; text-align: center; pointer-events: none; }
.bb-boss span { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: #ffd9a8; margin-bottom: 4px; text-shadow: 0 0 10px rgba(255,150,60,0.7); }
.bb-boss i { display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,190,120,0.35); overflow: hidden; }
.bb-boss i span { height: 100%; margin: 0; width: 100%; background: linear-gradient(90deg, #ff5470, #ffb86b); border-radius: 3px; }

.bb-banner { position: absolute; left: 0; right: 0; top: 30%; z-index: 2; text-align: center; pointer-events: none; opacity: 0; transform: scale(0.96); transition: opacity .35s, transform .35s; padding: 0 12px; }
.bb-banner.is-on { opacity: 1; transform: none; }
.bb-banner b { display: block; font-size: clamp(22px, 5.4vw, 40px); font-weight: 900; letter-spacing: 0.12em; color: #fff; text-shadow: 0 0 22px rgba(125,249,255,0.75), 0 0 2px #7df9ff; }
.bb-banner span { display: block; margin-top: 6px; font-size: clamp(12px, 2.6vw, 15px); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--bb-b); text-shadow: 0 0 12px rgba(255,150,60,0.6); }
.bb-banner.is-warn b { color: #ffd9d0; text-shadow: 0 0 24px rgba(255,84,112,0.9), 0 0 2px #ff5470; }

/* two-thumb controls */
.bb-pad[hidden] { display: none; }
.bb-pad { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.bb-pad-hint { position: absolute; left: 14px; bottom: 26px; width: 150px; padding: 12px 8px; border: 1.5px dashed rgba(255,255,255,0.3); border-radius: 16px; color: rgba(223,233,255,0.75); font-size: 12px; line-height: 1.35; text-align: center; transition: opacity .4s; }
.bb-pad-hint.is-gone { opacity: 0; }
.bb-tb { position: absolute; pointer-events: auto; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(255,255,255,0.4); background: rgba(10,18,40,0.42); color: #fff;
  font: inherit; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; padding: 0; touch-action: none; -webkit-tap-highlight-color: transparent; }
.bb-tb.is-down { background: rgba(125,249,255,0.3); border-color: #fff; }
.bb-tb-fire { right: 14px; bottom: 18px; width: 84px; height: 84px; border-color: rgba(125,249,255,0.75); font-size: 13px; }
.bb-tb-dash { right: 108px; bottom: 14px; width: 66px; height: 66px; border-color: rgba(255,184,107,0.8); }
.bb-tb-brake { right: 28px; bottom: 112px; width: 58px; height: 58px; }
.bb-pad.is-auto .bb-tb-fire { display: none; }
.bb-pad.is-auto .bb-tb-dash { right: 14px; bottom: 18px; width: 84px; height: 84px; font-size: 13px; }
.bb-pad.is-auto .bb-tb-brake { right: 108px; bottom: 14px; width: 66px; height: 66px; }
.bb-tb.is-cool { opacity: 0.4; }

.bb-overlay[hidden] { display: none; }
.bb-overlay { position: absolute; left: 0; right: 0; bottom: 0; top: var(--bb-hud); display: flex; align-items: center; justify-content: center; padding: 10px 12px 12px;
  background: radial-gradient(ellipse at center, rgba(3,6,16,0.4), rgba(3,5,12,0.8)); z-index: 4; overflow: auto; touch-action: pan-y; }
.bb-overlay.bb-ov-title { background: radial-gradient(ellipse at center, rgba(3,6,16,0.1), rgba(3,5,12,0.5)); }
.bb-panel { width: min(100%, 400px); margin: auto; text-align: center; padding: 20px 20px 18px; border: 1px solid #1c2b4a; border-radius: 18px;
  background: rgba(8,13,30,0.88); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(125,249,255,0.06) inset; animation: bb-in .28s cubic-bezier(.2,.9,.25,1.1); }
.bb-panel.bb-wide { width: min(100%, 720px); }
@keyframes bb-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.bb-logo { margin: 0 0 4px; font-size: clamp(28px, 8vw, 40px); font-weight: 900; letter-spacing: 0.05em; line-height: 1.05;
  background: linear-gradient(100deg, #7df9ff 10%, #dffcff 45%, #ffb86b 90%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(125,249,255,0.35)); }
.bb-tag { margin: 0 0 14px; font-size: 13.5px; color: #9fb4de; }
.bb-h2 { margin: 0 0 4px; font-size: 22px; font-weight: 900; letter-spacing: 0.04em; color: #fff; }
.bb-sub { margin: 0 0 12px; font-size: 13px; color: #9fb4de; }
.bb-modes { display: flex; gap: 6px; padding: 4px; border-radius: 13px; background: rgba(255,255,255,0.05); margin-bottom: 8px; }
.bb-mode { flex: 1 1 0; font: inherit; font-size: 13px; font-weight: 700; min-height: 40px; padding: 6px 4px; border-radius: 10px; border: 0; background: transparent; color: #9fb4de; cursor: pointer; touch-action: manipulation; }
.bb-mode[aria-pressed="true"] { background: #16254a; color: #fff; box-shadow: 0 0 0 1px rgba(125,249,255,0.5) inset; }
@media (hover: hover) { .bb-mode:hover { color: #fff; } }
.bb-mode:focus-visible, .bb-tog:focus-visible, .bb-card:focus-visible { outline: 2px solid var(--bb-a); outline-offset: 2px; }
.bb-desc { min-height: 36px; margin: 0 0 12px; font-size: 12.5px; line-height: 1.4; color: #b9c9ea; }
.bb-desc b { color: #ffd166; font-weight: 700; }
.bb-actions { display: flex; flex-direction: column; gap: 8px; }
.bb-actions.bb-rowed { flex-direction: row; } .bb-actions.bb-rowed > * { flex: 1 1 0; }
.bb-btn { font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 16px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation;
  border: 1px solid #263a66; background: #0e1a38; color: #dfe9ff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .bb-btn:hover:not(:disabled) { border-color: var(--bb-a); } }
.bb-btn:active { transform: translateY(1px); }
.bb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.bb-btn:disabled { opacity: 0.4; cursor: default; }
.bb-btn-primary { background: linear-gradient(135deg, #7df9ff, #6aa8ff); color: #03141c; border-color: transparent; font-size: 16px; font-weight: 800; box-shadow: 0 6px 24px rgba(110,200,255,0.3); }
@media (hover: hover) { .bb-btn-primary:hover:not(:disabled) { border-color: transparent; filter: brightness(1.08); } }
.bb-btn kbd, .bb-card kbd { font: inherit; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; background: rgba(0,0,0,0.22); }
.bb-togs { display: flex; gap: 8px; margin-top: 10px; }
.bb-tog { flex: 1 1 0; font: inherit; font-size: 12.5px; font-weight: 700; min-height: 40px; padding: 6px 8px; border-radius: 10px; border: 1px solid #1c2b4a; background: transparent; color: #8fa3cf; cursor: pointer; touch-action: manipulation; }
.bb-tog[aria-pressed="true"] { color: #fff; border-color: rgba(125,249,255,0.6); background: rgba(125,249,255,0.1); }
.bb-tog::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #33456f; vertical-align: 1px; }
.bb-tog[aria-pressed="true"]::before { background: var(--bb-a); box-shadow: 0 0 8px var(--bb-a); }
.bb-bests { margin: 12px 0 0; font-size: 12px; color: #8094c0; }
.bb-bests b { color: #dfe9ff; font-variant-numeric: tabular-nums; }
.bb-link { font: inherit; font-size: 12.5px; font-weight: 700; color: #9fd8ff; background: none; border: 0; padding: 8px 10px; min-height: 40px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.bb-link:focus-visible { outline: 2px solid var(--bb-a); outline-offset: 2px; border-radius: 8px; }

/* refit: pick an upgrade between waves */
.bb-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.bb-card { position: relative; font: inherit; text-align: left; padding: 12px 12px 10px; min-height: 132px; border-radius: 14px; border: 1px solid #263a66; background: linear-gradient(180deg, #101d3f, #0a1330); color: #dfe9ff;
  cursor: pointer; display: flex; flex-direction: column; gap: 5px; touch-action: manipulation; }
@media (hover: hover) { .bb-card:hover:not(:disabled) { border-color: var(--bb-a); transform: translateY(-2px); } }
.bb-card:disabled { opacity: 0.45; cursor: default; }
.bb-card.is-taken { border-style: dashed; opacity: 0.5; align-items: center; justify-content: center; text-align: center; color: #7dffa8; font-weight: 800; letter-spacing: 0.1em; }
.bb-card-n { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: #7f93bd; }
.bb-card-t { font-size: 15.5px; font-weight: 800; color: #fff; line-height: 1.15; }
.bb-card-d { font-size: 12.5px; line-height: 1.35; color: #b9c9ea; flex: 1 1 auto; }
.bb-card-f { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bb-pips { display: flex; gap: 3px; }
.bb-pips i { width: 12px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.16); }
.bb-pips i.on { background: var(--bb-a); box-shadow: 0 0 6px var(--bb-a); }
.bb-pips i.next { background: var(--bb-b); }
.bb-price { font-size: 12.5px; font-weight: 800; color: #ffd166; white-space: nowrap; }
.bb-price.free { color: #7dffa8; letter-spacing: 0.08em; }
.bb-price.no { color: #ff8a8a; }
.bb-refitbar { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.bb-refitbar .bb-btn { min-width: 150px; }
.bb-have { font-size: 13px; font-weight: 700; color: #ffd166; }

/* results */
.bb-big { font-size: 46px; font-weight: 900; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 0 26px rgba(125,249,255,0.5); margin: 6px 0 4px; }
.bb-newbest { display: inline-block; margin: 2px 0 6px; padding: 3px 10px; border-radius: 999px; background: linear-gradient(90deg, #ffb86b, #ff5fd2); color: #1a0b12; font-size: 11.5px; font-weight: 900; letter-spacing: 0.12em; animation: bb-pulse 1.1s ease-in-out infinite; }
@keyframes bb-pulse { 50% { transform: scale(1.06); } }
.bb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 12px; }
.bb-st { padding: 7px 4px 6px; border-radius: 10px; background: rgba(255,255,255,0.045); }
.bb-st span { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: #7f93bd; }
.bb-st b { display: block; font-size: 16px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; margin-top: 2px; }
.bb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 12px; }
.bb-chip { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: rgba(255,209,102,0.14); color: #ffd166; border: 1px solid rgba(255,209,102,0.4); }
.bb-chip.old { background: transparent; color: #7f93bd; border-color: #263a66; font-weight: 700; }

/* how to play */
.bb-how { text-align: left; margin: 10px 0 12px; display: grid; gap: 7px; font-size: 13px; line-height: 1.4; color: #c6d4f2; }
.bb-how div { display: grid; grid-template-columns: 92px 1fr; gap: 10px; align-items: baseline; }
.bb-how b { color: var(--bb-a); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.bb-how kbd { font: inherit; font-size: 11.5px; font-weight: 700; background: #16213a; color: #bfe9ff; border-radius: 4px; padding: 1px 5px; }
.bb-how .bb-kb, .bb-how .bb-tch { display: contents; }
.bb-wide .bb-how { grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.bb-wide .bb-how div { grid-template-columns: 62px 1fr; }
@media (max-width: 640px) { .bb-wide .bb-how { grid-template-columns: 1fr; } }
.bb-istouch .bb-how .bb-kb, .bb:not(.bb-istouch) .bb-how .bb-tch { display: none; }

.bb-toast[hidden] { display: none; }
.bb-toast { position: absolute; left: 50%; top: calc(var(--bb-hud) + 34px); transform: translateX(-50%); z-index: 6; padding: 8px 14px; border-radius: 999px; background: #dfe9ff; color: #04060f; font-size: 13px; font-weight: 700; animation: bb-in .2s ease-out; pointer-events: none; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.bb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* short stages (phone landscape): tighter panels */
.bb-short .bb-panel { padding: 12px 16px 12px; width: min(100%, 520px); }
.bb-short .bb-panel.bb-wide { width: min(100%, 720px); }
.bb-short .bb-logo { font-size: 26px; }
.bb-short .bb-tag { margin-bottom: 8px; font-size: 12.5px; }
.bb-short .bb-desc { min-height: 0; margin-bottom: 8px; }
.bb-short .bb-btn { min-height: 42px; padding: 8px 14px; }
.bb-short .bb-actions { flex-direction: row; } .bb-short .bb-actions > * { flex: 1 1 0; }
.bb-short .bb-card { min-height: 104px; padding: 9px 10px 8px; }
.bb-short .bb-cards { margin: 8px 0; }
.bb-short .bb-big { font-size: 34px; }
.bb-short .bb-stats { grid-template-columns: repeat(6, 1fr); margin: 6px 0 8px; }
.bb-short .bb-bests { margin-top: 8px; }
.bb-short .bb-how { grid-template-columns: 1fr 1fr; gap: 5px 16px; font-size: 12.5px; }
.bb-short .bb-how + .bb-chips { margin-bottom: 8px; gap: 5px; }
.bb-short .bb-how + .bb-chips .bb-chip { padding: 2px 9px; }
.bb-short .bb-banner { top: 22%; }

/* narrow stages (phone portrait) */
@media (max-width: 560px) {
  .bb-hud { gap: 8px; padding-left: 10px; }
  .bb-stat { min-width: 52px; } .bb-stat b { font-size: 18px; }
  .bb-where { display: none; }
  .bb-cards { grid-template-columns: 1fr; gap: 7px; margin: 8px 0; }
  .bb-card { min-height: 0; padding: 9px 12px 8px; gap: 3px; }
  .bb-card-n { position: absolute; right: 12px; top: 9px; }
  .bb-card-n kbd { display: none; }
  .bb-panel { padding: 16px 14px 14px; }
  .bb-h2 { font-size: 19px; }
  .bb-how div { grid-template-columns: 78px 1fr; }
  .bb-refitbar .bb-btn { min-width: 0; flex: 1 1 0; }
}

.bb-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.bb-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .bb-help .hint-kb { display: none; } .bb-help .hint-touch { display: inline; } }
.stage .bb-help { padding: 10px 14px 12px; }

/* full screen: the field takes every pixel */
.stage.is-immersive .stage-body > .bb { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .bb-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .bb-help { display: none; }
@media (prefers-reduced-motion: reduce) { .bb-panel, .bb-toast, .bb-newbest { animation: none; } .bb-banner { transition: none; } .bb-card:hover { transform: none; } }
