/*
 * Beer Pong — swipe to throw, portrait, one thumb.
 *
 * Same rules as the rest of public/play: plain CSS, no build step, palette
 * hand-copied from the site tokens (see docs/games.md). Arcade type shared
 * with Mug Climb and Stagger Home, over a table that is drawn rather than
 * pixelled, because the game is a physics arc and the arc has to read.
 */

.bp-hud[hidden], .bp-screen[hidden], .bp-aim[hidden], .bp-initials[hidden],
.bp-record[hidden], #hud-streak[hidden] { display: none !important; }

.bp-stage canvas { display: block; width: 100%; height: 100%; background: #0a0710; }

:root {
  --bp-gold: #ffc93c;
  --bp-cup: #d8382e;
  --bp-cream: #fff4d6;
  --bp-green: #7ef29d;
  --bp-ink: #fff6e0;
  --bp-panel: rgba(10, 6, 18, 0.84);
  --bp-line: #40325e;
  --bp-num: "Press Start 2P", "Courier New", monospace;
  --bp-px: "DotGothic16", "Courier New", monospace;
}

/* ---- HUD ---------------------------------------------------------------- */

.bp-hud {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 10px calc(14px + env(safe-area-inset-bottom, 0px));
  font-family: var(--bp-px);
}
.bp-hud-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.bp-hud-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; }

.bp-panel { background: var(--bp-panel); border: 2px solid var(--bp-line);
  border-bottom-width: 4px; padding: 6px 8px; display: flex; flex-direction: column;
  gap: 3px; line-height: 1; }
.bp-panel.bp-right { align-items: flex-end; }

.bp-lbl { font-family: var(--bp-num); font-size: 7px; letter-spacing: .12em;
  color: rgba(255, 246, 224, 0.55); }
.bp-score { font-family: var(--bp-num); font-size: 14px; color: var(--bp-gold);
  font-variant-numeric: tabular-nums; }
.bp-cups { font-family: var(--bp-num); font-size: 14px; color: var(--bp-cup);
  font-variant-numeric: tabular-nums; }
.bp-wind { font-family: var(--bp-num); font-size: 8px; letter-spacing: .1em;
  color: var(--bp-green); text-align: center; background: rgba(10, 6, 18, 0.72);
  padding: 5px 9px; border: 2px solid rgba(126, 242, 157, 0.28); }

.bp-balls { display: flex; gap: 5px; align-items: center; }
.bp-balls i { display: block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bp-cream); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
.bp-balls i.spent { background: rgba(255, 246, 224, 0.16); box-shadow: none; }

.bp-streak { font-family: var(--bp-num); font-size: 10px; color: var(--bp-gold);
  background: var(--bp-panel); border: 2px solid rgba(255, 201, 60, 0.5);
  padding: 5px 8px; }

/* The power readout sits above the thumb, never under it. */
.bp-aim { position: absolute; left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 3; pointer-events: none; display: flex; flex-direction: column;
  align-items: center; gap: 6px; }
.bp-power { width: min(62%, 260px); height: 10px; background: rgba(10, 6, 18, 0.8);
  border: 2px solid var(--bp-line); overflow: hidden; }
.bp-power i { display: block; height: 100%; width: 100%; background: var(--bp-gold);
  transform-origin: left center; transform: scaleX(0); }
.bp-aimhint { font-family: var(--bp-num); font-size: 7px; letter-spacing: .12em;
  color: rgba(255, 246, 224, 0.3); }

.bp-toast { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%);
  font-family: var(--bp-num); font-size: 15px; letter-spacing: .05em;
  color: var(--bp-gold); text-shadow: 0 3px 0 #7a3b00; opacity: 0;
  transition: opacity 130ms linear; z-index: 4; pointer-events: none;
  text-align: center; white-space: nowrap; }
.bp-toast[data-show="true"] { opacity: 1; }

/* ---- panels ------------------------------------------------------------- */

.bp-screen { position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 4, 12, 0.9); overflow-y: auto; }
.bp-screen p { max-width: 30rem; }
.bp-pass { background: rgba(6, 4, 12, 0.97); }

