.ld-comic-paper {
  container-type: inline-size;
  isolation: isolate;
  color: var(--ld-ink);
  background: var(--ld-ink);
}

.ld-comic-paper::before {
  position: absolute;
  z-index: -1;
  inset: clamp(2.5px, .75cqw, 4px);
  clip-path: var(--feature-outline);
  background:
    linear-gradient(113deg, #fff7e3a0, #fff5de74),
    url("/redesign-art/paper.webp") center / 565px,
    #fff4d8;
  content: "";
}

.ld-home-tile-title {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  color: var(--ld-ink);
  font: italic 900 clamp(16px, 13cqw, 42px)/.92 var(--ld-display);
  font-synthesis: style;
  letter-spacing: -.035em;
  transform: rotate(-5deg);
}

.ld-home-tile-title::after {
  position: absolute;
  inset: 100% -5% auto -4%;
  height: .32em;
  clip-path: polygon(0 88%, 11% 37%, 49% 20%, 100% 2%, 65% 48%, 44% 64%, 42% 86%, 27% 70%, 1% 100%);
  background: #ff2677;
  content: "";
}

.ld-featured-card.ld-home-cases {
  display: grid;
  grid-template-columns: minmax(0, 49%);
  align-items: center;
  padding: 2% 4% 3% 8%;
}

.ld-home-cases-title {
  position: relative;
  z-index: 1;
  display: block;
  justify-self: start;
  color: var(--ld-ink);
  font: italic 900 clamp(30px, 12cqw, 100px)/.86 var(--ld-display);
  font-synthesis: style;
  letter-spacing: -.045em;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.ld-home-cases-title span {
  position: relative;
  isolation: isolate;
  display: block;
  width: max-content;
  margin: .06em 0 0 .29em;
  color: #ffdf24;
  font-size: 1.14em;
  -webkit-text-stroke: .06em var(--ld-ink);
  paint-order: stroke fill;
  text-shadow: .035em .06em var(--ld-ink);
}

.ld-home-cases-title span::before {
  position: absolute;
  z-index: -1;
  inset: 17% -48% 5% -24%;
  clip-path: polygon(0 78%, 15% 23%, 11% 40%, 37% 17%, 32% 28%, 100% 0, 79% 27%, 88% 23%, 63% 51%, 71% 47%, 48% 84%, 52% 65%, 18% 99%, 24% 77%, 1% 100%, 6% 75%);
  background: radial-gradient(#430b3029 .6px, transparent 1px) 0 0 / 4px 4px, #ff2677;
  content: "";
}

.ld-home-case-scene {
  position: absolute;
  inset: 48.5% 4.75% auto auto;
  width: 48%;
  aspect-ratio: 3 / 2;
  translate: 0 -50%;
  pointer-events: none;
}

.ld-home-case-art {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.ld-home-case-video { visibility: hidden; }
.ld-home-cases[data-case-playing] .ld-home-case-video { visibility: visible; }
.ld-home-cases[data-case-playing] .ld-home-case-still { visibility: hidden; }

.ld-feature-mode.ld-comic-paper {
  grid-template-columns: minmax(0, .86fr) minmax(0, 1fr);
  gap: 7%;
  align-items: center;
  aspect-ratio: var(--mode-ratio);
  padding: 5% 10% 7% 9%;
}

.ld-feature-mode[data-mode="mines"].ld-comic-paper { --mode-ratio: 236 / 112; }

.ld-feature-mode[data-mode="plinko"].ld-comic-paper {
  --mode-ratio: 210 / 112;
  grid-template-columns: minmax(0, 1fr) minmax(0, .89fr);
  gap: 6%;
}

.ld-feature-mode[data-mode="games"].ld-comic-paper {
  --mode-ratio: 234 / 114;
  grid-template-columns: minmax(0, .57fr) minmax(0, 1fr);
  gap: 10%;
}

.ld-feature-mode[data-mode="games"].ld-comic-paper::before {
  background-image:
    linear-gradient(113deg, #a4fbbba5, #92eb9f87),
    url("/redesign-art/paper.webp");
}

html[data-ludik-theme="comic"] .ld-feature-mode[data-mode="upgrade"] {
  aspect-ratio: 200 / 110;
}

html[data-ludik-theme="comic"] .ld-feature-mode[data-mode="upgrade"] img {
  position: absolute;
  inset: 0;
  height: 100%;
}

.ld-home-mines-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4%;
  aspect-ratio: 1;
  color: var(--ld-ink);
  transform: rotate(-9deg);
}

.ld-home-mines-board > span {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: max(1px, .7cqw) solid var(--ld-ink);
  border-radius: 12%;
  box-shadow: .45cqw .7cqw var(--ld-ink);
  background: #fff0ce;
}

.ld-home-mines-board svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ld-home-mines-result {
  --reveal-duration: 320ms;
  --reveal-flash: #e9ffbb;
  position: absolute;
  display: grid;
  inset: 0;
  background:
    radial-gradient(#090c1326 .4px, transparent .75px) 0 0 / 3px 3px,
    #8afa9c;
}

.ld-home-mines-result[data-state="struck"] {
  --reveal-duration: 420ms;
  --reveal-flash: #ffed24;
  --reveal-jolt: 9%;
  background-color: #ff4079;
}

@media (prefers-reduced-motion: no-preference) {
  .ld-feature-mode[data-mode="mines"]:focus-visible {
    --reveal-face: ld-home-mines-reveal;
    --reveal-glyph: ld-home-mines-pop;
  }

  @media (hover: hover) {
    .ld-feature-mode[data-mode="mines"]:hover {
      --reveal-face: ld-home-mines-reveal;
      --reveal-glyph: ld-home-mines-pop;
    }
  }

  .ld-home-mines-result[data-reveal-order="2"] { --reveal-delay: 540ms; }
  .ld-home-mines-result[data-reveal-order="3"] { --reveal-delay: 930ms; }

  .ld-home-mines-result,
  .ld-home-mines-result > svg {
    animation-duration: var(--reveal-duration);
    animation-delay: var(--reveal-delay, 150ms);
    animation-timing-function: ease-out;
    animation-fill-mode: both;
  }

  .ld-home-mines-result { animation-name: var(--reveal-face, none); }
  .ld-home-mines-result > svg { animation-name: var(--reveal-glyph, none); }
}

@keyframes ld-home-mines-reveal {
  0% { opacity: 0; }
  6%, 100% { opacity: 1; }
  24% { background-color: var(--reveal-flash); }
}

@keyframes ld-home-mines-pop {
  0% { transform: scale(.86); }
  26% { transform: translateX(var(--reveal-jolt, 0%)) scale(1.18); }
  50% { transform: translateX(calc(-.6 * var(--reveal-jolt, 0%))) scale(.98); }
}

.ld-home-plinko-board {
  position: relative;
  display: block;
  aspect-ratio: 233 / 164;
  clip-path: polygon(48% 0, 52% 0, 56% 5%, 100% 88%, 100% 98%, 98% 100%, 2% 100%, 0 97%, 0 91%, 45% 4%);
  transform: rotate(-5deg);
}

.ld-home-plinko-board img {
  /* The original 522px card places its 233px board at (148, 12). */
  position: absolute;
  inset: -7.32% auto auto -63.52%;
  width: 224.03%;
  max-width: none;
}

.ld-home-plinko-board .ld-feature-motion {
  inset: 0;
  width: 100%;
  height: 100%;
}

.ld-home-games-icon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9%;
  aspect-ratio: 1;
  transform: rotate(-9deg);
}

.ld-home-games-icon > span {
  border: max(1px, .9cqw) solid var(--ld-ink);
  box-shadow: .65cqw .85cqw var(--ld-ink);
  background: #fff0ce;
}

.ld-home-games-icon > :nth-child(2) { background: #ffde29; }
.ld-home-games-icon > :nth-child(3) { background: #ff4079; }

@media (max-width: 560px) {
  html[data-ludik-theme="comic"] .ld-feature-mode:is(.ld-comic-paper, [data-mode="upgrade"]) {
    aspect-ratio: 2 / 1;
  }
}
