.app {
  width: min(1180px, calc(100% - 2rem));
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem 0;
}

.screen {
  min-height: calc(100vh - 2rem);
}

.title-screen,
.result-screen {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.35rem;
  max-width: 760px;
}

.title-screen.title-hero {
  justify-items: center;
  max-width: none;
  gap: 1.1rem;
  text-align: center;
}

.title-hero .title-copy p:not(.eyebrow) {
  margin-inline: auto;
}

.title-card-fan {
  display: flex;
  justify-content: center;
  align-items: end;
  min-height: 150px;
  margin-bottom: 1.4rem;
}

.title-fan-card {
  width: clamp(72px, 8vw, 104px);
  margin-inline: -0.9rem;
  transform: rotate(calc((var(--fan-index) - 2) * 9deg)) translateY(calc(max(var(--fan-index) - 2, 2 - var(--fan-index)) * 0.55rem));
  transform-origin: 50% 120%;
  filter: drop-shadow(0 10px 0 rgb(12 24 22 / 0.42));
}

.title-fan-card .title-fan-face {
  width: 100%;
}

.title-start-button {
  min-height: 3.4rem;
  border: 3px solid #101819;
  border-radius: 10px;
  padding: 0.8rem 2.6rem;
  box-shadow: 0 6px 0 #101819;
  font-size: 1.15rem;
  font-weight: 950;
  text-transform: uppercase;
}

.title-copy,
.result-screen {
  text-wrap: balance;
}

.title-copy p:not(.eyebrow),
.result-screen > p:not(.eyebrow) {
  max-width: 42rem;
  margin-top: 0.8rem;
  color: #efe7d4;
  font-size: 1.08rem;
}

.title-actions,
.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.game-screen,
.shop-screen {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.game-header,
.table-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1rem 0 0.25rem;
}

.game-header h1,
.table-header h1 {
  font-size: 3rem;
}

.boss-effect,
.message {
  max-width: 46rem;
  margin-top: 0.5rem;
  color: #f5ead0;
}

.upcoming-panel .boss-effect {
  color: var(--muted);
}

.message {
  border: 2px solid rgb(255 250 240 / 0.36);
  border-radius: 8px;
  padding: 0.65rem 0.8rem;
  background: rgb(18 57 46 / 0.68);
  font-weight: 700;
}

.stats-grid,
.stats-inline {
  display: grid;
  gap: 0.65rem;
}

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

.stats-grid.compact {
  grid-template-columns: repeat(4, minmax(7rem, 1fr));
  width: min(100%, 42rem);
}

.stats-inline {
  grid-template-columns: repeat(2, minmax(7rem, 1fr));
}

.stat {
  min-width: 0;
  border: 1px solid rgb(255 250 240 / 0.26);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  color: var(--panel-strong);
  background: rgb(12 31 27 / 0.52);
}

.stat dt {
  color: #d8ccb4;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat dd {
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
  font-size: 1.15rem;
  font-weight: 900;
}

.play-layout,
.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: 1rem;
  align-items: start;
}

.main-column,
.side-column,
.stack {
  display: grid;
  gap: 1rem;
}

