:root {
  color-scheme: dark;
  font-family: "Arial Black", Impact, "Trebuchet MS", Arial, sans-serif;
  color: #f1deb4;
  background: #0b0806;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #170b07;
  --coal: #0b0806;
  --timber: #4c2817;
  --timber-dark: #261108;
  --crimson: #8b2d23;
  --crimson-dark: #571713;
  --parchment: #f1deb4;
  --bone: #d5bd8c;
  --gold: #e2a93d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

button {
  font: inherit;
}

#app {
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100vw;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 50% 22%, rgba(126, 59, 29, 0.2), transparent 42%),
    repeating-linear-gradient(
      94deg,
      rgba(255, 255, 255, 0.012) 0 2px,
      transparent 2px 11px
    ),
    #0b0806;
}

.game-header {
  min-height: 67px;
  padding: 7px clamp(14px, 2.7vw, 42px) 6px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 18px;
  border-bottom: 4px solid #1b0b06;
  background:
    linear-gradient(rgba(67, 31, 17, 0.92), rgba(35, 15, 8, 0.96)),
    repeating-linear-gradient(86deg, #512b18 0 32px, #432313 32px 35px);
  box-shadow:
    inset 0 -2px 0 rgba(225, 179, 92, 0.28),
    0 8px 20px rgba(0, 0, 0, 0.46);
  z-index: 4;
}

.brand-lockup {
  position: relative;
  justify-self: start;
  padding: 2px 32px 2px 2px;
}

.eyebrow,
.tagline,
.fight-callout,
.utility-controls p,
.rules-stamp span {
  margin: 0;
}

.eyebrow {
  color: #c79d69;
  font:
    800 8px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.17em;
}

h1 {
  margin: 0;
  color: #f0ddb2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 3vw, 43px);
  line-height: 0.88;
  letter-spacing: -0.07em;
  text-shadow:
    -2px 2px 0 #1b0b06,
    2px 3px 0 #5d2d18,
    0 7px 12px #000;
  transform: rotate(-0.7deg);
}

h1 span {
  color: #db7f25;
}

.tagline {
  position: absolute;
  left: 118px;
  bottom: 2px;
  color: #e5a53b;
  font:
    900 8px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.scoreboard {
  min-width: min(430px, 42vw);
  min-height: 48px;
  padding: 6px 26px;
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  align-items: center;
  gap: 24px;
  border: 3px solid #1b0b06;
  clip-path: polygon(2% 0, 98% 3%, 100% 86%, 96% 100%, 3% 97%, 0 15%);
  background: #190d08;
  box-shadow:
    inset 0 0 0 2px rgba(205, 158, 88, 0.22),
    0 5px 0 rgba(0, 0, 0, 0.4);
}

.scoreboard i {
  width: 2px;
  height: 32px;
  background: #5b301c;
  transform: rotate(3deg);
}

.scoreboard__stat {
  text-align: center;
}

.scoreboard__stat span,
.tumble-plaque span,
.bet-stepper span {
  display: block;
  color: #b99c73;
  font:
    900 8px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.18em;
}

.scoreboard__stat strong {
  display: block;
  margin-top: 3px;
  color: #ffe9b8;
  font-size: clamp(16px, 2vw, 23px);
  line-height: 1;
  text-shadow: 0 2px 0 #000;
}

.fight-callout {
  justify-self: end;
  color: #d3bb8d;
  font:
    900 10px/1.15 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.11em;
  text-align: right;
  transform: rotate(1deg);
}

.fight-callout span {
  display: block;
  color: #f2a53a;
  font:
    1000 18px/1 Impact,
    "Arial Black",
    sans-serif;
}

.feature-rail {
  min-height: 56px;
  padding: 6px clamp(10px, 2vw, 28px);
  display: grid;
  grid-template-columns: minmax(220px, 0.95fr) minmax(560px, 2.8fr) 82px;
  align-items: stretch;
  gap: 8px;
  border-bottom: 3px solid #1b0b06;
  background: rgba(13, 8, 5, 0.96);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.34);
  z-index: 3;
}

.spoils-meter,
.fighter-meter,
.tumble-plaque {
  border: 2px solid #211008;
  background: #29140c;
  box-shadow:
    inset 0 0 0 1px rgba(214, 172, 99, 0.18),
    0 3px 0 #080403;
}

.spoils-meter {
  min-width: 0;
  padding: 5px 9px;
  display: grid;
  grid-template-columns: 34px auto minmax(45px, 1fr) auto;
  align-items: center;
  gap: 8px;
  clip-path: polygon(0 6%, 98% 0, 100% 88%, 96% 100%, 2% 96%);
}

.spoils-chest {
  position: relative;
  width: 29px;
  height: 20px;
  border: 3px solid #2a1208;
  border-radius: 2px;
  background: #963c20;
  box-shadow: inset 0 0 0 2px #d99935;
}

.spoils-chest::before {
  content: "";
  position: absolute;
  inset: -10px -3px auto;
  height: 11px;
  border: 3px solid #2a1208;
  border-bottom-width: 1px;
  border-radius: 12px 12px 1px 1px;
  background: #6f2818;
  box-shadow: inset 0 2px 0 #d99935;
}

.spoils-chest::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  width: 6px;
  height: 9px;
  background: #f2bc45;
  box-shadow: 0 0 0 2px #401708;
}

