:root {
  color-scheme: dark;
  font-family: system-ui, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: #fff3cf;
  background: #140c1d;
}

* {
  box-sizing: border-box;
}

body {
  display: grid;
  min-height: 100dvh;
  margin: 0;
  place-items: center;
  background: radial-gradient(ellipse at center, #482747, #1e1228 52%, #100a18 100%);
}

.machine {
  position: relative;
  isolation: isolate;
  width: min(100vw, 56.25dvh);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  container-type: inline-size;
  background: #291831 url("art/playfield.png") center / cover no-repeat;
  box-shadow: 0 0 75px #0c0619, 0 0 0 1px #67412f;
}

.machine::after {
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 1px solid #e5b0674a;
  box-shadow: inset 0 0 16px #10081c9e;
  content: "";
  pointer-events: none;
}

.machine::before {
  position: absolute;
  inset: 0;
  content: "";
  background: #281c2c url("art/mine-screen.png") center / cover no-repeat;
  opacity: 0;
  pointer-events: none;
}

.machine[data-scene="mine"]::before {
  opacity: 1;
}

#board {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.mine-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.mine-hud,
.mine-depths {
  position: absolute;
  display: grid;
}

.mine-hud {
  inset: 2.15% 3.2% auto;
  height: 5.45%;
  grid-template-columns: 0.93fr 1.07fr;
  gap: 1.5cqw;
}

.mine-badge {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.42em;
  min-width: 0;
  padding: 0 0.46em;
  border: clamp(2px, 0.55cqw, 5px) solid #eaaa59;
  border-radius: 0.52em;
  box-shadow: 0 0 0 1px #492421, 0 0.14em 0.3em #100815be,
    inset 0 0 0 1px #ffdda086, inset 0 -0.18em #31152290;
  background: linear-gradient(#7c3c25, #3b2027 65%, #532622);
  color: #ffecc8;
  font-size: clamp(10px, 3.65cqw, 32px);
  font-weight: 850;
  white-space: nowrap;
  text-shadow: 0 0.08em #3b1924;
}

.mine-badge span,
.mine-badge strong {
  flex: none;
}

.mine-badge strong {
  padding: 0.2em 0.38em;
  border: 1px solid #bf8043;
  border-radius: 0.44em;
  background: #321b21;
  color: #fff6d8;
  font-size: 1.12em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.badge-icon {
  position: relative;
  width: 1.05em;
  height: 1.05em;
  border: 1px solid #ffdd85;
  background: linear-gradient(#ffefac, #dd902b);
  box-shadow: inset 0 0 0 1px #a16438, 0 0.08em #3f211d;
}

.badge-icon--ticket {
  height: 0.76em;
  transform: rotate(-12deg);
  border-radius: 0.12em;
}

.badge-icon--coin {
  border-radius: 50%;
}

.badge-icon--coin::after {
  position: absolute;
  inset: 28%;
  transform: rotate(45deg);
  border: 1px solid #ad6728;
  background: #fff1a6;
  content: "";
}

.mine-depths {
  inset: 25.25% 2% auto;
  height: 3.55%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mine-depth {
  justify-content: center;
  gap: 0.45em;
  margin-inline: 1.85cqw;
  padding: 0 0.25em;
  font-size: clamp(10px, 3.48cqw, 30px);
}

.mine-depth strong {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.24em;
}

.machine[data-scene="mine"] .drop {
  width: 65%;
}

.drop {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 1.12%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.58em;
  width: 57%;
  height: 5.4%;
  min-height: 44px;
  padding: 0 0.7em;
  transform: translateX(-50%);
  border: clamp(2px, 0.68cqw, 6px) solid #e6a558;
  border-radius: 1.5em;
  box-shadow: 0 0 0 1px #422029, 0 0.18em 0 #71391f, 0 0.3em 0.65em #120a1bc9,
    inset 0 0.08em 0 #fff0acb5, inset 0 -0.15em #742620;
  background: linear-gradient(180deg, #cc6b3c, #a13024 48%, #771d26 52%, #8f3026);
  color: #fff7d6;
  font: inherit;
  font-size: clamp(14px, 4.2cqw, 36px);
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1;
  text-shadow: 0 0.08em #451322;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}

.drop kbd {
  display: grid;
  width: 1.43em;
  height: 1.43em;
  place-items: center;
  flex: none;
  border: 1px solid #edbb71;
  border-radius: 0.31em;
  box-shadow: 0 0.11em #552919, inset 0 0.06em #ffe2aaab;
  background: linear-gradient(#b77639, #5c3024);
  font: inherit;
  font-size: 0.85em;
}

.drop:hover:not([aria-disabled="true"]) {
  filter: brightness(1.16);
}

.drop:active:not([aria-disabled="true"]) {
  transform: translate(-50%, 0.12em);
  box-shadow: 0 0 0 1px #422029, inset 0 0.08em 0 #fff0acb5, inset 0 -0.15em #742620;
}

.drop:focus-visible {
  outline: 3px solid #fff3a6;
  outline-offset: 3px;
}

.drop[aria-disabled="true"] {
  border-color: #a87349;
  background: linear-gradient(#64442f, #412632);
  color: #f4d8aa;
  cursor: default;
}

.drop[aria-disabled="true"] kbd {
  display: none;
}

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

.unsupported {
  position: absolute;
  z-index: 4;
  inset-inline: 6%;
  top: 45%;
  padding: 1rem;
  border: 1px solid #e6a558;
  background: #301d30;
  text-align: center;
}
