@font-face{font-family:Barlow Condensed;src:url("assets/display.woff2") format("woff2");font-weight:800;font-display:swap}
@font-face{font-family:IBM Plex Mono;src:url("assets/mono.woff2") format("woff2");font-weight:400;font-display:swap}
@font-face{font-family:IBM Plex Mono;src:url("assets/mono-medium.woff2") format("woff2");font-weight:500;font-display:swap}

:root {
  color-scheme: dark;
  --ink: #171411;
  --paper: #f0dfbd;
  --muted: #b6a68d;
  --gold: #e1ad6c;
  --hot: #f0846e;
  --rule: #4c3b2e;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --mono: "IBM Plex Mono", monospace;
  --texture: url("assets/grain.png");
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  color: var(--paper);
  font: 400 14px/1.3 var(--mono);
  background:
    radial-gradient(ellipse at 49% 42%, #3c271b 0%, #251c16 39%, transparent 76%),
    #181410;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--texture);
  opacity: .46;
}
h1, h2 { margin: 0; }
button { font: inherit; }
.game {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1.39fr) minmax(0, 1fr) auto;
  gap: clamp(12px, 2.7dvh, 24px);
  width: min(100%, 904px);
  height: min(100%, 872px);
  padding: clamp(14px, 3.8dvh, 33px) clamp(14px, 4vw, 32px) clamp(12px, 3.2dvh, 27px);
  min-height: 0;
}
.masthead {
  display: flex;
  align-items: center;
  gap: 16px;
  height: clamp(23px, 4dvh, 37px);
}
.brand {
  display: flex;
  align-items: center;
  color: var(--paper);
  font-size: clamp(15px, 2.4vw, 20px);
  font-weight: 500;
  letter-spacing: -.075em;
  white-space: nowrap;
}
.brand-mark {
  height: .82em;
  aspect-ratio: 1;
  margin-right: .43em;
  background: #e7755d;
  clip-path: polygon(0 0, 42% 0, 42% 38%, 100% 0, 100% 100%, 58% 100%, 58% 63%, 0 100%);
}
.brand-dot { color: #ee795f; }
.masthead-line, .footer-rule { flex: 1; height: 1px; background: var(--rule); }
.date { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; white-space: nowrap; }
.controls { display: flex; gap: 6px; }
.control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid #654939;
  background: #2a1d17;
  color: #e7cdb1;
  white-space: nowrap;
  font-size: 11px;
  cursor: pointer;
}
.control:hover, .control[aria-pressed="true"] { border-color: #af7760; background: #3c261d; color: #ffddb4; }
.control:focus-visible { outline: 2px solid #ffdfa4; outline-offset: 2px; }
.control:disabled { opacity: .55; cursor: default; }
.sound-note, .reset-mark { color: var(--hot); font: 500 15px/1 sans-serif; }
.signal {
  width: 6px;
  height: 6px;
  background: #f18a70;
  box-shadow: 0 0 10px #e87658aa;
  transform: rotate(45deg);
}
.machine {
  width: min(100%, 688px);
  justify-self: center;
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(9px, 1.65dvh, 15px);
}
h1 {
  text-align: center;
  font: 800 clamp(34px, min(8.65vw, 9.25dvh), 83px)/.92 var(--display);
  letter-spacing: -.025em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 3px #342014;
  padding-bottom: .05em;
}
h1 em { color: #ef8269; font-style: normal; }
.cabinet {
  background:
    var(--texture),
    linear-gradient(106deg, #513326 0%, #3a261d 24%, #251c17 65%, #382419 100%);
  border: 1px solid #815d42;
  box-shadow: inset 0 0 0 4px #251913, inset 0 0 0 5px #6c4932, 0 3px #815337, 0 9px #150e0a, 0 10px #3d271a, 0 16px 32px #100905a8;
  position: relative;
  border-radius: 5px;
  padding: 0 clamp(12px, 3.2vw, 26px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 4fr) minmax(0, .9fr);
}
.cabinet-top, .cabinet-base { display: grid; align-items: center; min-width: 0; }
.cabinet-top { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: clamp(7px, 2vw, 19px); }
.cabinet-base { grid-template-columns: auto minmax(0, 1fr) auto; }
.screw {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(137deg, #b28c63 39%, #3b2c21 43% 57%, #78583e 61%);
  box-shadow: 0 1px 1px #0f0b08;
}
.vent {
  height: 6px;
  background: repeating-linear-gradient(90deg, #1d1411 0 2px, #7b5037 2px 3px, transparent 3px 6px);
  opacity: .65;
}
.cabinet-label, #spin-status {
  color: #e2c99f;
  text-align: center;
  font-size: clamp(10px, 1.65vw, 12px);
  font-weight: 500;
  letter-spacing: .11em;
  text-transform: uppercase;
  white-space: nowrap;
}
#spin-status { color: #e3a87b; letter-spacing: .17em; }
#spin-status[data-result="full"] { color: #ffce79; }
#spin-status[data-result="defeated"] { color: #ffa28d; }
.reels-tray {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 10px;
  gap: clamp(5px, 1.1vw, 11px);
  align-items: center;
  padding: clamp(5px, 1.15dvh, 11px) clamp(5px, 1.6vw, 13px);
  background: #17110f;
  border: 1px solid #94704e;
  box-shadow: 0 2px #1b110c, inset 0 0 0 2px #2a1b14, inset 0 5px 12px #0b0705;
  border-radius: 3px;
  min-height: 0;
}
.payline-marker {
  width: 10px;
  height: 17px;
  background: #d5684e;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.payline-marker.right { transform: scaleX(-1); }
.reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 1.45vw, 12px);
  height: 100%;
  min-height: 0;
}
.reel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  container-type: size;
  overflow: hidden;
  background:
    var(--texture),
    linear-gradient(#a08155 0%, #ead2a0 22%, #f5e2b8 48%, #e2c48e 80%, #967343 100%);
  border: 1px solid #e0bc7b;
  border-radius: 3px;
  box-shadow: inset 0 0 0 2px #53382530, inset 0 4px 13px #1f110780, inset 0 -5px 11px #39231469;
}
.reel::before {
  position: absolute;
  content: "";
  inset: 0;
  background:
    linear-gradient(90deg, #634a2c4d, transparent 13% 87%, #634a2c4d),
    repeating-linear-gradient(0deg, #4f3a2312 0 1px, transparent 1px 4px);
  pointer-events: none;
  z-index: 1;
}
.reel::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px dashed #66462a39;
  pointer-events: none;
}
.reel img {
  position: absolute;
  width: min(73cqh, 71cqw, 113px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 1px 0 #f5d5a380);
}
.reel img:not(:first-child) { visibility: hidden; }
.cabinet.hit .reel { animation: reel-hit 290ms ease-out; }
@keyframes reel-hit {
  0% { background-color: #ffdda2; box-shadow: inset 0 0 0 3px #ffdf8c, inset 0 0 24px #ffd37b; filter: brightness(1.21); }
  100% { filter: brightness(1); }
}
.dust { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.particle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  background: var(--dust-color);
  border-radius: 30% 55%;
}
.player { width: min(100%, 556px); justify-self: center; margin-top: 3px; }
.meter-caption, .enemy-meter-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.meter-caption { margin-bottom: 6px; color: #f0d9b4; font-size: clamp(11px, 2vw, 13px); font-weight: 500; text-transform: uppercase; letter-spacing: .065em; }
.player-label { display: flex; align-items: center; gap: 7px; }
.player-label span { color: #f58d74; font: 800 17px/1 var(--display); }
.meter {
  height: 12px;
  background: #1b1310;
  border: 1px solid #715341;
  padding: 2px;
  box-shadow: inset 0 1px 4px #0d0907;
}
.meter > div {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(112deg, #ffffff15 0 4px, transparent 4px 11px), linear-gradient(90deg, #993727, #ef8366);
  box-shadow: inset 0 1px #ffb69c80;
  transition: width 160ms ease-out;
}
.lower-board {
  display: grid;
  grid-template-columns: minmax(0, .38fr) minmax(0, 1fr);
  gap: clamp(9px, 2vw, 19px);
  min-height: 0;
}
.panel {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  border: 1px solid #674939;
  box-shadow: inset 0 0 0 3px #231812, 0 4px 14px #0f0a0759;
}
.inventory {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--texture), linear-gradient(124deg, #3a2a20, #251e18);
  padding: clamp(8px, 1.65dvh, 15px) clamp(8px, 2.15vw, 17px);
  gap: clamp(5px, 1dvh, 9px);
}
.panel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
}
.panel-heading h2 { font: 800 clamp(18px, 3.8vw, 30px)/.91 var(--display); text-transform: uppercase; }
#loot-count { color: var(--gold); white-space: nowrap; font-size: clamp(10px, 1.8vw, 13px); }
.slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, .9dvh, 8px);
  min-height: 0;
}
.slot {
  position: relative;
  min-height: 0;
  min-width: 0;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold);
  border: 1px solid #604735;
  background: #211812;
  box-shadow: inset 0 0 8px #0e0908be;
  cursor: pointer;
  container-type: size;
}
.slot::before {
  content: "";
  position: absolute;
  inset: 3px;
  background:
    linear-gradient(#795941 0 0) top left, linear-gradient(#795941 0 0) top left,
    linear-gradient(#795941 0 0) bottom right, linear-gradient(#795941 0 0) bottom right;
  background-size: 6px 1px, 1px 6px, 6px 1px, 1px 6px;
  background-repeat: no-repeat;
  pointer-events: none;
}
.slot:disabled { cursor: default; }
.slot:disabled::after {
  content: "";
  width: 6px;
  height: 6px;
  border: 1px solid #725541;
  transform: rotate(45deg);
}
.slot:not(:disabled) { background: radial-gradient(ellipse, #70503380, #2c2018 74%); }
.slot:hover:not(:disabled), .slot[aria-pressed="true"] { border-color: #e4a967; }
.slot:focus-visible { outline: 2px solid #ffdfa4; outline-offset: 1px; z-index: 1; }
.slot img { width: min(90cqh, 86cqw, 63px); aspect-ratio: 1; filter: drop-shadow(0 2px 3px #120d0a); }
.loot-detail {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.17;
  color: var(--muted);
  font-size: clamp(10px, 1.7vw, 12px);
  height: clamp(25px, 4.1dvh, 38px);
}
.loot-detail strong { color: #f4d9ac; font-weight: 500; }
.encounter {
  background: #492119;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(11px, 2.4dvh, 24px) clamp(11px, 3vw, 29px);
  overflow: hidden;
}
.poster, .poster-shade { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.poster {
  background: repeating-conic-gradient(from 11deg at 70% 34%, #963028 0deg 14deg, #62261f 14deg 32deg);
}
.poster img {
  width: 74%;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  object-fit: cover;
  object-position: center 26%;
  mask-image: linear-gradient(90deg, transparent, black 27%);
}
.poster-shade {
  z-index: 0;
  background: var(--texture), linear-gradient(0deg, #1a100ce8, #1a100c20 60%, #1a100c00), linear-gradient(90deg, #311b14 0%, #35191420 48%, transparent 70%);
}
.enemy-heading span {
  display: inline-block;
  padding: 5px 7px 4px;
  color: #f1c294;
  background: #281612dd;
  border-left: 2px solid #ed8166;
  font-size: clamp(9px, 1.7vw, 12px);
  letter-spacing: .11em;
  white-space: nowrap;
}
.enemy-card-copy { width: min(100%, 340px); }
.enemy-card-copy h2 {
  font: 800 clamp(32px, min(7.9vw, 7dvh), 62px)/.88 var(--display);
  text-transform: uppercase;
  text-shadow: 0 2px 10px #140807, 0 1px #130b09;
  margin-bottom: clamp(7px, 1.5dvh, 13px);
}
.enemy-meter-row { color: #f2d2a4; font-size: clamp(10px, 1.6vw, 13px); white-space: nowrap; text-shadow: 0 1px #16100d; }
.enemy-meter { flex: 1; height: 10px; border-color: #8a583a; }
.enemy-meter > div { background: repeating-linear-gradient(112deg, #ffffff20 0 4px, transparent 4px 10px), linear-gradient(90deg, #9e5f2a, #f4bd6c); box-shadow: inset 0 1px #ffe1ab70; }
.encounter.felled .poster img { filter: grayscale(.72) contrast(.85); }
.battle-mark {
  position: absolute;
  top: 20%;
  right: 22%;
  color: #ffe3a6;
  z-index: 2;
  font: 800 clamp(26px, 7vw, 56px)/1 var(--display);
  text-shadow: 0 2px 5px #29190d, 1px 1px #29190d;
  pointer-events: none;
  opacity: 0;
}
.encounter.struck::after {
  content: "";
  position: absolute;
  inset: 7% 7% 49% 43%;
  background: linear-gradient(136deg, transparent 45%, #ffe6a2 48%, #fc9d5c 51%, transparent 55%);
  pointer-events: none;
  animation: slash 245ms ease-out both;
}
@keyframes slash { from { opacity: .94; transform: scale(.78); } to { opacity: 0; transform: scale(1.12); } }
.flying-loot {
  position: fixed;
  top: 0;
  left: 0;
  width: 60px;
  height: 60px;
  z-index: 9;
  pointer-events: none;
  border: 1px solid #ffe4ac;
  border-radius: 50%;
  padding: 6px;
  background: radial-gradient(#654022, #271712 72%);
  box-shadow: 0 0 19px #ffba6fb5;
}
.slot.in-flight img { visibility: hidden; }
.pickup:not([hidden]) {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 7px;
  top: clamp(6px, 2.1dvh, 20px);
  right: clamp(6px, 2vw, 19px);
  max-width: calc(100% - 12px);
  padding: 4px 8px 4px 5px;
  border: 1px solid #ce985e;
  color: #f5dba9;
  background: #281b14f7;
  box-shadow: 0 2px 9px #1b110ad9;
  pointer-events: none;
  z-index: 3;
}
.pickup-icon { width: 27px; height: 27px; flex: none; }
.pickup-icon img { display: block; height: 100%; }
.pickup-label { display: block; color: #efb976; font-size: 9px; text-transform: uppercase; letter-spacing: .045em; }
.pickup strong { font-size: 12px; font-weight: 500; line-height: 1.1; }
.run-footer { display: flex; align-items: center; gap: 13px; color: #c6af92; font-size: clamp(10px, 1.6vw, 12px); white-space: nowrap; }
#run-status { display: inline-flex; align-items: center; gap: 9px; }
.footer-separator { width: 4px; height: 4px; background: #bc7158; transform: rotate(45deg); }
.no-script { position: fixed; inset: auto 10px 10px; background: #201610; border: 1px solid #eaa670; color: var(--paper); text-align: center; padding: 10px; }

@media (max-width: 600px) and (orientation: portrait) {
  .game { grid-template-rows: auto minmax(0, 1fr) minmax(0, .91fr) auto; }
  .masthead { height: 39px; }
  .control { min-height: 37px; }
  .lower-board { grid-template-columns: minmax(0, .56fr) minmax(0, 1fr); }
  .poster img { width: 100%; mask-image: none; object-position: 51% 20%; }
  .poster-shade { background: var(--texture), linear-gradient(0deg, #170d0c 1%, #210e0ab0 25%, transparent 57%, #25110d44); }
  .enemy-card-copy h2 { max-width: 10ch; }
}
@media (max-width: 520px) {
  .masthead { gap: 9px; }
  .date { display: none; }
  .pickup:not([hidden]) { top: clamp(33px, 6dvh, 63px); }
}
@media (max-height: 550px) and (orientation: landscape) {
  .game { gap: clamp(5px, 1.5dvh, 9px); padding-top: 6px; padding-bottom: 5px; grid-template-rows: auto minmax(0, 1.15fr) minmax(0, 1fr) auto; }
  .masthead { height: 25px; }
  .control { min-height: 25px; }
  .brand { font-size: 15px; }
  .machine { gap: 5px; width: min(100%, 540px); }
  h1 { font-size: min(8.6dvh, 6vw); }
  .player { margin-top: 2px; }
  .meter-caption { margin-bottom: 2px; }
  .meter { height: 9px; }
  .cabinet { grid-template-rows: minmax(14px, 1fr) minmax(0, 4fr) minmax(13px, .9fr); }
  .inventory { gap: 3px; padding: 5px 10px; }
  .panel-heading h2 { font-size: 19px; }
  .loot-detail { height: 22px; }
  .encounter { padding: 7px 15px; }
  .enemy-heading span { padding-block: 2px; }
  .enemy-card-copy h2 { font-size: max(27px, 7.5dvh); margin-bottom: 4px; }
}
@media (max-width: 360px) {
  .masthead { gap: 9px; }
  .date { font-size: 10px; }
  .controls { gap: 4px; }
  .control { gap: 4px; padding-inline: 6px; font-size: 10px; }
  .sound-note, .reset-mark { font-size: 13px; }
  .panel-heading h2 { font-size: 17px; }
  .loot-detail { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .meter > div { transition: none; }
  .cabinet.hit .reel { animation: none; box-shadow: inset 0 0 0 3px #ffd78d; }
  .encounter.struck::after { animation: none; background: #ffcb7b45; inset: 0; }
  .cabinet.reduced-miss .reel { box-shadow: inset 0 0 0 3px #93693769; }
}

