.banzai88-wrap {
  --banzai88-accent: #ff008c;
  --banzai88-dim: 0.70;
  --banzai88-accent-soft: color-mix(in srgb, var(--banzai88-accent) 55%, transparent);
  --banzai88-accent-glow: color-mix(in srgb, var(--banzai88-accent) 75%, transparent);

  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #fff;
}

.banzai88-card {
  background: #000;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #000, 0 0 26px var(--banzai88-accent-soft);
  padding: 16px;
}

.hidden { display: none !important; }

.banzai88-logo img,
.banzai88-end-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.banzai88-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 10px;
}

.banzai88-subtitle {
  margin-top: 8px;
  line-height: 1.35;
  opacity: 0.95;
}

.banzai88-subtitle.small {
  font-size: 13px;
  opacity: 0.85;
}

.banzai88-btn {
  appearance: none;
  border: 2px solid #fff;
  background: #000;
  color: #fff;
  padding: 12px 14px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 14px;
  width: 100%;
  cursor: pointer;
  text-transform: uppercase;
}

.banzai88-btn.secondary {
  border-color: rgba(255,255,255,0.65);
  opacity: 0.92;
}

.banzai88-btn:active {
  transform: translateY(1px);
}

.banzai88-canvas-wrap {
  position: relative;
  border: 2px solid #fff;
  overflow: hidden;
  background: #000;
}

.banzai88-canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  background: #000;
}

.banzai88-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 12px;
  pointer-events: none;
  z-index: 5;
}

.banzai88-hud-left,
.banzai88-hud-right {
  pointer-events: auto;
  display: flex;
  align-items: center;
}

.banzai88-hud-left {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.banzai88-score {
  font-size: 22px;
  font-weight: 900;
  display: flex;
  gap: 6px;
  align-items: baseline;
  text-shadow: 0 0 14px var(--banzai88-accent-glow);
}

.banzai88-score-icon {
  font-size: 22px;
  text-shadow: 0 0 18px var(--banzai88-accent-glow);
  color: var(--banzai88-accent);
}

.banzai88-balls {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  opacity: 0.9;
}

.banzai88-icon-btn {
  appearance: none;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 16px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.banzai88-icon-btn:active {
  transform: translateY(1px);
}

.banzai88-watermark {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 90px;
  opacity: 0.35;
  /* Hardcoded rgba instead of var(--banzai88-accent-glow). The CSS variable
     resolves through color-mix(), which a few browsers parse as invalid and
     disable the entire filter (which can affect child rendering in odd
     ways). The default accent (#ff008c) at 75% alpha is the same effective
     colour. */
  filter: drop-shadow(0 0 10px rgba(255, 0, 140, 0.75));
  pointer-events: none;
  z-index: 4;
}

/* v1 pattern. The start-screen and end-screen logos use this exact rule
   and render correctly. Earlier attempts to add object-fit, fixed width,
   and inline style on the img produced a blank white rectangle; that is
   the only known difference from the working logos, so revert. */
.banzai88-watermark img {
  width: 100%;
  height: auto;
  display: block;
}

.banzai88-floats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.banzai88-float {
  position: absolute;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 0 12px var(--banzai88-accent-glow);
  animation: banzai88-float-up 900ms ease-out forwards;
  transform: translate(-50%, 0);
}

@keyframes banzai88-float-up {
  from { transform: translate(-50%, 0); opacity: 1; }
  to   { transform: translate(-50%, -48px); opacity: 0; }
}

/* Big-variant float — used for MULTIBALL announcement. Larger font, longer
   travel, longer dwell time. Matches the animation duration on the JS
   setTimeout (1800ms). */
.banzai88-float.banzai88-float-big {
  font-size: 32px;
  letter-spacing: 1.5px;
  text-shadow: 0 0 18px var(--banzai88-accent-glow), 0 0 6px #000;
  animation: banzai88-float-up-big 1800ms ease-out forwards;
}

@keyframes banzai88-float-up-big {
  from { transform: translate(-50%, 0)    scale(0.85); opacity: 0; }
  20%  { transform: translate(-50%, -10px) scale(1.10); opacity: 1; }
  100% { transform: translate(-50%, -120px) scale(1.0);  opacity: 0; }
}

.banzai88-end-top {
  display: grid;
  gap: 12px;
}

.banzai88-final-label {
  font-size: 12px;
  letter-spacing: 1.4px;
  font-weight: 900;
  opacity: 0.8;
}

.banzai88-final-score {
  font-size: 44px;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 18px var(--banzai88-accent-soft);
}

.banzai88-final-sub {
  margin-top: 6px;
  font-size: 13px;
  opacity: 0.8;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.banzai88-leaderboard {
  margin-top: 14px;
  border-top: 2px solid rgba(255,255,255,0.35);
  padding-top: 12px;
}

.banzai88-leaderboard-title {
  font-weight: 1000;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.banzai88-leaderboard-list {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.banzai88-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  opacity: 0.95;
}

.banzai88-row .name { opacity: 0.9; }
.banzai88-row .score { font-weight: 1000; }

.banzai88-reward {
  margin-top: 14px;
  border-top: 2px solid rgba(255,255,255,0.35);
  padding-top: 12px;
}

.banzai88-glitch {
  font-weight: 1000;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.banzai88-flyer img {
  width: 100%;
  height: auto;
  display: block;
  border: 2px solid #fff;
  box-shadow: 0 0 18px var(--banzai88-accent-soft);
}

.banzai88-reveal {
  margin-top: 10px;
  font-weight: 1000;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.banzai88-playername {
  margin-top: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 12px;
  opacity: 0.9;
  text-align: center;
}

/* Fullscreen takeover */
.banzai88-wrap.banzai88-fullscreen,
.banzai88-wrap:fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  max-width: none;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banzai88-wrap.banzai88-fullscreen .banzai88-card,
.banzai88-wrap:fullscreen .banzai88-card {
  border: none;
  box-shadow: none;
  width: 100%;
  height: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banzai88-wrap.banzai88-fullscreen .banzai88-canvas-wrap,
.banzai88-wrap:fullscreen .banzai88-canvas-wrap {
  border: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banzai88-wrap.banzai88-fullscreen .banzai88-canvas,
.banzai88-wrap:fullscreen .banzai88-canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}
