/* Rack 'Em: felt green and brass. */
:root {
  --bg0: #0b1f17; --bg1: #134a33; --bg2: #040b08;
  --accent: #f0c04e; --accent2: #c98b1a; --accent-ink: #2a1a00; --accent-shadow: #7a5208;
  --panel: rgba(8, 22, 16, 0.78); --panel2: #0d2219; --line: rgba(255, 255, 255, 0.13);
  --dim: #9fb9ad;
}

/* ---------------------------------------------------------------- the logo */
.logo { display: inline-flex; flex-direction: column; align-items: center; font-family: var(--display); line-height: 0.86; letter-spacing: 0.02em; transform: rotate(-4deg); filter: drop-shadow(0 8px 0 rgba(0, 0, 0, 0.35)); }
.logo .l1 { font-size: 64px; color: #f7f0dc; -webkit-text-stroke: 3px #08140f; paint-order: stroke fill; text-shadow: 0 5px 0 #08140f; }
.logo .l2 { display: flex; align-items: center; gap: 0.08em; font-size: 54px; color: var(--accent); -webkit-text-stroke: 3px #08140f; paint-order: stroke fill; text-shadow: 0 5px 0 #08140f; }
.logo .eight { position: relative; display: inline-block; width: 0.86em; height: 0.86em; border-radius: 50%; background: radial-gradient(circle at 34% 30%, #5d5d5d 0%, #1b1b1b 36%, #000 100%); box-shadow: 0 0.06em 0 #08140f, inset -0.05em -0.07em 0.12em rgba(0, 0, 0, 0.6); font-style: normal; -webkit-text-stroke: 0; text-shadow: none; color: transparent; overflow: hidden; vertical-align: middle; }
.logo .eight::before { content: '8'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 0.3em; width: 1.45em; height: 1.45em; line-height: 1.5em; border-radius: 50%; background: #f7f3e8; color: #111; font-family: var(--font); font-weight: 900; text-align: center; }
.logo.big .l1 { font-size: clamp(70px, 21vw, 132px); }
.logo.big .l2 { font-size: clamp(58px, 17.5vw, 110px); }

/* ---------------------------------------------------------------- the HUD */
.pcards { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 280px) auto minmax(0, 280px); justify-content: center; align-items: center; gap: 8px; }
.pcard { position: relative; }
.pcard.right { flex-direction: row-reverse; padding: 6px 6px 6px 10px; text-align: right; }
.pcard.right .pn { align-items: flex-end; }
.pcard .pn b em { font-style: normal; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.pcard .racks { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; }
.pcard .racks i { width: 9px; height: 9px; border-radius: 50%; background: rgba(0, 0, 0, 0.55); border: 1.5px solid rgba(255, 255, 255, 0.35); }
.pcard .racks i.won { background: var(--accent); border-color: #fff3c9; box-shadow: 0 0 8px var(--accent); }
.grp { display: flex; align-items: center; gap: 2px; font-size: 11px; color: var(--dim); white-space: nowrap; margin-top: 2px; }
.grp.short { display: none; gap: 4px; }
.grp.short b { color: #fff; }
.pcard .pn { overflow: hidden; }
.pcard.right .grp { justify-content: flex-end; }
.bdot { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--b); color: transparent; font-size: 0; font-style: normal; box-shadow: inset -2px -2px 3px rgba(0, 0, 0, 0.35); flex: none; }
.bdot.st { background: linear-gradient(180deg, #f4efe2 0 24%, var(--b) 24% 76%, #f4efe2 76%); }
.bdot.gone { opacity: 0.2; filter: grayscale(0.6); }
.vs { display: flex; flex-direction: column; align-items: center; line-height: 1.05; padding: 0 2px; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }
.vs b { font-family: var(--display); font-weight: 400; font-size: 14px; color: var(--accent); letter-spacing: 0.04em; }
.vs small { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
@media (max-width: 480px) {
  .pcards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vs { display: none; }
  .pcard .av { width: 30px; height: 30px; font-size: 17px; }
  .pcard .pn b { font-size: 13px; }
  .bdot { width: 10px; height: 10px; }
  .grp { gap: 1.5px; }
  .grp.full { display: none; }
  .grp.short { display: flex; }
  .pcard { padding: 5px 7px 5px 5px; gap: 6px; }
}

/* power: pull the bar down */
.power { position: absolute; right: max(8px, env(safe-area-inset-right)); top: 54%; transform: translateY(-50%); width: 52px; height: min(46vh, 320px); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.power small { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.ptrack { position: relative; flex: 1; width: 100%; border-radius: 20px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35)); border: 1px solid var(--line); overflow: hidden; touch-action: none; cursor: grab; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5); }
.ptrack::before { content: ''; position: absolute; inset: 8px 0; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.13) 0 2px, transparent 2px 14%); pointer-events: none; }
.pfill { position: absolute; left: 0; right: 0; top: 0; height: 0; background: linear-gradient(180deg, #ffe58a, #ffb52e 45%, #ff5a2e 85%, #e5232b); opacity: 0.85; }
.pcue { position: absolute; left: 50%; top: 0; width: 14px; height: 100%; margin-left: -7px; pointer-events: none; }
.pcue::before { content: ''; position: absolute; left: 0; right: 0; top: -100%; height: 100%; background: linear-gradient(90deg, #a67a44, #e6c690 45%, #b98a50); border-radius: 7px 7px 0 0; }
.pcue::after { content: ''; position: absolute; left: 1px; right: 1px; top: -4px; height: 8px; border-radius: 4px 4px 2px 2px; background: #f3efe4; box-shadow: 0 -3px 0 #3c6fd1; }

/* fine aim: a knurled wheel */
.fine { position: absolute; left: max(6px, env(safe-area-inset-left)); top: 54%; transform: translateY(-50%); width: 34px; height: min(40vh, 280px); border-radius: 17px; overflow: hidden; background: linear-gradient(90deg, #0d0f12, #2a2f36 50%, #0d0f12); border: 1px solid var(--line); touch-action: none; cursor: ns-resize; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4); }
.fticks { position: absolute; inset: 0; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 9px); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }

/* spin */
.pads { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 10px; }
.spinbtn { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.spinbtn small { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.spinbtn:disabled { opacity: 0.45; }
.sball, .sbig { position: relative; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, #f1ede2 45%, #b9b4a6 100%); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), inset -4px -6px 10px rgba(0, 0, 0, 0.18); }
.sball { width: 50px; height: 50px; border: 2px solid rgba(255, 255, 255, 0.5); }
.sball i, .sbig i { position: absolute; width: 22%; height: 22%; border-radius: 50%; background: #d9232f; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); transition: transform 0.08s; }
.sball::before, .sbig::before { content: ''; position: absolute; width: 78%; height: 78%; border-radius: 50%; border: 1px dashed rgba(0, 0, 0, 0.22); }
.spinpad { position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: calc(max(10px, env(safe-area-inset-bottom)) + 76px); display: grid; justify-items: center; gap: 8px; padding: 14px; border-radius: 22px; background: var(--panel2); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5); animation: rise 0.2s both; z-index: 5; }
.spinpad small { font-size: 12px; color: var(--dim); max-width: 170px; text-align: center; }
.sbig { width: 170px; height: 170px; touch-action: none; cursor: crosshair; }
.sbig::after { content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: rgba(0, 0, 0, 0.3); }

/* the end of a match */
.ocard .score { font-family: var(--display); font-size: 22px; color: #fff; }