.panel {
  border: 2px solid #2a271f;
  border-radius: 8px;
  padding: 1rem;
  color: var(--ink);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

.score-breakdown {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.9rem;
}

.score-breakdown th,
.score-breakdown td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.score-breakdown th {
  color: #4e483e;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-button {
  position: relative;
  display: block;
  width: clamp(64px, 7.6vw, 92px);
  border: 0;
  border-radius: 6px;
  padding: 0;
  color: inherit;
  background: transparent;
  box-shadow: 0 8px 0 rgb(12 24 22 / 0.48);
  line-height: 0;
  transform-origin: 50% 92%;
  transition:
    filter 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.card-button:hover {
  filter: brightness(1.06);
  transform: translateY(-0.45rem);
}

.card-button.is-selected {
  box-shadow:
    0 12px 0 rgb(12 24 22 / 0.34),
    0 0 0 3px #f5cf5f,
    0 0 18px rgb(245 207 95 / 0.54);
  transform: translateY(-1.2rem);
}

.card-button:disabled {
  filter: grayscale(0.45);
  opacity: 0.56;
}

.jokers-panel .stack {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.mini-item,
.item-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.mini-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.7rem;
}

.mini-item strong {
  color: var(--ink);
}

.mini-item span {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-jokers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem;
}

.item-copy {
  display: grid;
  gap: 0.25rem;
}

.item-copy p {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.item-cost {
  color: var(--ink);
  font-weight: 950;
}

.pack-choice-panel {
  border-color: var(--accent);
  background: #fff7df;
}

@media (max-width: 900px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .play-layout,
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .game-header,
  .table-header {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app {
    width: min(100% - 1rem, 1180px);
  }

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

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

  .item-row {
    align-items: stretch;
    flex-direction: column;
  }

  .item-actions {
    justify-content: start;
  }

  .game-header h1,
  .table-header h1 {
    font-size: 2.25rem;
  }
}

.run-shell {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 2rem);
  overflow: hidden;
  border: 3px solid #111819;
  border-radius: 10px;
  background: linear-gradient(135deg, #174131 0%, #2b745a 55%, #1d4f43 100%);
}

.blind-shell {
  height: calc(100vh - 2rem);
  min-height: 0;
}

.run-hud {
  display: grid;
  align-content: start;
  gap: 0.48rem;
  padding: 0.55rem;
  color: #f8f1dc;
  background: #263436;
  border-right: 4px solid #d69517;
}

.reference-run-hud {
  min-width: 0;
}

.blind-shell .run-hud,
.blind-shell .run-table {
  min-height: 0;
}

.blind-shell .run-hud {
  overflow-y: auto;
}

.hud-blind-card,
.hud-round-score-row,
.hud-score-card,
.hud-mini-stat {
  border: 4px solid #122024;
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.42);
}

.hud-blind-card {
  overflow: hidden;
  border-radius: 15px;
  background: #5a501d;
}

.hud-blind-title {
  display: grid;
  place-items: center;
  min-height: 3rem;
  border-bottom: 4px solid #122024;
  padding: 0.42rem 0.5rem;
  background: #b67800;
  box-shadow: inset 0 -6px 0 rgb(0 0 0 / 0.18);
  text-align: center;
}

.ready-hud-title {
  display: grid;
  place-items: center;
  min-height: 5.8rem;
  border: 4px solid #122024;
  border-radius: 13px;
  padding: 0.65rem 0.45rem;
  color: #fff9e4;
  background: #101f22;
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.22);
  text-align: center;
}

.ready-hud-title span {
  color: #fff9e4;
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1;
}

.hud-up-next {
  display: block;
  color: #3a2c07;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-blind-title strong {
  color: #fff9e4;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 950;
  line-height: 0.95;
  text-shadow:
    2px 2px 0 rgb(0 0 0 / 0.34),
    -1px -1px 0 rgb(255 255 255 / 0.22);
}

.ready-hud-title strong {
  color: #fff9e4;
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 950;
  line-height: 0.95;
  text-shadow:
    2px 2px 0 rgb(0 0 0 / 0.34),
    -1px -1px 0 rgb(255 255 255 / 0.22);
}

.hud-blind-requirement-panel {
  display: grid;
  grid-template-columns: minmax(76px, 0.38fr) minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.72rem 0.55rem 0.8rem;
}

.hud-blind-medal {
  display: grid;
  place-items: center;
  width: clamp(64px, 22vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  justify-self: center;
  color: #263436;
  background:
    linear-gradient(135deg, transparent 0 56%, rgb(255 255 255 / 0.2) 57% 64%, transparent 65%),
    #eaa328;
  box-shadow:
    inset -7px -7px 0 rgb(162 105 12 / 0.42),
    7px 7px 0 rgb(0 0 0 / 0.28);
}

.hud-blind-medal span {
  white-space: pre-line;
  font-size: clamp(0.7rem, 1.1vw, 0.9rem);
  font-weight: 950;
  line-height: 0.88;
  text-align: center;
  text-transform: uppercase;
}

.hud-target-box {
  display: grid;
  gap: 0.2rem;
  justify-items: center;
  border-radius: 9px;
  padding: 0.48rem 0.42rem 0.55rem;
  color: #fff9e4;
  background: #102124;
  box-shadow: 0 6px 0 rgb(0 0 0 / 0.48);
  text-align: center;
}

.hud-target-box span,
.hud-round-score-row > span,
.hud-mini-stat dt {
  color: #fff9e4;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 0.98;
}

.hud-target-box strong,
.hud-round-score-row strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  color: #ff4a45;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  font-weight: 950;
  line-height: 0.95;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 0.36);
}

.chip-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 0.75em;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #f7fff9 0 34%, transparent 35%),
    conic-gradient(#dfeff0 0 12.5%, #82999c 12.5% 25%, #dfeff0 25% 37.5%, #82999c 37.5% 50%, #dfeff0 50% 62.5%, #82999c 62.5% 75%, #dfeff0 75% 87.5%, #82999c 87.5% 100%);
}

.hud-round-score-row {
  display: grid;
  grid-template-columns: minmax(74px, 0.38fr) minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
  border-radius: 12px;
  padding: 0.42rem 0.5rem;
  background: #101f22;
}

.hud-round-score-row strong {
  min-height: 2.7rem;
  border-radius: 9px;
  color: #fff9e4;
  background: #2b383b;
}

.hud-score-card {
  display: grid;
  gap: 0.72rem;
  border-radius: 12px;
  padding: 1rem 0.65rem;
  background: #101f22;
  text-align: center;
}

.ready-preview-card {
  padding: 0.78rem 0.62rem;
}

.hud-hand-name {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.28rem;
  color: #fff9e4;
  font-size: clamp(1.1rem, 1.9vw, 1.55rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 0.42);
}

.hud-hand-name span {
  color: #d8d4c8;
  font-size: clamp(0.78rem, 1.2vw, 1rem);
  font-weight: 850;
}

.hud-score-values {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0.45rem;
  align-items: center;
}

.chip-pill,
.mult-pill {
  border-radius: 12px;
  padding: 0.42rem 0.42rem;
  color: white;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
  font-weight: 950;
  line-height: 0.95;
  text-align: center;
  box-shadow: inset 0 -5px 0 rgb(0 0 0 / 0.16);
}

.chip-pill {
  background: #0c9bf2;
}

.mult-pill {
  background: #ff4642;
}

.score-x {
  color: #ff4a45;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 950;
  line-height: 1;
  text-shadow: 2px 2px 0 rgb(0 0 0 / 0.36);
}

.hud-bottom-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.52rem;
}

