:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #111614;
  color: #f2f5ed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #111614;
}

button {
  border: 0;
  border-radius: 8px;
  padding: 0.82rem 1.1rem;
  background: #f7c948;
  color: #12120e;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

button:hover,
button:focus-visible {
  background: #ffe082;
}

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

.game-shell {
  display: grid;
  gap: 1rem;
  width: min(100vw, 1400px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.eyebrow {
  margin: 0;
  color: #9ab0a4;
}

.eyebrow {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1;
}

h1 {
  font-size: clamp(1.7rem, 2.8rem, 3rem);
}

h2 {
  font-size: clamp(2rem, 3.4rem, 4rem);
}

.arena-wrap {
  position: relative;
  min-height: 420px;
  height: min(68vh, 780px);
  border: 1px solid rgba(242, 245, 237, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: #050706;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: default;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 1.25rem;
  text-align: center;
  background: rgba(5, 7, 6, 0.72);
}

.overlay.hidden {
  display: none;
}

.overlay p {
  max-width: 42rem;
  margin: 0;
  color: #d5ddd4;
  font-size: 1.05rem;
}

.overlay-actions {
  display: flex;
  align-items: end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.stats-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(7rem, 1fr));
  gap: 0.5rem;
  width: min(36rem, 100%);
}

.stats-board div {
  border: 1px solid rgba(242, 245, 237, 0.18);
  border-radius: 8px;
  padding: 0.7rem;
  background: rgba(17, 22, 20, 0.72);
}

.stats-board span {
  display: block;
  color: #9ab0a4;
  font-size: 0.78rem;
  font-weight: 800;
}

.stats-board strong {
  display: block;
  margin-top: 0.2rem;
  color: #f2f5ed;
  font-size: 1.1rem;
}

.reward-board {
  display: grid;
  gap: 0.65rem;
  width: min(42rem, 100%);
}

.reward-title {
  margin: 0;
  color: #f7c948;
  font-weight: 900;
}

.reward-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.reward-card {
  min-height: 9.5rem;
}

.reward-card.is-selected {
  outline: 3px solid #41be70;
  opacity: 1;
}

.hidden {
  display: none !important;
}

.deck-panel {
  display: grid;
  gap: 0.8rem;
}

.deck-topline {
  display: grid;
  grid-template-columns: repeat(4, minmax(7rem, 1fr)) minmax(12rem, auto);
  gap: 0.65rem;
  align-items: stretch;
}

.deck-topline > div {
  border: 1px solid rgba(242, 245, 237, 0.18);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: rgba(5, 7, 6, 0.78);
}

.deck-topline span {
  display: block;
  color: #9ab0a4;
  font-size: 0.75rem;
  font-weight: 800;
}

.deck-topline strong {
  display: block;
  margin-top: 0.2rem;
  color: #f2f5ed;
  font-size: 1rem;
}

.draw-meter {
  height: 0.42rem;
  margin-top: 0.45rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(242, 245, 237, 0.12);
}

.draw-meter div {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #f7c948;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 120ms linear, background 160ms ease;
}

.draw-meter.is-paused div {
  background: #69756e;
}

.draw-meter.is-full div {
  background: #41be70;
}

.unpause-button {
  min-height: 100%;
  background: #2da084;
  color: #04120e;
}

.unpause-button:hover,
.unpause-button:focus-visible,
.unpause-button.is-held {
  background: #41be70;
}

.hand {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.65rem;
}

.card,
.card-slot {
  min-height: 8.5rem;
  border-radius: 8px;
  padding: 0.75rem;
}

.card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.55rem;
  border: 1px solid rgba(242, 245, 237, 0.24);
  background: #d5ddd4;
  color: #111614;
  text-align: left;
  position: relative;
}

.card:hover,
.card:focus-visible {
  background: #f2f5ed;
}

.card:disabled {
  opacity: 0.5;
}

.card.is-discard-target {
  outline: 3px solid #f7c948;
  outline-offset: -3px;
  box-shadow: 0 0 0.9rem rgba(247, 201, 72, 0.32);
}

.card.is-discard-target:hover,
.card.is-discard-target:focus-visible {
  background: #ffe082;
}

.card-ghost {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.32);
}

.card strong,
.card span,
.card em {
  display: block;
}

.card-art {
  width: 3.2rem;
  height: 3.2rem;
  border: 2px solid rgba(17, 22, 20, 0.28);
  border-radius: 8px;
  display: grid !important;
  place-items: center;
  background: rgba(255, 255, 255, 0.34);
  color: #111614;
  font-size: 2.1rem;
  font-weight: 900;
  line-height: 1;
}

.card strong {
  font-size: 0.98rem;
  line-height: 1.1;
}

.card > span:not(.card-art) {
  color: #2b3530;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.card em {
  justify-self: end;
  align-self: end;
  border-radius: 8px;
  padding: 0.18rem 0.38rem;
  background: rgba(17, 22, 20, 0.82);
  color: #f2f5ed;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.card-rotateClockwise,
.card-rotateCounterclockwise {
  background: #b9d8ef;
}

.card-accelerateForward {
  background: #f7c948;
}

.card-fireForward {
  background: #ef8d7d;
}

.card-cycleOne {
  background: #d5c6f0;
}

.card-stop {
  background: #cbd2d0;
}

.card-shotgun {
  background: #f0a3a0;
}

.card-blink {
  background: #9ecff0;
}

.card-drawThree {
  background: #d5c6f0;
}

.card-novaGun {
  background: #f2d47b;
}

.card-heal {
  background: #9ed8aa;
}

.card-slot {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(242, 245, 237, 0.22);
  color: rgba(242, 245, 237, 0.36);
  background: rgba(5, 7, 6, 0.42);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 760px) {
  .hud {
    align-items: stretch;
    flex-direction: column;
  }

  .arena-wrap {
    height: 62vh;
    min-height: 360px;
  }

  .stats-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reward-options {
    grid-template-columns: 1fr;
  }

  .deck-topline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unpause-button {
    grid-column: 1 / -1;
    min-height: 3.25rem;
  }

  .hand {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
