/* Plinko scenes. The canvas flanks and payout pockets share the same measured width. */
html[data-ludik-theme] #content[data-game="plinko"] {
  --plinko-gutter: clamp(15px, 2.5vw, 38px);
  --plinko-outline: #1c130f;
  --plinko-lightning: #ffdf25;
  --plinko-board-width: min(96svh, 50rem);
  --plinko-paper-edge: polygon(0.8% 1%, 7% 1.5%, 14% 0%, 24% 1.7%, 31% 0.5%, 41% 1.4%, 50% 0%, 65% 1.8%, 75% 0.5%, 84% 1.6%, 96% 0%, 99% 2%, 100% 9%, 98% 16%, 100% 25%, 98.5% 33%, 100% 43%, 98% 50%, 99.5% 61%, 98.7% 72%, 100% 80%, 98% 87%, 100% 94%, 98% 98.5%, 88% 100%, 77% 98.7%, 64% 100%, 54% 98.3%, 48% 100%, 37% 99%, 29% 100%, 18% 98.7%, 8% 100%, 1% 98%, 1.8% 91%, 0% 82%, 1.4% 74%, 0% 61%, 1.6% 53%, 0% 45%, 1.5% 36%, 0% 27%, 2% 17%, 0% 9%);
  position: relative;
  isolation: isolate;
  width: min(100%, 1500px);
  padding: clamp(12px, 2vw, 26px) var(--plinko-gutter) clamp(20px, 3.5vw, 45px);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;

  & > .page-head { margin-bottom: 10px; }
  & > .page-head h1 {
    padding: .17em .27em .20em .22em;
    font-size: clamp(3rem, 6.5vw, 6.3rem);
    letter-spacing: -.03em;
    transform: rotate(-6deg) skew(-7deg);
  }
  & > .page-head h1::before {
    inset: -.01em -.035em -.05em;
    clip-path: polygon(0 9%, 14% 10%, 15% 3%, 24% 8%, 34% 1%, 39% 6%, 51% 0%, 58% 4%, 69% 1%, 72% 5%, 84% 1%, 88% 7%, 100% 3%, 97% 24%, 100% 36%, 98% 45%, 100% 64%, 96% 77%, 100% 90%, 90% 92%, 85% 100%, 76% 94%, 67% 99%, 59% 93%, 50% 100%, 41% 94%, 36% 100%, 25% 95%, 17% 100%, 9% 95%, 0 99%, 3% 79%, 0 71%, 3% 55%, 0 39%, 3% 27%);
  }
  & > .page-head p {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
  }
  & .mini-game-tools .button { min-height: 34px; border-radius: 4px; }
  & .plinko-layout {
    --lg-console-width: minmax(240px, 29%);
    gap: clamp(15px, 2.2vw, 36px);
  }
  & .stage.stage-plinko {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }
  & .stage.stage-plinko::before,
  & .stage.stage-plinko::after {
    z-index: -1;
    inline-size: clamp(36px, 7.2cqw, 104px);
    block-size: auto;
    aspect-ratio: .75;
    background: var(--plinko-lightning);
    clip-path: polygon(91% 0, 20% 51%, 51% 50%, 5% 100%, 82% 40%, 52% 38%);
    opacity: 1;
  }
  & .stage.stage-plinko::before { inset: 41% auto auto 2.5%; transform: rotate(17deg); }
  & .stage.stage-plinko::after { inset: 21% 3% auto auto; transform: rotate(12deg) scale(.88); }
  & .plinko-board {
    position: relative;
    max-width: var(--plinko-board-width);
    padding: 0 clamp(12px, 2cqw, 24px) 12px;
  }
  & .stage.stage-plinko .plinko-board canvas { aspect-ratio: 1.28; }
  & .plinko-bins {
    position: relative;
    margin: -8px clamp(10px, 2.14cqw, 25px) 0;
    border: solid var(--plinko-outline);
    border-width: 0 4px 5px;
    border-radius: 0 0 11px 11px;
    background: var(--plinko-outline);
    box-shadow: 0 4px 0 #100b08, 0 8px 15px #14040851;
  }
  & .plinko-bin {
    min-height: clamp(27px, 5cqw, 48px);
    padding-inline: 0;
    border-inline: 0;
    border-right: 2px solid #21150f;
    background: linear-gradient(#ffe75d, #ffd025 70%, #eea714);
    box-shadow: inset 0 2px #fff4aade, inset 0 -2px #26120e42;
    color: #1b140e;
    font: 760 clamp(10px, 2.02cqw, 16px)/1 var(--lg-display);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.018em;
  }
  & .plinko-bin:nth-child(odd) { background: linear-gradient(#ff80be, #f43b97 68%, #c8276c); }
  & .plinko-bin[data-tier="none"] { background: var(--lg-paper); }
  & .plinko-bin:last-child { border-right: 0; }
  & .plinko-bin::before {
    inset: 0 auto auto 0;
    z-index: 1;
    width: 100%;
    height: 3px;
    background: #3c181f57;
    border-radius: 0;
  }
  & .plinko-bin.plinko-landed {
    z-index: 1;
    background: #fff6a0;
    box-shadow: inset 0 0 0 2px #fff5d7, 0 0 16px #ffe7a6;
    color: #20140a;
  }
  & .plinko-bin-detail { margin: 10px clamp(10px, 2.14cqw, 25px) 0; }
  & #game-sidebar { padding: clamp(12px, 1.55vw, 22px); }
  & #game-sidebar :is(.form, .guest-fields) { gap: 9px; }
  & #game-sidebar .guest-fields { margin: 0; }
  & #game-sidebar .guest-fields:disabled :is(input,select) { opacity: .82; }
  & #game-sidebar .form label {
    gap: 3px;
    color: var(--lg-text);
    font-size: .88rem;
    font-weight: 750;
    line-height: 1.3;
  }
  & #game-sidebar :is(input[name="stake"],select[name="rows"],select[name="risk"]) {
    min-height: 42px;
    border-radius: 5px;
    color: var(--lg-text);
    font-size: 1.05rem;
  }
  & .plinko-stepper {
    display: grid;
    isolation: isolate;
    grid-template-columns: 40px minmax(0,1fr) 40px;
  }
  & .plinko-stepper label { grid-area: 1 / 1 / 2 / -1; }
  & .plinko-stepper :is(input,select) {
    appearance: textfield;
    padding-inline: 43px;
    text-align: center;
    text-align-last: center;
  }
  & .plinko-stepper select { appearance: none; }
  & .plinko-stepper input::-webkit-inner-spin-button,
  & .plinko-stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
  & .plinko-step {
    z-index: 1;
    grid-area: 1 / 1 / 2 / 2;
    align-self: end;
    margin: 0 2px 2px;
    height: 38px;
    padding: 0;
    font: 800 1.35rem/1 var(--font-interface, system-ui, sans-serif);
    border: 0;
    border-inline-end: 1px solid currentColor;
    background: #1624;
    color: var(--lg-text);
    text-align: center;
  }
  & .plinko-step[data-direction="1"] {
    grid-column: 3;
    border-inline-start: 1px solid currentColor;
    border-inline-end: 0;
  }
  & .plinko-step:hover:not(:disabled) { background: var(--lg-yellow); color: #1a130d; }
  & .plinko-step:focus-visible { outline: 3px solid var(--lg-accent); outline-offset: -3px; }
  & .plinko-step:disabled { opacity: .46; }
  & #game-sidebar .auto-mode button { font-size: clamp(.97rem, 1.5vw, 1.18rem); }
  & #game-sidebar .auto-mode button:disabled[aria-pressed="true"] { opacity: .88; }
  & #game-sidebar .auto-mode button:disabled:not([aria-pressed="true"]) { opacity: .66; }
  & .plinko-layout #game-sidebar .button:is(.play-primary, [data-action="auth"]) {
    flex: 1 1 9rem;
    min-height: clamp(49px, 5vw, 68px);
    padding: .38em .42em;
    text-align: center;
    font: 900 clamp(1.42rem, 2.6vw, 2.5rem)/1 var(--lg-display);
    letter-spacing: -.015em;
  }
  & #game-sidebar .form > .notice {
    padding: 4px 0 0;
    border: 0;
    background: transparent;
    color: var(--lg-muted);
    font-size: .84rem;
  }
  & #game-sidebar #preview {
    font-size: .83rem;
    line-height: 1.4;
  }
  & #game-sidebar #preview .notice { margin: 0; padding: 6px 8px; font-size: inherit; }
  & #game-sidebar details { margin: 0; }
  & #game-sidebar details > summary { font-size: .88rem; padding-block: 2px; }
}