.ready-hud .hud-mini-stat dt {
  font-size: 0.7rem;
}

.hud-run-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.52rem;
  min-width: 0;
}

.hud-mini-stat {
  display: grid;
  align-content: center;
  gap: 0.16rem;
  min-height: 3.72rem;
  border-radius: 11px;
  padding: 0.32rem;
  background: #101f22;
  text-align: center;
}

.hud-mini-stat dd {
  display: grid;
  place-items: center;
  min-height: 2.1rem;
  margin: 0;
  border-radius: 9px;
  color: #fff9e4;
  background: #2b383b;
  font-size: clamp(0.98rem, 1.6vw, 1.35rem);
  font-weight: 950;
  line-height: 1;
}

.hud-hands dd {
  color: #0c9bf2;
}

.hud-discards dd {
  color: #ff4642;
}

.hud-money {
  grid-column: 1 / -1;
}

.hud-money dd {
  color: #ffc044;
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
}

.hud-ante dd,
.hud-round dd {
  color: #f39a05;
}

.run-table {
  min-width: 0;
  padding: 1rem;
}

.blind-shell .run-table {
  padding: 0;
}

.table-scene {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto auto;
  gap: 0.65rem;
  height: 100%;
  min-height: calc(100vh - 2rem);
  overflow: hidden;
  padding: 0.7rem 1rem 1rem;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgb(0 0 0 / 0.08) 1px, transparent 1px),
    radial-gradient(ellipse at center, rgb(71 147 111 / 0.68), rgb(20 70 55 / 0.72) 66%, rgb(12 44 39 / 0.92)),
    #1e614c;
  background-size:
    6px 6px,
    100% 4px,
    100% 100%,
    100% 100%;
}

