:root {
  color-scheme: dark;
  --stage-width: 480px;
  --gold: #ffc672;
  --page-background: #200916;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 0;
  margin: 0;
  background: radial-gradient(ellipse at 50% 18%, #5f1d25 0%, #260b1c 42%, #100711 80%) fixed;
  color: #fff3de;
  font-family: system-ui, -apple-system, sans-serif;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid #fff1aa;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

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

.landing {
  width: min(100%, var(--stage-width));
  margin-inline: auto;
  background: var(--page-background);
  box-shadow: 0 0 80px #0009;
}

.slice {
  display: block;
  width: 100%;
  height: auto;
}

.download-band,
.games {
  position: relative;
}

.download-inline,
.download-floating,
.motion-toggle {
  appearance: none;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
  touch-action: manipulation;
}

.download-inline {
  position: absolute;
  inset-inline-start: 14.933333%;
  inset-block-start: 4.794521%;
  width: 70.133333%;
  height: 82.191781%;
  border-radius: 999px;
}

.download-art {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 526 / 120;
  pointer-events: none;
}

.download-inline .download-art {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.download-art img {
  position: absolute;
  display: block;
  /* Fit the 442 × 101 button region inside the GIF's transparent canvas. */
  inset-block-start: -29.70297%;
  inset-inline-start: -17.873303%;
  width: 135.746606%;
  height: auto;
  max-width: none;
}

.download-inline:active .download-art {
  filter: brightness(.9);
}

.download-floating {
  position: fixed;
  display: grid;
  place-items: center;
  z-index: 5;
  inset-block-start: max(9px, env(safe-area-inset-top));
  inset-inline-start: 50%;
  width: clamp(142px, 42vw, 196px);
  min-height: 44px;
  transform: translateX(-50%);
  border-radius: 999px;
  filter: drop-shadow(0 4px 7px #130509cc);
  animation: floating-enter 180ms ease-out both;
}

.download-floating:active {
  filter: brightness(.87) drop-shadow(0 2px 4px #130509cc);
}

@keyframes floating-enter {
  from { opacity: 0; transform: translate(-50%, -7px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.games {
  container-type: inline-size;
}

.reels {
  position: absolute;
  inset: 0 17.333333% 1.860465% 19.733333%;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1.658768%;
}

.reel {
  overflow: hidden;
  background: #4a210e;
}

.reel-track {
  display: flex;
  width: 100%;
  height: 100%;
}

.reel-group {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  gap: 1cqi;
}

.reel-group img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: fill;
}

.games[data-ready] .reel-track {
  width: 200%;
  animation: reel-loop 24s linear infinite;
}

.games[data-ready] .reel-group {
  flex-basis: 50%;
  padding-inline-end: 1cqi;
}

.games[data-ready] .reel:nth-child(2) .reel-track {
  animation-duration: 29s;
  animation-direction: reverse;
}

.games[data-paused="true"] .reel-track {
  animation-play-state: paused;
}

@keyframes reel-loop {
  to { transform: translateX(-50%); }
}

.motion-toggle {
  position: absolute;
  inset-inline-end: 1.6%;
  inset-block-end: 1%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
}

.motion-toggle::before {
  position: absolute;
  inset: 7px;
  border: 1px solid #f3b4699c;
  border-radius: 50%;
  background: #341222dc;
  content: "";
}

.motion-icon {
  position: relative;
  width: 9px;
  height: 12px;
  border-inline: 3px solid var(--gold);
}

.games[data-paused="true"] .motion-icon {
  width: 0;
  height: 0;
  margin-inline-start: 3px;
  border: 6px solid transparent;
  border-inline-start: 9px solid var(--gold);
  border-inline-end: 0;
}

.download-dialog {
  width: min(340px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid #e07843;
  border-radius: 20px;
  background: linear-gradient(145deg, #431b2b, #241024);
  color: #fff3de;
  text-align: center;
  box-shadow: 0 12px 48px #15080bb3;
}

.download-dialog::backdrop {
  background: #160813be;
}

.download-dialog h2 {
  margin: 0;
  color: var(--gold);
  font-size: 1.3rem;
}

.download-dialog p {
  margin: 12px 0 20px;
  line-height: 1.6;
}

.download-dialog button,
.download-dialog a {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 22px;
  border: 1px solid #72c785;
  border-radius: 999px;
  background: #176c44;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.download-dialog a:focus-visible {
  outline: 3px solid #fff1aa;
  outline-offset: 3px;
}

.download-dialog[data-view^="install-"] {
  width: min(352px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  border: 0;
  border-radius: 20px;
  padding: 22px 18px 16px;
  background: #f4f6f8;
  color: #18222d;
  color-scheme: light;
}

.download-dialog[data-view^="install-"] h2 {
  color: #14212d;
}

.download-dialog[data-view^="install-"] h2:focus {
  outline: 0;
}

.download-dialog[data-view^="install-"] #download-message {
  margin: 9px 0 15px;
  color: #465564;
  font-size: .9375rem;
}

.install-guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 16px;
  cursor: pointer;
}

.install-guide-overlay[hidden] {
  display: none;
}

.install-guide-overlay #show-shortcut-steps {
  position: relative;
  display: block;
  width: min(352px, 100%, calc((100dvh - 32px) * 720 / 856));
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
}

.install-guide-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 32px);
  border-radius: 20px;
  object-fit: contain;
}

#show-shortcut-steps {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
}

.download-dialog[data-view^="install-"] .download-close {
  border: 1px solid #ccd5df;
  border-radius: 10px;
  background: #fff;
  color: #283646;
}

.download-dialog[data-view^="install-"] :is(button, a):focus-visible {
  outline-color: #135ab0;
}

.download-dialog[data-view="install-progress"] {
  width: min(324px, calc(100% - 32px));
  padding: 28px 18px 22px;
  border-radius: 16px;
}

.download-dialog[data-view="install-progress"] h2 {
  font-size: 1.625rem;
  font-weight: 650;
}

.download-dialog[data-view="install-progress"] #download-message {
  margin: 8px 0 0;
}

#landing-native-install {
  margin-inline-end: 4px;
}

.install-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: #160813be;
}

.install-overlay[hidden] {
  display: none;
}

.install-overlay-card {
  display: grid;
  place-items: center;
  width: min(324px, calc(100% - 32px));
  padding: 36px 18px;
  border-radius: 16px;
  background: #f4f6f8;
}

.install-spinner {
  width: 92px;
  height: 92px;
  border: 4px solid #d7ebe3;
  border-block-start-color: #17865e;
  border-radius: 50%;
  animation: install-spin .8s linear infinite;
}

@keyframes install-spin {
  to { transform: rotate(360deg); }
}

.launcher-page {
  min-height: 100dvh;
}

.launcher {
  width: min(100%, var(--stage-width));
  min-height: 100dvh;
  margin-inline: auto;
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--page-background);
  text-align: center;
}