html[data-ludik-theme="comic"] #content[data-game="plinko"] {
  /* Both lettering stickers are separate silhouettes sampled from the PF01 artwork. */
  --pf-unit: min(calc(100vw / 1672), 1px);
  --pf-art: url("/redesign-art/plinko-pf01.png");
  --pf-title-edge: polygon(
    83.6% 0%, 87.6% 4.4%, 100% 0%, 95.5% 18.5%, 98.7% 23.4%, 95.5% 35.2%, 98.2% 43.6%,
    95.5% 52.9%, 98.5% 63%, 89.1% 66.1%, 85.6% 75.3%, 74.8% 73.1%, 67.4% 81.5%, 58.6% 78%,
    49.2% 88.1%, 40.7% 85%, 25.3% 98.7%, 15.4% 91.6%, 2.5% 100%, 5.3% 80.6%, 0% 79.3%,
    3.8% 61.7%, .3% 49.8%, 3.8% 37.4%, 1.3% 22.9%, 14.9% 19.8%, 16.2% 14.5%, 26.8% 15.9%,
    35.4% 8.8%, 42.2% 11.5%, 51.5% 4.9%, 59.9% 6.6%, 68.7% .9%, 75.3% 4.9%
  );
  --pf-history-edge: polygon(
    83.2% 0%, 96.9% 2.5%, 96.9% 17.2%, 100% 23%, 95.4% 44.3%, 95.4% 69.7%, 85.5% 75.4%,
    72.9% 75.4%, 65.7% 85.3%, 51.9% 82.8%, 42.8% 93.4%, 27.5% 90.2%, 13% 100%, 7.3% 99.2%,
    6.5% 91.8%, 0% 88.5%, 3.4% 58.2%, 0% 41%, 4.2% 13.9%, 13.4% 12.3%, 21.4% 8.2%,
    24% 9.8%, 28.6% 13.9%, 37.8% 7.4%, 40.8% 7.4%, 48.1% 12.3%, 60.7% 5.7%, 69.5% 9%
  );
  --plinko-paper-edge: polygon(
    7.7% .2%, 17.2% 2%, 24.1% .2%, 30.8% 1.6%, 37.7% 0%, 45.7% 1.6%, 53% .4%, 58% 1.8%,
    65.1% .4%, 72% 2%, 78.9% .2%, 87.5% 1.8%, 93.3% .6%, 98.5% 3.3%, 99.1% 12.4%,
    98% 18.5%, 99.4% 25.9%, 98.1% 32.8%, 99.8% 41.1%, 98.3% 48.9%, 99.8% 57.2%,
    98.3% 67.8%, 99.6% 73.7%, 98.7% 81.9%, 100% 88.4%, 98.7% 96.5%, 97.4% 98%,
    93.5% 98%, 86.9% 100%, 77.1% 97.8%, 70% 99.6%, 62.5% 98%, 54.3% 99.8%, 48.3% 98.2%,
    40.1% 99.8%, 31.9% 98%, 25.9% 99.8%, 17.4% 98.2%, 9.9% 100%, 2.1% 98%, 1.5% 96.1%,
    .9% 86.4%, 1.9% 81.1%, .2% 71.5%, 1.7% 64.4%, .2% 57.2%, 1.5% 50.3%, 0% 42.4%,
    1.7% 35.2%, .2% 26.9%, 1.7% 20%, .2% 12.4%, 1.7% 2.4%
  );
  --plinko-outline: #241510;
  --plinko-top: clamp(8px, 1vw, 15px);
  --plinko-board-width: min(100%, 58rem);
  --plinko-cup-height: clamp(37px, 5.25vw, 86px);
  --plinko-mint: #95ecab;
  --plinko-pink: #fb278c;
  --plinko-cream: #ffedc4;
  --plinko-ink: #140d09;
  /* 24 × 24 staggered PF01 print cells and seamless paper grain. */
  --pf-print-scale: 1;
  width: min(100%, 1672px);
  padding-block-start: var(--plinko-top);
  background: #fb0531 url("/redesign-art/plinko-pf01-paper.webp") 3px 1px /
    calc(410.4px * var(--pf-print-scale)) calc(427.2px * var(--pf-print-scale)) repeat;

  & .plinko-layout > .page-head {
    grid-area: title;
    margin: 0;
  }
  & .plinko-layout > .page-head h1 {
    display: block;
    inline-size: clamp(118px, 31vw, 235px);
    aspect-ratio: 396 / 227;
    padding: 0;
    color: transparent;
    font-size: 0;
    text-shadow: none;
    clip-path: var(--pf-title-edge);
    transform: none;
    background: var(--pf-art) 3.9969% 12.1849% / 422.2222% 414.5374% no-repeat;
  }
  & .plinko-layout > .page-head h1::before, & .plinko-layout > .page-head h1::after { display: none; }
  & .plinko-comic-form { gap: 0; }
  & .plinko-layout {
    --lg-console-width: minmax(275px, 32.5%);
    --plinko-layout-gap: clamp(15px, 2.3vw, 34px);
    align-content: start;
    min-block-size: calc(100svh - var(--header-height, 58px) - var(--plinko-top));
    row-gap: var(--plinko-layout-gap);
  }
  & .stage.stage-plinko { isolation: isolate; }
  & .plinko-board {
    padding: 0 clamp(13px, 2.4cqw, 34px) clamp(6px, 1.5cqw, 15px);
  }
  & .stage.stage-plinko #stage-canvas { aspect-ratio: 1.55; }
  & .plinko-bins {
    margin-inline: clamp(10px, 2.65cqw, 30px);
    border-color: #201410;
    box-shadow: 0 3px #f3e3c4, 0 6px #17110e;
  }
  & .plinko-bin { min-height: var(--plinko-cup-height); }
  & .plinko-bin-caption {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    inline-size: 100%;
    min-inline-size: 0;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
  }
  & .plinko-bin-caption[data-positioned] {
    position: absolute;
    inset: var(--plinko-caption-y) auto auto var(--plinko-caption-x);
    inline-size: var(--plinko-caption-width);
    block-size: var(--plinko-caption-height);
    transform: translate(-50%, -50%);
  }
  & .plinko-bin-caption > span {
    inline-size: max-content;
    transform: scale(var(--plinko-caption-scale, 1), var(--plinko-caption-scale-y, 1)) skewX(-7deg);
  }
  & .plinko-bins:not(:has(.plinko-bin:nth-child(11))) .plinko-bin {
    font-size: clamp(9px, 2.25cqw, 20px);
  }
  & .plinko-comic-scene {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    inline-size: 100%;
    block-size: 100%;
    pointer-events: none;
  }
  & .stage-plinko[data-plinko-renderer="webgl"] {
    &::before, &::after { display: none; }
    & #stage-canvas { opacity: 0; }
    & .plinko-bins {
      z-index: 2;
      border-color: transparent;
      background: transparent;
      box-shadow: none;
    }
    & .plinko-bin {
      overflow: visible;
      padding-block-start: calc(var(--plinko-cup-height) * .39);
      border-color: transparent;
      background: transparent;
      box-shadow: none;
      color: var(--plinko-ink);
      font-style: italic;
    }
    & .plinko-bin::before { display: none; }
    & .plinko-bin.plinko-landed { transform: none; }
    & .plinko-bin button {
      min-height: 0;
      justify-self: stretch;
    }
    & .plinko-bin button:hover:not(:disabled) { background: transparent; }
    & .plinko-bin-detail { position: relative; z-index: 2; }
  }
  & #game-sidebar {
    --plinko-label-width: 29%;
    --plinko-step-width: clamp(26px, 3vw, 48px);
    --plinko-control-height: clamp(38px, 3.1vw, 51px);
    --plinko-control-font-size: clamp(.96rem, 1.55vw, 1.28rem);
    position: relative;
    isolation: isolate;
    gap: clamp(10px, 1.1vw, 17px);
    padding: clamp(17px, 2.1vw, 34px);
    color: var(--plinko-ink);
    border: none;
    background: transparent;
    box-shadow: none;
  }
  & #game-sidebar::before,
  & #game-sidebar::after {
    position: absolute;
    inset: -3px;
    z-index: -2;
    content: "";
    background: #221512;
    clip-path: var(--plinko-paper-edge);
    pointer-events: none;
  }
  & #game-sidebar::after {
    z-index: -1;
    inset: 0;
    background: linear-gradient(#fff0cc25, #fff0cc25), url("/redesign-art/paper.webp") center / 480px auto, var(--plinko-cream);
  }
  & #game-sidebar .auto-mode {
    gap: 0;
    padding: 0;
    border: 2px solid var(--plinko-ink);
    border-radius: 7px;
    background: var(--plinko-cream);
    transform: skew(-5deg);
  }
  & #game-sidebar .auto-mode button {
    min-height: clamp(40px, 3.9vw, 57px);
    border: 0;
    border-radius: 4px;
    color: var(--plinko-ink);
    font: italic 850 clamp(1rem, 1.84vw, 1.7rem)/1 var(--lg-display);
  }
  & #game-sidebar .auto-mode button + button { border-inline-start: 2px solid var(--plinko-ink); }
  & #game-sidebar .auto-mode button[aria-pressed="true"] { background: var(--plinko-pink); }
  & #game-sidebar .auto-mode button:hover:not(:disabled, [aria-pressed="true"]) { background: #ffeb92; }
  & #game-sidebar .plinko-stepper {
    grid-template-columns: var(--plinko-label-width) var(--plinko-step-width) minmax(0, 1fr) var(--plinko-step-width);
  }
  & #game-sidebar label:has(> select[name="rows"]),
  & :is(.plinko-stake-field, .plinko-risk-field) {
    display: grid;
    grid-template-columns: var(--plinko-label-width) minmax(0, 1fr);
    gap: 0;
    align-items: center;
    color: var(--plinko-ink);
    font-size: clamp(.86rem, 1.45vw, 1.22rem);
    font-weight: 820;
  }
  & :is(.plinko-stake-field, .plinko-risk-field) {
    grid-area: 1 / 1 / 2 / -1;
  }
  & #game-sidebar label.plinko-stake-caption {
    display: block;
    grid-area: auto;
    font-size: clamp(.86rem, 1.45vw, 1.22rem);
    font-weight: 820;
  }
  & .plinko-stake-entry { min-inline-size: 0; }
  & #game-sidebar :is(input[name="stake"], select[name="rows"], .plinko-risk-value) {
    inline-size: 100%;
    min-inline-size: 0;
    block-size: var(--plinko-control-height);
    min-block-size: var(--plinko-control-height);
    padding-block: 0;
    color: var(--plinko-ink);
    border: 2px solid var(--plinko-ink);
    border-radius: 5px;
    background: var(--plinko-mint);
    font-size: var(--plinko-control-font-size);
    text-align: center;
    text-align-last: center;
  }
  & #game-sidebar input[name="autoCount"] {
    min-height: var(--plinko-control-height);
    background: var(--plinko-mint);
    font-size: clamp(.96rem, 1.55vw, 1.28rem);
  }
  & #game-sidebar .plinko-stepper :is(input, select) { padding-inline: var(--plinko-step-width); }
  & #game-sidebar input[name="stake"][aria-invalid] { background: #ffd4e0; }
  & .plinko-risk-value {
    display: grid;
    place-items: center;
    padding-inline: var(--plinko-step-width);
  }
  & #game-sidebar .plinko-step {
    grid-column: 2;
    align-self: center;
    height: calc(var(--plinko-control-height) - 4px);
    margin: 0 2px;
    background: transparent;
    font-size: clamp(1.08rem, 2vw, 1.55rem);
  }
  & #game-sidebar .plinko-step[data-direction="1"] { grid-column: 4; }
  & #game-sidebar .plinko-step:hover:not(:disabled) { background: #d0f8cb; }
  & #game-sidebar .plinko-step[data-plinko-scale] {
    padding: 0;
    font: 850 clamp(.78rem, 1.18vw, 1.1rem)/1 var(--lg-display);
    font-variant-numeric: tabular-nums;
  }
  & #game-sidebar .plinko-risk-choices {
    min-inline-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }
  & #game-sidebar .plinko-risk-choices legend,
  & #game-sidebar .plinko-rows-control > label {
    color: var(--plinko-ink);
    font-size: clamp(.86rem, 1.45vw, 1.22rem);
    font-weight: 820;
  }
  & #game-sidebar .plinko-risk-choices legend { margin-block-end: .4rem; padding: 0; }
  & #game-sidebar .plinko-risk-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  & #game-sidebar .plinko-risk-buttons button {
    min-block-size: var(--plinko-control-height);
    min-inline-size: 0;
    padding: 0 .18rem;
    border: 2px solid var(--plinko-ink);
    border-radius: 5px;
    background: var(--plinko-mint);
    color: var(--plinko-ink);
    font: 850 clamp(.72rem, 1.15vw, 1.05rem)/1 var(--lg-display);
  }
  & #game-sidebar .plinko-risk-buttons button[aria-pressed="true"] { background: var(--plinko-pink); }
  & #game-sidebar .plinko-risk-buttons button:hover:not(:disabled, [aria-pressed="true"]) { background: #d0f8cb; }
  & #game-sidebar .plinko-rows-control {
    display: grid;
    grid-template-columns: var(--plinko-label-width) minmax(0, 1fr) 2.5ch;
    align-items: center;
    gap: .35rem;
    min-block-size: var(--plinko-control-height);
  }
  & #game-sidebar .plinko-rows-control input {
    min-inline-size: 0;
    inline-size: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: #991343;
    cursor: ew-resize;
  }
  & #game-sidebar [data-plinko-rows-value] {
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    text-align: end;
  }
  & #game-sidebar .plinko-toggles {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6em;
    color: var(--plinko-ink);
    font-size: clamp(.86rem, 1.45vw, 1.22rem);
    font-weight: 820;
  }
  & #game-sidebar .plinko-toggles > label {
    display: inline-flex;
    align-items: center;
    gap: .46em;
    min-block-size: 36px;
    color: inherit;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
  }
  & #game-sidebar .plinko-volume-slot {
    min-inline-size: 0;
    flex: 1;
  }
  & #game-sidebar .plinko-volume-slot .game-volume {
    inline-size: 100%;
    min-block-size: 36px;
    border-radius: 5px;
  }
  & :is(.plinko-sound-label,.plinko-turbo-label) {
    display: inline-flex;
    align-items: center;
    gap: .33em;
  }
  & .plinko-sound-label::before {
    inline-size: 1.3em;
    block-size: 1.1em;
    background: var(--plinko-ink);
    clip-path: polygon(0 34%, 24% 34%, 53% 6%, 53% 94%, 24% 66%, 0 66%, 0 34%, 64% 31%, 70% 35%, 76% 51%, 70% 67%, 64% 71%, 64% 60%, 67% 51%, 64% 42%, 64% 31%, 79% 17%, 88% 27%, 94% 48%, 89% 73%, 79% 83%, 79% 73%, 85% 51%, 79% 28%, 79% 17%);
    content: "";
  }
  & .plinko-turbo-label::before {
    inline-size: .92em;
    block-size: 1.04em;
    background: currentColor;
    clip-path: polygon(57% 0, 98% 0, 65% 42%, 94% 42%, 19% 100%, 36% 55%, 4% 55%);
    content: "";
  }
  & #game-sidebar .plinko-toggles input[type="checkbox"] {
    appearance: none;
    inline-size: 2.6em;
    block-size: 1.5em;
    flex: none;
    margin: 0;
    border: 2px solid var(--plinko-ink);
    border-radius: 100vmax;
    background: radial-gradient(circle at 25% 50%, #fff0ce 0 .51em, var(--plinko-ink) .53em .59em, transparent .61em), #e8d3ae;
    cursor: pointer;
  }
  & #game-sidebar .plinko-toggles input:checked {
    background: radial-gradient(circle at 75% 50%, #fff0ce 0 .51em, var(--plinko-ink) .53em .59em, transparent .61em), #24ca76;
  }
  & #game-sidebar .plinko-turbo input:checked {
    background: radial-gradient(circle at 75% 50%, #fff0ce 0 .51em, var(--plinko-ink) .53em .59em, transparent .61em), var(--plinko-pink);
  }
  & #game-sidebar .plinko-toggles input:focus-visible { outline: 3px solid #ba1665; outline-offset: 2px; }
  & #game-sidebar .guest-fields { gap: inherit; }
  & #game-sidebar > .notice {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: .86rem;
  }
  & #game-sidebar .auto-series-fields {
    padding: 0;
    border: 0;
    background: transparent;
  }
  & #game-sidebar .auto-unlimited {
    color: var(--plinko-ink);
    border-color: var(--plinko-ink);
    background: var(--plinko-cream);
  }
  & #game-sidebar .plinko-auto-status {
    container: plinko-auto-status / inline-size;
    display: grid;
    min-inline-size: 0;
    color: var(--plinko-ink);
    border: 2px solid var(--plinko-ink);
    border-radius: 3px;
    background: var(--plinko-cream) url("/redesign-art/paper.webp") center / 460px auto;
    box-shadow: 2px 3px var(--plinko-ink);
  }
  & .plinko-auto-phase {
    display: flex;
    align-items: center;
    min-block-size: 35px;
    padding: .42rem .58rem;
    color: #fff1ce;
    border-inline-start: .36rem solid #ffe322;
    background: var(--plinko-ink);
    font: italic 850 clamp(.99rem, 1.42vw, 1.22rem)/1.2 var(--lg-display);
  }
  & .plinko-auto-status[data-plinko-auto-phase="running"] .plinko-auto-phase { border-inline-start-color: var(--plinko-mint); }
  & .plinko-auto-status[data-plinko-auto-phase="stopping"] .plinko-auto-phase { border-inline-start-color: var(--plinko-pink); }
  & .plinko-auto-metrics {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.05fr) minmax(0, 1.1fr);
    padding: .36rem .43rem;
  }
  & .plinko-auto-metric {
    display: grid;
    grid-template-rows: 2.2em 1.4rem;
    align-items: start;
    min-inline-size: 0;
    padding-inline: .38rem;
    font: 800 .77rem/1.1 var(--font-interface, system-ui, sans-serif);
  }
  & .plinko-auto-metric + .plinko-auto-metric { border-inline-start: 1px solid #25170f56; }
  & .plinko-auto-metric strong {
    align-self: stretch;
    min-inline-size: 0;
    min-block-size: 0;
    overflow: hidden;
    font-size: clamp(.88rem, 1.33vw, 1.06rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.4rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  & .plinko-auto-status[data-plinko-auto-result="positive"] [data-plinko-auto-field="result"] { color: #165336; }
  & .plinko-auto-status[data-plinko-auto-result="negative"] [data-plinko-auto-field="result"] { color: #9a1248; }
  & .plinko-auto-metric [data-plinko-auto-long] {
    display: grid;
    align-items: center;
    font-size: .66rem;
    line-height: 1.05;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  @container plinko-auto-status (max-width: 310px) {
    & .plinko-auto-metrics { grid-template-columns: minmax(0, 1fr); }
    & .plinko-auto-metric {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
      grid-template-rows: 1.8rem;
      align-items: center;
      gap: .5rem;
    }
    & .plinko-auto-metric + .plinko-auto-metric {
      border-block-start: 1px solid #25170f56;
      border-inline-start: 0;
    }
    & .plinko-auto-metric strong:not([data-plinko-auto-long]) { line-height: 1.8rem; }
  }
  & .plinko-layout #game-sidebar .button:is(.play-primary, [data-action="auth"], .auto-stop-button) {
    min-height: clamp(49px, 5.2vw, 79px);
    margin: 3px 4px 6px 2px;
    border: 2px solid var(--plinko-ink);
    border-radius: 7px;
    background: #ffdf04;
    box-shadow: 4px 6px var(--plinko-ink);
    font-style: italic;
    transform: rotate(-.8deg) skew(-5deg);
  }
  & .plinko-layout #game-sidebar .auto-stop-button {
    color: var(--plinko-ink);
    background: var(--plinko-pink);
    font: italic 860 clamp(1.42rem, 2.6vw, 2.5rem)/1 var(--lg-display);
  }
  & .plinko-layout #game-sidebar .auto-stop-button:hover:not(:disabled) { background: #ff65aa; }
  & .plinko-layout #game-sidebar .button:is(.play-primary, [data-action="auth"], .auto-stop-button):active:not(:disabled) {
    transform: skew(-5deg) translate(3px, 3px);
    box-shadow: 1px 2px #17110e;
  }
  & .plinko-layout #game-sidebar .play-primary:not([data-auto-start]) {
    font-size: clamp(1.5rem, 3.1vw, 2.8rem);
  }
  & #plinko-feedback:not([hidden]) {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px clamp(10px, 2vw, 30px);
    align-items: center;
    margin: 0;
    padding: 0 clamp(4px, 3vw, 42px) 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  & .plinko-history-title {
    inline-size: clamp(105px, 23vw, 262px);
    aspect-ratio: 262 / 122;
    appearance: none;
    border: 0;
    margin: 0;
    padding: 0;
    color: transparent;
    cursor: pointer;
    font-size: 0;
    clip-path: var(--pf-history-edge);
    background: var(--pf-art) 8.1560% 95.7265% / 638.1679% 771.3115% no-repeat;
  }
  & .plinko-history-title:is(:hover,:focus-visible) { filter: brightness(1.1); }
  & .plinko-history-title:focus-visible { background-color: #fff; outline: 3px solid #fff; outline-offset: -8px; }
  & .plinko-history-empty,
  & #plinko-status:not(:empty) {
    width: fit-content;
    margin: 0;
    padding: .45em .7em;
    color: var(--plinko-ink);
    background: var(--plinko-cream);
    border: 2px solid var(--plinko-ink);
    border-radius: 5px;
    font-weight: 720;
  }
  & #plinko-feedback > :is(output, #plinko-recovery, [data-action="plinko-refresh-terms"], .plinko-paperwork) { grid-column: 1 / -1; }
  & #plinko-status:not(:empty), & #plinko-recovery { grid-row: auto; }
  & #plinko-recent:not(:empty) {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    grid-auto-flow: column;
    grid-auto-columns: max(7.2rem, calc((100% - 4 * 11px) / 5));
    gap: 11px;
    margin: -3px -4px -8px;
    padding: 10px 14px 16px 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  & #plinko-recent::-webkit-scrollbar { display: none; }
  & #plinko-recent li {
    --pf-rear-x: 5px;
    --pf-rear-y: 7px;
    --pf-copy-angle: -5deg;
    position: relative;
    isolation: isolate;
    min-width: 0;
  }
  /* The front silhouette, crop, and blank paper patch are measured from PF01. */
  & #plinko-recent li:nth-child(5n + 1) {
    --pf-card-w: 228;
    --pf-card-h: 125;
    --pf-card-x: 0;
    --pf-card-y: 2;
    --pf-sticker: polygon(95.6% 0,99.6% 4.8%,100% 16%,98.7% 17.6%,93.4% 75.2%,90.4% 78.4%,89.9% 81.6%,2.6% 100%,1.8% 100%,2.2% 96%,0 99.2%,.4% 82.4%,5.7% 31.2%,6.6% 26.4%,9.2% 22.4%,15.8% 16.8%);
    --pf-sticker-sample: 26.3850% 95.8333% / 733.3333% 752.8000%;
    --pf-paper-inset: 12.8% 9.21% 5.6% 20.61%;
    --pf-paper-sample: 24.2629% 93.3941% / 3800% 1493.6508%;
  }
  & #plinko-recent li:nth-child(5n + 2) {
    --pf-card-w: 239;
    --pf-card-h: 125;
    --pf-card-x: -12;
    --pf-card-y: 1;
    --pf-sticker: polygon(94.6% 0,97.9% 0,98.7% 3.2%,99.6% 3.2%,100% 16%,99.6% 28%,95.4% 72.8%,92.1% 80.8%,87% 83.2%,5.4% 100%,2.5% 98.4%,1.7% 96%,1.7% 91.2%,.4% 89.6%,0 85.6%,1.3% 79.2%,5.9% 28%,9.2% 22.4%,9.6% 19.2%,43.9% 10.4%);
    --pf-sticker-sample: 41.4515% 95.7108% / 699.5816% 752.8000%;
    --pf-paper-inset: 12.8% 8.79% 5.6% 22.18%;
    --pf-paper-sample: 47.7887% 89.6355% / 3800% 1493.6508%;
  }
  & #plinko-recent li:nth-child(5n + 3) {
    --pf-card-w: 239;
    --pf-card-h: 126;
    --pf-card-x: -8;
    --pf-card-y: 1;
    --pf-sticker: polygon(97.9% 0,99.6% 0,99.2% 9.5%,100% 10.3%,98.3% 33.3%,94.1% 73.8%,91.6% 77%,90% 81.8%,42.7% 90.5%,2.1% 100%,.8% 99.2%,0 98.4%,0 81.8%,6.3% 19.8%,88.3% 1.6%,96.7% .8%,98.7% 3.2%);
    --pf-sticker-sample: 57.4320% 95.8282% / 699.5816% 746.8254%;
    --pf-paper-inset: 12.7% 8.79% 5.56% 17.99%;
    --pf-paper-sample: 51.4128% 92.0904% / 3800% 1680.3571%;
  }
  & #plinko-recent li:nth-child(5n + 4) {
    --pf-card-w: 238;
    --pf-card-h: 126;
    --pf-card-x: -8;
    --pf-card-y: 0;
    --pf-sticker: polygon(95.8% 0,98.7% 0,100% 4%,99.6% 30.2%,95.8% 72.2%,93.3% 75.4%,93.3% 78.6%,92% 81.8%,4.2% 100%,2.9% 100%,2.5% 97.6%,.8% 97.6%,0 84.9%,.8% 83.3%,6.3% 25.4%,10.5% 19.1%);
    --pf-sticker-sample: 73.0823% 95.7055% / 702.5210% 746.8254%;
    --pf-paper-inset: 13.49% 8.82% 5.56% 23.11%;
    --pf-paper-sample: 65.4703% 94.6893% / 2985.7143% 1680.3571%;
  }
  & #plinko-recent li:nth-child(5n + 5) {
    --pf-card-w: 226;
    --pf-card-h: 122;
    --pf-card-x: -7;
    --pf-card-y: 4;
    --pf-sticker: polygon(92% 0,97.8% 0,97.8% 12.3%,98.7% 16.4%,100% 17.2%,100% 20.5%,98.2% 31.2%,93.8% 75.4%,93.4% 77.9%,91.6% 77.9%,89.8% 82.8%,63.3% 86.9%,5.8% 99.2%,0 99.2%,0 82.8%,1.8% 81.2%,6.2% 27.1%,7.5% 23%,11.5% 18%,59.7% 4.9%);
    --pf-sticker-sample: 88.1051% 95.7265% / 739.8230% 771.3115%;
    --pf-paper-inset: 13.11% 9.29% 5.74% 22.12%;
    --pf-paper-sample: 79.2383% 92.7107% / 3800% 1493.6508%;
  }
  & #plinko-recent li:focus-within { z-index: 2; }
  & #plinko-recent li::before,
  & #plinko-recent li::after {
    position: absolute;
    inset: 0;
    background: var(--plinko-ink);
    clip-path: var(--pf-sticker);
    translate: var(--pf-rear-x) var(--pf-rear-y);
    pointer-events: none;
    content: "";
  }
  & #plinko-recent li::after { inset: 1.5px; background: #fb188b; }
  & #plinko-recent .button {
    position: relative;
    z-index: 1;
    isolation: isolate;
    justify-items: center;
    align-content: center;
    width: 100%;
    min-height: clamp(65px, 12vw, 106px);
    padding: .4em .8em .25em;
    color: var(--plinko-ink);
    border: 0;
    background: var(--plinko-ink);
    box-shadow: none;
    text-align: center;
    clip-path: var(--pf-sticker);
  }
  & #plinko-recent .plinko-sticker-paper {
    position: absolute;
    inset: clamp(1px, .17vw, 2.75px);
    z-index: -1;
    clip-path: var(--pf-sticker);
    background: var(--pf-art) var(--pf-sticker-sample) no-repeat;
    pointer-events: none;
  }
  & #plinko-recent .plinko-sticker-paper::after {
    position: absolute;
    inset: var(--pf-paper-inset);
    background: var(--pf-art) var(--pf-paper-sample) no-repeat;
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent),
      linear-gradient(transparent, #000 6%, #000 94%, transparent);
    mask-composite: intersect;
    content: "";
  }
  & #plinko-recent li .button:focus-visible { background: #fff768; }
  & #plinko-recent li .button:hover .plinko-sticker-paper { filter: brightness(1.055); }
  & #plinko-recent .plinko-sticker-copy {
    display: grid;
    justify-items: center;
    min-width: 0;
    max-width: 100%;
    gap: clamp(2px, .27vw, 4.5px);
    transform: translateY(6%) rotate(var(--pf-copy-angle));
    color: var(--plinko-ink);
    white-space: nowrap;
  }
  & #plinko-recent .plinko-sticker-copy strong {
    display: inline-block;
    color: inherit;
    font: italic 900 clamp(1.3rem, 2.95vw, 3.06rem)/1 var(--lg-display);
    letter-spacing: .005em;
    transform: skewX(-7deg);
  }
  & #plinko-recent .plinko-sticker-copy > span {
    color: inherit;
    font: 870 clamp(.69rem, 1.42vw, 1.5rem)/1 var(--font-interface, system-ui, sans-serif);
  }
  & #plinko-recent .plinko-sticker-copy strong[data-plinko-wide-caption] { font-size: clamp(.97rem, 2.25vw, 2.34rem); }
  & #plinko-recent .plinko-sticker-copy > span[data-plinko-wide-caption] { font-size: clamp(.64rem, 1.13vw, 1.18rem); }
  & #plinko-recent [data-plinko-result-nonce] { display: none; }
  & .plinko-paperwork {
    --paperwork-ink: #1b120c;
    --paperwork-warm: #ffedc4;
    --paperwork-stipple: radial-gradient(circle, #1b120c24 .6px, transparent .8px) 0 0 / 5px 5px;
    --paperwork-space: clamp(10px, 1.65vw, 22px);
    --paperwork-edge: polygon(
      0 7px, 5% 2px, 11% 6px, 16% 0, 23% 5px, 29% 2px, 36% 6px, 42% 1px, 49% 4px,
      55% 0, 60% 5px, 67% 2px, 74% 6px, 80% 1px, 87% 5px, 93% 1px, 99% 5px,
      100% 16%, 99.6% 32%, 100% 54%, 99.6% 72%, 100% calc(100% - 5px), 95% 100%,
      89% calc(100% - 5px), 83% calc(100% - 1px), 76% calc(100% - 6px), 70% 100%,
      62% calc(100% - 3px), 55% calc(100% - 6px), 48% 100%, 41% calc(100% - 3px),
      35% calc(100% - 6px), 30% calc(100% - 1px), 23% calc(100% - 5px), 16% 100%,
      11% calc(100% - 5px), 5% calc(100% - 1px), 0 calc(100% - 7px), .35% 72%,
      0 58%, .4% 41%, 0 28%, .35% 14%
    );
    position: relative;
    isolation: isolate;
    inline-size: fit-content;
    max-inline-size: min(100%, 58rem);
    min-inline-size: 0;
    margin: 0;
    padding: 0 4px 5px 2px;
    color: var(--paperwork-ink);

    &[open] {
      inline-size: min(100%, 58rem);
      padding: var(--paperwork-space);
    }

    &[open]::before,
    &[open]::after {
      position: absolute;
      inset: -2px -2px -5px;
      z-index: -2;
      background: var(--paperwork-ink);
      clip-path: var(--paperwork-edge);
      pointer-events: none;
      content: "";
    }

    &[open]::after {
      inset: 1px 1px -1px;
      z-index: -1;
      background: var(--paperwork-warm) url("/redesign-art/paper.webp") center / 470px auto;
    }

    & summary {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .6em;
      min-block-size: 44px;
      margin: 0;
      padding: .45em .75em;
      list-style: none;
      cursor: pointer;
      font: italic 860 clamp(1.03rem, 2.25vw, 1.48rem)/1.15 var(--lg-display);
    }

    & summary::-webkit-details-marker { display: none; }

    & summary::after {
      flex: 0 0 auto;
      inline-size: .62em;
      block-size: .44em;
      background: currentColor;
      clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 39%, 50% 100%, 0 39%);
      content: "";
    }

    &[open] > summary::after,
    & details[open] > summary::after { rotate: 180deg; }

    & > summary {
      inline-size: fit-content;
      max-inline-size: 100%;
      color: var(--paperwork-ink);
      border: 2px solid var(--paperwork-ink);
      border-radius: 3px 5px 3px 4px;
      background: var(--paperwork-stipple), #ffe321;
      box-shadow: 3px 4px var(--paperwork-ink);
      transform: skew(-4deg) rotate(-.7deg);
      font-size: clamp(1rem, 2.25vw, 1.9rem);
    }

    & > summary:hover { background-color: #ffed6c; }

    & :is(summary, button, input):focus-visible {
      outline: 3px solid #bd145b;
      outline-offset: 2px;
    }

    & .mini-game-tools {
      justify-content: flex-start;
      align-items: stretch;
      gap: .65rem;
      margin-block: .9rem .75rem;
    }

    & .mini-game-tools :is(.button, .tag),
    & .button.secondary {
      min-block-size: 44px;
      max-inline-size: 100%;
      padding-inline: .82em;
      color: var(--paperwork-ink);
      border: 2px solid var(--paperwork-ink);
      border-radius: 3px;
      background: var(--plinko-mint);
      box-shadow: 2px 3px var(--paperwork-ink);
      font-weight: 830;
      white-space: normal;
    }

    & .mini-game-tools .tag { background: #ffb4d2; }
    & .mini-game-tools .button { transform: skew(-4deg); }
    & .button.secondary:hover:not(:disabled) { background: #bff6c7; }
    & #preview { gap: .75rem; }
    & #preview:empty { display: none; }
    & .plinko-paper-quote { display: grid; gap: .55rem; }

    & .plinko-paper-stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.8rem), 1fr));
      gap: clamp(5px, 1vw, 12px);
      margin: 0;
    }

    & .plinko-paper-stats > div {
      display: grid;
      align-content: space-between;
      gap: .18rem;
      min-inline-size: 0;
      padding: clamp(5px, 1vw, 10px) clamp(6px, 1.4vw, 14px);
      border: 2px solid var(--paperwork-ink);
      border-radius: 2px 5px 4px 3px;
      background: #fff5db;
      box-shadow: 2px 2px var(--paperwork-ink);
    }

    & .plinko-paper-stats > div:has([data-plinko-edge]) { background: #ffc3dc; }
    & .plinko-paper-stats > div:has([data-plinko-rtp]) { background: var(--plinko-mint); }

    & .plinko-paper-stats dt {
      font-size: clamp(.65rem, 1.33vw, .86rem);
      font-weight: 760;
      line-height: 1.12;
    }

    & .plinko-paper-stats dd {
      margin: 0;
      font: italic 850 clamp(1.05rem, 2.5vw, 1.8rem)/1.1 var(--lg-display);
      font-variant-numeric: tabular-nums;
      overflow-wrap: anywhere;
    }

    & > #preview > small[data-plinko-rtp] {
      width: fit-content;
      padding: .25rem .55rem;
      border: 1.5px solid var(--paperwork-ink);
      background: var(--plinko-mint);
      font-weight: 800;
    }

    & .notice {
      margin: 0;
      padding: .52rem .65rem;
      color: var(--paperwork-ink);
      border: 2px solid var(--paperwork-ink);
      border-inline-start: 6px solid #ec3b86;
      border-radius: 3px;
      background: #ffe0eb;
      font-weight: 720;
      overflow-wrap: anywhere;
    }

    & details {
      padding: 0;
      border: 2px solid var(--paperwork-ink);
      border-radius: 3px;
      background: #fff4d8;
      box-shadow: 3px 4px var(--paperwork-ink);
    }

    & > details { margin-block-start: .8rem; }

    & details > summary {
      color: var(--paperwork-ink);
      background: var(--paperwork-stipple), #a9ebb1;
    }

    & [data-plinko-paytable] > summary { background-color: #ff9fc6; }
    & details > summary:hover { filter: brightness(1.07); }
    & details[open] > summary { border-block-end: 2px solid var(--paperwork-ink); }

    & [data-plinko-paytable] > small {
      display: block;
      margin: .56rem .65rem;
      color: #6d442c;
      font-weight: 675;
    }

    & [data-plinko-paytable] .table-wrap {
      margin: 0 .55rem .6rem;
      border: 1.5px solid var(--paperwork-ink);
      border-radius: 2px;
      background: #fff8e7;
    }

    & [data-plinko-paytable] table {
      width: 100%;
      table-layout: fixed;
      color: var(--paperwork-ink);
      text-align: center;
      font: 740 clamp(.68rem, 1.3vw, .95rem)/1.15 var(--font-interface, system-ui, sans-serif);
      font-variant-numeric: tabular-nums;
    }

    & [data-plinko-paytable] :is(th, td) {
      padding: .34em .29em;
      text-align: center;
      color: var(--paperwork-ink);
      border-color: #1b120c77;
      overflow-wrap: anywhere;
    }

    & [data-plinko-paytable] :is(th, td) + :is(th, td) { border-inline-start: 1px solid #1b120c55; }
    & [data-plinko-paytable] th { background: #ffe66a; font-weight: 850; }
    & [data-plinko-paytable] th:first-child { width: 25%; }
    & [data-plinko-paytable] th:last-child { width: 42%; }
    & [data-plinko-paytable] tbody tr:nth-child(even) { background: #f5e5bd; }
    & [data-plinko-paytable] tbody tr:last-child td { border-block-end: 0; }

    & .plinko-paper-basket {
      display: inline-grid;
      place-items: center;
      inline-size: 1.85em;
      block-size: 1.85em;
      color: #fff4d8;
      border-radius: 50%;
      background: var(--paperwork-ink);
      font-weight: 850;
    }

    & .plinko-paper-multiplier {
      display: inline-block;
      max-inline-size: 97%;
      padding: .25em .4em;
      border: 1px solid var(--paperwork-ink);
      border-radius: 2px;
      background: #ffbed6;
      box-shadow: 1px 1px var(--paperwork-ink);
      font-weight: 850;
      transform: skew(-4deg);
    }

    & .plinko-paper-multiplier[data-tier="win"] { background: var(--plinko-mint); }
    & .plinko-paper-multiplier[data-tier="big"] { background: #ffe34a; }

    & > details > .form {
      gap: .65rem;
      padding: clamp(.6rem, 1.6vw, .9rem);
    }

    & [data-plinko-offer] {
      gap: .57rem;
      min-inline-size: 0;
      padding-block-start: .6rem;
      border-block-start: 1.5px dashed #70533b;
    }

    & details label { color: var(--paperwork-ink); font-weight: 780; }

    & details input {
      inline-size: 100%;
      min-inline-size: 0;
      min-block-size: 44px;
      padding: .42rem .57rem;
      color: var(--paperwork-ink);
      border: 2px solid var(--paperwork-ink);
      border-radius: 3px;
      background: #fffaf0;
    }

    & details input[readonly] {
      background: #f1dfb4;
      font: 700 .81rem/1.25 var(--mono);
    }

    & [data-plinko-offer] .button {
      width: fit-content;
      min-block-size: 44px;
      max-inline-size: 100%;
      padding-inline: .7rem;
      color: var(--paperwork-ink);
      border: 2px solid var(--paperwork-ink);
      border-radius: 3px;
      background: #ffe664;
      box-shadow: 2px 3px var(--paperwork-ink);
      font-weight: 850;
      white-space: normal;
    }

    & [data-plinko-offer] .button:hover:not(:disabled) { background: #fff098; }

    @media (max-width: 420px) {
      & .plinko-paper-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      & .plinko-paper-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }
      & .plinko-paper-stats > :last-child:nth-child(odd):has([data-plinko-rtp]) {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
      }
      & [data-plinko-paytable] .table-wrap { margin-inline: .4rem; }
      & [data-plinko-paytable] th:first-child { width: 22%; }
      & [data-plinko-paytable] th:last-child { width: 45%; }
      & .plinko-paper-multiplier { font-size: .95em; letter-spacing: -.015em; }
    }
  }
}

html[data-ludik-theme="stencil"] #content[data-game="plinko"] {
  --plinko-outline: #c58d5b;
  --plinko-lightning: #ffce28;
  --lg-yellow: #ffcb27;

  & > .page-head h1::before { background: url("/redesign-art/paper.webp") center / 440px auto, #f3dcad; }
  & > .page-head h1::after { display: none; }
  & .stage.stage-plinko { background: transparent; }
  & .stage.stage-plinko::before { inset: 25% auto auto 4%; transform: scaleX(-1) rotate(-9deg); opacity: 1; }
  & .stage.stage-plinko::after { inset: 24% 5% auto auto; transform: rotate(6deg); opacity: 1; }
  & .plinko-bins {
    border-color: #db9960;
    box-shadow: 0 0 0 2px #271b11, 0 4px 0 2px #090706, 0 8px 19px #0d0707ab;
  }
  & .plinko-bin:nth-child(odd) {
    color: #fff1d4;
    background: linear-gradient(#c7482f, #ac2421 64%, #751712);
  }
  & .plinko-bin.plinko-landed { color: #1a140b; background: #fff0a2; }
  & #game-sidebar {
    border: 2px solid #d4ac80;
    border-radius: 10px;
    background: var(--lg-rule), #141110;
    box-shadow: inset 0 0 0 2px #000b, 2px 4px 0 #070505c7;
  }
  & #game-sidebar .form label:has(input[name="stake"],select[name="rows"],select[name="risk"]) {
    position: relative;
    isolation: isolate;
    padding-top: 3px;
    text-indent: .4em;
    color: #1d1611;
    font-style: italic;
  }
  & #game-sidebar .form label:has(input[name="stake"],select[name="rows"],select[name="risk"])::before {
    position: absolute;
    z-index: -1;
    inset: 0 auto auto 0;
    width: 47px;
    height: 1.6em;
    background: url("/redesign-art/paper.webp") center / 200px auto, #f4dbaf;
    clip-path: var(--plinko-paper-edge);
    transform: skew(-7deg) rotate(-2deg);
    content: "";
  }
  & #game-sidebar .form label:has(input[name="stake"])::before { width: 127px; }
  & #game-sidebar .form label :is(select,input) {
    text-indent: 0;
  }
  & #game-sidebar :is(input[name="stake"],select[name="rows"],select[name="risk"]) {
    color: #fff1d3;
    background: #151110;
    border-color: #e1b785;
    font-style: normal;
  }
  & .plinko-step { color: #ffcf31; background: #e1b78516; }
  & .plinko-layout #game-sidebar .button:is(.play-primary, [data-action="auth"]) {
    background: linear-gradient(#ffe153, #ffc521);
    border-radius: 9px;
    border-color: #fff19d;
    box-shadow: 0 3px #a36016, 0 5px #090706;
    font-style: normal;
  }
}

@media (min-width: 960px) {
  html[data-ludik-theme] #content[data-game="plinko"] {
    & > .page-head { position: absolute; inset: clamp(12px, 2vw, 26px) var(--plinko-gutter) auto; z-index: 2; pointer-events: none; }
    & > .page-head .mini-game-tools { pointer-events: auto; }
    & .plinko-layout { row-gap: 0; grid-template-areas: "board controls" "feedback ."; }
    & .plinko-layout #game-sidebar { margin-top: 39px; }
    & .plinko-layout .stage-plinko { padding-top: 14px; }
    & #plinko-feedback:not([hidden]) { margin-block-start: 16px; }
  }
  html[data-ludik-theme="stencil"] #content[data-game="plinko"] {
    & .plinko-layout { grid-template-areas: "controls board" ". feedback"; }
    & .plinko-layout #game-sidebar { margin-top: clamp(98px, 10vw, 140px); }
    & .plinko-layout .stage-plinko { padding-top: 3px; }
  }
  html[data-ludik-theme="comic"] #content[data-game="plinko"] {
    --plinko-top: var(--pf-unit);
    --plinko-cup-height: calc(85 * var(--pf-unit));
    padding-inline: 0;

    & .plinko-layout > .page-head {
      position: absolute;
      inset: calc(25 * var(--pf-unit)) auto auto calc(51 * var(--pf-unit));
      z-index: 2;
      pointer-events: none;
    }
    & .plinko-layout > .page-head h1 { inline-size: calc(396 * var(--pf-unit)); }
    & .plinko-layout {
      grid-template-columns: calc(1103 * var(--pf-unit)) calc(537 * var(--pf-unit));
      grid-template-areas: "board controls" "feedback feedback";
      column-gap: 0;
      row-gap: calc(10 * var(--pf-unit));
    }
    & .plinko-layout .stage-plinko {
      inline-size: calc(1145 * var(--pf-unit));
      padding-top: 0;
    }
    & .plinko-board {
      inline-size: calc(935 * var(--pf-unit));
      max-width: none;
      margin-inline: calc(200 * var(--pf-unit)) 0;
      padding: 0 0 calc(30 * var(--pf-unit));
    }
    & .stage.stage-plinko #stage-canvas { aspect-ratio: 935 / 589; }
    & .plinko-bins {
      margin: calc(-7 * var(--pf-unit)) calc(58 * var(--pf-unit)) 0 calc(63 * var(--pf-unit));
      border-width: 0 calc(4 * var(--pf-unit)) calc(4 * var(--pf-unit));
    }
    & .stage.stage-plinko[data-plinko-renderer="webgl"] .plinko-bin {
      overflow: visible;
      padding-block-start: calc(var(--plinko-cup-height) * .28);
    }
    /* The nine original cups fan outward from the mouth to the printed face. */
    & .plinko-bins:not(:has(.plinko-bin:nth-child(11))) .plinko-bin {
      font-size: clamp(.68rem, calc(23 * var(--pf-unit)), 1.5rem);
    }
    & .plinko-layout #game-sidebar {
      --plinko-label-width: 28%;
      --plinko-step-width: max(28px, calc(56 * var(--pf-unit)));
      --plinko-control-height: max(35px, calc(48 * var(--pf-unit)));
      --plinko-control-font-size: max(.88rem, calc(26 * var(--pf-unit)));
      margin-top: calc(87 * var(--pf-unit));
      min-block-size: calc(492 * var(--pf-unit));
      padding: calc(25 * var(--pf-unit)) calc(34 * var(--pf-unit)) calc(36 * var(--pf-unit));
      gap: max(9px, calc(16 * var(--pf-unit)));
    }
    & #game-sidebar label:has(> select[name="rows"]),
    & #game-sidebar label.plinko-stake-caption,
    & #game-sidebar .plinko-risk-field,
    & #game-sidebar .plinko-toggles {
      font-size: max(.84rem, calc(25 * var(--pf-unit)));
    }
    & #game-sidebar .auto-mode { margin-block-end: calc(5 * var(--pf-unit)); }
    & #game-sidebar .auto-mode button {
      min-height: max(36px, calc(60 * var(--pf-unit)));
      font-size: max(.98rem, calc(35 * var(--pf-unit)));
    }
    & #game-sidebar .plinko-toggles > label { min-block-size: max(36px, calc(43 * var(--pf-unit))); }
    & .plinko-layout #game-sidebar .button:is(.play-primary, [data-action="auth"], .auto-stop-button) {
      min-height: max(47px, calc(87 * var(--pf-unit)));
      box-shadow: calc(5 * var(--pf-unit)) calc(9 * var(--pf-unit)) var(--plinko-ink);
    }
    & .plinko-layout #game-sidebar .button:is(.play-primary, [data-action="auth"]):hover:not(:disabled) {
      background: #ffe527;
    }
    & .plinko-layout #game-sidebar .button:is(.play-primary:not([data-auto-start]), [data-action="auth"]) {
      font-size: max(1.38rem, calc(50 * var(--pf-unit)));
    }
    & #plinko-feedback:not([hidden]) {
      margin: 0 0 0 calc(114 * var(--pf-unit));
      inline-size: calc(1400 * var(--pf-unit));
      padding: 0;
      column-gap: 0;
    }
    & .plinko-history-title { inline-size: calc(262 * var(--pf-unit)); }
    & #plinko-feedback:has(#plinko-recent:not(:empty)) .plinko-history-title {
      align-self: start;
      margin-block-start: calc(10 * var(--pf-unit));
    }
    & #plinko-recent:not(:empty) {
      gap: 0;
      grid-auto-columns: calc(225 * var(--pf-unit));
      margin: 0;
      padding: calc(6 * var(--pf-unit)) calc(14 * var(--pf-unit)) calc(17 * var(--pf-unit)) calc(5 * var(--pf-unit));
      align-items: start;
    }
    & #plinko-recent li {
      --pf-rear-x: calc(9 * var(--pf-unit));
      --pf-rear-y: calc(12 * var(--pf-unit));
      inline-size: calc(var(--pf-card-w) * var(--pf-unit));
      translate: calc(var(--pf-card-x) * var(--pf-unit)) calc(var(--pf-card-y) * var(--pf-unit));
    }
    & #plinko-recent .button { min-height: calc(var(--pf-card-h) * var(--pf-unit)); }
  }
}