.table-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 34%, rgb(255 255 255 / 0.05) 35% 37%, transparent 38% 100%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.04) 0 1px, transparent 1px 4px);
  mix-blend-mode: soft-light;
}

.table-scene > * {
  position: relative;
  z-index: 1;
}

.table-scene .table-header {
  align-items: start;
  min-height: 2.6rem;
  padding: 0;
}

.table-scene .table-status-header {
  justify-content: end;
  min-height: 0;
}

.table-status-header .boss-effect,
.table-status-header .message {
  margin-top: 0;
}

.table-status-header .message {
  margin-left: auto;
}

.table-scene .table-header h1 {
  font-size: 1.55rem;
}

.table-scene .eyebrow {
  letter-spacing: 0;
}

.table-top-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.36fr);
  gap: 0.8rem;
  align-items: start;
}

.inventory-group {
  min-width: 0;
}

.rail-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #f5ead0;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-rail {
  display: flex;
  gap: 0.7rem;
  min-height: 88px;
  overflow-x: auto;
  padding-bottom: 0.35rem;
}

.card-rail .muted {
  display: grid;
  place-items: center;
  min-width: 9rem;
  min-height: 74px;
  border: 2px dashed rgb(255 250 240 / 0.22);
  border-radius: 7px;
  color: rgb(255 250 240 / 0.62);
  font-size: 0.82rem;
  font-weight: 800;
}

.compact-item {
  flex: 0 0 170px;
  min-height: 78px;
  padding: 0.45rem;
  color: var(--ink);
}

.compact-item .item-copy p {
  display: none;
}

.table-play-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(86px, 118px);
  gap: 0.8rem;
  min-height: 0;
}

.table-center {
  display: grid;
  grid-template-rows: minmax(112px, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  min-width: 0;
  border-radius: 8px;
  padding: 0.5rem;
  background: linear-gradient(180deg, rgb(10 45 37 / 0.08), rgb(10 45 37 / 0.32));
}

.played-card-row {
  display: flex;
  justify-content: center;
  align-items: end;
  min-height: 112px;
  padding: 0.35rem;
}

.played-card-wrap {
  position: relative;
  display: inline-grid;
  place-items: end center;
  width: clamp(58px, 7vw, 82px);
  margin-inline: -0.08rem;
  transition: transform 180ms ease, filter 180ms ease;
}

.played-card-row .played-card-face {
  width: 100%;
  margin-inline: 0;
  filter: drop-shadow(0 8px 0 rgb(14 30 27 / 0.48));
}

.played-card-wrap.is-popping {
  z-index: 2;
  filter: drop-shadow(0 0 16px rgb(255 238 166 / 0.78));
  transform: translateY(-0.55rem);
}

.card-pop-badge {
  position: absolute;
  top: -1rem;
  left: 50%;
  min-width: 2rem;
  border: 2px solid #fff6ce;
  border-radius: 999px;
  padding: 0.12rem 0.4rem;
  color: #18383b;
  background: #ffd85a;
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.34);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
  animation: card-pop-badge-in 160ms ease-out both;
}

@keyframes card-pop-badge-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(0.4rem) scale(0.7);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.joker-slot {
  display: contents;
}

.joker-slot.is-joker-firing .item-card {
  outline: 3px solid #ffd85a;
  outline-offset: 2px;
  box-shadow: 0 0 18px rgb(255 216 90 / 0.6);
}

.table-empty-zone {
  display: block;
  width: min(74%, 560px);
  min-height: 96px;
  border-radius: 8px;
  background: rgb(5 33 29 / 0.2);
  box-shadow: inset 0 0 38px rgb(0 0 0 / 0.12);
}

