:root {
  color-scheme: dark;
  --canvas: #1b140d;
  --surface: #2a2015;
  --surface-deep: #231a10;
  --ink: #fff4df;
  --muted: #d6bf99;
  --line: #574327;
  --accent: #f6c751;
  --accent-hover: #ffdc78;
  --accent-ink: #271908;
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --section-space: clamp(2.75rem, 6vw, 5.5rem);
  --page-width: 75rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
  color: var(--ink);
  font: 1rem / 1.6 "Leelawadee UI", Tahoma, system-ui, sans-serif;
  scroll-padding-block: 1.5rem 6rem;
  scrollbar-color: #8b6f45 var(--canvas);
}

body,
h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  color: var(--accent-ink);
  background: var(--accent);
}

.container {
  width: min(calc(100% - var(--gutter) * 2), var(--page-width));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.header-inner,
.dock-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-inner {
  min-height: 4.5rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.brand {
  min-height: 2.75rem;
  font: 800 1.375rem / 1 system-ui, sans-serif;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}

.app-icon {
  flex: 0 0 auto;
  width: 2.25rem;
  aspect-ratio: 1;
  border-radius: .5rem;
  background: #19140d url("../img/p4.png") 6.15385% 13.04348% / 750% 330% no-repeat;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 3.5vw, 2.75rem);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--muted);
  font-size: .95rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: .35em;
}

.download-button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: .6rem 1.1rem;
  border: 0;
  border-radius: .5rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease;
}

.download-button:hover {
  background: var(--accent-hover);
}

.download-icon {
  position: relative;
  display: block;
  width: .875rem;
  height: .95rem;
  border-bottom: 1.5px solid currentColor;
}

.download-icon::before,
.download-icon::after {
  position: absolute;
  left: 50%;
  content: "";
}

.download-icon::before {
  top: 0;
  height: .64rem;
  border-left: 1.5px solid currentColor;
  transform: translateX(-50%);
}

.download-icon::after {
  top: .26rem;
  width: .4rem;
  height: .4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateX(-50%) rotate(45deg);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
  min-height: clamp(25rem, 39vw, 31rem);
  isolation: isolate;
  overflow: hidden;
  margin-top: clamp(1rem, 2.75vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface);
}

.hero-media {
  position: relative;
  grid-area: 1 / 2;
}

.hero-media img {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 90% 40%;
  filter: saturate(.96);
}

.hero-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--surface), transparent 31%);
  content: "";
  pointer-events: none;
}

.hero-copy {
  grid-area: 1 / 1;
  align-self: center;
  z-index: 1;
  padding: clamp(1.5rem, 4.75vw, 4.25rem);
  padding-inline-end: 0;
}

.hero h1 {
  font-size: clamp(1.55rem, 3vw, 2.75rem);
  line-height: 1.3;
  font-weight: 700;
}

.hero h1 strong {
  display: block;
  margin-top: .35rem;
  color: var(--accent);
  font: 800 clamp(4rem, 8.3vw, 7.5rem) / 1 system-ui, sans-serif;
  letter-spacing: -.035em;
  white-space: nowrap;
}

.hero-download {
  min-height: 3.25rem;
  margin-top: clamp(1.2rem, 2.7vw, 2rem);
  padding-inline: 1.25rem;
  font-size: 1.05rem;
}

.hero-promises {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: .875rem;
}

.hero-promises li {
  display: flex;
  align-items: center;
  gap: .45rem;
  white-space: nowrap;
}

.hero-promises li::before,
.privilege-list li::before {
  flex: 0 0 auto;
  width: .65rem;
  height: .38rem;
  border-bottom: 1.5px solid var(--accent);
  border-left: 1.5px solid var(--accent);
  transform: translateY(-.1em) rotate(-45deg);
  content: "";
}

.providers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 5.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}

.providers span {
  color: var(--muted);
  font-size: .9rem;
  white-space: nowrap;
}

.providers img {
  display: block;
  width: min(79%, 54rem);
  filter: grayscale(1) sepia(.55) saturate(1.4);
  height: auto;
}

.games {
  margin-top: var(--section-space);
}

main h2 {
  font-size: clamp(1.85rem, 4vw, 3.05rem);
  line-height: 1.22;
  text-wrap: balance;
}

.game-group {
  margin-top: clamp(1.5rem, 3.5vw, 2.5rem);
}

.game-group h3 {
  margin-bottom: .75rem;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.4;
}

.game-grid {
  display: grid;
  gap: clamp(.6rem, 1.5vw, 1.1rem);
}

