/*
 * controls.css — the standard slot control layer shared by every game:
 * thin credit / bet strip at the bottom, spin cluster on the right of the
 * reels, buy panel on the left, bet menu and buy confirmation.
 * Load it after the game stylesheet; games theme it with --pp-accent on :root
 * (defaults sit on `html`, which :root outranks).
 */
html {
  --pp-accent: #ffcf3a;
  --pp-label: #ffc828;
  --pp-bar-h: 46px;
  --pp-side-w: clamp(180px, 16vw, 250px);
  --pp-spin: clamp(80px, 12vh, 124px);
  --pp-round: clamp(36px, 5vh, 48px);
  --pp-buy-bg:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(180deg, rgba(40, 20, 70, 0.92), rgba(10, 6, 24, 0.95));
}

.pp-bar .hidden,
.pp-menu.hidden,
.pp-menu .hidden,
.pp-modal.hidden {
  display: none !important;
}

/* ——— Layout: side columns on wide screens, stacked on portrait / narrow ——— */
.app {
  padding-bottom: 0 !important;
}
.stage {
  padding-inline: var(--pp-side-w);
}

.pp-side,
.pp-spin {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: var(--pp-side-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: translateY(-50%);
}
.pp-side {
  left: 10px;
}
.pp-spin {
  right: 10px;
}

/* ——— Buy panel ——— */
.pp-buy {
  position: relative;
  width: min(100%, 160px);
  padding: 12px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 18px;
  border: 2px solid var(--pp-accent);
  background: var(--pp-buy-bg);
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.35),
    0 10px 28px rgba(0, 0, 0, 0.55),
    0 0 22px color-mix(in srgb, var(--pp-accent) 45%, transparent);
  color: #fff;
  text-align: center;
  transition:
    transform 0.15s,
    box-shadow 0.25s,
    filter 0.2s;
}
.pp-buy:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.35),
    0 14px 30px rgba(0, 0, 0, 0.6),
    0 0 36px color-mix(in srgb, var(--pp-accent) 70%, transparent);
}
.pp-buy:active:not(:disabled) {
  transform: scale(0.97);
}
.pp-buy:disabled {
  filter: grayscale(0.7) brightness(0.7);
  cursor: default;
}
.pp-buy-art {
  width: 64%;
  aspect-ratio: 1;
  border-radius: 50%;
  background-position: center;
  background-size: 112%;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.5),
    0 0 18px color-mix(in srgb, var(--pp-accent) 60%, transparent);
}
.pp-buy-title {
  font-size: clamp(12px, 1.25vw, 16px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
}
.pp-buy-price {
  font-size: clamp(15px, 1.6vw, 21px);
  font-weight: 900;
  color: var(--pp-accent);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.7);
  font-variant-numeric: tabular-nums;
}

