:root {
  color: #211926;
  background: #f7f4ef;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

/* Live battle cards stay deliberately quiet. Score detail belongs to the animated
   stage layer, so the rails can be read at a glance on both desktop and mobile. */
.play-layout.is-battle-active .match-stage {
  position: relative !important;
  isolation: isolate !important;
}

.play-layout.is-battle-active .match-rail .match-token-header,
.play-layout.is-battle-active .match-rail .match-cost-badge,
.play-layout.is-battle-active .match-rail .opponent-pocket-card > small,
.play-layout.is-battle-active .match-rail .hand-card-select > small {
  display: none !important;
}

.play-layout.is-battle-active .match-rail .opponent-pocket-card,
.play-layout.is-battle-active .match-rail .hand-card {
  position: relative !important;
}

.play-layout.is-battle-active .match-rail .match-card-name {
  position: absolute !important;
  right: 4px !important;
  bottom: 4px !important;
  left: 4px !important;
  z-index: 3 !important;
  display: block !important;
  overflow: hidden !important;
  padding: 3px 5px !important;
  border-radius: 4px !important;
  background: linear-gradient(180deg, rgba(3, 8, 10, 0.18), rgba(3, 8, 10, 0.9)) !important;
  color: #fffaf2 !important;
  font-size: 0.68rem !important;
  font-weight: 950 !important;
  line-height: 1.05 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .battle-card-identity {
  position: absolute !important;
  top: 5px !important;
  right: 30px !important;
  left: 5px !important;
  z-index: 4 !important;
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 5px !important;
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-card-color-icon {
  display: grid !important;
  width: 28px !important;
  height: 28px !important;
  flex: 0 0 28px !important;
  place-items: center !important;
  padding: 2px !important;
  border: 1px solid rgba(255, 224, 138, 0.72) !important;
  border-radius: 6px !important;
  background: rgba(3, 8, 10, 0.84) !important;
  box-shadow: 0 0 12px rgba(226, 181, 91, 0.26) !important;
}

.play-layout.is-battle-active .battle-card-color-icon img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.play-layout.is-battle-active .battle-card-combat {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(20px, 1fr)) !important;
  gap: 3px !important;
  width: min(150px, calc(100% - 34px)) !important;
  min-width: 0 !important;
  padding: 2px 3px !important;
  border-radius: 6px !important;
  background: rgba(3, 8, 10, 0.75) !important;
}

.play-layout.is-battle-active .battle-card-combat i {
  position: relative !important;
  display: grid !important;
  width: 25px !important;
  height: 25px !important;
  place-items: center !important;
  justify-self: end !important;
  font-style: normal !important;
}

.play-layout.is-battle-active .battle-card-combat i img {
  display: block !important;
  width: 25px !important;
  height: 25px !important;
  object-fit: contain !important;
}

.play-layout.is-battle-active .battle-card-combat i b {
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  color: #fffaf2 !important;
  font-size: 0.68rem !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-shadow: 0 1px 2px #071015, 0 0 4px #071015 !important;
}

.play-layout.is-battle-active .match-rail .hand-card .match-card-name {
  bottom: 3px !important;
  padding-right: 28px !important;
  padding-left: 5px !important;
  text-align: left !important;
}

.play-layout.is-battle-active .match-rail .match-card-view-glyph,
.play-layout.is-battle-active .match-rail .hand-card-view-glyph {
  top: 5px !important;
  right: 5px !important;
  z-index: 5 !important;
  width: 21px !important;
  height: 21px !important;
  font-size: 0.8rem !important;
}

.play-layout.is-battle-active .match-rail .match-card-status {
  position: absolute !important;
  top: 5px !important;
  left: 5px !important;
  z-index: 4 !important;
  max-width: calc(100% - 32px) !important;
  padding: 3px 5px !important;
  border-radius: 4px !important;
  background: rgba(3, 8, 10, 0.82) !important;
  color: #ffe08a !important;
  font-size: 0.54rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .match-rail .match-booster-marker {
  top: 28px !important;
  right: 5px !important;
  z-index: 4 !important;
  font-size: 0.46rem !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card {
  position: relative !important;
  grid-template-rows: minmax(0, 1fr) auto auto !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card .match-ring-name {
  z-index: 3 !important;
  display: block !important;
  overflow: hidden !important;
  padding: 5px 8px 2px !important;
  background: rgba(3, 8, 10, 0.86) !important;
  color: #fffaf2 !important;
  font-size: 0.9rem !important;
  font-weight: 950 !important;
  line-height: 1 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card .match-ring-state {
  z-index: 3 !important;
  padding: 2px 8px 5px !important;
  background: rgba(3, 8, 10, 0.86) !important;
  color: #95f1df !important;
  font-size: 0.62rem !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effects {
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.match-effect-burst-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
}

.match-effect-burst {
  --burst-accent: #95f1df;
  position: absolute;
  top: var(--burst-y);
  left: var(--burst-x);
  display: grid;
  width: 104px;
  min-height: 116px;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--burst-accent);
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--burst-accent) 30%, transparent), transparent 62%),
    rgba(3, 10, 14, 0.86);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--burst-accent) 20%, transparent), 0 0 32px color-mix(in srgb, var(--burst-accent) 45%, transparent);
  opacity: 0;
  transform-origin: center;
  animation: match-effect-burst 3s cubic-bezier(0.16, 0.82, 0.24, 1) var(--burst-delay) both;
}

.match-effect-burst.is-opponent {
  --burst-accent: #ff9b7c;
}

.match-effect-burst.kind-boost {
  --burst-accent: #ffe08a;
}

.match-effect-burst.kind-banner {
  --burst-accent: #cba7ff;
}

.match-effect-burst.kind-accessory {
  --burst-accent: #ffcf6e;
}

.match-effect-burst img {
  display: block;
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px color-mix(in srgb, var(--burst-accent) 70%, transparent));
}

.match-effect-burst strong,
.match-effect-burst small {
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-effect-burst strong {
  color: #fffaf2;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.05;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.9);
}

.match-effect-burst small {
  color: var(--burst-accent);
  font-size: 0.48rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@keyframes match-effect-burst {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translate(-50%, -50%) scale(0.42) rotate(-10deg);
  }
  13% {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1.08) rotate(0deg);
  }
  66% {
    opacity: 0.96;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    filter: blur(5px);
    transform: translate(-50%, -64%) scale(0.82) rotate(6deg);
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .match-rail .match-card-name {
    right: 3px !important;
    bottom: 3px !important;
    left: 3px !important;
    padding: 2px 3px !important;
    font-size: 0.54rem !important;
  }

  .play-layout.is-battle-active .match-rail .hand-card .match-card-name {
    padding-right: 23px !important;
  }

  .play-layout.is-battle-active .match-rail .match-card-view-glyph,
  .play-layout.is-battle-active .match-rail .hand-card-view-glyph {
    top: 3px !important;
    right: 3px !important;
    width: 17px !important;
    height: 17px !important;
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .match-rail .match-card-status {
    top: 3px !important;
    left: 3px !important;
    padding: 2px 3px !important;
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-card-identity {
    top: 3px !important;
    right: 23px !important;
    left: 3px !important;
    gap: 3px !important;
  }

  .play-layout.is-battle-active .battle-card-color-icon {
    width: 20px !important;
    height: 20px !important;
    flex-basis: 20px !important;
    border-radius: 4px !important;
  }

  .play-layout.is-battle-active .battle-card-combat {
    grid-template-columns: repeat(4, minmax(13px, 1fr)) !important;
    gap: 1px !important;
    width: min(104px, calc(100% - 23px)) !important;
    padding: 1px 2px !important;
  }

  .play-layout.is-battle-active .battle-card-combat i,
  .play-layout.is-battle-active .battle-card-combat i img {
    width: 18px !important;
    height: 18px !important;
  }

  .play-layout.is-battle-active .battle-card-combat i b {
    font-size: 0.5rem !important;
  }

  .play-layout.is-battle-active .match-stage .match-ring-card .match-ring-name {
    padding: 3px 5px 2px !important;
    font-size: 0.72rem !important;
  }

  .play-layout.is-battle-active .match-stage .match-ring-card .match-ring-state {
    padding: 2px 5px 3px !important;
    font-size: 0.48rem !important;
  }

  .match-effect-burst {
    width: 64px;
    min-height: 74px;
    padding: 5px;
    border-radius: 7px;
  }

  .match-effect-burst img {
    width: 46px;
    height: 46px;
  }

  .match-effect-burst strong { font-size: 0.44rem; }
  .match-effect-burst small { font-size: 0.36rem; }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255, 243, 215, 0.82), rgba(222, 246, 241, 0.84)),
    #f7f4ef;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

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

.provenance-badge {
  width: fit-content;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 999px;
  padding: 0.24rem 0.55rem;
  background: rgba(16, 19, 31, 0.54);
}

.game-titlemark {
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
}

.game-titlemark--landing {
  width: min(100%, 440px);
}

.game-titlemark--compact {
  width: clamp(118px, 16vw, 210px);
  margin: 0.25rem 0 0.35rem;
}

h1,
h2,
h3,
p,
ol {
  margin-top: 0;
}

p,
li {
  line-height: 1.55;
}

.app-shell {
  position: relative;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
}

.landing {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  align-items: start;
  overflow: hidden;
  padding: 88px 24px 230px;
  color: #fffaf2;
}

.landing-art,
.landing-shade {
  position: absolute;
  inset: 0;
}

.landing-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.landing-shade {
  background:
    linear-gradient(90deg, rgba(15, 18, 26, 0.9), rgba(15, 18, 26, 0.4) 54%, rgba(15, 18, 26, 0.12)),
    linear-gradient(0deg, #f7f4ef, rgba(247, 244, 239, 0) 18%),
    linear-gradient(180deg, rgba(15, 18, 26, 0.38), transparent 34%);
}

.landing-topbar {
  position: absolute;
  z-index: 2;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.landing-topbar nav {
  display: flex;
  flex-wrap: nowrap;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.landing-topbar nav::-webkit-scrollbar {
  display: none;
}

.landing-topbar a,
.nav-mode-button,
.primary-link,
.reset-button,
.quiet-button,
.card-image-button,
.stage-tab,
.route-tab {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 900;
}

.landing-topbar a,
.nav-mode-button {
  flex: 0 0 auto;
  padding: 0 12px;
  background: rgba(255, 250, 242, 0.14);
  backdrop-filter: blur(12px);
  color: #fffaf2;
}

.buzz-home-link {
  width: 46px;
  padding: 0;
}

.buzz-home-link img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.32));
}

.landing-copy {
  position: relative;
  z-index: 1;
  width: min(660px, 100%);
  margin: 48px 0 0;
}

.landing-copy h1 {
  margin: 8px 0 14px;
  font-size: clamp(4.2rem, 16vw, 11rem);
  line-height: 0.78;
}

.landing-copy p {
  max-width: 560px;
  color: #fff2d8;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.primary-link {
  margin-top: 10px;
  padding: 0 18px;
  background: #fffaf2;
  color: #211926;
}

.deck-builder {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
  background: #f5f2ec;
  color: #211926;
}

.deck-builder-layout {
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 0 18px 24px;
}

.deck-builder .card-lab-topbar {
  padding: 8px 18px 12px;
}

.deck-builder .card-lab-topbar h2 {
  margin-bottom: 4px;
}

.deck-builder .card-lab-topbar p {
  margin-bottom: 0;
}

.deck-builder-sidebar,
.deck-builder-workbench {
  min-height: 0;
}

.deck-builder-sidebar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(180px, 0.5fr) minmax(240px, 0.9fr) minmax(320px, 1.35fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 12px 0;
  border-bottom: 1px solid rgba(33, 25, 38, 0.12);
  background: rgba(245, 242, 236, 0.96);
  backdrop-filter: blur(14px);
}

.deck-builder-workbench {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 16px;
}

.deck-builder-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.deck-builder-control-block {
  display: grid;
  align-content: start;
  gap: 8px;
}

.deck-mode-toggle,
.deck-side-toggle {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.deck-mode-toggle button,
.deck-side-toggle button {
  min-height: 40px;
  border-radius: 8px;
  background: #e6ded2;
  color: #211926;
  font-weight: 900;
}

.deck-mode-toggle button.is-active,
.deck-side-toggle button.is-active {
  background: #211926;
  color: #fffaf2;
}

.deck-cost-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deck-cost-card {
  padding: 12px;
  border: 1px solid rgba(33, 25, 38, 0.12);
  border-radius: 8px;
  background: #fffaf2;
}

.deck-cost-card.is-illegal {
  border-color: rgba(175, 48, 48, 0.42);
  background: #fff1eb;
}

.deck-cost-card span,
.deck-cost-card small,
.deck-rules-panel p,
.deck-round-side p {
  color: rgba(33, 25, 38, 0.68);
}

.deck-cost-card strong {
  display: block;
  margin: 2px 0;
  font-size: 1.35rem;
}

.deck-cost-card p,
.deck-cost-card small,
.deck-rules-panel p,
.deck-round-side p {
  margin: 0;
}

.deck-rules-panel {
  padding: 12px;
  border-radius: 8px;
  background: #eaf3ef;
}

.deck-builder-section {
  padding: 12px;
  border: 1px solid rgba(33, 25, 38, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.78);
}

.deck-builder-section-head,
.deck-hand-card-main,
.deck-round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deck-builder-section h3,
.deck-builder-section h4 {
  margin: 0;
}

.deck-legality-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 0.35fr)) minmax(260px, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(33, 25, 38, 0.12);
  border-radius: 8px;
  background: #fffaf2;
}

.deck-legality-panel strong {
  display: inline-block;
  margin-top: 2px;
  font-size: 1.15rem;
}

.deck-legality-panel p {
  margin: 0;
  color: rgba(33, 25, 38, 0.72);
}

.deck-legality-panel.is-legal {
  border-color: rgba(23, 121, 104, 0.42);
  background: #e8faf5;
}

.deck-legality-panel.is-illegal {
  border-color: rgba(175, 48, 48, 0.42);
  background: #fff1eb;
}

.deck-legality-panel.is-incomplete {
  border-color: rgba(177, 130, 28, 0.34);
  background: #fff7df;
}

.deck-warning-label {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(177, 130, 28, 0.12);
  color: #8d6208;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0;
  vertical-align: middle;
}

.deck-legality-panel.is-illegal .deck-warning-label {
  background: rgba(175, 48, 48, 0.14);
  color: #a82f2f;
}

.deck-saves-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(33, 25, 38, 0.06);
}

.deck-saves-panel p {
  margin: 0;
  color: rgba(33, 25, 38, 0.62);
  font-size: 0.82rem;
}

.deck-saves-panel > div {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.deck-saves-panel button {
  min-width: 168px;
  padding: 8px;
  border: 1px solid rgba(33, 25, 38, 0.12);
  border-radius: 8px;
  background: #fffaf2;
  color: #211926;
  text-align: left;
  font-weight: 900;
}

.deck-saves-panel button span {
  display: block;
  margin-top: 2px;
  color: rgba(33, 25, 38, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
}

.deck-saves-panel button.is-legal {
  border-color: rgba(23, 121, 104, 0.36);
}

.deck-saves-panel button.is-illegal {
  border-color: rgba(175, 48, 48, 0.32);
}

.deck-saves-panel label {
  display: grid;
  gap: 4px;
  color: rgba(226, 249, 250, 0.72);
  font-size: 0.72rem;
}

.deck-saved-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px;
  align-items: center;
}

.deck-saves-panel .deck-saved-row > button {
  min-width: 0;
  min-height: 28px;
  padding: 4px 6px;
  font-size: 0.68rem;
}

.deck-builder-columns {
  display: grid;
  grid-template-columns: minmax(420px, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  margin-top: 12px;
  align-items: start;
}

.deck-panel-label {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.deck-panel-label span {
  color: rgba(33, 25, 38, 0.62);
  font-size: 0.82rem;
  text-align: right;
}

.deck-card-pool,
.deck-table-grid {
  display: grid;
  gap: 8px;
}

.deck-card-pool {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.deck-table-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.deck-table-slot {
  min-height: 170px;
}

.deck-table-slot.is-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px dashed rgba(33, 25, 38, 0.24);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.52);
  color: rgba(33, 25, 38, 0.62);
  text-align: center;
}

.deck-table-slot.is-empty > span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(33, 25, 38, 0.12);
  color: #211926;
  font-weight: 900;
}

.deck-table-slot.is-empty strong,
.deck-table-slot.is-empty p {
  margin: 0;
}

.deck-table-slot.is-empty p {
  font-size: 0.78rem;
}

.deck-pool-card {
  min-height: 82px;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(33, 25, 38, 0.12);
  border-radius: 8px;
  background: #fffaf2;
  color: #211926;
  text-align: left;
}

.deck-pool-card.is-selected {
  background: #253f52;
  color: #fffaf2;
}

.deck-pool-card span,
.deck-pool-card em {
  font-size: 0.78rem;
}

.deck-hand-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(33, 25, 38, 0.12);
  border-radius: 8px;
  background: #fffaf2;
}

.deck-hand-card-main > span {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #211926;
  color: #fffaf2;
  font-weight: 900;
}

.deck-hand-card-main div {
  min-width: 0;
  flex: 1;
}

.deck-hand-card-main p,
.deck-card-rules {
  margin: 0;
  color: rgba(33, 25, 38, 0.68);
  font-size: 0.82rem;
}

.deck-hand-card-main button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eadbd4;
  color: #5a1d1d;
  font-weight: 900;
}

.deck-item-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.deck-item-row label,
.deck-round-slot {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 900;
  color: rgba(33, 25, 38, 0.72);
}

.deck-item-row select,
.deck-round-slot select,
.deck-round-head select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(33, 25, 38, 0.16);
  border-radius: 8px;
  background: #fff;
  color: #211926;
}

.deck-card-rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.deck-round-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.deck-round-side {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: #edf4f5;
}

.deck-round-result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #211926;
  color: #fffaf2;
}

.deck-round-result p {
  margin: 4px 0 8px;
  color: rgba(255, 250, 242, 0.78);
}

.deck-round-result ol {
  margin: 0;
  padding-left: 1.2rem;
}

.deck-trial-section.is-locked {
  opacity: 0.86;
}

.deck-trial-locked {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #211926;
  color: #fffaf2;
}

.deck-trial-locked p {
  margin: 4px 0 0;
  color: rgba(255, 250, 242, 0.76);
}

@media (max-width: 980px) {
  .deck-builder-layout {
    height: auto;
    grid-template-columns: 1fr;
    padding: 0 12px 18px;
  }

  .deck-builder-sidebar {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .deck-builder-columns,
  .deck-round-grid,
  .deck-table-grid,
  .deck-cost-panel {
    grid-template-columns: 1fr;
  }

  .deck-card-pool {
    max-height: none;
  }
}

/* Token combat row must stay below the name band after every legacy override. */
.play-layout.is-battle-active .battle-arena .match-token-header {
  position: relative !important;
}

.play-layout.is-battle-active .battle-arena .match-token-combat {
  position: absolute !important;
  top: 40px !important;
  right: 8px !important;
  left: 8px !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 3px !important;
  width: auto !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-token-combat img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-token-combat i b {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat img {
    width: 34px !important;
    height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i b {
    font-size: 0.78rem !important;
  }
}

@media (max-width: 980px) and (max-height: 700px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 98px minmax(0, 1fr) 98px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 112px 132px minmax(70px, 1fr) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    min-height: 98px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand {
    height: 86px !important;
    min-height: 86px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-slot {
    height: 84px !important;
    min-height: 84px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
    grid-template-rows: 27px minmax(0, 1fr) 20px !important;
    padding: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header {
    grid-template-columns: 20px minmax(0, 1fr) 14px !important;
    grid-template-rows: 12px 15px !important;
    height: 27px !important;
    min-height: 27px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 19px !important;
    height: 19px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    font-size: 0.32rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
    height: 15px !important;
    grid-template-rows: 15px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 13px !important;
    height: 13px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.3rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions button {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    font-size: 0.35rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row {
    height: 20px !important;
    min-height: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket {
    width: 16px !important;
    height: 16px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket img {
    width: 13px !important;
    height: 13px !important;
  }
}

/* Reference board finish: use the available desktop canvas and keep each token's
   identity row separate from its four combat markers. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-board {
    width: min(100%, 1560px) !important;
    padding: 8px !important;
  }

  .play-layout.is-battle-active .match-token-header {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: 24px 30px !important;
    min-height: 54px !important;
    padding: 3px 5px 1px !important;
  }

  .play-layout.is-battle-active .match-token-header > b {
    min-width: 24px !important;
    height: 24px !important;
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .match-token-header > strong {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .match-token-combat {
    position: static !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
  }

  .play-layout.is-battle-active .match-token-combat i,
  .play-layout.is-battle-active .match-token-combat img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .match-token-combat i {
    justify-self: center !important;
  }

  .play-layout.is-battle-active .match-token-combat i b {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .match-rail .opponent-pocket-card,
  .play-layout.is-battle-active .match-rail .hand-card {
    min-height: 116px !important;
    max-height: 116px !important;
  }

  .play-layout.is-battle-active .match-rail .opponent-pocket-card > img,
  .play-layout.is-battle-active .match-rail .hand-card-select > img {
    object-position: center 28% !important;
  }
}

/* Keep both card rails compact so the central match stage remains the visual focus. */
.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
  position: relative !important;
  grid-area: auto !important;
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: 116px !important;
  width: auto !important;
  height: 116px !important;
  min-height: 116px !important;
  max-height: 116px !important;
  align-self: stretch !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card {
  position: relative !important;
  grid-area: auto !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) 25px !important;
  width: auto !important;
  height: 116px !important;
  min-width: 0 !important;
  min-height: 116px !important;
  max-height: 116px !important;
  padding: 0 !important;
  transform: none !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-select {
  position: relative !important;
  grid-area: 1 !important;
  display: block !important;
  width: 100% !important;
  height: 91px !important;
  min-height: 91px !important;
  max-height: 91px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-select > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  aspect-ratio: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-actions {
  grid-area: 2 !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 25px !important;
  min-height: 25px !important;
  max-height: 25px !important;
  padding: 3px 5px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .match-hand-status {
  bottom: 25px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
  grid-area: auto !important;
  height: 116px !important;
  min-height: 116px !important;
  max-height: 116px !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent .opponent-pocket-card {
  grid-area: auto !important;
  height: 116px !important;
  min-height: 116px !important;
  max-height: 116px !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .hand-card {
    grid-template-rows: minmax(0, 1fr) auto !important;
    flex: 0 0 86px !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-select {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-actions {
    height: auto !important;
    min-height: 22px !important;
    max-height: none !important;
    padding: 2px 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .match-hand-status {
    bottom: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent .opponent-pocket-card {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }
}

/* End-of-file parity guard: these rules deliberately win over every historical
   compact battle rail rule above them. */
.play-layout.is-battle-active .battle-arena > .match-board {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent,
.play-layout.is-battle-active .battle-arena .match-rail-player {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 7px 8px 8px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-side,
.play-layout.is-battle-active .battle-arena .match-rail-player > .match-side,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  grid-auto-rows: auto !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 5 / 8 !important;
  transform: none !important;
  rotate: none !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  padding: 5% !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.45fr) minmax(210px, 0.8fr) !important;
  min-height: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-compare-panel,
.play-layout.is-battle-active .battle-arena .match-details-panel {
  display: block !important;
  min-width: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-stage {
  min-width: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select {
  inset: 0 0 30px !important;
  z-index: 2 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-actions {
  position: relative !important;
  z-index: 9 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-tile-header,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-header-identity,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-header-copy,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-combat-pips,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-portrait,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-socket-row {
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-header-actions,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-header-actions button {
  pointer-events: auto !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: thin !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
    flex: 0 0 86px !important;
    width: 86px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Final battle parity override. Keep this after the historical battle rail rules so
   the live board cannot fall back to the former bespoke compact card layout. */
.play-layout.is-battle-active .battle-arena > .match-board {
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent,
.play-layout.is-battle-active .battle-arena .match-rail-player {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 7px 8px 8px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-side,
.play-layout.is-battle-active .battle-arena .match-rail-player > .match-side,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
  grid-column: 1 !important;
  grid-row: 1 !important;
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  grid-auto-rows: auto !important;
  gap: 6px !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  min-width: 0 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 5 / 8 !important;
  transform: none !important;
  rotate: none !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  padding: 5% !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.45fr) minmax(210px, 0.8fr) !important;
  min-height: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-compare-panel,
.play-layout.is-battle-active .battle-arena .match-details-panel {
  display: block !important;
  min-width: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-stage {
  min-width: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select {
  inset: 0 0 30px !important;
  z-index: 4 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-actions {
  position: relative !important;
  z-index: 7 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select {
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-actions,
.play-layout.is-battle-active .battle-arena .battle-card-slot .deck-card-header-actions,
.play-layout.is-battle-active .battle-arena .battle-card-slot .deck-card-header-actions button {
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select {
  z-index: 2 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-actions {
  z-index: 9 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-header-actions {
  z-index: 8 !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: thin !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
    flex: 0 0 86px !important;
    width: 86px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Battle board parity: battle cards use the deck-builder object at every scale.
   Only the surrounding rail and action layer change for play. */
.play-layout.is-battle-active .battle-arena .match-board {
  gap: 10px !important;
  padding: 10px !important;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.08), rgba(255, 250, 242, 0.025)),
    rgba(6, 10, 16, 0.72) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 5px !important;
  min-width: 0 !important;
  padding: 7px 8px 8px !important;
  border: 1px solid rgba(149, 241, 223, 0.22) !important;
  border-radius: 9px !important;
  background: rgba(4, 18, 27, 0.66) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  border-color: rgba(255, 117, 78, 0.46) !important;
  background: linear-gradient(180deg, rgba(82, 27, 23, 0.34), rgba(4, 18, 27, 0.72)) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player {
  border-color: rgba(34, 235, 217, 0.42) !important;
  background: linear-gradient(180deg, rgba(8, 64, 64, 0.34), rgba(4, 18, 27, 0.72)) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail > .match-side,
.play-layout.is-battle-active .battle-arena .match-rail > .match-match-hud {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .opponent-hand,
.play-layout.is-battle-active .battle-arena .arena-hand {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-auto-rows: auto !important;
  gap: 6px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot {
  position: relative !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 5 / 8 !important;
  transform: none !important;
  rotate: none !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object > .deck-card-scale {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  padding: 5% !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object {
  position: relative !important;
  z-index: 1 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select {
  position: absolute !important;
  z-index: 4 !important;
  inset: 0 0 30px !important;
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select + .match-play-indicator,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object ~ .match-play-indicator {
  position: absolute !important;
  top: 6px !important;
  left: 6px !important;
  z-index: 8 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-card-header-copy,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-card-header-identity,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-combat-pips,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-card-header-actions,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-card-portrait,
.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-card-socket-row {
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-object .deck-card-view-button {
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .hand-card-select:focus-visible {
  outline: 2px solid #ffe08a !important;
  outline-offset: 2px !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot > .battle-card-actions {
  position: relative !important;
  z-index: 6 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-header-actions {
  z-index: 7 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-tile-header {
  min-height: 0 !important;
  height: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-portrait {
  min-height: 0 !important;
  height: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-socket-row {
  min-height: 0 !important;
  height: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-status,
.play-layout.is-battle-active .battle-arena .battle-card-booster-marker {
  position: absolute !important;
  z-index: 6 !important;
  bottom: 5px !important;
  display: grid !important;
  place-items: center !important;
  min-width: 24px !important;
  height: 18px !important;
  padding: 0 4px !important;
  border: 1px solid rgba(255, 224, 138, 0.56) !important;
  border-radius: 4px !important;
  background: rgba(4, 13, 18, 0.9) !important;
  color: #ffe08a !important;
  font-size: 0.48rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-status { left: 5px !important; }
.play-layout.is-battle-active .battle-arena .battle-card-booster-marker { right: 5px !important; }

.play-layout.is-battle-active .battle-arena .is-status-standing > .battle-card-object {
  border-color: rgba(34, 235, 217, 0.9) !important;
  box-shadow: 0 0 0 2px rgba(34, 235, 217, 0.32), 0 0 18px rgba(34, 235, 217, 0.22) !important;
}

.play-layout.is-battle-active .battle-arena .is-status-fallen > .battle-card-object,
.play-layout.is-battle-active .battle-arena .is-played-card > .battle-card-object {
  border-color: rgba(255, 117, 78, 0.82) !important;
  filter: grayscale(0.82) saturate(0.52) brightness(0.74) !important;
}

.play-layout.is-battle-active .battle-arena .is-status-in-ring > .battle-card-object,
.play-layout.is-battle-active .battle-arena .battle-card-object.is-current,
.play-layout.is-battle-active .battle-arena .battle-card-object.is-previewed {
  border-color: rgba(255, 224, 138, 0.96) !important;
  box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.28), 0 0 22px rgba(255, 224, 138, 0.28) !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
  min-width: 0 !important;
  margin-top: 4px !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action {
  min-width: 0 !important;
  min-height: 24px !important;
  padding: 0 3px !important;
  border: 1px solid rgba(149, 241, 223, 0.46) !important;
  border-radius: 4px !important;
  background: rgba(4, 31, 39, 0.92) !important;
  color: #95f1df !important;
  font-size: 0.5rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action--boost {
  border-color: rgba(255, 224, 138, 0.52) !important;
  color: #ffe08a !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action:disabled {
  cursor: not-allowed !important;
  opacity: 0.38 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-object .deck-card-view-button,
.play-layout.is-battle-active .battle-arena .battle-card-object .deck-table-remove-button {
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  display: grid !important;
  grid-template-columns: minmax(210px, 0.8fr) minmax(360px, 1.45fr) minmax(210px, 0.8fr) !important;
  align-items: stretch !important;
  gap: 10px !important;
  min-width: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-compare-panel,
.play-layout.is-battle-active .battle-arena .match-details-panel {
  min-width: 0 !important;
  padding: 10px !important;
  border: 1px solid rgba(226, 181, 91, 0.44) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(29, 24, 20, 0.86), rgba(6, 20, 27, 0.92)) !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading,
.play-layout.is-battle-active .battle-arena .battle-details-score,
.play-layout.is-battle-active .battle-arena .battle-details-status,
.play-layout.is-battle-active .battle-arena .battle-details-summary {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 6px !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading {
  margin-bottom: 9px !important;
  color: #ffe08a !important;
  font-size: 0.72rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading small {
  color: rgba(238, 252, 255, 0.56) !important;
  font-size: 0.48rem !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare {
  display: grid !important;
  align-content: start !important;
  gap: 10px !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-title {
  display: flex !important;
  justify-content: space-between !important;
  color: rgba(238, 252, 255, 0.7) !important;
  font-size: 0.58rem !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-title strong { color: #95f1df !important; }

.play-layout.is-battle-active .battle-arena .battle-compare-line {
  display: grid !important;
  gap: 5px !important;
  padding: 7px !important;
  border: 1px solid rgba(238, 252, 255, 0.15) !important;
  border-radius: 6px !important;
  background: rgba(0, 9, 14, 0.48) !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-line header,
.play-layout.is-battle-active .battle-arena .battle-compare-line footer {
  display: flex !important;
  justify-content: space-between !important;
  gap: 5px !important;
  color: rgba(238, 252, 255, 0.64) !important;
  font-size: 0.52rem !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-line header strong { color: #ffe08a !important; }
.play-layout.is-battle-active .battle-arena .battle-compare-line.is-player header strong { color: #95f1df !important; }

.play-layout.is-battle-active .battle-arena .battle-compare-values {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr !important;
  align-items: center !important;
  text-align: center !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-values b {
  color: #fffaf2 !important;
  font-size: 1.32rem !important;
  font-weight: 1000 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72) !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-values span {
  color: #ffe08a !important;
  font-size: 0.54rem !important;
  font-weight: 1000 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-meter {
  position: relative !important;
  height: 10px !important;
  overflow: hidden !important;
  border: 1px solid rgba(238, 252, 255, 0.16) !important;
  border-radius: 999px !important;
  background: linear-gradient(90deg, rgba(255, 117, 78, 0.7) 0 50%, rgba(34, 235, 217, 0.7) 50% 100%) !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-meter::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 50% 0 auto !important;
  width: 2px !important;
  background: rgba(255, 250, 242, 0.9) !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-meter i {
  position: absolute !important;
  top: 1px !important;
  bottom: 1px !important;
  left: 1px !important;
  width: var(--compare-ratio) !important;
  border-radius: inherit !important;
  background: #ffe08a !important;
  box-shadow: 0 0 10px rgba(255, 224, 138, 0.72) !important;
  transition: width 360ms ease !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-line.is-player .battle-compare-meter i { background: #95f1df !important; }

.play-layout.is-battle-active .battle-arena .battle-details-score {
  padding-bottom: 7px !important;
  border-bottom: 1px solid rgba(238, 252, 255, 0.16) !important;
  color: #ffe08a !important;
  font-size: 0.58rem !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-score strong { color: #95f1df !important; }

.play-layout.is-battle-active .battle-arena .battle-details-effects {
  display: grid !important;
  gap: 5px !important;
  margin: 8px 0 !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect {
  display: grid !important;
  grid-template-columns: 26px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 5px !important;
  min-width: 0 !important;
  padding: 5px !important;
  border-left: 2px solid #ff754e !important;
  background: rgba(255, 117, 78, 0.08) !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect.is-player {
  border-left-color: #22ebd9 !important;
  background: rgba(34, 235, 217, 0.08) !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect img { width: 24px !important; height: 24px !important; object-fit: contain !important; }
.play-layout.is-battle-active .battle-arena .battle-details-effect span { min-width: 0 !important; }
.play-layout.is-battle-active .battle-arena .battle-details-effect b,
.play-layout.is-battle-active .battle-arena .battle-details-effect small { display: block !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
.play-layout.is-battle-active .battle-arena .battle-details-effect b { color: #fffaf2 !important; font-size: 0.56rem !important; }
.play-layout.is-battle-active .battle-arena .battle-details-effect small { color: rgba(238, 252, 255, 0.55) !important; font-size: 0.46rem !important; }
.play-layout.is-battle-active .battle-arena .battle-details-effect > strong { color: #ffe08a !important; font-size: 0.72rem !important; }

.play-layout.is-battle-active .battle-arena .battle-details-status,
.play-layout.is-battle-active .battle-arena .battle-details-summary {
  padding-top: 6px !important;
  border-top: 1px solid rgba(238, 252, 255, 0.12) !important;
  color: rgba(238, 252, 255, 0.58) !important;
  font-size: 0.52rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-status strong,
.play-layout.is-battle-active .battle-arena .battle-details-summary strong { color: #95f1df !important; }
.play-layout.is-battle-active .battle-arena .battle-details-empty,
.play-layout.is-battle-active .battle-arena .battle-compare-empty { color: rgba(238, 252, 255, 0.62) !important; font-size: 0.58rem !important; line-height: 1.35 !important; }

.play-layout.is-battle-active .battle-arena .match-stage {
  min-width: 0 !important;
  display: grid !important;
  align-content: start !important;
  gap: 7px !important;
  padding: 10px !important;
  border: 1px solid rgba(226, 181, 91, 0.34) !important;
  border-radius: 8px !important;
  background: radial-gradient(circle at 50% 52%, rgba(255, 224, 138, 0.12), transparent 55%), rgba(4, 13, 18, 0.6) !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .battle-steps,
.play-layout.is-battle-active .battle-arena .match-stage .coach-tip,
.play-layout.is-battle-active .battle-arena .match-stage .arena-actions p { display: none !important; }

.play-layout.is-battle-active .battle-arena .match-stage .clash-banner { min-height: 34px !important; margin: 0 !important; }

.play-layout.is-battle-active .battle-arena .match-stage .bout-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-slot {
  display: grid !important;
  gap: 7px !important;
  min-width: 0 !important;
  padding: 8px !important;
  border: 1px solid rgba(226, 181, 91, 0.5) !important;
  border-radius: 8px !important;
  background: rgba(5, 15, 20, 0.7) !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-slot-head { display: none !important; }
.play-layout.is-battle-active .battle-arena .match-ring-faceoff { display: contents !important; }
.play-layout.is-battle-active .battle-arena .match-ring-side { min-width: 0 !important; }
.play-layout.is-battle-active .battle-arena .match-ring-side.is-player { grid-column: 1 !important; }
.play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent { grid-column: 3 !important; }
.play-layout.is-battle-active .battle-arena .match-ring-vs { grid-column: 2 !important; grid-row: 1 !important; width: 42px !important; height: 42px !important; display: grid !important; place-items: center !important; border: 1px solid rgba(255, 224, 138, 0.72) !important; border-radius: 50% !important; color: #ffe08a !important; font-size: 0.72rem !important; font-weight: 1000 !important; }
.play-layout.is-battle-active .battle-arena .match-ring-vs small { display: block !important; font-size: 0.5rem !important; }
.play-layout.is-battle-active .battle-arena .match-ring-card { width: 100% !important; }
.play-layout.is-battle-active .battle-arena .match-ring-result { display: none !important; }

.play-layout.is-battle-active .battle-arena .arena-actions { display: flex !important; justify-content: center !important; min-height: 30px !important; margin: 0 !important; }
.play-layout.is-battle-active .battle-arena .arena-actions > #advanceBattle { min-height: 30px !important; }

.play-layout.is-battle-active .battle-arena .arena-log {
  display: grid !important;
  gap: 4px !important;
  max-height: 92px !important;
  overflow: hidden !important;
  margin: 8px 0 0 !important;
  padding-left: 16px !important;
  color: rgba(238, 252, 255, 0.66) !important;
  font-size: 0.5rem !important;
  line-height: 1.25 !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-board { overflow: visible !important; }
  .play-layout.is-battle-active .battle-arena .match-rail { padding: 5px !important; }
  .play-layout.is-battle-active .battle-arena .opponent-hand,
  .play-layout.is-battle-active .battle-arena .arena-hand { grid-template-columns: repeat(10, 86px) !important; overflow-x: auto !important; overflow-y: visible !important; padding-bottom: 4px !important; }
  .play-layout.is-battle-active .battle-arena .match-center-row { grid-template-columns: minmax(0, 1fr) !important; gap: 6px !important; }
  .play-layout.is-battle-active .battle-arena .match-compare-panel { order: 2 !important; }
  .play-layout.is-battle-active .battle-arena .match-stage { order: 1 !important; }
  .play-layout.is-battle-active .battle-arena .match-details-panel { order: 3 !important; }
  .play-layout.is-battle-active .battle-arena .match-stage .bout-row { grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr) !important; gap: 4px !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-card { width: 100% !important; }
  .play-layout.is-battle-active .battle-arena .battle-card-action { min-height: 22px !important; font-size: 0.46rem !important; }
}

/* Live-match clarity pass: the HUD shares the opponent rail and played cards
   replace the final hand slots instead of creating another graveyard row. */
.play-layout.is-battle-active .battle-arena .match-score-banner,
.play-layout.is-battle-active .battle-arena .match-effects-panel,
.play-layout.is-battle-active .battle-arena .match-round-log,
.play-layout.is-battle-active .battle-arena .committed-row,
.play-layout.is-battle-active .battle-arena .match-graveyard-dock {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena > .match-board {
  grid-template-rows: 132px minmax(0, 1fr) 132px !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  grid-template-columns: minmax(0, 1fr) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  grid-template-columns: 122px minmax(0, 1fr) minmax(190px, 0.3fr) !important;
  grid-template-rows: 116px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
  grid-column: 3 !important;
  grid-row: 1 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 2px 8px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 9px 12px !important;
  border: 1px solid rgba(226, 181, 91, 0.55) !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, rgba(46, 24, 14, 0.78), rgba(4, 31, 36, 0.86)) !important;
}

.play-layout.is-battle-active .battle-arena .clash-banner .battle-attribute-duel {
  display: grid !important;
  gap: 3px !important;
  width: min(360px, 100%) !important;
  margin: 3px auto !important;
}

.play-layout.is-battle-active .battle-arena .clash-banner .battle-duel-line {
  min-height: 31px !important;
}

.play-layout.is-battle-active .match-match-hud .eyebrow {
  color: #ffe08a !important;
  font-size: 0.48rem !important;
  letter-spacing: 0.12em !important;
}

.play-layout.is-battle-active .match-match-hud h3 {
  min-width: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  color: #fffaf2 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.08em !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .match-match-hud > strong {
  grid-column: 2 !important;
  grid-row: 1 / -1 !important;
  display: grid !important;
  place-items: center !important;
  min-width: 56px !important;
  color: #8ff1df !important;
  font-size: 1.12rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0.04em !important;
}

.play-layout.is-battle-active .battle-arena .match-card-status,
.play-layout.is-battle-active .battle-arena .match-hand-status,
.play-layout.is-battle-active .battle-arena .match-ring-state {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-play-indicator {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  z-index: 8 !important;
  width: 9px !important;
  height: 9px !important;
  border: 1px solid rgba(3, 8, 10, 0.9) !important;
  border-radius: 50% !important;
  background: #82949b !important;
  box-shadow: 0 0 0 1px rgba(238, 252, 255, 0.28) !important;
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena [data-match-status="standing"] .match-play-indicator,
.play-layout.is-battle-active .battle-arena .is-status-standing .match-play-indicator {
  background: #65ed9d !important;
  box-shadow: 0 0 8px rgba(101, 237, 157, 0.9) !important;
}

.play-layout.is-battle-active .battle-arena [data-match-status="fallen"] .match-play-indicator,
.play-layout.is-battle-active .battle-arena .is-status-fallen .match-play-indicator {
  background: #ff715f !important;
  box-shadow: 0 0 8px rgba(255, 113, 95, 0.86) !important;
}

.play-layout.is-battle-active .battle-arena [data-match-status="deployed"] .match-play-indicator,
.play-layout.is-battle-active .battle-arena .is-status-in-ring .match-play-indicator,
.play-layout.is-battle-active .battle-arena .is-status-selected .match-play-indicator {
  background: #ffd16b !important;
  box-shadow: 0 0 8px rgba(255, 209, 107, 0.9) !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-slot {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-card {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(160, 175, 180, 0.62) !important;
  border-radius: 5px !important;
  background: rgba(8, 14, 17, 0.9) !important;
  color: #fffaf2 !important;
  filter: grayscale(1) saturate(0.34) brightness(0.72) !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-card.is-status-standing {
  border-color: #65ed9d !important;
  box-shadow: 0 0 0 1px rgba(101, 237, 157, 0.55), 0 0 11px rgba(101, 237, 157, 0.35) !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-card.is-status-fallen {
  border-color: #ff715f !important;
  box-shadow: 0 0 0 1px rgba(255, 113, 95, 0.55), 0 0 11px rgba(255, 113, 95, 0.3) !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-card.is-status-in-ring {
  border-color: #8ff1df !important;
  filter: grayscale(0.5) saturate(0.7) brightness(0.82) !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-card > img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.play-layout.is-battle-active .battle-arena .played-card-sequence {
  position: absolute !important;
  left: 3px !important;
  bottom: 3px !important;
  z-index: 3 !important;
  display: grid !important;
  place-items: center !important;
  width: 18px !important;
  height: 15px !important;
  border-radius: 3px !important;
  background: rgba(3, 8, 10, 0.88) !important;
  color: #fffaf2 !important;
  font-size: 0.46rem !important;
  font-weight: 1000 !important;
}

.play-layout.is-battle-active .battle-arena .played-hand-card .match-play-indicator {
  top: 4px !important;
  right: 4px !important;
}

.play-layout.is-battle-active .battle-arena .played-card-name {
  position: absolute !important;
  right: 3px !important;
  bottom: 3px !important;
  left: 24px !important;
  z-index: 3 !important;
  overflow: hidden !important;
  color: #fffaf2 !important;
  font-size: 0.42rem !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-shadow: 0 1px 2px #000 !important;
}

.play-layout.is-battle-active .battle-arena .battle-attribute-duel {
  display: grid !important;
  gap: 4px !important;
  width: min(360px, 100%) !important;
  margin: 5px auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-duel-line {
  display: grid !important;
  grid-template-columns: 48px 42px 22px 42px 42px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  min-height: 36px !important;
  padding: 3px 6px !important;
  border: 1px solid rgba(143, 241, 223, 0.26) !important;
  border-radius: 6px !important;
  background: rgba(3, 15, 19, 0.78) !important;
}

.play-layout.is-battle-active .battle-arena .battle-duel-line.is-opponent {
  border-color: rgba(255, 113, 95, 0.3) !important;
}

.battle-duel-side {
  color: rgba(238, 252, 255, 0.72) !important;
  font-size: 0.56rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

.battle-duel-stat {
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  width: 38px !important;
  height: 32px !important;
}

.battle-duel-stat img {
  width: 32px !important;
  height: 32px !important;
  object-fit: contain !important;
}

.battle-duel-stat b {
  position: absolute !important;
  color: #fffaf2 !important;
  font-size: 0.88rem !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  text-shadow: 0 1px 2px #000, 0 0 3px #000 !important;
}

.battle-duel-line > em {
  color: #ffe08a !important;
  font-size: 0.56rem !important;
  font-style: normal !important;
  font-weight: 1000 !important;
  text-align: center !important;
}

.battle-duel-line > strong {
  font-size: 0.64rem !important;
  text-align: center !important;
}

.battle-duel-line > strong.is-ahead { color: #65ed9d !important; }
.battle-duel-line > strong.is-behind { color: #ff715f !important; }

.play-layout.is-battle-active .battle-arena .effect-stack {
  display: none !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-center-row {
    min-height: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage {
    min-height: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .clash-banner:not([hidden]) {
    display: grid !important;
    min-height: 96px !important;
    padding: 5px 9px !important;
    gap: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .clash-banner .battle-attribute-duel {
    width: min(420px, 100%) !important;
    margin: 2px auto !important;
  }

  .play-layout.is-battle-active .battle-arena .clash-banner .battle-duel-line {
    min-height: 29px !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 82px minmax(0, 1fr) 96px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent {
    grid-template-columns: minmax(0, 1fr) 86px !important;
    grid-template-rows: 72px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
    grid-column: 2 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto 1fr !important;
    gap: 1px !important;
    padding: 4px !important;
  }

  .play-layout.is-battle-active .match-match-hud h3 {
    font-size: 0.46rem !important;
    letter-spacing: 0.03em !important;
  }

  .play-layout.is-battle-active .match-match-hud .eyebrow {
    font-size: 0.34rem !important;
  }

  .play-layout.is-battle-active .match-match-hud > strong {
    grid-column: 1 !important;
    grid-row: 3 !important;
    min-width: 0 !important;
    font-size: 0.7rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-duel-line {
    grid-template-columns: 36px 32px 18px 32px 32px !important;
    min-height: 28px !important;
    gap: 2px !important;
    padding: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-duel-stat,
  .play-layout.is-battle-active .battle-arena .battle-duel-stat img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-duel-stat b {
    font-size: 0.66rem !important;
  }

  .battle-duel-side,
  .battle-duel-line > strong {
    font-size: 0.42rem !important;
  }
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Final live-stage cleanup: visual score feedback is the large animated raster layer. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Last cascade pass for the live battle board. Keep the compatibility graph in the
   DOM for screen readers and tests, but reserve the visual stage for the burst art. */
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* Final battle presentation override: the old graph remains available to tests and
   assistive inspection, but it must not compete with the large animated bursts. */
.play-layout.is-battle-active .match-effects-panel .battle-effects-head,
.play-layout.is-battle-active .match-effects-panel .battle-effect-graph {
  display: none !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 1px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .match-effects-panel .match-effects-empty {
  color: rgba(255, 250, 242, 0.7) !important;
  font-size: 0.72rem !important;
  line-height: 1.35 !important;
}

/* One active bout stays large; resolved cards move into browsable side piles. */
.play-layout.is-battle-active .battle-arena .bout-row {
  grid-template-columns: minmax(0, 1fr) !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent {
  justify-items: start !important;
  align-items: start !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent .match-ring-concealed {
  justify-self: start !important;
  align-items: start !important;
  text-align: left !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-concealed.is-waiting {
  border-style: solid;
  border-color: rgba(238, 252, 255, 0.25);
  background: rgba(5, 16, 21, 0.78);
  animation: none;
}

.play-layout.is-battle-active .battle-arena .match-ring-concealed.is-deployed {
  border-color: rgba(255, 224, 138, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.16), 0 0 24px rgba(255, 224, 138, 0.14);
}

.match-graveyards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.match-graveyard {
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(149, 241, 223, 0.18);
  border-radius: 8px;
  background: rgba(5, 16, 21, 0.58);
}

.match-graveyard.is-opponent {
  border-color: rgba(255, 117, 78, 0.22);
}

.match-graveyard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: #95f1df;
  font-size: 0.6rem;
  text-transform: uppercase;
}

.match-graveyard.is-opponent .match-graveyard-head { color: #ffb29e; }

.match-graveyard-head span {
  color: rgba(238, 252, 255, 0.55);
  font-size: 0.52rem;
}

.match-graveyard-stack {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.match-card-token {
  position: relative;
  flex: 0 0 70px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  min-height: 38px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(149, 241, 223, 0.38);
  border-radius: 5px;
  background: rgba(8, 13, 17, 0.88);
  color: #fffaf2;
  text-align: left;
}

.match-graveyard.is-opponent .match-card-token { border-color: rgba(255, 117, 78, 0.44); }

.match-card-token img {
  grid-row: 1 / -1;
  width: 26px;
  height: 100%;
  object-fit: cover;
}

.match-card-token span,
.match-card-token small {
  min-width: 0;
  overflow: hidden;
  padding: 2px 4px 0;
  font-size: 0.48rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-card-token small {
  padding: 0 4px 2px;
  color: #95f1df;
  font-size: 0.42rem;
  text-transform: uppercase;
}

.match-card-token.is-status-fallen { filter: grayscale(0.9) saturate(0.48) brightness(0.62); }

.match-graveyard-empty {
  padding: 7px 4px;
  color: rgba(238, 252, 255, 0.42);
  font-size: 0.54rem;
}

@media (max-width: 520px) {
  .match-graveyards { grid-template-columns: 1fr; }
}

.play-layout.is-battle-active .battle-arena .committed-row {
  display: grid !important;
  gap: 4px;
  min-height: 0;
}

.play-layout.is-battle-active .battle-arena .committed-row > span {
  color: rgba(238, 252, 255, 0.56);
  font-size: 0.52rem;
}

.play-layout.is-battle-active .battle-arena #committedCards {
  min-height: 0;
}

/* Battle reveal pass: action buttons and score layers read as a live exchange rather than a text log. */
.play-layout.is-battle-active .battle-arena .hand-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 !important;
  overflow: hidden;
}

.play-layout.is-battle-active .battle-arena.phase-idle .arena-hand {
  pointer-events: none;
}

.play-layout.is-battle-active .battle-arena .hand-card-select {
  min-width: 0;
  display: grid;
  align-content: start;
  padding: 0 0 0.25rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.play-layout.is-battle-active .battle-arena .hand-card-select img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
}

.play-layout.is-battle-active .battle-arena .hand-card-select span,
.play-layout.is-battle-active .battle-arena .hand-card-select small {
  display: block;
  padding-inline: 0.38rem;
}

.play-layout.is-battle-active .battle-arena .hand-card-select span {
  margin-top: 0.22rem;
  font-size: 0.58rem;
}

.play-layout.is-battle-active .battle-arena .hand-card-select small {
  color: #95f1df;
  font-size: 0.43rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hand-card-select,
.opponent-pocket-card {
  position: relative;
}

.hand-card-view-glyph,
.match-card-view-glyph {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(149, 241, 223, 0.78);
  border-radius: 50%;
  background: rgba(3, 17, 23, 0.86);
  color: #95f1df;
  font-size: 0.65rem;
  font-weight: 1000;
  line-height: 1;
  pointer-events: none;
}

.match-card-view-glyph {
  top: 5px;
  right: 5px;
  z-index: 2;
}

.hand-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-top: 1px solid rgba(149, 241, 223, 0.16);
  background: rgba(3, 12, 17, 0.72);
}

.hand-card-action {
  min-width: 0;
  min-height: 22px;
  padding: 0.2rem 0.15rem;
  overflow: hidden;
  border: 1px solid rgba(149, 241, 223, 0.42);
  border-radius: 4px;
  background: rgba(23, 121, 104, 0.72);
  color: #fffaf2;
  font-size: 0.44rem;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.hand-card-action.hand-card-boost {
  border-color: rgba(226, 181, 91, 0.72);
  background: rgba(85, 47, 15, 0.82);
  color: #ffe08a;
}

.hand-card-action:not(:disabled):hover,
.hand-card-action:not(:disabled):focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.2);
}

.hand-card-action:disabled {
  border-color: rgba(238, 252, 255, 0.1);
  background: rgba(238, 252, 255, 0.05);
  color: rgba(238, 252, 255, 0.34);
  cursor: not-allowed;
}

.hand-card-action.is-blocked {
  display: grid;
  place-items: center;
  border-color: rgba(238, 252, 255, 0.1);
  background: rgba(238, 252, 255, 0.05);
  color: rgba(238, 252, 255, 0.34);
  cursor: help;
}

.hand-card.is-booster-returned {
  border-color: rgba(226, 181, 91, 0.72);
  box-shadow: 0 0 0 1px rgba(226, 181, 91, 0.18), 0 0 22px rgba(226, 181, 91, 0.14);
}

.hidden-deployment-card,
.match-ring-concealed {
  display: grid;
  place-items: center;
  gap: 0.15rem;
  min-width: 110px;
  min-height: 82px;
  padding: 0.5rem;
  border: 1px dashed rgba(149, 241, 223, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(149, 241, 223, 0.1), transparent 54%),
    rgba(5, 16, 21, 0.9);
  color: rgba(238, 252, 255, 0.72);
  text-align: center;
  animation: concealed-pulse 1300ms ease-in-out infinite;
}

.hidden-deployment-card > span,
.match-ring-concealed > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(226, 181, 91, 0.72);
  border-radius: 50%;
  color: #ffe08a;
  font-size: 1.1rem;
  font-weight: 950;
}

.hidden-deployment-card strong,
.match-ring-concealed strong {
  font-size: 0.58rem;
  text-transform: uppercase;
}

.hidden-deployment-card small,
.match-ring-concealed small {
  color: rgba(238, 252, 255, 0.48);
  font-size: 0.46rem;
}

.round-booster-card {
  position: absolute;
  left: 50%;
  bottom: 2px;
  z-index: 4;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  width: min(150px, 30%);
  padding: 3px;
  transform: translateX(-50%);
  border: 1px solid rgba(226, 181, 91, 0.8);
  border-radius: 5px;
  background: rgba(49, 27, 10, 0.94);
  box-shadow: 0 0 0 1px rgba(226, 181, 91, 0.16), 0 0 24px rgba(226, 181, 91, 0.2);
  animation: booster-land 440ms ease both;
}

.round-booster-card span {
  position: absolute;
  top: -8px;
  left: 4px;
  color: #ffe08a;
  font-size: 0.42rem;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.round-booster-card img {
  width: 28px;
  height: 38px;
  object-fit: cover;
  border-radius: 3px;
}

.round-booster-card strong,
.round-booster-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-booster-card strong { font-size: 0.48rem; }
.round-booster-card small { color: #ffe08a; font-size: 0.42rem; }

.battle-effects-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.battle-effects-head strong {
  color: #ffe08a;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.battle-effects-head span {
  color: rgba(238, 252, 255, 0.66);
  font-size: 0.55rem;
  font-weight: 900;
  text-transform: uppercase;
}

.battle-effect-graph {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.battle-effect-track {
  min-width: 0;
  padding: 0.25rem 0.35rem;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 5px;
  background: rgba(7, 31, 37, 0.78);
}

.battle-effect-track.is-opponent {
  border-color: rgba(255, 117, 78, 0.28);
  background: rgba(48, 22, 22, 0.74);
}

.battle-effect-track header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.3rem;
}

.battle-effect-track header b { color: #95f1df; font-size: 0.46rem; letter-spacing: 0.08em; }
.battle-effect-track.is-opponent header b { color: #ff9b7c; }
.battle-effect-track header strong { overflow: hidden; font-size: 0.56rem; text-overflow: ellipsis; white-space: nowrap; }
.battle-effect-track header em { color: #ffe08a; font-size: 0.68rem; font-style: normal; font-weight: 950; }

.battle-effect-meter {
  height: 5px;
  margin: 0.25rem 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(238, 252, 255, 0.1);
}

.battle-effect-meter i {
  display: block;
  width: var(--meter-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22ebd9, #ffe08a);
  box-shadow: 0 0 10px rgba(34, 235, 217, 0.58);
  animation: effect-meter-land 480ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.battle-effect-track.is-opponent .battle-effect-meter i { background: linear-gradient(90deg, #ff754e, #ffe08a); }

.battle-effect-layers {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
}

.battle-effect-layer {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 2px;
  border-radius: 3px;
  background: rgba(238, 252, 255, 0.04);
  text-align: center;
}

.battle-effect-layer b,
.battle-effect-layer strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-effect-layer b { color: rgba(238, 252, 255, 0.54); font-size: 0.39rem; }
.battle-effect-layer strong { color: rgba(238, 252, 255, 0.32); font-size: 0.5rem; }
.battle-effect-layer.is-live { background: rgba(34, 235, 217, 0.12); animation: layer-land 260ms ease both; }
.battle-effect-layer.is-live strong { color: #95f1df; }
.battle-effect-layer.is-final { background: rgba(226, 181, 91, 0.14); }
.battle-effect-layer.is-final.is-live strong { color: #ffe08a; }

@keyframes concealed-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(149, 241, 223, 0.03), 0 0 0 rgba(149, 241, 223, 0); }
  50% { box-shadow: inset 0 0 0 1px rgba(149, 241, 223, 0.16), 0 0 18px rgba(149, 241, 223, 0.1); }
}

@keyframes booster-land {
  from { opacity: 0; transform: translate(-50%, 12px) scale(0.84); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes effect-meter-land {
  from { width: 0; }
}

@keyframes layer-land {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .hand-card-select span { font-size: 0.46rem; }
  .play-layout.is-battle-active .battle-arena .hand-card-select small { font-size: 0.36rem; }
  .hand-card-actions { gap: 2px; padding: 2px; }
  .hand-card-action { min-height: 18px; font-size: 0.36rem; }
  .hidden-deployment-card,
  .match-ring-concealed { min-width: 72px; min-height: 54px; padding: 0.25rem; }
  .hidden-deployment-card > span,
  .match-ring-concealed > span { width: 20px; height: 20px; font-size: 0.8rem; }
  .hidden-deployment-card strong,
  .match-ring-concealed strong { font-size: 0.42rem; }
  .hidden-deployment-card small,
  .match-ring-concealed small { font-size: 0.34rem; }
  .round-booster-card { width: min(122px, 34%); grid-template-columns: 22px minmax(0, 1fr); }
  .round-booster-card img { width: 22px; height: 29px; }
  .round-booster-card strong { font-size: 0.4rem; }
  .round-booster-card small { font-size: 0.34rem; }
  .battle-effect-graph { gap: 0.25rem; }
  .battle-effect-track { padding: 0.2rem; }
  .battle-effect-track header b { font-size: 0.36rem; }
  .battle-effect-track header strong { font-size: 0.42rem; }
  .battle-effect-track header em { font-size: 0.54rem; }
  .battle-effect-layer b { font-size: 0.3rem; }
  .battle-effect-layer strong { font-size: 0.38rem; }
}

/* Live deployment feedback stays compact so the player can see the ring, hand, and effect order together. */
.battle-effects[hidden],
.battle-booster-slot[hidden],
.battle-booster-button[hidden] {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .arena-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem;
}

.play-layout.is-battle-active .battle-arena .battle-effects {
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(34, 235, 217, 0.28);
  border-radius: 7px;
  background: rgba(4, 18, 24, 0.72);
  color: rgba(238, 252, 255, 0.74);
  font-size: 0.62rem;
  line-height: 1.2;
}

.play-layout.is-battle-active .battle-effects > strong {
  display: block;
  margin-bottom: 0.18rem;
  color: #ffe08a;
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.battle-effect-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.battle-effect-summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-effect-summary b {
  margin-right: 0.25rem;
  color: #94f1df;
}

.play-layout.is-battle-active .battle-arena .battle-booster-slot {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem;
  min-width: 150px;
  padding: 0.3rem 0.45rem;
  border: 1px solid rgba(226, 181, 91, 0.58);
  border-radius: 7px;
  background: rgba(43, 28, 12, 0.72);
}

.battle-booster-slot-icon {
  display: block;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(226, 181, 91, 0.72);
  border-radius: 4px;
  object-fit: cover;
  color: #ffe08a;
}

.battle-booster-slot span:last-child {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
}

.battle-booster-slot b,
.battle-booster-slot strong,
.battle-booster-slot small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-booster-slot b {
  color: #ffe08a;
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.battle-booster-slot strong { font-size: 0.67rem; }
.battle-booster-slot small { color: rgba(238, 252, 255, 0.66); font-size: 0.52rem; }

.battle-booster-button {
  min-width: 0;
  white-space: nowrap;
  font-size: 0.62rem;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .arena-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 32px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effects {
    grid-column: 1 / -1;
    grid-row: 1;
    max-height: 34px;
    overflow: hidden;
    padding: 0.22rem 0.35rem;
    font-size: 0.48rem;
  }

  .play-layout.is-battle-active .battle-arena .battle-effects > strong {
    display: inline;
    margin-right: 0.3rem;
    font-size: 0.46rem;
  }

  .play-layout.is-battle-active .battle-effect-summary {
    display: inline-grid;
    grid-template-columns: repeat(2, auto);
    gap: 0.3rem;
    max-width: calc(100% - 2.4rem);
    vertical-align: middle;
  }

  .play-layout.is-battle-active .battle-booster-slot {
    grid-column: 1;
    grid-row: 2;
    min-width: 0 !important;
    max-width: 100%;
    padding: 0.18rem 0.28rem !important;
  }

  .play-layout.is-battle-active .battle-booster-slot-icon { width: 20px; height: 20px; }
  .play-layout.is-battle-active .battle-booster-slot strong { font-size: 0.52rem; }
  .play-layout.is-battle-active .battle-booster-slot small { font-size: 0.42rem; }
  .play-layout.is-battle-active .battle-booster-button {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    max-width: 100%;
    font-size: 0.48rem;
  }
  .play-layout.is-battle-active .battle-arena .arena-actions > #advanceBattle {
    grid-column: 2;
    grid-row: 2;
  }
}

/* Reference board composition: rails, stage, side utilities, and a graveyard shelf. */
.play-layout.is-battle-active .battle-arena {
  position: relative !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) !important;
  grid-template-areas: "board" !important;
  gap: 0 !important;
  min-height: 0 !important;
  padding: 12px !important;
  overflow: hidden !important;
  border: 2px solid rgba(226, 181, 91, 0.82) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(180deg, rgba(9, 9, 10, 0.18), rgba(9, 9, 10, 0.72)),
    var(--match-host-art) center / cover !important;
  box-shadow:
    inset 0 0 0 3px rgba(38, 23, 12, 0.88),
    inset 0 0 0 5px rgba(226, 181, 91, 0.16),
    0 22px 70px rgba(0, 0, 0, 0.48) !important;
}

.play-layout.is-battle-active .battle-arena > .match-board {
  grid-area: board !important;
  display: grid !important;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto !important;
  grid-template-areas:
    "score"
    "opponent"
    "center"
    "player"
    "grave" !important;
  gap: 8px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-score-banner {
  grid-area: score !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 38px !important;
  padding: 4px 12px !important;
  border: 1px solid rgba(226, 181, 91, 0.45) !important;
  border-radius: 8px !important;
  background: linear-gradient(90deg, rgba(45, 19, 12, 0.82), rgba(12, 19, 21, 0.86), rgba(7, 36, 39, 0.82)) !important;
}

.play-layout.is-battle-active .match-score-banner h3 {
  margin: 0 !important;
  color: #fff3d4 !important;
  font-size: 0.86rem !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .match-score-banner .eyebrow {
  color: #ffe08a !important;
  font-size: 0.48rem !important;
}

.play-layout.is-battle-active .match-score-banner #battleScore {
  min-width: 130px !important;
  padding: 3px 8px !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .match-rail {
  min-width: 0 !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: stretch !important;
  gap: 8px !important;
  padding: 7px !important;
  border: 1px solid rgba(226, 181, 91, 0.54) !important;
  border-radius: 9px !important;
  background: rgba(10, 10, 10, 0.56) !important;
}

.play-layout.is-battle-active .match-rail-opponent {
  grid-area: opponent !important;
  border-color: rgba(255, 117, 78, 0.72) !important;
  background: linear-gradient(90deg, rgba(61, 19, 14, 0.78), rgba(12, 11, 10, 0.58)) !important;
}

.play-layout.is-battle-active .match-rail-player {
  grid-area: player !important;
  border-color: rgba(34, 235, 217, 0.58) !important;
  background: linear-gradient(90deg, rgba(7, 38, 40, 0.72), rgba(12, 11, 10, 0.58)) !important;
}

.play-layout.is-battle-active .match-rail .match-side {
  min-width: 122px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 5px 8px !important;
  border: 0 !important;
  border-radius: 5px !important;
  background: rgba(0, 0, 0, 0.28) !important;
}

.play-layout.is-battle-active .match-rail-player .match-side { order: 2 !important; }
.play-layout.is-battle-active .match-rail-player .arena-hand { order: 1 !important; }

.play-layout.is-battle-active .match-rail .match-side span {
  color: #ffe08a !important;
  font-size: 0.5rem !important;
  letter-spacing: 0.13em !important;
}

.play-layout.is-battle-active .match-rail .match-side strong {
  overflow: hidden !important;
  max-width: 140px !important;
  color: #fffaf2 !important;
  font-size: 0.7rem !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .match-rail .match-side small {
  color: rgba(238, 252, 255, 0.62) !important;
  font-size: 0.48rem !important;
}

.play-layout.is-battle-active .match-rail .opponent-hand,
.play-layout.is-battle-active .match-rail .arena-hand {
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .match-rail .opponent-hand::before,
.play-layout.is-battle-active .match-rail .arena-hand::before {
  display: none !important;
}

.play-layout.is-battle-active .match-rail .opponent-hand {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
}

.play-layout.is-battle-active .match-rail .arena-hand {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 6px !important;
  align-items: stretch !important;
}

.play-layout.is-battle-active .match-rail .opponent-pocket-card {
  height: 116px !important;
  min-height: 0 !important;
  border-radius: 5px !important;
  border-color: rgba(255, 196, 137, 0.34) !important;
  background: rgba(5, 11, 13, 0.84) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.04) !important;
  font-size: 0.48rem !important;
}

.play-layout.is-battle-active .match-rail .opponent-pocket-card.is-current {
  border-color: #ff7659 !important;
  box-shadow: 0 0 0 2px rgba(255, 117, 78, 0.2), 0 0 24px rgba(255, 117, 78, 0.22) !important;
}

.play-layout.is-battle-active .match-rail .opponent-pocket-card span,
.play-layout.is-battle-active .match-rail .opponent-pocket-card small {
  padding-inline: 4px !important;
}

.play-layout.is-battle-active .match-rail .opponent-pocket-card span {
  margin-top: 3px !important;
}

.play-layout.is-battle-active .match-rail .opponent-pocket-card small {
  margin: 1px 0 4px !important;
  font-size: 0.4rem !important;
}

.play-layout.is-battle-active .match-rail .hand-card {
  width: auto !important;
  min-width: 0 !important;
  min-height: 116px !important;
  border-radius: 5px !important;
  background: rgba(5, 11, 13, 0.9) !important;
}

.play-layout.is-battle-active .match-rail .hand-card img { height: 72px !important; }
.play-layout.is-battle-active .match-rail .hand-card span { padding-inline: 4px !important; font-size: 0.46rem !important; }
.play-layout.is-battle-active .match-rail .hand-card small { padding-inline: 4px !important; font-size: 0.38rem !important; }
.play-layout.is-battle-active .match-rail .hand-card-actions { gap: 3px !important; padding-inline: 3px !important; }
.play-layout.is-battle-active .match-rail .hand-card-action { min-height: 18px !important; padding: 2px 3px !important; font-size: 0.36rem !important; }

.play-layout.is-battle-active .battle-arena .match-hand-status {
  position: absolute !important;
  right: 0 !important;
  bottom: 20px !important;
  left: 0 !important;
  z-index: 4 !important;
  padding: 2px 3px !important;
  background: rgba(3, 8, 10, 0.82) !important;
  color: #95f1df !important;
  font-size: 0.36rem !important;
  letter-spacing: 0.06em !important;
  text-align: center !important;
}

.play-layout.is-battle-active .match-center-row {
  grid-area: center !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(140px, 0.2fr) minmax(0, 1fr) minmax(140px, 0.2fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.play-layout.is-battle-active .match-effects-panel,
.play-layout.is-battle-active .match-round-log {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 8px !important;
  border: 1px solid rgba(226, 181, 91, 0.36) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(25, 16, 10, 0.76), rgba(6, 12, 14, 0.72)) !important;
  color: rgba(255, 250, 242, 0.82) !important;
}

.play-layout.is-battle-active .match-effects-panel > strong,
.play-layout.is-battle-active .match-round-log > strong {
  display: block !important;
  margin-bottom: 7px !important;
  color: #ffe08a !important;
  font-size: 0.58rem !important;
  letter-spacing: 0.14em !important;
  text-align: center !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effects {
  display: block !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effects-head {
  display: none !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effect-graph { display: none !important; }

.play-layout.is-battle-active .match-effects-panel .battle-effect-track {
  padding: 5px !important;
  border-color: rgba(226, 181, 91, 0.25) !important;
  background: rgba(0, 0, 0, 0.2) !important;
}

.play-layout.is-battle-active .match-effects-panel .battle-effect-track header { grid-template-columns: 1fr auto !important; }
.play-layout.is-battle-active .match-effects-panel .battle-effect-track header strong { display: none !important; }
.play-layout.is-battle-active .match-effects-panel .battle-effect-layer { grid-template-columns: 1fr auto !important; }

.play-layout.is-battle-active .match-round-log ol {
  display: grid !important;
  gap: 5px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.play-layout.is-battle-active .match-round-log li {
  padding: 6px !important;
  border-top: 1px solid rgba(255, 250, 242, 0.1) !important;
  color: rgba(238, 252, 255, 0.72) !important;
  font-size: 0.52rem !important;
  line-height: 1.2 !important;
}

.play-layout.is-battle-active .match-stage {
  min-width: 0 !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto auto !important;
  gap: 6px !important;
  padding: 0 4px !important;
}

.play-layout.is-battle-active .match-stage .battle-steps {
  display: none !important;
}

.play-layout.is-battle-active .match-stage .clash-banner {
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.play-layout.is-battle-active .match-stage .bout-row {
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .match-stage .match-ring-slot {
  min-height: 0 !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 5px !important;
  padding: 6px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.play-layout.is-battle-active .match-stage .match-ring-slot-head {
  padding-inline: 8px !important;
  color: #ffe08a !important;
  font-size: 0.56rem !important;
}

.play-layout.is-battle-active .match-stage .match-ring-slot-head strong { color: #fffaf2 !important; font-size: 0.62rem !important; }

.play-layout.is-battle-active .match-stage .match-ring-faceoff {
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: center !important;
}

.play-layout.is-battle-active .match-stage .match-ring-side { min-width: 0 !important; justify-items: center !important; }
.play-layout.is-battle-active .match-stage .match-ring-side.is-player { justify-items: end !important; }
.play-layout.is-battle-active .match-stage .match-ring-side.is-opponent { justify-items: start !important; }

.play-layout.is-battle-active .match-stage .match-ring-card,
.play-layout.is-battle-active .match-stage .match-ring-concealed {
  width: min(210px, 100%) !important;
  height: 214px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border-radius: 8px !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 1fr) auto auto !important;
  padding: 0 !important;
  border: 2px solid rgba(34, 235, 217, 0.66) !important;
  background: rgba(4, 11, 14, 0.92) !important;
  box-shadow: 0 0 0 2px rgba(34, 235, 217, 0.12), 0 14px 32px rgba(0, 0, 0, 0.42) !important;
}

.play-layout.is-battle-active .match-stage .match-ring-side.is-opponent .match-ring-card {
  border-color: rgba(255, 117, 78, 0.86) !important;
  box-shadow: 0 0 0 2px rgba(255, 117, 78, 0.14), 0 14px 32px rgba(0, 0, 0, 0.42) !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card img {
  grid-row: 1 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: cover !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card span,
.play-layout.is-battle-active .match-stage .match-ring-card small {
  min-width: 0 !important;
  padding: 3px 7px !important;
  background: rgba(3, 8, 10, 0.84) !important;
  font-size: 0.62rem !important;
}

.play-layout.is-battle-active .match-stage .match-ring-card small { padding-top: 0 !important; color: #95f1df !important; }

.play-layout.is-battle-active .match-stage .match-ring-concealed {
  place-content: center !important;
  gap: 7px !important;
  padding: 10px !important;
  border: 1px dashed rgba(255, 224, 138, 0.5) !important;
  background: linear-gradient(145deg, rgba(70, 28, 13, 0.62), rgba(5, 16, 21, 0.88)) !important;
  text-align: center !important;
}

.play-layout.is-battle-active .match-stage .match-ring-side.is-opponent .match-ring-concealed {
  justify-self: start !important;
  align-items: start !important;
  text-align: left !important;
}

.play-layout.is-battle-active .match-stage .match-ring-vs {
  width: 58px !important;
  height: 58px !important;
  border: 1px solid #ffe08a !important;
  border-radius: 0 !important;
  transform: rotate(45deg) !important;
  background: rgba(25, 14, 8, 0.86) !important;
  box-shadow: 0 0 24px rgba(226, 181, 91, 0.18) !important;
}

.play-layout.is-battle-active .match-stage .match-ring-vs span,
.play-layout.is-battle-active .match-stage .match-ring-vs small { transform: rotate(-45deg) !important; }
.play-layout.is-battle-active .match-stage .match-ring-vs span { color: #fffaf2 !important; font-size: 0.78rem !important; }

.play-layout.is-battle-active .match-stage .match-ring-result {
  color: rgba(255, 236, 200, 0.76) !important;
  font-size: 0.54rem !important;
}

.play-layout.is-battle-active .match-stage .coach-tip {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 5px 8px !important;
  border-color: rgba(226, 181, 91, 0.24) !important;
  background: rgba(3, 10, 12, 0.58) !important;
  font-size: 0.52rem !important;
}

.play-layout.is-battle-active .match-stage .arena-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  min-height: 30px !important;
  margin: 0 !important;
  padding: 0 4px !important;
}

.play-layout.is-battle-active .match-stage .arena-actions p { display: none !important; }

.play-layout.is-battle-active .battle-arena > .arena-table { display: none !important; }

.play-layout.is-battle-active .battle-arena .committed-row {
  grid-area: grave !important;
  display: grid !important;
  gap: 3px !important;
  min-height: 0 !important;
  padding: 4px 10px !important;
  border: 1px solid rgba(226, 181, 91, 0.32) !important;
  border-radius: 7px !important;
  background: rgba(6, 11, 12, 0.68) !important;
}

.play-layout.is-battle-active .battle-arena .committed-row > span { color: #ffe08a !important; font-size: 0.48rem !important; letter-spacing: 0.12em !important; }
.play-layout.is-battle-active .battle-arena .match-graveyards { gap: 8px !important; }
.play-layout.is-battle-active .battle-arena .match-graveyard { padding: 3px !important; border: 0 !important; background: transparent !important; }
.play-layout.is-battle-active .battle-arena .match-graveyard-head { display: none !important; }
.play-layout.is-battle-active .battle-arena .match-graveyard-stack { min-height: 26px !important; justify-content: center !important; }
.play-layout.is-battle-active .battle-arena .match-card-token { flex-basis: 82px !important; min-height: 28px !important; }
.play-layout.is-battle-active .battle-arena .match-card-token img { width: 22px !important; }
.play-layout.is-battle-active .battle-arena .match-card-token span { font-size: 0.42rem !important; }
.play-layout.is-battle-active .battle-arena .match-card-token small { font-size: 0.36rem !important; }

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-rail .opponent-hand.is-full-deck,
  .play-layout.is-battle-active .battle-arena .match-rail .arena-hand.is-full-deck {
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .opponent-hand.is-full-deck .opponent-pocket-card,
  .play-layout.is-battle-active .battle-arena .match-rail .arena-hand.is-full-deck .hand-card {
    height: 116px !important;
    min-height: 116px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .arena-hand.is-full-deck .hand-card img { height: 70px !important; }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena {
    padding: 6px !important;
    border-radius: 10px !important;
  }

  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: auto 84px minmax(0, 1fr) 112px auto !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .match-score-banner { min-height: 28px !important; padding: 2px 7px !important; }
  .play-layout.is-battle-active .match-score-banner h3 { font-size: 0.58rem !important; }
  .play-layout.is-battle-active .match-score-banner .eyebrow { font-size: 0.36rem !important; }
  .play-layout.is-battle-active .match-score-banner #battleScore { min-width: 86px !important; padding: 0 !important; }

  .play-layout.is-battle-active .match-rail { grid-template-columns: minmax(0, 1fr) !important; gap: 3px !important; padding: 3px !important; }
  .play-layout.is-battle-active .match-rail .match-side { display: none !important; }
  .play-layout.is-battle-active .match-rail .opponent-hand,
  .play-layout.is-battle-active .match-rail .arena-hand { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 3px !important; }
  .play-layout.is-battle-active .match-rail .opponent-pocket-card { height: 75px !important; font-size: 0.38rem !important; }
  .play-layout.is-battle-active .match-rail .opponent-pocket-card span { margin-top: 1px !important; padding-inline: 2px !important; }
  .play-layout.is-battle-active .match-rail .opponent-pocket-card small { margin: 0 0 2px !important; padding-inline: 2px !important; font-size: 0.32rem !important; }
  .play-layout.is-battle-active .match-rail .hand-card { min-height: 88px !important; }
  .play-layout.is-battle-active .match-rail .hand-card img { height: 52px !important; }
  .play-layout.is-battle-active .match-rail .hand-card span { padding-inline: 2px !important; font-size: 0.36rem !important; }
  .play-layout.is-battle-active .match-rail .hand-card small { padding-inline: 2px !important; font-size: 0.3rem !important; }
  .play-layout.is-battle-active .match-rail .hand-card-actions { gap: 2px !important; padding-inline: 2px !important; }
  .play-layout.is-battle-active .match-rail .hand-card-action { min-height: 14px !important; padding: 1px 2px !important; font-size: 0.28rem !important; }

  .play-layout.is-battle-active .match-center-row { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }
  .play-layout.is-battle-active .match-effects-panel,
  .play-layout.is-battle-active .match-round-log { display: none !important; }
  .play-layout.is-battle-active .match-stage { padding: 0 !important; gap: 3px !important; }
  .play-layout.is-battle-active .match-stage .match-ring-slot { padding: 2px !important; gap: 3px !important; }
  .play-layout.is-battle-active .match-stage .match-ring-slot-head { padding-inline: 3px !important; font-size: 0.42rem !important; }
  .play-layout.is-battle-active .match-stage .match-ring-slot-head strong { font-size: 0.42rem !important; }
  .play-layout.is-battle-active .match-stage .match-ring-faceoff { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) !important; gap: 4px !important; }
  .play-layout.is-battle-active .match-stage .match-ring-card,
  .play-layout.is-battle-active .match-stage .match-ring-concealed { width: min(130px, 100%) !important; height: 128px !important; border-radius: 5px !important; }
  .play-layout.is-battle-active .match-stage .match-ring-card span,
  .play-layout.is-battle-active .match-stage .match-ring-card small { padding: 2px 4px !important; font-size: 0.4rem !important; }
  .play-layout.is-battle-active .match-stage .match-ring-concealed { gap: 3px !important; padding: 4px !important; }
  .play-layout.is-battle-active .match-stage .match-ring-vs { width: 28px !important; height: 28px !important; }
  .play-layout.is-battle-active .match-stage .match-ring-vs span { font-size: 0.48rem !important; }
  .play-layout.is-battle-active .match-stage .match-ring-result { font-size: 0.4rem !important; }
  .play-layout.is-battle-active .match-stage .coach-tip { padding: 3px 4px !important; font-size: 0.38rem !important; }
  .play-layout.is-battle-active .match-stage .arena-actions { min-height: 24px !important; grid-template-columns: minmax(0, 1fr) auto auto !important; padding: 0 !important; }
  .play-layout.is-battle-active .match-stage .arena-actions > #advanceBattle { min-height: 24px !important; padding: 3px 6px !important; font-size: 0.44rem !important; }
  .play-layout.is-battle-active .battle-arena .committed-row { padding: 2px 4px !important; }
  .play-layout.is-battle-active .battle-arena .committed-row > span { font-size: 0.36rem !important; }
  .play-layout.is-battle-active .battle-arena .match-card-token { flex-basis: 58px !important; min-height: 22px !important; }
  .play-layout.is-battle-active .battle-arena .match-card-token span { font-size: 0.32rem !important; }
  .play-layout.is-battle-active .battle-arena .match-card-token small { font-size: 0.28rem !important; }
}

/* Squad switching remains available while a ready lineup is mounted on the one-screen table. */
.game.is-table-focus #squadTabs {
  position: fixed;
  inset: 8px 8px auto;
  z-index: 80;
  pointer-events: auto;
}

/* Match table pass: the live bout is a single host surface with both squad rails and three ring lanes. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-board {
    width: min(100%, 1240px);
    padding: 8px;
  }

  .play-layout.is-battle-active .battle-arena {
    position: relative;
    grid-template-rows: minmax(0, 1fr) auto 154px;
    gap: 8px;
    padding: 10px;
    border: 2px solid rgba(226, 181, 91, 0.76);
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(8, 13, 17, 0.28), rgba(8, 13, 17, 0.78)),
      var(--match-host-art) center / cover;
    box-shadow:
      inset 0 0 0 3px rgba(32, 20, 12, 0.8),
      inset 0 0 0 5px rgba(226, 181, 91, 0.18),
      0 20px 60px rgba(0, 0, 0, 0.46);
  }

  .play-layout.is-battle-active .battle-arena::before,
  .play-layout.is-battle-active .battle-arena::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  .play-layout.is-battle-active .battle-arena::before {
    inset: 12px;
    z-index: 0;
    border: 1px solid rgba(255, 224, 138, 0.5);
    border-radius: 9px;
    box-shadow:
      inset 0 0 0 1px rgba(8, 13, 17, 0.86),
      inset 0 0 36px rgba(0, 0, 0, 0.34);
  }

  .play-layout.is-battle-active .battle-arena::after {
    inset: 22px 20%;
    z-index: 0;
    border-block: 1px solid rgba(255, 224, 138, 0.32);
    opacity: 0.7;
  }

  .play-layout.is-battle-active .battle-arena > * {
    position: relative;
    z-index: 1;
  }

  .play-layout.is-battle-active .match-board {
    display: grid;
    grid-template-rows: 154px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .play-layout.is-battle-active .opponent-hand {
    position: relative;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 24px 8px 8px;
    border: 1px solid rgba(255, 117, 78, 0.7);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(102, 24, 24, 0.66), rgba(18, 18, 18, 0.72));
    box-shadow: inset 0 0 0 2px rgba(255, 117, 78, 0.12), 0 0 22px rgba(255, 117, 78, 0.1);
  }

  .play-layout.is-battle-active .opponent-hand::before,
  .play-layout.is-battle-active .arena-hand::before {
    position: absolute;
    top: 6px;
    left: 10px;
    color: #ffe08a;
    font-size: 0.62rem;
    font-weight: 1000;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .play-layout.is-battle-active .opponent-hand::before {
    content: "Opponent squad · deck line";
  }

  .play-layout.is-battle-active .arena-hand::before {
    content: "Your squad · deck line";
  }

  .play-layout.is-battle-active .opponent-pocket-card {
    position: relative;
    height: 122px;
    border-color: rgba(255, 117, 78, 0.54);
    border-radius: 7px;
    background: rgba(8, 13, 17, 0.8);
  }

  .play-layout.is-battle-active .opponent-pocket-card.is-current,
  .play-layout.is-battle-active .opponent-pocket-card.is-status-in-ring {
    border-color: #ff7659;
    box-shadow: 0 0 0 2px rgba(255, 117, 78, 0.26), 0 0 25px rgba(255, 117, 78, 0.24);
  }

  .play-layout.is-battle-active .opponent-pocket-card.is-status-standing {
    border-color: rgba(149, 241, 223, 0.66);
    filter: saturate(0.9);
  }

  .play-layout.is-battle-active .opponent-pocket-card.is-status-fallen {
    border-color: rgba(255, 117, 78, 0.62);
    filter: grayscale(0.9) saturate(0.48) brightness(0.62);
  }

  .play-layout.is-battle-active .match-board > .bout-row {
    grid-row: 2;
    align-content: stretch;
    grid-template-columns: 1fr;
    gap: 7px;
    min-height: 0;
    overflow: hidden;
  }

  .play-layout.is-battle-active .match-ring-slot {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid rgba(226, 181, 91, 0.42);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(30, 16, 12, 0.7), rgba(15, 18, 19, 0.5), rgba(10, 24, 26, 0.7));
  }

  .play-layout.is-battle-active .match-ring-slot.is-active,
  .play-layout.is-battle-active .match-ring-slot.is-just-resolved {
    border-color: rgba(255, 224, 138, 0.86);
    box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.26), 0 0 28px rgba(255, 224, 138, 0.16);
  }

  .match-ring-slot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #ffe08a;
    font-size: 0.62rem;
    font-weight: 950;
    text-transform: uppercase;
  }

  .match-ring-slot-head strong {
    color: #fffaf2;
    font-size: 0.7rem;
  }

  .match-ring-faceoff {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 0;
  }

  .match-ring-side {
    min-width: 0;
    display: grid;
    justify-items: center;
  }

  .match-ring-side.is-player {
    justify-items: end;
  }

  .match-ring-side.is-opponent {
    justify-items: start;
  }

  .match-ring-vs {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(226, 181, 91, 0.7);
    border-radius: 50%;
    background: rgba(24, 15, 10, 0.82);
    color: #ffe08a;
    font-size: 0.66rem;
    font-weight: 1000;
    text-align: center;
  }

  .match-ring-vs small {
    color: #fffaf2;
    font-size: 0.52rem;
  }

  .match-ring-result {
    overflow: hidden;
    color: rgba(255, 236, 200, 0.74);
    font-size: 0.62rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .match-ring-card {
    position: relative;
    width: min(190px, 100%);
    height: 86px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    column-gap: 7px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(149, 241, 223, 0.5);
    border-radius: 7px;
    background: rgba(5, 12, 16, 0.92);
    color: #fffaf2;
    text-align: left;
  }

  .match-ring-side.is-opponent .match-ring-card { border-color: rgba(255, 117, 78, 0.62); }

  .match-ring-card img {
    grid-row: 1 / -1;
    width: 58px;
    height: 100%;
    object-fit: cover;
  }

  .match-ring-card span {
    align-self: end;
    min-width: 0;
    overflow: hidden;
    padding: 0 5px;
    font-size: 0.66rem;
    font-weight: 1000;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .match-ring-card small {
    min-width: 0;
    overflow: hidden;
    padding: 0 5px 5px;
    color: #95f1df;
    font-size: 0.56rem;
    font-weight: 900;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .match-ring-card.is-status-in-ring {
    border-color: #ffe08a;
    box-shadow: 0 0 0 2px rgba(255, 224, 138, 0.24), 0 0 20px rgba(255, 224, 138, 0.2);
  }

  .match-ring-card.is-status-fallen {
    filter: grayscale(0.9) saturate(0.42) brightness(0.62);
  }

  .match-ring-empty {
    width: min(190px, 100%);
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(255, 224, 138, 0.28);
    border-radius: 7px;
    color: rgba(255, 236, 200, 0.64);
    font-size: 0.58rem;
    text-transform: uppercase;
  }

  .match-ring-empty small { display: none; }

  .play-layout.is-battle-active .arena-actions {
    min-height: 40px;
    margin: 0;
  }

  .play-layout.is-battle-active .arena-actions p,
  .play-layout.is-battle-active .battle-steps,
  .play-layout.is-battle-active .coach-tip,
  .play-layout.is-battle-active .clash-banner,
  .play-layout.is-battle-active .arena-head,
  .play-layout.is-battle-active .match-side,
  .play-layout.is-battle-active .committed-row {
    display: none;
  }

  .play-layout.is-battle-active .arena-hand {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 24px 8px 8px;
    border: 1px solid rgba(34, 235, 217, 0.72);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(12, 60, 62, 0.68), rgba(8, 18, 21, 0.78));
    box-shadow: inset 0 0 0 2px rgba(34, 235, 217, 0.12), 0 0 22px rgba(34, 235, 217, 0.1);
  }

  .play-layout.is-battle-active .hand-card {
    width: auto;
    min-width: 0;
    min-height: 118px;
    border-color: rgba(34, 235, 217, 0.46);
    border-radius: 7px;
    background: rgba(8, 13, 17, 0.84);
  }

  .play-layout.is-battle-active .hand-card.is-status-in-ring,
  .play-layout.is-battle-active .hand-card.is-committed {
    border-color: #22ebd9;
    box-shadow: 0 0 0 2px rgba(34, 235, 217, 0.24), 0 0 24px rgba(34, 235, 217, 0.22);
  }

  .play-layout.is-battle-active .hand-card.is-status-fallen,
  .play-layout.is-battle-active .hand-card.is-status-played {
    filter: grayscale(0.9) saturate(0.48) brightness(0.62);
  }

  .match-booster-marker {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 2;
    padding: 3px 5px;
    border: 1px solid rgba(255, 224, 138, 0.78);
    border-radius: 4px;
    background: rgba(72, 31, 12, 0.9);
    color: #ffe08a;
    font-size: 0.48rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
  }

  .match-card-status {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 2;
    padding: 3px 5px;
    border-radius: 4px;
    background: rgba(8, 13, 17, 0.84);
    color: #fffaf2;
    font-size: 0.48rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena {
    position: relative;
    grid-template-rows: minmax(0, 1fr) auto 126px;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(226, 181, 91, 0.64);
    border-radius: 10px;
    background:
      linear-gradient(180deg, rgba(8, 13, 17, 0.34), rgba(8, 13, 17, 0.8)),
      var(--match-host-art) center / cover;
  }

  .play-layout.is-battle-active .match-board {
    grid-template-rows: 88px minmax(0, 1fr);
    gap: 5px;
    margin: 0;
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .play-layout.is-battle-active .opponent-hand {
    position: relative;
    gap: 4px;
    padding: 18px 4px 4px;
    border: 1px solid rgba(255, 117, 78, 0.62);
    border-radius: 7px;
    background: rgba(50, 20, 19, 0.66);
  }

  .play-layout.is-battle-active .opponent-hand::before,
  .play-layout.is-battle-active .arena-hand::before {
    top: 3px;
    left: 6px;
    font-size: 0.46rem;
  }

  .play-layout.is-battle-active .opponent-hand::before {
    content: "Opponent squad";
  }

  .play-layout.is-battle-active .arena-hand::before {
    content: "Your squad";
  }

  .play-layout.is-battle-active .opponent-pocket-card {
    height: 64px;
    border-radius: 5px;
    font-size: 0.48rem;
  }

  .play-layout.is-battle-active .opponent-pocket-card span {
    margin-top: 2px;
    padding-inline: 3px;
  }

  .play-layout.is-battle-active .opponent-pocket-card small {
    margin: 1px 0 3px;
    padding-inline: 3px;
    font-size: 0.4rem;
  }

  .play-layout.is-battle-active .match-board > .bout-row {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
  }

  .play-layout.is-battle-active .match-ring-slot {
    gap: 2px;
    padding: 3px 4px;
    border-radius: 6px;
  }

  .match-ring-slot-head {
    font-size: 0.42rem;
  }

  .match-ring-slot-head strong,
  .match-ring-result {
    font-size: 0.42rem;
  }

  .match-ring-faceoff {
    grid-template-columns: minmax(0, 1fr) 25px minmax(0, 1fr);
    gap: 4px;
  }

  .match-ring-vs {
    width: 24px;
    height: 24px;
    font-size: 0.42rem;
  }

  .match-ring-vs small {
    font-size: 0.36rem;
  }

  .play-layout.is-battle-active .arena-actions {
    min-height: 32px;
  }

  .play-layout.is-battle-active .arena-actions .reset-button {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .play-layout.is-battle-active .arena-hand {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
    margin: 0;
    padding: 18px 4px 4px;
    border: 1px solid rgba(34, 235, 217, 0.62);
    border-radius: 7px;
    background: rgba(7, 43, 45, 0.7);
  }

  .play-layout.is-battle-active .hand-card {
    width: auto;
    min-height: 96px;
    border-radius: 5px;
  }

  .play-layout.is-battle-active .hand-card img {
    height: 62px;
  }

  .play-layout.is-battle-active .hand-card span {
    overflow: hidden;
    margin-top: 2px;
    padding-inline: 4px;
    font-size: 0.46rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .play-layout.is-battle-active .hand-card small {
    padding-inline: 4px;
    font-size: 0.4rem;
  }

  .match-booster-marker,
  .match-card-status {
    top: 2px;
    left: 2px;
    right: auto;
    padding: 2px 3px;
    font-size: 0.34rem;
  }

  .match-card-status {
    left: auto;
    right: 2px;
  }
}

@media (max-width: 560px) {
  .deck-builder .card-lab-topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 8px;
    padding: 8px 10px;
  }

  .deck-builder .card-lab-topbar .eyebrow,
  .deck-builder .card-lab-topbar p {
    display: none;
  }

  .deck-builder .game-titlemark--compact {
    width: 88px;
    margin: 0;
  }

  .deck-builder .card-lab-topbar h2 {
    margin: 4px 0 0;
    font-size: 1.55rem;
    line-height: 1;
  }

  .deck-builder .topbar-actions .quiet-button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .deck-builder-layout {
    padding: 0 8px 14px;
  }

  .deck-builder-sidebar {
    grid-template-columns: 1fr 1fr;
    padding: 8px 0;
  }

  .deck-builder-control-block:nth-child(3),
  .deck-cost-panel,
  .deck-rules-panel {
    grid-column: 1 / -1;
  }

  .deck-mode-toggle,
  .deck-side-toggle,
  .deck-cost-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .deck-mode-toggle button,
  .deck-side-toggle button {
    min-height: 34px;
    padding: 0 6px;
    font-size: 0.82rem;
  }

  .deck-cost-card {
    padding: 8px;
  }

  .deck-cost-card strong {
    font-size: 1.05rem;
  }

  .deck-cost-card p,
  .deck-cost-card small,
  .deck-rules-panel p {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .deck-rules-panel {
    padding: 8px;
  }

  .deck-builder-section {
    padding: 8px;
  }

  .deck-builder-section-head {
    align-items: start;
  }

  .deck-builder-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 186px;
  }

  .deck-builder-actions .quiet-button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .deck-builder-section h3 {
    font-size: 1rem;
    line-height: 1.12;
  }

  .deck-legality-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .deck-legality-panel p {
    grid-column: 1 / -1;
    font-size: 0.76rem;
  }

  .deck-legality-panel strong {
    font-size: 1rem;
  }

  .deck-saves-panel {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .deck-hand-panel {
    order: 2;
  }

  .deck-roster-panel {
    order: 1;
  }

  .deck-roster-panel h4,
  .deck-hand-panel h4 {
    margin-bottom: 6px;
  }

  .deck-panel-label {
    align-items: start;
    margin-bottom: 6px;
  }

  .deck-panel-label span {
    max-width: 150px;
    font-size: 0.72rem;
  }

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

  .deck-pool-card {
    min-height: 72px;
    padding: 8px;
  }

  .deck-hand-card {
    gap: 8px;
    min-height: 0;
    padding: 8px;
  }

  .deck-hand-card-main {
    gap: 8px;
  }

  .deck-hand-card-main > span,
  .deck-hand-card-main button {
    width: 30px;
    height: 30px;
  }

  .deck-item-row {
    grid-template-columns: 1fr;
  }

  .deck-item-row select,
  .deck-round-slot select,
  .deck-round-head select {
    min-height: 34px;
  }

  .deck-card-rules {
    font-size: 0.72rem;
  }
}

.is-deck-builder-active .buzz-companion {
  display: none;
}

.is-table-focus-active .buzz-companion {
  display: none;
}

.deck-builder {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  background:
    linear-gradient(90deg, rgba(5, 21, 31, 0.94), rgba(8, 48, 61, 0.78) 46%, rgba(3, 18, 31, 0.96)),
    url("../public/assets/b3-squad-crossover-hero-v1.png") center top / cover fixed;
  color: #eefcff;
}

.deck-builder::before,
.deck-builder::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.deck-builder::before {
  background:
    radial-gradient(circle at 16% 12%, rgba(93, 238, 226, 0.2), transparent 28%),
    linear-gradient(90deg, rgba(4, 18, 29, 0.28), rgba(4, 18, 29, 0.02) 45%, rgba(4, 18, 29, 0.42));
}

.deck-builder::after {
  inset: auto 0 0;
  height: 38%;
  background: linear-gradient(0deg, rgba(3, 13, 22, 0.82), transparent);
}

.deck-builder-layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 20px 24px;
}

.deck-builder .card-lab-topbar {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 20px 8px;
  color: #f5ffff;
}

.deck-builder .card-lab-topbar h2 {
  color: #dffcff;
  text-shadow: 0 0 18px rgba(68, 239, 226, 0.42);
}

.deck-builder .card-lab-topbar p {
  color: rgba(238, 252, 255, 0.76);
}

.deck-builder .game-titlemark--compact {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
}

.deck-builder .topbar-actions .quiet-button,
.deck-builder-actions .quiet-button,
.deck-bottom-actions .quiet-button {
  border: 1px solid rgba(144, 255, 239, 0.28);
  background: linear-gradient(180deg, rgba(19, 72, 83, 0.88), rgba(8, 42, 55, 0.92));
  color: #eefcff;
  box-shadow: inset 0 0 18px rgba(103, 255, 239, 0.08), 0 10px 24px rgba(0, 0, 0, 0.24);
}

.deck-builder-sidebar {
  top: 0;
  padding: 10px;
  border: 1px solid rgba(149, 241, 223, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(4, 39, 53, 0.82), rgba(4, 25, 38, 0.76));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.deck-builder-control-block .eyebrow,
.deck-builder-section .eyebrow,
.deck-legality-panel .eyebrow {
  color: #8ff7e7;
}

.deck-builder select,
.deck-builder input {
  border-color: rgba(149, 241, 223, 0.24);
  background: rgba(2, 21, 32, 0.88);
  color: #eefcff;
}

.deck-mode-toggle button,
.deck-side-toggle button {
  border: 1px solid rgba(149, 241, 223, 0.18);
  background: rgba(241, 250, 247, 0.1);
  color: rgba(238, 252, 255, 0.74);
}

.deck-mode-toggle button.is-active,
.deck-side-toggle button.is-active {
  border-color: rgba(149, 241, 223, 0.64);
  background: linear-gradient(180deg, rgba(149, 241, 223, 0.28), rgba(30, 123, 135, 0.42));
  color: #ffffff;
}

.deck-compact-toggle {
  min-height: 32px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid rgba(149, 241, 223, 0.22);
  border-radius: 8px;
  background: rgba(4, 25, 38, 0.82);
  color: #eefcff;
  text-align: left;
}

.deck-compact-toggle span {
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 224, 138, 0.18);
  color: #ffe08a;
  font-size: 0.72rem;
  font-weight: 950;
}

.deck-compact-toggle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.deck-cost-card,
.deck-rules-panel,
.deck-legality-panel,
.deck-saves-panel,
.deck-builder-section,
.deck-utility-panel,
.deck-round-side {
  border: 1px solid rgba(149, 241, 223, 0.18);
  background: linear-gradient(180deg, rgba(9, 48, 64, 0.84), rgba(6, 29, 43, 0.88));
  color: #eefcff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.deck-utility-panel .deck-saves-panel {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  margin-top: 0;
}

.deck-utility-panel .deck-saves-panel > div {
  display: grid;
  gap: 6px;
  overflow: visible;
}

.deck-builder-section {
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.deck-cost-card span,
.deck-cost-card small,
.deck-rules-panel p,
.deck-round-side p,
.deck-panel-label span,
.deck-saves-panel p,
.deck-saves-panel button span,
.deck-legality-panel p,
.deck-hand-card-main p,
.deck-card-rules,
.deck-table-slot.is-empty,
.deck-item-row label,
.deck-round-slot {
  color: rgba(226, 249, 250, 0.7);
}

.deck-cost-card.is-illegal,
.deck-legality-panel.is-illegal {
  border-color: rgba(255, 109, 87, 0.82);
  background: linear-gradient(180deg, rgba(105, 26, 35, 0.94), rgba(47, 13, 25, 0.96));
  box-shadow: inset 0 0 0 1px rgba(255, 198, 166, 0.12), 0 0 22px rgba(255, 76, 56, 0.16);
}

.deck-cost-card.is-legal,
.deck-legality-panel.is-legal {
  border-color: rgba(149, 241, 223, 0.58);
  background: linear-gradient(180deg, rgba(19, 93, 83, 0.82), rgba(8, 45, 54, 0.92));
}

.deck-legality-panel.is-incomplete {
  border-color: rgba(255, 216, 128, 0.72);
  background: linear-gradient(180deg, rgba(103, 73, 20, 0.9), rgba(45, 33, 18, 0.95));
  box-shadow: inset 0 0 0 1px rgba(255, 238, 178, 0.1), 0 0 18px rgba(255, 203, 85, 0.14);
}

.deck-progress-pips {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.deck-progress-pips span {
  width: 18px;
  height: 5px;
  border-radius: 999px;
  background: rgba(238, 252, 255, 0.18);
}

.deck-progress-pips span.is-filled {
  background: #54f2e2;
  box-shadow: 0 0 12px rgba(84, 242, 226, 0.48);
}

.deck-panel-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  border: 1px solid rgba(149, 241, 223, 0.16);
  border-radius: 8px;
  background: rgba(3, 18, 28, 0.56);
}

.deck-panel-tabs button {
  min-height: 38px;
  border: 1px solid rgba(149, 241, 223, 0.14);
  border-radius: 7px;
  background: rgba(4, 19, 31, 0.88);
  color: rgba(238, 252, 255, 0.7);
  font-weight: 900;
}

.deck-panel-tabs button.is-active {
  border: 1px solid rgba(255, 239, 171, 0.52);
  background: linear-gradient(180deg, rgba(84, 242, 226, 0.58), rgba(32, 128, 134, 0.86));
  color: #ffffff;
}

.deck-mobile-tray {
  display: none;
}

.deck-desktop-action-row {
  display: none;
}

.deck-help-button {
  min-width: 0;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 239, 171, 0.62);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 224, 138, 0.24), rgba(181, 116, 42, 0.32));
  color: #ffe08a;
  font-size: 1rem;
  font-weight: 950;
}

.deck-builder-columns {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.38fr);
  grid-template-areas:
    "library utility"
    "deck utility";
}

.deck-roster-panel {
  grid-area: library;
}

.deck-hand-panel {
  grid-area: deck;
}

.deck-utility-panel {
  grid-area: utility;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
}

.deck-card-pool {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  max-height: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 0 8px;
  scroll-snap-type: x proximity;
}

.deck-table-grid {
  grid-template-columns: repeat(5, minmax(112px, 1fr));
}

.deck-pool-card,
.deck-hand-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(149, 241, 223, 0.24);
  background: linear-gradient(180deg, rgba(14, 55, 71, 0.98), rgba(5, 25, 38, 0.98));
  color: #eefcff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.deck-pool-card {
  flex: 0 0 132px;
  min-height: 178px;
  padding: 6px;
  scroll-snap-align: start;
}

.deck-pool-card.is-selected {
  border-color: rgba(127, 255, 229, 0.86);
  background: linear-gradient(180deg, rgba(18, 101, 88, 0.96), rgba(6, 42, 45, 0.98));
  box-shadow: 0 0 0 1px rgba(127, 255, 229, 0.24), 0 0 24px rgba(67, 235, 221, 0.24);
}

.deck-card-art,
.deck-card-portrait {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 230, 154, 0.36);
  border-radius: 8px;
  background: #061822;
}

.deck-card-art {
  aspect-ratio: 3 / 4;
  margin-bottom: 6px;
}

.deck-card-tile-header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 26px;
  grid-template-rows: 28px 26px;
  align-items: center;
  gap: 2px 6px;
  min-height: 58px;
  margin-bottom: 5px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 224, 138, 0.18);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(2, 18, 28, 0.92), rgba(3, 28, 42, 0.82));
}

.deck-card-tile-header .deck-card-cost-badge,
.deck-card-tile-header .deck-build-medallion {
  position: relative;
  top: auto;
  left: auto;
  width: 28px;
  height: 28px;
}

.deck-card-tile-header .deck-build-medallion {
  display: grid;
  place-items: center;
  overflow: visible;
}

.deck-card-tile-header .deck-build-medallion img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

.deck-card-header-copy {
  min-width: 0;
  display: grid;
  gap: 0;
}

.deck-card-header-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-card-header-copy strong {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1;
}

.deck-combat-pips {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  align-items: start;
}

.deck-combat-pips span {
  position: relative;
  display: grid;
  grid-template-rows: 20px auto;
  place-items: center;
  gap: 0;
  width: auto;
  height: auto;
  min-width: 0;
}

.deck-combat-pips img {
  grid-area: 1 / 1;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.44));
}

.deck-combat-pips b {
  grid-area: 1 / 1;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f7fbff;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1;
  text-shadow:
    -1px -1px 0 rgba(2, 18, 28, 0.92),
    1px -1px 0 rgba(2, 18, 28, 0.92),
    -1px 1px 0 rgba(2, 18, 28, 0.92),
    1px 1px 0 rgba(2, 18, 28, 0.92);
}

.deck-combat-pips small {
  min-width: 0;
  overflow: hidden;
  color: #70f6e8;
  font-size: 0.42rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.deck-card-header-actions {
  display: inline-flex;
  justify-content: end;
  gap: 4px;
}

.deck-card-header-actions button {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(149, 241, 223, 0.24);
  border-radius: 7px;
  background: rgba(149, 241, 223, 0.16);
  color: #95f1df;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.deck-card-header-actions button:last-child {
  border-color: rgba(255, 151, 122, 0.22);
  background: rgba(255, 151, 122, 0.18);
  color: #ffd8ce;
}

.deck-card-art img,
.deck-card-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04);
}

.deck-card-cost-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #102735;
  font-weight: 950;
}

.deck-card-cost-badge img,
.deck-accessory-cost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.deck-card-cost-badge b,
.deck-accessory-cost b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #102735;
  font-weight: 950;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.46);
}

.deck-selector-icon-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.deck-skill-chip {
  min-width: 0;
  min-height: 28px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  border: 1px solid rgba(149, 241, 223, 0.22);
  border-radius: 6px;
  background: rgba(3, 18, 28, 0.62);
  color: #dffdf7;
  font-size: 0.58rem;
  font-weight: 950;
}

.deck-skill-chip img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.deck-skill-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-gear-info-button,
.deck-gear-clear-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(149, 241, 223, 0.22);
  border-radius: 7px;
  background: rgba(3, 18, 28, 0.68);
  color: #95f1df;
  font-weight: 950;
}

.deck-gear-clear-button {
  border-color: rgba(255, 151, 122, 0.28);
  color: #ffd8ce;
}

.deck-accessory-row.is-armed {
  border-color: rgba(255, 239, 171, 0.64);
  background: rgba(255, 224, 138, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 239, 171, 0.18);
}

.deck-pool-card strong,
.deck-hand-card strong {
  color: #ffffff;
}

.deck-pool-card > span:not(.deck-card-art),
.deck-pool-card em {
  color: rgba(226, 249, 250, 0.72);
}

.deck-pool-card-main small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(149, 241, 223, 0.78);
  font-size: 0.68rem;
  font-weight: 850;
}

.deck-library-nameplate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: grid;
  gap: 1px;
  padding: 14px 6px 5px;
  background: linear-gradient(180deg, rgba(2, 18, 28, 0), rgba(2, 18, 28, 0.9) 52%, rgba(2, 18, 28, 0.98));
}

.deck-library-nameplate strong,
.deck-library-nameplate small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-library-nameplate strong {
  color: #ffffff;
  font-size: 0.74rem;
  line-height: 1.1;
}

.deck-library-nameplate small {
  color: #5bffec;
  font-size: 0.64rem;
  font-weight: 900;
}

.deck-hand-card {
  min-height: 0;
  padding: 8px;
}

.deck-hand-card > * {
  min-width: 0;
  width: 100%;
}

.deck-card-portrait {
  aspect-ratio: 4 / 3;
}

.deck-equipped-strip {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 240, 184, 0.62);
  background: rgba(3, 18, 28, 0.7);
  box-shadow: 0 0 18px rgba(149, 241, 223, 0.36);
}

.deck-card-socket-row,
.deck-socket-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  align-items: center;
}

.deck-socket {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(149, 241, 223, 0.28);
  border-radius: 7px;
  background: rgba(2, 18, 28, 0.64);
  color: rgba(226, 249, 250, 0.72);
}

.deck-socket img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.deck-socket.is-filled {
  border-color: rgba(255, 224, 138, 0.62);
  background: rgba(255, 224, 138, 0.12);
  box-shadow: 0 0 12px rgba(255, 224, 138, 0.22);
}

.deck-socket--accessory.is-empty {
  border-radius: 50%;
}

.deck-socket--accessory.is-filled {
  border-radius: 50%;
  border-color: rgba(91, 255, 236, 0.68);
  box-shadow: 0 0 14px rgba(91, 255, 236, 0.32);
}

.deck-socket--banner {
  border-radius: 4px 4px 8px 8px;
}

.deck-socket--banner.is-filled {
  border-color: rgba(255, 224, 138, 0.78);
  box-shadow: 0 0 14px rgba(255, 224, 138, 0.34);
}

.deck-artifact-badge,
.deck-banner-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
}

.deck-hand-card-main {
  margin-top: 6px;
}

.deck-hand-card .deck-item-row {
  display: none;
}

.deck-hand-card .deck-card-rules {
  margin-top: 4px;
  font-size: 0.72rem;
}

.deck-hand-card-main > span,
.deck-table-slot.is-empty > span {
  background: linear-gradient(180deg, #16394f, #081925);
  color: #eefcff;
  border: 1px solid rgba(149, 241, 223, 0.34);
}

.deck-hand-card-main button {
  background: rgba(255, 151, 122, 0.18);
  color: #ffd8ce;
}

.deck-hand-card-main .deck-table-view-button {
  background: rgba(149, 241, 223, 0.16);
  color: #95f1df;
}

.deck-hand-card-main .deck-table-view-button:hover,
.deck-hand-card-main .deck-table-view-button:focus-visible {
  border-color: rgba(149, 241, 223, 0.58);
  background: rgba(149, 241, 223, 0.25);
  color: #ffffff;
}

.deck-table-slot.is-empty {
  min-height: 245px;
  border-color: rgba(149, 241, 223, 0.24);
  background: rgba(4, 31, 45, 0.48);
}

.deck-accessory-panel,
.deck-summary-panel {
  display: grid;
  gap: 10px;
}

.deck-artifact-controls {
  display: grid;
  gap: 8px;
}

.deck-artifact-controls label {
  display: grid;
  gap: 4px;
  color: rgba(226, 249, 250, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
}

.deck-accessory-list {
  display: grid;
  gap: 8px;
}

.deck-accessory-list.is-picker {
  align-content: start;
}

.deck-accessory-list p {
  margin: 0;
  color: rgba(226, 249, 250, 0.68);
}

.deck-gear-picker {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.deck-gear-picker label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: rgba(226, 249, 250, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
}

.deck-gear-picker select {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 7px;
  background: rgba(2, 18, 28, 0.72);
  color: #eefcff;
}

.deck-accessory-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(112px, 0.42fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(149, 241, 223, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.deck-accessory-row img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.deck-accessory-row span {
  display: block;
  color: rgba(226, 249, 250, 0.68);
  font-size: 0.78rem;
}

.deck-accessory-row em {
  display: block;
  margin-top: 2px;
  color: #5bffec;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 900;
}

.deck-accessory-row select {
  min-height: 34px;
  font-size: 0.76rem;
}

.deck-summary-panel dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.deck-summary-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(226, 249, 250, 0.72);
}

.deck-summary-panel dt,
.deck-summary-panel dd {
  margin: 0;
}

.deck-summary-panel .is-cost dd {
  color: #95f1df;
  font-size: 1.25rem;
  font-weight: 950;
}

.deck-summary-panel p {
  margin: 0;
  color: rgba(226, 249, 250, 0.72);
  font-size: 0.78rem;
}

.deck-socket-legend {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 8px;
  border: 1px solid rgba(149, 241, 223, 0.14);
  border-radius: 8px;
  background: rgba(2, 18, 28, 0.42);
}

.deck-socket-legend > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: rgba(226, 249, 250, 0.76);
  font-size: 0.72rem;
  font-weight: 850;
}

.deck-cost-graph {
  height: 62px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 7px;
  padding-top: 8px;
}

.deck-cost-graph span {
  height: var(--bar);
  min-height: 8px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #95f1df, #2daab6);
}

.deck-bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.deck-bottom-actions .reset-button {
  grid-column: 1 / -1;
  min-height: 56px;
  border: 1px solid rgba(255, 239, 171, 0.74);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffdf8c, #c58937);
  color: #321f11;
  font-size: 1.08rem;
  font-weight: 950;
  box-shadow: 0 0 26px rgba(255, 218, 116, 0.34);
}

.deck-bottom-actions button:disabled {
  opacity: 0.52;
  filter: grayscale(0.3);
}

.deck-log-line {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(149, 241, 223, 0.16);
  border-radius: 8px;
  background: rgba(2, 18, 28, 0.56);
}

.deck-action-note {
  padding: 8px;
  border: 1px solid rgba(255, 224, 138, 0.28);
  border-radius: 8px;
  background: rgba(255, 224, 138, 0.1);
  color: #ffe08a;
  font-size: 0.76rem;
  font-weight: 800;
}

.deck-log-line span {
  color: rgba(226, 249, 250, 0.72);
  font-size: 0.82rem;
}

.deck-saves-panel button {
  border-color: rgba(149, 241, 223, 0.18);
  background: rgba(4, 28, 42, 0.9);
  color: #eefcff;
}

.deck-round-result,
.deck-trial-locked {
  background: linear-gradient(180deg, rgba(6, 24, 36, 0.96), rgba(3, 13, 22, 0.98));
}

@media (min-width: 981px) {
  .deck-builder {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }

  .deck-builder .card-lab-topbar {
    display: none;
  }

  .deck-builder-layout {
    height: 100dvh;
    display: grid;
    grid-template-rows: 66px minmax(0, 1fr);
    gap: 5px;
    overflow: hidden;
    padding: 7px 18px 12px;
  }

  .deck-builder-sidebar {
    position: static;
    display: grid;
    grid-template-columns: minmax(260px, 0.62fr) minmax(0, 1fr) 46px;
    gap: 8px;
    min-height: 0;
    padding: 5px 8px;
  }

  .deck-builder-control-block {
    gap: 0;
  }

  .deck-top-tile {
    min-width: 0;
    min-height: 56px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(64, 229, 218, 0.34);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(7, 51, 68, 0.88), rgba(4, 24, 38, 0.92));
    color: #eefcff;
    text-align: left;
    box-shadow: inset 0 0 18px rgba(84, 242, 226, 0.06);
  }

  .deck-top-tile b,
  .deck-top-tile .eyebrow {
    color: #54f2e2;
    font-size: 0.72rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0;
  }

  .deck-top-tile strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1rem;
    line-height: 1.2;
  }

  .deck-top-tile small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(226, 249, 250, 0.72);
    font-size: 0.7rem;
  }

  .deck-top-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(84, 242, 226, 0.5);
    border-radius: 8px;
    background: rgba(84, 242, 226, 0.1);
    color: #54f2e2;
    font-weight: 950;
  }

  .deck-top-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(84, 242, 226, 0.34));
  }

  .deck-top-tile--team {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .deck-top-tile--team select {
    width: 100%;
    min-height: 34px;
    font-size: 0.9rem;
    font-weight: 950;
  }

  .deck-top-tile--squad {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .deck-top-tile--squad select {
    width: 100%;
    min-width: 0;
    min-height: 34px;
    font-size: 0.86rem;
    font-weight: 950;
  }

  .deck-top-tile--cost.is-illegal {
    border-color: rgba(255, 74, 84, 0.86);
    background: linear-gradient(180deg, rgba(96, 22, 38, 0.96), rgba(39, 8, 22, 0.98));
    box-shadow: 0 0 24px rgba(255, 74, 84, 0.16), inset 0 0 0 1px rgba(255, 198, 166, 0.12);
  }

  .deck-top-tile--cost.is-incomplete {
    border-color: rgba(255, 216, 128, 0.76);
    background: linear-gradient(180deg, rgba(91, 65, 18, 0.94), rgba(40, 29, 14, 0.96));
  }

  .deck-top-tile--cost.is-legal {
    border-color: rgba(84, 242, 226, 0.62);
  }

  .deck-cost-icon {
    border-color: rgba(255, 224, 138, 0.54);
    background: rgba(255, 224, 138, 0.12);
  }

  .deck-mode-toggle button,
  .deck-side-toggle button {
    min-height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 0.7rem;
    text-align: center;
  }

  .deck-mode-toggle,
  .deck-side-toggle {
    display: none;
  }

  .deck-mode-toggle button span,
  .deck-side-toggle button span {
    width: 25px;
    height: 25px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 238, 160, 0.16);
    color: #ffe08a;
    font-size: 0.68rem;
    font-weight: 950;
  }

  .deck-mode-toggle button small,
  .deck-side-toggle button small {
    display: none;
  }

  .deck-builder select {
    min-height: 32px;
    font-size: 0.76rem;
  }

  .deck-cost-card {
    padding: 5px 8px;
  }

  .deck-cost-card strong {
    font-size: 0.92rem;
  }

  .deck-cost-card p,
  .deck-cost-card small,
  .deck-rules-panel p {
    font-size: 0.62rem;
    line-height: 1.1;
  }

  .deck-cost-panel--active {
    grid-template-columns: 1fr;
  }

  .deck-rules-panel {
    display: grid;
    place-items: center;
    padding: 5px 8px;
  }

  .deck-rules-panel strong {
    font-size: 0.8rem;
  }

  .deck-builder-workbench {
    min-height: 0;
    overflow: auto;
    padding: 0;
  }

  .deck-builder-section {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto auto;
    gap: 6px;
    padding: 10px;
    overflow: visible;
  }

  .deck-builder-section-head {
    display: none;
  }

  .deck-builder-section-head h3 {
    font-size: 0.92rem;
  }

  .deck-builder-actions .quiet-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .deck-builder-section-head .deck-builder-actions {
    display: none;
  }

  .deck-legality-panel {
    grid-template-columns: minmax(190px, 0.9fr) minmax(210px, 0.9fr) minmax(150px, 0.65fr) minmax(260px, 1.45fr);
    align-items: center;
    margin-top: 0;
    padding: 8px 12px;
    min-height: 58px;
  }

  .deck-legality-panel > div,
  .deck-legality-panel p {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .deck-legality-panel p {
    margin: 0;
  }

  .deck-status-copy {
    min-width: 0;
  }

  .deck-legality-panel strong {
    font-size: 1rem;
  }

  .deck-legality-panel p {
    font-size: 0.78rem;
  }

  .deck-panel-tabs {
    display: none;
  }

  .deck-builder-columns {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 330px 288px 132px;
    grid-template-areas:
      "library"
      "deck"
      "utility";
    gap: 10px;
    align-items: stretch;
    margin-top: 0;
    overflow: visible;
  }

  .deck-mode-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    min-width: 0;
    overflow: hidden;
  }

  .deck-hand-panel {
    overflow-y: hidden;
    overflow-x: auto;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .deck-panel-label {
    margin-bottom: 6px;
  }

  .deck-panel-label h4 {
    font-size: 0.92rem;
  }

  .deck-panel-label span {
    font-size: 0.74rem;
  }

  .deck-card-reel-shell {
    position: relative;
    min-width: 0;
    overflow: hidden;
  }

  .deck-card-pool {
    width: 100%;
    height: 304px;
    min-height: 0;
    align-items: start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 5px;
    scrollbar-width: none;
    scroll-behavior: smooth;
  }

  .deck-card-pool::-webkit-scrollbar {
    display: none;
  }

  .deck-reel-arrow {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 28px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 224, 138, 0.52);
    border-radius: 8px;
    background: rgba(183, 123, 42, 0.38);
    color: #ffe08a;
    font-size: 1rem;
    font-weight: 950;
    transform: translateY(-50%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  }

  .deck-reel-arrow--left {
    left: 2px;
  }

  .deck-reel-arrow--right {
    right: 2px;
  }

  .deck-pool-card {
    position: relative;
    flex: 0 0 190px;
    min-height: 0;
    aspect-ratio: 5 / 7.9;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 60px minmax(0, 1fr) 48px;
    gap: 5px;
    align-items: stretch;
    padding: 6px;
  }

  .deck-pool-card-main {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 3px;
    align-content: start;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    color: inherit;
    text-align: left;
    background: transparent;
  }

  .deck-card-cost-badge {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }

  .deck-card-tile-header {
    grid-template-columns: 34px minmax(0, 1fr) 26px;
    grid-template-rows: 28px 24px;
    min-height: 56px;
    padding: 3px 6px;
  }

  .deck-card-tile-header .deck-card-cost-badge,
  .deck-card-tile-header .deck-build-medallion {
    width: 34px;
    height: 28px;
  }

  .deck-card-tile-header .deck-build-medallion img {
    width: 38px;
    height: 38px;
  }

  .deck-card-header-copy strong {
    font-size: 0.86rem;
  }

  .deck-combat-pips {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .deck-combat-pips {
    gap: 3px;
  }

  .deck-combat-pips span {
    grid-template-rows: 20px auto;
  }

  .deck-combat-pips img {
    width: 22px;
    height: 22px;
  }

  .deck-combat-pips b {
    font-size: 0.62rem;
  }

  .deck-combat-pips small {
    font-size: 0.4rem;
  }

  .deck-pool-card strong,
  .deck-pool-card-main span,
  .deck-pool-card-main small,
  .deck-pool-card em {
    font-size: 0.74rem;
    line-height: 1.15;
  }

  .deck-pool-card .deck-card-art {
    min-height: 0;
    margin-bottom: 0;
    aspect-ratio: 5 / 4;
  }

  .deck-pool-card-main span {
    color: rgba(226, 249, 250, 0.72);
  }

  .deck-build-medallion {
    width: 58px;
    height: 52px;
    display: inline-grid;
    place-items: center;
    overflow: visible;
  }

  .deck-build-medallion img {
    width: 62px;
    height: 62px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.38));
  }

  .deck-build-medallion--fallback {
    grid-template-columns: repeat(3, 18px);
    gap: 2px;
    color: #102735;
  }

  .deck-card-view-button {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(149, 241, 223, 0.18);
    border-radius: 7px;
    background: rgba(3, 18, 28, 0.68);
    color: #95f1df;
    font-size: 0.72rem;
    font-weight: 900;
  }

  .deck-selector-icon-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-items: center;
    margin-top: 0;
    min-height: 0;
  }

  .deck-skill-chip {
    min-width: 0;
    height: 40px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 24px auto;
    justify-items: center;
    align-items: center;
    gap: 0;
    padding: 3px 4px;
    border: 1px solid rgba(149, 241, 223, 0.2);
    border-radius: 6px;
    background: rgba(3, 18, 28, 0.58);
    color: #dffdf7;
    font-size: 0.56rem;
    font-weight: 950;
  }

  .deck-skill-chip img {
    width: 24px;
    height: 24px;
    object-fit: contain;
  }

  .deck-skill-chip span {
    overflow: hidden;
    max-width: 100%;
    font-size: 0.48rem;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .deck-pool-card.is-selected .deck-card-view-button {
    background: rgba(2, 18, 28, 0.78);
    color: #d8fff8;
  }

  .deck-table-grid {
    height: auto;
    min-height: 0;
    grid-template-columns: repeat(10, 314px);
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
    align-content: stretch;
    justify-content: start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 2px;
    scrollbar-width: thin;
  }

  .deck-hand-card {
    height: 100%;
    max-height: none;
    min-height: 0;
    align-content: stretch;
    grid-template-rows: 74px minmax(0, 1fr) 48px;
    gap: 6px;
    padding: 7px;
  }

  .deck-table-grid .deck-table-slot.is-empty {
    min-height: 0;
    height: 100%;
  }

  .deck-card-portrait {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: 5 / 4.35;
  }

  .deck-hand-card .deck-card-tile-header {
    grid-template-columns: 40px minmax(76px, 0.9fr) minmax(132px, 1.1fr) 44px;
    grid-template-rows: 28px 34px;
    min-height: 74px;
    gap: 4px 3px;
    margin-bottom: 0;
    padding: 5px;
  }

  .deck-hand-card .deck-card-cost-badge {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 40px;
    height: 40px;
  }

  .deck-hand-card .deck-card-header-copy {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
  }

  .deck-hand-card .deck-card-header-copy strong {
    display: block;
    font-size: 1rem;
    line-height: 1;
    white-space: nowrap;
  }

  .deck-hand-card .deck-combat-pips {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: center;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 100%;
  }

  .deck-hand-card .deck-combat-pips span {
    grid-template-rows: 28px 10px;
  }

  .deck-hand-card .deck-combat-pips img {
    width: 32px;
    height: 32px;
  }

  .deck-hand-card .deck-combat-pips b {
    font-size: 0.78rem;
  }

  .deck-hand-card .deck-combat-pips small {
    font-size: 0.43rem;
  }

  .deck-card-header-actions {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
  }

  .deck-card-header-actions button {
    width: 20px;
    height: 20px;
  }

  .deck-hand-card-main {
    margin-top: 3px;
    gap: 5px;
  }

  .deck-hand-card-main > span,
  .deck-hand-card-main button {
    width: 22px;
    height: 22px;
    font-size: 0.68rem;
  }

  .deck-hand-card-main strong {
    font-size: 0.76rem;
  }

  .deck-hand-card-main p {
    display: none;
  }

  .deck-card-socket-row {
    gap: 5px;
  }

  .deck-card-socket-row > span {
    display: grid;
    justify-items: center;
    gap: 1px;
    min-width: 0;
  }

  .deck-card-socket-row > span > b {
    overflow: hidden;
    color: #70f6e8;
    font-size: 0.48rem;
    font-weight: 950;
    line-height: 1;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .deck-card-socket-row .deck-socket {
    width: 24px;
    height: 24px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 20px;
    height: 20px;
  }

  .deck-hand-card .deck-card-rules {
    display: none;
  }

  .deck-equipped-strip .deck-artifact-badge,
  .deck-equipped-strip .deck-banner-badge {
    width: 24px;
    height: 24px;
  }

  .deck-utility-panel {
    height: 100%;
    display: grid;
    grid-template-columns: minmax(520px, 1.15fr) minmax(360px, 0.85fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
    gap: 8px;
    padding: 9px;
  }

  .deck-artifact-controls {
    display: none;
  }

  .deck-accessory-list {
    max-height: none;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    overflow: hidden;
    gap: 7px;
  }

  .deck-accessory-list.is-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .deck-gear-picker {
    min-height: 0;
    gap: 5px;
  }

  .deck-gear-picker select {
    min-height: 28px;
    font-size: 0.68rem;
  }

  .deck-accessory-list.is-picker .deck-accessory-row {
    grid-template-columns: 30px 42px minmax(0, 1fr) 28px auto;
    gap: 7px;
    min-height: 54px;
    padding: 6px;
  }

  .deck-accessory-list.is-picker .deck-accessory-cost {
    width: 30px;
    height: 30px;
  }

  .deck-accessory-list.is-picker .deck-accessory-icon {
    width: 42px;
    height: 42px;
  }

  .deck-accessory-list.is-picker .deck-accessory-row > div span {
    display: block;
  }

  .deck-accessory-row {
    grid-template-columns: 30px 48px minmax(0, 1fr) 30px auto;
    min-height: 0;
    padding: 7px;
  }

  .deck-accessory-cost {
    position: relative;
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    font-size: 0.74rem;
    font-weight: 950;
  }

  .deck-accessory-row img {
    width: 48px;
    height: 48px;
  }

  .deck-accessory-row strong,
  .deck-accessory-row span,
  .deck-accessory-row em,
  .deck-gear-info-button,
  .deck-gear-clear-button {
    font-size: 0.74rem;
  }

  .deck-accessory-row > div span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .deck-summary-panel {
    gap: 7px;
    align-content: start;
  }

  .deck-summary-panel h4,
  .deck-panel-label h4 {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    align-items: center;
    gap: 8px;
  }

  .deck-summary-panel dl {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .deck-summary-panel dl div {
    display: grid;
    gap: 2px;
    font-size: 0.78rem;
  }

  .deck-summary-panel .is-cost dd {
    font-size: 1.1rem;
  }

  .deck-summary-panel p {
    margin: 0;
    padding: 6px 8px;
  }

  .deck-socket-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 5px 7px;
  }

  .deck-socket-legend > span {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 5px;
    font-size: 0.66rem;
  }

  .deck-socket-legend .deck-socket {
    width: 22px;
    height: 22px;
  }

  .deck-cost-graph {
    height: 46px;
    gap: 5px;
    padding-top: 4px;
  }

  .deck-saves-panel {
    padding: 7px;
    font-size: 0.74rem;
  }

  .deck-log-line {
    min-height: 52px;
    padding: 8px;
  }

  .deck-log-line span {
    font-size: 0.72rem;
  }

  .deck-desktop-action-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .deck-desktop-action-row button {
    min-width: 0;
    min-height: 34px;
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    gap: 4px;
    padding: 0 12px;
    border: 1px solid rgba(144, 255, 239, 0.24);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(19, 72, 83, 0.92), rgba(8, 42, 55, 0.94));
    color: #eefcff;
    font-weight: 900;
  }

  .deck-desktop-action-row button strong {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.84rem;
  }

  .deck-action-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.38));
  }

  .deck-legality-panel .deck-action-icon {
    width: 30px;
    height: 30px;
  }

  .deck-desktop-action-row button span {
    display: none;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0.78;
  }

  .deck-desktop-action-row .reset-button {
    border: 1px solid rgba(255, 239, 171, 0.74);
    background: linear-gradient(180deg, #ffdf8c, #c58937);
    color: #321f11;
  }

  .deck-gear-info-button,
  .deck-gear-clear-button {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(149, 241, 223, 0.22);
    border-radius: 7px;
    background: rgba(3, 18, 28, 0.68);
    color: #95f1df;
    font-weight: 950;
  }

  .deck-gear-clear-button {
    border-color: rgba(255, 151, 122, 0.28);
    color: #ffd8ce;
  }

  .deck-mobile-tray {
    display: none;
  }
}

@media (max-width: 980px) {
  .deck-builder-columns {
    grid-template-columns: 1fr;
    grid-template-areas:
      "library"
      "deck"
      "utility";
  }

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

  .deck-card-pool {
    display: grid;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
  }

  .deck-pool-card {
    flex-basis: auto;
    aspect-ratio: 5 / 8.15;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) 28px;
  }

  .deck-pool-card-main {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .deck-builder {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background:
      linear-gradient(180deg, rgba(5, 21, 31, 0.84), rgba(3, 15, 25, 0.96)),
      url("../public/assets/b3-squad-crossover-hero-v1.png") 48% top / auto 100dvh fixed;
  }

  .deck-builder .card-lab-topbar {
    height: 52px;
    min-height: 0;
    padding: 4px 8px;
  }

  .deck-builder .game-titlemark--compact {
    width: 54px;
  }

  .deck-builder .card-lab-topbar h2 {
    font-size: 1rem;
  }

  .deck-builder .topbar-actions .quiet-button {
    min-height: 30px;
    font-size: 0.72rem;
  }

  .deck-builder-layout {
    height: calc(100dvh - 52px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    overflow: hidden;
    padding: 0 6px 6px;
  }

  .deck-builder-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-areas:
      "squad help"
      "actions actions";
    border-radius: 8px;
    gap: 6px;
    padding: 6px;
  }

  .deck-top-tile {
    min-height: 0;
    border-radius: 8px;
    padding: 6px;
  }

  .deck-top-tile--squad {
    grid-area: squad;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 6px;
  }

  .deck-top-tile--squad select {
    min-width: 0;
    width: 100%;
  }

  .deck-help-button {
    grid-area: help;
    min-height: 0;
    height: 100%;
    font-size: 0.9rem;
  }

  .deck-top-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
  }

  .deck-top-icon img {
    width: 24px;
    height: 24px;
  }

  .deck-top-tile b,
  .deck-top-tile .eyebrow {
    font-size: 0.58rem;
  }

  .deck-top-tile strong {
    font-size: 0.74rem;
    line-height: 1.1;
  }

  .deck-top-tile small {
    font-size: 0.6rem;
  }

  .deck-top-tile--team select {
    min-height: 30px;
    font-size: 0.72rem;
    padding: 0 28px 0 8px;
  }

  .deck-builder select {
    min-height: 32px;
    font-size: 0.75rem;
  }

  .deck-desktop-action-row {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .deck-desktop-action-row button {
    min-width: 0;
    min-height: 30px;
    padding: 0 3px;
    font-size: 0.58rem;
  }

  .deck-desktop-action-row button strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .deck-builder-workbench {
    min-height: 0;
    overflow: hidden;
  }

  .deck-builder-section {
    min-height: 0;
  }

  .deck-builder-workbench > .deck-builder-section:first-child {
    height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    padding-bottom: 0;
  }

  .deck-builder-section-head {
    display: none;
  }

  .deck-builder-section-head .eyebrow {
    font-size: 0.58rem;
  }

  .deck-builder-section-head h3 {
    font-size: 0.9rem;
  }

  .deck-builder-actions {
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .deck-builder-actions .quiet-button {
    min-height: 30px;
    padding: 0 4px;
    font-size: 0.64rem;
  }

  .deck-legality-panel {
    grid-template-columns: 0.9fr 0.75fr 0.75fr;
    margin-top: 6px;
    padding: 6px;
  }

  .deck-legality-panel p {
    display: none;
  }

  .deck-legality-panel strong {
    font-size: 0.88rem;
  }

  .deck-progress-pips span {
    width: 12px;
    height: 4px;
  }

  .deck-panel-tabs {
    margin-top: 6px;
  }

  .deck-panel-tabs button {
    min-height: 32px;
    font-size: 0.78rem;
  }

  .deck-builder-columns {
    display: block;
    min-height: 0;
    overflow: hidden;
    margin-top: 6px;
  }

  .deck-mode-panel {
    display: none;
  }

  .deck-mode-panel.is-active {
    display: block;
    height: 100%;
    overflow: auto;
    padding-right: 2px;
    padding-bottom: 8px;
  }

  .deck-hand-panel.is-active {
    overflow-y: auto;
    overflow-x: hidden;
  }

  .deck-panel-label {
    margin-bottom: 6px;
  }

  .deck-panel-label span {
    display: none;
  }

  .deck-card-pool {
    height: auto;
    max-height: calc(100dvh - 360px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    overflow: auto;
    padding: 0 2px 8px;
  }

  .deck-pool-card {
    min-height: 0;
    aspect-ratio: 5 / 8.15;
    flex-basis: auto;
    grid-template-rows: auto minmax(0, 1fr) 28px;
    padding: 6px;
    border-color: rgba(84, 242, 226, 0.55);
    background: linear-gradient(180deg, rgba(5, 72, 65, 0.82), rgba(3, 28, 42, 0.96));
  }

  .deck-card-reel-shell {
    position: static;
  }

  .deck-reel-arrow {
    display: none;
  }

  .deck-pool-card-main {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 3px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #eefcff;
  }

  .deck-card-view-button {
    top: 8px;
    right: 8px;
    border-color: rgba(149, 241, 223, 0.32);
    background: rgba(2, 18, 28, 0.78);
    color: #95f1df;
  }

  .deck-pool-card-main strong {
    color: #ffffff;
    font-size: 0.82rem;
  }

  .deck-pool-card-main small {
    font-size: 0.68rem;
  }

  .deck-card-cost-badge {
    width: 24px;
    height: 24px;
    font-size: 0.74rem;
  }

  .deck-card-tile-header {
    grid-template-columns: 21px minmax(0, 1fr);
    gap: 4px;
    grid-template-rows: 24px 20px;
    min-height: 48px;
    margin-bottom: 4px;
    padding: 2px 30px 2px 3px;
  }

  .deck-card-tile-header .deck-card-cost-badge {
    width: 22px;
    height: 22px;
  }

  .deck-combat-pips {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .deck-combat-pips img {
    width: 16px;
    height: 16px;
  }

  .deck-combat-pips b {
    font-size: 0.54rem;
  }

  .deck-combat-pips small {
    display: none;
  }

  .deck-pool-card .deck-card-art {
    min-height: 0;
    margin-bottom: 0;
    aspect-ratio: 5 / 6.7;
  }

  .deck-build-medallion {
    width: 54px;
    height: 48px;
  }

  .deck-build-medallion img {
    width: 58px;
    height: 58px;
  }

  .deck-selector-icon-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .deck-skill-chip {
    min-width: 0;
    height: 28px;
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 3px;
    padding: 2px 4px;
    border: 1px solid rgba(149, 241, 223, 0.24);
    border-radius: 6px;
    background: rgba(3, 18, 28, 0.62);
    color: #dffdf7;
    font-size: 0.56rem;
    font-weight: 950;
  }

  .deck-skill-chip img {
    width: 16px;
    height: 16px;
    object-fit: contain;
  }

  .deck-skill-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .deck-table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
    padding-bottom: 6px;
  }

  .deck-card-portrait {
    aspect-ratio: 5 / 3.1;
  }

  .deck-hand-card {
    grid-template-rows: 58px minmax(0, 1fr) 34px;
    gap: 3px;
    padding: 4px;
  }

  .deck-hand-card .deck-card-tile-header {
    grid-template-columns: 26px minmax(48px, 0.8fr) minmax(82px, 1fr) 44px;
    grid-template-rows: 24px 26px;
    min-height: 58px;
    padding: 3px 4px;
  }

  .deck-hand-card .deck-card-cost-badge {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 26px;
    height: 26px;
  }

  .deck-hand-card .deck-card-header-copy {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
  }

  .deck-hand-card .deck-card-header-copy strong {
    display: block;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .deck-hand-card .deck-combat-pips {
    grid-column: 3;
    grid-row: 1 / -1;
    align-self: center;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
  }

  .deck-hand-card .deck-combat-pips span {
    grid-template-rows: 19px 7px;
  }

  .deck-hand-card .deck-combat-pips img {
    width: 20px;
    height: 20px;
  }

  .deck-hand-card .deck-combat-pips b {
    font-size: 0.56rem;
  }

  .deck-hand-card .deck-combat-pips small {
    display: block;
    font-size: 0.31rem;
  }

  .deck-hand-card .deck-card-header-actions {
    grid-column: 4;
    grid-row: 1;
    align-self: start;
    gap: 3px;
  }

  .deck-hand-card .deck-card-header-actions button {
    width: 20px;
    height: 20px;
    font-size: 0.64rem;
  }

  .deck-hand-card-main {
    min-height: 24px;
    gap: 4px;
  }

  .deck-hand-card-main p,
  .deck-hand-card-main .deck-table-view-button {
    display: none;
  }

  .deck-card-socket-row .deck-socket {
    width: 20px;
    height: 20px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 16px;
    height: 16px;
  }

  .deck-card-socket-row > span > b {
    font-size: 0.42rem;
  }

  .deck-hand-card .deck-card-rules {
    font-size: 0.7rem;
  }

  .deck-table-slot.is-empty {
    min-height: 118px;
  }

  .deck-utility-panel {
    height: 100%;
    overflow: auto;
    padding: 10px;
  }

  .deck-bottom-actions {
    display: none;
  }

  .deck-mobile-tray {
    display: grid;
    gap: 5px;
    margin-top: 6px;
    padding: 6px;
    border: 1px solid rgba(149, 241, 223, 0.2);
    border-radius: 8px;
    background: rgba(3, 18, 28, 0.88);
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.28);
  }

  .deck-desktop-action-row {
    display: none;
  }

  .deck-mobile-tray-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    color: #eefcff;
    font-size: 0.82rem;
    font-weight: 900;
  }

  .deck-mobile-tray-head span {
    color: #95f1df;
  }

  .deck-mobile-strip {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 4px;
  }

  .deck-mobile-strip button {
    position: relative;
    height: 42px;
    overflow: hidden;
    border: 1px solid rgba(255, 230, 154, 0.26);
    border-radius: 6px;
    background: rgba(6, 24, 36, 0.92);
  }

  .deck-mobile-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .deck-mobile-strip b {
    position: absolute;
    top: 2px;
    left: 2px;
    padding: 1px 3px;
    border-radius: 4px;
    background: rgba(2, 14, 22, 0.72);
    color: #fff;
    font-size: 0.52rem;
  }

  .deck-mobile-strip .is-empty {
    display: grid;
    place-items: center;
  }

  .deck-mobile-strip .is-empty span {
    color: rgba(238, 252, 255, 0.58);
    font-size: 1.1rem;
  }

  .deck-mobile-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .deck-mobile-actions button {
    min-width: 0;
    min-height: 30px;
    overflow: hidden;
    padding: 0 2px;
    border-radius: 7px;
    font-size: 0.62rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .deck-mobile-actions .reset-button {
    border: 1px solid rgba(255, 239, 171, 0.7);
    background: linear-gradient(180deg, #ffdf8c, #c58937);
    color: #321f11;
  }

  .deck-trial-section {
    display: none;
  }
}

.mode-hub {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  position: absolute;
  inset: auto 0 24px;
  z-index: 3;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.mode-hub.lobby-shell {
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.82fr);
  align-items: end;
}

.card-lab,
.card-library {
  min-height: 100dvh;
  overflow-y: auto;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(17, 24, 39, 0.96), rgba(35, 30, 46, 0.96)),
    #111827;
  color: #fffaf2;
}

.card-lab-topbar {
  position: static;
  padding: 0 0 18px;
}

.card-lab-layout,
.card-library-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card-lab-sidebar,
.card-library-sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
}

.card-library-tabs {
  display: grid;
  gap: 8px;
}

.card-library-tabs button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.07);
  color: #fffaf2;
  font-weight: 950;
  text-align: left;
}

.card-library-tabs button.is-active {
  border-color: rgba(149, 241, 223, 0.55);
  background: rgba(149, 241, 223, 0.18);
  color: #95f1df;
}

.card-library-content {
  min-height: calc(100dvh - 160px);
  padding: 18px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.08), rgba(149, 241, 223, 0.06)),
    rgba(0, 0, 0, 0.16);
}

.library-discovery {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.46);
}

.library-discovery label {
  display: grid;
  gap: 5px;
}

.library-discovery label span,
.library-discovery > strong {
  color: #95f1df;
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(149, 241, 223, 0.34);
}

.library-discovery input {
  min-height: 40px;
  border: 1px solid rgba(255, 250, 242, 0.15);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  font: inherit;
  font-weight: 800;
  padding: 0 12px;
}

.library-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.library-filter-row button {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.07);
  color: #fffaf2;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.library-filter-row button.is-active {
  border-color: rgba(149, 241, 223, 0.58);
  background: rgba(149, 241, 223, 0.18);
  color: #95f1df;
}

.library-section + .library-section {
  margin-top: 20px;
}

.library-section h3 {
  margin: 0 0 10px;
  color: #95f1df;
  font-size: 0.92rem;
  font-weight: 950;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45);
}

.library-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

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

.library-team-index {
  display: grid;
  gap: 14px;
}

.library-team-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primitive-a), transparent 72%), transparent 45%),
    linear-gradient(135deg, rgba(255, 250, 242, 0.1), rgba(17, 24, 39, 0.2)),
    rgba(17, 24, 39, 0.5);
}

.library-team-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.library-team-head span {
  display: block;
  color: #95f1df;
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.library-team-head h3 {
  margin: 3px 0 4px;
  color: #fffaf2;
  font-size: 1.45rem;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.58);
}

.library-team-head p,
.library-team-card > p {
  margin: 0;
  color: rgba(255, 250, 242, 0.76);
  font-size: 0.9rem;
  line-height: 1.35;
}

.library-team-head strong {
  display: grid;
  place-items: center;
  width: 58px;
  min-width: 58px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 212, 77, 0.45);
  border-radius: 50%;
  background: rgba(255, 212, 77, 0.12);
  color: #ffd44d;
  font-size: 1.55rem;
  font-weight: 950;
}

.library-swatch-row {
  display: flex;
  gap: 8px;
}

.library-swatch-row i {
  display: block;
  width: 44px;
  height: 10px;
  border: 1px solid rgba(255, 250, 242, 0.26);
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.24);
}

.library-card-roster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.library-card-roster button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 3px 8px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  text-align: left;
}

.library-card-roster b {
  grid-row: span 3;
  align-self: center;
  color: #ffd44d;
  font-size: 1rem;
  font-weight: 950;
}

.library-card-roster span {
  overflow: hidden;
  color: #fffaf2;
  font-size: 0.84rem;
  font-weight: 900;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.library-card-roster em {
  overflow: hidden;
  color: #95f1df;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.library-card-roster strong {
  justify-self: end;
  color: #95f1df;
  font-family: var(--font-display);
  font-size: 0.68rem;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(149, 241, 223, 0.42);
}

.library-card-roster small {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.library-keyword-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: start;
}

.library-keyword-row em,
.library-card-roster small em {
  padding: 2px 6px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 999px;
  background: rgba(149, 241, 223, 0.08);
  color: rgba(255, 250, 242, 0.82);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.library-card {
  display: grid;
  align-items: stretch;
}

.library-card-face {
  grid-area: 1 / 1;
  display: grid;
  align-content: start;
  gap: 10px;
  aspect-ratio: 2.5 / 3.5;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 0, rgba(149, 241, 223, 0.12), transparent 28%),
    linear-gradient(135deg, rgba(255, 250, 242, 0.11), rgba(17, 24, 39, 0.18)),
    rgba(17, 24, 39, 0.48);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.library-card-face[hidden] {
  display: none;
}

.library-card:not(.is-back-visible) .library-card-back,
.library-card.is-back-visible .library-card-front {
  display: none;
}

.library-card-front {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.library-card-back {
  background:
    radial-gradient(circle at 76% 8%, rgba(255, 212, 77, 0.12), transparent 30%),
    linear-gradient(150deg, rgba(255, 250, 242, 0.1), rgba(16, 22, 32, 0.3)),
    rgba(17, 24, 39, 0.54);
}

.library-card-back-content {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.library-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.library-card-head img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 7px 14px rgba(0, 0, 0, 0.35));
}

.library-card span {
  display: block;
  color: #95f1df;
  font-size: 0.68rem;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.42);
}

.library-card h3 {
  margin: 2px 0 0;
  color: #fffaf2;
  font-size: 1.18rem;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.58),
    0 0 12px rgba(149, 241, 223, 0.18);
}

.library-card strong {
  color: #ffd44d;
  font-size: 0.82rem;
  line-height: 1.25;
}

.library-card p {
  margin: 0;
  color: rgba(255, 250, 242, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.accessory-library-card {
  align-items: stretch;
}

.accessory-library-card .library-card-head img {
  width: 62px;
  height: 62px;
}

.accessory-fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.accessory-fact-grid div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(149, 241, 223, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.07);
}

.accessory-fact-grid dt,
.accessory-story-panel span {
  color: #95f1df;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.48);
}

.accessory-fact-grid dd {
  margin: 4px 0 0;
  color: #fffaf2;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.22;
}

.accessory-story-panel {
  display: grid;
  gap: 7px;
  min-height: 0;
  padding: 10px;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.34);
}

.accessory-story-panel p {
  color: rgba(255, 250, 242, 0.84);
  font-size: 0.94rem;
  font-style: italic;
}

.accessory-story-panel strong {
  color: #ffd44d;
  font-size: 0.78rem;
  line-height: 1.32;
}

.accessory-boost-ladder {
  display: grid;
  gap: 6px;
  min-height: 0;
  max-height: 160px;
  overflow: auto;
  margin: 0;
  padding: 0 2px 0 0;
  list-style: none;
}

.accessory-boost-ladder li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 2px 7px;
  padding: 6px 7px;
  border: 1px solid rgba(255, 212, 77, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.06);
}

.accessory-boost-ladder b {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 212, 77, 0.16);
  color: #ffd44d;
  font-size: 0.78rem;
  font-weight: 950;
}

.accessory-boost-ladder span {
  color: #95f1df;
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.accessory-boost-ladder p {
  color: rgba(255, 250, 242, 0.8);
  font-size: 0.72rem;
  line-height: 1.25;
}

.library-flip-button {
  align-self: end;
  justify-self: start;
  margin-top: auto;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 212, 77, 0.36);
  border-radius: 6px;
  background: rgba(255, 212, 77, 0.14);
  color: #ffd44d;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  .library-card-grid,
  .library-card-grid.is-overview {
    grid-template-columns: 1fr;
  }

  .library-card {
    grid-template-columns: 1fr;
  }

}

.library-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: end;
}

.library-tag-row em {
  padding: 4px 7px;
  border: 1px solid rgba(149, 241, 223, 0.22);
  border-radius: 999px;
  background: rgba(149, 241, 223, 0.08);
  color: #dffdf7;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.card-lab-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.card-lab-stat-grid div,
.card-lab-filter,
.card-lab-toggle,
.primitive-zone-map span {
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.07);
}

.card-lab-stat-grid div {
  padding: 10px;
}

.card-lab-stat-grid span,
.card-lab-filter span,
.primitive-zone-map span {
  display: block;
  color: #95f1df;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-lab-stat-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 1.45rem;
}

.card-lab-filter {
  display: grid;
  gap: 7px;
  padding: 10px;
}

.card-lab-filter select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(149, 241, 223, 0.25);
  border-radius: 8px;
  background: #111827;
  color: #fffaf2;
  font: inherit;
  font-weight: 800;
}

.card-lab-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
}

.card-lab-toggle button {
  min-height: 38px;
  border-radius: 8px;
  background: transparent;
  color: #fffaf2;
  font-weight: 900;
}

.card-lab-toggle button.is-active {
  background: #fffaf2;
  color: #111827;
}

#cardLabFrameNote {
  margin: 0;
  color: rgba(255, 250, 242, 0.72);
  font-size: 0.88rem;
}

.primitive-preview-shell {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 160px);
  padding: 18px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.08), rgba(149, 241, 223, 0.06)),
    rgba(0, 0, 0, 0.16);
}

.primitive-card {
  --primitive-a: #ff7a00;
  --primitive-b: #f8fafc;
  --primitive-c: #111827;
  position: relative;
  width: min(100%, 390px);
  height: 590px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 242, 0.32);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(135deg, color-mix(in srgb, var(--primitive-a), #000000 18%), var(--primitive-b), var(--primitive-c));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
}

.primitive-art-window {
  position: relative;
  height: 386px;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 250, 242, 0.24);
  background: #111827;
}

.primitive-character-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.primitive-art-swatch {
  position: absolute;
  inset: 0;
  opacity: 0.78;
}

.primitive-art-window strong,
.primitive-art-window span {
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

.primitive-art-window strong {
  align-self: end;
  padding: 7px 10px;
  border: 1px solid rgba(255, 250, 242, 0.22);
  border-radius: 4px;
  background: rgba(17, 24, 39, 0.38);
  color: rgba(255, 250, 242, 0.9);
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.82rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.primitive-art-window span {
  align-self: end;
  max-width: 78%;
  margin: 10px 0 16px;
  overflow-wrap: anywhere;
  color: #fffaf2;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.primitive-corner {
  position: absolute;
  top: 12px;
  z-index: 2;
}

.primitive-corner-left {
  left: 12px;
  max-width: 230px;
}

.primitive-corner-right {
  right: 12px;
}

.primitive-corner-right .primitive-accessory-frame {
  transform-origin: top right;
}

.primitive-skill-mark {
  position: absolute;
  top: 68px;
  right: 12px;
  z-index: 2;
}

.primitive-front-color,
.primitive-front-accessory,
.primitive-front-traits,
.primitive-front-skill-stack {
  position: absolute;
  z-index: 3;
}

.primitive-front-color {
  top: -3px;
  left: -7px;
}

.primitive-front-accessory {
  top: 18px;
  right: 25px;
  z-index: 5;
}

.primitive-front-accessory .primitive-accessory-frame {
  --accessory-frame-size: 88px;
  --accessory-icon-size: 88px;
}

.primitive-front-accessory .primitive-accessory-frame-icon {
  filter: none;
}

.primitive-front-traits {
  top: 119px;
  left: 10px;
  display: grid;
  gap: 7px;
}

.primitive-front-traits .primitive-cheat-art {
  width: 56px;
  height: 56px;
  border: 0;
  background: transparent;
  opacity: 1;
  filter: none;
}

.primitive-front-traits .primitive-cheat-art img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: none;
}

.primitive-front-traits .primitive-cheat-art::after,
.primitive-back-trait-grid .primitive-cheat-art::after {
  content: none;
}

.primitive-front-skill-stack {
  right: 6px;
  bottom: 7px;
  width: 106px;
  display: grid;
  gap: 1px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  z-index: 6;
}

.primitive-front-skill-chip {
  display: grid;
  grid-template-rows: 58px auto;
  justify-items: center;
  gap: 0;
  align-items: center;
}

.primitive-front-skill-chip + .primitive-front-skill-chip {
  margin-top: -2px;
}

.primitive-front-skill-chip .primitive-icon-button,
.primitive-front-skill-chip .primitive-icon-button img {
  width: 62px;
  height: 62px;
}

.primitive-front-skill-chip .primitive-icon-button {
  background: transparent;
  box-shadow: none;
  filter: none;
}

.primitive-front-skill-chip .primitive-icon-button img {
  filter: none;
}

.primitive-front-skill-chip b {
  color: #ffc928;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.78rem;
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.78),
    0 0 8px rgba(255, 201, 40, 0.18);
}

.primitive-icon-button {
  width: 78px;
  height: 78px;
  position: relative;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fffaf2;
  box-shadow: none;
  cursor: pointer;
}

.primitive-icon-button img,
.primitive-icon-button .primitive-accessory-main {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: drop-shadow(0 10px 17px rgba(0, 0, 0, 0.4));
}

.primitive-icon-button .primitive-accessory-main {
  width: 84px;
  height: 84px;
}

.primitive-icon-button .primitive-accessory-boost {
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.42));
}

.primitive-icon-button span,
.primitive-icon-button strong {
  line-height: 1;
}

.primitive-icon-button span {
  font-size: 0.48rem;
  font-weight: 900;
  text-transform: uppercase;
}

.primitive-icon-button strong {
  position: absolute;
  right: -4px;
  bottom: -5px;
  min-width: 19px;
  min-height: 19px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 242, 0.8);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.58), transparent 36%),
    linear-gradient(135deg, #f7c948, #8a5a00);
  color: #111827;
  font-size: 1.15rem;
  font-weight: 950;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
}

.primitive-native-button strong {
  display: none;
}

.primitive-accessory-button strong {
  display: none;
}

.primitive-nameplate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 82px;
  min-height: 104px;
  padding: 16px 142px 8px 18px;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.8), rgba(17, 24, 39, 0.28)),
    linear-gradient(135deg, rgba(255, 250, 242, 0.2), transparent);
}

.primitive-nameplate span,
.primitive-back-head span {
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.9),
    0 0 8px rgba(149, 241, 223, 0.42);
}

.primitive-nameplate h3,
.primitive-back-head h3 {
  margin: 4px 0 6px;
  color: #fffaf2;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(17, 24, 39, 0.82),
    0 0 14px rgba(255, 250, 242, 0.22);
}

.primitive-nameplate p {
  margin: 0;
  color: rgba(255, 250, 242, 0.9);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.28;
  text-shadow: 0 1px 0 rgba(17, 24, 39, 0.82);
}

.primitive-combat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 5px 18px 10px;
}

.primitive-card-front > .primitive-combat-strip {
  position: absolute;
  left: 16px;
  right: 168px;
  bottom: 8px;
  margin: 0;
  grid-template-columns: repeat(4, 45px);
  justify-content: start;
  gap: 0;
}

.primitive-card-front > .primitive-combat-strip div {
  min-height: 76px;
}

.primitive-card-front > .primitive-combat-strip .combat-stat-icon,
.primitive-card-front > .primitive-combat-strip .combat-stat-icon img {
  width: 76px;
  height: 76px;
}

.primitive-card-front > .primitive-combat-strip .combat-stat-icon img {
  filter: none;
}

.primitive-card-front > .primitive-combat-strip dd {
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 2.1rem;
  color: #fffaf2;
  text-shadow:
    -2px -2px 0 rgba(17, 24, 39, 0.94),
    2px -2px 0 rgba(17, 24, 39, 0.94),
    -2px 2px 0 rgba(17, 24, 39, 0.94),
    2px 2px 0 rgba(17, 24, 39, 0.94),
    0 0 10px rgba(255, 250, 242, 0.42);
}

.primitive-combat-strip div {
  min-width: 0;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 86px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.primitive-combat-strip dt {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.primitive-combat-strip dd {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  margin: 0;
  color: #f7fbff;
  font-size: 2.22rem;
  font-weight: 950;
  line-height: 1;
  text-shadow:
    -2px -2px 0 rgba(17, 24, 39, 0.86),
    2px -2px 0 rgba(17, 24, 39, 0.86),
    -2px 2px 0 rgba(17, 24, 39, 0.86),
    2px 2px 0 rgba(17, 24, 39, 0.86),
    0 0 12px rgba(149, 241, 223, 0.5);
}

.combat-stat-icon {
  grid-area: 1 / 1;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.combat-stat-icon img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  filter:
    contrast(1.08)
    saturate(1.12)
    drop-shadow(0 9px 15px rgba(0, 0, 0, 0.46));
}

.combat-stat-medallion:focus-visible,
.primitive-medallion-cluster:focus-visible,
.combat-stat-icon:focus-visible,
.primitive-accessory-frame:focus-visible {
  outline: 2px solid #95f1df;
  outline-offset: 2px;
}

.primitive-card-back {
  width: min(100%, 760px);
  height: 1040px;
  display: grid;
  grid-template-rows: 186px 170px 224px 382px 76px;
  gap: 0;
  padding: 0;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, 0.88), rgba(17, 24, 39, 0.72)),
    linear-gradient(135deg, var(--primitive-a), var(--primitive-b), var(--primitive-c));
}

.primitive-back-head {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: start;
  padding: 48px 38px 18px 42px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.72);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.52), rgba(17, 24, 39, 0.22)),
    rgba(255, 250, 242, 0.06);
}

.primitive-back-title {
  position: relative;
  min-width: 0;
}

.primitive-back-title > span {
  display: block;
}

.primitive-contract-kicker {
  color: #95f1df;
  font-size: 1rem;
}

.primitive-back-head .primitive-contract-brand {
  margin-top: 4px;
  color: #ffd86f;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.9),
    0 0 10px rgba(255, 216, 111, 0.36);
}

.primitive-back-head h3 {
  margin: 14px 0 0;
  overflow: hidden;
  font-size: 2.55rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primitive-contract-status {
  position: relative;
  min-height: 54px;
  margin-top: 10px;
}

.primitive-contract-status em {
  position: relative;
  z-index: 2;
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 1rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.9),
    0 0 8px rgba(149, 241, 223, 0.42);
}

.primitive-contract-status img {
  position: absolute;
  z-index: 1;
  left: var(--stamp-left, 58%);
  top: var(--stamp-top, 0);
  width: 184px;
  height: auto;
  opacity: 0.92;
  mix-blend-mode: normal;
  filter: none;
  pointer-events: none;
  transform: translateX(-50%) rotate(var(--stamp-angle, -8deg)) scale(var(--stamp-scale, 1));
  transform-origin: center;
}

.primitive-back-top-icons {
  display: grid;
  grid-template-columns: 118px 168px;
  gap: 40px;
  align-items: start;
  justify-content: end;
}

.primitive-labeled-icon {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.primitive-labeled-icon > span,
.primitive-trait-tile > span,
.primitive-back-skill-copy article > span {
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.94rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.86),
    0 0 8px rgba(149, 241, 223, 0.44);
}

.primitive-back-accessory .primitive-accessory-frame {
  --accessory-frame-size: 94px;
  --accessory-icon-size: 64px;
  margin-top: 6px;
  overflow: visible;
  border-radius: 50%;
}

.primitive-back-color-chip .card-color-build {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  grid-template-rows: 66px 54px;
  gap: 0;
  align-items: center;
  justify-items: center;
  margin: -22px 0 0;
}

.primitive-back-color-chip .primitive-medallion-cluster {
  width: 156px;
  height: 156px;
  display: grid;
  place-items: center;
  margin: -14px 0 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter:
    drop-shadow(0 0 16px rgba(255, 0, 210, 0.42))
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4));
}

.primitive-back-color-chip .primitive-medallion-cluster .card-color-build {
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 1;
  pointer-events: none;
}

.primitive-back-color-chip .color-pip {
  width: 40px;
  height: 40px;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  position: relative;
  padding: 0;
  border-radius: 50%;
  outline: 1px solid rgba(255, 224, 139, 0.78);
  outline-offset: -2px;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-1 {
  width: 84px;
  height: 84px;
  grid-column: 2 / span 2;
  grid-row: 1;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-2 {
  width: 66px;
  height: 66px;
  grid-column: 1 / span 2;
  grid-row: 2;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-3 {
  width: 44px;
  height: 44px;
  grid-column: 3 / span 2;
  grid-row: 2;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .card-color-build {
  grid-template-columns: repeat(3, 74px);
  grid-template-rows: 76px;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .color-pip {
  width: 74px;
  height: 74px;
}

.primitive-back-color-chip .color-pip img {
  display: block;
  width: 98%;
  height: 98%;
  grid-area: 1 / 1;
  object-fit: contain;
}

.primitive-back-color-chip .color-pip b {
  display: none;
}

.primitive-back-color-chip .color-pip em {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #fffaf2;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 1.82rem;
  font-style: normal;
  font-weight: 950;
  text-shadow:
    -1px -1px 0 rgba(17, 24, 39, 0.94),
    1px -1px 0 rgba(17, 24, 39, 0.94),
    -1px 1px 0 rgba(17, 24, 39, 0.94),
    1px 1px 0 rgba(17, 24, 39, 0.94),
    0 0 8px rgba(255, 250, 242, 0.46);
}

.primitive-back-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 338px minmax(0, 1fr);
  gap: 40px;
  align-items: end;
  padding: 8px 38px 20px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.68);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.16), rgba(17, 24, 39, 0.34)),
    rgba(255, 250, 242, 0.03);
}

.primitive-base-combat {
  align-self: end;
  width: 338px;
  margin: 0;
  gap: 0;
}

.primitive-base-combat div {
  min-height: 134px;
  align-content: end;
}

.primitive-base-combat .combat-stat-icon,
.primitive-base-combat .combat-stat-icon img {
  width: 124px;
  height: 124px;
}

.primitive-base-combat dt {
  font-size: 0.52rem;
}

.primitive-base-combat dd {
  color: #fffaf2;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 3.08rem;
  font-weight: 950;
  text-shadow:
    -3px -3px 0 rgba(17, 24, 39, 0.94),
    3px -3px 0 rgba(17, 24, 39, 0.94),
    -3px 3px 0 rgba(17, 24, 39, 0.94),
    3px 3px 0 rgba(17, 24, 39, 0.94),
    0 0 13px rgba(255, 250, 242, 0.48);
}

.primitive-back-trait-grid {
  align-self: center;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
}

.primitive-trait-tile {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0 1px;
}

.primitive-trait-tile > span {
  font-size: 0.66rem;
}

.primitive-trait-tile .primitive-cheat-art {
  width: 70px;
  height: 70px;
  border: 0;
  background: rgba(17, 24, 39, 0.62);
  box-shadow:
    0 0 0 1px rgba(255, 250, 242, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.26);
}

.primitive-trait-tile .primitive-cheat-art img {
  width: 70px;
  height: 70px;
  filter:
    saturate(1.08)
    drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

.primitive-accessory-frame {
  --accessory-frame-size: 86px;
  --accessory-icon-size: 72px;
  position: relative;
  width: var(--accessory-frame-size);
  height: var(--accessory-frame-size);
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.primitive-accessory-level-frame,
.primitive-accessory-frame-icon {
  grid-area: 1 / 1;
  object-fit: contain;
  pointer-events: none;
}

.primitive-accessory-level-frame {
  z-index: 1;
  width: var(--accessory-frame-size);
  height: var(--accessory-frame-size);
  background-image: url("/public/assets/card-icons/accessory-backplate-empty-gold-v1.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter:
    hue-rotate(var(--accessory-hue, 0deg))
    saturate(var(--accessory-saturation, 1.05))
    brightness(var(--accessory-brightness, 0.92))
    drop-shadow(0 0 var(--accessory-glow-size, 10px) rgba(255, 176, 46, var(--accessory-glow, 0.28)))
    drop-shadow(0 10px 18px rgba(0, 0, 0, 0.42));
}

.primitive-accessory-frame.is-boost-0 .primitive-accessory-level-frame {
  --accessory-hue: -18deg;
  --accessory-saturation: 0.58;
  --accessory-brightness: 0.74;
  --accessory-glow: 0.08;
  --accessory-glow-size: 6px;
}

.primitive-accessory-frame.is-boost-1 .primitive-accessory-level-frame {
  --accessory-hue: -8deg;
  --accessory-saturation: 0.78;
  --accessory-brightness: 0.84;
  --accessory-glow: 0.16;
  --accessory-glow-size: 8px;
}

.primitive-accessory-frame.is-boost-2 .primitive-accessory-level-frame {
  --accessory-hue: 0deg;
  --accessory-saturation: 1.05;
  --accessory-brightness: 0.94;
  --accessory-glow: 0.28;
  --accessory-glow-size: 10px;
}

.primitive-accessory-frame.is-boost-3 .primitive-accessory-level-frame {
  --accessory-hue: 8deg;
  --accessory-saturation: 1.3;
  --accessory-brightness: 1.04;
  --accessory-glow: 0.42;
  --accessory-glow-size: 14px;
}

.primitive-accessory-frame.is-boost-4 .primitive-accessory-level-frame {
  --accessory-hue: 14deg;
  --accessory-saturation: 1.48;
  --accessory-brightness: 1.12;
  --accessory-glow: 0.58;
  --accessory-glow-size: 18px;
}

.primitive-accessory-frame.is-boost-5 .primitive-accessory-level-frame {
  --accessory-hue: 20deg;
  --accessory-saturation: 1.72;
  --accessory-brightness: 1.22;
  --accessory-glow: 0.72;
  --accessory-glow-size: 22px;
}

.primitive-accessory-frame-icon {
  z-index: 4;
  width: var(--accessory-icon-size);
  height: var(--accessory-icon-size);
  filter:
    contrast(1.08)
    drop-shadow(0 5px 8px rgba(0, 0, 0, 0.42));
}

.primitive-accessory-frame.is-rasterized .primitive-accessory-frame-icon {
  width: var(--accessory-frame-size);
  height: var(--accessory-frame-size);
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.42));
  object-fit: contain;
}

.primitive-accessory-frame.is-rasterized::after {
  display: none;
}

.primitive-story-quote {
  position: relative;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  margin: 18px 38px 0;
  padding: 22px 24px;
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.12), rgba(17, 24, 39, 0.28)),
    rgba(255, 250, 242, 0.06);
}

.primitive-story-quote h4 {
  position: relative;
  z-index: 2;
  margin: 0;
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.86),
    0 0 8px rgba(149, 241, 223, 0.44);
}

.primitive-story-quote p {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  margin: 0;
  overflow: hidden;
  color: #fffaf2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: 0;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.72),
    0 0 12px rgba(255, 250, 242, 0.12);
}

.primitive-story-quote p::before {
  content: open-quote;
}

.primitive-story-quote p::after {
  content: close-quote;
}

.primitive-story-quote footer {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 3px;
  justify-items: end;
  color: rgba(255, 250, 242, 0.78);
  font-size: 0.82rem;
  font-style: normal;
  line-height: 1.2;
  text-align: right;
}

.primitive-contract-signature {
  position: absolute;
  left: var(--signature-x, 62%);
  bottom: 56px;
  z-index: 1;
  max-width: 230px;
  color: var(--signature-color, #fffaf2);
  font-family: "Brush Script MT", "Segoe Script", "Lucida Handwriting", cursive;
  font-size: calc(5.1rem * var(--signature-scale, 1));
  font-style: italic;
  font-weight: var(--signature-weight, 500);
  letter-spacing: var(--signature-spacing, 0);
  line-height: 0.9;
  opacity: 0.28;
  pointer-events: none;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.38),
    0 0 10px color-mix(in srgb, var(--signature-color, #fffaf2), transparent 64%);
  transform: translateX(-50%) rotate(var(--signature-angle, 0deg));
  transform-origin: center;
  white-space: nowrap;
}

.primitive-contract-signature.is-print,
.primitive-contract-signature.is-standard {
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: calc(3.4rem * var(--signature-scale, 1));
  font-style: normal;
  opacity: 0.22;
}

.primitive-contract-signature.is-angular {
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-style: italic;
}

.primitive-contract-signature.is-underlined {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.primitive-contract-signature.is-symbol-marked::after {
  content: " *";
}

.primitive-story-quote footer strong {
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(149, 241, 223, 0.28);
}

.primitive-bio-button {
  position: relative;
  z-index: 4;
  justify-self: start;
  min-width: 78px;
  padding: 7px 14px 8px;
  border: 1px solid rgba(255, 216, 111, 0.62);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 216, 111, 0.22), rgba(149, 241, 223, 0.1)),
    rgba(17, 24, 39, 0.72);
  color: #fffaf2;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.92),
    0 0 8px rgba(255, 216, 111, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 242, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.primitive-contract-buttons {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-self: start;
}

.primitive-contract-buttons .primitive-bio-button {
  justify-self: auto;
}

.primitive-attribute-button {
  border-color: rgba(149, 241, 223, 0.56);
  background:
    linear-gradient(135deg, rgba(149, 241, 223, 0.2), rgba(255, 216, 111, 0.08)),
    rgba(17, 24, 39, 0.72);
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.92),
    0 0 8px rgba(149, 241, 223, 0.3);
}

.primitive-bio-button:hover,
.primitive-bio-button:focus-visible {
  border-color: rgba(149, 241, 223, 0.9);
  color: #95f1df;
  outline: none;
  transform: translateY(-1px);
}

.primitive-back-skill-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  padding: 18px 38px 14px;
}

.primitive-back-skill-copy article {
  min-width: 0;
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 8px 2px;
  align-items: start;
  padding: 20px 24px;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(149, 241, 223, 0.1), rgba(255, 250, 242, 0.07)),
    rgba(17, 24, 39, 0.34);
}

.primitive-skill-panel-head {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
}

.primitive-skill-panel-head > span {
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.86),
    0 0 8px rgba(149, 241, 223, 0.44);
}

.primitive-skill-panel-head > strong {
  min-width: 0;
  color: #fffaf2;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.92rem;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 2px 0 rgba(17, 24, 39, 0.72);
}

.primitive-back-skill-copy .primitive-icon-button {
  justify-self: center;
  align-self: center;
  width: 82px;
  height: 82px;
}

.primitive-back-skill-copy .primitive-icon-button img {
  width: 82px;
  height: 82px;
}

.primitive-back-skill-copy article > b {
  align-self: center;
  justify-self: center;
  transform: translateX(-22px);
  margin: 0;
  color: #ffc928;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 1.5rem;
  font-weight: 950;
  line-height: 1.16;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 rgba(17, 24, 39, 0.76),
    0 0 12px rgba(255, 201, 40, 0.24);
}

.primitive-buzz-link {
  align-self: center;
  justify-self: center;
  width: 48px;
  height: 48px;
  margin-bottom: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.54), transparent 34%),
    linear-gradient(145deg, #ffe38a, #c69219);
  box-shadow:
    0 0 0 1px rgba(255, 250, 242, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.primitive-buzz-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 34%;
  border-radius: 50%;
  transform: scale(1.45);
}

.primitive-buzz-link:focus-visible {
  outline: 2px solid #95f1df;
  outline-offset: 3px;
}

.primitive-cheatsheet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.primitive-cheat {
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 5px;
  align-items: center;
  justify-items: center;
  padding: 8px 6px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  text-align: center;
}

.primitive-cheat strong {
  grid-row: 1 / span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.72);
  color: #ffecc8;
  font-size: 0.64rem;
  font-weight: 950;
}

.primitive-cheat-art,
.accessory-list-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.62);
  box-shadow: none;
}

.primitive-cheat-art img,
.accessory-list-icon img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.32));
}

.accessory-list-icon {
  grid-row: 1 / span 2;
  width: 32px;
  height: 32px;
}

.accessory-list-icon img {
  width: 31px;
  height: 31px;
}

.primitive-cheat-art:focus-visible,
.accessory-list-icon:focus-visible,
.primitive-icon-button:focus-visible {
  outline: 2px solid #95f1df;
  outline-offset: 3px;
}

.primitive-cheat span,
.primitive-cheat em {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
  line-height: 1.1;
}

.primitive-cheat span {
  color: #95f1df;
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.primitive-cheat em {
  color: #fffaf2;
  font-size: 0.9rem;
  font-weight: 850;
}

.accessory-list-head {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
}

.primitive-zone-map {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.primitive-zone-map span {
  padding: 6px 8px;
  color: #ffecc8;
}

.mode-card,
.lobby-panel,
.battle-board,
.club-panel,
.roster-card,
.result-panel {
  border: 1px solid rgba(28, 58, 65, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 20px 60px rgba(43, 80, 82, 0.13);
}

.game .battle-board,
.game .club-panel,
.game .roster-card,
.game .result-panel {
  border-color: rgba(255, 250, 242, 0.13);
  background: rgba(17, 22, 30, 0.78);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(10px);
}

.mode-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  text-align: left;
}

.mode-card.is-active,
.mode-card.is-live {
  border-color: rgba(34, 148, 129, 0.5);
}

.mode-card.is-active {
  box-shadow:
    inset 0 0 0 2px rgba(34, 148, 129, 0.18),
    0 20px 60px rgba(43, 80, 82, 0.13);
}

.lobby-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.setup-label {
  margin: 0;
  color: #177968;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.lobby-control-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.play-mode-picker,
.lobby-secondary-actions,
.lobby-utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.play-mode-picker button,
.lobby-secondary-actions button,
.lobby-utility-actions button {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(28, 58, 65, 0.18);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.92);
  color: #211926;
  font-weight: 900;
}

.play-mode-picker button.is-active {
  border-color: rgba(34, 148, 129, 0.52);
  background: #177968;
  color: #fffaf2;
}

.mode-description {
  margin: 0;
  color: #5e5960;
  font-size: 0.92rem;
}

.lobby-utility-actions {
  padding-top: 2px;
}

.lobby-utility-actions .quiet-button {
  background: rgba(17, 24, 39, 0.78);
  color: #fffaf2;
}

.mode-card span,
.eyebrow {
  color: #177968;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-card strong {
  font-size: 1.32rem;
}

.mode-card p,
.topbar p,
.club-panel p,
.collection-head p {
  color: #5e5960;
}

.game {
  position: relative;
  height: 100dvh;
  min-height: 680px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
  padding: 12px;
  color: #fffaf2;
  background:
    linear-gradient(180deg, rgba(12, 14, 20, 0.44), rgba(12, 14, 20, 0.92)),
    url("../public/assets/cards/welcome-wagon-tier1-v1.png") center 20% / cover fixed;
}

.game::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 236, 200, 0.28), transparent 30%),
    linear-gradient(90deg, rgba(7, 13, 18, 0.86), transparent 28%, transparent 72%, rgba(7, 13, 18, 0.82));
}

.game.stage-first-hello {
  background:
    linear-gradient(180deg, rgba(12, 14, 20, 0.3), rgba(12, 14, 20, 0.9)),
    url("../public/assets/cards/welcome-brightside-tier1-v1.png") center 18% / cover fixed;
}

.game.stage-event-3 {
  background:
    linear-gradient(180deg, rgba(12, 14, 20, 0.34), rgba(12, 14, 20, 0.92)),
    url("../public/assets/cards/welcome-flecto-tier2-v1.png") center 16% / cover fixed;
}

.game.stage-event-6 {
  background:
    linear-gradient(180deg, rgba(12, 14, 20, 0.34), rgba(12, 14, 20, 0.92)),
    url("../public/assets/cards/welcome-clipboard-tier2-v1.png") center 18% / cover fixed;
}

.game.stage-event-9,
.game.stage-champion {
  background:
    linear-gradient(180deg, rgba(12, 14, 20, 0.26), rgba(12, 14, 20, 0.94)),
    url("../public/assets/cards/welcome-the-word-tier3-v1.png") center 16% / cover fixed;
}

.topbar,
.collection-head,
.board-head,
.result-head,
.action-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.topbar,
.stage-tabs,
.route-tabs,
.story-intro,
.play-layout,
.collection-band {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  max-width: 1240px;
  margin-inline: auto;
}

.game .topbar {
  padding: 12px 14px;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  background: rgba(14, 18, 24, 0.68);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.26);
}

.game.is-table-focus {
  height: 100dvh;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  padding: 8px;
}

.game.is-intro-active {
  grid-template-rows: minmax(0, 1fr);
  padding: 8px;
}

.game.is-table-focus .topbar {
  display: none;
}

.game.is-intro-active .topbar p {
  display: none;
}

.game.is-intro-active .topbar {
  display: none;
}

.game .topbar p,
.game .collection-head p,
.game .club-panel p,
.game .action-row p {
  color: #ffecc8;
}

.topbar h2,
.board-head h2 {
  margin: 5px 0 8px;
  font-size: clamp(1.8rem, 4.2vw, 3.25rem);
  line-height: 0.98;
}

.reset-button {
  padding: 0 16px;
  background: #211926;
  color: #fffaf2;
}

.quiet-button {
  padding: 0 14px;
  border: 1px solid rgba(33, 25, 38, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: #211926;
}

.stage-tabs,
.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.route-tabs {
  align-items: stretch;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.stage-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.stage-tab {
  flex: 0 0 auto;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.7);
  color: #26645d;
}

.route-tab {
  flex: 0 0 auto;
  min-width: 150px;
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #26645d;
}

.route-tab strong,
.route-tab span {
  display: block;
}

.route-tab span {
  font-size: 0.74rem;
  color: #7c536a;
}

.stage-tab.is-active,
.route-tab.is-active {
  background: #177968;
  color: #fffaf2;
}

.route-tab.is-active span {
  color: #d8fff5;
}

.route-tab.is-locked {
  background: rgba(255, 255, 255, 0.46);
  color: #8a8289;
  box-shadow: none;
}

.route-tab.is-locked span {
  color: #9d7e8f;
}

.topbar-actions,
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.story-intro {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 0;
}

.scene-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(13, 15, 22, 0.05), rgba(13, 15, 22, 0.5)),
    var(--scene-backdrop, url("../public/assets/cards/welcome-wagon-tier0-v1.png")) var(--scene-focus, center 20%) / cover;
  box-shadow: inset 0 0 0 1px rgba(33, 25, 38, 0.12);
  transition: background-position 220ms ease, filter 220ms ease;
}

.scene-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(11, 13, 18, 0.72), rgba(11, 13, 18, 0.14) 44%, rgba(11, 13, 18, 0.72)),
    rgba(16, 26, 28, 0.28);
}

.scene-character {
  position: absolute;
  z-index: 1;
  bottom: 0;
  width: min(34vw, 390px);
  opacity: 0.62;
  transform: translateY(18px) scale(0.96);
  transform-origin: 50% 100%;
  transition:
    opacity 520ms cubic-bezier(0.22, 0.8, 0.28, 1),
    filter 520ms cubic-bezier(0.22, 0.8, 0.28, 1),
    transform 520ms cubic-bezier(0.22, 0.8, 0.28, 1);
}

.scene-character.is-host {
  left: 8%;
}

.scene-character.is-lead {
  right: 8%;
}

.scene-character.is-speaking {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: brightness(1.08) saturate(1.04);
  animation: expression-sustain 3200ms ease both;
}

.scene-character.is-listening {
  filter: brightness(0.86) saturate(0.88);
  animation: listening-sustain 3200ms ease both;
}

.story-intro[data-beat="1"] .scene-character.is-host.is-speaking {
  transform: translateY(-4px) scale(1.02) rotate(-1deg);
}

.story-intro[data-beat="1"] .scene-character.is-lead.is-listening {
  transform: translateY(15px) scale(0.95) rotate(1deg);
}

.story-intro[data-beat="2"] .scene-character.is-lead.is-speaking {
  transform: translateY(-5px) scale(1.03) rotate(1deg);
}

.story-intro[data-beat="2"] .scene-character.is-host.is-listening {
  transform: translateY(20px) scale(0.95) rotate(-1deg);
}

.story-intro[data-beat="3"] .scene-character.is-speaking {
  transform: translateY(-2px) scale(1.04);
}

.scene-character img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: cover;
  object-position: 50% 18%;
  border-radius: 8px 8px 0 0;
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.34));
  transition:
    filter 180ms ease,
    object-position 180ms ease,
    transform 180ms ease;
}

.scene-character.gesture-point img {
  object-position: 45% 14% !important;
  transform: scale(1.08);
}

.scene-character.gesture-open img {
  object-position: 55% 18% !important;
  transform: scale(1.06);
}

.scene-character.gesture-think img {
  object-position: 50% 12% !important;
  transform: scale(1.08) rotate(-0.5deg);
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.34)) saturate(0.92);
}

.scene-character.gesture-ready img {
  object-position: 50% 10% !important;
  transform: scale(1.1);
  filter: drop-shadow(0 28px 46px rgba(0, 0, 0, 0.38)) brightness(1.08);
}

.scene-character.gesture-react img,
.scene-character.gesture-listen img {
  object-position: 50% 22% !important;
  transform: scale(0.96);
}

.scene-character span {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  color: #fffaf2;
  font-size: 0.82rem;
  font-weight: 900;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}

.dialogue-box {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  width: min(880px, calc(100% - 32px));
  max-height: calc(100% - 36px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 18px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  border: 1px solid rgba(33, 25, 38, 0.12);
  color: #211926;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.22);
  animation: dialogue-pop 180ms ease both;
}

.dialogue-box strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 1.25rem;
}

.dialogue-box p {
  margin-bottom: 14px;
  color: #433946;
  font-size: clamp(1.02rem, 2vw, 1.22rem);
}

.intro-card {
  overflow: hidden;
  border-radius: 8px;
  background: #211926;
  color: #fffaf2;
  box-shadow: 0 28px 90px rgba(43, 80, 82, 0.24);
}

.intro-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.intro-card div {
  padding: 16px;
}

.intro-card span {
  color: #95f1df;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.intro-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.6rem;
}

.intro-card p {
  margin: 6px 0 0;
  color: #ffecc8;
}

.play-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  margin-top: 0;
  overflow: hidden;
}

.play-layout.is-battle-active {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
}

.play-layout.is-battle-active .battle-board {
  width: min(100%, 1120px);
  height: 100%;
  max-height: 100%;
  margin-inline: auto;
  display: grid;
  align-content: center;
  padding: 14px;
  overflow: hidden;
}

.play-layout.is-battle-active .battle-arena {
  height: 100%;
  min-height: 0;
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "board"
    "actions"
    "hand";
  align-content: stretch;
  gap: 12px;
  overflow: hidden;
}

.play-layout.is-battle-active .arena-head {
  display: none;
}

.play-layout.is-battle-active .match-board {
  grid-area: board;
  min-height: 0;
  overflow: hidden;
}

.play-layout.is-battle-active .arena-table {
  display: none;
}

.play-layout.is-battle-active .arena-actions {
  grid-area: actions;
  position: relative;
  z-index: 2;
}

.play-layout.is-battle-active .arena-hand {
  grid-area: hand;
  align-self: end;
  margin-top: 0;
  padding-top: 16px;
  position: relative;
  z-index: 1;
}

.play-layout.is-battle-active .arena-log {
  display: none;
}

.play-layout.is-battle-active .arena-table {
  min-height: 0;
}

.play-layout.is-battle-active .arena-vs {
  max-height: clamp(210px, 44dvh, 390px);
  overflow: auto;
  scrollbar-width: thin;
}

.play-layout.is-battle-active .opponent-pocket-card {
  height: clamp(78px, 15dvh, 118px);
}

.play-layout.is-battle-active .battle-steps span {
  min-height: 22px;
}

.play-layout.is-battle-active .bout-slot {
  min-height: 60px;
  padding: 7px;
}

.play-layout.is-battle-active .coach-tip {
  padding: 6px 8px;
}

.play-layout.is-battle-active .clash-banner {
  min-height: 64px;
  padding: 8px;
}

.play-layout.is-battle-active .clash-banner.is-preview {
  min-height: 74px;
}

.play-layout.is-battle-active .arena-hand {
  min-height: 118px;
}

.play-layout.is-battle-active .hand-card {
  width: 76px;
  min-height: 92px;
}

.battle-board,
.club-panel {
  min-height: 0;
  padding: 20px;
  overflow: auto;
  scrollbar-width: thin;
}

.field-row,
.lineup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.turn-guide {
  display: grid;
  grid-template-columns: auto minmax(0, 0.55fr) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(149, 241, 223, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(149, 241, 223, 0.14), rgba(255, 250, 242, 0.05)),
    rgba(12, 16, 24, 0.76);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.04);
}

.turn-guide span {
  color: #95f1df;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.turn-guide strong {
  color: #fffaf2;
  font-size: 1.05rem;
}

.turn-guide p {
  margin: 0;
  color: #ffecc8;
  line-height: 1.3;
}

.battle-arena {
  min-height: 0;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 18%, rgba(149, 241, 223, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(10, 16, 24, 0.86), rgba(24, 18, 32, 0.9));
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.04),
    0 24px 70px rgba(0, 0, 0, 0.28);
}

.arena-head,
.arena-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.arena-head h3 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
}

#battleScore {
  min-width: 86px;
  padding: 10px 12px;
  border: 1px solid rgba(149, 241, 223, 0.28);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  color: #95f1df;
  text-align: center;
}

.match-board {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.08), rgba(255, 250, 242, 0.03)),
    rgba(6, 10, 16, 0.54);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.04);
}

.phase-ready .match-board {
  animation: table-commit 360ms ease both;
}

.phase-revealed .match-board {
  animation: table-reveal 460ms ease both;
}

.phase-resolved .match-board {
  animation: table-settle 520ms ease both;
}

.match-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  background: rgba(12, 16, 24, 0.72);
}

.battle-arena .match-side,
.battle-arena .committed-row {
  display: none;
}

.match-side span,
.committed-row > span {
  display: block;
  color: #95f1df;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.match-side strong {
  display: block;
  margin-top: 2px;
  color: #fffaf2;
}

.match-side small {
  color: #ffecc8;
  font-weight: 850;
}

.match-side.is-player {
  border-color: rgba(149, 241, 223, 0.2);
  background:
    linear-gradient(180deg, rgba(149, 241, 223, 0.14), rgba(149, 241, 223, 0.03)),
    rgba(12, 16, 24, 0.76);
}

.opponent-hand {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.opponent-pocket-card {
  height: clamp(92px, 18dvh, 152px);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-content: stretch;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(255, 250, 242, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(140deg, rgba(173, 120, 152, 0.2), rgba(149, 241, 223, 0.08)),
    rgba(12, 16, 24, 0.72);
  color: #95f1df;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.opponent-pocket-card.is-masked::before {
  content: "?";
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
}

.opponent-pocket-card img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.88);
}

.opponent-pocket-card span,
.opponent-pocket-card small {
  display: block;
  padding: 0 7px;
}

.opponent-pocket-card span {
  margin-top: 6px;
}

.opponent-pocket-card small {
  margin: 2px 0 7px;
  color: #ffecc8;
  font-size: 0.58rem;
}

.opponent-pocket-card.is-known,
.opponent-pocket-card.is-current {
  border-color: rgba(255, 236, 200, 0.5);
  background:
    linear-gradient(180deg, rgba(255, 236, 200, 0.22), rgba(149, 241, 223, 0.08)),
    rgba(12, 16, 24, 0.76);
  color: #fffaf2;
}

.opponent-pocket-card.is-current {
  box-shadow:
    0 0 0 1px rgba(255, 236, 200, 0.2),
    0 0 26px rgba(255, 236, 200, 0.28);
  animation: table-focus-pulse 1400ms ease-in-out infinite;
}

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

.battle-steps span {
  min-height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.06);
  color: rgba(255, 250, 242, 0.7);
  font-size: 0.58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.battle-steps .is-active {
  border-color: rgba(255, 236, 200, 0.7);
  background: rgba(255, 236, 200, 0.16);
  color: #ffecc8;
  box-shadow: 0 0 18px rgba(255, 236, 200, 0.18);
}

.battle-steps .is-done {
  border-color: rgba(149, 241, 223, 0.38);
  color: #95f1df;
}

.bout-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bout-slot {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px dashed rgba(149, 241, 223, 0.22);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.05);
  text-align: center;
}

.bout-slot span {
  color: #95f1df;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.bout-slot strong {
  font-size: 1rem;
}

.bout-slot small {
  overflow: hidden;
  color: #ffecc8;
  font-size: 0.74rem;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.bout-slot.is-active {
  border-style: solid;
  border-color: rgba(255, 236, 200, 0.76);
  background:
    linear-gradient(180deg, rgba(255, 236, 200, 0.18), rgba(149, 241, 223, 0.08)),
    rgba(255, 250, 242, 0.08);
  box-shadow: 0 0 28px rgba(255, 236, 200, 0.18);
  animation: active-bout-pulse 1400ms ease-in-out infinite;
}

.bout-slot.is-won {
  border-style: solid;
  border-color: rgba(149, 241, 223, 0.64);
  background: rgba(149, 241, 223, 0.12);
}

.bout-slot.is-lost {
  border-style: solid;
  border-color: rgba(173, 120, 152, 0.72);
  background: rgba(173, 120, 152, 0.12);
}

.bout-slot.is-just-resolved {
  animation: bout-lock 520ms ease both;
}

.coach-tip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(149, 241, 223, 0.12), rgba(255, 236, 200, 0.06)),
    rgba(12, 16, 24, 0.76);
}

.coach-tip span {
  color: #95f1df;
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
}

.coach-tip strong {
  min-width: 0;
  overflow: hidden;
  color: #ffecc8;
  font-size: 0.74rem;
  line-height: 1.18;
  text-overflow: ellipsis;
}

.coach-tip.has-playbook {
  align-items: start;
}

.coach-playbook {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.coach-playbook strong {
  display: block;
}

.coach-chips,
.preview-coach {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.coach-chips b,
.preview-coach span {
  min-width: 0;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 999px;
  background: rgba(6, 10, 16, 0.48);
  color: #fffaf2;
  font-size: 0.58rem;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.coach-chips b:nth-child(2),
.preview-coach span:first-child {
  border-color: rgba(255, 236, 200, 0.34);
  color: #ffecc8;
}

.coach-chips b:nth-child(3),
.preview-coach span:nth-child(2) {
  border-color: rgba(149, 241, 223, 0.34);
  color: #95f1df;
}

.clash-banner {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-height: 76px;
  padding: 11px;
  border: 1px solid rgba(255, 236, 200, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 236, 200, 0.22), transparent 58%),
    rgba(255, 250, 242, 0.07);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.04);
}

.clash-banner span {
  color: #95f1df;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.clash-banner strong {
  color: #fffaf2;
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1;
}

.clash-banner small {
  color: #ffecc8;
  font-weight: 850;
}

.clash-banner.is-revealed {
  animation: lane-flash 420ms ease both;
}

.phase-revealed .clash-banner {
  box-shadow:
    inset 0 0 0 1px rgba(149, 241, 223, 0.08),
    0 0 38px rgba(149, 241, 223, 0.14);
}

.clash-banner.is-resolved {
  border-color: rgba(149, 241, 223, 0.42);
  animation: result-pop 520ms ease both;
}

.clash-banner.is-guiding {
  border-color: rgba(255, 236, 200, 0.24);
  background:
    linear-gradient(90deg, rgba(255, 236, 200, 0.12), rgba(149, 241, 223, 0.07)),
    rgba(255, 250, 242, 0.06);
}

.clash-banner.is-ready {
  animation: lane-flash 520ms ease both;
}

.clash-banner.is-preview {
  min-height: 88px;
}

.clash-banner.is-favored {
  border-color: rgba(149, 241, 223, 0.52);
  box-shadow:
    inset 0 0 0 1px rgba(149, 241, 223, 0.1),
    0 0 34px rgba(149, 241, 223, 0.16);
}

.clash-banner.is-close {
  border-color: rgba(255, 236, 200, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 236, 200, 0.08),
    0 0 30px rgba(255, 236, 200, 0.13);
}

.clash-banner.is-risky {
  border-color: rgba(173, 120, 152, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(173, 120, 152, 0.08),
    0 0 30px rgba(173, 120, 152, 0.16);
}

.preview-line {
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 7px;
}

.preview-line b,
.preview-line em {
  min-width: 0;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 999px;
  background: rgba(6, 10, 16, 0.52);
  color: #fffaf2;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 950;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.preview-line em {
  border-color: rgba(149, 241, 223, 0.34);
  color: #95f1df;
}

.clash-scoreline {
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 7px;
}

.clash-scoreline b,
.clash-scoreline em {
  min-width: 0;
  overflow: hidden;
  padding: 5px 7px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.07);
  color: #fffaf2;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clash-scoreline em {
  border-color: rgba(149, 241, 223, 0.3);
  color: #95f1df;
  text-transform: uppercase;
}

.clash-banner .math-chips {
  max-width: min(100%, 620px);
  margin-top: 2px;
}

.clash-banner .math-chips span {
  border-color: rgba(149, 241, 223, 0.34);
  background: rgba(6, 10, 16, 0.78);
  color: #95f1df;
  padding: 4px 7px;
  font-size: 0.62rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.48);
}

.clash-banner .reveal-chips span {
  animation: none;
}

.clash-banner.is-player-winning {
  box-shadow:
    inset 0 0 0 1px rgba(149, 241, 223, 0.08),
    0 0 34px rgba(149, 241, 223, 0.18);
}

.clash-banner.is-opponent-winning {
  border-color: rgba(173, 120, 152, 0.46);
  box-shadow:
    inset 0 0 0 1px rgba(173, 120, 152, 0.08),
    0 0 34px rgba(173, 120, 152, 0.18);
}

.committed-row {
  display: grid;
  gap: 7px;
}

#committedCards {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.queued-card,
.committed-card {
  flex: 0 0 auto;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
}

.queued-card {
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 900;
}

.committed-card {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 5px;
  font-size: 0.76rem;
  font-weight: 900;
}

.committed-card img {
  width: 30px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
}

.scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 8px;
}

.scoreline b {
  font-size: 1.35rem;
}

.scoreline small {
  color: #ffecc8;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.score-pips {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-top: 6px;
}

.score-pips span {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 250, 242, 0.26);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.1);
}

.score-pips .is-current {
  border-color: #ffecc8;
  background: #ffecc8;
  box-shadow: 0 0 18px rgba(255, 236, 200, 0.55);
}

.score-pips .is-won {
  border-color: #95f1df;
  background: #95f1df;
}

.score-pips .is-lost {
  border-color: #ad7898;
  background: #ad7898;
}

.arena-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.58fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.phase-choose .arena-table {
  display: none;
}

.phase-resolved .arena-table,
.phase-complete .arena-table {
  display: none;
}

.arena-slot {
  min-height: clamp(165px, 25dvh, 240px);
  display: grid;
  place-items: center;
}

.arena-vs {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px;
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  text-align: center;
}

.arena-vs span {
  color: #95f1df;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arena-vs strong {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.9;
}

.arena-vs small {
  color: #ffecc8;
  line-height: 1.45;
}

.phase-revealed .arena-vs,
.phase-resolved .arena-vs {
  box-shadow:
    0 0 0 1px rgba(149, 241, 223, 0.25),
    0 18px 50px rgba(149, 241, 223, 0.12);
}

.phase-revealed .arena-slot .table-card {
  animation: card-flip-in 360ms ease both;
}

.phase-resolved.is-player-winning .arena-slot:first-child .table-card,
.phase-resolved.is-opponent-winning .arena-slot.is-opponent .table-card {
  border-color: rgba(149, 241, 223, 0.72);
  box-shadow:
    0 0 0 1px rgba(149, 241, 223, 0.18),
    0 28px 70px rgba(149, 241, 223, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.34);
  animation: winner-card 520ms ease both;
}

.table-card {
  position: relative;
  width: min(165px, 100%);
  overflow: hidden;
  border: 1px solid rgba(149, 241, 223, 0.28);
  border-radius: 8px;
  background: #211926;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 250, 242, 0.05);
  transform: rotate(-1.5deg);
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.arena-slot.is-opponent .table-card {
  transform: rotate(1.5deg);
}

.table-card:not(.is-facedown) {
  animation: card-pop 220ms ease both;
}

.table-card.is-facedown {
  animation: card-commit 240ms ease both;
}

.table-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.table-card.is-facedown img {
  filter: brightness(0.18) saturate(0.6);
}

.table-card.is-facedown::before {
  content: "B3";
  position: absolute;
  inset: 10px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(149, 241, 223, 0.34);
  border-radius: 6px;
  color: #95f1df;
  font-size: 3rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  background:
    linear-gradient(135deg, rgba(149, 241, 223, 0.12), transparent),
    rgba(12, 16, 24, 0.82);
}

.table-card div {
  position: relative;
  z-index: 1;
  padding: 10px;
}

.table-card span,
.table-card small {
  display: block;
  color: #95f1df;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.table-card strong {
  display: block;
  margin: 3px 0;
}

.table-card small {
  color: #ffecc8;
  text-transform: none;
}

.arena-actions {
  position: relative;
  z-index: 1;
  justify-content: center;
  margin-top: 0;
}

.arena-actions p {
  display: none;
}

.phase-choose #advanceBattle:disabled {
  opacity: 1;
  background: rgba(255, 236, 200, 0.08);
  color: #ffecc8;
  box-shadow: inset 0 0 0 1px rgba(255, 236, 200, 0.14);
}

.phase-idle #advanceBattle,
.phase-ready #advanceBattle,
.phase-revealed #advanceBattle,
.phase-resolved #advanceBattle,
.action-row .reset-button:not(:disabled) {
  box-shadow:
    0 0 0 1px rgba(149, 241, 223, 0.2),
    0 0 28px rgba(149, 241, 223, 0.18);
}

.phase-ready #advanceBattle,
.phase-revealed #advanceBattle,
.phase-resolved #advanceBattle {
  animation: action-ready-pulse 1180ms ease-in-out infinite;
}

.guidance-guided .focus-start .arena-actions,
.guidance-guided .focus-pick .arena-hand,
.guidance-guided .focus-reveal .arena-actions,
.guidance-guided .focus-score .clash-banner,
.guidance-guided .focus-lock .arena-actions,
.guidance-guided .focus-next .arena-actions,
.guidance-assisted .focus-pick .hand-card.is-previewed,
.guidance-assisted .focus-reveal .arena-actions,
.guidance-assisted .focus-score .clash-banner {
  position: relative;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(255, 236, 200, 0.58),
    0 0 34px rgba(255, 236, 200, 0.28),
    0 16px 46px rgba(0, 0, 0, 0.26);
}

.guidance-guided .focus-pick .opponent-pocket-card.is-current,
.guidance-assisted .focus-pick .opponent-pocket-card.is-current {
  box-shadow:
    0 0 0 2px rgba(255, 236, 200, 0.58),
    0 0 34px rgba(255, 236, 200, 0.3);
}

.clash-callout {
  display: grid;
  gap: 5px;
}

.clash-callout span {
  color: #95f1df;
}

.clash-callout strong {
  font-size: clamp(1.5rem, 3vw, 2.7rem);
}

.clash-callout.is-final strong {
  color: #95f1df;
}

.score-swing {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.score-swing b {
  min-width: 64px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  line-height: 1;
}

.score-swing b:not(.is-leading) {
  animation: score-bump 360ms ease both;
}

.score-swing b.is-leading {
  border-color: rgba(149, 241, 223, 0.58);
  color: #95f1df;
  box-shadow: 0 0 26px rgba(149, 241, 223, 0.18);
  animation: score-bump 420ms ease both;
}

.score-swing em {
  color: #ffecc8;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.effect-stack {
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px auto 0;
}

.effect-side {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(6, 10, 16, 0.48);
}

.effect-side > strong {
  overflow: hidden;
  color: #fffaf2;
  font-size: 0.66rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.effect-row {
  display: grid;
  grid-template-columns: minmax(54px, 0.85fr) minmax(44px, 1fr) minmax(34px, auto);
  align-items: center;
  gap: 6px;
  opacity: 0.42;
  color: #ffecc8;
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.effect-row span,
.effect-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.effect-row i {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.1);
}

.effect-row i::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--effect-width, 8%);
  border-radius: inherit;
  background: linear-gradient(90deg, #95f1df, #ffecc8);
  transform: scaleX(0);
  transform-origin: left;
}

.effect-row.is-live {
  opacity: 1;
  animation: effect-row-hit 320ms ease both;
}

.effect-row.is-live i::before {
  animation: effect-bar-grow 520ms ease both;
}

.effect-row.is-debuff {
  color: #ffb8d6;
}

.effect-row.is-debuff i::before {
  background: linear-gradient(90deg, #ad7898, #ffb8d6);
}

.effect-row.is-final {
  color: #95f1df;
}

.effect-row.is-final i::before {
  background: linear-gradient(90deg, #95f1df, #fffaf2);
}

.effect-stack.reveal-step-2 .effect-row:nth-child(4),
.effect-stack.reveal-step-2 .effect-row:nth-child(5) {
  animation-delay: 90ms;
}

.effect-stack.reveal-step-3 .effect-row.is-final {
  animation-delay: 80ms;
}

.math-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  max-width: 330px;
  margin-top: 8px;
}

.math-chips span {
  padding: 3px 6px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

.math-chips .is-total {
  border-color: rgba(149, 241, 223, 0.38);
  color: #95f1df;
}

.reveal-chips span {
  animation: chip-reveal 260ms ease both;
}

.reveal-chips span:nth-child(2) {
  animation-delay: 60ms;
}

.reveal-chips span:nth-child(3) {
  animation-delay: 120ms;
}

.reveal-chips span:nth-child(4) {
  animation-delay: 180ms;
}

.reveal-chips span:nth-child(n + 5) {
  animation-delay: 240ms;
}

.reveal-chips .is-active {
  border-color: rgba(255, 236, 200, 0.42);
  color: #ffecc8;
}

.arena-hand {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.06);
}

.hand-card {
  width: 82px;
  min-height: 112px;
  display: grid;
  align-content: start;
  overflow: hidden;
  padding: 0 0 8px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 8px;
  background: #211926;
  color: #fffaf2;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  transform: translateY(0) rotate(-1deg);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    opacity 140ms ease;
}

.hand-card.is-committed {
  border-color: rgba(255, 236, 200, 0.78);
  box-shadow:
    0 0 0 1px rgba(255, 236, 200, 0.22),
    0 22px 46px rgba(255, 236, 200, 0.14);
  transform: translateY(-12px) scale(1.02);
}

.hand-card.is-previewed {
  border-color: rgba(255, 236, 200, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 236, 200, 0.28),
    0 0 34px rgba(255, 236, 200, 0.24),
    0 22px 46px rgba(0, 0, 0, 0.26);
  transform: translateY(-14px) scale(1.03);
}

.hand-card.is-used {
  opacity: 0.58;
  filter: saturate(0.72);
}

.phase-choose .hand-card.is-recommended {
  border-color: rgba(255, 236, 200, 0.84);
  box-shadow:
    0 0 0 1px rgba(255, 236, 200, 0.24),
    0 0 30px rgba(255, 236, 200, 0.24),
    0 18px 44px rgba(149, 241, 223, 0.16);
  animation: answer-card-pulse 1200ms ease-in-out infinite;
}

.hand-card:nth-child(2) {
  transform: translateY(-8px);
}

.hand-card:nth-child(3) {
  transform: translateY(0) rotate(1deg);
}

.guidance-guided .focus-pick .hand-card.is-previewed,
.guidance-guided .focus-pick .hand-card.is-recommended {
  transform: translateY(-18px) scale(1.05);
}

.hand-card:not(:disabled):hover {
  transform: translateY(-18px) scale(1.03);
  border-color: rgba(149, 241, 223, 0.6);
}

.phase-choose .hand-card:not(:disabled) {
  border-color: rgba(149, 241, 223, 0.55);
  box-shadow:
    0 0 0 1px rgba(149, 241, 223, 0.18),
    0 18px 44px rgba(149, 241, 223, 0.16),
    0 14px 34px rgba(0, 0, 0, 0.22);
}

.play-layout.is-battle-active .hand-card.is-previewed,
.play-layout.is-battle-active .hand-card.is-recommended,
.guidance-guided .play-layout.is-battle-active .focus-pick .hand-card.is-previewed,
.guidance-guided .play-layout.is-battle-active .focus-pick .hand-card.is-recommended {
  transform: translateY(-6px) scale(1.02);
}

#deployCardButton:not([hidden]) {
  min-width: min(260px, 100%);
  background: #177968;
  color: #fffaf2;
  box-shadow:
    0 0 0 1px rgba(255, 236, 200, 0.28),
    0 0 28px rgba(255, 236, 200, 0.22);
  animation: action-ready-pulse 1180ms ease-in-out infinite;
}

.hand-card:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.hand-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 4.6;
  object-fit: cover;
}

.play-layout.is-battle-active .hand-card {
  min-height: 92px;
  padding-bottom: 3px;
}

.play-layout.is-battle-active .hand-card img {
  height: 58px;
  aspect-ratio: auto;
}

.hand-card span,
.hand-card small {
  display: block;
  padding: 0 8px;
  text-align: left;
}

.hand-card span {
  margin-top: 7px;
  font-size: 0.78rem;
  font-weight: 950;
}

.hand-card small {
  color: #95f1df;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.play-layout.is-battle-active .hand-card span {
  margin-top: 3px;
  font-size: 0.62rem;
}

.play-layout.is-battle-active .hand-card small {
  font-size: 0.52rem;
}

.empty-table-card {
  width: min(240px, 100%);
  min-height: 330px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed rgba(149, 241, 223, 0.34);
  border-radius: 8px;
  color: #95f1df;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.arena-log {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: #fffaf2;
  font-size: 0.9rem;
  pointer-events: none;
}

@keyframes card-pop {
  from {
    opacity: 0.7;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
  }
}

@keyframes card-commit {
  from {
    opacity: 0.68;
    transform: translateY(12px) scale(0.96) rotate(-4deg);
  }
  to {
    opacity: 1;
  }
}

@keyframes card-flip-in {
  0% {
    filter: brightness(0.8);
    transform: translateY(6px) rotateY(82deg) scale(0.96);
  }
  64% {
    filter: brightness(1.12);
    transform: translateY(-5px) rotateY(0deg) scale(1.03);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes winner-card {
  0% {
    transform: translateY(0) scale(1) rotate(-1.5deg);
  }
  50% {
    transform: translateY(-10px) scale(1.04) rotate(0deg);
  }
  100% {
    transform: translateY(-4px) scale(1.02) rotate(0deg);
  }
}

@keyframes active-bout-pulse {
  0%,
  100% {
    box-shadow: 0 0 22px rgba(255, 236, 200, 0.14);
  }
  50% {
    box-shadow: 0 0 34px rgba(255, 236, 200, 0.32);
  }
}

@keyframes answer-card-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.16);
  }
}

@keyframes table-focus-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

@keyframes table-commit {
  0% {
    filter: brightness(0.92);
    transform: scale(0.995);
  }
  70% {
    filter: brightness(1.08);
    transform: scale(1.006);
  }
  100% {
    filter: brightness(1);
    transform: scale(1);
  }
}

@keyframes table-reveal {
  0% {
    filter: brightness(0.9) saturate(0.92);
  }
  48% {
    filter: brightness(1.18) saturate(1.16);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

@keyframes table-settle {
  0% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-3px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes action-ready-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.12);
  }
}

@keyframes bout-lock {
  0% {
    transform: scale(0.96);
  }
  58% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes lane-flash {
  0% {
    opacity: 0.72;
    transform: translateY(8px) scale(0.98);
  }
  62% {
    opacity: 1;
    transform: translateY(-3px) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes result-pop {
  0% {
    transform: scale(0.96);
  }
  52% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes score-bump {
  0% {
    transform: translateY(5px) scale(0.94);
  }
  60% {
    transform: translateY(-3px) scale(1.08);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes chip-reveal {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes effect-row-hit {
  0% {
    filter: brightness(0.86);
    transform: translateX(-4px);
  }
  58% {
    filter: brightness(1.18);
    transform: translateX(2px);
  }
  100% {
    filter: brightness(1);
    transform: translateX(0);
  }
}

@keyframes effect-bar-grow {
  0% {
    transform: scaleX(0);
  }
  72% {
    transform: scaleX(1.06);
  }
  100% {
    transform: scaleX(1);
  }
}

@keyframes expression-sustain {
  0% {
    opacity: 0.76;
    filter: brightness(0.96) saturate(0.92);
  }
  18%,
  78% {
    opacity: 1;
    filter: brightness(1.1) saturate(1.08);
  }
  100% {
    opacity: 1;
    filter: brightness(1.08) saturate(1.04);
  }
}

@keyframes listening-sustain {
  0% {
    opacity: 0.62;
    filter: brightness(0.92) saturate(0.9);
  }
  18%,
  78% {
    opacity: 0.52;
    filter: brightness(0.82) saturate(0.84);
  }
  100% {
    opacity: 0.62;
    filter: brightness(0.86) saturate(0.88);
  }
}

@keyframes dialogue-pop {
  from {
    opacity: 0.86;
    transform: translateX(-50%) translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.story-strip {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #f6fbf8;
  border: 1px solid rgba(28, 58, 65, 0.1);
}

.story-strip p {
  margin-bottom: 0;
  color: #5e5960;
}

.story-strip p:empty {
  display: none;
}

.story-strip span {
  color: #7c536a;
  font-weight: 800;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: #7c536a;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  background: #e8faf5;
  color: #145f54;
  font-size: 0.8rem;
  font-weight: 850;
}

.is-muted .pill {
  background: #f0edf2;
  color: #6c5c69;
}

.lineup {
  display: grid;
  gap: 10px;
  align-content: start;
}

.lineup h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.lineup-card {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(155deg, rgba(255, 250, 242, 0.16), rgba(149, 241, 223, 0.06)),
    #211926;
  border: 1px solid rgba(149, 241, 223, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.04);
  color: #fffaf2;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.lineup-card:hover {
  transform: translateY(-2px);
  border-color: rgba(149, 241, 223, 0.5);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 250, 242, 0.08);
}

.lineup-card-art {
  width: 100%;
  display: block;
  overflow: hidden;
  margin-bottom: 10px;
  padding: 0;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 6px;
  background: #0f131a;
}

.lineup-card-art img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.lineup-card strong,
.lineup-card span {
  display: block;
}

.lineup-card span {
  margin-top: 3px;
  color: #ffecc8;
  font-size: 0.86rem;
}

.mini-color-build {
  margin-top: 8px;
}

.lineup-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}

.mini-card-button {
  min-height: 34px;
  margin-top: 10px;
  font-size: 0.82rem;
}

.lineup-card div {
  min-width: 0;
}

.lineup-card dt {
  color: #95f1df;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.lineup-card dd {
  margin: 3px 0 0;
  font-weight: 900;
}

.action-row {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(33, 25, 38, 0.1);
}

.action-row p {
  margin: 4px 0 0;
  color: #5e5960;
}

.result-panel {
  margin-top: 18px;
  padding: 18px;
  background: #fffdf8;
}

.result-head h2 {
  margin: 4px 0 0;
}

#exchangeList {
  display: grid;
  gap: 8px;
  padding-left: 20px;
  margin-bottom: 0;
}

#exchangeList strong,
#exchangeList span {
  display: block;
}

.result-recovery {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid rgba(33, 25, 38, 0.1);
  background: rgba(255, 253, 248, 0.95);
  padding-top: 12px;
  backdrop-filter: blur(10px);
}

.result-recovery .quiet-button,
.result-recovery .reset-button {
  min-height: 44px;
}

#exchangeList span {
  color: #5e5960;
}

.collection-band {
  min-height: 0;
  max-height: min(31dvh, 330px);
  margin-top: 0;
  overflow: hidden;
}

.collection-head {
  align-items: end;
  margin-bottom: 10px;
}

.collection-head h2 {
  margin-bottom: 0;
}

.roster-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.roster-card {
  flex: 0 0 min(250px, 76vw);
  scroll-snap-align: start;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.roster-card:hover,
.mode-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 70px rgba(43, 80, 82, 0.18);
}

.roster-card.is-active {
  border-color: rgba(34, 148, 129, 0.62);
  box-shadow: 0 18px 54px rgba(34, 148, 129, 0.18);
}

.card-image-button {
  width: 100%;
  min-height: 0;
  display: block;
  padding: 0;
  border-radius: 0;
  background: #211926;
}

.roster-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #211926;
}

.roster-body {
  padding: 14px;
}

.roster-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #7c536a;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.roster-body h3 {
  margin: 8px 0 5px;
  font-size: 1.12rem;
}

.roster-body p,
.roster-body small {
  display: block;
  margin-bottom: 0;
  color: #5e5960;
}

.power-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}

.power-readout div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(34, 148, 129, 0.18);
  border-radius: 8px;
  background: rgba(34, 148, 129, 0.08);
}

.power-readout dt {
  color: #7c536a;
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.power-readout dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  color: #211926;
  font-size: 0.82rem;
  font-weight: 900;
}

.game .power-readout dd {
  color: #fffaf2;
}

.game .power-readout dt {
  color: #95f1df;
}

.roster-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.roster-actions .quiet-button,
.roster-actions .reset-button {
  min-height: 36px;
  flex: 1;
  font-size: 0.82rem;
}

.card-modal {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fffaf2;
}

.card-modal.is-primitive-card-modal {
  width: min(418px, calc(100vw - 28px));
}

.card-modal.is-primitive-card-modal .detail-card {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.card-modal.is-primitive-card-modal .primitive-card {
  width: min(390px, calc(100vw - 44px));
  max-width: 100%;
}

.card-modal::backdrop {
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(6px);
}

.deck-library-modal {
  width: min(720px, calc(100vw - 28px));
}

.deck-library-dialog {
  max-height: calc(100dvh - 92px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(149, 241, 223, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(5, 32, 44, 0.98), rgba(4, 18, 29, 0.98)),
    #04121d;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
}

.deck-library-dialog h2 {
  margin: 4px 0 5px;
  color: #eefcff;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
}

.deck-library-dialog > p {
  margin: 0 0 16px;
  color: rgba(238, 252, 255, 0.68);
}

.deck-library-list {
  display: grid;
  gap: 8px;
}

.deck-library-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(149, 241, 223, 0.18);
  border-radius: 7px;
  background: rgba(3, 18, 28, 0.72);
}

.deck-library-entry.is-legal {
  border-color: rgba(84, 242, 226, 0.42);
}

.deck-library-entry-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.deck-library-entry-copy strong {
  overflow: hidden;
  color: #fffaf2;
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-library-entry-copy span,
.deck-library-entry-copy small {
  color: rgba(238, 252, 255, 0.64);
  font-size: 0.78rem;
}

.deck-library-entry-copy small {
  color: #95f1df;
}

.deck-library-entry.is-illegal .deck-library-entry-copy small {
  color: #ffd08d;
}

.deck-library-entry-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.deck-library-entry-actions button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 900;
}

.deck-library-entry-actions .deck-library-delete {
  border-color: rgba(255, 151, 122, 0.3);
  color: #ffd8ce;
}

.deck-library-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(149, 241, 223, 0.24);
  border-radius: 7px;
  color: rgba(238, 252, 255, 0.68);
  text-align: center;
}

.icon-modal {
  width: min(360px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fffaf2;
}

.icon-modal.is-bio {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100dvh - 20px);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.icon-modal::backdrop {
  background: rgba(12, 14, 18, 0.72);
  backdrop-filter: blur(6px);
}

.icon-detail-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(149, 241, 223, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(17, 24, 39, 0.96), rgba(33, 25, 38, 0.94));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.icon-detail-card img {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.4));
}

.icon-detail-card h2 {
  margin: 0;
  font-size: 1.55rem;
}

.icon-detail-card p {
  margin: 0;
  color: #ffecc8;
  line-height: 1.45;
  max-width: 100%;
  text-align: left;
  white-space: pre-line;
}

.icon-modal.is-bio .icon-detail-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  grid-template-areas:
    "art title"
    "art meta"
    "body body"
    "actions actions";
  align-items: start;
  justify-items: start;
  gap: 8px 18px;
  max-height: calc(100dvh - 20px);
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  padding: 20px 22px;
  text-align: left;
  scrollbar-width: thin;
}

.icon-modal.is-bio .icon-detail-card img {
  grid-area: art;
  width: 96px;
  height: 96px;
}

.icon-modal.is-bio .icon-detail-card h2 {
  grid-area: title;
  align-self: end;
}

.icon-modal.is-bio .icon-detail-card > span {
  grid-area: meta;
}

.icon-modal.is-bio .icon-detail-card p {
  grid-area: body;
  max-height: min(58dvh, 560px);
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 8px;
  padding-bottom: 14px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.icon-modal.is-bio .icon-detail-card form {
  grid-area: actions;
  justify-self: end;
  position: sticky;
  bottom: 0;
  padding-top: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-card {
  position: relative;
  max-height: calc(100dvh - 92px);
  overflow: auto;
  scrollbar-width: thin;
  border-radius: 8px;
  background: #211926;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
}

.rules-card {
  max-height: calc(100dvh - 92px);
  overflow-y: auto;
  scrollbar-width: thin;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(25, 31, 43, 0.98), rgba(13, 17, 25, 0.98));
  padding: 24px;
  color: #fffaf2;
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
}

.rules-card h2 {
  margin: 8px 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.rules-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding-left: 1.2rem;
  color: rgba(255, 250, 242, 0.78);
  line-height: 1.55;
}

.detail-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: min(56dvh, 440px);
  object-fit: cover;
}

.card-corner {
  position: absolute;
  top: 12px;
  z-index: 2;
}

.card-corner-left {
  left: 12px;
}

.card-corner-right {
  right: 12px;
}

.card-color-build,
.back-color-build,
.mini-color-build {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-color-build {
  max-width: 210px;
}

.primitive-medallion-cluster {
  display: inline-grid;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.primitive-card-front .card-color-build {
  width: 206px;
  min-height: 150px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 76px 68px;
  align-items: center;
  justify-items: center;
  gap: 0;
}

.primitive-card-front .primitive-medallion-cluster {
  width: 145px;
  height: 145px;
  display: grid;
  place-items: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter:
    drop-shadow(0 0 16px rgba(255, 0, 210, 0.44))
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.4));
}

.primitive-card-front .primitive-medallion-cluster .card-color-build {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
  opacity: 1;
  pointer-events: none;
}

.primitive-card-front.is-balanced .card-color-build {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 82px;
  width: 238px;
  min-height: 86px;
}

.back-color-build {
  margin: 12px 0;
}

.color-pip {
  --pip-color: #95f1df;
  min-width: 48px;
  min-height: 38px;
  display: inline-grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(255, 250, 242, 0.4);
  border-radius: 8px;
  padding: 5px 7px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--pip-color), #ffffff 24%), var(--pip-color));
  color: #111827;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.22);
}

.primitive-card-front .color-pip {
  width: 70px;
  height: 70px;
  min-width: 0;
  min-height: 0;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  place-items: center;
  position: relative;
  border-radius: 50%;
  padding: 0;
  outline: 2px solid rgba(194, 133, 21, 0.82);
  outline-offset: -4px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.54), transparent 30%),
    radial-gradient(circle at 50% 52%, color-mix(in srgb, var(--pip-color), #ffffff 20%), var(--pip-color) 68%, color-mix(in srgb, var(--pip-color), #000000 28%));
  box-shadow:
    0 0 0 2px rgba(255, 224, 139, 0.84),
    0 10px 24px rgba(0, 0, 0, 0.34),
    inset 0 0 0 2px rgba(17, 24, 39, 0.52);
}

.color-pip img {
  display: none;
}

.primitive-card-front .color-pip img {
  display: block;
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  object-fit: contain;
  opacity: 0.96;
  filter:
    saturate(1.16)
    contrast(1.08)
    drop-shadow(0 4px 7px rgba(0, 0, 0, 0.46));
}

.primitive-card-front.is-dominant .color-pip.is-slot-1 {
  width: 82px;
  height: 82px;
  grid-column: 2 / span 2;
  grid-row: 1;
}

.primitive-card-front.is-dominant .color-pip.is-slot-2 {
  width: 70px;
  height: 70px;
  grid-column: 1 / span 2;
  grid-row: 2;
}

.primitive-card-front.is-dominant .color-pip.is-slot-3 {
  width: 58px;
  height: 58px;
  grid-column: 3 / span 2;
  grid-row: 2;
}

.primitive-card-front.is-balanced .color-pip {
  width: 78px;
  height: 78px;
  grid-row: 1;
}

.primitive-card-front.is-balanced .color-pip.is-slot-1 {
  grid-column: 1;
}

.primitive-card-front.is-balanced .color-pip.is-slot-2 {
  grid-column: 2;
}

.primitive-card-front.is-balanced .color-pip.is-slot-3 {
  grid-column: 3;
}

.color-pip[style*="#111827"],
.color-pip[style*="#7d8590"] {
  color: #fffaf2;
}

.color-pip b,
.color-pip em {
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.color-pip b {
  font-size: 0.58rem;
  letter-spacing: 0;
}

.color-pip em {
  font-size: 1.05rem;
}

.primitive-card-front .color-pip b {
  display: none;
}

.primitive-card-front .color-pip em {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  font-size: 2.05rem;
  color: #fffaf2;
  text-shadow:
    -2px -2px 0 rgba(17, 24, 39, 0.94),
    2px -2px 0 rgba(17, 24, 39, 0.94),
    -2px 2px 0 rgba(17, 24, 39, 0.94),
    2px 2px 0 rgba(17, 24, 39, 0.94),
    0 0 13px rgba(255, 250, 242, 0.5);
}

.primitive-card-front.is-dominant .color-pip.is-slot-1 em {
  font-size: 2.42rem;
}

.primitive-card-front.is-dominant .color-pip.is-slot-3 em {
  font-size: 1.72rem;
}

.color-pip.is-enhanced,
.primitive-combat-strip .is-enhanced,
.combat-readout .is-enhanced,
.lineup-card dl .is-enhanced {
  box-shadow:
    0 0 0 1px rgba(255, 210, 87, 0.78),
    0 0 18px rgba(255, 210, 87, 0.62),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.color-pip.is-reduced,
.primitive-combat-strip .is-reduced,
.combat-readout .is-reduced,
.lineup-card dl .is-reduced {
  box-shadow:
    0 0 0 1px rgba(255, 88, 88, 0.78),
    0 0 18px rgba(255, 88, 88, 0.58),
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.primitive-card-front .color-pip.is-enhanced::before,
.combat-stat-medallion.is-enhanced::before,
.primitive-card-front .color-pip.is-reduced::before,
.combat-stat-medallion.is-reduced::before {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: 1;
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: screen;
}

.primitive-card-front .color-pip.is-enhanced::before,
.combat-stat-medallion.is-enhanced::before {
  background:
    radial-gradient(circle at 50% 78%, rgba(255, 229, 99, 0.95), transparent 24%),
    conic-gradient(from 22deg, transparent 0 7%, rgba(255, 74, 20, 0.96) 9% 16%, transparent 18% 27%, rgba(255, 202, 50, 0.98) 30% 41%, transparent 43% 54%, rgba(255, 95, 26, 0.92) 58% 69%, transparent 71% 100%);
  filter: blur(0.35px) saturate(1.75) contrast(1.16);
  opacity: 0.96;
}

.primitive-card-front .color-pip.is-reduced::before,
.combat-stat-medallion.is-reduced::before {
  background:
    radial-gradient(circle at 46% 18%, rgba(207, 252, 255, 0.92), transparent 25%),
    conic-gradient(from -18deg, transparent 0 9%, rgba(39, 225, 255, 0.92) 11% 20%, transparent 22% 33%, rgba(98, 164, 255, 0.9) 36% 47%, transparent 49% 61%, rgba(231, 252, 255, 0.82) 65% 76%, transparent 78% 100%);
  filter: blur(0.35px) saturate(1.65) contrast(1.12);
  opacity: 0.96;
}

.primitive-card-front .color-pip.is-enhanced img,
.combat-stat-medallion.is-enhanced img {
  filter:
    contrast(1.12)
    saturate(1.22)
    drop-shadow(0 0 14px rgba(255, 130, 31, 0.72))
    drop-shadow(0 9px 15px rgba(0, 0, 0, 0.46));
}

.primitive-card-front .color-pip.is-reduced img,
.combat-stat-medallion.is-reduced img {
  filter:
    contrast(1.08)
    saturate(1.18)
    drop-shadow(0 0 14px rgba(81, 221, 255, 0.7))
    drop-shadow(0 9px 15px rgba(0, 0, 0, 0.46));
}

.skill-icon,
.accessory-capacity-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 242, 0.58);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.42), transparent 34%),
    rgba(15, 19, 26, 0.86);
  color: #fffaf2;
  font-weight: 950;
  box-shadow:
    0 0 0 1px rgba(17, 24, 39, 0.32),
    0 12px 32px rgba(0, 0, 0, 0.32);
}

.accessory-capacity-icon {
  grid-template-rows: auto auto;
  gap: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.5), transparent 34%),
    rgba(33, 25, 38, 0.9);
}

.accessory-capacity-icon b,
.accessory-capacity-icon em {
  font-style: normal;
  line-height: 1;
}

.accessory-capacity-icon b {
  font-size: 0.54rem;
  letter-spacing: 0;
}

.accessory-capacity-icon em {
  font-size: 1.25rem;
  font-weight: 950;
}

.detail-face,
.detail-back {
  padding: 18px;
}

.detail-face span,
.detail-back span {
  color: #95f1df;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-face h2,
.detail-back h2 {
  margin: 6px 0;
  font-size: 2.1rem;
}

.detail-face p,
.detail-back p {
  color: #ffecc8;
}

.front-skill-line {
  margin: 12px 0 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.accessory-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
  padding: 0;
  list-style: none;
}

.accessory-list li {
  padding: 10px;
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.07);
}

.accessory-list strong,
.accessory-list span {
  display: block;
}

.accessory-list span {
  margin-top: 2px;
  color: #95f1df;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.accessory-list p {
  margin: 6px 0 0;
}

.combat-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.combat-readout div,
.lineup-card dl .is-enhanced,
.lineup-card dl .is-reduced {
  padding: 9px;
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.1);
}

.combat-readout dt {
  color: #95f1df;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.combat-readout dd {
  margin: 4px 0 0;
  color: #fffaf2;
  font-size: 1.15rem;
  font-weight: 950;
}

.detail-back {
  min-height: 0;
  background:
    linear-gradient(145deg, rgba(23, 121, 104, 0.22), transparent),
    #211926;
}

.detail-back h3 {
  margin: 20px 0 6px;
}

.detail-back dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.detail-back > dl:not(.power-readout) > div {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.08);
}

.detail-back > dl:not(.power-readout) dt {
  color: #95f1df;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-back > dl:not(.power-readout) dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.detail-back .power-readout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-back .power-readout div {
  border-color: rgba(149, 241, 223, 0.22);
  background: rgba(255, 250, 242, 0.08);
}

.detail-back .power-readout dt {
  color: #95f1df;
}

.detail-back .power-readout dd {
  color: #fffaf2;
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .mode-hub,
  .story-intro,
  .play-layout,
  .roster-grid,
  .arena-table,
  .field-row,
  .lineup-grid,
  .card-lab-layout,
  .card-library-layout {
    grid-template-columns: 1fr;
  }

  .card-lab,
  .card-library {
    padding: 14px;
  }

  .card-lab-sidebar,
  .card-library-sidebar {
    position: static;
  }

  .primitive-preview-shell {
    min-height: 0;
    padding: 10px;
  }

  .mode-hub {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    overflow-x: auto;
    padding: 0 14px 4px;
    scroll-snap-type: x mandatory;
  }

  .mode-hub.lobby-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .mode-card {
    min-height: 132px;
    scroll-snap-align: start;
  }

  .lobby-control-grid {
    grid-template-columns: repeat(4, minmax(210px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
  }

  .arena-slot {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .app-shell {
    min-height: 100dvh;
  }

  .landing {
    height: auto;
    min-height: auto;
    align-items: start;
    padding: 82px 14px 24px;
  }

  .landing-topbar {
    align-items: flex-start;
    padding: 14px;
  }

  .landing-topbar nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: calc(100vw - 28px);
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .landing-topbar .nav-mode-button:disabled {
    display: none;
  }

  .landing-copy h1 {
    font-size: clamp(4.6rem, 22vw, 6.8rem);
  }

  .landing-copy p {
    max-width: 330px;
    font-size: 0.98rem;
  }

  .mode-hub {
    position: relative;
    inset: auto;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
    max-width: 520px;
    margin: 0 auto 18px;
    padding: 0 14px;
    scroll-snap-type: none;
  }

  .mode-card {
    min-height: 112px;
    padding: 14px;
    scroll-snap-align: none;
  }

  .lobby-control-grid {
    grid-template-columns: 1fr;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
  }

  .mode-card strong {
    font-size: 1.02rem;
  }

  .mode-card p {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .game {
    min-height: 100dvh;
    padding: 10px;
    gap: 8px;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .club-panel,
  .game:not(.is-intro-active):not(.is-table-focus) .story-strip,
  .game:not(.is-intro-active):not(.is-table-focus) .field-row,
  .game:not(.is-intro-active):not(.is-table-focus) #stageLesson {
    display: none;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .battle-board {
    padding: 12px;
    overflow: hidden;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .board-head {
    align-items: center;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .board-head h2 {
    margin-bottom: 0;
    font-size: 1.65rem;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .board-head #stageMeta {
    font-size: 0.72rem;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .turn-guide {
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: 10px;
    padding: 10px;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .turn-guide p {
    font-size: 0.88rem;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .action-row {
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .action-row p {
    display: none;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .action-row .reset-button {
    white-space: nowrap;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .collection-band {
    max-height: 30dvh;
  }

  .game.is-lineup-ready:not(.is-intro-active):not(.is-table-focus) .collection-band {
    display: none;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .collection-head {
    display: block;
  }

  .game:not(.is-intro-active):not(.is-table-focus) .collection-head p {
    display: none;
  }

  .game.is-intro-active .topbar {
    padding: 10px 12px;
  }

  .game.is-intro-active .topbar h2 {
    margin-bottom: 0;
    font-size: 1.55rem;
  }

  .game.is-intro-active .topbar-actions .quiet-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .game.is-intro-active .scene-character {
    width: min(48vw, 190px);
    transform: translateY(8px) scale(0.94);
  }

  .game.is-intro-active .scene-character.is-host {
    left: 2%;
  }

  .game.is-intro-active .scene-character.is-lead {
    right: 2%;
  }

  .game.is-intro-active .scene-character img {
    max-height: 46vh;
  }

  .game.is-intro-active .dialogue-box {
    width: calc(100% - 20px);
    bottom: 10px;
    padding: 14px;
  }

  .game.is-intro-active .dialogue-box p {
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.35;
  }

  .game.is-intro-active .intro-actions {
    flex-wrap: nowrap;
  }

  .play-layout.is-battle-active .battle-board {
    padding: 10px;
    align-content: stretch;
  }

  .play-layout.is-battle-active .battle-arena {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "board"
      "actions"
      "hand";
    align-content: start;
    padding: 10px;
    overflow: hidden;
  }

  .play-layout.is-battle-active .arena-table {
    display: none;
  }

  .play-layout.is-battle-active .arena-hand {
    grid-area: hand;
  }

  .play-layout.is-battle-active .turn-guide {
    grid-template-columns: 1fr;
    gap: 3px;
    margin-top: 0;
    padding: 9px 10px;
  }

  .play-layout.is-battle-active .turn-guide strong {
    font-size: 0.98rem;
  }

  .play-layout.is-battle-active .turn-guide p {
    font-size: 0.86rem;
  }

  .play-layout.is-battle-active .arena-head {
    align-items: center;
  }

  .play-layout.is-battle-active .arena-head h3 {
    font-size: 1.35rem;
  }

  .play-layout.is-battle-active .match-board {
    gap: 7px;
    margin-top: 7px;
    padding: 8px;
  }

  .play-layout.is-battle-active .match-side {
    padding: 7px 8px;
  }

  .play-layout.is-battle-active .match-side.is-player {
    display: none;
  }

  .play-layout.is-battle-active .opponent-hand {
    gap: 6px;
  }

  .play-layout.is-battle-active .opponent-pocket-card {
    height: 84px;
    min-height: 84px;
    font-size: 0.62rem;
  }

  .play-layout.is-battle-active .opponent-pocket-card span,
  .play-layout.is-battle-active .opponent-pocket-card small {
    padding-inline: 5px;
  }

  .play-layout.is-battle-active .opponent-pocket-card span {
    margin-top: 4px;
  }

  .play-layout.is-battle-active .opponent-pocket-card small {
    margin-bottom: 5px;
  }

  .play-layout.is-battle-active .match-side strong {
    font-size: 0.9rem;
  }

  .play-layout.is-battle-active .match-side small {
    font-size: 0.72rem;
  }

  .play-layout.is-battle-active .bout-row {
    gap: 6px;
  }

  .play-layout.is-battle-active .battle-steps {
    gap: 4px;
  }

  .play-layout.is-battle-active .battle-steps span {
    min-height: 20px;
    font-size: 0.5rem;
  }

  .play-layout.is-battle-active .bout-slot {
    min-height: 68px;
    gap: 3px;
    padding: 7px 5px;
  }

  .play-layout.is-battle-active .bout-slot strong {
    font-size: 0.82rem;
  }

  .play-layout.is-battle-active .bout-slot small {
    font-size: 0.62rem;
  }

  .play-layout.is-battle-active .coach-tip {
    gap: 6px;
    padding: 6px 7px;
  }

  .play-layout.is-battle-active .coach-tip strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.62rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .play-layout.is-battle-active .coach-tip.has-playbook {
    gap: 5px;
  }

  .play-layout.is-battle-active .coach-playbook {
    gap: 4px;
  }

  .play-layout.is-battle-active .coach-chips,
  .play-layout.is-battle-active .preview-coach {
    gap: 3px;
    max-height: 42px;
    overflow: hidden;
  }

  .play-layout.is-battle-active .coach-chips b,
  .play-layout.is-battle-active .preview-coach span {
    padding: 3px 5px;
    font-size: 0.5rem;
  }

  .play-layout.is-battle-active .clash-banner {
    min-height: 58px;
    gap: 2px;
    padding: 7px;
  }

  .play-layout.is-battle-active .clash-banner strong {
    font-size: 1.05rem;
  }

  .play-layout.is-battle-active .clash-banner small {
    font-size: 0.68rem;
  }

  .play-layout.is-battle-active .preview-line {
    gap: 4px;
  }

  .play-layout.is-battle-active .preview-line b,
  .play-layout.is-battle-active .preview-line em {
    padding: 4px 5px;
    font-size: 0.56rem;
  }

  .play-layout.is-battle-active .clash-scoreline {
    gap: 4px;
  }

  .play-layout.is-battle-active .clash-scoreline b,
  .play-layout.is-battle-active .clash-scoreline em {
    padding: 4px 5px;
    font-size: 0.56rem;
  }

  .play-layout.is-battle-active .clash-banner .math-chips {
    gap: 3px;
    max-height: 46px;
    overflow: hidden;
  }

  .play-layout.is-battle-active .clash-banner .math-chips span {
    padding: 3px 6px;
    font-size: 0.58rem;
  }

  .play-layout.is-battle-active .committed-row {
    gap: 5px;
  }

  .play-layout.is-battle-active #committedCards {
    min-height: 34px;
  }

  .play-layout.is-battle-active .queued-card,
  .play-layout.is-battle-active .committed-card {
    font-size: 0.66rem;
  }

  .play-layout.is-battle-active .queued-card {
    padding: 6px 8px;
  }

  .play-layout.is-battle-active .committed-card {
    min-height: 34px;
    padding: 4px 7px 4px 4px;
  }

  .play-layout.is-battle-active .committed-card img {
    width: 24px;
    height: 28px;
  }

  .play-layout.is-battle-active #battleScore {
    min-width: 78px;
    padding: 8px;
  }

  .play-layout.is-battle-active .scoreline {
    gap: 4px;
  }

  .play-layout.is-battle-active .scoreline b {
    font-size: 1rem;
  }

  .play-layout.is-battle-active .scoreline small {
    font-size: 0.52rem;
  }

  .play-layout.is-battle-active .arena-table {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: 8px;
    row-gap: 28px;
    margin-top: 8px;
    overflow: hidden;
  }

  .play-layout.is-battle-active .arena-slot {
    min-height: 0;
  }

  .play-layout.is-battle-active .arena-vs {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 220px;
    margin-top: 22px;
    overflow: auto;
    padding: 10px;
  }

  .play-layout.is-battle-active .arena-vs strong {
    font-size: 2rem;
  }

  .play-layout.is-battle-active .score-swing {
    gap: 6px;
  }

  .play-layout.is-battle-active .score-swing b {
    min-width: 52px;
    padding: 5px 7px;
    font-size: 1.45rem;
  }

  .play-layout.is-battle-active .table-card {
    width: min(108px, 100%);
  }

  .play-layout.is-battle-active .table-card div {
    padding: 7px;
  }

  .play-layout.is-battle-active .table-card strong {
    font-size: 0.86rem;
  }

  .play-layout.is-battle-active .table-card small {
    font-size: 0.62rem;
  }

  .play-layout.is-battle-active .math-chips {
    max-width: 100%;
    gap: 4px;
  }

  .play-layout.is-battle-active .math-chips span {
    padding: 3px 6px;
    font-size: 0.56rem;
  }

  .play-layout.is-battle-active .arena-actions {
    align-items: center;
    gap: 8px;
    margin-top: 8px;
  }

  .play-layout.is-battle-active .arena-actions p {
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .play-layout.is-battle-active .arena-actions .reset-button {
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .play-layout.is-battle-active .arena-hand {
    flex-wrap: nowrap;
    min-height: 126px;
    overflow-x: auto;
    justify-content: center;
    padding: 8px;
  }

  .play-layout.is-battle-active .hand-card {
    flex: 0 0 84px;
    width: 84px;
    min-height: 112px;
  }

  .play-layout.is-battle-active .hand-card span {
    font-size: 0.64rem;
  }

  .play-layout.is-battle-active .hand-card small {
    font-size: 0.58rem;
  }

  .card-modal {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 8px;
  }

  .modal-actions .quiet-button,
  .modal-actions .reset-button {
    min-height: 42px;
    padding-inline: 12px;
  }

  .detail-card {
    max-height: calc(100dvh - 82px);
  }

  .detail-card > img {
    max-height: 46dvh;
    aspect-ratio: 4 / 4.35;
  }

  .detail-face,
  .detail-back {
    padding: 14px;
  }

  .detail-face h2,
  .detail-back h2 {
    font-size: 1.72rem;
  }

  .detail-face p,
  .detail-back p {
    line-height: 1.35;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

/* Final cascade for the live match board. Keep this after the legacy arena rules so the board stays one composed surface. */
@media (min-width: 981px) {
  .game.is-table-focus .play-layout.is-battle-active {
    position: absolute !important;
    inset: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: calc(100% - 16px) !important;
    margin: 0 !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-board,
  .game.is-table-focus .play-layout.is-battle-active .battle-arena {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }

  .play-layout.is-battle-active .battle-arena {
    position: relative;
    grid-template-rows: minmax(0, 1fr) auto 154px;
    gap: 8px;
    padding: 10px;
    border: 2px solid rgba(226, 181, 91, 0.76);
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(8, 13, 17, 0.28), rgba(8, 13, 17, 0.78)),
      var(--match-host-art) center / cover;
    box-shadow:
      inset 0 0 0 3px rgba(32, 20, 12, 0.8),
      inset 0 0 0 5px rgba(226, 181, 91, 0.18),
      0 20px 60px rgba(0, 0, 0, 0.46);
  }

  .play-layout.is-battle-active .battle-arena > * {
    position: relative;
    z-index: 1;
  }

  .play-layout.is-battle-active .match-board {
    display: grid;
    grid-template-rows: 154px minmax(0, 1fr);
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .play-layout.is-battle-active .opponent-hand {
    position: relative;
    grid-row: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 24px 8px 8px;
    border: 1px solid rgba(255, 117, 78, 0.7);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(102, 24, 24, 0.66), rgba(18, 18, 18, 0.72));
  }

  .play-layout.is-battle-active .opponent-hand::before,
  .play-layout.is-battle-active .arena-hand::before {
    position: absolute;
    top: 6px;
    left: 10px;
    color: #ffe08a;
    font-size: 0.62rem;
    font-weight: 1000;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .play-layout.is-battle-active .opponent-hand::before {
    content: "Opponent squad · deck line";
  }

  .play-layout.is-battle-active .arena-hand::before {
    content: "Your squad · deck line";
  }

  .play-layout.is-battle-active .opponent-pocket-card {
    position: relative;
    height: 122px;
    border-color: rgba(255, 117, 78, 0.54);
    border-radius: 7px;
    background: rgba(8, 13, 17, 0.8);
  }

  .play-layout.is-battle-active .opponent-pocket-card.is-current,
  .play-layout.is-battle-active .opponent-pocket-card.is-status-in-ring {
    border-color: #ff7659;
    box-shadow: 0 0 0 2px rgba(255, 117, 78, 0.26), 0 0 25px rgba(255, 117, 78, 0.24);
  }

  .play-layout.is-battle-active .opponent-pocket-card.is-status-standing {
    border-color: rgba(149, 241, 223, 0.66);
    filter: saturate(0.9);
  }

  .play-layout.is-battle-active .opponent-pocket-card.is-status-fallen {
    border-color: rgba(255, 117, 78, 0.62);
    filter: grayscale(0.9) saturate(0.48) brightness(0.62);
  }

  .play-layout.is-battle-active .match-board > .bout-row {
    grid-row: 2;
    grid-template-columns: 1fr;
    gap: 7px;
    min-height: 0;
    overflow: hidden;
  }

  .play-layout.is-battle-active .match-ring-slot {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid rgba(226, 181, 91, 0.42);
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(30, 16, 12, 0.7), rgba(15, 18, 19, 0.5), rgba(10, 24, 26, 0.7));
  }

  .play-layout.is-battle-active .match-ring-slot.is-active,
  .play-layout.is-battle-active .match-ring-slot.is-just-resolved {
    border-color: rgba(255, 224, 138, 0.86);
    box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.26), 0 0 28px rgba(255, 224, 138, 0.16);
  }

  .match-ring-slot-head,
  .match-ring-faceoff {
    display: grid;
  }

  .match-ring-slot-head {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #ffe08a;
    font-size: 0.62rem;
    font-weight: 950;
    text-transform: uppercase;
  }

  .match-ring-slot-head strong {
    color: #fffaf2;
    font-size: 0.7rem;
    text-align: right;
  }

  .match-ring-faceoff {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 0;
  }

  .match-ring-side {
    min-width: 0;
    display: grid;
    justify-items: center;
  }

  .match-ring-side.is-player { justify-items: end; }
  .match-ring-side.is-opponent { justify-items: start; }

  .match-ring-vs {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(226, 181, 91, 0.7);
    border-radius: 50%;
    background: rgba(24, 15, 10, 0.82);
    color: #ffe08a;
    font-size: 0.66rem;
    font-weight: 1000;
    text-align: center;
  }

  .match-ring-vs small {
    color: #fffaf2;
    font-size: 0.52rem;
  }

  .match-ring-result {
    overflow: hidden;
    color: rgba(255, 236, 200, 0.74);
    font-size: 0.62rem;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .play-layout.is-battle-active .arena-actions {
    min-height: 40px;
    margin: 0;
  }

  .play-layout.is-battle-active .arena-actions p,
  .play-layout.is-battle-active .battle-steps,
  .play-layout.is-battle-active .coach-tip,
  .play-layout.is-battle-active .clash-banner,
  .play-layout.is-battle-active .arena-head,
  .play-layout.is-battle-active .match-side,
  .play-layout.is-battle-active .committed-row {
    display: none;
  }

  .play-layout.is-battle-active .arena-hand {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 8px;
    min-height: 0;
    margin: 0;
    padding: 24px 8px 8px;
    border: 1px solid rgba(34, 235, 217, 0.72);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(12, 60, 62, 0.68), rgba(8, 18, 21, 0.78));
  }

  .play-layout.is-battle-active .hand-card {
    width: auto;
    min-width: 0;
    min-height: 118px;
    border-color: rgba(34, 235, 217, 0.46);
    border-radius: 7px;
    background: rgba(8, 13, 17, 0.84);
  }

  .play-layout.is-battle-active .hand-card.is-status-in-ring,
  .play-layout.is-battle-active .hand-card.is-committed {
    border-color: #22ebd9;
    box-shadow: 0 0 0 2px rgba(34, 235, 217, 0.24), 0 0 24px rgba(34, 235, 217, 0.22);
  }

  .play-layout.is-battle-active .hand-card.is-status-fallen,
  .play-layout.is-battle-active .hand-card.is-status-played {
    filter: grayscale(0.9) saturate(0.48) brightness(0.62);
  }

  .match-booster-marker,
  .match-card-status {
    position: absolute;
    top: 5px;
    z-index: 2;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 0.48rem;
    font-weight: 1000;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .match-booster-marker {
    left: 5px;
    border: 1px solid rgba(255, 224, 138, 0.78);
    background: rgba(72, 31, 12, 0.9);
    color: #ffe08a;
  }

  .match-card-status {
    right: 5px;
    background: rgba(8, 13, 17, 0.84);
    color: #fffaf2;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena {
    position: relative;
    grid-template-rows: minmax(0, 1fr) auto 126px;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(226, 181, 91, 0.64);
    border-radius: 10px;
    background:
      linear-gradient(180deg, rgba(8, 13, 17, 0.34), rgba(8, 13, 17, 0.8)),
      var(--match-host-art) center / cover;
  }

  .play-layout.is-battle-active .match-board {
    grid-template-rows: 88px minmax(0, 1fr);
    gap: 5px;
    margin: 0;
    padding: 4px;
    border: 0;
    background: transparent;
  }

  .play-layout.is-battle-active .opponent-hand {
    position: relative;
    gap: 4px;
    padding: 18px 4px 4px;
    border: 1px solid rgba(255, 117, 78, 0.62);
    border-radius: 7px;
    background: rgba(50, 20, 19, 0.66);
  }

  .play-layout.is-battle-active .opponent-hand::before,
  .play-layout.is-battle-active .arena-hand::before {
    position: absolute;
    top: 3px;
    left: 6px;
    color: #ffe08a;
    font-size: 0.46rem;
    font-weight: 1000;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .play-layout.is-battle-active .opponent-hand::before { content: "Opponent squad"; }
  .play-layout.is-battle-active .arena-hand::before { content: "Your squad"; }

  .play-layout.is-battle-active .opponent-pocket-card {
    height: 64px;
    border-radius: 5px;
    font-size: 0.48rem;
  }

  .play-layout.is-battle-active .opponent-pocket-card span {
    margin-top: 2px;
    padding-inline: 3px;
  }

  .play-layout.is-battle-active .opponent-pocket-card small {
    margin: 1px 0 3px;
    padding-inline: 3px;
    font-size: 0.4rem;
  }

  .play-layout.is-battle-active .match-board > .bout-row {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
  }

  .play-layout.is-battle-active .match-ring-slot {
    gap: 2px;
    padding: 3px 4px;
    border-radius: 6px;
  }

  .match-ring-slot-head,
  .match-ring-result { font-size: 0.42rem; }
  .match-ring-slot-head strong { font-size: 0.42rem; }

  .match-ring-faceoff {
    grid-template-columns: minmax(0, 1fr) 25px minmax(0, 1fr);
    gap: 4px;
  }

  .match-ring-vs {
    width: 24px;
    height: 24px;
    font-size: 0.42rem;
  }

  .match-ring-vs small { font-size: 0.36rem; }

  .match-ring-card {
    width: min(124px, 100%);
    height: 46px;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 3px;
    border-radius: 4px;
  }

  .match-ring-card img { width: 32px; }
  .match-ring-card span { padding-inline: 3px; font-size: 0.42rem; }
  .match-ring-card small { padding: 0 3px 2px; font-size: 0.36rem; }
  .match-ring-empty { width: min(124px, 100%); height: 30px; font-size: 0.38rem; }

  .play-layout.is-battle-active .arena-actions { min-height: 32px; }

  .play-layout.is-battle-active .arena-actions .reset-button {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.68rem;
  }

  .play-layout.is-battle-active .arena-hand {
    position: relative;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-height: 0;
    margin: 0;
    padding: 18px 4px 4px;
    border: 1px solid rgba(34, 235, 217, 0.62);
    border-radius: 7px;
    background: rgba(7, 43, 45, 0.7);
  }

  .play-layout.is-battle-active .hand-card {
    width: auto;
    min-height: 96px;
    border-radius: 5px;
  }

  .play-layout.is-battle-active .hand-card img { height: 62px; }

  .play-layout.is-battle-active .hand-card span {
    overflow: hidden;
    margin-top: 2px;
    padding-inline: 4px;
    font-size: 0.46rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .play-layout.is-battle-active .hand-card small {
    padding-inline: 4px;
    font-size: 0.4rem;
  }

  .match-booster-marker,
  .match-card-status {
    top: 2px;
    padding: 2px 3px;
    font-size: 0.34rem;
  }

  .match-booster-marker { left: 2px; }
  .match-card-status { right: 2px; }
}

@media (max-width: 720px) {
  .landing-topbar {
    display: flex;
    flex-wrap: nowrap;
    min-width: 0;
  }

  .landing-topbar nav {
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .game {
    padding: 14px;
  }

  .landing-topbar,
  .topbar,
  .collection-head,
  .board-head,
  .result-head,
  .action-row {
    display: grid;
  }

  .scene-stage {
    inset: 18px 0 132px;
  }

  .game.is-intro-active .topbar,
  .game.is-table-focus .topbar {
    display: none;
  }

  .scene-character {
    width: 48vw;
  }

  .scene-character.is-host {
    left: -4%;
  }

  .scene-character.is-lead {
    right: -4%;
  }
}

.buzz-companion {
  position: static;
  inset: auto;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: min(100% - 2rem, 980px);
  max-width: 980px;
  margin: 0 auto;
  padding: 0.55rem;
  border: 1px solid rgba(255, 236, 200, 0.42);
  border-inline: 0;
  border-radius: 1rem 1rem 0 0;
  background: rgba(17, 22, 30, 0.9);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
  color: #fffaf2;
  backdrop-filter: blur(18px);
}

.buzz-companion[data-subscribed="true"] {
  border-color: rgba(255, 236, 200, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 236, 200, 0.18), 0 22px 48px rgba(0, 0, 0, 0.42);
}

.buzz-companion__mark {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #ffecc8;
}

.buzz-companion__mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.buzz-companion__body {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.buzz-companion__body span,
.buzz-companion__actions a,
.buzz-companion__actions summary,
.buzz-companion__actions button {
  color: inherit;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.buzz-companion__body span {
  color: #95f1df;
}

.buzz-companion__body strong {
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buzz-companion__promise {
  max-width: 28rem;
  margin: 0;
  color: rgba(255, 236, 200, 0.74);
  font-size: 0.72rem;
  line-height: 1.25;
}

.buzz-companion__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.buzz-companion__actions a,
.buzz-companion__actions summary,
.buzz-companion__actions button {
  min-height: 1.8rem;
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.08);
  padding: 0.25rem 0.55rem;
}

.buzz-companion__actions details {
  position: relative;
}

.buzz-companion__actions summary {
  cursor: pointer;
  list-style: none;
}

.buzz-companion__actions summary::-webkit-details-marker {
  display: none;
}

.buzz-companion__actions details p {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.4rem);
  z-index: 5;
  width: min(18rem, calc(100vw - 2rem));
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  background: rgba(17, 22, 30, 0.96);
  color: #fffaf2;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.buzz-companion__actions button {
  cursor: pointer;
}

@media (max-width: 680px) {
  .buzz-companion {
    width: 100%;
    max-width: none;
    border-radius: 0;
  }

  .buzz-companion__body strong {
    display: none;
  }

  .buzz-companion__actions {
    gap: 0.25rem;
  }
}
/* Footer visibility fix: keep the buzzgames banner outside the clipped game shell. */
.app-shell {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
}

.landing {
  min-height: 100dvh;
}

.buzz-companion {
  margin: 0 auto;
}

/* Card primitive fit pass: keep both faces on one physical card footprint. */
.primitive-front-color {
  top: 4px;
  left: 4px;
}

.primitive-front-accessory {
  top: 16px;
  right: 22px;
}

.primitive-front-accessory .primitive-accessory-frame {
  --accessory-frame-size: 82px;
  --accessory-icon-size: 82px;
}

.primitive-front-accessory .primitive-accessory-frame-icon {
  filter: none;
}

.primitive-front-traits {
  top: 122px;
  gap: 2px;
}

.primitive-front-traits .primitive-cheat-art,
.primitive-front-traits .primitive-cheat-art img {
  width: 56px;
  height: 56px;
}

.primitive-card-front > .primitive-combat-strip {
  left: 14px;
  right: 138px;
  bottom: 8px;
  grid-template-columns: repeat(4, 50px);
  gap: 0;
}

.primitive-card-front > .primitive-combat-strip div {
  min-height: 76px;
}

.primitive-card-front > .primitive-combat-strip dt,
.primitive-base-combat dt {
  position: absolute;
  left: 50%;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  z-index: 3;
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.92),
    0 0 7px rgba(149, 241, 223, 0.42);
  transform: translateX(-50%);
  pointer-events: none;
}

.primitive-card-front > .primitive-combat-strip dt {
  bottom: 8px;
  font-size: 0.38rem;
}

.primitive-card-front > .primitive-combat-strip .combat-stat-icon,
.primitive-card-front > .primitive-combat-strip .combat-stat-icon img {
  width: 74px;
  height: 74px;
}

.primitive-front-skill-stack {
  right: 8px;
  bottom: 10px;
  width: 124px;
  height: 168px;
  display: grid;
  grid-template-rows: 78px 78px;
  align-content: end;
  justify-items: stretch;
  gap: 4px;
  overflow: hidden;
}

.primitive-front-skill-chip {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 52px minmax(18px, 26px);
  place-items: center;
  overflow: hidden;
}

.primitive-front-skill-chip + .primitive-front-skill-chip {
  margin-top: 0;
}

.primitive-front-skill-chip.is-booster {
  grid-template-columns: 1fr;
  grid-template-rows: 52px minmax(18px, 26px) 8px;
  justify-content: stretch;
  column-gap: 0;
}

.primitive-front-skill-chip .primitive-icon-button,
.primitive-front-skill-chip .primitive-icon-button img {
  width: 56px;
  height: 56px;
}

.primitive-front-skill-chip b {
  display: block;
  max-width: 116px;
  font-size: 0.68rem;
  line-height: 0.92;
  text-align: center;
  overflow-wrap: anywhere;
  align-self: start;
}

.primitive-front-skill-chip em {
  margin-top: -1px;
  color: #95f1df;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.42rem;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.92),
    0 0 7px rgba(149, 241, 223, 0.42);
}

.primitive-front-skill-chip.is-booster .primitive-icon-button {
  grid-column: 1;
  grid-row: 1;
}

.primitive-front-skill-chip.is-booster b,
.primitive-front-skill-chip.is-booster em {
  grid-column: 1;
}

.primitive-front-skill-chip.is-booster b {
  grid-row: 2;
}

.primitive-front-skill-chip.is-booster em {
  grid-row: 3;
}

.primitive-booster-status {
  position: absolute;
  left: 6px;
  top: 20px;
  z-index: 4;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(135deg, #8bffd7, #00a66f 58%, #065f46);
  box-shadow:
    0 0 0 2px rgba(17, 24, 39, 0.9),
    0 0 0 3px rgba(149, 241, 223, 0.8),
    0 0 12px rgba(72, 255, 194, 0.5);
}

.primitive-card-back {
  width: min(100%, 390px);
  height: 590px;
  grid-template-rows: 128px 94px 130px 192px 46px;
}

.primitive-back-head {
  z-index: 50;
  grid-template-columns: minmax(0, 1fr) 134px;
  gap: 6px;
  padding: 34px 14px 8px 18px;
  overflow: visible;
}

.primitive-back-title > span {
  font-size: 0.62rem;
}

.primitive-back-head .primitive-contract-brand {
  margin-top: 3px;
  font-size: 0.66rem;
}

.primitive-back-head h3 {
  margin: 8px 0 0;
  overflow: hidden;
  font-size: 1.45rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primitive-contract-status {
  min-height: 34px;
  margin-top: 7px;
}

.primitive-contract-status em {
  display: block;
  max-width: 242px;
  white-space: nowrap;
  font-size: 0.58rem;
}

.primitive-contract-status img {
  z-index: 100;
  width: 118px;
  opacity: 1;
  filter:
    saturate(1.35)
    contrast(1.22)
    brightness(1.12)
    drop-shadow(0 1px 0 rgba(255, 246, 174, 0.44))
    drop-shadow(0 4px 3px rgba(0, 0, 0, 0.32));
}

.primitive-back-top-icons {
  grid-template-columns: 62px 66px;
  gap: 2px;
}

.primitive-labeled-icon > span,
.primitive-trait-tile > span,
.primitive-back-skill-copy article > span,
.primitive-skill-panel-head > span,
.primitive-skill-panel-head > strong {
  font-size: 0.52rem;
}

.primitive-back-accessory .primitive-accessory-frame {
  --accessory-frame-size: 66px;
  --accessory-icon-size: 66px;
}

.primitive-back-accessory .primitive-accessory-frame-icon {
  filter:
    contrast(1.08)
    drop-shadow(0 4px 7px rgba(0, 0, 0, 0.42));
}

.primitive-back-accessory b {
  max-width: 70px;
  overflow: hidden;
  color: #fffaf2;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.38rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow:
    0 1px 0 rgba(17, 24, 39, 0.9),
    0 0 7px rgba(255, 250, 242, 0.18);
}

.primitive-back-color-chip .primitive-medallion-cluster {
  width: 76px;
  height: 76px;
  margin: -5px 0 0;
}

.primitive-back-body {
  z-index: 1;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 6px;
  padding: 6px 14px 7px;
}

.primitive-base-combat {
  width: 178px;
  grid-template-columns: repeat(4, 44px);
  gap: 1px;
}

.primitive-base-combat div {
  min-height: 78px;
}

.primitive-base-combat dt {
  bottom: 10px;
  font-size: 0.36rem;
}

.primitive-base-combat .combat-stat-icon,
.primitive-base-combat .combat-stat-icon img {
  width: 60px;
  height: 60px;
}

.primitive-base-combat dd {
  font-size: 1.72rem;
}

.primitive-back-trait-grid {
  gap: 2px;
}

.primitive-trait-tile {
  gap: 3px;
}

.primitive-trait-tile > span {
  font-size: 0.38rem;
}

.primitive-trait-tile .primitive-cheat-art,
.primitive-trait-tile .primitive-cheat-art img {
  width: 36px;
  height: 36px;
}

.primitive-back-skill-copy {
  position: relative;
  z-index: 1;
  gap: 8px;
  padding: 8px 14px 7px;
}

.primitive-back-skill-copy article {
  grid-template-columns: 66px minmax(0, 1fr);
  grid-template-rows: auto 58px 1fr;
  gap: 4px 8px;
  padding: 9px 8px;
}

.primitive-skill-panel-head {
  gap: 8px;
}

.primitive-back-skill-copy .primitive-icon-button,
.primitive-back-skill-copy .primitive-icon-button img {
  align-self: start;
  width: 62px;
  height: 62px;
}

.primitive-back-skill-copy article > b {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  justify-self: start;
  transform: none;
  font-size: 0.82rem;
  line-height: 1.05;
  text-align: left;
}

.primitive-back-skill-copy article > p {
  grid-column: 1 / -1;
  grid-row: 3;
  margin: 0;
  overflow: hidden;
  color: rgba(255, 250, 242, 0.78);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: 0.5rem;
  font-weight: 800;
  line-height: 1.18;
  text-shadow: 0 1px 0 rgba(17, 24, 39, 0.72);
}

.primitive-cheat-art::after {
  content: attr(data-token);
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 4;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.85), transparent 30%),
    linear-gradient(135deg, #fff1a8, #d89512);
  color: #171923;
  font-family: "Arial Black", Impact, var(--font-display, sans-serif);
  font-size: 0.46rem;
  font-weight: 950;
  line-height: 1;
  box-shadow:
    0 0 0 1px rgba(17, 24, 39, 0.78),
    0 4px 8px rgba(0, 0, 0, 0.32);
}

.primitive-cheat-art {
  position: relative;
}

.primitive-cheat-art img {
  position: relative;
  z-index: 1;
}

.primitive-cheat-art.is-grudge-none::after {
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.72), transparent 30%),
    linear-gradient(135deg, #f1f5f9, #7d8590);
}

/* Color medallions must show the actual card attributes, not fixed template colors. */
.primitive-card-front .primitive-medallion-cluster,
.primitive-card-back .primitive-back-color-chip .primitive-medallion-cluster {
  background-image: none;
}

.primitive-card-front .primitive-medallion-cluster .card-color-build,
.primitive-card-back .primitive-back-color-chip .primitive-medallion-cluster .card-color-build {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: visible;
  opacity: 1;
  pointer-events: none;
}

.color-build-raster {
  display: none;
  grid-area: 1 / 1 / -1 / -1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.primitive-card-front .has-raster-build,
.primitive-card-back .primitive-back-color-chip .has-raster-build {
  display: grid;
  place-items: center;
}

.primitive-card-front .has-raster-build .color-build-raster,
.primitive-card-back .primitive-back-color-chip .has-raster-build .color-build-raster {
  display: block;
  filter:
    saturate(1.08)
    contrast(1.04)
    drop-shadow(0 0 12px rgba(255, 0, 210, 0.34))
    drop-shadow(0 10px 14px rgba(0, 0, 0, 0.34));
}

.primitive-card-front .has-raster-build .color-pip,
.primitive-card-back .primitive-back-color-chip .has-raster-build .color-pip {
  width: 0;
  height: 0;
  min-width: 0;
  min-height: 0;
  opacity: 0;
  overflow: hidden;
}

.primitive-card-front .primitive-medallion-cluster {
  width: 126px;
  height: 126px;
}

.primitive-card-front .primitive-medallion-cluster .card-color-build {
  grid-template-columns: repeat(4, 31px);
  grid-template-rows: 66px 58px;
}

.primitive-card-front.is-dominant .color-pip.is-slot-1 {
  width: 70px;
  height: 70px;
}

.primitive-card-front.is-dominant .color-pip.is-slot-2 {
  width: 58px;
  height: 58px;
}

.primitive-card-front.is-dominant .color-pip.is-slot-3 {
  width: 46px;
  height: 46px;
}

.primitive-card-front.is-balanced .primitive-medallion-cluster {
  width: 132px;
  height: 116px;
}

.primitive-card-front.is-balanced .primitive-medallion-cluster .card-color-build {
  grid-template-columns: repeat(4, 31px);
  grid-template-rows: 52px 58px;
}

.primitive-card-front.is-balanced .color-pip {
  width: 58px;
  height: 58px;
  grid-row: auto;
}

.primitive-card-front.is-balanced .color-pip.is-slot-1 {
  grid-column: 1 / span 2;
  grid-row: 1;
}

.primitive-card-front.is-balanced .color-pip.is-slot-2 {
  grid-column: 3 / span 2;
  grid-row: 1;
}

.primitive-card-front.is-balanced .color-pip.is-slot-3 {
  grid-column: 2 / span 2;
  grid-row: 2;
}

.primitive-card-back .primitive-back-color-chip .primitive-medallion-cluster {
  width: 76px;
  height: 76px;
}

.primitive-card-back .primitive-back-color-chip .primitive-medallion-cluster .card-color-build {
  grid-template-columns: repeat(4, 19px);
  grid-template-rows: 40px 34px;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-1 {
  width: 42px;
  height: 42px;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-2 {
  width: 34px;
  height: 34px;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-3 {
  width: 26px;
  height: 26px;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .card-color-build {
  grid-template-columns: repeat(4, 19px);
  grid-template-rows: 33px 37px;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .color-pip {
  width: 34px;
  height: 34px;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .color-pip.is-slot-1 {
  grid-column: 1 / span 2;
  grid-row: 1;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .color-pip.is-slot-2 {
  grid-column: 3 / span 2;
  grid-row: 1;
}

.primitive-card-back.is-balanced .primitive-back-color-chip .color-pip.is-slot-3 {
  grid-column: 2 / span 2;
  grid-row: 2;
}

.primitive-card-back .primitive-back-color-chip .color-pip em {
  font-size: 0.86rem;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-1 em {
  font-size: 1.08rem;
}

.primitive-card-back.is-dominant .primitive-back-color-chip .color-pip.is-slot-3 em {
  font-size: 0.66rem;
}

/* Boosted accessories share a base shell, with escalating ornament on top. */
.primitive-accessory-frame::after {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 2;
  border-radius: 50%;
  opacity: var(--accessory-rizz-opacity, 0);
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 10%, rgba(255, 247, 190, 0.95), transparent 10%),
    radial-gradient(circle at 88% 50%, rgba(255, 179, 41, 0.88), transparent 8%),
    radial-gradient(circle at 50% 90%, rgba(255, 120, 20, 0.76), transparent 10%),
    conic-gradient(from 18deg, transparent 0 11%, rgba(255, 210, 76, 0.8) 12% 15%, transparent 16% 28%, rgba(255, 134, 28, 0.62) 30% 34%, transparent 35% 100%);
  filter:
    saturate(var(--accessory-rizz-saturation, 1.1))
    drop-shadow(0 0 var(--accessory-rizz-glow, 8px) rgba(255, 149, 25, 0.48));
}

.primitive-accessory-frame.is-boost-0 {
  --accessory-rizz-opacity: 0;
}

.primitive-accessory-frame.is-boost-1 {
  --accessory-rizz-opacity: 0.18;
  --accessory-rizz-glow: 6px;
}

.primitive-accessory-frame.is-boost-2 {
  --accessory-rizz-opacity: 0.3;
  --accessory-rizz-glow: 8px;
}

.primitive-accessory-frame.is-boost-3 {
  --accessory-rizz-opacity: 0.44;
  --accessory-rizz-glow: 11px;
  --accessory-rizz-saturation: 1.25;
}

.primitive-accessory-frame.is-boost-4 {
  --accessory-rizz-opacity: 0.58;
  --accessory-rizz-glow: 14px;
  --accessory-rizz-saturation: 1.42;
}

.primitive-accessory-frame.is-boost-5 {
  --accessory-rizz-opacity: 0.74;
  --accessory-rizz-glow: 18px;
  --accessory-rizz-saturation: 1.62;
}

/* Real color builds use blank fillable medallions, not pre-painted score art. */
.primitive-card-front .color-pip,
.primitive-back-color-chip .color-pip {
  overflow: visible;
  outline: 0;
  border: 0;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.78), transparent 27%),
    radial-gradient(circle at 52% 54%, color-mix(in srgb, var(--pip-color), #ffffff 16%), var(--pip-color) 62%, color-mix(in srgb, var(--pip-color), #000000 35%));
  box-shadow:
    0 0 0 3px rgba(25, 20, 17, 0.96),
    0 0 0 5px rgba(246, 193, 70, 0.96),
    0 0 0 7px rgba(82, 51, 12, 0.86),
    0 10px 24px rgba(0, 0, 0, 0.34),
    inset 0 0 0 3px rgba(255, 255, 255, 0.18),
    inset 0 0 0 9px rgba(17, 24, 39, 0.28);
}

.primitive-card-front .color-pip img,
.primitive-back-color-chip .color-pip img {
  display: none;
}

.primitive-card-front .color-pip::after,
.primitive-back-color-chip .color-pip::after {
  content: "";
  position: absolute;
  inset: -9%;
  z-index: 3;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 242, 171, 0.98) 0 7%, transparent 8%),
    radial-gradient(ellipse at 100% 50%, rgba(255, 211, 85, 0.92) 0 7%, transparent 8%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 242, 171, 0.98) 0 7%, transparent 8%),
    radial-gradient(ellipse at 0% 50%, rgba(255, 211, 85, 0.92) 0 7%, transparent 8%);
  filter:
    drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4))
    drop-shadow(0 4px 5px rgba(0, 0, 0, 0.26));
}

.primitive-card-front .color-pip em,
.primitive-back-color-chip .color-pip em {
  z-index: 5;
}

.primitive-back-trait-grid .primitive-cheat-art::after {
  right: -5px;
  bottom: -5px;
  transform: scale(0.72);
  transform-origin: center;
}

.primitive-back-color-chip .color-pip {
  box-shadow:
    0 0 0 2px rgba(25, 20, 17, 0.96),
    0 0 0 3px rgba(246, 193, 70, 0.96),
    0 0 0 4px rgba(82, 51, 12, 0.86),
    0 7px 14px rgba(0, 0, 0, 0.32),
    inset 0 0 0 2px rgba(255, 255, 255, 0.15),
    inset 0 0 0 5px rgba(17, 24, 39, 0.28);
}

.primitive-story-quote {
  z-index: 1;
  gap: 7px;
  margin: 8px 14px 0;
  padding: 11px 13px;
}

.primitive-story-quote h4 {
  font-size: 0.56rem;
}

.primitive-story-quote p {
  -webkit-line-clamp: 5;
  font-size: 0.82rem;
  line-height: 1.2;
}

.primitive-story-quote footer {
  z-index: 3;
  font-size: 0.5rem;
}

.primitive-story-quote footer strong {
  font-size: 0.5rem;
}

.primitive-contract-signature {
  z-index: 20;
  bottom: 33px;
  max-width: 160px;
  font-size: calc(3.2rem * var(--signature-scale, 1));
  opacity: 0.34;
}

.primitive-contract-signature.is-print,
.primitive-contract-signature.is-standard {
  font-size: calc(2.08rem * var(--signature-scale, 1));
  opacity: 0.28;
}

.primitive-buzz-link {
  width: 32px;
  height: 32px;
}

/* Card tile spec: identity and cost, one-line combat row, portrait, then state sockets. */
.deck-card-tile-header {
  position: relative;
  grid-template-columns: 38px minmax(0, 1fr) minmax(76px, 0.9fr) 26px;
  grid-template-rows: 42px;
  min-height: 50px;
  margin-bottom: 0;
  gap: 0 5px;
  padding: 4px 5px;
  border: 1px solid rgba(255, 224, 138, 0.32);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(5, 23, 34, 0.96), rgba(3, 35, 47, 0.9));
}

.deck-card-header-identity {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.deck-card-header-identity .deck-build-medallion {
  position: relative;
  inset: auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.deck-card-header-identity .deck-build-medallion img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.deck-card-header-identity .deck-card-cost-badge {
  position: absolute;
  top: 19px;
  left: 19px;
  z-index: 2;
  width: 22px;
  height: 22px;
  font-size: 0.62rem;
}

.deck-card-art-cost {
  position: absolute;
  right: -13px;
  bottom: -13px;
  z-index: 6;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.68));
}

.deck-card-art-cost b {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #162432;
  font-size: 0.98rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.88);
}

.deck-card-header-copy {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.deck-card-header-copy strong {
  display: block;
  font-size: 0.98rem;
  line-height: 1;
}

.deck-card-tile-header > .deck-combat-pips {
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  width: 100%;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
}

.deck-card-tile-header > .deck-combat-pips span {
  grid-template-rows: 24px;
}

.deck-card-tile-header > .deck-combat-pips img {
  width: 26px;
  height: 26px;
}

.deck-card-tile-header > .deck-combat-pips b {
  font-size: 0.68rem;
}

.deck-card-tile-header > .deck-combat-pips small {
  display: none;
}

.deck-card-view-button {
  position: relative;
  top: auto;
  right: auto;
  grid-column: 3;
  grid-row: 1;
  z-index: 2;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  align-self: start;
  border: 1px solid rgba(149, 241, 223, 0.62);
  border-radius: 50%;
  background: rgba(3, 27, 39, 0.9);
  color: #dffdf7;
  font-size: 0.86rem;
  font-weight: 950;
}

.deck-card-footer-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 2px 4px;
  border: 1px solid rgba(149, 241, 223, 0.2);
  border-radius: 8px;
  background: rgba(3, 25, 38, 0.78);
}

.deck-card-slot-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(149, 241, 223, 0.52);
  border-radius: 50%;
  color: #eefcff;
  font-size: 0.72rem;
  font-weight: 950;
}

.deck-card-footer-row strong {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.84rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-table-view-button,
.deck-table-remove-button {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(149, 241, 223, 0.28);
  border-radius: 50%;
  background: rgba(149, 241, 223, 0.16);
  color: #95f1df;
  font-size: 0.78rem;
  font-weight: 950;
}

.deck-table-remove-button {
  border-color: rgba(255, 151, 122, 0.26);
  background: rgba(255, 151, 122, 0.18);
  color: #ffd8ce;
}

.deck-card-socket-row {
  min-width: 0;
  min-height: 40px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 2px 4px 0;
}

.deck-card-socket-row > span {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  min-width: 0;
}

.deck-card-socket-row > span > b {
  max-width: 100%;
  overflow: hidden;
  color: #70f6e8;
  font-size: 0.47rem;
  font-weight: 950;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.deck-card-socket-row .deck-socket {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.deck-card-socket-row .deck-socket--banner {
  border-radius: 4px 4px 10px 10px;
}

.deck-card-socket-row .deck-socket img {
  width: 24px;
  height: 24px;
}

.deck-pool-card,
.deck-hand-card {
  border-radius: 12px;
}

.deck-pool-card {
  grid-template-rows: 60px minmax(0, 1fr) 42px;
  gap: 5px;
  padding: 7px;
}

.deck-pool-card .deck-card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  margin-bottom: 0;
}

.deck-pool-card .deck-card-socket-row--library {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.deck-pool-card .deck-card-socket-row--library > span:nth-child(n + 3) {
  display: none;
}

@media (min-width: 981px) {
  .deck-table-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    grid-template-rows: 198px;
    gap: 6px;
    align-items: stretch;
  }

  .deck-roster-panel,
  .deck-hand-panel {
    border: 1px solid rgba(149, 241, 223, 0.28);
    border-radius: 10px;
    padding: 8px;
  }

  .deck-roster-panel {
    border-color: rgba(84, 242, 226, 0.42);
    background: linear-gradient(180deg, rgba(5, 67, 71, 0.56), rgba(3, 28, 42, 0.72));
    box-shadow: inset 0 2px 0 rgba(84, 242, 226, 0.2);
  }

  .deck-hand-panel {
    border-color: rgba(255, 224, 138, 0.46);
    background: linear-gradient(180deg, rgba(62, 48, 28, 0.46), rgba(5, 28, 40, 0.82));
    box-shadow: inset 0 2px 0 rgba(255, 224, 138, 0.26);
  }

  .deck-roster-panel .deck-card-reel-shell,
  .deck-hand-panel .deck-table-grid {
    min-width: 0;
  }

  .deck-panel-label h4 {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }

  .deck-lane-kicker {
    color: #95f1df;
    font-size: 0.56rem;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .deck-hand-panel .deck-lane-kicker {
    color: #ffe08a;
  }

  .deck-hand-panel .deck-table-grid {
    height: 198px !important;
    min-height: 198px !important;
    grid-template-rows: 198px !important;
    grid-auto-rows: 198px !important;
  }

  .deck-hand-card,
  .deck-table-grid .deck-table-slot.is-empty {
    height: 198px !important;
    min-height: 198px !important;
    aspect-ratio: 5 / 8 !important;
  }

  .deck-hand-card {
    grid-template-rows: 44px minmax(0, 1fr) 34px !important;
    gap: 2px !important;
    padding: 4px !important;
  }

  .deck-hand-card .deck-card-tile-header,
  .deck-pool-card .deck-card-tile-header {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    grid-template-rows: 21px 25px !important;
    height: 46px !important;
    min-height: 46px !important;
    padding: 2px 4px !important;
  }

  .deck-hand-card .deck-card-header-identity,
  .deck-pool-card .deck-card-header-identity,
  .deck-hand-card .deck-card-header-identity .deck-build-medallion,
  .deck-hand-card .deck-card-header-identity .deck-build-medallion img,
  .deck-pool-card .deck-card-header-identity .deck-build-medallion,
  .deck-pool-card .deck-card-header-identity .deck-build-medallion img {
    width: 36px !important;
    height: 36px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips {
    width: 96px !important;
    grid-template-columns: repeat(4, 24px) !important;
    gap: 0 !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips span,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips span,
  .deck-hand-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
    width: 27px !important;
    height: 27px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips span,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips span {
    height: 25px !important;
    grid-template-rows: 25px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.76rem !important;
    -webkit-text-stroke-width: 0.55px;
  }

  .deck-hand-card .deck-card-header-copy strong,
  .deck-pool-card .deck-card-header-copy strong {
    font-size: 0.74rem !important;
  }

  .deck-hand-card .deck-card-header-actions,
  .deck-pool-card .deck-card-header-actions {
    top: 3px !important;
    right: 3px !important;
  }

  .deck-hand-card .deck-card-header-actions button,
  .deck-pool-card .deck-card-header-actions button {
    width: 14px !important;
    height: 14px !important;
    flex-basis: 14px !important;
    font-size: 0.5rem !important;
  }

  .deck-hand-card .deck-card-art-cost,
  .deck-pool-card .deck-card-art-cost {
    width: 30px !important;
    height: 30px !important;
    right: 3px !important;
    bottom: 3px !important;
  }

  .deck-hand-card .deck-card-art-cost b,
  .deck-pool-card .deck-card-art-cost b {
    font-size: 0.82rem !important;
  }

  .deck-hand-card .deck-card-socket-row,
  .deck-pool-card .deck-card-socket-row--library {
    height: 34px !important;
  }

  .deck-hand-card .deck-card-socket-row .deck-socket,
  .deck-pool-card .deck-card-socket-row--library .deck-socket {
    width: 28px !important;
    height: 28px !important;
  }

  .deck-hand-card .deck-card-socket-row .deck-socket img,
  .deck-pool-card .deck-card-socket-row--library .deck-socket img {
    width: 23px !important;
    height: 23px !important;
  }

  .deck-pool-card {
    flex: 0 0 124px !important;
    width: 124px !important;
    height: 198px !important;
    min-height: 198px !important;
    grid-template-rows: 46px minmax(0, 1fr) 34px !important;
    gap: 2px !important;
    padding: 4px !important;
  }

  .deck-card-pool {
    gap: 6px;
    padding-bottom: 4px;
  }

  .deck-builder-columns {
    grid-template-rows: 222px 222px 132px !important;
  }

  .deck-hand-panel {
    min-height: 0 !important;
    height: 222px !important;
    overflow: hidden !important;
  }
}

  .deck-hand-card {
    height: 262px;
    grid-template-rows: 50px minmax(0, 1fr) 37px 46px;
    gap: 4px;
    padding: 6px;
  }

  .deck-hand-card .deck-card-tile-header {
    grid-template-columns: 38px minmax(0, 1fr) minmax(76px, 0.9fr) 26px;
    grid-template-rows: 42px;
    min-height: 50px;
    padding: 4px 5px;
  }

  .deck-hand-card .deck-card-header-copy strong {
    font-size: 0.9rem;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips {
    grid-column: 3;
    grid-row: 1;
    gap: 2px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips img {
    width: 23px;
    height: 23px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.58rem;
  }

.deck-hand-card .deck-card-tile-header > .deck-combat-pips small {
    display: none;
}

/* Annotated desktop target: identity upper-left, cost contained by the art window. */
.deck-hand-card,
.deck-pool-card {
  overflow: hidden;
  box-sizing: border-box;
}

.deck-card-tile-header {
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: 28px 36px;
  min-height: 66px;
  padding-left: 4px;
  padding-right: 42px;
}

.deck-card-header-identity {
  width: 48px;
  height: 48px;
  align-self: start;
  justify-self: start;
}

.deck-card-header-identity .deck-build-medallion,
.deck-card-header-identity .deck-build-medallion img {
  width: 48px;
  height: 48px;
}

.deck-card-header-identity .deck-card-cost-badge {
  display: none;
}

.deck-card-portrait,
.deck-card-art {
  overflow: hidden;
}

.deck-card-art-cost {
  top: auto !important;
  left: auto !important;
  right: 6px;
  bottom: 6px;
  width: 38px;
  height: 38px;
}

.deck-card-art-cost b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 #18212b,
    1px 0 0 #18212b,
    0 -1px 0 #18212b,
    -1px 0 0 #18212b,
    0 2px 5px rgba(0, 0, 0, 0.9);
}

.deck-card-tile-header > .deck-combat-pips {
  grid-column: 2;
  grid-row: 2;
  width: 124px;
  justify-self: end;
  align-self: center;
  gap: 3px;
}

.deck-card-tile-header > .deck-combat-pips span {
  width: 28px;
  height: 36px;
  grid-template-rows: 36px;
  place-items: center;
}

.deck-card-tile-header > .deck-combat-pips img,
.deck-card-tile-header > .deck-combat-pips b {
  width: 36px;
  height: 36px;
}

.deck-card-tile-header > .deck-combat-pips b {
  z-index: 2;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 #18212b,
    1px 0 0 #18212b,
    0 -1px 0 #18212b,
    -1px 0 0 #18212b;
}

.deck-card-tile-header > .deck-combat-pips small {
  display: none !important;
}

.deck-card-header-actions {
  top: 5px;
  right: 5px;
  gap: 2px;
}

.deck-card-header-actions .deck-card-view-button,
.deck-card-header-actions .deck-table-remove-button {
  flex-basis: 16px;
  width: 16px;
  height: 16px;
  font-size: 0.58rem;
  line-height: 1;
}

.deck-card-socket-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  align-items: start;
}

.deck-card-socket-row > span {
  justify-items: start;
  width: 100%;
  padding: 0;
}

.deck-card-socket-row .deck-socket {
  width: 36px;
  height: 36px;
}

.deck-card-socket-row .deck-socket img {
  width: 30px;
  height: 30px;
}

.deck-card-socket-row > span > b {
  display: none !important;
}

@media (max-width: 980px) {
  .deck-card-tile-header {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: 26px 31px;
    min-height: 57px;
  }

  .deck-card-header-identity,
  .deck-card-header-identity .deck-build-medallion,
  .deck-card-header-identity .deck-build-medallion img {
    width: 40px;
    height: 40px;
  }

  .deck-card-tile-header > .deck-combat-pips {
    width: 108px;
  }

  .deck-card-tile-header > .deck-combat-pips span,
  .deck-card-tile-header > .deck-combat-pips img,
  .deck-card-tile-header > .deck-combat-pips b {
    width: 31px;
    height: 31px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.72rem;
  }

  .deck-card-art-cost {
    right: 5px;
    bottom: 5px;
    width: 32px;
    height: 32px;
  }

  .deck-card-art-cost b {
    font-size: 0.82rem;
  }

  .deck-card-header-actions .deck-card-view-button,
  .deck-card-header-actions .deck-table-remove-button {
    flex-basis: 15px;
    width: 15px;
    height: 15px;
    font-size: 0.54rem;
  }
}

  .deck-card-portrait {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .deck-card-footer-row {
    min-height: 37px;
  }

  .deck-card-socket-row .deck-socket {
    width: 24px;
    height: 24px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 980px) {
  .deck-pool-card {
    grid-template-rows: 56px minmax(0, 1fr) 38px;
  }

  .deck-hand-card {
    height: 258px;
    grid-template-rows: 50px minmax(0, 1fr) 35px 42px;
    gap: 3px;
    padding: 5px;
  }

  .deck-hand-card .deck-card-tile-header,
  .deck-pool-card .deck-card-tile-header {
    grid-template-columns: 34px minmax(0, 1fr) minmax(64px, 0.9fr) 26px;
    grid-template-rows: 42px;
    min-height: 50px;
    padding: 3px 4px;
  }

  .deck-card-header-identity {
    width: 32px;
    height: 36px;
  }

  .deck-card-header-identity .deck-build-medallion,
  .deck-card-header-identity .deck-build-medallion img {
    width: 32px;
    height: 32px;
  }

  .deck-card-header-identity .deck-card-cost-badge {
    top: 17px;
    left: 17px;
    width: 19px;
    height: 19px;
    font-size: 0.52rem;
  }

  .deck-card-header-copy strong {
    font-size: 0.84rem;
  }

  .deck-card-tile-header > .deck-combat-pips {
    grid-column: 3;
    grid-row: 1;
    gap: 1px;
  }

  .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 21px 8px;
  }

  .deck-card-tile-header > .deck-combat-pips img {
    width: 21px;
    height: 21px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.54rem;
  }

  .deck-card-tile-header > .deck-combat-pips small {
    display: none;
  }

  .deck-card-view-button {
    width: 25px;
    height: 25px;
    font-size: 0.76rem;
  }

  .deck-card-footer-row {
    grid-template-columns: 32px minmax(0, 1fr) 25px 25px;
    min-height: 35px;
    gap: 3px;
  }

  .deck-card-slot-number {
    width: 27px;
    height: 27px;
    font-size: 0.66rem;
  }

  .deck-card-footer-row strong {
    font-size: 0.76rem;
  }

  .deck-table-view-button,
  .deck-table-remove-button {
    width: 25px;
    height: 25px;
  }

  .deck-card-socket-row .deck-socket {
    width: 22px;
    height: 22px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 18px;
    height: 18px;
  }

  .deck-card-socket-row > span > b {
    font-size: 0.4rem;
  }
}

@media (max-width: 560px) {
  .deck-table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 258px;
    overflow: visible;
  }

  .deck-hand-card {
    width: 100%;
    height: 258px;
  }
}

/* Final tile alignment: occupied cards keep only the spec header, art, and socket row. */
.deck-card-tile-header {
  grid-template-columns: 38px minmax(52px, 0.8fr) minmax(90px, 1.25fr) 48px;
  grid-template-rows: 28px 28px;
  min-height: 60px;
}

.deck-card-header-copy {
  grid-column: 2;
  grid-row: 1;
}

.deck-card-tile-header > .deck-combat-pips {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  width: 100%;
  gap: 2px;
}

.deck-card-tile-header > .deck-combat-pips span {
  grid-template-rows: 24px 8px;
}

.deck-card-tile-header > .deck-combat-pips img {
  width: 24px;
  height: 24px;
}

.deck-card-tile-header > .deck-combat-pips b {
  font-size: 0.62rem;
}

.deck-card-tile-header > .deck-combat-pips small {
  display: block;
  font-size: 0.34rem;
}

.deck-card-header-actions {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: start;
  gap: 3px;
}

.deck-card-header-actions .deck-card-view-button,
.deck-card-header-actions .deck-table-remove-button {
  position: static;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.deck-card-header-actions .deck-card-view-button {
  border-color: rgba(149, 241, 223, 0.62);
}

.deck-card-header-actions .deck-table-remove-button {
  border-color: rgba(255, 151, 122, 0.32);
}

.deck-card-footer-row {
  display: none;
}

.deck-hand-card {
  grid-template-rows: 60px minmax(0, 1fr) 46px;
}

.deck-card-socket-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.deck-card-socket-row > span {
  width: 100%;
}

@media (min-width: 981px) {
  .deck-hand-card {
    grid-template-rows: 60px minmax(0, 1fr) 46px;
  }
}

@media (max-width: 980px) {
  .deck-card-tile-header {
    grid-template-columns: 34px minmax(44px, 0.78fr) minmax(68px, 1.2fr) 46px;
    grid-template-rows: 26px 26px;
    min-height: 56px;
  }

  .deck-card-tile-header > .deck-combat-pips {
    grid-column: 3;
    grid-row: 2;
    gap: 1px;
  }

  .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 20px 7px;
  }

  .deck-card-tile-header > .deck-combat-pips img {
    width: 20px;
    height: 20px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.52rem;
  }

  .deck-card-tile-header > .deck-combat-pips small {
    font-size: 0.28rem;
  }

  .deck-card-header-actions .deck-card-view-button,
  .deck-card-header-actions .deck-table-remove-button {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
    font-size: 0.62rem;
  }

  .deck-hand-card {
    grid-template-rows: 56px minmax(0, 1fr) 42px;
  }
}

@media (max-width: 560px) {
  .deck-card-tile-header {
    grid-template-columns: 32px minmax(38px, 0.75fr) minmax(60px, 1.25fr) 44px;
  }

  .deck-card-header-copy strong {
    font-size: 0.78rem;
  }

  .deck-card-tile-header > .deck-combat-pips img {
    width: 18px;
    height: 18px;
  }

  .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 18px 6px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.48rem;
  }

  .deck-card-tile-header > .deck-combat-pips small {
    font-size: 0.25rem;
  }

  .deck-hand-card {
    grid-template-rows: 56px minmax(0, 1fr) 42px;
  }

  .deck-card-socket-row > span > b {
    font-size: 0.37rem;
  }
}

/* Reference alignment: title has the full first line; controls float top-right; stats sit right below. */
.deck-card-tile-header {
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 28px 28px;
  min-height: 60px;
  padding-right: 44px;
}

.deck-card-header-identity {
  grid-column: 1;
  grid-row: 1 / -1;
  width: 36px;
  height: 36px;
}

.deck-card-header-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding-right: 2px;
}

.deck-card-header-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-card-tile-header > .deck-combat-pips {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  width: 84px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
}

.deck-card-tile-header > .deck-combat-pips span {
  grid-template-rows: 22px 7px;
}

.deck-card-tile-header > .deck-combat-pips img {
  width: 22px;
  height: 22px;
}

.deck-card-tile-header > .deck-combat-pips b {
  font-size: 0.58rem;
}

.deck-card-tile-header > .deck-combat-pips small {
  display: block;
  font-size: 0.3rem;
}

.deck-card-header-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 3px;
}

.deck-card-header-actions .deck-card-view-button,
.deck-card-header-actions .deck-table-remove-button {
  position: static;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.deck-card-header-actions .deck-card-view-button {
  border-color: rgba(149, 241, 223, 0.62);
  background: rgba(3, 27, 39, 0.9);
}

.deck-card-header-actions .deck-table-remove-button {
  border-color: rgba(255, 151, 122, 0.32);
}

.deck-card-socket-row,
.deck-pool-card .deck-card-socket-row--library {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
}

.deck-pool-card .deck-card-socket-row--library > span:nth-child(n + 3) {
  display: grid;
}

@media (min-width: 981px) {
  .deck-card-tile-header > .deck-combat-pips {
    width: 92px;
  }

  .deck-card-tile-header > .deck-combat-pips img {
    width: 24px;
    height: 24px;
  }

  .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 24px 7px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.62rem;
  }

  .deck-card-tile-header > .deck-combat-pips small {
    font-size: 0.32rem;
  }
}

@media (max-width: 560px) {
  .deck-card-tile-header {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: 26px 26px;
    min-height: 56px;
    padding-right: 42px;
  }

  .deck-card-header-identity {
    width: 32px;
    height: 32px;
  }

  .deck-card-header-identity .deck-build-medallion,
  .deck-card-header-identity .deck-build-medallion img {
    width: 32px;
    height: 32px;
  }

  .deck-card-header-identity .deck-card-cost-badge {
    top: 16px;
    left: 16px;
  }

  .deck-card-tile-header > .deck-combat-pips {
    width: 76px;
  }

  .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 19px 6px;
  }

  .deck-card-tile-header > .deck-combat-pips img {
    width: 19px;
    height: 19px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.5rem;
  }

  .deck-card-tile-header > .deck-combat-pips small {
    font-size: 0.25rem;
  }
}

/* Final reference pass: keep the cost readable at the art edge and leave the footer icon-only. */
.deck-hand-card,
.deck-pool-card {
  overflow: visible;
}

.deck-card-tile-header {
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 28px 36px;
  min-height: 66px;
  padding-right: 44px;
}

.deck-card-header-identity {
  grid-row: 1 / -1;
}

.deck-card-header-identity .deck-card-cost-badge {
  top: 26px;
  left: 20px;
  z-index: 7;
  width: 30px;
  height: 30px;
  font-size: 0.84rem;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.62));
}

.deck-card-header-identity .deck-card-cost-badge b {
  z-index: 2;
  color: #182534;
  font-size: 0.8rem;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.deck-card-tile-header > .deck-combat-pips {
  grid-column: 2;
  grid-row: 2;
  width: 104px;
  justify-self: end;
  align-self: center;
  gap: 2px;
}

.deck-card-tile-header > .deck-combat-pips span {
  grid-template-rows: 31px;
  width: 25px;
  height: 31px;
}

.deck-card-tile-header > .deck-combat-pips img {
  width: 31px;
  height: 31px;
}

.deck-card-tile-header > .deck-combat-pips b {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  font-size: 0.76rem;
  line-height: 1;
  text-align: center;
}

.deck-card-tile-header > .deck-combat-pips small {
  display: none;
}

.deck-card-socket-row,
.deck-pool-card .deck-card-socket-row--library {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  align-items: start;
}

.deck-card-socket-row > span {
  justify-items: start;
  align-items: start;
  width: 100%;
  padding-left: 0;
}

.deck-card-socket-row .deck-socket {
  width: 36px;
  height: 36px;
}

.deck-card-socket-row .deck-socket img {
  width: 30px;
  height: 30px;
}

.deck-card-socket-row > span > b {
  display: none;
}

.deck-pool-card .deck-card-socket-row--library > span:nth-child(n + 3) {
  display: grid;
}

.deck-hand-card {
  grid-template-rows: 66px minmax(0, 1fr) 40px;
  gap: 4px;
  padding-bottom: 4px;
}

.deck-card-portrait {
  overflow: visible;
}

.deck-card-portrait > img {
  border-radius: inherit;
}

@media (min-width: 981px) {
  .deck-hand-card {
    height: 262px;
    grid-template-rows: 66px minmax(0, 1fr) 40px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips {
    width: 104px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips span {
    width: 25px;
    height: 31px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b {
    width: 31px;
    height: 31px;
  }
}

@media (max-width: 980px) {
  .deck-card-tile-header {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: 26px 31px;
    min-height: 57px;
    padding-right: 42px;
  }

  .deck-card-header-identity {
    width: 32px;
    height: 32px;
  }

  .deck-card-header-identity .deck-card-cost-badge {
    display: none;
  }

  .deck-card-art-cost {
    right: -10px;
    bottom: -10px;
    width: 31px;
    height: 31px;
  }

  .deck-card-art-cost b {
    font-size: 0.76rem;
  }

  .deck-card-tile-header > .deck-combat-pips {
    width: 92px;
  }

  .deck-card-tile-header > .deck-combat-pips span,
  .deck-card-tile-header > .deck-combat-pips img,
  .deck-card-tile-header > .deck-combat-pips b {
    width: 27px;
    height: 27px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.64rem;
  }

  .deck-card-socket-row .deck-socket {
    width: 31px;
    height: 31px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 26px;
    height: 26px;
  }

  .deck-hand-card {
    grid-template-rows: 57px minmax(0, 1fr) 35px;
  }
}

@media (max-width: 560px) {
  .deck-card-tile-header > .deck-combat-pips {
    width: 84px;
  }

  .deck-card-tile-header > .deck-combat-pips span,
  .deck-card-tile-header > .deck-combat-pips img,
  .deck-card-tile-header > .deck-combat-pips b {
    width: 24px;
    height: 24px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.56rem;
  }

  .deck-card-socket-row .deck-socket {
    width: 27px;
    height: 27px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 23px;
    height: 23px;
  }
}

/* Keep the deck-card rules above the older desktop/mobile compatibility selectors. */
.deck-hand-card .deck-card-tile-header {
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 28px 36px;
  min-height: 66px;
  padding-right: 44px;
}

.deck-hand-card .deck-card-header-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  width: 104px;
  gap: 1px;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips span {
  grid-template-rows: 31px;
  width: 25px;
  height: 31px;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips img {
  width: 31px;
  height: 31px;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips b {
  width: 31px;
  height: 31px;
  font-size: 0.76rem;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips small {
  display: none;
}

.deck-hand-card .deck-card-header-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 4;
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 3px;
}

.deck-hand-card .deck-card-header-actions .deck-card-view-button,
.deck-hand-card .deck-card-header-actions .deck-table-remove-button {
  position: static;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

@media (max-width: 560px) {
  .deck-hand-card .deck-card-tile-header {
    grid-template-columns: 32px minmax(0, 1fr);
    grid-template-rows: 26px 31px;
    min-height: 57px;
    padding-right: 42px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips {
    width: 84px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 24px;
    width: 24px;
    height: 24px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips img {
    width: 24px;
    height: 24px;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b {
    width: 24px;
    height: 24px;
    font-size: 0.56rem;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips small {
    display: none;
  }
}

/* Annotated card target: keep identity, stats, art cost, and sockets readable at tile size. */
.deck-pool-card,
.deck-hand-card {
  box-sizing: border-box;
  overflow: hidden;
}

.deck-card-tile-header {
  position: relative;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: 30px 34px;
  min-height: 68px;
  padding: 4px 34px 2px 4px;
  gap: 0;
}

.deck-card-header-identity {
  grid-column: 1;
  grid-row: 1 / -1;
  width: 48px;
  height: 48px;
  align-self: start;
  justify-self: start;
}

.deck-card-header-identity .deck-build-medallion,
.deck-card-header-identity .deck-build-medallion img {
  width: 48px;
  height: 48px;
}

.deck-card-header-identity .deck-card-cost-badge {
  display: none;
}

.deck-card-header-copy {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
}

.deck-card-tile-header > .deck-combat-pips {
  grid-column: 2;
  grid-row: 2;
  width: 131px;
  justify-self: end;
  align-self: center;
  grid-template-columns: repeat(4, 32px);
  gap: 1px;
}

.deck-card-tile-header > .deck-combat-pips span,
.deck-card-tile-header > .deck-combat-pips img,
.deck-card-tile-header > .deck-combat-pips b {
  width: 32px;
  height: 32px;
}

.deck-card-tile-header > .deck-combat-pips span {
  grid-template-rows: 32px;
  place-items: center;
}

.deck-card-tile-header > .deck-combat-pips img {
  object-fit: contain;
}

.deck-card-tile-header > .deck-combat-pips b {
  z-index: 2;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 #18212b,
    1px 0 0 #18212b,
    0 -1px 0 #18212b,
    -1px 0 0 #18212b,
    0 2px 4px rgba(0, 0, 0, 0.9);
}

.deck-card-tile-header > .deck-combat-pips small {
  display: none !important;
}

.deck-card-header-actions {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  display: flex;
  gap: 2px;
}

.deck-card-header-actions button,
.deck-hand-card .deck-card-header-actions button {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 50%;
  font-size: 0.56rem;
  line-height: 1;
}

.deck-card-art,
.deck-card-portrait {
  position: relative;
  overflow: hidden;
}

.deck-card-art-cost {
  top: auto !important;
  left: auto !important;
  right: 5px;
  bottom: 5px;
  z-index: 3;
  width: 38px;
  height: 38px;
}

.deck-card-art-cost b {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: #ffffff !important;
  font-size: 1rem;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 1px 0 #18212b,
    1px 0 0 #18212b,
    0 -1px 0 #18212b,
    -1px 0 0 #18212b,
    0 2px 5px rgba(0, 0, 0, 0.9);
}

.deck-card-socket-row,
.deck-pool-card .deck-card-socket-row--library {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  align-items: start;
}

.deck-card-socket-row > span {
  width: 100%;
  padding: 0;
  justify-items: start;
}

.deck-card-socket-row .deck-socket {
  width: 36px;
  height: 36px;
}

.deck-card-socket-row .deck-socket img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.deck-card-socket-row > span > b {
  display: none !important;
}

@media (max-width: 980px) {
  .deck-card-tile-header {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: 27px 31px;
    min-height: 62px;
    padding-right: 30px;
  }

  .deck-card-header-identity,
  .deck-card-header-identity .deck-build-medallion,
  .deck-card-header-identity .deck-build-medallion img {
    width: 42px;
    height: 42px;
  }

  .deck-card-tile-header > .deck-combat-pips {
    width: 115px;
    grid-template-columns: repeat(4, 28px);
  }

  .deck-card-tile-header > .deck-combat-pips span,
  .deck-card-tile-header > .deck-combat-pips img,
  .deck-card-tile-header > .deck-combat-pips b {
    width: 28px;
    height: 28px;
  }

  .deck-card-tile-header > .deck-combat-pips span {
    grid-template-rows: 28px;
  }

  .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.68rem;
  }

  .deck-card-art-cost {
    right: 4px;
    bottom: 4px;
    width: 32px;
    height: 32px;
  }

  .deck-card-art-cost b {
    font-size: 0.84rem;
  }

  .deck-card-socket-row .deck-socket {
    width: 32px;
    height: 32px;
  }

  .deck-card-socket-row .deck-socket img {
    width: 27px;
    height: 27px;
  }
}

/* Effective final target: these rules intentionally come after all legacy responsive rules. */
.deck-hand-card .deck-card-tile-header,
.deck-pool-card .deck-card-tile-header {
  grid-template-columns: 52px minmax(0, 1fr) !important;
  grid-template-rows: 28px 34px !important;
  height: 66px !important;
  min-height: 0 !important;
  padding: 3px 6px 1px 3px !important;
  gap: 0 !important;
}

.deck-hand-card .deck-card-header-identity,
.deck-pool-card .deck-card-header-identity {
  grid-column: 1 !important;
  grid-row: 1 / -1 !important;
  width: 52px !important;
  height: 52px !important;
}

.deck-hand-card .deck-card-header-identity .deck-build-medallion,
.deck-hand-card .deck-card-header-identity .deck-build-medallion img,
.deck-pool-card .deck-card-header-identity .deck-build-medallion,
.deck-pool-card .deck-card-header-identity .deck-build-medallion img {
  width: 52px !important;
  height: 52px !important;
}

.deck-hand-card .deck-card-header-copy,
.deck-pool-card .deck-card-header-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips {
  grid-column: 2 !important;
  grid-row: 2 !important;
  justify-self: start !important;
  width: 112px !important;
  grid-template-columns: repeat(4, 28px) !important;
  gap: 0 !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips span,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips span {
  width: 28px !important;
  height: 34px !important;
  grid-template-rows: 34px !important;
  overflow: visible !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips img,
.deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips img,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
  width: 34px !important;
  height: 34px !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
  display: grid !important;
  place-items: center !important;
  color: #ffffff !important;
  font-size: 0.8rem !important;
  text-align: center !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips small,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips small {
  display: none !important;
}

.deck-hand-card .deck-card-header-actions,
.deck-pool-card .deck-card-header-actions {
  top: 5px !important;
  right: 5px !important;
  gap: 2px !important;
}

.deck-hand-card .deck-card-header-actions button,
.deck-pool-card .deck-card-header-actions button {
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0.56rem !important;
}

.deck-hand-card .deck-card-portrait,
.deck-pool-card .deck-card-art {
  position: relative !important;
  overflow: hidden !important;
}

.deck-hand-card .deck-card-art-cost,
.deck-pool-card .deck-card-art-cost {
  top: auto !important;
  left: auto !important;
  right: 5px !important;
  bottom: 5px !important;
  width: 40px !important;
  height: 40px !important;
  z-index: 3 !important;
}

.deck-hand-card .deck-card-art-cost b,
.deck-pool-card .deck-card-art-cost b {
  position: absolute !important;
  inset: 0 !important;
  display: grid !important;
  place-items: center !important;
  color: #ffffff !important;
  font-size: 1.06rem !important;
  font-weight: 1000 !important;
  text-align: center !important;
  text-shadow: 0 1px 0 #18212b, 1px 0 0 #18212b, 0 -1px 0 #18212b, -1px 0 0 #18212b, 0 2px 5px rgba(0, 0, 0, 0.9) !important;
}

.deck-hand-card .deck-card-socket-row,
.deck-pool-card .deck-card-socket-row--library {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0 !important;
  padding: 0 !important;
  align-items: start !important;
}

.deck-hand-card .deck-card-socket-row > span,
.deck-pool-card .deck-card-socket-row--library > span {
  width: 100% !important;
  padding: 0 !important;
  justify-items: start !important;
  align-items: end !important;
}

.deck-hand-card .deck-card-socket-row .deck-socket,
.deck-pool-card .deck-card-socket-row--library .deck-socket {
  width: 36px !important;
  height: 36px !important;
  align-self: end !important;
}

.deck-hand-card .deck-card-socket-row .deck-socket img,
.deck-pool-card .deck-card-socket-row--library .deck-socket img {
  width: 30px !important;
  height: 30px !important;
  object-fit: contain !important;
}

@media (max-width: 980px) {
  .deck-hand-card .deck-card-tile-header,
  .deck-pool-card .deck-card-tile-header {
    grid-template-columns: 44px minmax(0, 1fr) !important;
    grid-template-rows: 26px 31px !important;
    height: 60px !important;
    padding-right: 4px !important;
  }

  .deck-hand-card .deck-card-header-identity,
  .deck-pool-card .deck-card-header-identity,
  .deck-hand-card .deck-card-header-identity .deck-build-medallion,
  .deck-hand-card .deck-card-header-identity .deck-build-medallion img,
  .deck-pool-card .deck-card-header-identity .deck-build-medallion,
  .deck-pool-card .deck-card-header-identity .deck-build-medallion img {
    width: 44px !important;
    height: 44px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips {
    width: 108px !important;
    grid-template-columns: repeat(4, 27px) !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips span,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips span {
    width: 27px !important;
    height: 31px !important;
    grid-template-rows: 31px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
    width: 31px !important;
    height: 31px !important;
  }

  .deck-hand-card .deck-card-art-cost,
  .deck-pool-card .deck-card-art-cost {
    right: 4px !important;
    bottom: 4px !important;
    width: 34px !important;
    height: 34px !important;
  }

  .deck-hand-card .deck-card-art-cost b,
  .deck-pool-card .deck-card-art-cost b {
    font-size: 0.9rem !important;
  }

  .deck-hand-card .deck-card-socket-row .deck-socket,
  .deck-pool-card .deck-card-socket-row--library .deck-socket {
    width: 32px !important;
    height: 32px !important;
  }

  .deck-hand-card .deck-card-socket-row .deck-socket img,
  .deck-pool-card .deck-card-socket-row--library .deck-socket img {
    width: 27px !important;
    height: 27px !important;
  }
}

/* Final fit pass: the raster badge itself owns the 30px slot, so it cannot be squeezed by max-width. */
.deck-hand-card .deck-card-tile-header,
.deck-pool-card .deck-card-tile-header {
  grid-template-rows: 26px 32px !important;
  height: 60px !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips {
  width: 120px !important;
  grid-template-columns: repeat(4, 30px) !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips span,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips span {
  width: 30px !important;
  height: 32px !important;
  grid-template-rows: 32px !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips img,
.deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips img,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
  width: 34px !important;
  height: 34px !important;
  max-width: none !important;
}

.deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
  font-size: 0.74rem !important;
}

.deck-hand-card {
  height: 262px !important;
  grid-template-rows: 60px 130px 44px !important;
  gap: 2px !important;
  padding: 3px !important;
}

@media (max-width: 980px) {
  .deck-hand-card .deck-card-tile-header,
  .deck-pool-card .deck-card-tile-header {
    grid-template-rows: 25px 30px !important;
    height: 56px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips {
    width: 108px !important;
    grid-template-columns: repeat(4, 27px) !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips span,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips span {
    width: 27px !important;
    height: 30px !important;
    grid-template-rows: 30px !important;
  }

  .deck-hand-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips img,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
    width: 31px !important;
    height: 31px !important;
    max-width: none !important;
  }

  .deck-hand-card {
    height: 220px !important;
    grid-template-rows: 56px 96px 40px !important;
    align-content: start !important;
    padding: 6px !important;
  }
}

/* Taller card target: 5:8 width-to-height, with the art using the added space. */
@media (min-width: 981px) {
  .deck-hand-card,
  .deck-pool-card {
    height: 304px !important;
    min-height: 304px !important;
    aspect-ratio: 5 / 8 !important;
    grid-template-rows: 60px minmax(0, 1fr) 44px !important;
    align-content: stretch !important;
  }

  .deck-table-grid .deck-table-slot.is-empty {
    height: 304px !important;
    min-height: 304px !important;
  }

  .deck-hand-card .deck-card-portrait,
  .deck-pool-card .deck-card-art,
  .deck-pool-card-main {
    min-height: 0 !important;
    height: 100% !important;
    aspect-ratio: auto !important;
  }

  .deck-hand-card .deck-card-socket-row,
  .deck-pool-card .deck-card-socket-row--library {
    align-self: stretch !important;
    height: 44px !important;
  }
}

@media (max-width: 980px) {
  .deck-hand-card,
  .deck-pool-card {
    height: 270px !important;
    min-height: 270px !important;
    aspect-ratio: 5 / 8 !important;
    grid-template-rows: 56px minmax(0, 1fr) 40px !important;
    align-content: stretch !important;
  }

  .deck-table-grid .deck-table-slot.is-empty {
    height: 270px !important;
    min-height: 270px !important;
  }

  .deck-hand-card .deck-card-portrait,
  .deck-pool-card .deck-card-art,
  .deck-pool-card-main {
    min-height: 0 !important;
    height: 100% !important;
    aspect-ratio: auto !important;
  }

  .deck-hand-card .deck-card-socket-row,
  .deck-pool-card .deck-card-socket-row--library {
    align-self: stretch !important;
    height: 40px !important;
  }
}

/* Let the desktop hand panel scroll vertically just enough for the taller 5:8 cards. */
@media (min-width: 981px) {
  .deck-builder-columns {
    grid-template-rows: 330px 348px 132px !important;
  }

  .deck-hand-panel {
    min-height: 348px !important;
  }

  .deck-hand-panel .deck-table-grid {
    min-height: 304px !important;
    height: 304px !important;
    grid-template-rows: 304px !important;
    grid-auto-rows: 304px !important;
  }
}

/* Legibility pass: keep the approved raster art, but give its overlaid values a stronger read. */
.deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
.deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
  color: #ffffff !important;
  font-size: 0.96rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  -webkit-text-stroke: 0.7px #07131b;
  text-shadow:
    0 1px 0 #07131b,
    1px 0 0 #07131b,
    0 -1px 0 #07131b,
    -1px 0 0 #07131b,
    0 2px 4px rgba(0, 0, 0, 0.95) !important;
}

.deck-hand-card .deck-card-header-identity,
.deck-pool-card .deck-card-header-identity {
  overflow: visible !important;
  z-index: 2;
}

.deck-hand-card .deck-card-header-identity .deck-build-medallion img,
.deck-pool-card .deck-card-header-identity .deck-build-medallion img {
  transform: scale(1.14);
  transform-origin: left top;
}

@media (max-width: 980px) {
  .deck-hand-card .deck-card-tile-header > .deck-combat-pips b,
  .deck-pool-card .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.84rem !important;
    -webkit-text-stroke-width: 0.6px;
  }

  .deck-hand-card .deck-card-header-identity .deck-build-medallion img,
  .deck-pool-card .deck-card-header-identity .deck-build-medallion img {
    transform: scale(1.12);
  }
}

/* Final desktop lane fit: ten built-deck cards visible without horizontal scrolling. */
@media (min-width: 981px) {
  .deck-builder-columns {
    grid-template-rows: 220px 220px 132px !important;
  }

  .deck-roster-panel,
  .deck-hand-panel {
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .deck-card-pool {
    min-width: 0 !important;
    width: 100% !important;
    gap: 6px !important;
    padding-bottom: 4px !important;
  }

  .deck-pool-card {
    flex: 0 0 124px !important;
    width: 124px !important;
    height: 198px !important;
    min-height: 198px !important;
    aspect-ratio: 5 / 8 !important;
    grid-template-rows: 46px minmax(0, 1fr) 34px !important;
    gap: 2px !important;
    padding: 4px !important;
  }

  .deck-hand-panel .deck-table-grid {
    width: 100% !important;
    height: 198px !important;
    min-height: 198px !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: 198px !important;
    grid-auto-rows: 198px !important;
    gap: 6px !important;
    overflow-x: hidden !important;
  }

  .deck-hand-card,
  .deck-table-grid .deck-table-slot.is-empty {
    width: auto !important;
    height: 198px !important;
    min-height: 198px !important;
    aspect-ratio: 5 / 8 !important;
  }

  .deck-hand-card {
    grid-template-rows: 46px minmax(0, 1fr) 34px !important;
    gap: 2px !important;
    padding: 4px !important;
  }

  .deck-roster-panel .deck-panel-label,
  .deck-hand-panel .deck-panel-label {
    margin-bottom: 5px !important;
  }

  .deck-roster-panel .deck-card-reel-shell {
    height: 198px !important;
  }
}

/* Keep the compact lane height after the legacy 5:8 compatibility rules. */
@media (min-width: 981px) {
  .deck-builder-columns {
    grid-template-rows: 232px 232px 132px !important;
    row-gap: 6px !important;
  }

  .deck-hand-panel {
    height: 232px !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .deck-hand-panel .deck-table-grid {
    height: 198px !important;
    min-height: 198px !important;
    grid-template-rows: 198px !important;
    grid-auto-rows: 198px !important;
  }
}

/* Scale each card as one composed object: header, art, cost, and sockets keep one proportion. */
@media (min-width: 981px) {
  .deck-pool-card,
  .deck-hand-card,
  .deck-table-grid .deck-table-slot.is-empty {
    position: relative !important;
    display: block !important;
    width: 124px !important;
    height: 198px !important;
    min-height: 198px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .deck-card-scale {
    position: absolute;
    top: 0;
    left: 0;
    width: 190px;
    height: 304px;
    display: grid;
    grid-template-rows: 60px minmax(0, 1fr) 44px;
    gap: 5px;
    padding: 7px;
    box-sizing: border-box;
    transform: scale(0.6526315789);
    transform-origin: top left;
  }

  .deck-card-scale .deck-card-tile-header {
    min-width: 0;
    min-height: 0 !important;
    height: 60px !important;
  }

  .deck-card-scale .deck-pool-card-main {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .deck-card-scale .deck-card-art,
  .deck-card-scale .deck-card-portrait {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .deck-card-scale .deck-card-socket-row,
  .deck-card-scale .deck-card-socket-row--library {
    width: 100%;
    height: 44px !important;
    min-height: 0;
    align-self: stretch;
  }

  .deck-card-scale .deck-card-header-identity .deck-build-medallion img {
    transform: scale(1.14);
  }

  .deck-card-scale .deck-card-art-cost {
    right: 6px !important;
    bottom: 6px !important;
    width: 38px !important;
    height: 38px !important;
  }
}

@media (max-width: 980px) {
  .deck-pool-card,
  .deck-hand-card {
    display: block !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  .deck-card-scale {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: grid;
    grid-template-rows: 56px minmax(0, 1fr) 40px;
    gap: 2px;
    padding: 6px;
    box-sizing: border-box;
  }

  .deck-card-scale .deck-card-tile-header {
    min-height: 0 !important;
    height: 56px !important;
  }

  .deck-pool-card .deck-card-scale {
    height: 100% !important;
  }

  .deck-card-scale .deck-pool-card-main {
    width: 100%;
    min-height: 0;
    height: 100%;
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .deck-card-scale .deck-card-art,
  .deck-card-scale .deck-card-portrait {
    width: 100%;
    height: 100%;
    min-height: 0;
    aspect-ratio: auto;
  }

  .deck-card-scale .deck-card-socket-row,
  .deck-card-scale .deck-card-socket-row--library {
    width: 100%;
    height: 40px !important;
    min-height: 0;
    align-self: stretch;
  }
}

/* Board mount: the built deck sits inside a recessed play surface, while the library stays a browse lane. */
@media (min-width: 981px) {
  .deck-hand-panel {
    position: relative !important;
    overflow: hidden !important;
    border: 1px solid rgba(226, 181, 91, 0.72) !important;
    border-radius: 12px !important;
    background: #101b1d !important;
    box-shadow:
      inset 0 0 0 2px rgba(84, 74, 54, 0.56),
      inset 0 0 0 5px rgba(7, 26, 35, 0.8),
      inset 0 2px 0 rgba(255, 224, 138, 0.26),
      0 8px 22px rgba(0, 0, 0, 0.26) !important;
  }

  .deck-board-frame-art {
    position: absolute;
    inset: 0;
    z-index: 0 !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.68;
    filter: saturate(0.94) contrast(1.04) brightness(0.72);
    pointer-events: none;
  }

  .deck-hand-panel::before {
    content: "";
    position: absolute;
    inset: 6px;
    z-index: 1;
    border: 1px solid rgba(255, 224, 138, 0.26);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(5, 20, 26, 0.08), rgba(5, 19, 27, 0.38));
    pointer-events: none;
  }

  .deck-hand-panel::after {
    content: "";
    position: absolute;
    top: 32px;
    left: 18px;
    right: 18px;
    z-index: 1;
    border-top: 1px solid rgba(255, 224, 138, 0.44);
    box-shadow: 0 2px 0 rgba(4, 18, 27, 0.72);
    pointer-events: none;
  }

  .deck-hand-panel > * {
    position: relative;
    z-index: 1;
  }

  .deck-hand-panel > .deck-board-frame-art {
    position: absolute;
    z-index: 0 !important;
  }

  .deck-hand-panel .deck-panel-label {
    position: relative;
    z-index: 3;
  }

  .deck-board-rail {
    position: absolute;
    top: 21px;
    left: 18px;
    right: 18px;
    z-index: 2;
    height: 13px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    color: rgba(255, 224, 138, 0.76);
    font-size: 0.46rem;
    font-weight: 950;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
    pointer-events: none;
  }

  .deck-board-rail-title {
    justify-self: start;
    color: rgba(238, 252, 255, 0.72);
  }

  .deck-board-lane {
    position: relative;
    justify-self: center;
    padding: 0 9px;
    background: rgba(22, 31, 34, 0.96);
  }

  .deck-board-lane::before,
  .deck-board-lane::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 24px;
    border-top: 1px solid rgba(255, 224, 138, 0.52);
  }

  .deck-board-lane::before {
    right: 100%;
  }

  .deck-board-lane::after {
    left: 100%;
  }

  .deck-board-lane--support {
    grid-column: 3;
  }

  .deck-hand-panel .deck-table-grid {
    z-index: 2;
  }
}

@media (max-width: 980px) {
  .deck-board-rail {
    display: none;
  }

  .deck-hand-panel.is-active {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(226, 181, 91, 0.56);
    background: #101b1d;
  }

  .deck-board-frame-art {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.34;
    filter: saturate(0.86) contrast(1.04) brightness(0.56);
    pointer-events: none;
  }

  .deck-hand-panel.is-active::before {
    content: "";
    position: absolute;
    inset: 5px;
    z-index: 1;
    border: 1px solid rgba(255, 224, 138, 0.2);
    border-radius: 8px;
    background: rgba(5, 19, 27, 0.42);
    pointer-events: none;
  }

  .deck-hand-panel.is-active > *:not(.deck-board-frame-art) {
    position: relative;
    z-index: 2;
  }

  .deck-hand-panel.is-active > .deck-board-frame-art {
    position: absolute;
    z-index: 0;
  }
}

/* Squad visual rewards: the earned tile frame is a raster treatment on the composed card object. */
.deck-pool-card.is-club-frame-unlocked,
.deck-hand-card.is-club-frame-unlocked {
  border-color: rgba(255, 224, 138, 0.86) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 224, 138, 0.46),
    0 0 0 1px rgba(34, 235, 217, 0.34),
    0 0 18px rgba(34, 235, 217, 0.16) !important;
}

.deck-pool-card.is-club-frame-unlocked::before,
.deck-hand-card.is-club-frame-unlocked::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background-image: var(--deck-tile-frame-image);
  background-size: cover;
  background-position: center 72%;
  opacity: 0.22;
  filter: saturate(1.18) contrast(1.08) brightness(0.78);
  pointer-events: none;
}

.deck-pool-card.is-club-frame-unlocked > .deck-card-scale,
.deck-hand-card.is-club-frame-unlocked > .deck-card-scale {
  position: relative;
  z-index: 1;
}

.deck-board-frame-locked {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(135deg, rgba(226, 181, 91, 0.08), transparent 36%, rgba(35, 235, 217, 0.06)),
    #101b1d;
  pointer-events: none;
}

.deck-reward-track {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.35rem;
  color: rgba(238, 252, 255, 0.6);
  font-size: 0.72em;
  font-weight: 800;
  white-space: nowrap;
}

.deck-reward-track > span + span {
  padding-left: 0.45rem;
  border-left: 1px solid rgba(238, 252, 255, 0.18);
}

.deck-reward-track .is-earned {
  color: #ffe08a;
}

.deck-reward-track .is-locked {
  color: rgba(238, 252, 255, 0.52);
}

@media (max-width: 980px) {
  .deck-reward-track {
    display: flex;
    flex-wrap: wrap;
    margin: 0.2rem 0 0;
    white-space: normal;
  }
}

/* Last mobile match-board override: keep the three rings together and remove coaching chrome from the live table. */
@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena {
    position: relative !important;
    display: grid !important;
    grid-template-rows: minmax(0, 1fr) auto 126px !important;
    grid-template-areas: "board" "actions" "hand" !important;
    gap: 6px !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 6px !important;
    overflow: hidden !important;
    border: 1px solid rgba(226, 181, 91, 0.64) !important;
    border-radius: 10px !important;
    background:
      linear-gradient(180deg, rgba(8, 13, 17, 0.34), rgba(8, 13, 17, 0.8)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-area: board !important;
    display: grid !important;
    grid-template-rows: 88px minmax(0, 1fr) !important;
    gap: 5px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 4px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .opponent-hand {
    position: relative !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    min-height: 0 !important;
    padding: 18px 4px 4px !important;
    border: 1px solid rgba(255, 117, 78, 0.62) !important;
    border-radius: 7px !important;
    background: rgba(50, 20, 19, 0.66) !important;
  }

  .play-layout.is-battle-active .battle-arena .opponent-hand::before,
  .play-layout.is-battle-active .battle-arena .arena-hand::before {
    position: absolute !important;
    top: 3px !important;
    left: 6px !important;
    color: #ffe08a !important;
    font-size: 0.46rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .opponent-hand::before { content: "Opponent squad" !important; }
  .play-layout.is-battle-active .battle-arena .arena-hand::before { content: "Your squad" !important; }

  .play-layout.is-battle-active .battle-arena .opponent-pocket-card {
    height: 64px !important;
    min-height: 0 !important;
    border-radius: 5px !important;
    font-size: 0.48rem !important;
  }

  .play-layout.is-battle-active .battle-arena .opponent-pocket-card span {
    margin-top: 2px !important;
    padding-inline: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .opponent-pocket-card small {
    margin: 1px 0 3px !important;
    padding-inline: 3px !important;
    font-size: 0.4rem !important;
  }

  .play-layout.is-battle-active .battle-arena .bout-row {
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-slot {
    min-height: 0 !important;
    gap: 2px !important;
    padding: 3px 4px !important;
    border-radius: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-slot-head,
  .play-layout.is-battle-active .battle-arena .match-ring-result {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-slot-head strong { font-size: 0.42rem !important; }

  .play-layout.is-battle-active .battle-arena .match-ring-faceoff {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 25px minmax(0, 1fr) !important;
    gap: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side {
    display: grid !important;
    min-width: 0 !important;
    justify-items: center !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side.is-player { justify-items: end !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent { justify-items: start !important; }

  .play-layout.is-battle-active .battle-arena .match-ring-vs {
    width: 24px !important;
    height: 24px !important;
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-vs small { font-size: 0.36rem !important; }

  .play-layout.is-battle-active .battle-arena .match-ring-card {
    width: min(124px, 100%) !important;
    height: 46px !important;
    grid-template-columns: 32px minmax(0, 1fr) !important;
    column-gap: 3px !important;
    display: grid !important;
    padding: 0 !important;
    border: 1px solid rgba(149, 241, 223, 0.5) !important;
    border-radius: 4px !important;
    background: rgba(5, 12, 16, 0.92) !important;
    color: #fffaf2 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-card img { width: 32px !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent .match-ring-card { border-color: rgba(255, 117, 78, 0.62) !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-card span { padding-inline: 3px !important; font-size: 0.42rem !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-card small { padding: 0 3px 2px !important; font-size: 0.36rem !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-empty { width: min(124px, 100%) !important; height: 30px !important; font-size: 0.38rem !important; }

  .play-layout.is-battle-active .battle-arena .arena-actions {
    grid-area: actions !important;
    display: flex !important;
    min-height: 32px !important;
    margin: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions p,
  .play-layout.is-battle-active .battle-arena .battle-steps,
  .play-layout.is-battle-active .battle-arena .coach-tip,
  .play-layout.is-battle-active .battle-arena .arena-head,
  .play-layout.is-battle-active .battle-arena .match-side,
  .play-layout.is-battle-active .battle-arena .committed-row {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-hand {
    grid-area: hand !important;
    position: relative !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 4px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 18px 4px 4px !important;
    border: 1px solid rgba(34, 235, 217, 0.62) !important;
    border-radius: 7px !important;
    background: rgba(7, 43, 45, 0.7) !important;
  }

  .play-layout.is-battle-active .battle-arena .hand-card {
    width: auto !important;
    min-height: 96px !important;
    border-radius: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .hand-card img { height: 62px !important; }
  .play-layout.is-battle-active .battle-arena .hand-card span { padding-inline: 4px !important; font-size: 0.46rem !important; }
  .play-layout.is-battle-active .battle-arena .hand-card small { padding-inline: 4px !important; font-size: 0.4rem !important; }
}

/* Saved-deck computer matches keep the full ten-card deck visible while the three-card lineup enters the rings. */
.play-layout.is-battle-active .battle-arena .opponent-hand.is-full-deck,
.play-layout.is-battle-active .battle-arena .arena-hand.is-full-deck {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
}

.play-layout.is-battle-active .battle-arena .opponent-hand.is-full-deck .opponent-pocket-card {
  height: clamp(66px, 11dvh, 92px);
  font-size: 0.54rem;
}

.play-layout.is-battle-active .battle-arena .arena-hand.is-full-deck .hand-card {
  width: auto;
  min-width: 0;
  min-height: 94px;
  font-size: 0.54rem;
}

.play-layout.is-battle-active .battle-arena .arena-hand.is-full-deck .hand-card img {
  height: 60px;
}

.play-layout.is-computer-match .battle-arena .arena-hand.is-full-deck .hand-card.is-status-bench {
  opacity: 0.72;
  filter: saturate(0.78);
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .opponent-hand.is-full-deck,
  .play-layout.is-battle-active .battle-arena .arena-hand.is-full-deck {
    display: flex !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
  }

  .play-layout.is-battle-active .battle-arena .opponent-hand.is-full-deck .opponent-pocket-card {
    flex: 0 0 54px;
    height: 64px !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-hand.is-full-deck .hand-card {
    flex: 0 0 54px;
    min-height: 96px !important;
  }
}

/* Final battle overlay pass: keep deployment controls and landed effects visible after the compact board cascade. */
.play-layout.is-battle-active .battle-arena .arena-actions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 0.45rem !important;
  position: relative !important;
  z-index: 20 !important;
}

.play-layout.is-battle-active .battle-arena .arena-hand {
  z-index: 1 !important;
}

.play-layout.is-battle-active .battle-arena .battle-effects:not([hidden]) {
  display: grid !important;
}

.play-layout.is-battle-active .battle-arena .battle-booster-slot:not([hidden]) {
  display: grid !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .arena-actions {
    grid-template-columns: minmax(0, 1fr) auto !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effects:not([hidden]) {
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-booster-slot:not([hidden]),
  .play-layout.is-battle-active .battle-arena .battle-booster-button:not([hidden]) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-booster-button:not([hidden]) {
    justify-self: start !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions > #advanceBattle {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
}

/* Final reference-token pass. Keep these rules last so legacy arena cascades cannot flatten the board. */
.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  grid-template-columns: 122px minmax(0, 1fr) minmax(116px, 0.24fr) !important;
  grid-template-rows: 116px !important;
  min-height: 130px !important;
  max-height: 130px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-side {
  grid-column: 1 !important;
  grid-row: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
  grid-column: 2 !important;
  grid-row: 1 !important;
  grid-area: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-graveyard-dock {
  grid-column: 3 !important;
  grid-row: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player {
  grid-template-columns: minmax(0, 1fr) 122px !important;
  grid-template-rows: 116px !important;
  min-height: 130px !important;
  max-height: 130px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
  grid-column: 1 !important;
  grid-row: 1 !important;
  grid-area: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > .match-side {
  grid-column: 2 !important;
  grid-row: 1 !important;
}

.match-token-header {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 3 !important;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 3px !important;
  min-width: 0 !important;
  min-height: 24px !important;
  padding: 2px 4px !important;
  overflow: hidden !important;
  background: linear-gradient(180deg, rgba(3, 8, 10, 0.94), rgba(3, 8, 10, 0.52)) !important;
  color: #fffaf2 !important;
  pointer-events: none !important;
}

.match-token-header > b {
  display: grid !important;
  place-items: center !important;
  min-width: 17px !important;
  height: 17px !important;
  padding: 0 3px !important;
  border: 1px solid rgba(226, 181, 91, 0.76) !important;
  border-radius: 3px !important;
  background: rgba(48, 27, 11, 0.9) !important;
  color: #ffe08a !important;
  font-size: 0.52rem !important;
  line-height: 1 !important;
}

.match-token-header > strong {
  min-width: 0 !important;
  overflow: hidden !important;
  color: #fffaf2 !important;
  font-size: 0.52rem !important;
  font-weight: 950 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.match-token-combat {
  position: absolute !important;
  top: 25px !important;
  left: 4px !important;
  right: 4px !important;
  display: flex !important;
  justify-content: space-between !important;
  gap: 2px !important;
}

.match-token-combat i {
  display: grid !important;
  place-items: center !important;
  width: 18px !important;
  height: 18px !important;
  position: relative !important;
  font-style: normal !important;
}

.match-token-combat img {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)) !important;
}

.match-token-combat i b {
  position: absolute !important;
  z-index: 1 !important;
  color: #fffaf2 !important;
  font-size: 0.52rem !important;
  line-height: 1 !important;
  text-shadow: 0 1px 2px #000 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .match-token-header {
  min-height: 28px !important;
  padding: 3px 4px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .match-token-header > b {
  min-width: 20px !important;
  height: 19px !important;
  font-size: 0.56rem !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .match-token-header > strong { font-size: 0.48rem !important; }
.play-layout.is-battle-active .battle-arena .match-rail .match-token-combat { top: 29px !important; }
.play-layout.is-battle-active .battle-arena .match-rail .match-token-combat i,
.play-layout.is-battle-active .battle-arena .match-rail .match-token-combat img { width: 15px !important; height: 15px !important; }
.play-layout.is-battle-active .battle-arena .match-rail .match-token-combat i b { font-size: 0.44rem !important; }

.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select > span:not(.match-token-header),
.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select > small {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select {
  height: 100% !important;
  padding: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select img {
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .opponent-pocket-card img {
  height: 100% !important;
  object-position: center !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .opponent-pocket-card .match-card-status {
  top: auto !important;
  right: 4px !important;
  bottom: 3px !important;
  z-index: 4 !important;
  padding: 2px 3px !important;
  background: rgba(3, 8, 10, 0.86) !important;
  color: #fffaf2 !important;
  font-size: 0.4rem !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .opponent-pocket-card > small {
  position: absolute !important;
  left: 4px !important;
  bottom: 3px !important;
  z-index: 4 !important;
  margin: 0 !important;
  padding: 2px 3px !important;
  background: rgba(3, 8, 10, 0.78) !important;
  font-size: 0.38rem !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-ring-card {
  grid-template-rows: 1fr !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-ring-card img {
  grid-row: 1 / -1 !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-ring-state {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 4 !important;
  padding: 4px 7px !important;
  background: rgba(3, 8, 10, 0.86) !important;
  color: #95f1df !important;
  font-size: 0.58rem !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-token-header {
  position: relative !important;
  grid-template-columns: 34px minmax(0, 1fr) !important;
  grid-template-rows: 34px !important;
  min-height: 54px !important;
  padding: 5px 8px 2px !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-token-header > b {
  min-width: 34px !important;
  height: 34px !important;
  font-size: 0.9rem !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-token-header > strong {
  font-size: 0.78rem !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-token-combat {
  position: absolute !important;
  top: 40px !important;
  right: 8px !important;
  left: 8px !important;
  grid-column: auto !important;
  grid-row: auto !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 4px !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i,
.play-layout.is-battle-active .battle-arena .match-stage .match-token-combat img {
  width: 34px !important;
  height: 34px !important;
}

.play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i b {
  font-size: 0.78rem !important;
}

.play-layout.is-battle-active .battle-arena .match-cost-badge {
  display: grid !important;
  position: absolute !important;
  right: 4px !important;
  bottom: 4px !important;
  z-index: 5 !important;
  place-items: center !important;
  width: 24px !important;
  height: 24px !important;
  color: #fffaf2 !important;
  text-shadow: 0 1px 2px #000 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select > .match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-rail .opponent-pocket-card > .match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-stage .match-ring-card > .match-cost-badge {
  display: grid !important;
}

.play-layout.is-battle-active .battle-arena .match-cost-badge,
.play-layout.is-battle-active .battle-arena .hand-card-select .match-cost-badge {
  display: grid !important;
}

.play-layout.is-battle-active .battle-arena .hand-card-select .match-cost-badge {
  display: grid !important;
}

.play-layout.is-battle-active .battle-arena .match-cost-badge img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}

.play-layout.is-battle-active .battle-arena .match-cost-badge b {
  position: relative !important;
  z-index: 1 !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-ring-card .match-cost-badge {
    width: 34px !important;
    height: 34px !important;
    right: 6px !important;
    bottom: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-card .match-cost-badge b {
    font-size: 0.9rem !important;
  }
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-stage .match-token-header {
    grid-template-rows: 34px !important;
    min-height: 76px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat img {
    width: 34px !important;
    height: 34px !important;
  }
}

.match-graveyard-dock {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  padding: 5px !important;
  border: 1px solid rgba(255, 117, 78, 0.32) !important;
  border-radius: 6px !important;
  background: rgba(4, 8, 10, 0.68) !important;
}

.match-graveyard-dock-inner {
  display: grid !important;
  gap: 4px !important;
  min-width: 0 !important;
  height: 100% !important;
}

.match-graveyard-dock strong {
  color: #ffb29e !important;
  font-size: 0.46rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.match-graveyard-dock .match-graveyard-stack {
  min-height: 0 !important;
  display: flex !important;
  align-items: flex-start !important;
  overflow-x: auto !important;
}

.match-graveyard-dock .match-card-token,
.committed-row .match-card-token {
  flex-basis: 74px !important;
  min-height: 30px !important;
}

.match-graveyard-dock .match-card-token .match-token-header,
.committed-row .match-card-token .match-token-header {
  min-height: 17px !important;
  padding: 1px 2px !important;
}

.match-graveyard-dock .match-card-token .match-token-header > b,
.committed-row .match-card-token .match-token-header > b {
  min-width: 12px !important;
  height: 12px !important;
  font-size: 0.36rem !important;
}

.match-graveyard-dock .match-card-token .match-token-header > strong,
.committed-row .match-card-token .match-token-header > strong { font-size: 0.34rem !important; }

.match-graveyard-dock .match-token-combat,
.committed-row .match-token-combat { display: none !important; }

.match-graveyard-dock .match-card-token > img,
.committed-row .match-card-token > img { width: 100% !important; height: 100% !important; opacity: 0.72 !important; }

.match-graveyard-dock .match-card-token > small,
.committed-row .match-card-token > small {
  position: absolute !important;
  right: 2px !important;
  bottom: 1px !important;
  left: 2px !important;
  z-index: 3 !important;
  padding: 1px 2px !important;
  background: rgba(3, 8, 10, 0.82) !important;
  font-size: 0.32rem !important;
}

.match-effects-empty,
.match-round-log-empty {
  color: rgba(238, 252, 255, 0.54) !important;
  font-size: 0.48rem !important;
  line-height: 1.3 !important;
  text-align: center !important;
}

.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty:not([hidden]),
.play-layout.is-battle-active .battle-arena .match-round-log .match-round-log-empty { display: block !important; }
.play-layout.is-battle-active .battle-arena .match-effects-panel .match-effects-empty[hidden] { display: none !important; }

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-side,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .match-side {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-graveyard-dock {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-height: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent .match-graveyard-dock-inner {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent .match-graveyard-stack { flex: 1 !important; }
  .play-layout.is-battle-active .battle-arena .match-effects-empty,
  .play-layout.is-battle-active .battle-arena .match-round-log-empty { display: none !important; }

  .play-layout.is-battle-active .battle-arena .committed-row {
    display: grid !important;
    grid-area: grave !important;
    min-height: 24px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-token-combat { top: 22px !important; }
  .play-layout.is-battle-active .battle-arena .match-rail .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-rail .match-token-combat img { width: 12px !important; height: 12px !important; }
  .play-layout.is-battle-active .battle-arena .match-rail .match-token-combat i b { font-size: 0.34rem !important; }
  .play-layout.is-battle-active .battle-arena .match-rail .match-token-header > strong { font-size: 0.38rem !important; }
  .play-layout.is-battle-active .battle-arena .match-hand-status { bottom: 16px !important; font-size: 0.28rem !important; }
}

/* Cost markers are intentional child overlays, not footer text. */
.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select > span.match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-rail .opponent-pocket-card > span.match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-stage .match-ring-card > span.match-cost-badge {
  display: grid !important;
}

/* Final visibility guard for cost markers nested inside selectable card buttons. */
.play-layout.is-battle-active .battle-arena .hand-card-select > .match-cost-badge,
.play-layout.is-battle-active .battle-arena .opponent-pocket-card > .match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-ring-card > .match-cost-badge {
  display: grid !important;
}

/* Final token layout: identity above the combat row, never overlapping it. */
.play-layout.is-battle-active .battle-arena .match-token-header {
  position: relative !important;
}

.play-layout.is-battle-active .battle-arena .match-token-combat {
  position: absolute !important;
  top: 40px !important;
  right: 8px !important;
  left: 8px !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 3px !important;
  width: auto !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-token-combat img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-token-combat i b {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat img {
    width: 34px !important;
    height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i b {
    font-size: 0.78rem !important;
  }
}

/* Cost markers are intentional child overlays, not footer text. */
.play-layout.is-battle-active .battle-arena .match-rail .hand-card-select > span.match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-rail .opponent-pocket-card > span.match-cost-badge,
.play-layout.is-battle-active .battle-arena .match-stage .match-ring-card > span.match-cost-badge {
  display: grid !important;
}

/* Final token layout: identity above the combat row, never overlapping it. */
.play-layout.is-battle-active .battle-arena .match-token-header {
  position: relative !important;
}

.play-layout.is-battle-active .battle-arena .match-token-combat {
  position: absolute !important;
  top: 40px !important;
  right: 8px !important;
  left: 8px !important;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 3px !important;
  width: auto !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-token-combat img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-token-combat i b {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i,
  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat img {
    width: 34px !important;
    height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-token-combat i b {
    font-size: 0.78rem !important;
  }
}

/* Final reference board finish: use the available desktop canvas and keep each token's
   identity row separate from its four combat markers. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-board {
    width: min(100%, 1560px) !important;
    padding: 8px !important;
  }

  .play-layout.is-battle-active .match-token-header {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: 24px 30px !important;
    min-height: 54px !important;
    padding: 3px 5px 1px !important;
  }

  .play-layout.is-battle-active .match-token-header > b {
    min-width: 24px !important;
    height: 24px !important;
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .match-token-header > strong {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .match-token-combat {
    position: static !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 3px !important;
    width: 100% !important;
  }

  .play-layout.is-battle-active .match-token-combat i,
  .play-layout.is-battle-active .match-token-combat img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .match-token-combat i {
    justify-self: center !important;
  }

  .play-layout.is-battle-active .match-token-combat i b {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .match-rail .opponent-pocket-card,
  .play-layout.is-battle-active .match-rail .hand-card {
    min-height: 116px !important;
    max-height: 116px !important;
  }

  .play-layout.is-battle-active .match-rail .opponent-pocket-card > img,
  .play-layout.is-battle-active .match-rail .hand-card-select > img {
    object-position: center 28% !important;
  }
}

/* Final grouped rail sizing: the hand must never consume the stage's height. */
.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
  position: relative !important;
  grid-area: auto !important;
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: stretch !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card {
  position: relative !important;
  grid-area: auto !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  transform: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-select {
  position: relative !important;
  grid-area: 1 !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-select > img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  aspect-ratio: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-actions {
  grid-area: 2 !important;
  align-self: stretch !important;
  width: 100% !important;
  height: 25px !important;
  min-height: 25px !important;
  max-height: 25px !important;
  padding: 3px 5px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player .match-hand-status {
  bottom: 25px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
  grid-area: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent .opponent-pocket-card {
  grid-area: auto !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 88px !important;
    height: 88px !important;
    min-height: 88px !important;
    max-height: 88px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .hand-card {
    grid-template-rows: minmax(0, 1fr) 20px !important;
    height: 88px !important;
    min-height: 88px !important;
    max-height: 88px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-select {
    height: 68px !important;
    min-height: 68px !important;
    max-height: 68px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .hand-card-actions {
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
    padding: 2px 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player .match-hand-status {
    bottom: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent .opponent-pocket-card {
    height: 75px !important;
    min-height: 75px !important;
    max-height: 75px !important;
  }
}

/* True end-of-file battle board guard. */
.play-layout.is-battle-active .battle-arena .match-rail-player,
.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  position: relative !important;
  z-index: 1 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
  position: relative !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 5 / 8 !important;
  transform: none !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  padding: 5% !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  position: relative !important;
  z-index: 10 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot.is-played-slot,
.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot.is-played-slot * {
  pointer-events: none !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
    flex: 0 0 86px !important;
    width: 86px !important;
  }
}

/* Actual stylesheet tail: prevent played rail objects from covering the round controls. */
.play-layout.is-battle-active .battle-arena .match-center-row {
  position: relative !important;
  z-index: 20 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail {
  position: relative !important;
  z-index: 1 !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot.is-played-slot {
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot.is-played-slot.played-hand-card {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* The deployed side rails must remain below the active round controls. */
.play-layout.is-battle-active .battle-arena .match-center-row {
  position: relative !important;
  z-index: 50 !important;
}

.play-layout.is-battle-active .battle-arena .match-stage,
.play-layout.is-battle-active .battle-arena .match-stage .arena-actions {
  position: relative !important;
  z-index: 51 !important;
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail {
  z-index: 1 !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    position: relative !important;
    z-index: -1 !important;
  }
}

.play-layout.is-battle-active .battle-arena .battle-card-slot.is-played-slot .battle-card-object,
.play-layout.is-battle-active .battle-arena .battle-card-slot.is-played-slot .battle-card-object * {
  pointer-events: none !important;
}

/* Battle object parity wins over the older compact rail cascade above. */
.play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
  display: grid !important;
  grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
  grid-template-rows: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
  position: relative !important;
  display: grid !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 5 / 8 !important;
  padding: 0 !important;
  transform: none !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  padding: 5% !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot > .hand-card-select {
  position: absolute !important;
  z-index: 4 !important;
  inset: 0 0 30px !important;
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  cursor: pointer !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot > .battle-card-actions {
  position: relative !important;
  z-index: 7 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
  min-width: 0 !important;
  margin-top: 4px !important;
}

.play-layout.is-battle-active .battle-arena.phase-choose .match-rail .battle-card-slot > .hand-card-select {
  display: block !important;
}

.play-layout.is-battle-active .battle-arena.phase-idle .match-rail .battle-card-slot > .hand-card-select,
.play-layout.is-battle-active .battle-arena.phase-idle .match-rail .battle-card-slot > .battle-card-actions {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot > .battle-card-actions .battle-card-action {
  min-width: 0 !important;
  min-height: 24px !important;
  padding: 0 3px !important;
  border: 1px solid rgba(149, 241, 223, 0.46) !important;
  border-radius: 4px !important;
  background: rgba(4, 31, 39, 0.92) !important;
  color: #95f1df !important;
  font-size: 0.5rem !important;
  font-weight: 1000 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions,
.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions button,
.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot > .battle-card-actions {
  pointer-events: auto !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    grid-template-rows: none !important;
    gap: 6px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
    flex: 0 0 86px !important;
    width: 86px !important;
  }
}

/* Pointer and stacking guard for the single-screen board. Side rails own their
   cards; the middle panels never intercept card actions. */
.play-layout.is-battle-active .battle-arena .match-center-row {
  position: relative !important;
  z-index: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail {
  position: relative !important;
  z-index: 5 !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row > .match-compare-panel,
.play-layout.is-battle-active .battle-arena .match-center-row > .match-details-panel {
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row > .match-details-panel,
.play-layout.is-battle-active .battle-arena .match-center-row > .match-details-panel * {
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row > .match-stage,
.play-layout.is-battle-active .battle-arena .match-stage .arena-actions,
.play-layout.is-battle-active .battle-arena .match-stage .arena-actions * {
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-slot.is-played-slot {
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena > .match-board {
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  z-index: 30 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail {
  z-index: 0 !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand {
    z-index: -1 !important;
  }
}

/*
 * Local reference board pass.
 * The live board is one composed surface: two ten-card rails and one horizontal
 * combat band. Keep the deck-builder card object intact and size the wrapper
 * around it, so the card never becomes a separate battle-only token.
 */
@media (min-width: 981px) {
  .play-layout.is-battle-active #arenaHand .battle-card-slot,
  .play-layout.is-battle-active #opponentHand .battle-card-slot {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
  }

  .play-layout.is-battle-active #arenaHand .battle-card-object,
  .play-layout.is-battle-active #opponentHand .battle-card-object {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .play-layout.is-battle-active #boutRow {
    grid-template-columns: 190px 112px 190px !important;
  }

  .play-layout.is-battle-active #boutRow .match-ring-side {
    width: 190px !important;
    grid-template-columns: 190px !important;
  }

  .play-layout.is-battle-active #boutRow .match-ring-card,
  .play-layout.is-battle-active #boutRow .match-ring-card .battle-card-object {
    width: 190px !important;
    height: 304px !important;
    min-height: 304px !important;
    max-height: 304px !important;
  }

  .play-layout.is-battle-active {
    width: calc(100% - 16px) !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .play-layout.is-battle-active .battle-board,
  .play-layout.is-battle-active .battle-arena {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .play-layout.is-battle-active .battle-board {
    height: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena {
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 10px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .play-layout.is-battle-active .battle-arena > .match-board {
    display: grid !important;
    grid-template-areas: "opponent" "center" "player" !important;
    grid-template-rows: minmax(0, 29%) minmax(0, 42%) minmax(0, 29%) !important;
    gap: 8px !important;
    width: 100% !important;
    height: calc(100vh - 42px) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 32px minmax(0, 1fr) !important;
    gap: 5px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 7px 10px 9px !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 5 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent {
    grid-area: opponent !important;
    grid-row: 1 !important;
    border-color: rgba(255, 167, 89, 0.7) !important;
    background:
      linear-gradient(180deg, rgba(42, 21, 17, 0.82), rgba(7, 24, 30, 0.88)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player {
    grid-area: player !important;
    grid-row: 3 !important;
    border-color: rgba(81, 220, 213, 0.64) !important;
    background:
      linear-gradient(180deg, rgba(7, 42, 48, 0.78), rgba(5, 20, 28, 0.9)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .match-side {
    position: relative !important;
    z-index: 4 !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 4px !important;
    color: rgba(238, 252, 255, 0.68) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side > div {
    display: flex !important;
    align-items: baseline !important;
    gap: 7px !important;
    min-width: 0 !important;
    margin-right: auto !important;
    justify-self: start !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side span {
    color: #ffe08a !important;
    font-size: 0.52rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side strong {
    min-width: 0 !important;
    overflow: hidden !important;
    color: #fffaf2 !important;
    font-size: 0.86rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.02em !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side small {
    flex: 0 0 auto !important;
    margin: 0 !important;
    color: rgba(238, 252, 255, 0.62) !important;
    font-size: 0.52rem !important;
    font-weight: 850 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .match-match-hud {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail > .arena-hand,
  .play-layout.is-battle-active .battle-arena .match-rail #opponentHand,
  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand {
    grid-column: 1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    grid-auto-rows: minmax(0, 1fr) !important;
    gap: 7px !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    padding-inline: 21px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail #opponentHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand .battle-card-slot {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: stretch !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    overflow: hidden !important;
    transform: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    transform: none !important;
    padding: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header {
    height: 56px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row--library {
    height: 39px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-actions {
    position: absolute !important;
    right: 3px !important;
    bottom: 3px !important;
    left: 3px !important;
    z-index: 10 !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 3px !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 140ms ease !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot:hover .battle-card-actions,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot:focus-within .battle-card-actions {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-area: center !important;
    display: grid !important;
    grid-template-columns: minmax(286px, 1fr) minmax(0, 2.45fr) minmax(286px, 1fr) !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 10px 8% 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 6 !important;
    background:
      linear-gradient(90deg, rgba(4, 12, 15, 0.92), rgba(4, 10, 12, 0.62), rgba(4, 12, 15, 0.92)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel,
  .play-layout.is-battle-active .battle-arena .match-details-panel {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    padding: 12px !important;
    border: 1px solid rgba(226, 181, 91, 0.66) !important;
    border-radius: 9px !important;
    background: linear-gradient(180deg, rgba(29, 19, 13, 0.88), rgba(4, 16, 22, 0.86)) !important;
    box-sizing: border-box !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading {
    min-width: 0 !important;
    padding-bottom: 7px !important;
    border-bottom: 1px solid rgba(255, 224, 138, 0.3) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading span {
    color: #ffe08a !important;
    font-size: 0.72rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.09em !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading small {
    color: rgba(238, 252, 255, 0.56) !important;
    font-size: 0.5rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare,
  .play-layout.is-battle-active .battle-arena .battle-effects,
  .play-layout.is-battle-active .battle-arena .arena-log {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage {
    position: relative !important;
    display: block !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: visible !important;
    padding: 0 !important;
    background:
      linear-gradient(180deg, rgba(7, 14, 16, 0.7), rgba(8, 13, 14, 0.42)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-steps,
  .play-layout.is-battle-active .battle-arena .coach-tip,
  .play-layout.is-battle-active .battle-arena .arena-actions p {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .clash-banner {
    position: absolute !important;
    top: 4px !important;
    left: 50% !important;
    z-index: 8 !important;
    width: min(300px, 60%) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 5px 8px !important;
    transform: translateX(-50%) !important;
    opacity: 0.82 !important;
    pointer-events: none !important;
  }

  .play-layout.is-battle-active .battle-arena .bout-row {
    display: grid !important;
    grid-template-columns: 190px 112px 190px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 24px 0 18px !important;
    box-sizing: border-box !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-slot {
    display: contents !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-slot-head,
  .play-layout.is-battle-active .battle-arena .match-ring-result {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-faceoff {
    display: contents !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side {
    display: grid !important;
    align-items: center !important;
    min-width: 0 !important;
    min-height: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side.is-player { grid-column: 1 !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent { grid-column: 3 !important; }

  .play-layout.is-battle-active .battle-arena .match-ring-card,
  .play-layout.is-battle-active .battle-arena .match-ring-concealed {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 5 / 8 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-radius: 9px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-card .deck-card-scale {
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    padding: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-vs {
    grid-column: 2 !important;
    display: grid !important;
    place-items: center !important;
    width: 58px !important;
    height: 58px !important;
    align-self: center !important;
    justify-self: center !important;
    border: 1px solid rgba(255, 224, 138, 0.82) !important;
    border-radius: 50% !important;
    background: rgba(12, 13, 14, 0.8) !important;
    color: #ffe08a !important;
    font-size: 1rem !important;
    font-weight: 1000 !important;
    box-shadow: 0 0 22px rgba(255, 165, 75, 0.32) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-vs small {
    display: block !important;
    font-size: 0.46rem !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions {
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 9 !important;
    display: flex !important;
    justify-content: center !important;
    min-height: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions > * {
    pointer-events: auto !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions > #advanceBattle {
    min-height: 25px !important;
    padding: 0 12px !important;
    font-size: 0.5rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-attribute-duel {
    width: 100% !important;
    gap: 3px !important;
    margin: 0 0 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-line {
    grid-template-columns: 38px 28px 16px 28px 28px !important;
    gap: 2px !important;
    min-height: 24px !important;
    padding: 1px 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-side,
  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-line > em,
  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-line > strong {
    font-size: 0.44rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-stat {
    width: 26px !important;
    height: 23px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-stat img {
    width: 23px !important;
    height: 23px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-stat b {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena.phase-resolved .clash-banner,
  .play-layout.is-battle-active .battle-arena.phase-revealed .clash-banner,
  .play-layout.is-battle-active .battle-arena.phase-complete .clash-banner {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena.phase-revealed #battleBoosterSlot,
  .play-layout.is-battle-active .battle-arena.phase-resolved #battleBoosterSlot,
  .play-layout.is-battle-active .battle-arena.phase-complete #battleBoosterSlot {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active {
    width: calc(100% - 16px) !important;
    max-width: none !important;
  }

  .play-layout.is-battle-active .battle-board {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }
}

/* Mobile reference pass: keep the board in one compact vertical stack while
   preserving the same card object and a readable faceoff. */
@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 0 96px minmax(0, 400px) 150px 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 184px 146px 58px !important;
    grid-template-areas: "compare" "stage" "details" !important;
    gap: 6px !important;
    padding: 6px 6px 0 !important;
    background:
      linear-gradient(90deg, rgba(4, 12, 15, 0.92), rgba(4, 10, 12, 0.62), rgba(4, 12, 15, 0.92)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel {
    grid-area: compare !important;
    height: 100% !important;
    padding: 7px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage {
    grid-area: stage !important;
    display: block !important;
    height: 100% !important;
    min-height: 0 !important;
    pointer-events: none !important;
    background:
      linear-gradient(180deg, rgba(7, 14, 16, 0.7), rgba(8, 13, 14, 0.42)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel {
    grid-area: details !important;
    height: 100% !important;
    padding: 7px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading {
    padding-bottom: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading span {
    font-size: 0.56rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading small {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-attribute-duel {
    width: 100% !important;
    gap: 2px !important;
    margin: 0 0 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-line {
    grid-template-columns: 42px 28px 14px 28px 24px !important;
    gap: 2px !important;
    min-height: 19px !important;
    padding: 0 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-side,
  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-line > em,
  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-line > strong {
    font-size: 0.36rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-stat {
    width: 24px !important;
    height: 19px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-stat img {
    width: 19px !important;
    height: 19px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel .battle-duel-stat b {
    font-size: 0.52rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare {
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-title {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line {
    display: grid !important;
    grid-template-rows: 9px 16px 5px 8px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 3px 4px !important;
    gap: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line header,
  .play-layout.is-battle-active .battle-arena .battle-compare-line footer {
    font-size: 0.36rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values b {
    font-size: 0.72rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-meter {
    height: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .bout-row {
    grid-template-columns: 82px 34px 82px !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 2px 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-slot,
  .play-layout.is-battle-active .battle-arena .match-ring-faceoff {
    display: contents !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side {
    display: grid !important;
    grid-column: auto !important;
    align-items: center !important;
    justify-items: center !important;
    width: 82px !important;
    min-width: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side.is-player { grid-column: 1 !important; }
  .play-layout.is-battle-active .battle-arena .match-ring-side.is-opponent { grid-column: 3 !important; }

  .play-layout.is-battle-active .battle-arena .match-ring-card,
  .play-layout.is-battle-active .battle-arena .match-ring-concealed {
    display: block !important;
    width: 82px !important;
    height: 131px !important;
    min-height: 131px !important;
    max-height: 131px !important;
    aspect-ratio: 5 / 8 !important;
    grid-template-columns: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-concealed {
    pointer-events: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-side {
    pointer-events: none !important;
  }

  .play-layout.is-battle-active .battle-arena .bout-row {
    pointer-events: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-card .deck-card-scale {
    width: 100% !important;
    height: 100% !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-card .battle-card-object {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    grid-template-columns: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-vs {
    grid-column: 2 !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-ring-vs small {
    font-size: 0.32rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effects,
  .play-layout.is-battle-active .battle-arena .arena-log {
    overflow: auto !important;
    font-size: 0.4rem !important;
  }

  .play-layout.is-battle-active .battle-arena.phase-revealed .clash-banner,
  .play-layout.is-battle-active .battle-arena.phase-resolved .clash-banner,
  .play-layout.is-battle-active .battle-arena.phase-complete .clash-banner,
  .play-layout.is-battle-active .battle-arena.phase-revealed #battleBoosterSlot,
  .play-layout.is-battle-active .battle-arena.phase-resolved #battleBoosterSlot,
  .play-layout.is-battle-active .battle-arena.phase-complete #battleBoosterSlot {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions {
    bottom: 2px !important;
    min-height: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .arena-actions > #advanceBattle {
    min-height: 20px !important;
    padding: 0 7px !important;
    font-size: 0.4rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .arena-actions,
  .play-layout.is-battle-active .battle-arena .match-stage .arena-actions * {
    pointer-events: auto !important;
  }

  .play-layout.is-battle-active #battleArena .match-stage {
    pointer-events: none !important;
  }

  .play-layout.is-battle-active #battleArena .match-stage .arena-actions,
  .play-layout.is-battle-active #battleArena .match-stage .arena-actions * {
    pointer-events: auto !important;
  }
}

/* Reference contract guard: the battle rails reuse the deck-builder card
   object, but their narrow width must keep the name row and combat row in
   separate, deterministic tracks. This is intentionally last so older
   compact-card rules cannot put the name back over the stat pips. */
.play-layout.is-battle-active .battle-arena > .arena-table,
.play-layout.is-battle-active .battle-arena .coach-tip,
.play-layout.is-battle-active .battle-arena .clash-banner,
.play-layout.is-battle-active .battle-arena .battle-steps,
.play-layout.is-battle-active #turnGuide {
  display: none !important;
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-round-badge {
    position: absolute !important;
    top: -18px !important;
    left: 50% !important;
    z-index: 12 !important;
    display: grid !important;
    min-width: 112px !important;
    padding: 4px 12px 3px !important;
    transform: translateX(-50%) !important;
    border: 1px solid rgba(255, 224, 138, 0.82) !important;
    border-radius: 4px !important;
    background: linear-gradient(180deg, rgba(31, 20, 9, 0.98), rgba(7, 22, 27, 0.98)) !important;
    box-shadow: 0 0 18px rgba(255, 180, 82, 0.24) !important;
    text-align: center !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge strong {
    color: #fff0b8 !important;
    font-size: 1.05rem !important;
    line-height: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge span {
    color: rgba(255, 224, 138, 0.74) !important;
    font-size: 0.38rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.1em !important;
    line-height: 1.1 !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
    display: grid !important;
    grid-template-rows: 56px minmax(0, 1fr) 40px !important;
    gap: 0 !important;
    padding: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) 24px !important;
    grid-template-rows: 24px 28px !important;
    height: 56px !important;
    min-height: 56px !important;
    margin: 0 !important;
    gap: 0 2px !important;
    padding: 2px 3px !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    width: 38px !important;
    height: 38px !important;
    align-self: start !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 38px !important;
    height: 38px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy {
    grid-column: 2 / 4 !important;
    grid-row: 1 !important;
    align-self: center !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding-right: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
    font-size: 0.58rem !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips {
    grid-column: 2 / 4 !important;
    grid-row: 2 !important;
    display: grid !important;
    width: 100% !important;
    height: 28px !important;
    min-width: 0 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
    display: grid !important;
    width: 100% !important;
    height: 28px !important;
    min-width: 0 !important;
    grid-template-rows: 28px !important;
    place-items: center !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 26px !important;
    height: 26px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.7rem !important;
    line-height: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    z-index: 5 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions button {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    padding: 0 !important;
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait {
    grid-row: 2 !important;
    min-height: 0 !important;
    height: auto !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row {
    grid-row: 3 !important;
    height: 40px !important;
    min-height: 40px !important;
    gap: 2px !important;
    padding: 2px 1px 0 !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-round-badge {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
    display: grid !important;
    grid-template-rows: 36px minmax(0, 1fr) 26px !important;
    gap: 0 !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header {
    display: grid !important;
    grid-template-columns: 26px minmax(0, 1fr) 18px !important;
    grid-template-rows: 16px 20px !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    gap: 0 1px !important;
    padding: 1px 2px !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 24px !important;
    height: 24px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity {
    grid-column: 1 !important;
    grid-row: 1 / span 2 !important;
    align-self: start !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy {
    grid-column: 2 / 4 !important;
    grid-row: 1 !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    padding-right: 16px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    font-size: 0.42rem !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips {
    grid-column: 2 / 4 !important;
    grid-row: 2 !important;
    display: grid !important;
    width: 100% !important;
    height: 20px !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0 !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
    display: grid !important;
    width: 100% !important;
    height: 20px !important;
    grid-template-rows: 20px !important;
    place-items: center !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 18px !important;
    height: 18px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions {
    position: absolute !important;
    top: 1px !important;
    right: 1px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions button {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    padding: 0 !important;
    font-size: 0.46rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row {
    grid-row: 3 !important;
    height: 26px !important;
    min-height: 26px !important;
    gap: 1px !important;
    padding: 1px 0 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket {
    width: 21px !important;
    height: 21px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket img {
    width: 17px !important;
    height: 17px !important;
  }
}

/* Reference fidelity pass: the live board uses the same card object as the
   deck builder, but the surrounding board must read like a composed tabletop.
   Keep these rules last so legacy compact battle styles cannot flatten the
   header bands, faceoff stage, or detail hierarchy again. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena {
    padding: 10px !important;
    border: 2px solid rgba(226, 181, 91, 0.82) !important;
    border-radius: 14px !important;
    background:
      linear-gradient(180deg, rgba(5, 9, 12, 0.16), rgba(4, 10, 13, 0.62)),
      var(--match-host-art) center / cover !important;
    box-shadow:
      inset 0 0 0 3px rgba(35, 22, 13, 0.9),
      inset 0 0 0 5px rgba(226, 181, 91, 0.18),
      0 24px 64px rgba(0, 0, 0, 0.48) !important;
  }

  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 28% minmax(0, 44%) 28% !important;
    gap: 8px !important;
    height: min(879px, calc(100vh - 42px)) !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail {
    position: relative !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: 34px minmax(0, 1fr) !important;
    gap: 4px !important;
    padding: 7px 12px 9px !important;
    border: 1px solid rgba(226, 181, 91, 0.66) !important;
    border-radius: 10px !important;
    background:
      linear-gradient(180deg, rgba(22, 16, 12, 0.64), rgba(5, 18, 24, 0.82)),
      var(--match-host-art) center / cover !important;
    box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.06), 0 9px 24px rgba(0, 0, 0, 0.26) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent {
    border-color: rgba(255, 117, 78, 0.8) !important;
    background:
      linear-gradient(180deg, rgba(74, 22, 16, 0.72), rgba(7, 19, 24, 0.86)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player {
    border-color: rgba(34, 235, 217, 0.7) !important;
    background:
      linear-gradient(180deg, rgba(6, 55, 59, 0.72), rgba(5, 18, 24, 0.86)),
      var(--match-host-art) center / cover !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .match-side {
    position: relative !important;
    z-index: 6 !important;
    display: flex !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-width: 0 !important;
    padding: 0 4px !important;
    border: 0 !important;
    background: transparent !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side > div {
    display: flex !important;
    align-items: baseline !important;
    gap: 7px !important;
    min-width: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side span {
    color: #ffe08a !important;
    font-size: 0.54rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.13em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side strong {
    max-width: 260px !important;
    overflow: hidden !important;
    color: #fffaf2 !important;
    font-size: 0.82rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.02em !important;
    text-overflow: ellipsis !important;
    text-transform: none !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-side small {
    position: absolute !important;
    right: 4px !important;
    margin: 0 !important;
    color: rgba(238, 252, 255, 0.66) !important;
    font-size: 0.5rem !important;
    font-weight: 850 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
    position: absolute !important;
    top: 7px !important;
    left: 50% !important;
    z-index: 7 !important;
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    min-width: 0 !important;
    transform: translateX(-50%) !important;
    pointer-events: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud .eyebrow {
    color: rgba(255, 224, 138, 0.76) !important;
    font-size: 0.46rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.1em !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud h3 {
    overflow: hidden !important;
    max-width: 220px !important;
    color: #fffaf2 !important;
    font-size: 0.62rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.06em !important;
    text-overflow: ellipsis !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud > strong {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail > .arena-hand {
    grid-column: 1 !important;
    grid-row: 2 !important;
    grid-template-columns: repeat(10, minmax(0, 1fr)) !important;
    gap: 7px !important;
    padding-inline: 10px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
    display: grid !important;
    grid-template-rows: 50px minmax(0, 1fr) 34px !important;
    gap: 0 !important;
    padding: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header {
    grid-template-rows: 22px 28px !important;
    height: 50px !important;
    min-height: 50px !important;
    padding: 1px 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 34px !important;
    height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    font-size: 0.64rem !important;
    line-height: 1.05 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips {
    height: 28px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 24px !important;
    height: 24px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.68rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row {
    height: 34px !important;
    min-height: 34px !important;
    gap: 2px !important;
    padding: 1px 0 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket {
    width: 26px !important;
    height: 26px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket img {
    width: 22px !important;
    height: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-columns: minmax(250px, 0.92fr) minmax(500px, 2.3fr) minmax(250px, 0.92fr) !important;
    gap: 12px !important;
    padding: 8px 7% 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel,
  .play-layout.is-battle-active .battle-arena .match-details-panel {
    padding: 13px !important;
    border: 1px solid rgba(226, 181, 91, 0.7) !important;
    border-radius: 10px !important;
    background: linear-gradient(180deg, rgba(40, 21, 13, 0.9), rgba(4, 18, 25, 0.94)) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.05), 0 10px 30px rgba(0, 0, 0, 0.24) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid rgba(255, 224, 138, 0.3) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading span {
    font-size: 0.74rem !important;
    letter-spacing: 0.11em !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare {
    gap: 9px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-title {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line {
    gap: 6px !important;
    padding: 8px !important;
    border-color: rgba(255, 250, 242, 0.18) !important;
    background: rgba(0, 8, 13, 0.62) !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line header,
  .play-layout.is-battle-active .battle-arena .battle-compare-line footer {
    font-size: 0.56rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values b {
    font-size: 1.56rem !important;
    text-shadow: 0 0 10px rgba(255, 224, 138, 0.2), 0 2px 8px rgba(0, 0, 0, 0.72) !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-meter {
    height: 12px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage {
    position: relative !important;
    display: block !important;
    padding: 10px 8px !important;
    border: 1px solid rgba(226, 181, 91, 0.62) !important;
    border-radius: 10px !important;
    background:
      radial-gradient(ellipse at 50% 56%, rgba(255, 224, 138, 0.18), transparent 44%),
      linear-gradient(180deg, rgba(6, 13, 16, 0.46), rgba(8, 13, 14, 0.7)),
      var(--match-host-art) center / cover !important;
    box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.06), 0 12px 30px rgba(0, 0, 0, 0.26) !important;
    isolation: isolate !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage::before {
    content: "" !important;
    position: absolute !important;
    inset: 22% 14% 15% !important;
    z-index: -1 !important;
    border: 1px solid rgba(226, 181, 91, 0.42) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 0 10px rgba(226, 181, 91, 0.05), 0 0 36px rgba(226, 181, 91, 0.12) !important;
    transform: perspective(320px) rotateX(58deg) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .bout-row {
    position: relative !important;
    z-index: 3 !important;
    height: 100% !important;
    padding: 25px 0 18px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage #boutRow {
    grid-template-columns: clamp(204px, calc(7vw + 91.16px), 232px) 116px clamp(204px, calc(7vw + 91.16px), 232px) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage #boutRow .match-ring-side {
    width: clamp(204px, calc(7vw + 91.16px), 232px) !important;
    grid-template-columns: clamp(204px, calc(7vw + 91.16px), 232px) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-card {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 5 / 8 !important;
    border-width: 2px !important;
    box-shadow: 0 0 0 2px rgba(34, 235, 217, 0.14), 0 0 30px rgba(34, 235, 217, 0.22), 0 14px 34px rgba(0, 0, 0, 0.48) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-side.is-opponent .match-ring-card {
    box-shadow: 0 0 0 2px rgba(255, 117, 78, 0.16), 0 0 30px rgba(255, 117, 78, 0.22), 0 14px 34px rgba(0, 0, 0, 0.48) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-card .battle-card-object {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: auto !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-vs {
    width: 54px !important;
    height: 54px !important;
    border-radius: 8px !important;
    background: linear-gradient(145deg, rgba(40, 23, 10, 0.94), rgba(6, 20, 25, 0.94)) !important;
    box-shadow: 0 0 0 1px rgba(255, 224, 138, 0.2), 0 0 24px rgba(255, 224, 138, 0.18) !important;
    transform: rotate(45deg) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-vs span,
  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-vs small {
    transform: rotate(-45deg) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-vs span {
    font-size: 0.82rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-vs small {
    font-size: 0.46rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst-layer {
    z-index: 12 !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst {
    width: 112px !important;
    min-height: 122px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--burst-accent) 34%, transparent), rgba(3, 10, 14, 0.72) 65%) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst img {
    width: 82px !important;
    height: 82px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge {
    top: -13px !important;
    min-width: 148px !important;
    padding: 5px 16px 4px !important;
    border: 2px solid rgba(226, 181, 91, 0.9) !important;
    border-radius: 6px !important;
    background: linear-gradient(180deg, rgba(37, 22, 9, 0.98), rgba(5, 20, 25, 0.98)) !important;
    box-shadow: 0 0 0 1px rgba(255, 250, 242, 0.08), 0 0 22px rgba(255, 180, 82, 0.28) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge strong {
    font-size: 1.28rem !important;
    letter-spacing: 0.08em !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge span {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta,
  .play-layout.is-battle-active .battle-arena .battle-details-section-heading,
  .play-layout.is-battle-active .battle-arena .battle-details-status {
    display: flex !important;
    align-items: baseline !important;
    justify-content: space-between !important;
    gap: 7px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta {
    margin: -3px 0 8px !important;
    padding-bottom: 7px !important;
    border-bottom: 1px solid rgba(255, 224, 138, 0.3) !important;
    color: rgba(238, 252, 255, 0.78) !important;
    font-size: 0.54rem !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta strong {
    color: #ffe08a !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-section {
    margin-top: 8px !important;
    padding-top: 7px !important;
    border-top: 1px solid rgba(255, 250, 242, 0.12) !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-section-heading {
    margin-bottom: 6px !important;
    color: #ffe08a !important;
    font-size: 0.56rem !important;
    font-weight: 1000 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-section-heading strong {
    color: #95f1df !important;
    font-size: 0.5rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effects {
    gap: 4px !important;
    margin: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect {
    grid-template-columns: 28px minmax(0, 1fr) auto !important;
    gap: 6px !important;
    min-height: 34px !important;
    padding: 4px 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect img,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row > img {
    width: 26px !important;
    height: 26px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect b,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row b {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect small,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row small {
    font-size: 0.48rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect > strong,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row > strong {
    font-size: 0.78rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-booster-row {
    display: grid !important;
    grid-template-columns: 30px minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 6px !important;
    min-height: 34px !important;
    padding: 4px 6px !important;
    border: 1px solid rgba(226, 181, 91, 0.24) !important;
    border-radius: 5px !important;
    background: rgba(72, 42, 12, 0.22) !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-booster-row span {
    display: grid !important;
    min-width: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-booster-row b,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row small {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-layers {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-layer {
    padding: 3px 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-layer b { font-size: 0.4rem !important; }
  .play-layout.is-battle-active .battle-arena .battle-effect-layer strong { font-size: 0.54rem !important; }

  .play-layout.is-battle-active .battle-arena .battle-details-status-block .battle-details-status {
    padding: 3px 5px !important;
    border-top: 0 !important;
    border-radius: 3px !important;
    background: rgba(34, 235, 217, 0.08) !important;
    color: rgba(238, 252, 255, 0.68) !important;
    font-size: 0.52rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-status-block .battle-details-status.is-fallen {
    margin-top: 2px !important;
    background: rgba(255, 117, 78, 0.08) !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-status-block .battle-details-status strong {
    color: #95f1df !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-status-block .battle-details-status.is-fallen strong {
    color: #ff9b7c !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-log ol {
    display: grid !important;
    gap: 3px !important;
    max-height: 72px !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-log li {
    display: grid !important;
    grid-template-columns: 16px minmax(0, 1fr) !important;
    gap: 4px !important;
    color: rgba(238, 252, 255, 0.68) !important;
    font-size: 0.48rem !important;
    line-height: 1.2 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-log li b {
    color: #ffe08a !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-effect-burst-layer,
  .play-layout.is-battle-active .battle-arena .match-match-hud {
    display: none !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-areas: "opponent" "center" "player" !important;
    grid-template-rows: 96px minmax(0, 1fr) 150px !important;
    height: min(814px, calc(100dvh - 30px)) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 188px 210px minmax(120px, 1fr) !important;
    min-height: 0 !important;
    padding: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .match-side {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage {
    padding: 5px !important;
    border-color: rgba(226, 181, 91, 0.58) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-card {
    width: 82px !important;
    height: 131px !important;
    min-height: 131px !important;
    max-height: 131px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-ring-vs {
    width: 34px !important;
    height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel {
    min-height: 120px !important;
    padding: 7px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta,
  .play-layout.is-battle-active .battle-arena .battle-details-section-heading {
    font-size: 0.44rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect {
    min-height: 28px !important;
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect img,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row > img {
    width: 20px !important;
    height: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect b,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row b {
    font-size: 0.44rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect small,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row small,
  .play-layout.is-battle-active .battle-arena .battle-details-log {
    font-size: 0.38rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-status-block,
  .play-layout.is-battle-active .battle-arena .battle-details-log,
  .play-layout.is-battle-active .battle-arena .battle-effect-layers {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst {
    width: 66px !important;
    min-height: 72px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst img {
    width: 46px !important;
    height: 46px !important;
  }
}

/* The battle state is mounted on the arena, while the containing play layout
   remains shared with the lesson flow. Use :has so the live board can occupy
   the full table-focus canvas without changing the non-battle lesson layout. */
@media (min-width: 981px) {
  .app-shell:has(.game.is-table-focus) {
    position: relative !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .game.is-table-focus {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    padding: 8px !important;
    overflow: hidden !important;
  }

  .game.is-table-focus .play-layout.is-battle-active {
    position: absolute !important;
    inset: 8px !important;
    width: auto !important;
    max-width: none !important;
    height: calc(100% - 16px) !important;
    margin: 0 !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-board,
  .game.is-table-focus .play-layout.is-battle-active .battle-arena {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-board {
    grid-template-rows: minmax(0, 1fr) !important;
    align-content: stretch !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-arena > .match-board {
    height: 100% !important;
    min-height: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage #boutRow .match-ring-card,
  .play-layout.is-battle-active .battle-arena .match-stage #boutRow .match-ring-card .battle-card-object {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    aspect-ratio: 5 / 8 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage #boutRow .match-ring-card .battle-card-object {
    height: 100% !important;
    aspect-ratio: auto !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-panel {
    overflow: hidden !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-section {
    margin-top: 5px !important;
    padding-top: 4px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-section-heading {
    margin-bottom: 4px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-effects {
    gap: 3px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-effect {
    min-height: 28px !important;
    padding: 2px 5px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-effect img,
  .game.is-table-focus .play-layout.is-battle-active .battle-details-booster-row > img {
    width: 22px !important;
    height: 22px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-booster-row {
    min-height: 28px !important;
    padding: 2px 5px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-status-block .battle-details-status {
    padding: 2px 5px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-log {
    display: block !important;
    margin-top: 5px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-log ol {
    max-height: 74px !important;
  }

  .game.is-table-focus .play-layout.is-battle-active .battle-details-log li {
    font-size: 0.46rem !important;
    line-height: 1.05 !important;
  }
}

@media (max-width: 980px) {
  .game.is-table-focus .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
    display: none !important;
  }
}

/* Automatic match sequence and tall shared card geometry. Keep this contract
   last: the battle rails use the same deck-builder object, while their outer
   slots reserve a fixed 5:8 portrait instead of stretching into squares. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner {
  position: absolute !important;
  top: 8px !important;
  left: 50% !important;
  z-index: 14 !important;
  display: grid !important;
  min-width: min(270px, 48%) !important;
  padding: 5px 16px 6px !important;
  transform: translateX(-50%) !important;
  border: 1px solid rgba(226, 181, 91, 0.66) !important;
  border-radius: 6px !important;
  background: linear-gradient(180deg, rgba(31, 20, 9, 0.96), rgba(5, 20, 25, 0.96)) !important;
  box-shadow: 0 0 22px rgba(255, 180, 82, 0.18) !important;
  text-align: center !important;
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner span {
  color: #ffe08a !important;
  font-size: 0.46rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0.12em !important;
  line-height: 1.1 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner strong {
  color: #fffaf2 !important;
  font-size: 0.78rem !important;
  font-weight: 1000 !important;
  line-height: 1.1 !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner small {
  color: rgba(238, 252, 255, 0.62) !important;
  font-size: 0.42rem !important;
  font-weight: 850 !important;
  line-height: 1.1 !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner.is-revealed {
  border-color: rgba(34, 235, 217, 0.72) !important;
  box-shadow: 0 0 24px rgba(34, 235, 217, 0.2) !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner.is-resolved,
.play-layout.is-battle-active .battle-arena .match-phase-banner.is-complete {
  border-color: rgba(255, 224, 138, 0.86) !important;
}

.play-layout.is-battle-active .battle-arena[data-sequence="automatic"] #advanceBattle {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena.phase-choose .battle-card-actions {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action {
  display: grid !important;
  min-width: 0 !important;
  min-height: 27px !important;
  place-items: center !important;
  padding: 2px !important;
  border: 1px solid rgba(149, 241, 223, 0.58) !important;
  border-radius: 5px !important;
  background: rgba(3, 18, 25, 0.94) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.42) !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action img {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action--boost {
  border-color: rgba(255, 224, 138, 0.72) !important;
}

.play-layout.is-battle-active .battle-arena .battle-card-action:disabled {
  opacity: 0.3 !important;
  filter: grayscale(0.8) !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-graph {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  margin-top: 7px !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track {
  min-width: 0 !important;
  padding: 5px !important;
  border-radius: 6px !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header {
  gap: 4px !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header b {
  font-size: 0.48rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header strong {
  font-size: 0.56rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header em {
  font-size: 0.8rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-meter {
  height: 8px !important;
  margin: 5px 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-effect-burst {
  animation-duration: 2s !important;
}

.play-layout.is-battle-active .battle-arena .match-effect-burst strong,
.play-layout.is-battle-active .battle-arena .match-effect-burst small {
  animation: match-effect-copy-in 260ms ease 0.2s both !important;
}

@keyframes match-effect-copy-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 30% minmax(0, 40%) 30% !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail > .arena-hand {
    --battle-rail-card-width: clamp(82px, calc((100vw - 280px) / 10), 138px);
    display: grid !important;
    grid-template-columns: repeat(10, var(--battle-rail-card-width)) !important;
    grid-template-rows: calc(var(--battle-rail-card-width) * 1.6) !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0 !important;
    padding-inline: 10px !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot {
    width: var(--battle-rail-card-width) !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: 0 !important;
    align-self: center !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 5 / 8 !important;
  }

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
  width: 100% !important;
  height: 100% !important;
}

/* The full-deck rail has an older compact image rule for list cards. The
   battle board uses the same composed card object, so its portrait must fill
   the portrait row instead of leaving a short image and a blank lower band. */
.play-layout.is-battle-active .battle-arena .match-rail #arenaHand .battle-card-object .deck-card-portrait > img,
.play-layout.is-battle-active .battle-arena .match-rail #opponentHand .battle-card-object .deck-card-portrait > img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner {
    top: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge {
    top: 6px !important;
    left: auto !important;
    right: 14px !important;
    transform: none !important;
    min-width: 122px !important;
    padding: 4px 10px 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge small {
    display: block !important;
    color: rgba(255, 224, 138, 0.78) !important;
    font-size: 0.38rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.08em !important;
    line-height: 1.1 !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-phase-banner {
    top: 5px !important;
    min-width: 190px !important;
    max-width: 72% !important;
    padding: 4px 9px 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner strong {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner span,
  .play-layout.is-battle-active .battle-arena .match-phase-banner small {
    font-size: 0.34rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst-layer {
    display: block !important;
    z-index: 18 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst {
    width: 58px !important;
    min-height: 68px !important;
    padding: 4px !important;
    border-radius: 8px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst img {
    width: 40px !important;
    height: 40px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst strong {
    font-size: 0.4rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst small {
    font-size: 0.3rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-graph {
    gap: 3px !important;
    margin-top: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-track {
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-track header strong {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-track header em {
    font-size: 0.6rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-effect-track .battle-effect-layers {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-actions {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-card-action {
    min-height: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-card-action img {
    width: 15px !important;
    height: 15px !important;
  }

  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 150px minmax(0, 514px) 150px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 176px 198px minmax(118px, 1fr) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    min-height: 150px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand {
    height: 138px !important;
    min-height: 138px !important;
    align-items: start !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-slot {
    height: 136px !important;
    min-height: 136px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst {
    width: 42px !important;
    min-height: 48px !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst img {
    width: 30px !important;
    height: 30px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst strong {
    font-size: 0.34rem !important;
  }
}

/* ID-qualified rail contract wins over the legacy full-width hand rules. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand,
  .play-layout.is-battle-active .battle-arena .match-rail #opponentHand {
    --battle-rail-card-width: clamp(82px, calc((100vw - 280px) / 10), 138px) !important;
    grid-template-columns: repeat(10, var(--battle-rail-card-width)) !important;
    grid-template-rows: calc(var(--battle-rail-card-width) * 1.6) !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 0 !important;
    padding-inline: 10px !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail #opponentHand .battle-card-slot {
    width: var(--battle-rail-card-width) !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: center !important;
  }
}

/* Keep round and match context visible on phones without covering the card
   headers; the stage has enough lower edge space for this compact badge. */
@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-round-badge {
    display: grid !important;
    position: absolute !important;
    top: auto !important;
    right: 6px !important;
    bottom: 5px !important;
    left: auto !important;
    transform: none !important;
    min-width: 78px !important;
    padding: 3px 6px !important;
    gap: 1px !important;
    z-index: 12 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge strong {
    font-size: 0.68rem !important;
    line-height: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-round-badge span,
  .play-layout.is-battle-active .battle-arena .match-round-badge small {
    display: block !important;
    font-size: 0.3rem !important;
    line-height: 1.1 !important;
  }
}

/* Keep the grouped board inside short phone viewports as well. */
@media (max-width: 980px) and (max-height: 700px) {
  .play-layout.is-battle-active .battle-arena > .match-board {
    grid-template-rows: 98px minmax(0, 1fr) 98px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 112px 132px minmax(70px, 1fr) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    min-height: 98px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .opponent-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > .arena-hand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand {
    height: 86px !important;
    min-height: 86px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-slot {
    height: 84px !important;
    min-height: 84px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object > .deck-card-scale {
    grid-template-rows: 27px minmax(0, 1fr) 20px !important;
    padding: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header {
    grid-template-columns: 20px minmax(0, 1fr) 14px !important;
    grid-template-rows: 12px 15px !important;
    height: 27px !important;
    min-height: 27px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 19px !important;
    height: 19px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    font-size: 0.32rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips,
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
    height: 15px !important;
    grid-template-rows: 15px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 13px !important;
    height: 13px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.3rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-actions button {
    width: 12px !important;
    height: 12px !important;
    min-width: 12px !important;
    font-size: 0.35rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row {
    height: 20px !important;
    min-height: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket {
    width: 16px !important;
    height: 16px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-socket-row .deck-socket img {
    width: 13px !important;
    height: 13px !important;
  }
}

/* True final action overlay guard: Deploy/Boost live inside the portrait art,
   so the shared 5:8 card object never grows a separate control footer. */
.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot > .battle-card-object {
  z-index: 5 !important;
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-slot > .hand-card-select {
  z-index: 3 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait {
  position: relative !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions {
  position: absolute !important;
  right: 5px !important;
  bottom: 5px !important;
  left: auto !important;
  z-index: 22 !important;
  display: grid !important;
  grid-template-columns: repeat(2, 28px) !important;
  gap: 4px !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 3px !important;
  border: 1px solid rgba(149, 241, 223, 0.36) !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, rgba(2, 17, 23, 0.92), rgba(2, 10, 14, 0.82)) !important;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), 0 0 14px rgba(34, 235, 217, 0.14) !important;
  opacity: 0.96 !important;
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  padding: 3px !important;
  border-radius: 50% !important;
  pointer-events: auto !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action img {
  width: 19px !important;
  height: 19px !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions {
    right: 4px !important;
    bottom: 4px !important;
    grid-template-columns: repeat(2, 22px) !important;
    gap: 3px !important;
    padding: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    padding: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action img {
    width: 15px !important;
    height: 15px !important;
  }
}

/* Player hand density guard: keep the playable hand close-packed now that
   status is shown on the board instead of as card overlays. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand {
    justify-content: start !important;
    gap: 3px !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand {
    gap: 3px !important;
  }
}

/* Battle board readability guard: the board chrome must be legible at a glance,
   while both deck rails stay close-packed 5:8 card objects. */
.play-layout.is-battle-active .battle-arena .match-board {
  --battle-rail-card-width: clamp(82px, calc((100vw - 760px) / 10), 108px);
  grid-template-rows: calc(var(--battle-rail-card-width) * 1.6 + 14px) minmax(0, 1fr) calc(var(--battle-rail-card-width) * 1.6 + 14px) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail #arenaHand,
.play-layout.is-battle-active .battle-arena .match-rail #opponentHand {
  --battle-rail-card-width: clamp(82px, calc((100vw - 760px) / 10), 108px) !important;
  grid-template-columns: repeat(10, var(--battle-rail-card-width)) !important;
  grid-template-rows: calc(var(--battle-rail-card-width) * 1.6) !important;
  justify-content: start !important;
  align-items: center !important;
  gap: 3px !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .match-rail #arenaHand .battle-card-slot,
.play-layout.is-battle-active .battle-arena .match-rail #opponentHand .battle-card-slot {
  width: var(--battle-rail-card-width) !important;
  height: calc(var(--battle-rail-card-width) * 1.6) !important;
  min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
  --battle-rail-card-width: clamp(82px, calc((100vw - 760px) / 10), 108px) !important;
  height: calc(var(--battle-rail-card-width) * 1.6) !important;
  min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-slot,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-slot {
  width: var(--battle-rail-card-width) !important;
  height: calc(var(--battle-rail-card-width) * 1.6) !important;
  min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
}

.play-layout.is-battle-active .battle-arena .match-rail #arenaHand .battle-card-object,
.play-layout.is-battle-active .battle-arena .match-rail #opponentHand .battle-card-object {
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 5 / 8 !important;
}

.play-layout.is-battle-active .battle-arena .match-center-row {
  grid-template-columns: minmax(250px, 0.82fr) minmax(470px, 1.45fr) minmax(290px, 0.9fr) !important;
  gap: 12px !important;
}

.play-layout.is-battle-active .battle-arena .match-compare-panel,
.play-layout.is-battle-active .battle-arena .match-details-panel {
  padding: 14px !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-content: stretch !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel .arena-log {
  display: none !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading {
  margin-bottom: 10px !important;
  font-size: 1rem !important;
  letter-spacing: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading small {
  font-size: 0.76rem !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner {
  min-width: min(440px, 55%) !important;
  padding: 8px 20px 9px !important;
  animation: battle-phase-pulse 1400ms ease-in-out infinite !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner span {
  font-size: 0.72rem !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner strong {
  font-size: 1.28rem !important;
}

.play-layout.is-battle-active .battle-arena .match-phase-banner small {
  font-size: 0.74rem !important;
}

@keyframes battle-phase-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(255, 180, 82, 0.16); }
  50% { box-shadow: 0 0 30px rgba(34, 235, 217, 0.28), 0 0 18px rgba(255, 180, 82, 0.18); }
}

.play-layout.is-battle-active .battle-arena .match-round-badge {
  min-width: 150px !important;
  padding: 8px 14px 7px !important;
}

.play-layout.is-battle-active .battle-arena .match-round-badge strong {
  font-size: 1.8rem !important;
}

.play-layout.is-battle-active .battle-arena .match-round-badge span,
.play-layout.is-battle-active .battle-arena .match-round-badge small {
  font-size: 0.7rem !important;
}

.play-layout.is-battle-active .match-match-hud .eyebrow {
  font-size: 0.72rem !important;
}

.play-layout.is-battle-active .match-match-hud h3 {
  font-size: 1rem !important;
}

.play-layout.is-battle-active .match-match-hud > strong {
  font-size: 1.6rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-title {
  font-size: 0.86rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-line {
  gap: 7px !important;
  padding: 10px !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-line header,
.play-layout.is-battle-active .battle-arena .battle-compare-line footer {
  font-size: 0.82rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-values b {
  font-size: 2.08rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-values span {
  font-size: 0.78rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-meta {
  display: flex !important;
  justify-content: space-between !important;
  gap: 8px !important;
  color: rgba(238, 252, 255, 0.78) !important;
  font-size: 0.86rem !important;
  font-weight: 900 !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-section-heading {
  margin-top: 8px !important;
  font-size: 0.82rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-section-heading strong {
  font-size: 0.82rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect {
  grid-template-columns: 36px minmax(0, 1fr) auto !important;
  gap: 8px !important;
  padding: 8px !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect img,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row > img {
  width: 34px !important;
  height: 34px !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect b,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row b {
  font-size: 0.9rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect small,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row small {
  font-size: 0.74rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect > strong,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row > strong {
  font-size: 1.15rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header b {
  font-size: 0.72rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header strong {
  font-size: 0.84rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-effect-track header em {
  font-size: 1.25rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-empty,
.play-layout.is-battle-active .battle-arena .battle-compare-empty {
  font-size: 0.95rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-log li {
  font-size: 0.74rem !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-concealed,
.play-layout.is-battle-active .battle-arena .hidden-deployment-card {
  font-size: 1rem !important;
  line-height: 1.3 !important;
}

.play-layout.is-battle-active .battle-arena .match-ring-concealed strong,
.play-layout.is-battle-active .battle-arena .hidden-deployment-card strong {
  font-size: 1.18rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-chat-panel {
  min-height: 164px !important;
  padding-top: 10px !important;
  border-top: 1px solid rgba(238, 252, 255, 0.12) !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk {
  display: grid !important;
  grid-template-rows: auto minmax(78px, 1fr) auto auto !important;
  gap: 8px !important;
  min-height: 0 !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk > strong {
  color: #ffe08a !important;
  font-size: 0.9rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk ol {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  min-height: 0 !important;
  max-height: 130px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto !important;
  list-style: none !important;
  scrollbar-width: thin !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li {
  display: grid !important;
  gap: 2px !important;
  padding: 6px 8px !important;
  border: 1px solid rgba(149, 241, 223, 0.18) !important;
  border-radius: 8px !important;
  background: rgba(5, 17, 22, 0.72) !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li.room-talk-entry--own {
  border-color: rgba(255, 224, 138, 0.42) !important;
  background: rgba(72, 50, 18, 0.52) !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li.room-talk-entry--other {
  border-color: rgba(34, 235, 217, 0.28) !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li span {
  color: #95f1df !important;
  font-size: 0.74rem !important;
  font-weight: 1000 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li p {
  margin: 0 !important;
  color: #eefcff !important;
  font-size: 0.88rem !important;
  line-height: 1.25 !important;
}

.play-layout.is-battle-active .battle-arena .quick-phrases,
.play-layout.is-battle-active .battle-arena .room-chat-form {
  display: flex !important;
  gap: 6px !important;
}

.play-layout.is-battle-active .battle-arena .quick-phrases button {
  display: grid !important;
  place-items: center !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 4px !important;
  border: 1px solid rgba(255, 224, 138, 0.32) !important;
  border-radius: 6px !important;
  background: rgba(3, 18, 25, 0.88) !important;
}

.play-layout.is-battle-active .battle-arena .quick-phrases button img {
  width: 26px !important;
  height: 26px !important;
  object-fit: contain !important;
}

.play-layout.is-battle-active .battle-arena .room-chat-form {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
}

.play-layout.is-battle-active .battle-arena .room-chat-form input {
  min-width: 0 !important;
  min-height: 38px !important;
  padding: 7px 9px !important;
  border: 1px solid rgba(149, 241, 223, 0.24) !important;
  border-radius: 6px !important;
  background: rgba(0, 9, 14, 0.72) !important;
  color: #eefcff !important;
  font: inherit !important;
  font-size: 0.86rem !important;
}

.play-layout.is-battle-active .battle-arena .room-chat-form button {
  min-height: 38px !important;
  padding: 0 12px !important;
  border-color: rgba(34, 235, 217, 0.42) !important;
  color: #021116 !important;
  background: linear-gradient(180deg, #95f1df, #22ebd9) !important;
  font-size: 0.82rem !important;
  font-weight: 1000 !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-board {
    --battle-rail-card-width: 76px;
    grid-template-rows: 126px minmax(0, 1fr) 126px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand,
  .play-layout.is-battle-active .battle-arena .match-rail #opponentHand {
    --battle-rail-card-width: 76px !important;
    display: flex !important;
    grid-template-columns: none !important;
    gap: 3px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail #arenaHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail #opponentHand .battle-card-slot {
    flex: 0 0 var(--battle-rail-card-width) !important;
    width: var(--battle-rail-card-width) !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
    --battle-rail-card-width: 76px !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object > .deck-card-scale,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object > .deck-card-scale {
    grid-template-rows: 32px minmax(0, 1fr) 22px !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header {
    grid-template-columns: 22px minmax(0, 1fr) 14px !important;
    grid-template-rows: 12px 16px !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row {
    height: 22px !important;
    min-height: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner {
    min-width: min(270px, 74%) !important;
    padding: 5px 10px 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner span {
    font-size: 0.46rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner strong {
    font-size: 0.76rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner small {
    font-size: 0.46rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading {
    font-size: 0.74rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading small {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values b {
    font-size: 1.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line header,
  .play-layout.is-battle-active .battle-arena .battle-compare-line footer,
  .play-layout.is-battle-active .battle-arena .battle-details-meta,
  .play-layout.is-battle-active .battle-arena .battle-details-empty,
  .play-layout.is-battle-active .battle-arena .battle-compare-empty {
    font-size: 0.68rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect b,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row b,
  .play-layout.is-battle-active .battle-arena .room-table-talk li p {
    font-size: 0.68rem !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk ol {
    max-height: 92px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-chat-panel {
    min-height: 132px !important;
  }
}

/* Final board rack contract: both hands sit inside their mounted lanes, and
   compact rail cards keep enough portrait area for play actions. */
.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.28fr) !important;
  grid-template-rows: calc(var(--battle-rail-card-width) * 1.6) !important;
  align-items: start !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player {
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: calc(var(--battle-rail-card-width) * 1.6) !important;
  align-items: start !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand,
.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand {
  grid-row: 1 !important;
  align-self: start !important;
  justify-self: start !important;
  margin: 0 !important;
  transform: none !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
  grid-column: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand {
  grid-column: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: stretch !important;
  height: calc(var(--battle-rail-card-width) * 1.6) !important;
  min-height: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading span {
  font-size: 1rem !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object > .deck-card-scale,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object > .deck-card-scale {
  grid-template-rows: 34px minmax(0, 1fr) 24px !important;
  padding: 3px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header {
  grid-template-columns: 24px minmax(0, 1fr) 15px !important;
  grid-template-rows: 13px 17px !important;
  height: 34px !important;
  min-height: 34px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity,
.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity .deck-build-medallion,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity .deck-build-medallion,
.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity .deck-build-medallion img,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity .deck-build-medallion img {
  width: 23px !important;
  height: 23px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips,
.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips span,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
  height: 17px !important;
  grid-template-rows: 17px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips img,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
  width: 15px !important;
  height: 15px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips b,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
  font-size: 0.42rem !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row {
  height: 24px !important;
  min-height: 24px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row .deck-socket,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row .deck-socket {
  width: 20px !important;
  height: 20px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row .deck-socket img,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row .deck-socket img {
  width: 17px !important;
  height: 17px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions {
  grid-template-columns: repeat(2, 20px) !important;
  gap: 3px !important;
  padding: 2px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  padding: 2px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action img {
  width: 14px !important;
  height: 14px !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: calc(var(--battle-rail-card-width) * 1.6) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading span {
    font-size: 0.74rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions {
    grid-template-columns: repeat(2, 18px) !important;
    gap: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-portrait > .battle-card-actions .battle-card-action img {
    width: 12px !important;
    height: 12px !important;
  }
}

/* Final overlap guard for the live board: rail labels were legacy scaffolding
   and cannot sit on top of the reusable card tiles. */
.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-side,
.play-layout.is-battle-active .battle-arena .match-rail-player > .match-side {
  display: none !important;
  visibility: hidden !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-stage {
    align-content: start !important;
    gap: 4px !important;
    padding: 6px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-phase-banner {
    position: static !important;
    inset: auto !important;
    justify-self: center !important;
    transform: none !important;
    width: min(270px, 94%) !important;
    margin: 0 auto 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge {
    position: absolute !important;
    top: 44px !important;
    right: 6px !important;
    bottom: auto !important;
    min-width: 68px !important;
    padding: 2px 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge strong {
    font-size: 0.78rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge span,
  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge small {
    font-size: 0.34rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst {
    width: 36px !important;
    min-height: 42px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst img {
    width: 25px !important;
    height: 25px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-effect-burst strong {
    font-size: 0.3rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel {
    grid-template-rows: auto minmax(0, 62px) minmax(0, 52px) !important;
    gap: 4px !important;
    padding: 8px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel .battle-effects {
    min-height: 0 !important;
    max-height: 62px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta,
  .play-layout.is-battle-active .battle-arena .battle-details-section-heading {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-section:not(:first-of-type),
  .play-layout.is-battle-active .battle-arena .battle-effect-graph,
  .play-layout.is-battle-active .battle-arena .battle-effect-layers {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect {
    grid-template-columns: 22px minmax(0, 1fr) auto !important;
    gap: 4px !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect img {
    width: 20px !important;
    height: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-chat-panel {
    min-height: 0 !important;
    max-height: 52px !important;
    padding-top: 3px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk {
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk > strong {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk ol {
    max-height: 30px !important;
    gap: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li {
    padding: 3px 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li span {
    font-size: 0.5rem !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li p {
    font-size: 0.58rem !important;
    line-height: 1.12 !important;
  }

  .play-layout.is-battle-active .battle-arena .quick-phrases,
  .play-layout.is-battle-active .battle-arena .room-chat-form {
    display: none !important;
  }
}

/* Battle board readability pass: keep the shared card tiles intact while
   giving the actual board panels enough type scale to be read in play. */
.play-layout.is-battle-active .battle-arena .match-panel-heading span {
  font-size: 1.12rem !important;
}

.play-layout.is-battle-active .battle-arena .match-panel-heading small {
  font-size: 0.86rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-title,
.play-layout.is-battle-active .battle-arena .battle-compare-line header,
.play-layout.is-battle-active .battle-arena .battle-compare-line footer {
  font-size: 0.92rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-values b {
  font-size: 2.28rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-compare-values span {
  font-size: 0.96rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-meta,
.play-layout.is-battle-active .battle-arena .battle-details-section-heading {
  font-size: 0.92rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect b,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row b {
  font-size: 1rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect small,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row small,
.play-layout.is-battle-active .battle-arena .battle-details-log li span {
  font-size: 0.82rem !important;
}

.play-layout.is-battle-active .battle-arena .battle-details-effect strong,
.play-layout.is-battle-active .battle-arena .battle-details-booster-row strong {
  font-size: 1.08rem !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk > strong {
  font-size: 0.96rem !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li span {
  font-size: 0.78rem !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk li p {
  font-size: 0.98rem !important;
  line-height: 1.28 !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud .eyebrow {
  font-size: 0.82rem !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud h3 {
  font-size: 1.02rem !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud strong {
  font-size: 1.62rem !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-board {
    grid-template-rows: 130px minmax(0, 1fr) 130px !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail {
    padding: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 164px minmax(184px, 1fr) 150px !important;
    gap: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-compare-panel,
  .play-layout.is-battle-active .battle-arena .match-details-panel {
    padding: 8px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading span {
    font-size: 0.92rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading small {
    font-size: 0.72rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-title {
    font-size: 0.76rem !important;
    gap: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-attribute-duel {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line {
    min-height: 52px !important;
    padding: 5px 6px !important;
    gap: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line header,
  .play-layout.is-battle-active .battle-arena .battle-compare-line footer {
    font-size: 0.7rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values b {
    font-size: 1.54rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values span {
    font-size: 0.72rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-phase-banner {
    width: min(292px, 96%) !important;
    padding: 6px 10px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner span {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner strong {
    font-size: 0.88rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner small {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge {
    top: 48px !important;
    right: 7px !important;
    min-width: 74px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge strong {
    font-size: 0.92rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge span,
  .play-layout.is-battle-active .battle-arena .match-stage .match-round-badge small {
    font-size: 0.42rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel {
    grid-template-rows: auto minmax(0, 86px) minmax(0, 46px) !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel .battle-effects {
    max-height: 86px !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta,
  .play-layout.is-battle-active .battle-arena .battle-details-section-heading {
    font-size: 0.7rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effects {
    gap: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect:nth-child(n+3) {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect {
    grid-template-columns: 24px minmax(0, 1fr) auto !important;
    min-height: 28px !important;
    padding: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect img {
    width: 22px !important;
    height: 22px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect b,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row b {
    font-size: 0.74rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect small,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row small {
    font-size: 0.62rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect strong,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row strong {
    font-size: 0.82rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-chat-panel {
    max-height: 46px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk > strong {
    font-size: 0.68rem !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk ol {
    max-height: 24px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li {
    min-height: 22px !important;
    padding: 3px 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li span {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li p {
    font-size: 0.68rem !important;
    line-height: 1.12 !important;
  }
}

/* Final ordering/readability lock for the live match panels. */
.play-layout.is-battle-active .battle-arena .match-details-panel > .match-panel-heading {
  grid-row: 1 !important;
  grid-column: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel > .battle-effects {
  grid-row: 2 !important;
  grid-column: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel > .battle-chat-panel {
  grid-row: 3 !important;
  grid-column: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel > .arena-log {
  grid-row: 4 !important;
  grid-column: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud h3 {
  overflow: visible !important;
  line-height: 1.12 !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 330px) !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  grid-template-rows: auto auto minmax(0, 1fr) !important;
  align-content: start !important;
  gap: 6px 10px !important;
  min-width: 300px !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud .eyebrow {
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud h3 {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  align-self: center !important;
  overflow: hidden !important;
  font-size: 0.92rem !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  display: grid !important;
  gap: 4px !important;
  align-self: start !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline {
  display: flex !important;
  align-items: baseline !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline b {
  color: #95f1df !important;
  font-size: 1.7rem !important;
  line-height: 1 !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline small {
  color: #ffe08a !important;
  font-size: 0.76rem !important;
  font-weight: 1000 !important;
  text-transform: uppercase !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .score-pips {
  justify-content: flex-end !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-board {
    grid-template-rows: 126px minmax(0, 1fr) 126px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail {
    padding: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 170px minmax(0, 216px) 146px !important;
    gap: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare {
    display: grid !important;
    grid-template-rows: auto 58px 58px !important;
    align-content: start !important;
    gap: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    height: 58px !important;
    min-height: 58px !important;
    padding: 15px 6px 8px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line header {
    position: absolute !important;
    top: 3px !important;
    right: 6px !important;
    left: 6px !important;
    display: flex !important;
    justify-content: flex-end !important;
    font-size: 0.68rem !important;
    line-height: 1.05 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-line header span,
  .play-layout.is-battle-active .battle-arena .battle-compare-line footer {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values {
    align-items: center !important;
    height: auto !important;
    line-height: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-values b {
    font-size: 1.58rem !important;
    line-height: 0.96 !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-compare-meter {
    height: 8px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel {
    grid-template-rows: auto minmax(0, 67px) minmax(0, 36px) !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel .match-panel-heading {
    margin-bottom: 0 !important;
    padding-bottom: 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel .battle-effects {
    max-height: 67px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-meta {
    margin-bottom: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-section-heading {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect {
    min-height: 29px !important;
    padding: 3px 4px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-chat-panel {
    max-height: 36px !important;
    padding-top: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk > strong {
    line-height: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk ol {
    max-height: 22px !important;
  }
}

/* Release guard: keep the board HUD out of the card rail and keep both hand
   racks on the same compressed, reusable deck-card object. */
.play-layout.is-battle-active .battle-arena .match-board {
  --battle-rail-strip-width: calc((var(--battle-rail-card-width) * 10) + 27px);
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent {
  grid-template-columns: minmax(0, var(--battle-rail-strip-width)) minmax(270px, 1fr) !important;
  gap: 10px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player {
  grid-template-columns: minmax(0, var(--battle-rail-strip-width)) minmax(0, 1fr) !important;
  gap: 10px !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand,
.play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
  width: min(100%, var(--battle-rail-strip-width)) !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
  justify-self: start !important;
}

.play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
  grid-column: 2 !important;
  grid-row: 1 !important;
  justify-self: end !important;
  align-self: stretch !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(124px, auto) !important;
  grid-template-rows: auto auto !important;
  align-content: center !important;
  gap: 4px 14px !important;
  width: min(100%, 430px) !important;
  max-width: 430px !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 12px 14px !important;
  overflow: hidden !important;
  border: 1px solid rgba(226, 181, 91, 0.56) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(90deg, rgba(34, 18, 12, 0.82), rgba(4, 21, 25, 0.9)),
    rgba(3, 10, 14, 0.78) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.05), 0 10px 22px rgba(0, 0, 0, 0.25) !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud .eyebrow {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  color: #ffe08a !important;
  font-size: 0.78rem !important;
  line-height: 1 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud h3 {
  grid-column: 1 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden !important;
  color: #fffaf2 !important;
  font-size: 1.04rem !important;
  line-height: 1.05 !important;
  letter-spacing: 0 !important;
  text-overflow: ellipsis !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore {
  grid-column: 2 !important;
  grid-row: 1 / 3 !important;
  align-self: center !important;
  display: grid !important;
  gap: 6px !important;
  width: auto !important;
  min-width: 124px !important;
  max-width: 150px !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline {
  display: flex !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline b {
  flex: 0 0 auto !important;
  color: #95f1df !important;
  font-size: 1.8rem !important;
  line-height: 0.92 !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline small {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  color: #ffe08a !important;
  font-size: 0.68rem !important;
  line-height: 1 !important;
  text-align: center !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .score-pips {
  display: flex !important;
  justify-content: center !important;
  gap: 5px !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
    display: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    justify-self: stretch !important;
    scrollbar-width: none !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand::-webkit-scrollbar,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand::-webkit-scrollbar {
    display: none !important;
  }
}

/* Mobile readability floor: board copy must be readable without zooming. */
@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 166px minmax(0, 196px) 170px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading span {
    font-size: 0.9rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-panel-heading small {
    font-size: 0.74rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner strong {
    font-size: 0.96rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-phase-banner span,
  .play-layout.is-battle-active .battle-arena .match-phase-banner small {
    font-size: 0.66rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel {
    grid-template-rows: auto minmax(0, 82px) minmax(0, 52px) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel .battle-effects {
    max-height: 82px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect {
    min-height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect b,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row b {
    font-size: 0.82rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-details-effect strong,
  .play-layout.is-battle-active .battle-arena .battle-details-booster-row strong {
    font-size: 0.9rem !important;
  }

  .play-layout.is-battle-active .battle-arena .battle-chat-panel {
    max-height: 52px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li {
    min-height: 26px !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li span {
    font-size: 0.66rem !important;
  }

  .play-layout.is-battle-active .battle-arena .room-table-talk li p {
    font-size: 0.76rem !important;
  }
}

/* Right-side battle console frame. */
.play-layout.is-battle-active .battle-arena .match-details-panel {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  border: 2px solid rgba(226, 181, 91, 0.72) !important;
  border-radius: 10px !important;
  background:
    linear-gradient(180deg, rgba(31, 20, 14, 0.86), rgba(3, 15, 19, 0.94)),
    var(--match-host-art) right center / cover !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.07),
    inset 0 0 28px rgba(226, 181, 91, 0.08),
    0 18px 34px rgba(0, 0, 0, 0.34) !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel::before {
  content: "" !important;
  position: absolute !important;
  inset: 7px !important;
  z-index: -1 !important;
  border: 1px solid rgba(149, 241, 223, 0.18) !important;
  border-radius: 7px !important;
  background: linear-gradient(180deg, rgba(1, 13, 18, 0.44), rgba(1, 9, 13, 0.2)) !important;
  pointer-events: none !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel .match-panel-heading {
  padding: 2px 2px 11px !important;
  border-bottom: 1px solid rgba(226, 181, 91, 0.4) !important;
}

.play-layout.is-battle-active .battle-arena .match-details-panel .battle-effects {
  padding: 10px !important;
  border: 1px solid rgba(149, 241, 223, 0.2) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(2, 21, 27, 0.78), rgba(1, 10, 15, 0.72)) !important;
}

.play-layout.is-battle-active .battle-arena .battle-chat-panel {
  padding: 10px !important;
  border: 1px solid rgba(226, 181, 91, 0.28) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(24, 17, 12, 0.7), rgba(2, 15, 19, 0.74)) !important;
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-details-panel {
    border-width: 1px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-details-panel .battle-effects,
  .play-layout.is-battle-active .battle-arena .battle-chat-panel {
    padding: 6px !important;
  }
}

/* Battle chat is intentionally live during the local/computer match phase until
   room-backed chat replaces it. Keep its controls hit-testable even in compact
   board layouts that previously treated table talk as read-only. */
.play-layout.is-battle-active .battle-arena .battle-chat-panel {
  max-height: none !important;
  overflow: visible !important;
}

.play-layout.is-battle-active .battle-arena .room-table-talk {
  grid-template-rows: auto minmax(34px, 1fr) auto auto !important;
}

.play-layout.is-battle-active .battle-arena .quick-phrases {
  display: flex !important;
  visibility: visible !important;
}

.play-layout.is-battle-active .battle-arena .room-chat-form {
  display: grid !important;
  visibility: visible !important;
}

.play-layout.is-battle-active .battle-arena .quick-phrases button,
.play-layout.is-battle-active .battle-arena .room-chat-form input,
.play-layout.is-battle-active .battle-arena .room-chat-form button {
  pointer-events: auto !important;
}

/* Hand-forward battle scale trial: compress the center board and return the
   recovered height to the shared deck-card racks. */
@media (min-width: 981px) {
  .play-layout.is-battle-active .battle-arena .match-board {
    --battle-rail-card-width: clamp(112px, calc((100vw - 310px) / 10), 130px) !important;
    --battle-rail-strip-width: calc((var(--battle-rail-card-width) * 10) + 27px) !important;
    grid-template-rows: clamp(214px, 25vh, 230px) minmax(390px, 0.7fr) clamp(214px, 25vh, 230px) !important;
    gap: 7px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent,
  .play-layout.is-battle-active .battle-arena .match-rail-player {
    min-height: clamp(214px, 25vh, 230px) !important;
    padding: 9px 12px !important;
    align-items: center !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent {
    grid-template-columns: minmax(0, var(--battle-rail-strip-width)) minmax(188px, 208px) !important;
    gap: 8px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player {
    grid-template-columns: minmax(0, var(--battle-rail-strip-width)) minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
    --battle-rail-card-width: clamp(112px, calc((100vw - 310px) / 10), 130px) !important;
    width: var(--battle-rail-strip-width) !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    align-self: center !important;
    overflow: hidden !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-slot {
    width: var(--battle-rail-card-width) !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-opponent > .match-match-hud {
    width: min(100%, 208px) !important;
    max-width: 208px !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    align-self: center !important;
    padding: 10px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: center !important;
    justify-content: stretch !important;
    justify-items: stretch !important;
    gap: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud .eyebrow,
  .play-layout.is-battle-active .battle-arena .match-match-hud h3,
  .play-layout.is-battle-active .battle-arena .match-match-hud #battleScore {
    grid-column: 1 !important;
    justify-self: stretch !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud .eyebrow {
    grid-row: 1 !important;
    width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud h3 {
    grid-row: 2 !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    font-size: 0.88rem !important;
    line-height: 1.08 !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud #battleScore {
    grid-row: 3 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline b {
    font-size: 1.55rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-match-hud #battleScore .scoreline small {
    min-width: 0 !important;
    overflow: hidden !important;
    font-size: 0.58rem !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-columns: minmax(240px, 0.8fr) minmax(420px, 1.22fr) minmax(280px, 0.86fr) !important;
    gap: 10px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage {
    padding-block: 6px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-stage #boutRow .match-ring-card {
    width: clamp(162px, 12.2vw, 196px) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object > .deck-card-scale,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object > .deck-card-scale {
    grid-template-rows: 48px minmax(0, 1fr) 34px !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header {
    grid-template-columns: 34px minmax(0, 1fr) 18px !important;
    grid-template-rows: 18px 28px !important;
    height: 48px !important;
    min-height: 48px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity .deck-build-medallion img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 34px !important;
    height: 34px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    font-size: 0.74rem !important;
    line-height: 1 !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips span,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
    height: 28px !important;
    grid-template-rows: 28px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 27px !important;
    height: 27px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips b,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.72rem !important;
    line-height: 1 !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row {
    height: 34px !important;
    min-height: 34px !important;
    gap: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row .deck-socket,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row .deck-socket {
    width: 28px !important;
    height: 28px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row .deck-socket img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row .deck-socket img {
    width: 24px !important;
    height: 24px !important;
  }
}

@media (max-width: 980px) {
  .play-layout.is-battle-active .battle-arena .match-board {
    --battle-rail-card-width: 82px !important;
    grid-template-rows: 136px minmax(0, 1fr) 136px !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand {
    --battle-rail-card-width: 82px !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-slot,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-slot {
    width: var(--battle-rail-card-width) !important;
    height: calc(var(--battle-rail-card-width) * 1.6) !important;
    min-height: calc(var(--battle-rail-card-width) * 1.6) !important;
    max-height: calc(var(--battle-rail-card-width) * 1.6) !important;
  }

  .play-layout.is-battle-active .battle-arena .match-center-row {
    grid-template-rows: 126px minmax(180px, 1fr) 138px !important;
    gap: 5px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail .battle-card-object .deck-card-header-copy strong {
    font-size: 0.56rem !important;
    text-transform: uppercase !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object > .deck-card-scale,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object > .deck-card-scale {
    grid-template-rows: 35px minmax(0, 1fr) 25px !important;
    padding: 3px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header {
    grid-template-columns: 24px minmax(0, 1fr) 15px !important;
    grid-template-rows: 14px 19px !important;
    height: 35px !important;
    min-height: 35px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity .deck-build-medallion,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-header-identity .deck-build-medallion img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-header-identity .deck-build-medallion img {
    width: 24px !important;
    height: 24px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips,
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips span,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips span {
    height: 19px !important;
    grid-template-rows: 19px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips img {
    width: 18px !important;
    height: 18px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-tile-header > .deck-combat-pips b,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-tile-header > .deck-combat-pips b {
    font-size: 0.58rem !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-portrait > img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-portrait > img {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
  }

  /* Motor's sidefoot contact clears the compact action buttons at this crop. */
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object[data-match-card="athleticism-single-11"] .deck-card-portrait > img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object[data-match-card="athleticism-single-11"] .deck-card-portrait > img {
    width: 120% !important;
    transform: translateX(-17%);
  }

  /* Stonewall's ball meets her boot just left of the compact actions. */
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object[data-match-card="athleticism-single-12"] .deck-card-portrait > .battle-card-actions,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object[data-match-card="athleticism-single-12"] .deck-card-portrait > .battle-card-actions {
    right: 0 !important;
  }
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object[data-match-card="athleticism-single-12"] .deck-card-portrait > img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object[data-match-card="athleticism-single-12"] .deck-card-portrait > img {
    width: 110% !important;
    transform: translateX(-8%);
  }

  /* Boot's contact sits left of the compact battle actions. */
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object[data-match-card="athleticism-single-13"] .deck-card-portrait > .battle-card-actions,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object[data-match-card="athleticism-single-13"] .deck-card-portrait > .battle-card-actions {
    right: 0 !important;
  }
  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object[data-match-card="athleticism-single-13"] .deck-card-portrait > img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object[data-match-card="athleticism-single-13"] .deck-card-portrait > img {
    width: 125% !important;
    transform: translateX(-20%);
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row {
    height: 25px !important;
    min-height: 25px !important;
    gap: 2px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row .deck-socket,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row .deck-socket {
    width: 20px !important;
    height: 20px !important;
  }

  .play-layout.is-battle-active .battle-arena .match-rail-player > #arenaHand .battle-card-object .deck-card-socket-row .deck-socket img,
  .play-layout.is-battle-active .battle-arena .match-rail-opponent > #opponentHand .battle-card-object .deck-card-socket-row .deck-socket img {
    width: 17px !important;
    height: 17px !important;
  }
}
