/* Individual paper, ink, and cell layers for the Comic Mines screen. */
html[data-ludik-theme="comic"]:has(#content[data-game="mines"] .mines-comic-page) {
  --mines-ink: #140f0c;
  --mines-cream: #fff0ce;
  --mines-green: #8afa9c;
  --mines-yellow: #ffed24;
  --mines-pink: #fa1266;
  --mines-paper: url("/redesign-art/paper.webp");
  --mines-edge: polygon(
    .7% 3.2%, 1.5% 2.56%, 2% 2.6%, 3.15% 1.71%, 3.7% .8%, 4.81% .34%, 5.7% .35%, 6.56% .88%,
    7.1% .9%, 8.28% 1.29%, 9.45% 1.03%, 10.4% 1%, 11.03% 1.02%, 11.7% 1.7%, 12.34% 1.12%, 13.2% .95%,
    13.78% .91%, 14.7% 1.08%, 15.4% 1.4%, 16.07% 1.23%, 16.9% .45%, 18.12% .59%, 18.9% .4%, 19.5% .2%,
    20.29% .47%, 20.96% .82%, 21.6% 1.4%, 22.53% 1.45%, 23% 1.48%, 24.1% 1.7%, 24.78% 1.29%, 25.41% 1.44%,
    26.4% .75%, 27.14% 1.08%, 28.35% 1.41%, 28.9% 1.15%, 29.92% 1.06%, 30.37% .46%, 31.3% .3%, 31.95% .33%,
    33.08% 1.36%, 33.6% 1.4%, 34.61% 1.7%, 35.52% 2.06%, 36.5% 1.9%, 37.47% 1.18%, 38.51% 1.16%, 39.4% .7%,
    40.34% .79%, 41.2% 1.05%, 41.7% .98%, 42.94% .38%, 43.4% .35%, 44.26% .72%, 45.4% .8%, 46.33% .99%,
    46.88% 1.23%, 47.6% 1.7%, 48.44% 1.6%, 49.32% 1.36%, 50.1% 1.5%, 50.64% .95%, 51.97% .67%, 52.5% .55%,
    53.55% .58%, 54.91% 1.01%, 55.8% 1.2%, 56.59% 1.14%, 57.32% .46%, 58.3% .2%, 59.22% .87%, 60.13% 1.08%,
    61.4% 1.45%, 62.56% 1.03%, 63.04% .96%, 64.4% 1%, 65.51% 1.58%, 66.32% 1.59%, 67.2% 1.9%, 68.39% 1.51%,
    69.1% 1.35%, 70.55% 1.19%, 71.63% 1.41%, 72.4% 1.55%, 73.06% 1.11%, 73.56% 1.08%, 74.6% .35%, 75.35% .82%,
    76.5% .9%, 77.49% .56%, 78.59% 1%, 79.3% .7%, 80.43% .89%, 81.47% 1.52%, 82% 1.65%, 82.67% 1.18%,
    83.51% .79%, 84.2% .45%, 85.15% .96%, 86% .75%, 86.75% .41%, 88.19% .62%, 88.9% .2%, 89.57% .84%,
    90.67% 1.09%, 91.1% 1.4%, 92.27% .96%, 93.02% 1.24%, 94.3% .75%, 95.33% 1.07%, 96.01% 1.54%, 96.6% 1.9%,
    97.39% 1.54%, 98.37% 1.27%, 99.3% 1.15%, 99.81% 2.25%, 99.68% 3.22%, 99.8% 4%, 99.69% 4.64%, 99.4% 5.63%,
    99.25% 6.3%, 99.54% 6.94%, 99.48% 8.08%, 99.65% 8.7%, 99.66% 9.45%, 99.11% 10.51%, 99.05% 11%, 99.13% 11.71%,
    98.93% 13.04%, 99.25% 14.1%, 98.97% 15.06%, 98.86% 16.19%, 98.65% 17.7%, 98.73% 18.81%, 98.94% 19.52%, 99.55% 20.5%,
    99.06% 21.82%, 99.28% 22.77%, 99.15% 23.4%, 99.76% 24.22%, 99.9% 25.3%, 99.64% 26.16%, 99.82% 27.19%, 99.4% 28.5%,
    99.36% 29.32%, 99.36% 30.34%, 99.65% 31.6%, 99.45% 32.32%, 99.3% 32.98%, 98.9% 34%, 98.72% 34.97%, 99.21% 35.69%,
    99.2% 36.4%, 99.07% 37.58%, 98.49% 38.52%, 98.7% 39.2%, 98.99% 40.48%, 98.87% 41.27%, 99.6% 42.9%, 99.57% 43.37%,
    99.29% 44.11%, 99.3% 45.1%, 99.38% 45.89%, 99.69% 47.2%, 99.75% 48%, 99.8% 49.04%, 98.92% 50.49%, 99.1% 51.2%,
    99.63% 52.48%, 99.38% 53.25%, 99.6% 54.2%, 99.5% 55.37%, 98.89% 55.94%, 98.85% 56.8%, 98.75% 57.43%, 99.52% 58.56%,
    99.4% 59.6%, 99.34% 60.67%, 99.51% 61.31%, 99.1% 62.2%, 99.41% 62.92%, 99.85% 64.1%, 99.8% 65.3%, 99.93% 66.14%,
    99.74% 67.52%, 99.45% 68.4%, 99.46% 69.46%, 99.94% 70.18%, 99.85% 71.1%, 99.91% 71.79%, 99.38% 73.21%, 99.25% 74.2%,
    99.34% 74.89%, 99.53% 76.63%, 99.6% 77.5%, 99.28% 79.05%, 99.47% 79.88%, 98.95% 80.8%, 99.32% 82.13%, 99.45% 82.83%,
    99.2% 83.7%, 99.11% 84.65%, 99.08% 85.48%, 98.75% 86%, 99.35% 87.07%, 99.53% 87.67%, 99.55% 89%, 99.38% 90.42%,
    99.07% 91.18%, 99.25% 92.6%, 99.42% 93.14%, 99.65% 94.08%, 99.65% 95.2%, 99.09% 96.25%, 98.24% 97.41%, 98% 98.5%,
    97.28% 98.59%, 96.73% 98.01%, 95.65% 98.1%, 94.42% 98.64%, 94.06% 99.12%, 92.7% 99.75%, 91.63% 99.3%, 90.7% 98.8%,
    90.17% 98.67%, 89.19% 98.99%, 88.1% 99.4%, 87.06% 99.14%, 86.2% 98.35%, 85.08% 99.1%, 84.67% 98.79%, 83.35% 99.5%,
    82.72% 99.21%, 81.88% 99.09%, 81.2% 98.65%, 80.36% 98.81%, 79.4% 99.21%, 78.6% 99%, 77.61% 98.6%, 77.18% 98.84%,
    76.25% 98.25%, 75.25% 98.89%, 73.35% 98.94%, 72.5% 99.55%, 71.83% 99.28%, 70.31% 99.02%, 69.7% 98.9%, 68.96% 98.99%,
    67.95% 99.2%, 66.9% 99.6%, 65.69% 98.91%, 64.42% 98.54%, 63.55% 98.5%, 62.49% 99.35%, 62.13% 99.08%, 61.2% 99.6%,
    60.24% 99.51%, 59.37% 99.76%, 58.7% 99.35%, 58% 99.09%, 56.8% 98.7%, 56.23% 98.57%, 54.92% 98.87%, 53.9% 99.4%,
    53.38% 99.13%, 52.23% 98.6%, 51.35% 98.3%, 50.47% 98.24%, 49.02% 99.19%, 47.55% 99.3%, 46.64% 98.73%, 45.6% 98.7%,
    44.66% 98.78%, 44.22% 99.4%, 43.2% 99.7%, 42.36% 99.81%, 41.55% 99.14%, 40.6% 99.15%, 39.69% 98.67%, 39.1% 98.2%,
    37.79% 99.01%, 36.9% 98.94%, 35.7% 99.45%, 34.62% 99.52%, 34.06% 99.34%, 33.4% 98.85%, 32.38% 99.41%, 31.31% 99.59%,
    30.8% 99.75%, 30.03% 99.72%, 29.16% 99.84%, 27.8% 99.4%, 26.99% 99.33%, 25.8% 98.4%, 24.89% 98.61%, 24.29% 98.86%,
    23.5% 99.15%, 22.78% 99.05%, 21.21% 98.87%, 20.35% 98.4%, 19.14% 99.32%, 18.35% 99.5%, 17.19% 98.84%, 16.5% 98.7%,
    15.34% 98.89%, 15% 99.52%, 14% 99.65%, 13.36% 99.13%, 11.91% 99.09%, 11.35% 98.5%, 10.48% 98.64%, 10.01% 99.48%,
    9% 99.7%, 8.01% 99.06%, 7.33% 99.31%, 6.65% 98.8%, 5.6% 99.37%, 5.06% 99.2%, 4.25% 99.35%, 3.16% 98.79%,
    2.4% 98.45%, 1.23% 98.82%, .5% 99.1%, .35% 97.73%, .14% 97.08%, .2% 96%, .55% 95.39%, .84% 93.84%,
    .75% 93.3%, .7% 92.68%, .62% 91.31%, .35% 90.2%, .39% 89.08%, .9% 88.36%, .95% 87.5%, .68% 86.47%,
    .97% 85.42%, .7% 84.8%, .66% 83.75%, .84% 82.76%, 1.15% 81.5%, .98% 80.68%, .55% 79.69%, .35% 79.2%,
    .42% 78.64%, .29% 77.83%, .65% 76.7%, .34% 76.17%, .61% 74.71%, .25% 74.1%, .26% 72.89%, .47% 72.29%,
    .9% 70.8%, .7% 70.16%, .72% 69.3%, .4% 68.5%, .25% 67.85%, .62% 66.45%, .85% 65.5%, .64% 64.42%,
    .5% 63.5%, .1% 62.9%, .48% 61.49%, .68% 60.29%, .55% 59.3%, .19% 58.48%, .09% 57.91%, .1% 56.8%,
    .42% 55.99%, .79% 54.38%, .75% 53.8%, .79% 52.71%, .49% 52%, .35% 51.2%, .31% 50.04%, .81% 49.21%,
    1.05% 48.1%, .93% 46.98%, .22% 46.26%, .35% 45.6%, .75% 44.64%, .68% 43.96%, .75% 42.9%, .75% 41.59%,
    .09% 40.49%, .2% 39.9%, .64% 39.22%, .71% 38%, .65% 37.3%, .26% 36.45%, .3% 35.6%, .3% 34.3%,
    .29% 33.27%, .78% 31.72%, 1.05% 31.1%, .8% 30.49%, .85% 29.01%, .85% 28.4%, .64% 27.62%, .37% 25.89%,
    .15% 24.9%, .42% 23.72%, .5% 22.73%, .85% 21.9%, .96% 21.28%, .84% 20.12%, .35% 19.3%, .15% 18.44%,
    .32% 17.88%, .7% 16.6%, .62% 16.07%, .76% 15.15%, .2% 13.9%, .38% 12.87%, .74% 12.04%, .8% 11.4%,
    .62% 10.55%, .78% 8.77%, .35% 8.1%, .4% 7.57%, .58% 6.41%, .95% 5.8%, .61% 5.15%, .73% 4.06%
  );
  --mines-ruling: radial-gradient(#28201319 .55px, transparent .82px) 0 0 / 5px 5px;
  --mines-grain: linear-gradient(#fff1cd82, #fff1cd72), var(--mines-paper) center / 530px auto;
  --mines-display: var(--ld-display, Impact, "Arial Narrow", sans-serif);

  & #content[data-game="mines"] {
    --mines-gutter: clamp(9px, 1.48vw, 25px);
    --mines-outline: clamp(2px, .31vw, 5px);
    --mines-gain: clamp(23px, 2.5vw, 42px);
    --mines-value: clamp(21px, 3.05vw, 51px);
    --mines-control-gap: clamp(9px, 1.1vw, 18px);
    isolation: isolate;
    overflow: clip;
    width: min(100%, 1672px);
    max-width: none;
    padding: 0;
    color: var(--mines-ink);
    background: #ff173f url("/redesign-art/plinko-pf01-paper.webp") 3px 1px / 410px 427px repeat;
  }

  & .mines-comic-page {
    --mines-sidebar-inset: clamp(19px, 2.4vw, 41px);
    --mines-toggles-top: clamp(8px, .85vw, 14px);
    --mines-toggle-height: 44px;
    display: grid;
    grid-template: "board controls" auto "tools tools" auto / minmax(0, 1.29fr) minmax(0, 1fr);
    align-items: start;
    gap: clamp(10px, 1.64vw, 28px);
    min-width: 0;
    max-width: 1580px;
    margin-inline: auto;
    padding: clamp(19px, 1.82vw, 31px) var(--mines-gutter) clamp(12px, 1.2vw, 24px);
  }
  & .mines-comic-identity {
    position: relative;
    z-index: 2;
    grid-area: board;
    justify-self: start;
    align-self: start;
    min-inline-size: 0;
    margin-block-start: -12px;
    padding-inline-start: clamp(12px, 2.25vw, 38px);
    pointer-events: none;
  }
  & .mines-comic-identity h1 {
    --title-edge: polygon(
      3% 10%, 9% 9%, 13% 6%, 21% 8%, 26% 3%, 31% 5%, 38% 2%, 45% 5%, 52% 1%, 59% 3%,
      66% 0, 72% 4%, 81% 1%, 89% 4%, 100% 2%, 97% 14%, 99% 23%, 97% 33%, 99% 43%,
      97% 53%, 99% 62%, 95% 75%, 96% 89%, 91% 92%, 84% 94%, 78% 91%, 70% 96%, 62% 94%,
      55% 97%, 48% 95%, 39% 99%, 35% 96%, 27% 100%, 22% 96%, 17% 99%, 11% 96%, 2% 100%,
      3% 90%, 0 80%, 1% 71%, 0 62%, 2% 51%, 0 42%, 2% 30%, 1% 21%
    );
    position: relative;
    z-index: 2;
    isolation: isolate;
    display: inline-grid;
    justify-content: center;
    margin: 0;
    padding: .23em .34em .36em;
    color: var(--mines-ink);
    font: italic 900 clamp(36px, 3.45vw, 56px)/.9 var(--mines-display);
    font-synthesis: style weight;
    letter-spacing: -.031em;
    white-space: nowrap;
    transform: rotate(-8deg) skewX(-9deg);
  }
  & .mines-comic-identity h1::before,
  & .mines-comic-identity h1::after {
    position: absolute;
    z-index: -2;
    inset: 0;
    background: var(--mines-ink);
    clip-path: var(--title-edge);
    content: "";
  }
  & .mines-comic-identity h1::after {
    z-index: -1;
    inset: clamp(2px, .27vw, 5px);
    background:
      linear-gradient(104deg, #fff447, transparent 44%) center / 100%,
      linear-gradient(94deg, var(--mines-pink), var(--mines-pink)) center 83% / 78% .13em no-repeat,
      var(--mines-ruling), var(--mines-yellow);
  }
  & #content .mines-comic-stage.stage-column { grid-area: board; }
  & .mines-comic-stage.stage-column {
    display: grid;
    gap: 11px;
    min-inline-size: 0;
    margin-block-start: clamp(22px, 1.93vw, 33px);
  }
  & .mines-comic-stage .stage.stage-mines,
  & #game-sidebar.mines-comic-sidebar {
    position: relative;
    isolation: isolate;
    overflow: visible;
    min-width: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  & .mines-comic-stage .stage.stage-mines::before,
  & .mines-comic-stage .stage.stage-mines::after,
  & #game-sidebar.mines-comic-sidebar::before,
  & #game-sidebar.mines-comic-sidebar::after {
    position: absolute;
    inset: 0;
    z-index: -2;
    clip-path: var(--mines-edge);
    background: var(--mines-ink);
    pointer-events: none;
    content: "";
  }
  & .mines-comic-stage .stage.stage-mines::after,
  & #game-sidebar.mines-comic-sidebar::after {
    inset: var(--mines-outline);
    z-index: -1;
    background: var(--mines-grain), var(--mines-cream);
  }
  & .mines-comic-stage .stage.stage-mines {
    padding: clamp(43px, 3.37vw, 56px) clamp(20px, 2.54vw, 43px) clamp(17px, 1.7vw, 27px);
  }
  & .mines-comic-stage [data-step-stage="mines"] {
    display: grid;
    align-content: start;
    gap: 9px;
    min-height: 0;
    padding: 0;
    background: transparent;
  }
  & .mines-comic-stage [data-step-stage="mines"]::after { content: none; }
  & .mines-comic-stage .step-stage-head,
  & .mines-comic-stage .step-stage-note:not([data-mines-queue-status]) { display: none; }
  & .mines-comic-result {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: .18em .8em;
    width: fit-content;
    max-width: 100%;
    margin: clamp(9px, 1.2vw, 18px) auto 0;
    padding: .5em .85em;
    border: var(--mines-outline) solid var(--mines-ink);
    background: #a6f4a0;
    box-shadow: 3px 3px var(--mines-ink);
    color: var(--mines-ink);
    font: 800 clamp(14px, 1.15vw, 20px)/1.1 var(--mines-display);
    font-variant-numeric: tabular-nums;
  }
  & .mines-comic-result[data-mines-result="loss"] { background: #f79eb8; }
  & .mines-comic-result strong {
    grid-row: span 2;
    font-size: 1.75em;
    font-style: italic;
  }
  & .mines-comic-result small { font: inherit; font-size: .8em; }
  & .mines-comic-stage [data-mines-queue-status] {
    margin: 0;
    padding: .35rem .55rem;
    border-inline-start: 4px solid var(--mines-pink);
    background: #fff9e7;
    font-weight: 740;
  }

  & .mines-comic-stage [data-step-grid] {
    position: relative;
    isolation: isolate;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: clamp(4px, .58vw, 10px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  & .mines-comic-board-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  & .mines-comic-stage [data-step-grid] .step-cell {
    z-index: 1;
    min-width: 0;
    aspect-ratio: 1.046;
    color: var(--mines-ink);
    border: clamp(2px, .42vw, 7px) solid var(--mines-ink);
    border-radius: clamp(2px, .33vw, 5px);
    background: var(--mines-grain), var(--mines-cream);
    box-shadow: inset 0 0 0 1px #fff9e8;
    font-family: var(--mines-display);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & .mines-comic-stage [data-step-grid] .step-cell > svg {
    width: 79%;
    height: auto;
    max-height: 79%;
    visibility: visible;
  }
  & .mines-comic-stage [data-step-grid] .step-cell > [data-mines-glyph] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
  }
  & .mines-comic-stage [data-step-grid] .step-cell::before { content: none; }
  & .mines-comic-stage [data-step-grid] .step-cell:disabled { opacity: 1; }
  & .mines-comic-stage [data-step-grid] .step-cell[data-cell-state="safe"] {
    background: var(--mines-ruling), var(--mines-green);
    box-shadow: inset 0 0 0 2px #baffb8;
  }
  & .mines-comic-stage [data-step-grid]:not([data-mines-webgl]) .step-cell[data-mines-preview-safe] {
    border-style: dashed;
    border-color: #496f55;
    background: var(--mines-ruling), #c6eed0;
  }
  & .mines-comic-stage [data-step-grid] .step-cell[data-cell-state="planned"] { background: var(--mines-ruling), var(--mines-yellow); }
  & .mines-comic-stage [data-step-grid] .step-cell[data-cell-state="danger"] { background: var(--mines-ruling), #e999aa; }
  & .mines-comic-stage [data-step-grid] .step-cell[data-cell-state="struck"] { background: var(--mines-ruling), #ff4079; }
  & .mines-comic-stage [data-step-grid]:not([data-mines-webgl]) .step-cell[data-mines-waiting] { border-style: dashed; }
  & .mines-comic-stage [data-step-grid] .step-cell:is(:hover,:active):not(:disabled) { transform: none; }
  & .mines-comic-stage [data-step-grid]:not([data-mines-webgl]) .step-cell:active:not(:disabled) {
    background-color: #ffe890;
    filter: brightness(.94);
  }
  & .mines-comic-stage [data-step-grid] .step-cell:focus-visible {
    outline: 3px solid #b70a53;
    outline-offset: -4px;
  }
  & .mines-comic-stage [data-step-grid][data-mines-webgl] .step-cell {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
    filter: none;
  }
  & .mines-comic-stage [data-step-grid][data-mines-webgl] .step-cell > svg { visibility: hidden; }
  & .mines-comic-stage .step-cell:has(.mines-playback-order, [data-mines-plan-order]) {
    container-type: inline-size;
  }
  & .mines-comic-stage :is(.mines-playback-order, [data-mines-plan-order]) {
    color: var(--mines-ink);
    font-family: var(--mines-display);
    font-variant-numeric: tabular-nums;
    font-weight: 900;
    letter-spacing: -.025em;
    line-height: 1;
    white-space: nowrap;
  }
  & .mines-comic-stage [data-mines-plan-order] {
    position: relative;
    padding: .15em .2em .2em;
    border: 1px solid var(--mines-ink);
    border-radius: 2px;
    background: #fff594;
    box-shadow: 1px 2px var(--mines-ink);
    font-size: clamp(11px, 25cqi, 32px);
  }
  & .mines-comic-stage [data-mines-plan-order][data-mines-factor-wide] {
    font-size: clamp(8px, 17cqi, 22px);
  }
  & .mines-comic-stage .mines-playback-order {
    inset: auto 1px 1px auto;
    padding: .14em .24em .18em;
    background: var(--mines-cream);
    border: 1px solid var(--mines-ink);
    border-radius: 2px;
    font-size: clamp(9px, 19cqi, 21px);
  }
  & .mines-comic-stage .mines-playback-order[data-mines-factor-wide] {
    font-size: clamp(8px, 14cqi, 15px);
  }
  & .mines-comic-stage .mines-comic-plan-footer {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "count help clear";
    align-items: center;
    gap: .6rem clamp(8px, 1.1vw, 17px);
    padding: clamp(7px, .85vw, 14px) 3px 3px;
    border-block-start: 2px solid var(--mines-ink);
  }
  & .mines-comic-stage .mines-comic-plan-footer output {
    display: flex;
    grid-area: count;
    align-items: baseline;
    gap: .45em;
    min-width: 0;
    min-height: 44px;
    padding: .36em .61em;
    align-content: center;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 4px 2px 1px 3px;
    background: var(--mines-ruling), #d2ffc9;
    box-shadow: 2px 2px var(--mines-ink);
    font: 800 clamp(12px, 1vw, 15px)/1.15 var(--font-interface);
    font-variant-numeric: tabular-nums;
    transform: skewX(-5deg) rotate(-.8deg);
  }
  & .mines-comic-stage .mines-comic-plan-footer output strong {
    font: italic 900 clamp(20px, 1.78vw, 28px)/1 var(--mines-display);
    white-space: nowrap;
  }
  & .mines-comic-stage:has(.step-cell[data-cell-state="planned"]) .mines-comic-plan-footer output { background-color: var(--mines-green); }
  & .mines-comic-stage .mines-comic-plan-footer p {
    grid-area: help;
    min-width: 0;
    margin: 0;
    padding: .38em .5em;
    color: var(--mines-ink);
    border-inline-start: 4px solid var(--mines-pink);
    font: 730 clamp(12px, 1.07vw, 15px)/1.2 var(--font-interface);
  }
  & .mines-comic-stage .mines-comic-plan-footer .mines-plan-clear {
    display: inline-flex;
    grid-area: clear;
    align-items: center;
    justify-content: center;
    gap: .28em;
    min-width: 44px;
    min-height: 44px;
    padding: .3em .55em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 2px 4px 2px 3px;
    background: var(--mines-ruling), #ffacd3;
    box-shadow: 2px 3px var(--mines-ink);
    font: italic 850 clamp(15px, 1.28vw, 19px)/1.05 var(--mines-display);
    transform: rotate(1.5deg);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & .mines-comic-stage .mines-comic-plan-footer .mines-plan-clear > span { font-size: 1.36em; }
  & .mines-comic-stage .mines-comic-plan-footer .mines-plan-clear:hover:not(:disabled) { background-color: #ffc9e1; }
  & .mines-comic-stage .mines-comic-plan-footer .mines-plan-clear:active:not(:disabled) {
    transform: translate(2px, 2px) rotate(1.5deg);
    box-shadow: none;
  }
  & .mines-comic-stage .mines-comic-plan-footer .mines-plan-clear:focus-visible { outline: 2px solid #ad1550; outline-offset: 2px; }
  & .mines-comic-stage .mines-comic-plan-footer .mines-plan-clear:disabled { opacity: .65; }
  @media (max-width: 460px) {
    & .mines-comic-stage .mines-comic-plan-footer {
      grid-template-columns: minmax(0, 1fr) max-content;
      grid-template-areas: "count clear" "help help";
    }
    & .mines-comic-stage .mines-comic-plan-footer output {
      align-items: center;
      justify-self: start;
      flex-wrap: wrap;
    }
  }

  & #game-sidebar.mines-comic-sidebar {
    grid-area: controls;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    min-height: min(48.9vw, 817px);
    gap: var(--mines-control-gap);
    padding: calc(var(--mines-toggles-top) + var(--mines-toggle-height) + var(--mines-control-gap)) var(--mines-sidebar-inset) clamp(12px, 1.62vw, 27px);
  }
  & #game-sidebar .mines-comic-form {
    grid-template-columns: minmax(0, 1fr);
    min-inline-size: 0;
    gap: var(--mines-control-gap);
  }
  & #game-sidebar .mines-comic-form fieldset.guest-fields { opacity: 1; }
  & #game-sidebar .mines-comic-settings {
    display: grid;
    min-width: 0;
    gap: clamp(6px, .76vw, 13px);
    margin: 0;
    padding: 0;
    border: 0;
  }
  & #game-sidebar .mines-comic-setting {
    display: grid;
    grid-template-columns: minmax(0, 31%) minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: 7px;
    margin: 0;
    padding-inline: clamp(3px, .65vw, 10px);
    color: var(--mines-ink);
    font: italic 900 var(--mines-value)/1.04 var(--mines-display);
    font-synthesis: style weight;
    letter-spacing: -.025em;
  }
  & #game-sidebar .mines-comic-setting > .mines-comic-setting-label {
    color: inherit;
    font: inherit;
  }
  & #game-sidebar .mines-comic-setting-value {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: clamp(44px, 4.29vw, 72px);
    margin-inline: 5px 1px;
    padding: .08em .32em .12em clamp(11px, 1.42vw, 24px);
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }
  & #game-sidebar .mines-comic-setting-value::before {
    position: absolute;
    inset: 0 3px;
    z-index: -1;
    background: var(--mines-ruling), var(--mines-green);
    border: var(--mines-outline) solid var(--mines-ink);
    border-radius: 2px;
    box-shadow: inset 0 0 0 2px #abffb7;
    transform: skewX(-14deg);
    pointer-events: none;
    content: "";
  }
  & #game-sidebar .mines-comic-setting-value:focus-within::before {
    border-color: #9f0e47;
    box-shadow: inset 0 0 0 2px white;
  }
  & #game-sidebar .mines-comic-setting-value:has(.mines-comic-mine-select)::after {
    position: absolute;
    inset: 0 clamp(10px, 1.2vw, 20px) 0 auto;
    width: clamp(9px, .91vw, 15px);
    height: clamp(7px, .66vw, 11px);
    margin-block: auto;
    background: var(--mines-ink);
    clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 38%, 50% 100%, 0 38%);
    pointer-events: none;
    content: "";
  }
  & #game-sidebar .mines-comic-setting-value :is(.mines-comic-mine-select, input[name="stake"]) {
    appearance: none;
    width: 100%;
    min-width: 0;
    min-height: 0;
    color: inherit;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
    font: inherit;
    font-variant-numeric: tabular-nums;
    -webkit-text-fill-color: currentColor;
  }
  & #game-sidebar .mines-comic-setting-value select.mines-comic-mine-select {
    position: absolute;
    inset: 0;
    height: 100%;
    padding: 0 clamp(27px, 2.8vw, 46px) 0 clamp(11px, 1.42vw, 24px);
    font-size: clamp(20px, .86em, 40px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  & #game-sidebar .mines-comic-mine-select option { color: var(--mines-ink); background: var(--mines-cream); }
  & #game-sidebar .mines-comic-mine-select:disabled { opacity: 1; cursor: default; }
  @supports (appearance: base-select) and selector(::picker(select)) {
    & #game-sidebar .mines-comic-setting-value select.mines-comic-mine-select,
    & #game-sidebar .mines-comic-mine-select::picker(select) {
      appearance: base-select;
    }
    & #game-sidebar .mines-comic-setting-value select.mines-comic-mine-select {
      font-size: min(var(--mines-value), 48px);
    }
    & #game-sidebar .mines-comic-mine-select > button {
      display: block;
      inline-size: 100%;
      min-inline-size: 0;
      padding: 0;
      border: 0;
      color: inherit;
      background: transparent;
      font: inherit;
    }
    & #game-sidebar .mines-comic-mine-select::picker-icon { display: none; }
    & #game-sidebar .mines-comic-mine-select::picker(select) {
      max-block-size: min(22rem, 60dvh);
      max-inline-size: calc(100vw - 24px);
      overflow: auto;
      padding: 4px;
      color: var(--mines-ink);
      border: 3px solid var(--mines-ink);
      border-radius: 2px 3px 2px 4px;
      background: var(--mines-grain), var(--mines-cream);
      box-shadow: 3px 3px var(--mines-ink);
    }
    & #game-sidebar .mines-comic-mine-select :is(option, selectedcontent) {
      display: grid;
      grid-template-columns: minmax(0, 1fr) max-content;
      align-items: center;
      gap: .35em;
    }
    & #game-sidebar .mines-comic-mine-select selectedcontent {
      inline-size: 100%;
      text-align: start;
    }
    & #game-sidebar .mines-comic-mine-select option {
      grid-template-columns: minmax(0, 1fr) max-content 1rem;
      min-block-size: 44px;
      padding: .15em .4em;
      border-block-end: 1px solid #140f0c31;
      background: transparent;
      font-size: clamp(25px, 2.2vw, 34px);
      line-height: 1;
    }
    & #game-sidebar .mines-comic-mine-select option:last-child { border-block-end-color: transparent; }
    & #game-sidebar .mines-comic-mine-select option:is(:hover, :focus-visible, :checked) {
      background: var(--mines-ruling), var(--mines-green);
    }
    & #game-sidebar .mines-comic-mine-select option:checked { box-shadow: inset 3px 0 var(--mines-ink); }
    & #game-sidebar .mines-comic-mine-select .mines-comic-mine-count { grid-area: 1 / 1; }
    & #game-sidebar .mines-comic-mine-select option::checkmark {
      grid-area: 1 / 3;
      justify-self: end;
      font: 850 .92rem/1 var(--font-interface);
    }
    & #game-sidebar .mines-comic-mine-select .mines-comic-mine-divider { display: none; }
    & #game-sidebar .mines-comic-mine-select .mines-comic-mine-factor {
      grid-area: 1 / 2;
      justify-self: end;
      font: 850 clamp(14px, .53em, 25px)/1 var(--font-interface);
      font-variant-numeric: tabular-nums;
      letter-spacing: -.04em;
      text-align: end;
    }
  }
  & #game-sidebar .mines-comic-setting-value:has(.mines-comic-stake-step) {
    display: grid;
    grid-template-columns: minmax(44px, 21%) minmax(0, 1fr) minmax(44px, 21%);
    align-items: stretch;
    padding: 0 clamp(6px, .72vw, 12px);
  }
  & #game-sidebar .mines-comic-setting-value > label {
    display: grid;
    container-type: inline-size;
    align-items: stretch;
    min-width: 0;
    color: inherit;
    font: inherit;
  }
  & #game-sidebar .mines-comic-setting-value input[name="stake"] {
    appearance: textfield;
    height: 100%;
    padding: .02em .09em .06em;
    font-size: clamp(19px, .85em, 46px);
    text-align: center;
  }
  @supports (font-size: calc(100cqi / attr(data-mines-stake-digits type(<number>), 1))) {
    & #game-sidebar .mines-comic-setting-value input[name="stake"] {
      --mines-stake-chars: max(1, attr(data-mines-stake-digits type(<number>), 1));
      font-size: clamp(10px, calc(162cqi / var(--mines-stake-chars)), clamp(19px, .85em, 46px));
    }
  }
  & #game-sidebar .mines-comic-setting-value input[name="stake"]::-webkit-inner-spin-button,
  & #game-sidebar .mines-comic-setting-value input[name="stake"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  & #game-sidebar .mines-comic-setting-value input:disabled { opacity: 1; }
  & #game-sidebar .mines-comic-stake-step {
    --mines-step-paper: #ff9bc3;
    --mines-step-turn: -7deg;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--mines-ink);
    border: 0;
    border-radius: 2px;
    background: transparent;
    font: inherit;
    font-size: clamp(17px, .47em, 28px);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & #game-sidebar .mines-comic-stake-step[data-value="double"] {
    --mines-step-paper: var(--mines-yellow);
    --mines-step-turn: 7deg;
  }
  & #game-sidebar .mines-comic-stake-step > span {
    display: grid;
    place-items: center;
    inline-size: min(84%, 2.1em);
    min-block-size: 1.42em;
    padding: .05em .14em .12em;
    border: 2px solid var(--mines-ink);
    border-radius: 3px 1px 2px 4px;
    background: var(--mines-ruling), var(--mines-step-paper);
    box-shadow: 2px 2px var(--mines-ink);
    transform: rotate(var(--mines-step-turn));
    transition: transform .13s ease-out, filter .13s ease-out;
    pointer-events: none;
  }
  & #game-sidebar .mines-comic-stake-step:hover:not(:disabled) > span {
    filter: brightness(1.09);
    transform: translateY(-1px) rotate(var(--mines-step-turn));
  }
  & #game-sidebar .mines-comic-stake-step:active:not(:disabled) > span {
    transform: translate(2px, 2px) rotate(var(--mines-step-turn));
    box-shadow: none;
  }
  & #game-sidebar .mines-comic-stake-step:focus-visible { outline: 2px solid #921749; outline-offset: -2px; }
  & #game-sidebar .mines-comic-stake-step:disabled { opacity: .61; }
  & #game-sidebar .mines-comic-setting-value :is(output, span) { min-width: 0; white-space: nowrap; }
  & #game-sidebar :is(.mines-comic-stats, p.mines-comic-prompt) {
    min-inline-size: 0;
    margin-inline: clamp(5px, .55vw, 9px);
  }
  & #game-sidebar .mines-comic-stats {
    display: grid;
    gap: 0;
    margin-block: clamp(2px, .35vw, 7px) 0;
    padding: clamp(3px, .4vw, 7px) clamp(9px, 1.04vw, 18px);
    color: var(--mines-ink);
    border: var(--mines-outline) solid var(--mines-ink);
    border-radius: 2px;
    background: var(--mines-ruling), var(--mines-green);
    box-shadow: inset 0 0 0 2px #abffb7;
    font: italic 900 var(--mines-gain)/1.03 var(--mines-display);
    font-synthesis: style weight;
  }
  & #game-sidebar .mines-comic-stats > div {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: .35em;
    padding-block: .18em .2em;
  }
  & #game-sidebar .mines-comic-stats dt { font-size: clamp(18px, .88em, 30px); }
  & #game-sidebar .mines-comic-stats dd {
    container-type: inline-size;
    min-width: 0;
    margin: 0;
    text-align: end;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
  }
  & [data-mines-auto-running] #game-sidebar .mines-comic-stats dd { min-block-size: 1lh; }
  @supports (font-size: calc(100cqi / attr(data-mines-payout-digits type(<number>), 1))) {
    & #game-sidebar .mines-comic-stats [data-mines-last-payout] {
      --mines-payout-chars: max(1, attr(data-mines-payout-digits type(<number>), 1));
      font-size: min(1em, calc(163cqi / var(--mines-payout-chars)));
      white-space: nowrap;
    }
  }
  @media (max-width: 460px) {
    & #game-sidebar .mines-comic-stats[data-mines-payout-long] > div,
    & [data-mines-auto-running] #game-sidebar .mines-comic-stats > div {
      grid-template-columns: minmax(0, 1fr);
      gap: .18em;
    }
  }
  & #game-sidebar :is(.mines-comic-prompt, p.mines-comic-prompt) {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    min-height: clamp(39px, 4.28vw, 71px);
    margin-block: clamp(0px, .2vw, 4px);
    padding: .23em .6em;
    color: var(--mines-ink);
    font: italic 900 clamp(19px, 2.23vw, 37px)/1.03 var(--mines-display);
    font-synthesis: style weight;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }
  & #game-sidebar .mines-comic-prompt::before {
    position: absolute;
    inset: 0 clamp(5px, .5vw, 9px);
    z-index: -1;
    border: max(2px, calc(var(--mines-outline) - 1px)) solid var(--mines-ink);
    border-radius: 2px;
    background: #fff8e598;
    transform: skewX(-12deg);
    content: "";
  }
  & #game-sidebar .mines-comic-prompt:empty { display: none; }
  & #game-sidebar .mines-comic-random {
    justify-self: center;
    width: 100%;
    min-height: 42px;
    border: 2px solid var(--mines-ink);
    border-radius: 0;
    background: #fff5cf;
    color: var(--mines-ink);
    font: 900 clamp(17px, 1.65vw, 28px)/1 var(--mines-display);
  }
  & #game-sidebar .mines-comic-random:hover:not(:disabled) { background: #ffe95d; }
  & [data-mines-auto-running] #game-sidebar .mines-comic-prompt { block-size: clamp(39px, 4.28vw, 71px); }

  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)) {
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    justify-self: center;
    width: calc(100% + clamp(1px, 1.2vw, 20px));
    min-height: clamp(55px, 8.72vw, 146px);
    margin: clamp(3px, .73vw, 13px) 0 0;
    padding: .26em .34em .52em;
    color: var(--mines-ink);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font: 900 clamp(25px, 3.87vw, 65px)/.98 var(--mines-display);
    font-synthesis: style weight;
    letter-spacing: -.029em;
    text-align: center;
    text-wrap: balance;
    overflow-wrap: normal;
    transform: rotate(-3.8deg) skewX(-13deg);
    transition: transform .16s ease-out;
    touch-action: manipulation;
  }
  & #game-sidebar .mines-comic-primary.mines-comic-cashout {
    grid-template-columns: minmax(0, 1fr);
    padding: clamp(7px, 1.06vw, 18px) clamp(12px, 2.15vw, 36px) clamp(13px, 2.05vw, 34px);
    -webkit-tap-highlight-color: transparent;
  }
  & #game-sidebar .mines-comic-cashout-content {
    display: grid;
    container-type: inline-size;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center;
    column-gap: clamp(7px, 1.15vw, 19px);
    inline-size: 100%;
    min-inline-size: 0;
    font: 900 clamp(20px, 3.1vw, 51px)/1.04 var(--font-interface);
    letter-spacing: -.055em;
    text-align: start;
    transform: skewX(9deg);
  }
  & #game-sidebar .mines-comic-cashout-content:not(:has([data-trail-cashout])) {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
  }
  & #game-sidebar .mines-comic-cashout-content [data-trail-cashout] {
    min-inline-size: 0;
    font-size: .93em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }
  & #game-sidebar .mines-comic-cashout-factor {
    justify-self: end;
    padding: .24em .42em .28em;
    border: max(2px, calc(var(--mines-outline) * .65)) solid var(--mines-ink);
    border-radius: 3px 2px 4px 2px;
    background: var(--mines-ruling), #fff5ce;
    box-shadow: 1px 2px var(--mines-ink);
    font: 900 clamp(13px, 2.8vw, 24px)/1.05 var(--font-interface);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.045em;
    white-space: nowrap;
    transform: rotate(6deg);
  }
  & #game-sidebar .mines-comic-cashout-content[data-mines-cashout-long] {
    grid-template-columns: minmax(0, 1fr) max-content;
    row-gap: .06em;
    font-size: clamp(19px, 2.67vw, 44px);
  }
  & #game-sidebar .mines-comic-cashout-content[data-mines-cashout-long] .mines-comic-cashout-label { grid-area: 1 / 1; }
  & #game-sidebar .mines-comic-cashout-content[data-mines-cashout-long] .mines-comic-cashout-factor { grid-area: 1 / 2 / span 2; }
  & #game-sidebar .mines-comic-cashout-content[data-mines-cashout-long] [data-trail-cashout] {
    grid-area: 2 / 1;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  @supports (font-size: calc(100cqi / attr(data-mines-cashout-digits type(<number>), 1))) {
    & #game-sidebar .mines-comic-cashout-content[data-mines-cashout-long] [data-trail-cashout] {
      --mines-cashout-chars: max(1, attr(data-mines-cashout-digits type(<number>), 1));
      font-size: min(1em, calc((100cqi - clamp(88px, 22cqi, 150px)) * 1.5 / var(--mines-cashout-chars)));
      white-space: nowrap;
    }
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button))::before,
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button))::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    border: max(3px, var(--mines-outline)) solid var(--mines-ink);
    background: var(--mines-ruling), var(--mines-yellow);
    pointer-events: none;
    content: "";
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button))::before {
    inset: 5px -5px -5px 5px;
    z-index: -2;
    background: var(--mines-ink);
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button))::after {
    background:
      linear-gradient(90deg, var(--mines-pink), var(--mines-pink)) center 84% / 78% .13em no-repeat,
      var(--mines-ruling), var(--mines-yellow);
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)):is(:hover,:active):not(:disabled) {
    color: var(--mines-ink);
    border: 0;
    background: transparent;
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)):hover:not(:disabled)::after {
    background-color: #fff752;
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)):active:not(:disabled) {
    transform: translate(2px, 2px) rotate(-3deg) skewX(-13deg);
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)):focus-visible {
    outline: 3px solid #ad1550;
    outline-offset: 4px;
  }
  & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)):disabled { opacity: .65; }
  & #game-sidebar .auto-series-actions .auto-stop-button::after { background-color: #ff95b7; }
  & #game-sidebar .mines-comic-result-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(5px, .52vw, 9px);
    min-width: 0;
  }
  & #game-sidebar .mines-comic-next-round {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    gap: .36em;
    min-width: 44px;
    min-height: 44px;
    margin-inline-end: clamp(3px, .58vw, 10px);
    padding: .28em .7em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 2px 4px 2px 3px;
    background: linear-gradient(0deg, #ffadd0 0 23%, transparent 23%), var(--mines-ruling), #fff3d1;
    box-shadow: 2px 3px var(--mines-ink);
    font: 820 clamp(15px, 1.23vw, 19px)/1 var(--font-interface);
    transform: rotate(-2deg);
    transition: transform .13s ease-out;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & #game-sidebar .mines-comic-next-round > span { font-size: 1.26em; }
  & #game-sidebar .mines-comic-next-round:hover:not(:disabled) { background-color: #ffe4ed; }
  & #game-sidebar .mines-comic-next-round:active:not(:disabled) {
    transform: translate(2px, 2px) rotate(-2deg);
    box-shadow: none;
  }
  & #game-sidebar .mines-comic-next-round:focus-visible { outline: 3px solid #ad1550; outline-offset: 2px; }
  & #game-sidebar .mines-comic-auto-settings-switch {
    --mines-auto-thumb: 25%;
    --mines-auto-track: #e8d5b2;
    display: inline-flex;
    justify-self: end;
    align-items: center;
    gap: .56em;
    min-height: 44px;
    margin-inline-end: max(0px, calc((100% - 30rem) / 2));
    padding: .35em .66em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 3px 2px 4px 2px;
    background: var(--mines-ruling), #fff5d5;
    box-shadow: 1px 2px var(--mines-ink);
    font: 820 clamp(14px, 1.38vw, 19px)/1.13 var(--font-interface);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & #game-sidebar .mines-comic-auto-settings-switch[aria-checked="true"] {
    --mines-auto-thumb: 75%;
    --mines-auto-track: var(--mines-green);
  }
  & #game-sidebar .mines-comic-auto-settings-switch::after {
    flex: none;
    width: 2.65em;
    height: 1.47em;
    border: 2px solid var(--mines-ink);
    border-radius: 100vmax;
    background: radial-gradient(circle at var(--mines-auto-thumb) 50%, #fff5d5 0 .41em, var(--mines-ink) .44em .5em, transparent .53em), var(--mines-auto-track);
    content: "";
  }
  & #game-sidebar .mines-comic-auto-settings-switch:hover { background-color: #fff9e7; }
  & #game-sidebar .mines-comic-auto-settings-switch:focus-visible { outline: 2px solid #ad1550; outline-offset: 2px; }
  & #game-sidebar .mines-comic-mode {
    display: grid;
    align-items: center;
    justify-items: center;
    min-width: 0;
    min-height: clamp(30px, 3.5vw, 57px);
    margin: 0;
    color: #524635;
    font: italic 800 clamp(16px, 1.9vw, 32px)/1 var(--mines-display);
    font-synthesis: style weight;
  }
  & #game-sidebar .mines-comic-mode .auto-mode {
    width: min(100%, 30rem);
    border-radius: 3px;
    border-color: var(--mines-ink);
    background: #fff6dc;
  }
  & #game-sidebar .mines-comic-form .mines-comic-mode {
    margin-block-start: clamp(15px, 1.8vw, 30px);
  }
  & #game-sidebar .mines-comic-mode .auto-mode button {
    min-height: 44px;
    font-style: italic;
    font-size: clamp(14px, 1.47vw, 23px);
  }
  & #game-sidebar .mines-comic-mode .auto-mode button[aria-pressed="true"] { background: var(--mines-green); }
  & .mines-comic-toggles {
    position: relative;
    z-index: 3;
    display: grid;
    grid-area: controls;
    grid-template-columns: repeat(2, max-content);
    place-self: start end;
    column-gap: clamp(13px, 1.6vw, 26px);
    min-width: 0;
    margin-block-start: var(--mines-toggles-top);
    margin-inline-end: var(--mines-sidebar-inset);
    color: var(--mines-ink);
    font: 820 clamp(14px, 1.3vw, 18px)/1.16 var(--font-interface);
  }
  & .mines-comic-toggles > label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45em;
    min-width: 0;
    min-height: var(--mines-toggle-height);
    color: inherit;
    font: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & .mines-comic-toggles label > span {
    display: flex;
    align-items: center;
    gap: .25em;
    white-space: nowrap;
  }
  & .mines-comic-toggles :is(.mines-comic-sound-label, .mines-comic-turbo-label)::before {
    flex: none;
    width: .9em;
    height: .94em;
    background: currentColor;
    content: "";
  }
  & .mines-comic-toggles .mines-comic-sound-label::before {
    width: 1.07em;
    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%);
  }
  & .mines-comic-toggles .mines-comic-turbo-label::before {
    clip-path: polygon(57% 0, 98% 0, 65% 42%, 94% 42%, 19% 100%, 36% 55%, 4% 55%);
  }
  & .mines-comic-toggles input {
    --mines-switch-thumb: 25%;
    --mines-switch-track: #e8d5b2;
    appearance: none;
    flex: none;
    width: 2.7em;
    height: 1.53em;
    min-height: 0;
    margin: 0;
    padding: 0;
    color: inherit;
    border: 2px solid var(--mines-ink);
    border-radius: 100vmax;
    background: radial-gradient(circle at var(--mines-switch-thumb) 50%, #fff5d5 0 .43em, var(--mines-ink) .46em .52em, transparent .55em), var(--mines-switch-track);
    cursor: pointer;
  }
  & .mines-comic-toggles input:checked {
    --mines-switch-thumb: 75%;
    --mines-switch-track: var(--mines-green);
  }
  & .mines-comic-toggles [data-mines-turbo]:checked { --mines-switch-track: #ff85ba; }
  & .mines-comic-toggles input:focus-visible { outline: 2px solid #ad1550; outline-offset: 2px; }
  & #game-sidebar .auto-series-fields,
  & #game-sidebar .notice {
    background: #fff6de;
    border: 2px solid var(--mines-ink);
    border-radius: 3px;
  }
  & #game-sidebar .auto-series-fields :is(input, select) { background: var(--mines-green); }
  & #game-sidebar .auto-series-status { color: var(--mines-ink); }
  & #game-sidebar .auto-series-status:not(:empty) { margin-block-start: clamp(8px, 1.3vw, 22px); }
  & [data-mines-auto-running] #game-sidebar .auto-series-status {
    position: static;
    inline-size: 100%;
    block-size: 2lh;
    margin-block-start: clamp(8px, 1.3vw, 22px);
    clip-path: none;
    overflow: auto;
    scrollbar-width: thin;
    line-height: 1.28;
  }
  @media (max-width: 460px) {
    & [data-mines-auto-running] #game-sidebar .auto-series-status { block-size: 3lh; }
  }

  & .mines-comic-tools {
    display: flex;
    grid-area: tools;
    flex-wrap: wrap;
    align-items: start;
    gap: 8px 12px;
    width: min(100%, 60rem);
    margin-inline: auto;
    padding-block: 0 clamp(14px, 1.5vw, 25px);
  }
  & .mines-comic-round-tools {
    --mines-round-tool-gap: clamp(7px, 1.1vw, 12px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: var(--mines-round-tool-gap);
    flex: 0 0 min(100%, 26rem);
    min-width: 0;
  }
  & .mines-comic-disclosure {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
  }
  & .mines-comic-round-tool {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(4px, .85vw, 5px);
    min-width: 0;
    min-height: 44px;
    padding: .27em clamp(6px, 1vw, 9px);
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 3px 4px 3px 2px;
    background: var(--mines-ruling), #d1ffc4;
    box-shadow: 2px 3px var(--mines-ink);
    font: italic 900 clamp(13px, 1.4vw, 16px)/1.1 var(--mines-display);
    font-synthesis: style weight;
    text-align: start;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  & .mines-comic-disclosure > summary {
    grid-template-columns: auto minmax(0, 1fr) .53em;
    width: calc((100% - var(--mines-round-tool-gap)) / 2);
    list-style: none;
  }
  & .mines-comic-disclosure > summary::-webkit-details-marker { display: none; }
  & .mines-comic-round-tool:hover:not(:disabled) { background-color: var(--mines-green); }
  & .mines-comic-round-tool:focus-visible { outline: 2px solid #921749; outline-offset: -4px; }
  & .mines-comic-disclosure > summary::after {
    grid-column: 3;
    justify-self: end;
    width: .41em;
    height: .41em;
    margin: -.16em .1em 0 0;
    border: solid currentColor;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    content: "";
  }
  & .mines-comic-disclosure[open] > summary::after {
    margin-block-start: .16em;
    transform: rotate(225deg);
  }
  & .mines-comic-round-details {
    position: relative;
    grid-column: 2;
    grid-row: 1;
    background-color: #fff2b3;
  }
  & .mines-comic-round-details:disabled {
    opacity: .72;
    cursor: default;
  }
  & .mines-comic-disclosure-icon {
    display: grid;
    place-items: center;
    inline-size: 1.32em;
    block-size: 1.32em;
    padding-block-end: .03em;
    border: 2px solid var(--mines-ink);
    border-radius: 3px 1px 4px 2px;
    background: var(--mines-yellow);
    box-shadow: 1px 1px var(--mines-ink);
    font: 850 .9em/1 var(--font-interface);
    transform: rotate(-5deg);
  }
  & .mines-comic-round-details .mines-comic-disclosure-icon { background: #ffb2c7; }
  & .mines-comic-disclosure-body {
    container-type: inline-size;
    min-width: 0;
    margin-block: 9px 3px;
    padding: clamp(8px, 1vw, 14px);
    border: 2px solid var(--mines-ink);
    border-radius: 2px 4px 3px 2px;
    background: var(--mines-grain), var(--mines-cream);
  }
  & .mines-comic-next-empty {
    margin: 0;
    color: var(--mines-ink);
    font: 730 clamp(13px, 1.25vw, 16px)/1.32 var(--font-interface);
  }
  & [data-mines-auto-running] .mines-comic-disclosure-body {
    block-size: clamp(105px, 14vw, 144px);
    overflow: auto;
    scrollbar-width: thin;
  }
  & [data-mines-auto-running] .mines-comic-next-empty {
    display: grid;
    align-content: center;
    min-block-size: 100%;
  }
  & .mines-comic-next {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(7px, 1.2vw, 16px);
    margin: 0;
  }
  & .mines-comic-next > div {
    --mines-metric-paper: #fff7db;
    display: grid;
    align-content: space-between;
    min-width: 0;
    min-height: clamp(55px, 18cqi, 73px);
    gap: .45rem;
    padding: .58em .72em;
    border: 2px solid var(--mines-ink);
    border-radius: 2px 4px 1px 3px;
    background: var(--mines-ruling), var(--mines-metric-paper);
    box-shadow: 2px 3px var(--mines-ink);
  }
  & .mines-comic-next > [data-mines-next-metric="factor"] { --mines-metric-paper: #b7ffa9; }
  & .mines-comic-next > [data-mines-next-metric="payout"] { --mines-metric-paper: #fff285; }
  & .mines-comic-next dt { font: 760 clamp(12px, 3.5cqi, 14px)/1.2 var(--font-interface); }
  & .mines-comic-next dd {
    min-width: 0;
    margin: 0;
    font: italic 900 clamp(20px, 6.5cqi, 30px)/1.04 var(--mines-display);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }
  & .mines-comic-next dd small { font-size: .65em; white-space: nowrap; }
  & .mines-comic-next-limit {
    display: grid;
    gap: .3em;
    margin: 0;
    padding: .65em .8em;
    border: 2px solid var(--mines-ink);
    background: #ffd3df;
    font-weight: 730;
  }
  & .mines-comic-next-limit strong {
    font: italic 900 clamp(22px, 3.1vw, 34px)/1.05 var(--mines-display);
    overflow-wrap: anywhere;
  }
  & .mines-comic-tools .button {
    min-height: 37px;
    padding: .3em .75em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 3px;
    background: var(--mines-yellow);
    box-shadow: 2px 3px var(--mines-ink);
    font: italic 800 clamp(15px, 1.32vw, 22px)/1.1 var(--mines-display);
  }
  & .mines-comic-tools .button:nth-of-type(even) { background: var(--mines-cream); }
  & .mines-comic-tools .button:hover:not(:disabled) { background: var(--mines-green); }

  @media (max-width: 380px) {
    & .topbar .ld-theme-switch {
      inline-size: 34px;
      justify-content: center;
      font-size: 0;
    }
    & .topbar .ld-theme-switch::before {
      inline-size: 12px;
      block-size: 12px;
    }
  }

  @media (min-width: 1050px) {
    & .surface:has(> #content[data-game="mines"]) .topbar {
      min-height: clamp(58px, 4.12vw, 69px);
      background: #0b0b0a;
    }
    & .surface:has(> #content[data-game="mines"]) .redesign-brand { font-size: clamp(32px, 3.37vw, 57px); }
    & .surface:has(> #content[data-game="mines"]) .ld-primary-links a { font-size: clamp(17px, 1.58vw, 26px); }
    & .surface:has(> #content[data-game="mines"]) .topbar .header-credit {
      min-width: clamp(115px, 12.45vw, 208px);
      min-height: clamp(36px, 2.87vw, 48px);
      justify-content: center;
      color: var(--mines-ink);
      border: 0;
      border-radius: 11px;
      background: var(--mines-yellow);
    }
    & .surface:has(> #content[data-game="mines"]) .header-credit .number {
      color: inherit;
      font: italic 900 clamp(18px, 1.78vw, 30px)/1 var(--mines-display);
    }
    & .surface:has(> #content[data-game="mines"]) .header-credit .number::after { content: " кр."; }
    & .surface:has(> #content[data-game="mines"]) .header-credit .credit-glyph { color: inherit; }
  }

  @media (max-width: 860px) {
    & #content[data-game="mines"] {
      --mines-value: clamp(24px, 5.6vw, 33px);
      --mines-gain: clamp(22px, 5.15vw, 31px);
      --mines-control-gap: clamp(8px, 2.14vw, 13px);
    }
    & .mines-comic-page {
      grid-template: "identity" auto "board" auto "controls" auto "tools" auto / minmax(0, 1fr);
      max-width: 650px;
      gap: 7px;
      padding-block-start: 7px;
    }
    & .mines-comic-identity {
      grid-area: identity;
      margin-block-start: 0;
      padding-block: .05em .13em;
    }
    & .mines-comic-identity h1 {
      padding-block: .22em .35em;
      font-size: clamp(36px, 7vw, 53px);
    }
    & .mines-comic-toggles {
      grid-area: identity;
      place-self: center end;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      column-gap: clamp(7px, 1.7vw, 13px);
      width: min(60%, 16rem);
      margin: 0;
      color: #fff4d3;
      text-shadow: 0 1px 2px #19060a, 0 1px #19060a, 1px 0 #19060a, -1px 0 #19060a;
      font-size: clamp(13px, 2.7vw, 16px);
    }
    & .mines-comic-toggles label > span { filter: drop-shadow(0 1px #19060a); }
    & .mines-comic-toggles input:focus-visible { outline-color: #fff4d3; }
    & .mines-comic-stage.stage-column { margin-block-start: 0; }
    & .mines-comic-stage .stage.stage-mines { padding: clamp(10px, 2.7vw, 16px); }
    & .mines-comic-stage [data-step-grid] .step-cell { aspect-ratio: 1; }
    & #game-sidebar.mines-comic-sidebar {
      align-self: start;
      min-height: 0;
      padding: clamp(14px, 3.8vw, 21px) clamp(15px, 4.1vw, 23px);
    }
    & #game-sidebar .mines-comic-setting { grid-template-columns: minmax(0, 30%) minmax(0, 1fr); }
    & #game-sidebar .mines-comic-setting-value { padding-inline-start: 12px; }
    & #game-sidebar .mines-comic-stats > div { padding-block: .17em .2em; }
    & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)) {
      width: calc(100% - 9px);
      min-height: clamp(60px, 13.5vw, 89px);
      margin-block: 7px 4px;
      font-size: clamp(26px, 7.1vw, 42px);
    }
    & #game-sidebar .mines-comic-cashout-content { font-size: clamp(20px, 5.4vw, 42px); }
    & #game-sidebar .mines-comic-cashout-content[data-mines-cashout-long] { font-size: clamp(19px, 3.55vw, 31px); }
    & #game-sidebar .mines-comic-mode { min-height: 26px; }
  }
  @media (max-width: 440px) {
    & [data-mines-auto-running] .mines-comic-disclosure-body { block-size: 178px; }
    & .mines-comic-next { grid-template-columns: minmax(0, 1fr); }
    & .mines-comic-next > div {
      grid-template-columns: minmax(0, 1fr) minmax(0, max-content);
      align-items: center;
      min-height: 46px;
    }
    & .mines-comic-next dd { text-align: end; }
  }
  @media (max-width: 400px) {
    & .mines-comic-toggles { width: min(57%, 16rem); }
    & .mines-comic-toggles :is(.mines-comic-sound-label, .mines-comic-turbo-label)::before { content: none; }
    & .mines-comic-toggles input { width: 2.45em; }
  }
  @media (prefers-reduced-motion: reduce) {
    & #game-sidebar .mines-comic-stake-step > span { transition: none; }
    & #game-sidebar .mines-comic-next-round { transition: none; }
    & #game-sidebar :is(.mines-comic-primary, .auto-series-actions :is(.play-primary, .auto-stop-button)) { transition: none; }
  }
}

html[data-ludik-theme="comic"] #dialog:is([data-variant="mines-rules"], [data-variant="mines-proof"], [data-variant="mines-history"]) {
  --mines-dialog-edge: polygon(
    .6% 2%, 6% .3%, 13% 1.4%, 20% 0, 27% 1.1%, 31% .3%, 39% 1.5%, 48% .2%,
    55% 1.6%, 64% .4%, 72% 1.2%, 79% 0, 86% 1.4%, 94% .3%, 99% 2%, 98.8% 11%,
    100% 20%, 98.7% 28%, 99.6% 37%, 98.8% 47%, 100% 55%, 98.65% 63%, 99.7% 71%,
    98.75% 81%, 100% 88%, 98.7% 97%, 94% 100%, 86% 98.4%, 80% 99.6%, 74% 98.8%,
    67% 99.7%, 59% 98.15%, 52% 99.6%, 46% 98.5%, 38% 100%, 30% 98.4%, 23% 99.5%,
    17% 98.2%, 9% 99.7%, 1% 98.7%, .2% 92%, 1.2% 82%, .1% 73%, .85% 65%, 0 56%,
    1% 46%, .2% 38%, 1.1% 29%, 0 19%, .9% 10%
  );
  box-sizing: border-box;
  width: min(690px, calc(100% - 22px));
  max-block-size: calc(100dvh - 26px);
  overflow: visible;
  padding: 0;
  color: var(--mines-ink);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;

  &::backdrop { background: #160b0edd; }
  & #dialog-content {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: clamp(10px, 2.6vw, 18px);
    max-block-size: calc(100dvh - 26px);
    padding: clamp(12px, 4vw, 28px);
  }
  & #dialog-content::before, & #dialog-content::after {
    position: absolute;
    inset: 0;
    z-index: -2;
    clip-path: var(--mines-dialog-edge);
    background: var(--mines-ink);
    pointer-events: none;
    content: "";
  }
  & #dialog-content::after {
    inset: 3px;
    z-index: -1;
    background: var(--mines-grain), var(--mines-cream);
  }
  & .dialog-head {
    align-items: center;
    margin: 0;
    gap: .43em;
  }
  & .dialog-head:has(.dialog-back) h2 { margin-inline-end: auto; }
  & .dialog-head h2 {
    min-width: 0;
    margin-block: 0;
    padding: .26em .41em .3em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    background: var(--mines-ruling), var(--mines-yellow);
    box-shadow: 2px 3px var(--mines-ink);
    font: italic 900 clamp(1.25rem, 4.8vw, 2.42rem)/1 var(--mines-display);
    text-wrap: balance;
    transform: rotate(-2deg);
  }
  & .dialog-head .icon-button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 3px;
    background: var(--mines-cream);
    box-shadow: 2px 3px var(--mines-ink);
    font-weight: 900;
  }
  & #dialog-content > :is(section, .stack, .mines-history-list) {
    gap: .7em;
    min-width: 0;
    min-height: 0;
    padding: 2px 5px 7px 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--mines-ink) transparent;
    color: var(--mines-ink);
    font: 600 clamp(.8rem, 2vw, 1rem)/1.43 var(--font-interface, system-ui, sans-serif);
    overflow-wrap: anywhere;
  }
  & :is(p, small, label, legend, dt, dd, .muted, .notice) { color: var(--mines-ink); }
  & :is(.stat, .notice, .table-wrap, details, .minigame-rules section) {
    color: var(--mines-ink);
    border: 1px solid var(--mines-ink);
    border-radius: 3px;
    background: #fff8e3;
  }
  & .notice { padding: .45rem .6rem; }
  & .stat :is(span, strong) { color: var(--mines-ink); }
  & .stat strong { font-weight: 850; }
  & :is(td, th) { color: var(--mines-ink); border-color: #7863415e; }
  & th {
    color: var(--mines-cream);
    background: var(--mines-ink);
  }
  & .mines-comic-proof-body details > summary {
    padding: .3em .55em;
    color: var(--mines-ink);
    background: var(--mines-yellow);
    font-weight: 830;
  }
  & :is(pre, input, textarea) {
    max-inline-size: 100%;
    color: var(--mines-ink);
    border-color: var(--mines-ink);
    border-radius: 3px;
    background: #fffae9;
  }
  & #dialog-content .button {
    min-height: 38px;
    max-width: 100%;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 3px;
    background: var(--mines-green);
    box-shadow: 2px 2px var(--mines-ink);
    font-weight: 790;
    white-space: normal;
  }
  & .minigame-rules > .button { background: var(--mines-yellow); }
  & :is(.icon-button, .button):hover:not(:disabled) { background: #ffe874; }
  & :is(button, input, textarea, summary):focus-visible { outline: 3px solid #bd195a; outline-offset: 2px; }
  & .minigame-rules section {
    padding: 0 .7em .7em;
    box-shadow: 2px 3px var(--mines-ink);
  }
  & .minigame-rules section h3 {
    margin-inline: -.7em;
    padding: .36em .64em;
    color: var(--mines-cream);
    border-inline-start: 5px solid var(--mines-pink);
    background: var(--mines-ink);
    font: italic 870 clamp(1.05rem, 3.2vw, 1.55rem)/1.1 var(--mines-display);
  }
  & .minigame-rules dl {
    border: 1px solid var(--mines-ink);
    border-radius: 2px;
    background: var(--mines-ink);
  }
  & .minigame-rules dl div { background: #fff8e3; }
  & .minigame-rules dl div:nth-child(even) { background: #f7e5b9; }
  & .minigame-rules ol li::marker { color: #aa164e; font-weight: 900; }
}

html[data-ludik-theme="comic"] #dialog[data-variant="mines-history"] {
  & .mines-history-list {
    display: grid;
    align-content: start;
    min-block-size: 0;
    margin: 0;
    list-style: none;
  }
  & .mines-history-bet {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.22fr) repeat(2, minmax(0, .85fr));
    grid-template-areas: "factor date stake paid";
    align-items: center;
    gap: .62em;
    width: 100%;
    min-height: 60px;
    padding: .45em .55em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 3px;
    background: #fff7de;
    box-shadow: 2px 3px var(--mines-ink);
    font-weight: 730;
    text-align: start;
  }
  & .mines-history-bet:hover { background: #ffefb7; }
  & .mines-history-factor {
    grid-area: factor;
    padding: .25em .32em;
    color: var(--mines-ink);
    border: 2px solid var(--mines-ink);
    border-radius: 2px;
    background: var(--mines-green);
    font: italic 890 clamp(1.1rem, 3.2vw, 1.65rem)/1 var(--mines-display);
    text-align: center;
  }
  & .mines-history-bet[data-result="loss"] .mines-history-factor { background: #ffabc1; }
  & .mines-history-date { grid-area: date; }
  & .mines-history-amount {
    display: grid;
    min-width: 0;
    gap: .15em;
    font-variant-numeric: tabular-nums;
  }
  & .mines-history-amount:nth-last-child(2) { grid-area: stake; }
  & .mines-history-amount:last-child { grid-area: paid; }
  & .mines-history-amount small { font-size: .77em; }
  & .mines-history-empty {
    margin: 0;
    padding: .55em .75em;
    border-inline-start: 3px solid var(--mines-pink);
    background: #fff9e7;
  }
  @media (max-width: 430px) {
    & .mines-history-bet {
      grid-template-columns: minmax(0, .7fr) repeat(2, minmax(0, 1fr));
      grid-template-areas: "factor date date" "factor stake paid";
      gap: .3em .55em;
    }
  }
}