/* Ante ("double chance") toggle under the buy card */
.pp-ante {
  width: min(100%, 160px);
  padding: 10px 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 6, 24, 0.78);
  color: #fff;
  text-align: center;
  cursor: pointer;
}
.pp-ante input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pp-ante-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.15;
}
.pp-ante-bet {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
}
.pp-ante-bet b {
  display: block;
  font-size: 16px;
  color: var(--pp-accent);
}
.pp-switch {
  position: relative;
  width: 50px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  transition: background 0.2s;
}
.pp-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}
.pp-ante input:checked ~ .pp-switch {
  background: #2fbf4f;
}
.pp-ante input:checked ~ .pp-switch::after {
  transform: translateX(24px);
}
.pp-ante:has(input:checked) {
  border-color: #2fbf4f;
  box-shadow: 0 0 18px rgba(47, 191, 79, 0.45);
}
.pp-ante:has(input:disabled) {
  opacity: 0.55;
  cursor: default;
}
/* Special bets card (replaces the ante switch in games with several special bets) */
.pp-special .pp-special-sel {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
}
.pp-special.on {
  border-color: #2fbf4f;
  box-shadow: 0 0 18px rgba(47, 191, 79, 0.5);
}
.pp-special.on .pp-special-sel {
  color: #062a10;
  background: linear-gradient(180deg, #8dff9f, #2fbf4f);
}
.pp-special:disabled {
  opacity: 0.55;
  cursor: default;
}

/* ——— Special bets / multi-choice buy cards ——— */
.pp-special-sheet {
  width: min(780px, 100%);
  border: 2px solid transparent;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in srgb, var(--pp-accent) 22%, transparent), transparent 70%) padding-box,
    linear-gradient(180deg, #24182f, #0c0a14 70%) padding-box,
    linear-gradient(160deg, #fff3c0, var(--pp-accent) 30%, #7a4a08 55%, var(--pp-accent) 80%, #fff3c0) border-box;
  animation: ppConfirmIn 0.4s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.pp-special-sheet .pp-sheet-head > span {
  flex: 1;
  text-align: center;
  font-size: 22px;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #fffbe6 10%, #ffd34a 50%, #c07a10 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(80, 30, 0, 0.9));
}
.pp-special-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.pp-scard {
  grid-column: span 2;
}
.pp-scard.row-start {
  grid-column: 2 / span 2;
}
.pp-scard,
.pp-confirm.multi .pp-choice {
  --tone-a: #c2185b;
  --tone-b: #5a0a2e;
  --tone-edge: #ffb3c8;
  position: relative;
  min-height: 92px;
  padding: 10px 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 12px;
  border: 2px solid var(--tone-edge);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.28), transparent 60%),
    linear-gradient(180deg, var(--tone-a), var(--tone-b));
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.25),
    0 6px 16px rgba(0, 0, 0, 0.45);
  color: #fff;
  text-align: center;
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    filter 0.2s;
}
.pp-scard[data-tone='0'],
.pp-confirm.multi .pp-choice[data-tone='0'] {
  --tone-a: #8e2a8a;
  --tone-b: #3d0b45;
  --tone-edge: #ffb27a;
}
.pp-scard[data-tone='1'],
.pp-confirm.multi .pp-choice[data-tone='1'] {
  --tone-a: #7b3fb8;
  --tone-b: #2e1458;
  --tone-edge: #d8d8f0;
}
.pp-scard[data-tone='2'],
.pp-confirm.multi .pp-choice[data-tone='2'] {
  --tone-a: #c2307a;
  --tone-b: #5a0d3a;
  --tone-edge: #ffd34a;
}
.pp-scard[data-tone='3'],
.pp-confirm.multi .pp-choice[data-tone='3'] {
  --tone-a: #e0408f;
  --tone-b: #7a0f52;
  --tone-edge: #ffe08a;
}
.pp-scard[data-tone='4'] {
  --tone-a: #ff4fa8;
  --tone-b: #8a1060;
  --tone-edge: #fff0a0;
}
.pp-scard b,
.pp-confirm.multi .pp-choice b {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55);
}
.pp-scard span,
.pp-confirm.multi .pp-choice span {
  margin: 0;
  font-size: 21px;
  font-weight: 900;
  color: #ffe45a;
  text-shadow:
    0 2px 0 #6a2a00,
    0 0 12px rgba(255, 200, 60, 0.6);
  font-variant-numeric: tabular-nums;
}
.pp-scard small,
.pp-confirm.multi .pp-choice small {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
}
.pp-scard:hover:not(:disabled),
.pp-confirm.multi .pp-choice:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.12);
}
.pp-scard.sel,
.pp-confirm.multi .pp-choice.sel {
  border-color: #fff;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.4), transparent 60%),
    linear-gradient(180deg, var(--tone-a), var(--tone-b));
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.35),
    0 0 0 3px var(--tone-edge),
    0 0 26px color-mix(in srgb, var(--tone-edge) 80%, transparent),
    0 8px 18px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px) scale(1.03);
}
.pp-scard:disabled {
  filter: grayscale(0.6) brightness(0.7);
  cursor: default;
}
.pp-scard-on {
  position: absolute;
  top: -9px;
  right: 8px;
  display: none;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #062a10;
  background: linear-gradient(180deg, #8dff9f, #2fbf4f);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.pp-scard.sel .pp-scard-on {
  display: block;
}
.pp-special-sheet .pp-confirm-bet {
  margin: 0;
}
.pp-confirm.multi {
  width: min(820px, 100%);
}
.pp-confirm.multi .pp-confirm-hero {
  display: none;
}
.pp-confirm.multi .pp-choices {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
@media (max-width: 640px) {
  .pp-special-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .pp-scard,
  .pp-scard.row-start {
    grid-column: auto;
  }
  .pp-scard,
  .pp-confirm.multi .pp-choice {
    min-height: 80px;
  }
  .pp-confirm.multi .pp-choices {
    grid-template-columns: repeat(2, 1fr);
  }
  .pp-scard span,
  .pp-confirm.multi .pp-choice span {
    font-size: 18px;
  }
}
@media (max-height: 460px) {
  .pp-special-sheet {
    padding: 10px 14px 12px;
  }
  .pp-special-sheet .pp-sheet-head {
    margin-bottom: 8px;
  }
  .pp-special-grid {
    gap: 6px;
    margin-bottom: 8px;
  }
  .pp-scard,
  .pp-confirm.multi .pp-choice {
    min-height: 0;
    padding: 6px 6px 7px;
  }
  .pp-scard span,
  .pp-confirm.multi .pp-choice span {
    font-size: 16px;
  }
  .pp-scard small,
  .pp-confirm.multi .pp-choice small {
    font-size: 9px;
  }
  .pp-confirm.multi .pp-choices {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ——— Spin cluster ——— */
.pp-spin-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pp-spin .spin-btn {
  width: var(--pp-spin);
  height: var(--pp-spin);
  margin: 0;
  flex: none;
}
.pp-round {
  width: var(--pp-round);
  height: var(--pp-round);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: calc(var(--pp-round) * 0.55);
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.12s,
    background 0.2s;
}
.pp-round:hover:not(:disabled) {
  background: rgba(40, 40, 40, 0.75);
}
.pp-round:active:not(:disabled) {
  transform: scale(0.92);
}
.pp-round:disabled,
.pp-spin .spin-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.pp-under {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pp-auto {
  min-width: 84px;
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.pp-auto.active {
  border-color: var(--pp-accent);
  background: var(--pp-accent);
  color: #2a1600;
  box-shadow: 0 0 18px color-mix(in srgb, var(--pp-accent) 70%, transparent);
}
.pp-auto:disabled {
  opacity: 0.4;
}
.pp-turbo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.pp-turbo svg {
  width: 18px;
  height: 18px;
  fill: #fff;
  stroke: none;
}
.pp-turbo[aria-pressed='true'] {
  border-color: var(--pp-accent);
  background: var(--pp-accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--pp-accent) 70%, transparent);
}
.pp-turbo[aria-pressed='true'] svg {
  fill: #2a1600;
}

/* ——— Bottom strip ——— */
.pp-bar {
  position: relative;
  z-index: 6;
  flex: none;
  height: calc(var(--pp-bar-h) + env(safe-area-inset-bottom));
  margin: 8px -18px 0;
  padding: 0 16px env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.8));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-variant-numeric: tabular-nums;
}
.pp-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pp-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.pp-ico {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  transition: background 0.2s;
}
.pp-ico:hover {
  background: rgba(255, 255, 255, 0.12);
}
.pp-ico svg,
.pp-menu-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pp-ico .off,
.pp-menu-item .off {
  display: none;
}
.pp-ico[aria-pressed='false'] .on,
.pp-menu-item[aria-pressed='false'] .on {
  display: none;
}
.pp-ico[aria-pressed='false'] .off,
.pp-menu-item[aria-pressed='false'] .off {
  display: inline;
}
.pp-stat {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  white-space: nowrap;
}
.pp-label {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--pp-label);
}
.pp-value {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}
.pp-betbtn {
  padding: 4px 8px;
  margin-left: 6px;
  border-radius: 8px;
}
.pp-betbtn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}
.pp-betbtn:disabled {
  opacity: 0.6;
  cursor: default;
}
.pp-refill {
  width: 22px;
  height: 22px;
  align-self: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  line-height: 1;
}
.pp-msg {
  text-align: center;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.pp-msg b {
  color: var(--pp-accent);
  font-size: 20px;
}
#pp-win.pulse b {
  display: inline-block;
  animation: ppWinPulse 0.6s ease-out;
}
@keyframes ppWinPulse {
  40% {
    transform: scale(1.15);
    color: #fff;
  }
}
.pp-right .mode-badge {
  font-size: 11px;
}

/* ——— Menu popover ——— */
.pp-menu {
  position: fixed;
  left: 12px;
  bottom: calc(var(--pp-bar-h) + env(safe-area-inset-bottom) + 8px);
  z-index: 35;
  min-width: 230px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 14px;
  background: rgba(12, 12, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  animation: ppMenuIn 0.18s ease-out;
}
@keyframes ppMenuIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.pp-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.pp-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pp-menu-item[aria-pressed='true']::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: #2fbf4f;
}
.pp-menu-item[aria-pressed='false']::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

/* ——— Bet menu / buy confirmation ——— */
.pp-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(3px);
  animation: ppFade 0.2s ease;
}
@keyframes ppFade {
  from {
    opacity: 0;
  }
}
.pp-sheet {
  width: min(460px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #1d1d27, #0d0d13);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.75);
  color: #fff;
  animation: ppPop 0.25s ease-out;
}
@keyframes ppPop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}
.pp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--pp-label);
}
.pp-x {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.pp-betrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 16px;
}
.pp-betval {
  min-width: 150px;
  text-align: center;
  font-size: 30px;
  font-weight: 900;
}
.pp-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
.pp-chips button {
  padding: 9px 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pp-chips button:hover {
  background: rgba(255, 255, 255, 0.14);
}
.pp-chips button.sel {
  border-color: var(--pp-accent);
  background: var(--pp-accent);
  color: #2a1600;
}
.pp-maxbet {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd84d, #e59a00);
  color: #2a1600;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.pp-confirm {
  position: relative;
  width: min(420px, 100%);
  overflow: visible;
  padding-top: 22px;
  text-align: center;
  border: 2px solid transparent;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, color-mix(in srgb, var(--pp-accent) 26%, transparent), transparent 70%) padding-box,
    linear-gradient(180deg, #24182f, #0c0a14 70%) padding-box,
    linear-gradient(160deg, #fff3c0, var(--pp-accent) 30%, #7a4a08 55%, var(--pp-accent) 80%, #fff3c0) border-box;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.8),
    0 0 40px color-mix(in srgb, var(--pp-accent) 30%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: ppConfirmIn 0.45s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes ppConfirmIn {
  from {
    transform: scale(0.6) translateY(30px);
    opacity: 0;
  }
}
.pp-confirm-hero {
  position: relative;
  width: 132px;
  height: 132px;
  margin: -6px auto 6px;
  display: grid;
  place-items: center;
}
.pp-confirm-hero.hidden {
  display: none;
}
.pp-confirm-rays {
  position: absolute;
  inset: -46px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--pp-accent) 55%, transparent) 0 7deg, transparent 7deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 22%, transparent 68%);
  mask: radial-gradient(circle, #000 22%, transparent 68%);
  animation: ppRays 12s linear infinite;
  pointer-events: none;
}
.pp-confirm-rays::after {
  content: '';
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 250, 225, 0.7), color-mix(in srgb, var(--pp-accent) 35%, transparent) 50%, transparent 72%);
  animation: ppThrob 1.4s ease-in-out infinite;
}
@keyframes ppRays {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ppThrob {
  50% {
    transform: scale(1.15);
    opacity: 0.7;
  }
}
.pp-confirm-art {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-position: center;
  background-size: 112%;
  box-shadow:
    0 0 0 3px #fff3c0,
    0 0 0 6px color-mix(in srgb, var(--pp-accent) 80%, #000),
    0 0 34px color-mix(in srgb, var(--pp-accent) 80%, transparent),
    0 14px 30px rgba(0, 0, 0, 0.6);
  animation: ppArtFloat 2.6s ease-in-out infinite;
}
@keyframes ppArtFloat {
  50% {
    transform: translateY(-5px) scale(1.03);
  }
}
.pp-confirm-title {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fffbe6 10%, #ffd34a 50%, #c07a10 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(80, 30, 0, 0.9)) drop-shadow(0 0 12px color-mix(in srgb, var(--pp-accent) 55%, transparent));
}
.pp-confirm-bet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 2px 0 12px;
}
.pp-confirm-bet .pp-round {
  width: 42px;
  height: 42px;
  font-size: 24px;
  border: 2px solid color-mix(in srgb, var(--pp-accent) 70%, transparent);
  background: radial-gradient(circle at 40% 30%, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.55));
  color: #fff;
}
.pp-confirm-betval {
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.pp-confirm-betval span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--pp-label);
}
.pp-confirm-betval b {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.pp-confirm-price {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 10px 26px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.2));
  border: 1px solid color-mix(in srgb, var(--pp-accent) 45%, transparent);
  box-shadow: inset 0 0 24px color-mix(in srgb, var(--pp-accent) 14%, transparent);
}
.pp-confirm-x {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #2a1600;
  background: linear-gradient(180deg, #fff1b0, var(--pp-accent));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.pp-confirm-x:empty {
  display: none;
}
.pp-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.pp-choice {
  padding: 12px 10px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-align: center;
}
.pp-choice b {
  display: block;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.pp-choice small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.pp-choice span {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  font-weight: 900;
  color: var(--pp-accent);
}
.pp-choice.sel {
  border-color: var(--pp-accent);
  background: color-mix(in srgb, var(--pp-accent) 16%, transparent);
}
.pp-choice:disabled {
  opacity: 0.45;
}
.pp-confirm-q {
  margin: 16px 0 4px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
}
.pp-confirm-cost {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff 15%, #ffe48a 55%, #e0a020 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 rgba(90, 40, 0, 0.85)) drop-shadow(0 0 18px color-mix(in srgb, var(--pp-accent) 65%, transparent));
}
.pp-confirm-warn {
  min-height: 18px;
  margin-top: 4px;
  font-size: 13px;
  color: #ff7a6b;
}
.pp-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin-top: 16px;
}
.pp-yes,
.pp-no {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.12s;
}
.pp-yes svg,
.pp-no svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: #fff;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pp-yes {
  position: relative;
  background: radial-gradient(circle at 40% 35%, #5fe07a, #178a32);
}
.pp-yes:not(:disabled)::before {
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 3px solid rgba(120, 255, 150, 0.85);
  animation: ppYesRing 1.3s ease-out infinite;
  pointer-events: none;
}
@keyframes ppYesRing {
  from {
    transform: scale(0.9);
    opacity: 1;
  }
  to {
    transform: scale(1.45);
    opacity: 0;
  }
}
.pp-no {
  background: radial-gradient(circle at 40% 35%, #ff7a6b, #b3261b);
}
.pp-yes:hover:not(:disabled),
.pp-no:hover {
  transform: scale(1.07);
}
.pp-yes:disabled {
  filter: grayscale(1);
  opacity: 0.5;
  cursor: default;
}

@media (max-height: 600px) {
  .pp-confirm {
    overflow: auto;
    padding-top: 14px;
  }
  .pp-confirm-hero {
    width: 74px;
    height: 74px;
    margin: 0 auto 4px;
  }
  .pp-confirm-rays {
    inset: -24px;
  }
  .pp-confirm-title {
    font-size: 20px;
  }
  .pp-confirm-q {
    margin: 8px 0 4px;
  }
  .pp-confirm-cost {
    font-size: 34px;
  }
  .pp-confirm-actions {
    margin-top: 10px;
  }
}
@media (max-height: 420px) {
  .pp-confirm {
    padding: 10px 16px 12px;
  }
  .pp-confirm-hero {
    width: 50px;
    height: 50px;
    margin-bottom: 2px;
  }
  .pp-confirm-rays {
    inset: -16px;
  }
  .pp-confirm-title {
    font-size: 17px;
  }
  .pp-confirm-q {
    margin: 4px 0 4px;
    font-size: 13px;
  }
  .pp-confirm-price {
    padding: 6px 18px 8px;
    gap: 4px;
  }
  .pp-confirm-cost {
    font-size: 28px;
  }
  .pp-confirm-hero {
    display: none;
  }
  .pp-confirm-bet {
    margin: 0 0 6px;
  }
  .pp-confirm-bet .pp-round {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
  .pp-confirm-betval b {
    font-size: 18px;
  }
  .pp-confirm-warn {
    min-height: 0;
  }
  .pp-confirm-actions {
    margin-top: 8px;
  }
  .pp-yes,
  .pp-no {
    width: 54px;
    height: 54px;
  }
}

/* ——— Stacked layout: portrait phones and narrow windows ——— */
@media (max-width: 699px), (max-aspect-ratio: 5/4) {
  :root {
    --pp-spin: clamp(76px, 11vh, 104px);
    --pp-round: clamp(38px, 5vh, 48px);
  }
  .stage {
    padding-inline: 0;
  }
  .pp-side,
  .pp-spin {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: auto;
    transform: none;
  }
  .pp-side {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 8px;
    margin: 4px 0 6px;
  }
  .pp-buy,
  .pp-ante {
    width: auto;
    min-width: 0;
    flex-direction: row;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    gap: 8px;
  }
  .pp-buy-art {
    width: 38px;
  }
  .pp-buy-title br {
    display: none;
  }
  .pp-buy-title {
    font-size: 12px;
  }
  .pp-buy-price {
    font-size: 15px;
  }
  .pp-ante {
    padding: 6px 12px;
  }
  .pp-ante-title br {
    display: none;
  }
  .pp-spin {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
    margin-top: 8px;
  }
  .pp-spin > .pp-turbo {
    order: 0;
  }
  .pp-spin-row {
    order: 1;
  }
  .pp-under {
    order: 2;
  }
  .pp-bar {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    /* full-bleed whatever the game's own side padding is */
    margin-inline: calc(50% - 50vw);
    padding: 4px 10px calc(4px + env(safe-area-inset-bottom));
    row-gap: 0;
  }
  .pp-msg {
    grid-column: 1 / -1;
    grid-row: 1;
    font-size: 13px;
  }
  .pp-msg b {
    font-size: 15px;
  }
  .pp-left {
    grid-row: 2;
  }
  .pp-right {
    grid-row: 2;
  }
  .pp-stat {
    margin-left: 4px;
  }
  .pp-label {
    font-size: 11px;
  }
  .pp-value {
    font-size: 13px;
  }
  .pp-ico {
    width: 30px;
    height: 30px;
  }
  .pp-ico svg {
    width: 19px;
    height: 19px;
  }
}

@media (max-width: 520px) {
  .pp-right .mode-badge {
    display: none;
  }
}

@media (max-width: 380px) {
  .pp-stat {
    flex-direction: column;
    gap: 0;
    line-height: 1.1;
  }
}

/* Short landscape phones: keep the side columns but shrink them */
@media (max-height: 460px) and (min-aspect-ratio: 5/4) {
  :root {
    --pp-bar-h: 36px;
    --pp-spin: 72px;
    --pp-round: 34px;
  }
  /* centre the columns on the area above the bar, not on the whole screen */
  .pp-side,
  .pp-spin {
    top: calc(50% - (var(--pp-bar-h) + 8px) / 2);
    max-height: calc(100% - var(--pp-bar-h) - 16px);
    gap: 6px;
  }
  .pp-buy-art {
    width: 40%;
  }
  .pp-buy {
    padding: 6px;
    gap: 3px;
  }
  .pp-buy-title {
    font-size: 11px;
  }
  .pp-buy-price {
    font-size: 14px;
  }
  .pp-ante {
    padding: 6px 8px 8px;
    gap: 3px;
  }
  .pp-bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .pp-label {
    font-size: 12px;
  }
  .pp-value,
  .pp-msg {
    font-size: 14px;
  }
  .pp-msg {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pp-msg b {
    font-size: 16px;
  }
}