.bp-logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; }
.bp-logo span { font-family: var(--bp-px); font-size: 40px; color: var(--bp-gold);
  letter-spacing: .06em; line-height: 1; text-shadow: 0 4px 0 #7a3b00; }
.bp-logo em { font-family: var(--bp-num); font-style: normal; font-size: 13px;
  letter-spacing: .1em; color: var(--bp-ink); }
.bp-logo.bp-small span { font-size: 26px; }
.bp-logo.bp-small em { font-size: 10px; }

.bp-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.bp-stat { background: var(--bp-panel); border: 2px solid var(--bp-line);
  border-bottom-width: 4px; padding: 8px 10px; min-width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bp-stat b { font-family: var(--bp-num); font-size: 14px; color: var(--bp-gold);
  font-variant-numeric: tabular-nums; }
.bp-stat span { font-family: var(--bp-px); font-size: 11px; color: rgba(255, 246, 224, 0.6); }
.bp-stat[data-rank="1"] { border-color: rgba(255, 201, 60, 0.55); }
.bp-stat[data-rank="last"] b { color: var(--bp-cup); }

.bp-signoff { font-family: var(--bp-px); font-size: 13px; text-align: center;
  color: rgba(255, 246, 224, 0.78); max-width: 26rem; }
.bp-fine { font-family: var(--bp-px); font-size: 12px; text-align: center;
  color: rgba(255, 246, 224, 0.5); }
.bp-record { font-family: var(--bp-num); font-size: 9px; letter-spacing: .1em;
  color: var(--bp-gold); }

.bp-guide-row, .bp-initials { display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; justify-content: center; font-family: var(--bp-px); font-size: 12px;
  color: rgba(255, 246, 224, 0.75); }
.bp-guide-row > span { font-family: var(--bp-num); font-size: 7px;
  letter-spacing: .12em; color: var(--bp-green); }
.bp-seg { font-family: var(--bp-num); font-size: 8px; letter-spacing: .06em;
  padding: 8px 10px; background: #2b2350; color: var(--bp-ink);
  border: 2px solid var(--bp-line); border-bottom-width: 4px; cursor: pointer; }
.bp-seg.on { background: var(--bp-gold); color: #3a1400; border-color: #a06a00; }

.bp-initials input { width: 5.2rem; font-family: var(--bp-num); font-size: 14px;
  text-align: center; text-transform: uppercase; letter-spacing: .18em;
  padding: 8px 6px; background: #120e22; border: 2px solid var(--bp-line);
  color: var(--bp-gold); }
.bp-initials input:focus-visible { outline: 2px solid var(--bp-gold); outline-offset: 2px; }

.bp-btn-gold { border-color: rgba(255, 201, 60, 0.6) !important; color: var(--bp-gold) !important; }

/* ---- board -------------------------------------------------------------- */

.bp-board { width: min(100%, 22rem); display: flex; flex-direction: column; gap: 3px; }
.bp-board h3 { margin: 6px 0 2px; font-family: var(--bp-num); font-size: 7px;
  letter-spacing: .12em; color: rgba(255, 246, 224, 0.45); text-align: center; }
.bp-row { display: flex; gap: 8px; align-items: baseline; font-family: var(--bp-num);
  font-size: 9px; padding: 4px 8px; background: rgba(10, 6, 18, 0.6);
  border-left: 3px solid transparent; }
.bp-row .r { width: 1.6em; color: rgba(255, 246, 224, 0.4); }
.bp-row .n { flex: 1; color: var(--bp-ink); letter-spacing: .1em; }
.bp-row .c { color: rgba(255, 246, 224, 0.45); font-size: 8px; }
.bp-row .s { color: var(--bp-gold); font-variant-numeric: tabular-nums; }
.bp-row.me { border-left-color: var(--bp-gold); background: rgba(255, 201, 60, 0.1); }
.bp-empty-row { font-family: var(--bp-px); font-size: 12px; text-align: center;
  color: rgba(255, 246, 224, 0.35); padding: 6px; }

@media (orientation: landscape) and (max-height: 520px) {
  .bp-logo span { font-size: 28px; }
  .bp-screen { gap: 8px; padding-top: 8px; padding-bottom: 8px; }
}