@container plinko (max-width: 455px) {
  html[data-ludik-theme] #content[data-game="plinko"] .plinko-bin {
    min-height: 28px;
    border-right-width: 1px;
    font-size: clamp(8px, 2.35cqw, 11px);
    letter-spacing: -.04em;
  }
  html[data-ludik-theme="comic"] #content[data-game="plinko"] .plinko-bin { min-height: var(--plinko-cup-height); }
}

@container plinko (min-width: 332px) and (max-width: 455px) {
  html[data-ludik-theme] #content[data-game="plinko"] .plinko-bins:not(:has(.plinko-bin:nth-child(14))) {
    & .plinko-bin-full { display: block; }
    & .plinko-bin-short { display: none; }
  }
}

@media (max-width: 959px) {
  html[data-ludik-theme] #content[data-game="plinko"] {
    --plinko-board-width: min(100%, 36rem);
    & .plinko-layout { grid-template-columns: minmax(0,1fr); grid-template-areas: "board" "controls" "feedback"; }
    & > .page-head { flex-direction: row; align-items: center; }
    & > .page-head h1 { font-size: clamp(2.55rem, 9vw, 4.5rem); }
    & .stage.stage-plinko .plinko-board canvas { aspect-ratio: 1.24; }
    & .stage.stage-plinko::before { inset-inline-start: 0; }
    & .stage.stage-plinko::after { inset-inline-end: 0; }
  }
  html[data-ludik-theme="comic"] #content[data-game="plinko"] {
    --plinko-board-width: min(100%, 42rem);
    --plinko-cup-height: clamp(37px, 8.5vw, 65px);
    --pf-print-scale: .69;
    & .plinko-layout { grid-template-areas: "title" "board" "controls" "feedback"; row-gap: 0; }
    & .plinko-layout > .page-head { margin-block-end: 9px; }
    & .plinko-layout #game-sidebar { width: min(100%, 42rem); justify-self: center; }
    & .plinko-layout > :is(#game-sidebar, #plinko-feedback:not([hidden])) { margin-block-start: var(--plinko-layout-gap); }
    & #plinko-feedback:not([hidden]) { padding-inline: 0; }
  }
}