.deck-pile {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 0.25rem;
  min-width: 0;
  color: #f8f1dc;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.35);
}

.deck-pile-face {
  width: clamp(56px, 7vw, 80px);
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 8px 0 rgb(14 30 27 / 0.48));
}

.deck-pile-button {
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  line-height: 0;
}

.deck-pile-button:hover .deck-pile-face,
.deck-pile-button:focus-visible .deck-pile-face {
  filter:
    drop-shadow(0 8px 0 rgb(14 30 27 / 0.48))
    drop-shadow(0 0 14px rgb(255 238 166 / 0.72));
}

.deck-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(0.7rem, 2vw, 1.4rem);
  background: rgb(5 12 14 / 0.72);
}

.deck-viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.75rem;
  width: min(100%, 780px);
  max-height: min(86vh, 680px);
  border: 3px solid #101819;
  border-radius: 8px;
  padding: 0.85rem;
  color: #f8f1dc;
  background: #263436;
  box-shadow: 0 16px 0 rgb(0 0 0 / 0.34);
}

.deck-viewer-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.deck-viewer-header h2 {
  color: #fff9e4;
  font-size: 1.3rem;
  font-weight: 950;
  line-height: 1;
}

.deck-viewer-close {
  border: 2px solid #101819;
  border-radius: 8px;
  padding: 0.38rem 0.62rem;
  color: #fff9e4;
  background: #ed423d;
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.28);
  font-weight: 950;
}

.deck-viewer-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(34px, 1fr));
  gap: 0.34rem;
  min-height: 0;
  overflow: auto;
  padding: 0.12rem;
}

.deck-viewer-card {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
  border: 2px solid rgb(255 250 240 / 0.18);
  border-radius: 8px;
  padding: 0.18rem;
  background: rgb(12 31 27 / 0.48);
  text-align: center;
}

.deck-viewer-card.is-spent {
  filter: grayscale(1);
  opacity: 0.42;
}

.deck-viewer-card-face {
  width: 100%;
  filter: drop-shadow(0 4px 0 rgb(0 0 0 / 0.28));
}

.deck-viewer-face {
  width: 100%;
  filter: drop-shadow(0 4px 0 rgb(0 0 0 / 0.28));
}

.deck-viewer-card > span {
  color: #f8f1dc;
  font-size: 0.64rem;
  font-weight: 950;
  line-height: 1;
}

.hand-rail {
  min-width: 0;
}

.hand-card-fan {
  display: flex;
  justify-content: center;
  align-items: end;
  min-height: 148px;
  overflow-x: auto;
  padding: 2rem 0.75rem 0.6rem;
  scrollbar-width: thin;
}

.hand-card-slot {
  flex: 0 0 auto;
  margin-inline: clamp(-0.5rem, -0.8vw, -0.18rem);
  transform-origin: 50% 92%;
}

.hand-card-slot:nth-child(odd) {
  transform: translateY(0.25rem) rotate(-1.5deg);
}

.hand-card-slot:nth-child(even) {
  transform: translateY(-0.05rem) rotate(1.5deg);
}

.table-controls {
  display: grid;
  grid-template-columns: minmax(118px, 152px) auto minmax(118px, 152px);
  justify-content: center;
  align-items: end;
  gap: 0.55rem;
  padding-bottom: 0.1rem;
}

.table-controls .button {
  min-height: 3.45rem;
  border: 3px solid #101819;
  border-radius: 8px;
  color: white;
  box-shadow: 0 5px 0 #101819;
  font-size: 1rem;
  font-weight: 950;
}

.button-play {
  background: #0b76d8;
}

.button-discard {
  background: #ed423d;
}

.button-sort {
  min-height: 2.4rem;
  padding: 0.45rem 0.65rem;
  background: #f0a018;
  font-size: 0.78rem;
}