.launcher-hero {
  mask-image: linear-gradient(#000 68%, transparent);
}

.launcher-content {
  position: relative;
  margin-top: -24px;
  padding: 0 20px 24px;
}

.launcher h1 {
  margin: 12px 0;
  color: var(--gold);
  font-size: 1.55rem;
}

.launcher-icon {
  display: block;
  margin-inline: auto;
  border: 1px solid #ffc6728a;
  border-radius: 16px;
}

.launcher-install {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #a5614866;
  border-radius: 14px;
  background: #361020;
  text-align: start;
}

.launcher-install h2 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 1.1rem;
}

.launcher-actions {
  display: grid;
  gap: 8px;
}

.launcher-action {
  display: inline-grid;
  min-height: 44px;
  padding: 8px 16px;
  place-items: center;
  border: 1px solid #c98465;
  border-radius: 10px;
  background: #4d2030;
  color: #fff3de;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.launcher-primary {
  border-color: #72c785;
  background: #176c44;
}

.launcher-action:focus-visible {
  outline: 3px solid #fff1aa;
  outline-offset: 3px;
}

#install-address {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #a56148;
  border-radius: 8px;
  background: #200916;
  color: inherit;
  font: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .download-floating,
  .install-spinner {
    animation: none;
  }

  .download-art img {
    inset: 0;
    width: 100%;
  }
}