@media (max-width: 768px) {
  html[data-ludik-theme="comic"] #content[data-game="plinko"] {
    & .plinko-layout { grid-template-areas: "feedback" "board" "controls"; }
    & .plinko-layout > .page-head {
      grid-area: board;
      align-self: start;
      justify-self: start;
      z-index: 2;
      margin: clamp(6px, 1.5vw, 12px) 0 0;
      pointer-events: none;
    }
    & .plinko-layout > .page-head h1 {
      inline-size: clamp(94px, 28vw, 205px);
      transform: rotate(-5deg);
    }
    & #plinko-feedback:not([hidden]) { margin: 0; padding: 0 0 9px; gap: 7px; }
    & .plinko-history-title { inline-size: clamp(96px, 21vw, 160px); }
    & #plinko-recent:not(:empty) {
      grid-auto-columns: clamp(78px, 16vw, 118px);
      gap: 6px;
      margin: 0;
      padding: 3px 5px 6px 2px;
    }
    & #plinko-recent li { --pf-rear-x: 3px; --pf-rear-y: 4px; }
    & #plinko-recent .button { min-height: clamp(48px, 8.6vw, 65px); padding-inline: .35em; }
    & #plinko-recent .plinko-sticker-copy strong { font-size: clamp(1.12rem, 3.8vw, 1.65rem); }
    & #plinko-recent .plinko-sticker-copy > span { font-size: clamp(.63rem, 1.8vw, .87rem); }
    & #plinko-recent .plinko-sticker-copy > span[data-plinko-wide-caption] {
      max-inline-size: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: clamp(.58rem, 1.5vw, .76rem);
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  html[data-ludik-theme] #content[data-game="plinko"] .stage-plinko:has(.plinko-landed)::after {
    animation: plinko-lightning-impact 220ms ease-out both;
  }
}