.sort-hand-control {
  display: grid;
  gap: 0.25rem;
  min-width: 128px;
  border: 3px solid #f7f2df;
  border-radius: 8px;
  padding: 0.35rem;
  color: #f7f2df;
  background: #1c292d;
  box-shadow: 0 5px 0 #101819;
  text-align: center;
}

.sort-hand-control > span {
  font-size: 0.74rem;
  font-weight: 950;
  text-transform: uppercase;
}

.sort-hand-control > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
}

@media (max-width: 780px) {
  .run-shell {
    grid-template-columns: 1fr;
  }

  .blind-shell {
    height: auto;
    min-height: calc(100vh - 2rem);
    overflow: visible;
  }

  .ready-shell .run-table {
    order: -1;
  }

  .ready-shell .next-blind-screen {
    align-content: start;
  }

  .ready-shell .ready-blind-layout {
    grid-template-columns: 1fr;
  }

  .ready-shell .ready-blind-layout {
    align-items: start;
  }

  .ready-shell .ready-deck-pile {
    align-content: start;
  }

  .ready-shell .ready-deck-pile {
    justify-self: center;
  }

  .run-hud {
    border-right: 0;
    border-bottom: 3px solid #d69517;
  }

  .blind-shell .run-hud {
    overflow: visible;
  }

  .blind-shell .table-scene {
    height: auto;
    min-height: calc(100vh - 2rem);
    overflow: visible;
  }

  .blind-shell .table-scene .table-header {
    min-height: 0;
  }
}

.shop-lobby {
  display: grid;
  gap: 1rem;
}

.shop-marquee {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.shop-marquee h1 {
  color: #ffc43a;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  text-shadow: 3px 3px 0 #7b2e16;
}

.shop-counter {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 1rem;
  border: 3px solid #101819;
  border-radius: 10px;
  padding: 1rem;
  background: #2c4144;
  box-shadow: inset 0 0 0 2px #c44138;
}

.shop-actions-column {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.shop-offers,
.shop-owned {
  display: grid;
  gap: 1rem;
}

.shop-offers .stack,
.shop-owned .stack {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.shop-shell .panel {
  border: 3px solid #101819;
  color: #f8f1dc;
  background: #12262a;
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.35);
}

.shop-shell .panel h2 {
  color: #ffc43a;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shop-shell .panel .muted {
  color: #9fb4ad;
}

.shop-shell .item-row {
  border: 2px solid #0d1c1f;
  border-radius: 10px;
  background: #1a3237;
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.32);
}

.shop-shell .item-copy h4 {
  color: #fff9e4;
  font-size: 1.02rem;
}

.shop-shell .item-copy p {
  color: #b9c9c1;
}

.shop-shell .item-cost {
  display: inline-grid;
  place-items: center;
  min-width: 2.6rem;
  border: 2px solid #101819;
  border-radius: 999px;
  padding: 0.3rem 0.55rem;
  color: #1d1609;
  background: #ffc43a;
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.35);
  font-weight: 950;
}

.shop-shell .item-card-face {
  width: clamp(64px, 6vw, 84px);
}

.shop-shell .shop-actions-column .button {
  min-height: 3.2rem;
  border: 3px solid #101819;
  border-radius: 9px;
  box-shadow: 0 5px 0 #101819;
  font-weight: 950;
  text-transform: uppercase;
}

.shop-shell .mini-item {
  border: 2px solid #0d1c1f;
  background: #1a3237;
}

.shop-shell .mini-item strong {
  color: #fff9e4;
}

.shop-shell .mini-item span {
  color: #b9c9c1;
}

.pack-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 1rem;
  background: rgb(6 16 15 / 0.72);
  overflow: hidden;
}

