#content[data-game="double"] {
  width: min(100%, 1780px);
  max-width: none;
  padding: 0;
  color-scheme: light;
}

html[data-ludik-theme="comic"] .surface:has(> #content[data-game="double"]) > #live-strip {
  display: none;
}

@media (max-width: 360px) {
  .surface:has(> #content[data-game="double"]) #primary-nav {
    & :is(.ld-primary-links a, .ld-more summary) { padding-inline: 3px; }
    & .ld-theme-switch { gap: .3em; font-size: .625rem; }
  }
}

.double-game {
  --double-ink: #18110d;
  --double-cream: #fff2d9;
  --double-yellow: #ffeb12;
  --double-pink: #ff0574;
  --double-mint: #84f6ad;
  --double-red: #ff1649;
  --double-paper-image: url("/redesign-art/hilo-paper.webp");
  --double-display-type: Impact, "Arial Narrow", "Roboto Condensed", sans-serif;
  --double-edge: polygon(0 6%, 2% 2.5%, 4% 3.2%, 6% .5%, 9% 2.1%, 12% 0, 15% 2.3%, 18% .8%, 21% 2.2%, 24% .3%, 28% 2.2%, 31% .6%, 35% 2.4%, 38% 1%, 41% 0, 44% 2.1%, 48% .5%, 51% 2.1%, 54% 0, 57% 1.5%, 61% .4%, 64% 2.5%, 67% .7%, 70% 2%, 74% 0, 77% 1.9%, 80% .5%, 83% 2.6%, 86% .8%, 89% 2.7%, 92% .5%, 95% 2.2%, 97.8% 1.8%, 100% 6%, 98.8% 11%, 100% 16%, 98.8% 22%, 100% 29%, 98.7% 36%, 100% 43%, 99% 50%, 100% 56%, 99% 63%, 100% 70%, 98.6% 77%, 100% 84%, 99% 90%, 100% 95%, 97.6% 99%, 95% 98.2%, 92% 100%, 89% 97.7%, 86% 99.7%, 82% 98.1%, 79% 100%, 75% 98.2%, 72% 99.7%, 69% 98.1%, 66% 100%, 62% 98.5%, 58% 99.7%, 54% 97.9%, 50% 100%, 47% 98.4%, 44% 99.6%, 41% 98.2%, 38% 100%, 35% 98.5%, 32% 100%, 29% 98.4%, 25% 99.6%, 22% 98.1%, 18% 100%, 15% 98.5%, 12% 99.8%, 9% 98%, 6% 99.6%, 3% 97.6%, 1% 98.2%, 0 95%, 1% 89%, 0 83%, 1.2% 77%, 0 71%, 1.2% 65%, 0 59%, 1.2% 53%, 0 47%, 1% 41%, 0 35%, 1.1% 29%, 0 23%, 1.2% 17%, 0 12%);
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  color: var(--double-ink);
  font-synthesis: style;
  background: var(--double-red);
  overflow: clip;

  &::before {
    --dot: 7px;
    --shift: calc(var(--dot) / 2);
    position: absolute;
    inset: -30%;
    z-index: -1;
    background:
      radial-gradient(circle, #210d14 0 17%, transparent 27%) 0 0 / var(--dot) var(--dot),
      radial-gradient(circle, #210d14 0 17%, transparent 27%) var(--shift) var(--shift) / var(--dot) var(--dot),
      repeating-linear-gradient(0deg, #61001624 0 1px, transparent 1px 3px),
      radial-gradient(ellipse at 48% 45%, #ff416a, #ff1b4d 50%, #f60038 85%);
    transform: rotate(-16deg);
    pointer-events: none;
    content: "";
  }

  & [hidden] { display: none !important; }
  & :is(button, input) { font: inherit; }
  & button { touch-action: manipulation; }
  & button:disabled { cursor: default; }
  & :is(button, input):focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
  & :is(h1, h2, p, ol, ul) { margin: 0; }
  & :is(ol, ul) { padding: 0; list-style: none; }
}

.double-layout {
  display: grid;
  grid-template-columns: minmax(0, 24.2fr) minmax(0, 49.8fr) minmax(0, 25fr);
  grid-template-areas: "hero board controls" "colors colors colors" "players players players";
  gap: clamp(8px, .85cqw, 16px);
  padding: clamp(11px, 1.5cqw, 26px) clamp(9px, 1.05cqw, 19px) clamp(21px, 2.8cqw, 45px);
}
.double-layout > :where(section), .double-hero > :where(section) { margin: 0; }

.double-paper {
  --double-paper-line: clamp(2px, .23cqw, 4px);
  --double-paper-color: var(--double-cream);
  position: relative;
  isolation: isolate;

  &::before, &::after {
    position: absolute;
    z-index: -1;
    clip-path: var(--double-edge);
    pointer-events: none;
    content: "";
  }
  &::before { inset: 0; background: var(--double-ink); }
  &::after {
    inset: var(--double-paper-line);
    background: var(--double-paper-color) var(--double-paper-image) center / clamp(240px, 36cqw, 625px);
    background-blend-mode: multiply;
  }
}

.double-hero {
  grid-area: hero;
  z-index: 2;
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(290px, 36.3cqw, 630px);
}

.double-game .double-title {
  --double-title-shape: polygon(1% 16%, 8% 12%, 5% 6%, 17% 9%, 23% 2%, 29% 8%, 35% 3%, 40% 5%, 51% 0, 51% 5%, 61% 0, 63% 5%, 72% 1%, 75% 6%, 85% 1%, 87% 6%, 98% 3%, 96% 13%, 100% 14%, 96% 25%, 99% 29%, 97% 38%, 100% 39%, 96% 51%, 99% 54%, 95% 63%, 97% 71%, 90% 78%, 94% 83%, 78% 87%, 82% 90%, 65% 93%, 66% 98%, 52% 94%, 48% 100%, 37% 96%, 30% 100%, 25% 95%, 16% 100%, 16% 94%, 4% 98%, 8% 90%, 0 91%, 5% 80%, 0 79%, 4% 69%, 0 66%, 4% 57%, 0 54%, 4% 45%, 0 37%, 7% 29%, 1% 26%, 5% 21%);
  position: absolute;
  z-index: 2;
  inset: .5% -8% auto -1%;
  display: grid;
  place-items: center;
  padding: .23em .06em .33em;
  color: #100c09;
  font: italic 900 clamp(57px, 9cqw, 152px)/.9 var(--double-display-type);
  letter-spacing: -.065em;
  transform: rotate(-10deg);
  isolation: isolate;

  &::before, &::after {
    position: absolute;
    z-index: -1;
    clip-path: var(--double-title-shape);
    content: "";
  }
  &::before { inset: -2px; background: var(--double-ink); }
  &::after {
    inset: 0;
    background: var(--double-yellow) var(--double-paper-image) center / 280px;
    background-blend-mode: multiply;
  }
  & span { position: relative; transform: skewX(-3deg); }
  & span::after {
    position: absolute;
    inset: auto -.01em -.17em -.06em;
    height: .12em;
    background: var(--double-pink);
    clip-path: polygon(0 54%, 19% 30%, 100% 2%, 97% 44%, 43% 62%, 29% 89%, 32% 66%, 2% 100%);
    content: "";
  }
}

.double-mascot {
  position: absolute;
  inset: auto 0 clamp(58px, 8.35cqw, 148px) -1%;
  aspect-ratio: 411 / 273;
  pointer-events: none;

  & img { display: block; }
  & .double-mascot-art { position: relative; width: 100%; height: auto; }
  & .double-mascot-coin { position: absolute; top: 29.67%; left: 72.263%; width: 17.518%; height: auto; }
}

.double-history {
  padding: clamp(9px, .9cqw, 16px) clamp(9px, 1.05cqw, 19px) clamp(13px, 1.3cqw, 23px);

  & ol { display: flex; flex-wrap: wrap; gap: clamp(3px, .29cqw, 5px); margin-top: clamp(6px, .65cqw, 11px); }
  & li { display: flex; }
  & li.double-history-empty { min-height: clamp(34px, 2.8cqw, 48px); align-items: center; font-size: clamp(13px, .92cqw, 17px); font-weight: 750; }
  & ol button {
    width: clamp(25px, 2.39cqw, 42px);
    min-height: clamp(30px, 2.8cqw, 49px);
    display: grid;
    place-items: center;
    border: 2px solid var(--double-ink);
    border-radius: 18%;
    background: var(--double-option);
    color: var(--double-symbol);
    cursor: pointer;
  }
  & ol button:hover { box-shadow: inset 0 0 0 2px var(--double-cream); }
  & button:focus-visible { outline-color: var(--double-ink); }
  & ol svg { display: block; width: 74%; height: auto; fill: currentColor; }
}

.double-game .double-history-open {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 36px;
  padding: 0 .09em;
  border: 0;
  background: transparent;
  color: var(--double-ink);
  cursor: pointer;

  &::after {
    width: .22em;
    aspect-ratio: 1;
    border-top: .065em solid currentColor;
    border-right: .065em solid currentColor;
    transform: rotate(45deg) skew(-4deg);
    content: "";
  }
  &:hover { color: #8d0048; }
}

.double-section-title {
  width: max-content;
  max-width: 100%;
  position: relative;
  font: italic 900 clamp(25px, 2.85cqw, 50px)/1.02 var(--double-display-type);
  letter-spacing: -.035em;

  &::after {
    position: absolute;
    inset: auto .03em -.11em -.04em;
    height: .12em;
    background: var(--double-pink);
    clip-path: polygon(0 75%, 33% 32%, 69% 7%, 100% 4%, 96% 35%, 55% 67%, 0 100%);
    content: "";
  }
}

.double-board {
  --double-board-padding: clamp(11px, 2.05cqw, 36px);
  --double-paper-line: clamp(2px, .26cqw, 5px);
  --double-display-inset: clamp(18px, 2.18cqw, 38px);
  grid-area: board;
  min-width: 0;
  align-self: stretch;
  display: grid;
  align-content: center;
  padding: var(--double-board-padding);
}

@media (width > 875px) {
  .double-game[data-display="wheel"] .double-board {
    padding-block-start: calc(var(--double-board-padding) + clamp(0px, 104px - 8cqw, 32px));
  }
}

.double-clock {
  --double-paper-line: clamp(1.5px, .15cqw, 3px);
  justify-self: center;
  width: max-content;
  max-width: 100%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: .35em;
  padding: .55em .62em .48em;
  font: italic 900 clamp(17px, 2.05cqw, 35px)/1.05 var(--double-display-type);
  letter-spacing: -.025em;
  transform: rotate(-2.4deg);

  & > span { text-align: center; }
  & > span::after {
    display: block;
    margin-top: .08em;
    height: .13em;
    background: var(--double-pink);
    clip-path: polygon(0 72%, 65% 10%, 100% 0, 87% 47%, 0 100%);
    content: "";
  }
  & > strong {
    min-width: 2.85em;
    padding: .08em .22em .12em;
    text-align: center;
    background: var(--double-mint);
    clip-path: var(--double-edge);
    font-size: 1.65em;
    line-height: .95;
    font-weight: inherit;
    font-variant-numeric: tabular-nums;
  }
}

.double-game[data-display="wheel"] .double-clock {
  position: absolute;
  top: 7%;
  left: clamp(11px, 2.05cqw, 36px);
  font-size: clamp(15px, 1.8cqw, 30px);
}

.double-game[data-display="reel"] .double-wheel-assembly,
.double-game[data-display="wheel"] .double-reel-assembly { display: none; }

.double-wheel-assembly {
  --double-small-width: 43%;
  --double-closeup-width: 54%;
  min-width: 0;
  min-height: clamp(220px, 30cqw, 520px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, var(--double-small-width)) minmax(0, var(--double-closeup-width));
  column-gap: 3%;
  align-items: center;

  & .double-wheel { z-index: 1; }
  & .double-zoom-rays {
    width: 9.1%;
    position: absolute;
    z-index: 2;
    aspect-ratio: 9.1 / 33;
    top: 50%;
    left: 38.3%;
    overflow: visible;
    transform: translateY(-50%);
    stroke: var(--double-ink);
    fill: none;
  }
  & .double-zoom-rays path { stroke-width: 2px; vector-effect: non-scaling-stroke; }
}

.double-wheel, .double-closeup, .double-machine-inner { min-width: 0; }
.double-wheel, [data-double-closeup] { aspect-ratio: 1; }
.double-wheel > svg, .double-machine-inner > svg { display: block; width: 100%; height: 100%; }

.double-closeup { position: relative; z-index: 3; }

.double-machine {
  --double-machine-line: clamp(3px, .53cqw, 9px);
  --double-machine-gold: clamp(7px, 1cqw, 17px);
  --double-machine-curve: clamp(13px, 2.45cqw, 42px);
  padding: var(--double-machine-gold);
  border: var(--double-machine-line) solid var(--double-ink);
  border-radius: var(--double-machine-curve);
  background:
    radial-gradient(circle, #2b1a04bb .55px, transparent .9px) 0 0 / 5px 5px,
    var(--double-yellow);
  box-shadow: 0 clamp(2px, .25cqw, 4px) 0 #261c14;
  position: relative;

  &::before, &::after {
    position: absolute;
    z-index: 2;
    inset: calc(var(--double-machine-gold) * -.17);
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9' fill='%23ffecaf' stroke='%2318110d' stroke-width='2.5'/%3E%3Cpath d='m8 8 6 6m0-6-6 6' stroke='%2318110d' stroke-width='2'/%3E%3C/svg%3E") left top / var(--double-machine-gold) no-repeat,
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Ccircle cx='11' cy='11' r='9' fill='%23ffecaf' stroke='%2318110d' stroke-width='2.5'/%3E%3Cpath d='m8 8 6 6m0-6-6 6' stroke='%2318110d' stroke-width='2'/%3E%3C/svg%3E") right bottom / var(--double-machine-gold) no-repeat;
    pointer-events: none;
    content: "";
  }
  &::after { transform: scaleX(-1); }
}

.double-machine-inner {
  overflow: hidden;
  border: clamp(2px, .3cqw, 5px) solid var(--double-ink);
  border-radius: calc(var(--double-machine-curve) - .65 * var(--double-machine-gold));
  background: #25211e;
}

.double-reel-assembly {
  position: relative;
  margin: clamp(13px, 2.4cqw, 41px) .4cqw clamp(4px, 1.5cqw, 25px);

  & [data-double-reel] { aspect-ratio: 30 / 7; }
  & .double-board-ink {
    position: absolute;
    width: clamp(15px, 4.3cqw, 75px);
    height: auto;
    bottom: calc(100% + 1.5cqw);
    right: 75%;
    fill: var(--double-ink);
  }
  & .double-board-ink:last-child { right: auto; left: 75%; transform: scaleX(-1); }
}

.double-reel-pointer {
  position: absolute;
  z-index: 3;
  top: calc(-1 * clamp(12px, 1.15cqw, 20px));
  left: 50%;
  width: clamp(29px, 4.7cqw, 83px);
  aspect-ratio: .95;
  transform: translateX(-50%);
  background: var(--double-ink);
  clip-path: polygon(0 0, 100% 0, 50% 100%);

  &::after {
    position: absolute;
    inset: clamp(2px, .26cqw, 4px) clamp(3px, .35cqw, 6px) clamp(5px, .63cqw, 11px);
    background: var(--double-yellow);
    clip-path: inherit;
    content: "";
  }
}

.double-controls {
  grid-area: controls;
  align-self: start;
  display: grid;
  gap: clamp(8px, .9cqw, 16px);
  min-width: 0;
  margin-block: clamp(5px, 1.55cqw, 26px);
  padding: clamp(14px, 2.55cqw, 43px) clamp(10px, 1.8cqw, 31px) clamp(12px, 2.1cqw, 36px);
}

.double-stake-panel { min-width: 0; }
.double-stake-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  margin-bottom: clamp(8px, .95cqw, 17px);
}

.double-info {
  position: relative;
  z-index: 3;

  & summary {
    display: grid;
    place-items: center;
    width: clamp(37px, 2.75cqw, 49px);
    aspect-ratio: 1;
    border: 2px solid currentColor;
    border-radius: 5px 3px 5px 3px;
    background: #fff8e5;
    box-shadow: 2px 2px var(--double-ink);
    color: var(--double-ink);
    transform: rotate(-3deg);
    cursor: pointer;
    list-style: none;
  }
  & summary::-webkit-details-marker { display: none; }
  & summary:hover, &[open] > summary { background: var(--double-yellow); }
  & summary:focus-visible { outline: 3px solid #9c0051; outline-offset: 3px; }
  & summary svg { width: 57%; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
}

.double-info-panel {
  position: absolute;
  inset: calc(100% + 7px) 0 auto auto;
  width: max-content;
  max-width: min(70vw, 13rem);
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 2px solid var(--double-ink);
  border-radius: 5px 3px 6px 3px;
  background: #fff1cb var(--double-paper-image) center / 280px;
  box-shadow: 3px 3px var(--double-ink);

  & button {
    min-height: 36px;
    padding: .32rem .53rem;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    color: var(--double-ink);
    text-align: start;
    font: 800 .86rem/1.15 system-ui, sans-serif;
    cursor: pointer;
  }
  & button + button { border-top-color: #b48b62; }
  & button:hover:not(:disabled) { border-color: currentColor; background: var(--double-yellow); }
  & button:focus-visible { outline-color: #9c0051; outline-offset: -2px; }
}

.double-stake {
  display: grid;
  grid-template-columns: minmax(32px, 19%) minmax(0, 1fr) minmax(32px, 19%);
  align-items: stretch;
  min-height: clamp(42px, 4.25cqw, 72px);
  isolation: isolate;
  overflow: hidden;
  border: clamp(2px, .3cqw, 5px) solid var(--double-ink);
  border-radius: clamp(8px, 1cqw, 17px);
  background:
    radial-gradient(circle, #1c693d4d .45px, transparent .85px) 0 0 / 4px 4px,
    var(--double-mint);
  box-shadow: 0 clamp(2px, .33cqw, 5px) 0 var(--double-ink);

  & :is(input, button) {
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--double-ink);
    text-align: center;
    font: italic 900 clamp(22px, 2.9cqw, 49px)/1 var(--double-display-type);
  }
  & input { width: 100%; padding: 0 .1em; border-inline: 2px solid var(--double-ink); border-radius: 0; }
  & button { font-size: clamp(18px, 2.25cqw, 39px); cursor: pointer; }
  & button:hover:not(:disabled) { background: #d8ffe5; }
  & :is(input, button):focus-visible { outline-offset: -4px; }
}

.double-quick-stake {
  display: grid;
  gap: clamp(7px, .60cqw, 11px);
  margin-top: clamp(12px, 1.1cqw, 19px);
  padding-top: clamp(8px, .72cqw, 13px);
  border-top: 1px dashed #a17753;

  & button {
    min-width: 0;
    min-height: clamp(33px, 2.75cqw, 47px);
    padding: .20em .1em .24em;
    border: 2px solid currentColor;
    border-radius: 4px 2px 4px 2px;
    background: #fff9eb;
    box-shadow: 1px 2px var(--double-ink);
    color: var(--double-ink);
    font: italic 900 clamp(16px, 1.55cqw, 27px)/1 var(--double-display-type);
    transform: skewX(-4deg);
    cursor: pointer;
  }
  & button:hover:not(:disabled) { background: var(--double-mint); }
  & button:focus-visible { outline-color: #9c0051; }
}

.double-quick-amounts, .double-quick-presets {
  display: grid;
  gap: clamp(4px, .48cqw, 8px);
  padding-inline: 2px;
}
.double-quick-amounts { grid-template-columns: minmax(0, .85fr) minmax(0, .95fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.double-quick-presets {
  grid-template-columns: repeat(2, minmax(0, 1fr));

  & button[data-value="max"] {
    background: radial-gradient(#21190c45 .45px, transparent .85px) 0 0 / 4px 4px, var(--double-yellow);
  }
  & button[data-value="clear"] { box-shadow: 1px 2px var(--double-ink), inset 0 -3px #ffc2d9; }
  & button:hover:not(:disabled) { background-color: #fff080; }
}

.double-game [data-action="double-stake-step"][aria-disabled="true"],
.double-game .double-color[aria-disabled="true"] { cursor: progress; }

.double-display {
  position: absolute;
  z-index: 4;
  top: var(--double-display-inset);
  right: var(--double-display-inset);
  display: flex;
  border: 2px solid var(--double-ink);
  border-radius: 6px 4px 5px 3px;
  background: var(--double-cream);
  box-shadow: 2px 2px var(--double-ink);
  overflow: hidden;
  transform: rotate(-2deg);

  & button {
    display: grid;
    place-items: center;
    width: clamp(36px, 2.65cqw, 48px);
    min-height: clamp(34px, 2.5cqw, 44px);
    padding: 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--double-ink);
    cursor: pointer;
  }
  & button + button { border-inline-start: 2px solid var(--double-ink); }
  & button:hover { background: #ffe77c; }
  & button[aria-pressed="true"] { background: var(--double-yellow); }
  & button:focus-visible { outline-offset: -4px; }
  & svg { width: clamp(23px, 1.88cqw, 33px); fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
  & .double-display-hub { fill: currentColor; }
}

.double-game .double-button {
  min-width: 0;
  min-height: clamp(48px, 5.15cqw, 88px);
  padding: .22em .4em .33em;
  background: var(--double-yellow);
  color: var(--double-ink);
  border: clamp(2px, .27cqw, 5px) solid var(--double-ink);
  box-shadow: 0 .095em 0 var(--double-ink);
  font: italic 900 clamp(23px, 3.2cqw, 55px)/1 var(--double-display-type);
  letter-spacing: -.035em;
  transform: skewX(-10deg) rotate(-1.7deg);
  cursor: pointer;

  &:hover:not(:disabled) { background: #fff678; }
  &:disabled { background: #e7d593; color: #625745; }
}
.double-game .double-retry { font-size: clamp(19px, 2.45cqw, 42px); }
.double-note {
  min-height: 1.42em;
  color: #654131;
  font-size: clamp(12px, .93cqw, 17px);
  font-weight: 750;
  line-height: 1.42;
  text-align: center;
}

:is(.double-game, .double-history-dialog) [data-tone="red"] { --double-option: #ff1152; --double-symbol: #fff0d8; --double-option-text: #20100f; }
:is(.double-game, .double-history-dialog) [data-tone="black"] { --double-option: #2c2927; --double-symbol: #fff0d8; --double-option-text: #fff0d8; }
:is(.double-game, .double-history-dialog) [data-tone="green"] { --double-option: #85f7b2; --double-symbol: #17130f; --double-option-text: #17130f; }

.double-colors {
  grid-area: colors;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.3cqw, 23px);
  padding: 0 6.4% clamp(14px, 2.15cqw, 36px);
}

.double-game .double-color {
  min-width: 0;
  display: grid;
  justify-items: center;
  align-content: start;
  position: relative;
  border: clamp(3px, .48cqw, 9px) solid var(--double-ink);
  border-radius: clamp(12px, 2.55cqw, 44px) clamp(10px, 1.8cqw, 32px);
  padding: clamp(7px, .6cqw, 11px) clamp(4px, .65cqw, 12px) clamp(18px, 2.55cqw, 44px);
  background:
    radial-gradient(circle, #23150d25 .6px, transparent 1.1px) 0 0 / 4px 4px,
    var(--double-option);
  color: var(--double-option-text);
  box-shadow: 0 clamp(2px, .32cqw, 5px) 0 var(--double-ink);
  font: italic 900 clamp(16px, 2.9cqw, 50px)/1 var(--double-display-type);
  letter-spacing: -.015em;
  transform: skewX(-7deg);
  cursor: pointer;

  & > span { max-width: 100%; transform: skewX(7deg); }
  &:hover:not(:disabled) { filter: brightness(1.08); }
  &:focus-visible { outline-color: var(--double-yellow); }
}

.double-color-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45em;
  white-space: nowrap;

  & svg { width: 1.17em; height: 1.17em; fill: var(--double-symbol); }
}
.double-color-total { margin-top: .19em; font-size: .66em; line-height: 1.13; text-wrap: balance; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.double-color-factor {
  --double-paper-line: .16em;
  position: absolute;
  inset: auto auto -.65em;
  min-width: 2.8em;
  padding: .19em .36em .22em;
  color: var(--double-ink);
  font-size: 1em;
  text-align: center;

  &::before { background: var(--double-cream); }
  &::after { background-color: var(--double-mint); }
}

.double-players { grid-area: players; min-width: 0; padding-inline: 6.4%; }

.double-game .double-players-title {
  --double-paper-color: var(--double-yellow);
  width: max-content;
  max-width: 100%;
  margin-bottom: clamp(12px, 1.1cqw, 19px);
  padding: .24em .55em .35em;
  color: var(--double-ink);
  font: italic 900 clamp(25px, 2.6cqw, 46px)/1 var(--double-display-type);
  transform: rotate(-2.5deg);
}

.double-player-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: clamp(8px, 1.3cqw, 23px);
}

.double-player-column {
  min-width: 0;
  padding: clamp(9px, 1cqw, 17px);

  & .double-player-column-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .42em;
    margin: 0 0 6px;
    padding: .25em .45em .3em;
    border: 2px solid var(--double-ink);
    border-radius: .18em .1em .16em .11em;
    background: radial-gradient(#21190c4a .48px, transparent .8px) 0 0 / 4px 4px, var(--double-option);
    color: var(--double-option-text);
    font: italic 900 clamp(19px, 1.92cqw, 32px)/1 var(--double-display-type);
    transform: skewX(-4deg);
  }
  & h3 { display: flex; align-items: center; gap: .38em; margin: 0; font: inherit; }
  & h3 svg { width: .9em; height: .98em; flex: none; fill: var(--double-symbol); transform: skewX(4deg); }
  & .double-player-color-totals {
    display: grid;
    gap: 2px;
    min-width: 0;
    text-align: end;
    font: normal 800 clamp(.72rem, .97cqw, 1rem)/1.1 system-ui, sans-serif;
    font-variant-numeric: tabular-nums;
    transform: skewX(4deg);
  }
  & .double-player-color-totals small { color: inherit; font-size: .82em; }
  & summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    margin-top: .35em;
    padding: .27em .45em;
    border: 1px solid var(--double-ink);
    border-radius: 3px;
    background: #fff9ec;
    color: var(--double-ink);
    cursor: pointer;
    list-style: none;
    font-size: .84rem;
    font-weight: 800;
  }
  & summary::-webkit-details-marker { display: none; }
  & summary::after {
    width: .44em;
    aspect-ratio: 1;
    margin-inline-end: .22em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    content: "";
  }
  & summary:hover { background: #fff080; }
  & summary:focus-visible { outline: 3px solid #9c0051; outline-offset: 2px; }
  & summary > span:last-child, & details[open] summary > span:first-child { display: none; }
  & details[open] summary > span:last-child { display: block; }
  & details[open] summary::after { transform: rotate(-135deg); }
}

.double-players-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .58em;
  min-height: 3em;
  padding: .31em .5em;
  border: 1px dashed #9c7756;
  border-radius: 4px 6px 3px 5px;
  background: repeating-linear-gradient(135deg, #b9916520 0 1px, transparent 1px 6px), #fff7e4;
  color: #574135;
  font-size: clamp(12px, .91cqw, 16px);
  font-weight: 750;

  & .double-player-stamp {
    width: 1.94em;
    background: color-mix(in srgb, var(--double-option) 36%, #fff4d9);
  }
  & svg { width: 57%; height: 61%; fill: var(--double-ink); }
}

.double-player {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, max-content);
  align-items: center;
  gap: .48em;
  min-width: 0;
  padding: .43em .18em;
  border-bottom: 1px dashed #98775f;
  color: var(--double-ink);
  font-size: clamp(12px, .91cqw, 16px);

  &[data-own-player] { background: #fff08790; }
  & small { color: #664537; font-size: .8em; font-weight: 700; }
}

.double-player-stamp {
  width: 2.1em;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--double-ink);
  border-radius: .48em .38em .43em .34em;
  background: radial-gradient(#21190c5c .45px, transparent .75px) 0 0 / 3px 3px, var(--double-option);
  box-shadow: 1px 1px var(--double-ink);
  color: var(--double-option-text);
  transform: rotate(-6deg);
  font-weight: 900;
  line-height: 1;
}

.double-player-name { min-width: 0; overflow-wrap: anywhere; font-weight: 800; }
.double-player-name small {
  display: inline-block;
  margin-inline-start: .3em;
  padding-inline: .28em;
  border: 1px solid var(--double-ink);
  border-radius: 2px;
  background: var(--double-yellow);
  color: var(--double-ink);
}
.double-player-stake {
  display: grid;
  text-align: end;
  overflow-wrap: anywhere;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;

  & strong { font-weight: 850; }
}

@media (max-width: 875px) {
  .double-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "title mascot" "board board" "controls controls" "colors colors" "history history" "players players";
    row-gap: clamp(11px, 1.8cqw, 17px);
    padding-top: clamp(4px, 1cqw, 9px);
  }
  .double-hero { display: contents; }
  .double-game .double-title {
    grid-area: title;
    position: relative;
    inset: auto;
    place-self: center;
    width: 91%;
    font-size: clamp(48px, 11cqw, 100px);
    padding: .23em .04em .34em;
  }
  .double-mascot { grid-area: mascot; position: relative; width: min(78%, 250px); inset: auto; place-self: end center; }
  .double-game .double-history { grid-area: history; padding: 12px 14px; }
  .double-history ol button { width: clamp(30px, 5.5cqw, 44px); min-height: clamp(34px, 6.3cqw, 48px); }
  .double-board {
    --double-display-inset: clamp(17px, 2.7cqw, 26px);
    padding: clamp(10px, 3cqw, 24px);
    padding-top: calc(clamp(10px, 3cqw, 24px) + 43px);
  }
  .double-game[data-display="reel"] .double-board { padding-top: calc(var(--double-display-inset) + 56px); }
  .double-clock { font-size: clamp(16px, 3.5cqw, 28px); }
  .double-game[data-display="wheel"] .double-clock { left: clamp(10px, 3cqw, 24px); font-size: clamp(13px, 3.2cqw, 24px); }
  .double-wheel-assembly { min-height: clamp(187px, 59cqw, 465px); }
  .double-reel-assembly { margin: clamp(17px, 4cqw, 33px) 1% clamp(8px, 2.4cqw, 20px); }
  .double-reel-pointer { width: clamp(30px, 7.7cqw, 67px); }
  .double-controls { margin: 0; padding: clamp(10px, 2.5cqw, 20px); gap: clamp(8px, 1.5cqw, 15px); }
  .double-section-title { font-size: clamp(25px, 5.3cqw, 43px); }
  .double-game .double-button { min-height: 43px; font-size: clamp(21px, 4cqw, 34px); }
  .double-game .double-color { font-size: clamp(15px, 4.65cqw, 38px); }
  :is(.double-colors, .double-players) { padding-inline: clamp(2px, 1.5cqw, 13px); }
}

@media (max-width: 610px) {
  .double-player-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .double-game .double-title { width: 96%; font-size: clamp(40px, 10.9cqw, 50px); }
  .double-game .double-color { min-height: 88px; padding-inline: 2px; }
  .double-color-heading { flex-direction: column; gap: .13em; }
  .double-color-heading svg { width: 1em; height: 1em; }
  .double-color-total { margin-top: .35em; font-size: .78em; }
}

#dialog:is([data-variant="double-proof"], [data-variant="double-rules"], [data-variant="double-history"]) {
  --double-dialog-ink: #18110d;
  --double-dialog-paper: #fff2d9;
  --double-dialog-yellow: #ffeb12;
  --double-dialog-mint: #84f6ad;
  --text: var(--double-dialog-ink);
  --muted: #54372b;
  --line: #624d3b;
  --well: #fff9ea;
  width: min(590px, calc(100% - 28px));
  max-height: min(88dvh, calc(100dvh - 28px));
  padding: clamp(13px, 3.3vw, 24px);
  border: 3px solid var(--double-dialog-ink);
  border-radius: 5px 9px 4px 8px;
  background: var(--double-dialog-paper) url("/redesign-art/hilo-paper.webp") center / 380px;
  box-shadow: 4px 5px var(--double-dialog-ink);
  color: var(--double-dialog-ink);
  color-scheme: light;
  overflow: auto;

  &::backdrop { background: #170a13dc; }

  & .dialog-head { align-items: start; margin-bottom: clamp(13px, 3vw, 20px); }
  & .dialog-head h2 {
    position: relative;
    isolation: isolate;
    margin: 0;
    padding: .29em .5em .36em;
    color: var(--double-dialog-ink);
    font: italic 900 clamp(21px, 5vw, 36px)/1.1 Impact, "Arial Narrow", sans-serif;
    font-synthesis: style;
    letter-spacing: -.018em;
  }
  & .dialog-head h2::before {
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 2px solid var(--double-dialog-ink);
    border-radius: 3px;
    background: var(--double-dialog-yellow);
    box-shadow: 2px 3px var(--double-dialog-ink);
    transform: skewX(-5deg) rotate(-1deg);
    content: "";
  }

  & :is(.button, .icon-button, input, textarea) {
    border: 2px solid var(--double-dialog-ink);
    border-radius: 4px;
    background: #fff9ea;
    color: var(--double-dialog-ink);
  }
  & .dialog-head .icon-button {
    flex: 0 0 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    background: var(--double-dialog-mint);
    box-shadow: 2px 3px var(--double-dialog-ink);
    font: 800 1.45rem/1 sans-serif;
  }
  & .button { min-height: 41px; background: var(--double-dialog-yellow); box-shadow: 2px 3px var(--double-dialog-ink); }
  & :is(.button, .icon-button):hover { background: #fff57f; }
  & :is(button, input, textarea):focus-visible { outline: 3px solid #9c0051; outline-offset: 2px; }

  & [data-double-proof-body] > p { margin: 0; }
  & [data-double-proof-body] :is(input, textarea) { font: .82rem/1.35 ui-monospace, monospace; }
  & [data-double-proof-body] textarea { resize: vertical; }
  & [data-double-verified]:not([hidden]) {
    padding: .55em .68em;
    border: 2px solid var(--double-dialog-ink);
    background: #fff9ea;
    color: var(--double-dialog-ink);
    font-weight: 750;
  }

  & .minigame-rules { gap: .85rem; color: var(--double-dialog-ink); }
  & .minigame-rules h3 { color: var(--double-dialog-ink); font-weight: 900; }
  & .minigame-rules :is(dd, .minigame-rules-version) { color: var(--double-dialog-ink); }
  & .minigame-rules dl { border: 2px solid currentColor; border-radius: 4px; background: var(--double-dialog-ink); }
  & .minigame-rules dl div { background: #fff9ea; }
  & .minigame-rules li::marker { color: #9c0051; }
}

.double-history-dialog {
  --double-ink: var(--double-dialog-ink);
  --double-cream: var(--double-dialog-paper);
  display: grid;
  justify-items: start;
  gap: .8rem;

  & p { margin: 0; }
  & [role="alert"] { color: #8d0048; font-weight: 800; }
  & ol { padding: 0; list-style: none; }
  & .double-history-public { padding: 0; }
  & .double-history-public h3 { margin: 0; font-size: 1rem; }
}

.double-history-receipts {
  display: grid;
  width: 100%;
  gap: .7rem;
  margin: 0;
}

.double-history-receipt {
  display: grid;
  gap: .58rem;
  min-width: 0;
  padding: .6rem;
  border: 2px solid var(--double-ink);
  border-inline-start: 6px solid var(--double-option);
  border-radius: 3px 7px 4px 5px;
  background: #fff9ea;
  box-shadow: 2px 2px var(--double-ink);
}

.double-receipt-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .45rem;
  line-height: 1.15;

  & time { display: block; margin-top: .18em; color: #56382b; font-size: .78rem; }
}

.double-receipt-symbol {
  width: 2rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--double-ink);
  border-radius: 6px 4px 5px 3px;
  background: var(--double-option);

  & svg { width: 65%; height: 65%; fill: var(--double-symbol); }
}

.double-receipt-state {
  padding: .28em .4em;
  border: 1.5px solid currentColor;
  border-radius: 2px;
  background: var(--double-cream);
  font-size: .74rem;
  line-height: 1.1;
  transform: rotate(-3deg);

  &[data-result="win"] { background: var(--double-dialog-mint); }
  &[data-result="loss"] { background: #ffc3d4; }
  &[data-result="pending"] { background: #fff0a1; }
}

.double-receipt-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .48rem;
  margin: 0;
  padding-top: .42rem;
  border-top: 1px dashed #876854;
  font-size: .86rem;

  & dt { color: #56382b; }
  & dd { margin: .13em 0 0; font-weight: 800; overflow-wrap: anywhere; }
}

.double-receipt-proof {
  justify-self: start;
  min-height: 31px;
  padding: .24em .48em;
  border: 1px solid var(--double-ink);
  border-radius: 2px;
  background: var(--double-cream);
  color: var(--double-ink);
  font: inherit;
  font-size: .76rem;
  font-weight: 750;
  cursor: pointer;

  &:hover { background: var(--double-dialog-yellow); }
}