.spoils-meter__copy {
  min-width: 0;
}

.spoils-meter__copy strong {
  display: block;
  color: #f1b44d;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.spoils-meter__copy span {
  display: block;
  margin-top: 3px;
  color: #b9a27e;
  font:
    800 8px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.spoils-meter__track,
.fighter-meter__track {
  overflow: hidden;
  border: 2px solid #100805;
  background: #090503;
}

.spoils-meter__track {
  height: 9px;
}

.spoils-meter__track span,
.fighter-meter__fill {
  display: block;
  width: 0;
  height: 100%;
  transition: width 260ms ease;
}

.spoils-meter__track span {
  background: #d77729;
  box-shadow: inset 0 2px 0 #f3bc49;
}

.spoils-meter > b {
  color: #ffe1a0;
  font-size: 13px;
  white-space: nowrap;
}

.spoils-meter.is-rich,
.spoils-meter.is-claimed {
  filter: brightness(1.18);
}

.spoils-meter.is-claimed .spoils-chest {
  animation: chest-knock 480ms ease-in-out 2;
}

.fighter-meters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
}

.fighter-meter {
  min-width: 0;
  padding: 5px 6px;
  border-top-color: color-mix(in srgb, var(--fighter-color) 46%, #211008);
  clip-path: polygon(2% 0, 98% 3%, 100% 93%, 5% 100%, 0 13%);
  background: color-mix(in srgb, var(--fighter-color) 8%, #26120b);
}

.fighter-meter__label {
  display: flex;
  justify-content: space-between;
  gap: 3px;
  margin-bottom: 4px;
  color: #d8c6a3;
  font:
    900 8px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.fighter-meter__label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fighter-meter__count {
  color: var(--fighter-color);
  white-space: nowrap;
}

.fighter-meter__track {
  height: 7px;
}

.fighter-meter__fill {
  background: var(--fighter-color);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.34);
}

.fighter-meter.is-ready {
  border-color: var(--fighter-color);
  animation: ready-pulse 520ms steps(2, end) infinite alternate;
}

.tumble-plaque {
  padding: 7px 5px 3px;
  display: grid;
  place-content: center;
  text-align: center;
  clip-path: polygon(7% 0, 94% 5%, 100% 89%, 86% 100%, 3% 94%, 0 10%);
}

.tumble-plaque strong {
  display: block;
  color: #f0aa39;
  font:
    1000 24px/1 Impact,
    "Arial Black",
    sans-serif;
  text-shadow: 0 2px 0 #000;
}

#pixi-container {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #160d08;
}

#pixi-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: manipulation;
}