.pack-modal {
  display: grid;
  gap: 0.8rem;
  width: min(560px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border: 3px solid #ffc43a;
  border-radius: 12px;
  padding: 1rem;
  background: #12262a;
  box-shadow: 0 14px 0 rgb(0 0 0 / 0.35);
}

.pack-modal-header h2 {
  color: #ffc43a;
  font-size: 1.2rem;
  font-weight: 950;
}

.pack-modal-choices {
  display: grid;
  gap: 0.7rem;
}

.pack-modal .item-row {
  border: 2px solid #0d1c1f;
  border-radius: 10px;
  background: #1a3237;
  box-shadow: 0 4px 0 rgb(0 0 0 / 0.32);
}

.pack-modal .item-copy h4 {
  color: #fff9e4;
}

.pack-modal .item-copy p {
  color: #b9c9c1;
}

.pack-modal-footer {
  display: flex;
  justify-content: center;
}

.pack-skip-button {
  min-width: 10rem;
}

.next-blind-screen {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-height: 100%;
  padding: clamp(0.75rem, 2vw, 1.4rem);
}

.ready-scene-header .table-top-rail {
  margin-bottom: 0.2rem;
}

.ready-blind-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(74px, 96px);
  gap: 1rem;
  align-items: end;
  min-height: 0;
}

.ready-lane-panel {
  min-width: 0;
}

.next-blind-board.ready-blind-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.blind-lane {
  display: grid;
  align-content: start;
  gap: 0.62rem;
  min-height: clamp(18rem, 45vh, 26rem);
  border: 3px solid #15282a;
  border-radius: 10px;
  padding: 0.8rem;
  color: #f8f1dc;
  background: linear-gradient(180deg, rgb(15 35 39 / 0.74), rgb(21 44 50 / 0.88));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.04);
  text-align: center;
}

.blind-lane.is-current {
  border-color: #129fe3;
  opacity: 1;
  box-shadow:
    inset 0 0 0 2px rgb(18 159 227 / 0.45),
    0 5px 0 rgb(0 0 0 / 0.32);
}

.blind-lane.is-upcoming {
  opacity: 0.72;
}

.blind-lane.is-cleared {
  opacity: 0.62;
}

.blind-lane.is-boss {
  border-color: #b63b32;
}

.lane-status,
.lane-disabled-start {
  display: grid;
  place-items: center;
  min-height: 1.8rem;
  border-radius: 7px;
  padding: 0.24rem 0.45rem;
  color: #fff9e4;
  background: #f39a05;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
}

.lane-status.is-upcoming,
.lane-disabled-start {
  color: #94a4a3;
  background: #39484c;
}

.lane-status.is-cleared,
.lane-disabled-start.is-cleared {
  color: #becfc8;
  background: #31514c;
}

.lane-label {
  display: grid;
  place-items: center;
  min-height: 1.8rem;
  border-radius: 7px;
  padding: 0.25rem 0.4rem;
  background: #095fa9;
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.blind-lane.is-upcoming:not(.is-boss) .lane-label {
  background: #8a6818;
}

.blind-lane.is-cleared:not(.is-boss) .lane-label {
  background: #315a53;
}

.blind-lane.is-boss .lane-label {
  background: #87362f;
}

.lane-medal {
  display: grid;
  place-items: center;
  justify-self: center;
  width: clamp(3.2rem, 5.5vw, 4.1rem);
  aspect-ratio: 1;
  border-radius: 50%;
  color: #263436;
  background: #eaa328;
  box-shadow:
    inset -6px -6px 0 rgb(162 105 12 / 0.42),
    5px 5px 0 rgb(0 0 0 / 0.26);
}

.lane-medal span {
  white-space: pre-line;
  font-size: 0.76rem;
  font-weight: 950;
  line-height: 0.88;
}

.lane-medal.is-boss-medal {
  color: #f4d9cc;
  background: #843d2e;
}

.lane-score-panel {
  display: grid;
  gap: 0.18rem;
  border-radius: 8px;
  padding: 0.55rem 0.45rem;
  background: #102124;
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.36);
  font-size: 0.78rem;
  font-weight: 950;
}

.lane-score-panel strong {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.28rem;
  color: #ff4a45;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  line-height: 1;
}

.lane-effect {
  margin: 0;
  color: #d7d0be;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.lane-up-ante {
  display: grid;
  gap: 0.16rem;
  color: #f0a018;
  font-size: 0.75rem;
  font-weight: 850;
}

