:root {
  color-scheme: dark;
  --gold: #e8b74b;
  --light: #ffe5a1;
  --ink: #130c07;
}
* {
  box-sizing: border-box;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
body {
  margin: 0;
  background: #080605;
  color: #f4d795;
  font:
    14px Arial,
    sans-serif;
  min-height: 100svh;
  display: grid;
  place-items: center;
}
button {
  font: inherit;
  cursor: pointer;
  color: #f8d16b;
  touch-action: manipulation;
}
button:disabled {
  opacity: 0.43;
  cursor: not-allowed;
}
button:focus-visible {
  outline: 2px solid #fff4b7;
  outline-offset: 3px;
}
.game {
  width: min(100%, 1100px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 65%, #583014 0, #24160e 51%, #0a0806 89%);
  padding: 8px clamp(8px, 5.5vw, 70px) 7px;
  box-shadow: 0 0 70px #000;
  --edge: clamp(17px, 3.3vw, 35px);
}
.temple {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}
.head {
  height: clamp(60px, 11vw, 110px);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.brand {
  width: clamp(210px, 44%, 420px);
  height: 100%;
  filter: drop-shadow(0 3px 2px #000);
}
.demotag {
  position: absolute;
  top: 6px;
  right: 0;
  color: #e9ca87;
  font-size: 10px;
  letter-spacing: 2px;
  background: #1a100b;
  padding: 4px 7px;
  border: 1px solid #704d2c;
}
.feature {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 35px;
  background: #251107;
  border: 1px solid #b67b25;
  margin: 0 var(--edge) 5px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
}
.feature.active {
  display: flex;
}
.specials {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.specials svg {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 0 4px #f7c154);
}
.machine {
  position: relative;
  display: grid;
  grid-template-columns: var(--edge) minmax(0, 1fr) var(--edge);
  align-items: stretch;
  gap: 3px;
}
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  aspect-ratio: 5/3;
  border: 3px ridge #e9ab36;
  box-shadow:
    0 0 0 1px #3f1e09,
    0 0 15px #d184234d,
    inset 0 0 15px #000;
  background: #17110b;
  overflow: hidden;
}
.reel {
  height: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(90deg, #080603 0, transparent 8%, transparent 92%, #080603 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='210' viewBox='0 0 150 210'%3E%3Crect width='150' height='210' fill='%231e150d'/%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.16' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='150' height='210' filter='url(%23n)' opacity='.12'/%3E%3Cg fill='none' stroke='%23624627' stroke-width='2' opacity='.36'%3E%3Cpath d='M0 4H150M0 69H150M0 139H150M0 207H150M27 4V69M113 69V139M53 139V207'/%3E%3Cpath d='M7 23q15-17 31 0q-15 12-31 0m16-8v16M49 16v38m-9-28h18m-18-10q9-14 18 0q0 10-9 10q-9 0-9-10M76 13l19 40H57zM110 15h27v39h-27zm4 5h18m-18 9h18m-18 9h18M14 87l10 37 10-37m-18 18h17M43 85q25 30 0 37m0-37v37M79 86q18-20 35 0q-17 17-35 0m19-9v20M125 80v46m-8-23h17M11 163h26v30H11zm6 6h15m-15 8h15M61 151v47m-12-30h24m-24-12q12-12 24 0q0 12-12 12q-12 0-12-12M83 191l18-37 18 37zm41-33v38m-9-24h17'/%3E%3C/g%3E%3C/svg%3E");
  background-size:
    100% 100%,
    100% auto;
}
.reel:not(:last-of-type) {
  border-right: clamp(3px, 0.55vw, 7px) solid transparent;
  border-image: repeating-linear-gradient(#c88a29 0 4px, #9b1c0f 4px 28px, #076d72 28px 44px, #c88a29 44px 48px) 1;
}
.strip {
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  position: relative;
}
.cell {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cell svg {
  display: block;
  width: 96%;
  height: 96%;
  max-height: 100%;
  filter: drop-shadow(1px 3px 2px #0008);
}
.cell.win {
  background: radial-gradient(#ffcc3b37, transparent 75%);
  box-shadow:
    inset 0 0 0 2px #ffdf68,
    inset 0 0 16px #ff9e38;
  z-index: 1;
}
.cell.scatter {
  background: radial-gradient(#b32b0c, #4b0905);
  box-shadow: inset 0 0 0 2px #ffc95c;
}
.cell.expanded {
  background: linear-gradient(90deg, #541708, #c3811a, #541708);
  box-shadow: inset 0 0 12px #ffe07a;
}
.cell.win svg,
.cell.expanded svg {
  animation: glint 0.9s ease-in-out infinite alternate;
}
@keyframes glint {
  to {
    filter: brightness(1.23) drop-shadow(0 0 7px #f6a52c);
  }
}
.reel.rolling .strip {
  animation: roll 0.13s linear infinite;
  filter: blur(1.8px);
}
@keyframes roll {
  from {
    transform: translateY(-10%);
  }
  to {
    transform: translateY(10%);
  }
}
.reel.stop .strip {
  animation: land 0.18s ease-out;
}
@keyframes land {
  0% {
    transform: translateY(-8%);
  }
  65% {
    transform: translateY(3%);
  }
  100% {
    transform: translateY(0);
  }
}
.linebank {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 2px;
  padding: 2px 0;
}
.line {
  border: 1px solid #fff9;
  border-radius: 2px;
  color: #130b06;
  font-size: clamp(9px, 1.5vw, 16px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px #fff7;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 -2px #0003,
    0 1px 2px #000;
  padding: 0;
}
.line.inactive {
  opacity: 0.28;
}
.line.hit {
  outline: 2px solid #fff;
  filter: brightness(1.4);
}
.lineOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: visible;
}
.lineOverlay polyline {
  fill: none;
  stroke-width: 5;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px #000);
  vector-effect: non-scaling-stroke;
}
.controls {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.35fr 2.5fr 0.85fr 0.85fr 1.35fr;
  gap: 5px;
  margin: 8px var(--edge) 0;
  align-items: stretch;
}
.key,
.meter,
.status {
  background: linear-gradient(#251a10, #0e0b08 50%, #1e130b);
  border: 1px solid #a47732;
  box-shadow:
    inset 0 0 0 2px #0007,
    0 2px 3px #000;
  border-radius: 5px;
  min-height: clamp(48px, 7vw, 75px);
  padding: 4px;
  color: #eec157;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-weight: bold;
}
.key:hover:not(:disabled) {
  border-color: #ffdf7b;
  background: #362614;
}
.key small,
.meter small {
  font-size: clamp(8px, 1.05vw, 12px);
  letter-spacing: 0.3px;
}
.key b,
.meter b {
  font-size: clamp(13px, 2.05vw, 22px);
  color: #f8db75;
  line-height: 1.4;
}
.betmeter {
  display: grid;
  grid-template-columns: 22px 1fr 22px;
  align-items: center;
  gap: 1px;
}
.betmeter > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.betmeter > div small {
  white-space: nowrap;
  font-size: clamp(7px, 0.95vw, 11px);
}
.betmeter button {
  padding: 0;
  border: 1px solid #765429;
  background: #2c1e0e;
  font-size: 17px;
  border-radius: 3px;
  height: 27px;
}
.status {
  color: #e4be78;
  gap: 3px;
  line-height: 1.15;
}
.status strong {
  font-size: clamp(10px, 1.45vw, 16px);
  color: #ffd769;
}
.status span {
  font-size: clamp(8px, 1.2vw, 13px);
}
.credit {
  border-top: 1px solid #554128;
  padding-top: 3px;
  width: 100%;
}
.start {
  color: #8af96d;
  border: 2px solid #45942b;
  box-shadow:
    inset 0 0 12px #2b6c22a0,
    0 2px 3px #000;
  background: linear-gradient(#172b12, #0b1608);
  font-size: clamp(12px, 1.7vw, 19px);
  gap: 3px;
}
.start .arrow {
  font-size: clamp(18px, 3vw, 31px);
  line-height: 1;
}
.start:hover:not(:disabled) {
  background: #28451d;
  border-color: #86ed54;
}
.auto.on {
  border-color: #6ee04e;
  color: #9aff7e;
}
.foot {
  margin: 7px var(--edge) 0;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  color: #b49659;
  font-size: 10px;
  min-height: 26px;
}
.foot button {
  background: #1e150b;
  border: 1px solid #735021;
  border-radius: 3px;
  font-size: 11px;
  padding: 5px 7px;
}
.foot .right {
  display: flex;
  gap: 5px;
}
.notice {
  font-size: 10px;
  text-align: center;
  color: #bda37d;
  line-height: 1.4;
  padding: 4px;
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #000b;
  display: grid;
  place-items: center;
  padding: 12px;
  backdrop-filter: blur(3px);
}
.overlay[hidden] {
  display: none;
}
.panel {
  background: radial-gradient(ellipse at top, #503219, #150e08 75%);
  border: 3px ridge #e4ad43;
  box-shadow: 0 0 35px #000;
  width: min(96%, 650px);
  max-height: 93%;
  overflow: auto;
  padding: clamp(12px, 3vw, 25px);
  text-align: center;
  border-radius: 6px;
}
.panel h2 {
  font:
    bold clamp(22px, 4vw, 38px) Georgia,
    serif;
  margin: 0 0 10px;
  color: #ffe49a;
  text-shadow: 0 2px #6f3005;
}
.panel p {
  line-height: 1.45;
  color: #f2d49b;
  margin: 8px 0;
}
.panel button {
  background: linear-gradient(#765018, #30200b);
  border: 1px solid #cf9b3c;
  border-radius: 4px;
  padding: 9px 15px;
  margin: 5px;
}
.panel .big {
  font-size: 19px;
  font-weight: bold;
}
.panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.panel td,
.panel th {
  padding: 4px;
  border-bottom: 1px solid #7d542a65;
}
.panel td:first-child {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 7px;
}
.panel td svg {
  width: 34px;
  height: 32px;
}
.featureArt svg {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 0 13px #ffbc39);
}
.featureArt {
  min-height: 95px;
}
.winpop {
  pointer-events: none;
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  color: #fff1a3;
  font:
    bold clamp(21px, 4.7vw, 50px) Georgia,
    serif;
  white-space: nowrap;
  text-shadow:
    0 2px #722400,
    0 4px #281002,
    0 0 15px #ffb521;
  animation: pop 0.35s ease-out;
}
.winpop[hidden] {
  display: none;
}
@keyframes pop {
  from {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
.game:fullscreen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-inline: max(10px, calc((100vw - min(100vw, 115vh)) / 2));
  background-color: #100a05;
}
.game:fullscreen .head {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .game {
    padding: 4px 6px;
    --edge: 17px;
  }
  .head {
    height: 64px;
  }
  .demotag {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .controls {
    grid-template-columns: 0.8fr 0.8fr 1.6fr 1fr 1fr 1.45fr;
    margin: 5px 0 0;
    gap: 3px;
  }
  .status {
    grid-column: 1/-1;
    grid-row: 1;
    min-height: 38px;
    flex-direction: row;
    justify-content: space-around;
    padding: 5px;
    gap: 8px;
  }
  .credit {
    width: auto;
    border-top: 0;
    padding: 0;
  }
  .betmeter {
    grid-template-columns: 17px 1fr 17px;
  }
  .betmeter button {
    height: 24px;
  }
  .key,
  .meter {
    min-height: 49px;
  }
  .foot {
    margin-inline: 0;
    gap: 3px;
  }
  .foot button {
    font-size: 10px;
    padding: 4px;
  }
  .feature {
    margin-inline: 0;
  }
  .lineOverlay polyline {
    stroke-width: 3;
  }
  .notice {
    font-size: 9px;
  }
  .panel {
    max-height: 100%;
  }
  .panel td,
  .panel th {
    padding: 2px;
    font-size: 10px;
  }
  .panel td svg {
    width: 25px;
    height: 24px;
  }
  .panel h2 {
    font-size: 22px;
  }
  .featureArt svg {
    width: 75px;
    height: 75px;
  }
  .featureArt {
    min-height: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cell.win svg,
  .cell.expanded svg,
  .reel.stop .strip {
    animation: none;
  }
  .reel.rolling .strip {
    animation: none;
  }
}