.control-deck {
  min-height: 103px;
  padding: 5px clamp(12px, 2.6vw, 38px) 8px;
  border-top: 5px solid #1c0b05;
  background:
    linear-gradient(rgba(66, 31, 16, 0.97), rgba(31, 13, 7, 0.99)),
    repeating-linear-gradient(88deg, #4b2716 0 45px, #3b1e11 45px 49px);
  box-shadow:
    inset 0 2px 0 rgba(218, 173, 90, 0.27),
    0 -9px 24px rgba(0, 0, 0, 0.38);
  z-index: 4;
}

.status {
  width: min(980px, 82vw);
  min-height: 20px;
  margin: -16px auto 4px;
  padding: 5px 18px 4px;
  border: 2px solid #180a05;
  clip-path: polygon(1% 0, 99% 2%, 100% 86%, 97% 100%, 2% 97%, 0 15%);
  color: #d8c6a3;
  background: #160b07;
  font:
    800 10px/1.2 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.035em;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(220, 168, 82, 0.18);
}

.control-row {
  width: min(1160px, 100%);
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 185px 102px minmax(170px, 1fr);
  align-items: center;
  gap: clamp(8px, 2vw, 28px);
}

.utility-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.utility-controls p {
  color: #d8bd8b;
  font:
    900 9px/1.1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
}

.utility-controls p strong,
.utility-controls p span {
  display: block;
}

.utility-controls p span {
  margin-top: 3px;
  color: #9e8060;
  font-size: 7px;
}

.secondary-button,
.spin-button,
.bet-stepper button {
  border: 0;
  cursor: pointer;
  transition:
    transform 110ms ease,
    filter 110ms ease,
    opacity 110ms ease;
}

.secondary-button {
  min-height: 37px;
  padding: 0 12px;
  border: 3px solid #1a0b06;
  clip-path: polygon(4% 0, 97% 4%, 100% 85%, 92% 100%, 2% 93%, 0 12%);
  color: #c7ad82;
  background: #2b160d;
  font:
    900 9px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 1px #5d361e;
}

.bet-stepper {
  height: 48px;
  display: grid;
  grid-template-columns: 38px minmax(92px, 1fr) 38px;
  align-items: stretch;
  border: 3px solid #180a05;
  clip-path: polygon(3% 0, 98% 3%, 100% 90%, 95% 100%, 1% 95%, 0 10%);
  background: #1a0d08;
  box-shadow: inset 0 0 0 2px #5a301b;
}

.bet-stepper button {
  color: #f0b54a;
  background: #34180e;
  font-size: 23px;
  line-height: 1;
}

.bet-stepper button:first-child {
  border-right: 2px solid #180a05;
}

.bet-stepper button:last-child {
  border-left: 2px solid #180a05;
}

.bet-stepper div {
  align-self: center;
  min-width: 0;
  text-align: center;
}

.bet-stepper strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #ffe6ad;
  font-size: 16px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spin-button {
  position: relative;
  width: 94px;
  height: 94px;
  justify-self: center;
  margin-top: -20px;
  border: 5px solid #2a0c07;
  border-radius: 50%;
  color: #fff0bd;
  background: #9f2e1f;
  box-shadow:
    inset 0 0 0 4px #e27030,
    inset 0 8px 0 rgba(255, 218, 119, 0.19),
    0 6px 0 #3b1009,
    0 10px 18px rgba(0, 0, 0, 0.45);
  text-shadow: 0 3px 0 #491008;
}

.spin-button::before,
.spin-button::after {
  content: "";
  position: absolute;
  border: 2px solid rgba(255, 209, 99, 0.34);
  border-radius: 50%;
}

.spin-button::before {
  inset: 8px;
}

.spin-button::after {
  inset: 13px;
  border-style: dashed;
}

.spin-button span,
.spin-button small {
  position: relative;
  z-index: 1;
  display: block;
}

.spin-button span {
  font:
    1000 23px/1 Impact,
    "Arial Black",
    sans-serif;
  letter-spacing: 0.08em;
}

.spin-button small {
  margin-top: 4px;
  color: #f5bf67;
  font:
    900 7px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.1em;
}

.rules-stamp {
  justify-self: end;
  padding: 7px 12px 5px;
  border: 3px solid #1b0b06;
  color: #e3bb72;
  background: #37180e;
  text-align: center;
  transform: rotate(1.2deg);
  box-shadow: inset 0 0 0 1px #6c3920;
}

.rules-stamp strong,
.rules-stamp span {
  display: block;
}

.rules-stamp strong {
  font:
    1000 15px/1 Impact,
    "Arial Black",
    sans-serif;
  letter-spacing: 0.11em;
}

.rules-stamp span {
  margin-top: 3px;
  color: #ae895a;
  font:
    900 7px/1 "Trebuchet MS",
    Arial,
    sans-serif;
  letter-spacing: 0.1em;
}

.secondary-button:hover:not(:disabled),
.spin-button:hover:not(:disabled),
.bet-stepper button:hover:not(:disabled) {
  filter: brightness(1.13);
  transform: translateY(-1px);
}

.spin-button:hover:not(:disabled) {
  transform: translateY(-2px) rotate(-1deg);
}

.secondary-button:active:not(:disabled),
.spin-button:active:not(:disabled),
.bet-stepper button:active:not(:disabled) {
  transform: translateY(3px);
}

.secondary-button:focus-visible,
.spin-button:focus-visible,
.bet-stepper button:focus-visible {
  outline: 3px solid #ffe2a2;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.spin-button.is-busy {
  cursor: wait;
  animation: spin-thump 380ms ease-in-out infinite alternate;
}

.spin-button.is-busy span::after {
  content: "…";
}

@keyframes ready-pulse {
  from {
    filter: brightness(1);
    transform: translateY(0);
  }
  to {
    filter: brightness(1.35);
    transform: translateY(-2px);
  }
}

@keyframes chest-knock {
  0%,
  100% {
    transform: rotate(0);
  }
  35% {
    transform: rotate(-5deg) translateY(-2px);
  }
  70% {
    transform: rotate(4deg);
  }
}

@keyframes spin-thump {
  from {
    filter: brightness(0.9);
  }
  to {
    filter: brightness(1.18);
  }
}

@media (max-width: 980px) {
  .game-header {
    grid-template-columns: minmax(160px, 1fr) minmax(310px, 1.4fr);
  }

  .fight-callout {
    display: none;
  }

  .scoreboard {
    justify-self: end;
    min-width: min(420px, 56vw);
  }

  .feature-rail {
    grid-template-columns: minmax(185px, 0.85fr) minmax(430px, 2.6fr) 70px;
  }

  .spoils-meter {
    grid-template-columns: 31px auto auto;
  }

  .spoils-meter__track {
    display: none;
  }

  .fighter-meter__label {
    font-size: 7px;
  }

  .control-row {
    grid-template-columns: minmax(120px, 1fr) 165px 96px minmax(120px, 1fr);
    gap: 10px;
  }

  .utility-controls p {
    display: none;
  }
}

@media (max-width: 700px) {
  .game-header {
    min-height: 59px;
    grid-template-columns: 1fr auto;
    gap: 6px;
    padding-inline: 10px;
  }

  .brand-lockup {
    min-width: 0;
    padding-right: 0;
  }

  .eyebrow,
  .tagline {
    display: none;
  }

  h1 {
    font-size: 32px;
  }

  .scoreboard {
    width: min(280px, 64vw);
    min-width: 0;
    min-height: 42px;
    padding: 5px 8px;
    gap: 6px;
  }

  .feature-rail {
    min-height: 88px;
    padding: 5px 7px;
    grid-template-columns: minmax(150px, 1fr) 64px;
    grid-template-rows: 37px 39px;
  }

  .spoils-meter {
    grid-column: 1;
    grid-row: 1;
    padding-block: 3px;
  }

  .spoils-chest {
    transform: scale(0.8);
  }

  .fighter-meters {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .fighter-meter {
    padding: 4px 3px;
  }

  .fighter-meter__label {
    justify-content: center;
  }

  .fighter-meter__label span:first-child {
    display: none;
  }

  .tumble-plaque {
    grid-column: 2;
    grid-row: 1;
  }

  .control-deck {
    min-height: 92px;
    padding-inline: 8px;
  }

  .status {
    width: 94vw;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .control-row {
    grid-template-columns: 58px minmax(130px, 1fr) 84px;
    gap: 7px;
  }

  .rules-stamp {
    display: none;
  }

  .secondary-button {
    width: 56px;
    padding: 0 4px;
    font-size: 7px;
  }

  .bet-stepper {
    height: 44px;
    grid-template-columns: 32px minmax(58px, 1fr) 32px;
  }

  .spin-button {
    width: 80px;
    height: 80px;
    margin-top: -15px;
    border-width: 4px;
  }

  .spin-button span {
    font-size: 19px;
  }
}

@media (max-height: 710px) {
  .game-header {
    min-height: 54px;
    padding-block: 5px;
  }

  .feature-rail {
    min-height: 48px;
    padding-block: 4px;
  }

  .fighter-meter {
    padding-block: 3px;
  }

  .control-deck {
    min-height: 84px;
    padding-bottom: 5px;
  }

  .control-row {
    min-height: 60px;
  }

  .spin-button {
    width: 78px;
    height: 78px;
    margin-top: -15px;
  }
}