@keyframes plinko-lightning-impact {
  30% { scale: 1.13; filter: brightness(1.16); }
}

html[data-ludik-theme="comic"] #dialog[data-variant="plinko-history"] {
  --plinko-history-ink: #21150f;
  --plinko-history-lemon: #ffdf24;
  --plinko-history-pink: #fa2d82;
  --plinko-history-mint: #a9edac;

  & .plinko-history-sheet { display: grid; gap: .85rem; min-inline-size: 0; }
  & .plinko-history-sheet [hidden] { display: none; }
  & [data-plinko-history-list] {
    display: grid;
    gap: .62rem;
    list-style: none;
    margin: 0;
    padding: 3px 4px 6px 0;
  }
  & .plinko-history-bet {
    display: grid;
    grid-template-columns: minmax(5.3rem, .65fr) minmax(8rem, 1.25fr) minmax(5rem, .78fr) minmax(5rem, .78fr) .55rem;
    align-items: center;
    gap: clamp(.4rem, 1.5vw, .9rem);
    inline-size: 100%;
    padding: .46rem .7rem .46rem .55rem;
    color: var(--plinko-history-ink);
    background: #fff1ce;
    border: 2px solid currentColor;
    border-radius: 3px;
    box-shadow: 3px 3px var(--plinko-history-ink);
    cursor: pointer;
    font-size: .92rem;
    line-height: 1.16;
    text-align: start;
  }
  & li:nth-child(even) .plinko-history-bet { background: #ffe7b6; }
  & li .plinko-history-bet:hover { background: #fff7dd; transform: translateY(-1px); }
  & .plinko-history-bet:active { box-shadow: 1px 1px var(--plinko-history-ink); transform: translate(2px, 2px); }
  & .plinko-history-bet:focus-visible,
  & .plinko-history-more:focus-visible { outline: 3px solid #aa0752; outline-offset: 3px; }
  & .plinko-history-factor {
    border: 2px solid var(--plinko-history-ink);
    border-radius: 2px;
    padding: .32em .16em .41em;
    background: var(--plinko-history-lemon);
    box-shadow: 2px 2px var(--plinko-history-ink);
    font: italic 860 clamp(1rem, 3vw, 1.55rem)/1 var(--lg-display, Impact, sans-serif);
    text-align: center;
    transform: skew(-5deg) rotate(-2deg);
    overflow-wrap: anywhere;
  }
  & [data-result="win"] .plinko-history-factor { background: var(--plinko-history-mint); }
  & [data-result="loss"] .plinko-history-factor { background: #ff83b7; }
  & :is(.plinko-history-date, .plinko-history-amount) { display: grid; gap: .12rem; min-inline-size: 0; }
  & .plinko-history-date { font-weight: 750; }
  & .plinko-history-bet small { color: #654731; font-size: .72rem; font-weight: 660; }
  & .plinko-history-amount b { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  & .plinko-history-arrow { font-size: 1.5rem; font-weight: 850; line-height: 1; }
  & .plinko-history-status {
    margin: 0;
    padding: .55rem .8rem;
    color: var(--plinko-history-ink);
    background: #fff1ce;
    border-inline-start: 4px solid var(--plinko-history-pink);
    font-weight: 720;
  }
  & .plinko-history-more {
    justify-self: start;
    padding-inline: 1.25rem;
    color: var(--plinko-history-ink);
    background: var(--plinko-history-mint);
    border: 2px solid var(--plinko-history-ink);
    border-radius: 3px;
    box-shadow: 3px 4px var(--plinko-history-ink);
    font-weight: 850;
  }
  & .plinko-history-more:hover:not(:disabled) { background: #d5f6b6; }

  @media (max-width: 620px) {
    & .plinko-history-bet {
      grid-template-columns: minmax(3.5rem, .75fr) repeat(2, minmax(0, 1fr)) .4rem;
      gap: .28rem .48rem;
      min-block-size: 66px;
      padding-inline: .42rem;
      font-size: .83rem;
    }
    & .plinko-history-factor { grid-column: 1; grid-row: 1 / 3; }
    & .plinko-history-date {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: .16em .55em;
      grid-column: 2 / 4;
      grid-row: 1;
    }
    & .plinko-history-amount { grid-row: 2; }
    & .plinko-history-arrow { grid-column: 4; grid-row: 1 / 3; }
  }
}