.lane-up-ante strong {
  font-size: 0.9rem;
  line-height: 1;
}

.lane-start-button {
  min-height: 2.15rem;
  border: 0;
  border-radius: 7px;
  color: #1d1609;
  background: #e4ab3d;
  font-size: 0.9rem;
  font-weight: 950;
  box-shadow: 0 5px 0 rgb(0 0 0 / 0.3);
}

.ready-deck-pile {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 0.38rem;
  min-width: 0;
  color: #f8f1dc;
  font-size: 0.74rem;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.35);
}

.ready-deck-face {
  width: clamp(54px, 6.5vw, 78px);
  filter: drop-shadow(0 8px 0 rgb(14 30 27 / 0.48));
}

@media (max-width: 980px) and (min-width: 781px) {
  .ready-shell .ready-blind-layout {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .next-blind-board.ready-blind-lanes {
    grid-template-columns: repeat(3, minmax(124px, 1fr));
    gap: 0.7rem;
  }

  .ready-shell .ready-deck-pile {
    justify-self: center;
    align-content: start;
  }

  .blind-lane {
    padding: 0.7rem;
  }
}

@media (max-width: 520px) {
  .next-blind-board.ready-blind-lanes {
    grid-template-columns: 1fr;
  }

  .ready-scene-header .table-top-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .ready-scene-header .rail-label {
    margin-bottom: 0.22rem;
    font-size: 0.66rem;
  }

  .ready-scene-header .card-rail {
    min-height: 2.15rem;
    padding-bottom: 0;
  }

  .ready-scene-header .card-rail .muted {
    min-width: 0;
    min-height: 2.15rem;
    padding: 0.18rem;
    font-size: 0.64rem;
    line-height: 1.05;
  }

  .blind-lane {
    min-height: auto;
  }

  .blind-lane.is-current {
    order: -1;
  }
}

.sprite-card {
  display: block;
  aspect-ratio: var(--sprite-aspect, 71 / 95);
  background-image: var(--sprite-url);
  background-repeat: no-repeat;
  background-size: calc(var(--sprite-cols) * 100%) calc(var(--sprite-rows) * 100%);
  background-position: var(--sprite-x) var(--sprite-y);
}

.playing-card-face {
  width: 100%;
  margin: 0;
}

.item-card-face {
  width: 70px;
}

.card-button .sprite-card-fallback {
  width: 100%;
}

.sprite-card-fallback {
  display: grid;
  place-items: center;
  aspect-ratio: 71 / 95;
  border: 2px solid #101819;
  border-radius: 6px;
  padding: 0.4rem;
  color: #111819;
  background: #f7f4e8;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.sprite-card-fallback.is-monogram {
  border: 2px solid rgb(255 250 240 / 0.4);
  color: #fff9e4;
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 0.25), 0 3px 0 rgb(0 0 0 / 0.3);
}

.sprite-card-fallback.is-kind-joker {
  background: linear-gradient(160deg, #5b3a8f, #2c1f52);
}

.sprite-card-fallback.is-kind-consumable {
  background: linear-gradient(160deg, #1f6f9e, #123a55);
}

.sprite-card-fallback.is-kind-voucher {
  background: linear-gradient(160deg, #b78615, #6b4c0a);
}

.sprite-card-fallback.is-kind-pack {
  background: linear-gradient(160deg, #1f8a70, #0f4a3c);
}

.fallback-monogram {
  font-size: clamp(0.95rem, 1.6vw, 1.35rem);
  font-weight: 950;
  letter-spacing: 0.04em;
  text-shadow: 1px 2px 0 rgb(0 0 0 / 0.4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .next-blind-board,
  .hud-blind-requirement-panel,
  .hud-bottom-grid,
  .table-top-rail,
  .table-inventory,
  .table-play-area,
  .shop-counter {
    grid-template-columns: 1fr;
  }

  .table-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .hand-card-fan {
    justify-content: start;
  }

  .deck-viewer-grid {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }

  .card-grid {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  }
}