.slots {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.table-games {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* The original game art is packed into two sheets. These positions isolate each tile. */
.game-tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: clamp(.5rem, 1.1vw, .875rem);
  background-color: var(--surface);
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease;
}

@media (hover: hover) {
  .game-tile:hover {
    transform: translateY(-3px);
    filter: brightness(1.12);
  }
}

.slots .game-tile {
  aspect-ratio: 120 / 162;
  background-image: url("../img/p2.png");
  background-size: 625% 637.037%;
  background-position: var(--tile-x) 95.4023%;
}

.slots li:nth-child(1) { --tile-x: 7.61905%; }
.slots li:nth-child(2) { --tile-x: 28.73016%; }
.slots li:nth-child(3) { --tile-x: 50%; }
.slots li:nth-child(4) { --tile-x: 71.11111%; }
.slots li:nth-child(5) { --tile-x: 92.38095%; }

.table-games .game-tile {
  aspect-ratio: 317 / 204;
  background-image: url("../img/p3.png");
  background-size: 236.593% 280.392%;
  background-position: var(--tile-x) var(--tile-y);
}

.table-games li:nth-child(odd) { --tile-x: 11.08545%; }
.table-games li:nth-child(even) { --tile-x: 88.91455%; }
.table-games li:nth-child(-n + 2) { --tile-y: 28.26087%; }
.table-games li:nth-child(n + 3) { --tile-y: 92.11957%; }

.privileges {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr);
  align-items: start;
  gap: clamp(1.25rem, 4vw, 3rem);
  margin-block: var(--section-space);
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--surface-deep);
}

.privileges h2 {
  font-size: clamp(1.85rem, 3.25vw, 2.75rem);
}

.privilege-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;
}

.privilege-list li {
  position: relative;
  padding: .8rem 0 .8rem 1.35rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.privilege-list li:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.privilege-list li::before {
  position: absolute;
  top: 1.37rem;
  left: 0;
}

.privilege-list strong {
  color: var(--accent);
  white-space: nowrap;
}

.site-footer {
  padding-block: 1.75rem 2.25rem;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
}

.footer-brand {
  align-self: start;
}

.footer-brand .app-icon {
  width: 2.75rem;
}

.footer-brand strong {
  display: block;
  font: 750 1rem / 1.3 system-ui, sans-serif;
}

.footer-brand p,
.footer-details {
  color: var(--muted);
  font-size: .875rem;
}

.footer-details {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.25rem;
  align-items: center;
}

.download-dock {
  display: none;
}

[aria-disabled="true"] {
  cursor: wait;
}

.download-status:not(:empty) {
  position: fixed;
  z-index: 4;
  inset: auto var(--gutter) 1rem auto;
  max-width: calc(100% - 2 * var(--gutter));
  padding: .65rem 1rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--ink);
}

@media (min-width: 44.001rem) {
  html {
    scroll-padding-block-start: 6rem;
  }

  .site-header {
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--canvas);
  }
}

@media (max-width: 54rem) {
  .privileges {
    grid-template-columns: 1fr;
  }

  .privileges h2 br {
    display: none;
  }
}

@media (max-width: 44rem) {
  .header-inner {
    min-height: 3.75rem;
  }

  .header-download {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .hero-media {
    grid-area: 1 / 1;
    aspect-ratio: 4 / 5;
    min-height: 25rem;
    max-height: 34rem;
    overflow: hidden;
  }

  .hero-media img {
    /* Show rows 79–1069. Fade the old poster lettering at the lower left. */
    --portrait-mask: linear-gradient(to bottom, #000 51%, transparent 54%),
                     linear-gradient(to right, transparent 59%, #000 63%);
    top: -7.98%;
    right: 0;
    width: auto;
    height: 146.26%;
    -webkit-mask-image: var(--portrait-mask);
    mask-image: var(--portrait-mask);
  }

  .hero-media::after {
    content: none;
  }

  .hero-copy {
    grid-area: 1 / 1;
    align-self: end;
    padding: 2rem clamp(1rem, 4.5vw, 2rem) 1.25rem;
    background: linear-gradient(
      to top,
      var(--canvas),
      rgb(27 20 13 / 86%) 35%,
      rgb(27 20 13 / 48%) 68%,
      transparent
    );
  }

  .hero h1 {
    font-size: clamp(1.45rem, 5.6vw, 2.25rem);
  }

  .hero h1 strong {
    margin-top: .2rem;
    font-size: clamp(3.4rem, 13vw, 6rem);
  }

  .hero-promises {
    gap: .35rem .8rem;
    margin-top: 1rem;
  }

  .providers {
    display: grid;
    gap: .55rem;
    min-height: 0;
    padding-block: 1rem;
  }

  .providers img {
    width: 100%;
  }

  .games {
    margin-top: 2rem;
  }

  .game-group {
    margin-top: 1.25rem;
  }

  .slots {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: clamp(6.5rem, 29vw, 9rem);
    overflow-x: auto;
    margin-inline: -.3rem;
    padding: .3rem .3rem .55rem;
    scroll-snap-type: x proximity;
    scroll-padding-inline: .3rem;
  }

  .slots li {
    scroll-snap-align: start;
  }

  .table-games {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    padding-bottom: calc(5.75rem + env(safe-area-inset-bottom));
  }

  .download-dock {
    position: fixed;
    z-index: 3;
    inset: auto 0 0;
    display: block;
    padding-block: .55rem calc(.55rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--canvas);
  }

  .download-status:not(:empty) {
    bottom: calc(4.2rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 26rem) {
  .privilege-list {
    grid-template-columns: 1fr;
  }

  .privilege-list li:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .download-button,
  .game-tile {
    transition: none;
  }

  .game-tile:hover {
    transform: none;
  }
}
