:root {
  --ink: #171614;
  --ink-soft: #2a2721;
  --paper: #f4ead9;
  --paper-strong: #fff8ec;
  --line: #d2c0a6;
  --muted: #72665a;
  --brass: #b9823d;
  --clay: #9b4b36;
  --teal: #1d766f;
  --olive: #66773b;
  --wine: #7f334d;
  --violet: #5d4a76;
  --blue: #385c79;
  --success: #2f7d52;
  --danger: #aa3f36;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --card-shadow: 0 12px 28px rgba(23, 22, 20, 0.18);
  --panel-shadow: 0 16px 38px rgba(23, 22, 20, 0.16);
  --lift-shadow: 0 22px 48px rgba(23, 22, 20, 0.2);
  --inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  --gold-soft: #f6cf7b;
  --aqua: #68d8cc;
  --focus-ring: 0 0 0 3px rgba(104, 216, 204, 0.28);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -20%, rgba(246, 207, 123, 0.18), transparent 42%),
    linear-gradient(120deg, rgba(29, 118, 111, 0.16), transparent 34%, rgba(127, 51, 77, 0.14)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    #171614;
  background-size: 40px 40px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(115deg, rgba(246, 207, 123, 0.04) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(18deg, rgba(104, 216, 204, 0.035) 0 1px, transparent 1px 30px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.32));
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 12%, rgba(246, 207, 123, 0.035) 12% 12.3%, transparent 12.3% 24%),
    linear-gradient(135deg, rgba(255, 248, 236, 0.028) 0 1px, transparent 1px 18px);
  opacity: 0.82;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

::selection {
  color: var(--paper-strong);
  background: rgba(29, 118, 111, 0.72);
}

* {
  scrollbar-color: rgba(185, 130, 61, 0.52) rgba(23, 22, 20, 0.08);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(23, 22, 20, 0.08);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(246, 207, 123, 0.72), rgba(29, 118, 111, 0.58)) border-box;
}

.sprite {
  display: none;
}

.game-root {
  position: relative;
  isolation: isolate;
}

.game-root.is-hidden,
.launcher-screen.is-hidden {
  display: none;
}

.game-root::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 50% 44%, rgba(246, 207, 123, 0.22), transparent 34%),
    radial-gradient(circle at 24% 72%, rgba(104, 216, 204, 0.16), transparent 28%);
}

.launcher-screen {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: clamp(16px, 4vw, 44px);
  color: var(--paper-strong);
  position: relative;
  overflow: hidden;
}

.launcher-frame {
  width: min(1160px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(360px, 1.15fr);
  gap: 14px;
  align-items: stretch;
  min-width: 0;
}

.launcher-overview,
.launcher-panel {
  border: 1px solid rgba(244, 234, 217, 0.2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.launcher-overview {
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  padding: clamp(18px, 3vw, 32px);
  background:
    linear-gradient(180deg, rgba(43, 37, 28, 0.88), rgba(23, 22, 20, 0.98)),
    #272119;
}

.launcher-overview::before,
.online-hero::before,
.app-topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.13), transparent 24%, transparent 72%, rgba(104, 216, 204, 0.1)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 20px);
  opacity: 0.42;
}

.launcher-overview > *,
.launcher-panel > *,
.app-topbar > * {
  position: relative;
}

.launcher-title {
  display: grid;
  gap: 18px;
}

.launcher-title h1 {
  max-width: 100%;
  font-size: clamp(3rem, 5.45vw, 4.85rem);
  line-height: 0.92;
  white-space: nowrap;
}

.launcher-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244, 234, 217, 0.2);
  border-radius: 999px;
  padding: 7px 11px;
  color: rgba(244, 234, 217, 0.82);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.launcher-badge svg,
.launcher-choice svg,
.profile-seal svg,
.launcher-action-grid svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.launcher-feature {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
  color: rgba(244, 234, 217, 0.88);
}

.launcher-feature .card-art-launcher {
  width: 116px;
  aspect-ratio: 5 / 7;
  border: 1px solid rgba(244, 234, 217, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
}

.launcher-feature .card-art-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.launcher-feature h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.launcher-feature p {
  margin: 0;
  color: rgba(244, 234, 217, 0.72);
  line-height: 1.4;
}

.launcher-pack-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.launcher-pack-strip > div {
  border: 1px solid rgba(244, 234, 217, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 248, 236, 0.08);
}

.launcher-pack-strip span,
.pack-status-card span,
.online-pack-bank span {
  display: block;
  color: rgba(244, 234, 217, 0.72);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.launcher-pack-strip strong,
.pack-status-card strong,
.online-pack-bank strong {
  display: block;
  margin-top: 2px;
  color: #f6cf7b;
  font-size: 1.85rem;
  line-height: 1;
}

.launcher-panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), rgba(255, 248, 236, 0.1)),
    var(--paper);
  color: var(--ink);
  padding: clamp(16px, 3vw, 28px);
}

.launcher-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.launcher-panel-head h2 {
  margin-top: 3px;
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  line-height: 0.95;
}

.profile-seal {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #272119;
  color: #f6cf7b;
  border: 1px solid rgba(23, 22, 20, 0.24);
  flex: 0 0 auto;
}

.profile-seal svg {
  width: 32px;
  height: 32px;
}

.launcher-form {
  display: grid;
  gap: 16px;
}

.launcher-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.launcher-field {
  display: grid;
  gap: 6px;
}

.launcher-field label,
.launcher-group-label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.launcher-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(23, 22, 20, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  padding: 9px 10px;
}

.launcher-choice-grid {
  display: grid;
  gap: 8px;
}

.launcher-choice-grid.focus-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.launcher-choice-grid.emblem-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.launcher-choice {
  min-height: 58px;
  border: 1px solid rgba(23, 22, 20, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--ink);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px;
  font-size: 0.72rem;
  font-weight: 950;
  position: relative;
  overflow: hidden;
}

.launcher-choice span {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.launcher-choice.is-selected {
  border-color: var(--clay);
  background: #fff8ec;
  box-shadow: 0 0 0 2px rgba(155, 75, 54, 0.14);
}

.launcher-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 800;
}

.launcher-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.launcher-actions .primary-button {
  width: auto;
  min-width: min(180px, 100%);
}

.account-callout,
.pack-status-card {
  border: 1px solid rgba(29, 118, 111, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.16), rgba(185, 130, 61, 0.18)),
    rgba(255, 255, 255, 0.52);
  padding: 14px;
  margin-bottom: 14px;
}

.account-callout strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.account-callout span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.account-callout-compact {
  margin-bottom: 10px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.12), rgba(246, 207, 123, 0.13)),
    rgba(255, 255, 255, 0.58);
}

.account-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.account-benefits > div {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(23, 22, 20, 0.1);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.account-benefits svg {
  width: 20px;
  height: 20px;
  color: var(--teal);
}

.account-benefits strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 950;
}

.account-benefits span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.25;
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.account-tabs button {
  min-height: 42px;
  border: 1px solid rgba(23, 22, 20, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  font-weight: 950;
}

.account-tabs button.is-active {
  background: var(--ink);
  color: var(--paper-strong);
  border-color: var(--ink);
}

.starter-pack-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pack-token {
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 5px;
  border: 1px solid rgba(185, 130, 61, 0.4);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.92), rgba(246, 207, 123, 0.24)),
    #fff8ec;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(185, 130, 61, 0.16);
  position: relative;
  overflow: hidden;
}

.pack-token::after {
  content: "";
  position: absolute;
  inset: -40% -80%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: translateX(-40%) rotate(8deg);
  opacity: 0;
  transition:
    opacity 160ms ease,
    transform 480ms ease;
}

.pack-token:hover::after {
  opacity: 0.82;
  transform: translateX(45%) rotate(8deg);
}

.pack-token svg {
  width: 25px;
  height: 25px;
  stroke: var(--brass);
}

.profile-pass {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(23, 22, 20, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68), rgba(246, 207, 123, 0.12)),
    rgba(255, 255, 255, 0.42);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.profile-pass h3 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  line-height: 0.95;
}

.profile-pass p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.profile-handle {
  margin-top: 4px !important;
  color: var(--teal) !important;
  font-size: 0.82rem;
}

.pack-status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 10px 26px rgba(23, 22, 20, 0.08);
}

.pack-status-card span {
  color: var(--muted);
}

.launcher-stat-grid,
.launcher-action-grid {
  display: grid;
  gap: 8px;
}

.launcher-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.launcher-stat {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 248, 236, 0.28)),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.launcher-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 950;
  text-transform: uppercase;
}

.launcher-stat strong {
  display: block;
  margin-top: 3px;
  font-size: 1.35rem;
  line-height: 1;
}

.launcher-action-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.launcher-action {
  min-height: 92px;
  border: 1px solid rgba(23, 22, 20, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.74), rgba(246, 207, 123, 0.14)),
    #fff8ec;
  color: var(--ink);
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: start;
  padding: 12px;
  text-align: left;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(23, 22, 20, 0.08);
  position: relative;
  overflow: hidden;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease,
    filter 150ms ease;
}

.launcher-action::before,
.launcher-choice::before,
.pack-type-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 0, rgba(246, 207, 123, 0.22), transparent 42%),
    linear-gradient(120deg, transparent 0 36%, rgba(255, 255, 255, 0.22) 48%, transparent 62%);
  opacity: 0;
  transform: translateX(-10%);
  transition:
    opacity 160ms ease,
    transform 180ms ease;
}

.launcher-action:hover,
.launcher-action:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(185, 130, 61, 0.5);
  box-shadow: 0 16px 32px rgba(23, 22, 20, 0.14);
  filter: saturate(1.05);
}

.launcher-action:hover::before,
.launcher-action:focus-visible::before,
.launcher-choice:hover::before,
.launcher-choice:focus-visible::before,
.pack-type-card:hover::before,
.pack-type-card:focus-visible::before {
  opacity: 0.82;
  transform: translateX(8%);
}

.launcher-action:active,
.icon-button:active,
.tab:active,
.round-icon:active {
  transform: translateY(1px) scale(0.99);
}

.launcher-action span {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tutorial-panel {
  display: grid;
  gap: 16px;
}

.tutorial-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.tutorial-head h2 {
  margin-top: 3px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 0.92;
}

.tutorial-shell {
  display: grid;
  grid-template-columns: minmax(118px, 0.34fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.tutorial-progress,
.tutorial-body,
.tutorial-preview,
.tutorial-callout {
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 248, 236, 0.22)),
    rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.tutorial-progress {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
}

.tutorial-meter {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 22, 20, 0.12);
}

.tutorial-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold-soft), var(--clay));
  transition: width 220ms ease;
}

.tutorial-step-tab {
  min-height: 50px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  text-align: left;
  font-weight: 950;
}

.tutorial-step-tab span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 22, 20, 0.1);
  color: var(--ink);
  font-size: 0.72rem;
}

.tutorial-step-tab strong {
  min-width: 0;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.tutorial-step-tab.is-active {
  border-color: rgba(29, 118, 111, 0.45);
  background: #fff8ec;
  color: var(--ink);
  box-shadow: 0 0 0 2px rgba(29, 118, 111, 0.12);
}

.tutorial-step-tab.is-done span {
  background: var(--teal);
  color: var(--paper-strong);
}

.tutorial-body {
  padding: clamp(12px, 2vw, 18px);
  display: grid;
  gap: 12px;
}

.tutorial-mode-chip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(29, 118, 111, 0.28);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(29, 118, 111, 0.1);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tutorial-mode-chip svg,
.tutorial-overview-demo svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tutorial-summary {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 760;
  line-height: 1.45;
}

.tutorial-preview {
  min-height: 168px;
  padding: 12px;
  display: grid;
  align-items: center;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.12), rgba(185, 130, 61, 0.14)),
    rgba(255, 255, 255, 0.48);
}

.tutorial-overview-demo,
.tutorial-online-demo,
.tutorial-choice-demo {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

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

.tutorial-overview-demo > div,
.tutorial-online-demo > div {
  min-height: 102px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: rgba(255, 248, 236, 0.66);
  box-shadow: 0 12px 24px rgba(23, 22, 20, 0.08);
}

.tutorial-overview-demo strong,
.tutorial-online-demo strong {
  font-size: 1.35rem;
  line-height: 1;
}

.tutorial-overview-demo span,
.tutorial-online-demo span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tutorial-track-grid,
.tutorial-board-demo,
.tutorial-field-demo {
  display: grid;
  gap: 8px;
}

.tutorial-track {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 46px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tutorial-track div,
.tutorial-action-bar i,
.tutorial-health-demo div {
  height: 9px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(23, 22, 20, 0.12);
}

.tutorial-track i,
.tutorial-health-demo i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold-soft));
}

.tutorial-track strong {
  color: var(--ink);
  text-align: right;
}

.tutorial-board-demo {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tutorial-slot-demo,
.tutorial-card-demo,
.tutorial-field-demo span {
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.68);
  padding: 10px;
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 3px;
  box-shadow: 0 10px 22px rgba(23, 22, 20, 0.08);
}

.tutorial-slot-demo.is-offense {
  border-color: rgba(127, 51, 77, 0.4);
  box-shadow: 0 0 0 2px rgba(127, 51, 77, 0.08), 0 10px 22px rgba(23, 22, 20, 0.08);
}

.tutorial-slot-demo span,
.tutorial-card-demo,
.tutorial-field-demo span {
  font-weight: 950;
}

.tutorial-slot-demo strong {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.tutorial-hand-demo {
  display: flex;
  gap: 8px;
}

.tutorial-card-demo {
  min-height: 72px;
  flex: 1;
  text-align: center;
}

.tutorial-action-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tutorial-action-bar strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.tutorial-action-bar i {
  flex: 1;
  position: relative;
}

.tutorial-action-bar i::before {
  content: "";
  display: block;
  width: 64%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clay), var(--gold-soft));
}

.tutorial-duel-demo {
  display: grid;
  gap: 10px;
}

.tutorial-health-demo {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 52px;
  gap: 8px;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.tutorial-health-demo.rival i {
  background: linear-gradient(90deg, var(--wine), var(--clay));
}

.tutorial-field-demo {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.tutorial-field-demo span {
  min-height: 74px;
  text-align: center;
  color: var(--muted);
  font-size: 0.68rem;
}

.tutorial-field-demo span.filled {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.92), rgba(246, 207, 123, 0.2)),
    #fff8ec;
}

.tutorial-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  line-height: 1.42;
  font-weight: 720;
}

.tutorial-callout {
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(127, 51, 77, 0.11), rgba(29, 118, 111, 0.11)),
    rgba(255, 255, 255, 0.38);
}

.tutorial-callout strong {
  display: block;
  margin-bottom: 4px;
}

.tutorial-callout p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  font-weight: 760;
}

.tutorial-controls {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.tutorial-controls > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(16px, 3vw, 34px);
  color: var(--paper-strong);
  border-bottom: 1px solid rgba(244, 234, 217, 0.18);
  position: sticky;
  top: 0;
  z-index: 18;
  background:
    linear-gradient(90deg, rgba(23, 22, 20, 0.94), rgba(39, 33, 25, 0.86), rgba(23, 22, 20, 0.94)),
    rgba(23, 22, 20, 0.86);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 38px rgba(0, 0, 0, 0.2);
}

.app-topbar::after {
  content: "";
  position: absolute;
  left: clamp(16px, 3vw, 34px);
  right: clamp(16px, 3vw, 34px);
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(246, 207, 123, 0.52), rgba(104, 216, 204, 0.28), transparent);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(244, 234, 217, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(246, 207, 123, 0.24), rgba(29, 118, 111, 0.16)),
    #2b251c;
  color: #f6cf7b;
  flex: 0 0 auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 20px rgba(246, 207, 123, 0.12);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 1px;
  background: rgba(246, 207, 123, 0.72);
  transform: translateY(17px);
}

.brand-mark svg,
.icon-button svg,
.card-type-icon,
.slot-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-type-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.eyebrow {
  margin: 0 0 3px;
  color: inherit;
  opacity: 0.68;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
  line-height: 1;
}

h2 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
}

.top-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button {
  min-height: 38px;
  border: 1px solid rgba(244, 234, 217, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.13), rgba(244, 234, 217, 0.06)),
    rgba(244, 234, 217, 0.08);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.icon-button::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 30%, rgba(255, 255, 255, 0.18) 44%, transparent 58%);
  opacity: 0;
  transform: translateX(-32%);
  transition:
    opacity 150ms ease,
    transform 180ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(244, 234, 217, 0.16);
  border-color: rgba(246, 207, 123, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.icon-button:hover::after,
.icon-button:focus-visible::after {
  opacity: 0.8;
  transform: translateX(32%);
}

.sound-toggle.is-muted {
  opacity: 0.68;
}

.sound-toggle:not(.is-muted) {
  border-color: rgba(104, 216, 204, 0.36);
  color: #dffdf7;
}

.primary-button {
  width: 100%;
  background:
    linear-gradient(135deg, #b9563e, #7f334d);
  border-color: #c77854;
  color: #fff9ef;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(155, 75, 54, 0.22);
}

.primary-button:hover {
  box-shadow: 0 14px 30px rgba(155, 75, 54, 0.3), 0 0 0 1px rgba(246, 207, 123, 0.22);
}

.slim-button {
  min-height: 34px;
  padding: 7px 10px;
}

.danger-button {
  border-color: rgba(171, 57, 49, 0.34);
  color: #7a2a24;
  background:
    linear-gradient(180deg, rgba(171, 57, 49, 0.22), rgba(82, 35, 31, 0.12)),
    rgba(171, 57, 49, 0.08);
}

.danger-button:hover {
  border-color: rgba(219, 83, 69, 0.56);
  background: rgba(171, 57, 49, 0.2);
  box-shadow: 0 12px 26px rgba(122, 42, 36, 0.2);
}

.mode-tabs {
  display: flex;
  gap: 6px;
  padding: 10px clamp(16px, 3vw, 34px) 16px;
  color: var(--paper-strong);
  position: sticky;
  top: 80px;
  z-index: 17;
  background:
    linear-gradient(180deg, rgba(23, 22, 20, 0.94), rgba(23, 22, 20, 0.68) 74%, rgba(23, 22, 20, 0.12));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(244, 234, 217, 0.08);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

.tab {
  position: relative;
  min-height: 36px;
  border: 1px solid rgba(244, 234, 217, 0.18);
  border-radius: 8px;
  padding: 7px 12px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.11), rgba(244, 234, 217, 0.05)),
    rgba(244, 234, 217, 0.08);
  color: inherit;
  font-weight: 800;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.tab::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0 18%, rgba(255, 255, 255, 0.14) 38%, transparent 60%);
  opacity: 0;
  transform: translateX(-28%);
  transition:
    opacity 160ms ease,
    transform 180ms ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: scaleX(0.2);
  transition:
    opacity 140ms ease,
    transform 160ms ease;
}

.tab:hover {
  transform: translateY(-1px);
  background: rgba(244, 234, 217, 0.14);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tab:hover::before,
.tab:focus-visible::before {
  opacity: 0.9;
  transform: translateX(26%);
}

.tab.is-active {
  background:
    radial-gradient(circle at 50% 0, rgba(246, 207, 123, 0.3), transparent 58%),
    linear-gradient(180deg, #fff8ec, #f1dfc1);
  color: var(--ink);
  border-color: var(--paper);
  box-shadow:
    0 9px 20px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(246, 207, 123, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.tab.is-active::after {
  opacity: 0.42;
  transform: scaleX(1);
}

.app-shell {
  width: min(1680px, calc(100vw - 24px));
  margin: 0 auto 28px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewFadeUp 220ms ease both;
}

.score-band,
.civilization-panel,
.command-panel,
.hand-panel,
.duel-health-card,
.duel-command-card,
.duel-board-panel,
.duel-log-panel,
.duel-hand-panel,
.campaign-overview,
.combo-journal,
.deck-summary,
.deck-builder,
.history-list-wrap,
.history-detail,
.modal-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--panel-shadow);
}

.score-band,
.civilization-panel,
.command-panel,
.hand-panel,
.duel-health-card,
.duel-command-card,
.duel-board-panel,
.duel-log-panel,
.duel-hand-panel,
.campaign-overview,
.combo-journal,
.deck-summary,
.deck-builder,
.history-list-wrap,
.history-detail,
.modal-panel,
.online-card,
.online-empty {
  box-shadow: var(--panel-shadow), var(--inner-highlight);
}

.civilization-panel,
.hand-panel,
.campaign-overview,
.combo-journal,
.history-list-wrap,
.history-detail {
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(244, 234, 217, 0.88)),
    repeating-linear-gradient(135deg, rgba(185, 130, 61, 0.055) 0 1px, transparent 1px 18px),
    var(--paper);
}

.score-band,
.civilization-panel,
.hand-panel,
.duel-health-card,
.duel-command-card,
.duel-board-panel,
.duel-log-panel,
.duel-hand-panel,
.campaign-overview,
.combo-journal,
.deck-summary,
.deck-builder,
.history-list-wrap,
.history-detail {
  position: relative;
}

.civilization-panel::after,
.hand-panel::after,
.campaign-overview::after,
.combo-journal::after,
.deck-summary::after,
.deck-builder::after,
.history-list-wrap::after,
.history-detail::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.42), transparent 26%),
    linear-gradient(315deg, rgba(29, 118, 111, 0.055), transparent 34%);
  opacity: 0.72;
}

.civilization-panel > *,
.hand-panel > *,
.campaign-overview > *,
.combo-journal > *,
.deck-summary > *,
.deck-builder > *,
.history-list-wrap > *,
.history-detail > * {
  position: relative;
  z-index: 1;
}

.score-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 14px;
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(255, 248, 236, 0.94), rgba(244, 234, 217, 0.78)),
    var(--paper);
}

.duel-status-band {
  display: grid;
  grid-template-columns: minmax(190px, 0.85fr) minmax(360px, 1.35fr) minmax(190px, 0.85fr);
  gap: 10px;
  margin-bottom: 10px;
}

.duel-health-card,
.duel-command-card,
.duel-board-panel,
.duel-log-panel,
.duel-hand-panel {
  padding: 14px;
}

.duel-health-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.74), rgba(244, 234, 217, 0.58)),
    var(--paper);
}

.duel-health-card.rival {
  background:
    linear-gradient(135deg, rgba(255, 232, 229, 0.72), rgba(244, 234, 217, 0.58)),
    var(--paper);
}

.duel-health-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-weight: 950;
  text-transform: uppercase;
}

.duel-health-head span {
  color: var(--muted);
  font-size: 0.72rem;
}

.duel-health-track,
.duel-mini-track {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 22, 20, 0.13);
}

.duel-health-track {
  height: 12px;
}

.duel-health-fill,
.duel-mini-track div {
  height: 100%;
  transition: width 160ms ease;
}

.duel-health-fill.player {
  background: var(--success);
}

.duel-health-fill.rival {
  background: var(--danger);
}

.duel-command-card {
  color: var(--paper-strong);
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.34), rgba(39, 33, 25, 0.96)),
    #272119;
  border-color: rgba(244, 234, 217, 0.18);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.duel-command-card .eyebrow {
  color: inherit;
}

.duel-quick-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}

.duel-quick-stats span {
  border: 1px solid rgba(244, 234, 217, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  color: rgba(244, 234, 217, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.duel-actions {
  display: flex;
  gap: 7px;
}

.duel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.duel-board-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.74), rgba(244, 234, 217, 0.56)),
    var(--paper);
}

.duel-board-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(23, 22, 20, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 22, 20, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.65;
}

.duel-board-panel > * {
  position: relative;
  z-index: 1;
}

.duel-board-panel.rival {
  border-color: rgba(170, 63, 54, 0.28);
  background:
    linear-gradient(90deg, rgba(255, 235, 232, 0.82), rgba(244, 234, 217, 0.58)),
    var(--paper);
}

.duel-board-panel.player {
  border-color: rgba(47, 125, 82, 0.28);
  background:
    linear-gradient(90deg, rgba(232, 255, 240, 0.76), rgba(244, 234, 217, 0.58)),
    var(--paper);
}

.duel-field {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 148px));
  justify-content: center;
  gap: 8px;
}

.duel-slot-empty {
  min-height: 188px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(23, 22, 20, 0.22);
  border-radius: 8px;
  color: rgba(23, 22, 20, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(255, 248, 236, 0.14));
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.duel-slot-empty span {
  display: inline-flex;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.42);
}

.duel-hero-card,
.duel-card {
  --rarity-border: rgba(23, 22, 20, 0.2);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  color: #fff8eb;
  box-shadow: var(--card-shadow), var(--rarity-glow);
  overflow: hidden;
  position: relative;
  will-change: transform, filter;
}

.duel-hero-card::after,
.duel-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(246, 207, 123, 0.28), transparent 32%),
    linear-gradient(120deg, transparent 0 30%, rgba(255, 255, 255, 0.16) 48%, transparent 64%);
}

.duel-hero-card {
  display: flex;
  flex-direction: column;
  min-height: 188px;
}

.duel-hero-card.is-exhausted {
  filter: saturate(0.7);
  opacity: 0.76;
}

.duel-hero-card .card-art-duel,
.duel-card .card-art-duel {
  width: 100%;
  aspect-ratio: 5 / 4;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.22);
}

.duel-hero-card .card-art-duel img,
.duel-card .card-art-duel img {
  object-fit: contain;
}

.duel-hero-main,
.duel-card-copy {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.duel-hero-main h3,
.duel-card-copy h3 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.05;
}

.duel-hp-line {
  display: grid;
  gap: 4px;
  color: rgba(255, 248, 235, 0.86);
  font-size: 0.68rem;
  font-weight: 950;
}

.duel-mini-track {
  height: 6px;
  background: rgba(0, 0, 0, 0.22);
}

.duel-mini-track div {
  background: #66d69a;
}

.duel-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

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

.duel-stat-row span {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  padding: 4px;
  text-align: center;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.58rem;
  font-weight: 950;
}

.duel-stat-row strong {
  display: block;
  font-size: 0.92rem;
}

.duel-special-text,
.duel-card-copy p {
  margin: 0;
  color: rgba(255, 248, 235, 0.86);
  font-size: 0.64rem;
  line-height: 1.24;
  max-height: 3.1em;
  overflow: hidden;
}

.duel-hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.duel-hero-actions .icon-button {
  min-width: 0;
  padding-inline: 6px;
}

.duel-log-panel {
  color: var(--paper-strong);
  background:
    linear-gradient(135deg, rgba(39, 33, 25, 0.98), rgba(29, 118, 111, 0.74)),
    #272119;
  border-color: rgba(244, 234, 217, 0.18);
  display: grid;
  grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.duel-log-panel .section-title {
  margin-bottom: 0;
}

.duel-log {
  max-height: 108px;
  overflow: auto;
  border-top: 0;
  padding-top: 0;
  font-size: 0.74rem;
  line-height: 1.35;
}

.duel-hand-panel {
  margin-top: 12px;
}

.duel-hand {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.duel-card {
  flex: 0 0 166px;
  min-height: 252px;
  padding: 0;
  text-align: left;
  scroll-snap-align: start;
}

.duel-card:disabled {
  opacity: 0.52;
  filter: grayscale(0.35);
}

.duel-hero-card.duel-fx-summon {
  animation: duelSummon 560ms cubic-bezier(0.18, 0.9, 0.25, 1.15) both;
}

.duel-hero-card.duel-fx-attack {
  animation: duelStrike 420ms ease both;
}

.duel-hero-card.duel-fx-hit {
  animation: duelHit 360ms ease both;
}

.duel-hero-card.duel-fx-clash {
  animation: duelClash 460ms ease both;
}

.duel-hero-card.duel-fx-special {
  animation: duelSpecialPulse 660ms ease both;
}

.duel-hero-card.duel-fx-buff {
  animation: duelBuff 520ms ease both;
}

.campaign-overview {
  padding: 14px;
  margin-bottom: 12px;
}

.campaign-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 12px;
}

.progress-stats,
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.progress-card,
.campaign-card,
.combo-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(23, 22, 20, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

.progress-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.66), rgba(246, 207, 123, 0.12)),
    rgba(255, 255, 255, 0.36);
}

.progress-card::after {
  content: "";
  position: absolute;
  inset: auto 10px 8px 10px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--gold-soft), var(--wine));
  opacity: 0.48;
}

.progress-card > span,
.campaign-card > div > span,
.combo-item > span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.progress-card strong {
  font-size: 1.9rem;
}

.campaign-card {
  position: relative;
  min-height: 205px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.campaign-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(29, 118, 111, 0.08), transparent 38%),
    linear-gradient(300deg, rgba(246, 207, 123, 0.14), transparent 42%);
  opacity: 0.86;
}

.campaign-card > * {
  position: relative;
}

.campaign-card:hover,
.campaign-card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(185, 130, 61, 0.5);
  box-shadow:
    var(--lift-shadow),
    0 0 0 1px rgba(246, 207, 123, 0.14);
  filter: saturate(1.04);
}

.campaign-card p,
.combo-item p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  line-height: 1.38;
}

.campaign-reward {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 10px;
  border: 1px solid rgba(29, 118, 111, 0.18);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.48);
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.combo-journal {
  padding: 14px;
}

.combo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 74vh;
  overflow: auto;
}

.combo-item.is-locked {
  opacity: 0.58;
}

.recipe-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(95px, 1fr));
  gap: 8px;
}

.score-meter {
  min-width: 0;
}

.score-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.74rem;
  font-weight: 900;
  color: var(--ink-soft);
}

.meter-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(23, 22, 20, 0.16), rgba(23, 22, 20, 0.08));
  box-shadow: inset 0 1px 2px rgba(23, 22, 20, 0.18);
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  box-shadow: 0 0 14px rgba(29, 118, 111, 0.34);
  transition: width 220ms ease;
}

.meter-fill.military {
  background: var(--clay);
}

.meter-fill.knowledge {
  background: var(--blue);
}

.meter-fill.wealth {
  background: var(--brass);
}

.meter-fill.prestige {
  background: var(--wine);
}

.meter-fill.faith {
  background: var(--violet);
}

.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.civilization-panel,
.command-panel,
.hand-panel,
.deck-summary,
.deck-builder,
.history-list-wrap,
.history-detail {
  padding: 14px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.compact-title {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(23, 22, 20, 0.08);
}

.section-title h2 {
  text-wrap: balance;
}

.target-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  white-space: nowrap;
  border: 1px solid rgba(23, 22, 20, 0.14);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.42);
  font-size: 0.76rem;
  font-weight: 900;
}

.discard-piles {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}

.discard-pile-box {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 248, 236, 0.2)),
    rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.discard-pile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.discard-pile-head span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.discard-pile-head strong {
  min-width: 26px;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--paper-strong);
  background: rgba(23, 22, 20, 0.78);
  font-size: 0.72rem;
  text-align: center;
}

.discard-pile-stack {
  display: grid;
  gap: 5px;
  max-height: 190px;
  overflow: auto;
  padding-right: 2px;
}

.discard-card-chip {
  --rarity-border: rgba(23, 22, 20, 0.16);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 48px;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  padding: 5px;
  color: var(--ink);
  text-align: left;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.64), rgba(255, 248, 236, 0.28)),
    rgba(255, 255, 255, 0.44);
  box-shadow: var(--rarity-glow);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.discard-card-chip:hover,
.discard-card-chip:focus-visible {
  transform: translateX(2px);
  box-shadow: var(--rarity-glow-strong, var(--rarity-glow)), 0 8px 18px rgba(23, 22, 20, 0.1);
}

.discard-card-chip .card-art-mini {
  width: 38px;
  min-height: 46px;
}

.discard-card-chip strong,
.discard-card-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discard-card-chip strong {
  font-size: 0.76rem;
  line-height: 1.1;
}

.discard-card-chip small,
.discard-empty {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.discard-card-chip.is-top-card {
  border-style: solid;
}

.battle-fx-layer {
  pointer-events: none;
  position: sticky;
  top: 8px;
  z-index: 35;
  height: 0;
}

.battle-fx-scene {
  position: absolute;
  left: 50%;
  top: 8px;
  display: grid;
  grid-template-columns: 112px 48px 112px;
  align-items: center;
  justify-content: center;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid rgba(23, 22, 20, 0.16);
  border-radius: 8px;
  padding: 10px;
  background:
    radial-gradient(circle at 50% 46%, rgba(233, 93, 62, 0.28), transparent 38%),
    linear-gradient(135deg, rgba(23, 22, 20, 0.92), rgba(69, 45, 31, 0.84));
  box-shadow:
    0 22px 54px rgba(23, 22, 20, 0.28),
    0 0 34px rgba(185, 130, 61, 0.24);
  animation: battleSceneIn 1080ms ease both;
}

.battle-fx-card {
  position: relative;
}

.battle-fx-card .game-card {
  min-height: 168px;
  color: var(--paper-strong);
}

.battle-fx-card .card-body,
.battle-fx-card .stats-row {
  display: none;
}

.battle-fx-attacker {
  animation: battleAttackerLunge 780ms cubic-bezier(0.14, 0.78, 0.2, 1) both;
}

.battle-fx-target {
  animation: battleTargetBrace 780ms cubic-bezier(0.14, 0.78, 0.2, 1) both;
}

.battle-fx-card.is-loser {
  animation: battleLoserKnockout 980ms cubic-bezier(0.18, 0.88, 0.22, 1) both;
  animation-delay: 260ms;
}

.battle-fx-card.is-winner {
  filter: drop-shadow(0 0 16px rgba(246, 207, 123, 0.36));
}

.battle-fx-burst {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 999px;
  color: #fff8eb;
  background: rgba(233, 93, 62, 0.82);
  box-shadow: 0 0 28px rgba(233, 93, 62, 0.42);
  animation: battleBurst 760ms ease both;
}

.battle-fx-burst svg {
  width: 24px;
  height: 24px;
}

.battle-fx-discard {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: rgba(255, 248, 235, 0.74);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 112px));
  justify-content: center;
  align-items: start;
  gap: 8px;
}

.board-slot {
  border: 1px dashed rgba(23, 22, 20, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.44), rgba(255, 248, 236, 0.16)),
    rgba(255, 255, 255, 0.3);
  padding: 7px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.board-slot:hover {
  transform: translateY(-1px);
  border-color: rgba(185, 130, 61, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 10px 20px rgba(23, 22, 20, 0.08);
}

.board-slot > .game-card,
.resource-stack-inner > .game-card,
.board-slot > .slot-empty,
.resource-stack-inner > .slot-empty {
  width: 100%;
  aspect-ratio: 5 / 7;
}

.slot-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.slot-icon {
  width: 15px;
  height: 15px;
}

.slot-empty {
  display: grid;
  aspect-ratio: 5 / 7;
  min-height: 0;
  place-items: center;
  color: rgba(23, 22, 20, 0.45);
  font-size: 0.74rem;
  font-weight: 800;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), rgba(244, 234, 217, 0.14)),
    rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.mini-card {
  --rarity-border: rgba(23, 22, 20, 0.18);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  width: 100%;
  min-height: 92px;
  margin-top: 7px;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  padding: 7px;
  color: #fff8eb;
  text-align: left;
  box-shadow: var(--rarity-glow);
}

.mini-art-wrap {
  display: block;
  margin-bottom: 6px;
}

.mini-card span {
  display: block;
}

.mini-card .mini-name {
  font-weight: 900;
  line-height: 1.12;
}

.mini-card .mini-type {
  margin-top: 5px;
  font-size: 0.68rem;
  opacity: 0.8;
  text-transform: uppercase;
  font-weight: 900;
}

.resource-stack {
  grid-column: 1 / -1;
}

.resource-stack-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 112px));
  justify-content: center;
  gap: 6px;
}

.command-panel {
  color: var(--paper-strong);
  background:
    radial-gradient(circle at 18% 0, rgba(246, 207, 123, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(42, 39, 33, 0.98), rgba(23, 22, 20, 0.98)),
    #272119;
  border-color: rgba(244, 234, 217, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.turn-number {
  font-size: 3.5rem;
  line-height: 0.95;
  font-weight: 950;
}

.command-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.command-stats div {
  border: 1px solid rgba(244, 234, 217, 0.16);
  border-radius: 8px;
  padding: 8px;
}

.command-stats span {
  display: block;
  color: rgba(244, 234, 217, 0.68);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.command-stats strong {
  font-size: 1.45rem;
}

.log-panel {
  min-height: 220px;
  max-height: 340px;
  overflow: auto;
  border-top: 1px solid rgba(244, 234, 217, 0.18);
  padding-top: 10px;
  font-size: 0.82rem;
  line-height: 1.35;
}

.log-line {
  padding: 8px 0;
  border-bottom: 1px solid rgba(244, 234, 217, 0.11);
}

.log-line.is-latest {
  margin-inline: -4px;
  padding-inline: 4px;
  border-radius: 6px;
  color: #fff8ec;
}

.hand-panel {
  margin-top: 12px;
  border-color: rgba(185, 130, 61, 0.28);
}

.hand-grid,
.card-gallery,
.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(174px, 1fr));
  gap: 10px;
}

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

.game-card {
  --rarity-border: rgba(23, 22, 20, 0.2);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  --rarity-glow-strong: var(--rarity-glow);
  aspect-ratio: 5 / 7;
  min-height: 245px;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  padding: 9px;
  text-align: left;
  color: #fff8eb;
  background: var(--ink-soft);
  box-shadow: var(--card-shadow), var(--rarity-glow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  overflow: hidden;
  will-change: transform, filter;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    filter 180ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px) rotate(-0.35deg);
  box-shadow:
    var(--card-shadow),
    var(--rarity-glow-strong),
    0 18px 34px rgba(23, 22, 20, 0.2);
  filter: saturate(1.08) brightness(1.04);
}

.hand-grid .game-card:hover,
.hand-grid .game-card:focus-visible,
.duel-hand .duel-card:hover,
.duel-hand .duel-card:focus-visible {
  transform: translateY(-8px) rotate(-0.65deg) scale(1.018);
}

.game-card.has-card-image {
  min-height: 0;
  padding: 0;
  background: #11100e;
}

.game-card.has-card-image::before {
  display: none;
}

.game-card.has-card-image > :not(.card-art) {
  display: none;
}

.game-card.has-card-image .card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: inherit;
  background: #11100e;
}

.game-card.has-card-image .card-art img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  transition:
    transform 240ms ease,
    filter 240ms ease;
}

.game-card.has-card-image:hover .card-art img,
.game-card.has-card-image:focus-visible .card-art img {
  transform: scale(1.018);
  filter: saturate(1.06) contrast(1.04);
}

.card-mode-board {
  min-height: 0;
  width: 100%;
  height: auto;
}

.card-mode-board:not(.has-card-image) {
  padding: 7px;
  gap: 5px;
}

.card-mode-board:not(.has-card-image) .card-body {
  display: none;
}

.card-mode-board:not(.has-card-image) .card-name {
  font-size: 0.84rem;
}

.card-mode-board:not(.has-card-image) .rarity-chip,
.card-mode-board:not(.has-card-image) .card-footer {
  font-size: 0.55rem;
}

.card-mode-board:not(.has-card-image) .card-art {
  min-height: 44px;
}

.card-mode-board:not(.has-card-image) .stat-pill span {
  display: none;
}

.card-mode-board:not(.has-card-image) .stat-pill {
  padding: 2px;
}

.game-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 38%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 9px);
  opacity: 0.55;
  pointer-events: none;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: -45% -60%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.34), transparent 62%);
  transform: translateX(-38%) rotate(8deg);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 520ms ease;
}

.game-card:hover::after,
.game-card:focus-visible::after {
  opacity: 0.72;
  transform: translateX(38%) rotate(8deg);
}

.game-card > * {
  position: relative;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.rarity-chip {
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 0.64rem;
  font-weight: 950;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.18);
}

.card-name {
  margin: 2px 0 0;
  font-size: 1.07rem;
  line-height: 1.05;
  font-weight: 950;
}

.card-art {
  display: grid;
  min-height: 68px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
  overflow: hidden;
  position: relative;
}

.card-art::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(115deg, transparent 0 28%, rgba(255, 248, 236, 0.2) 42%, transparent 58% 100%),
    radial-gradient(circle at 50% 42%, rgba(246, 207, 123, 0.18), transparent 58%);
  transform: translateX(-120%);
}

.card-art.is-loading::before {
  opacity: 1;
  animation: cardArtLoadingSheen 1.1s ease-in-out infinite;
}

.card-art img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 240ms ease,
    filter 240ms ease;
}

.card-art.has-image img {
  opacity: 1;
}

.card-art.has-image::before,
.card-art.no-image::before {
  display: none;
}

.card-art-back {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 244, 184, 0.18), transparent 38%),
    #11100e;
}

.card-art-back img {
  object-fit: contain;
}

.card-art svg {
  width: 46px;
  height: 46px;
  stroke: currentColor;
  stroke-width: 1.45;
  fill: none;
}

.card-art-fallback {
  display: grid;
  place-items: center;
  position: relative;
  z-index: 2;
}

.card-art.has-image .card-art-fallback {
  display: none;
}

.card-art.no-image img {
  display: none;
}

.card-art-mini {
  min-height: 34px;
  height: 34px;
}

.card-art-mini svg {
  width: 24px;
  height: 24px;
}

.card-art-detail {
  width: min(260px, 100%);
  aspect-ratio: 5 / 7;
  min-height: 0;
  align-self: stretch;
  background: rgba(0, 0, 0, 0.2);
}

.card-art-detail img {
  object-fit: contain;
}

.card-art-detail svg {
  width: 82px;
  height: 82px;
}

.card-body {
  min-height: 58px;
  font-size: 0.78rem;
  line-height: 1.28;
  color: rgba(255, 248, 235, 0.88);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.stat-pill {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 7px;
  padding: 4px 2px;
  text-align: center;
  background: rgba(0, 0, 0, 0.16);
}

.stat-pill span {
  display: block;
  font-size: 0.55rem;
  font-weight: 950;
  text-transform: uppercase;
  opacity: 0.68;
}

.stat-pill strong {
  display: block;
  font-size: 0.86rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-count {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(0, 0, 0, 0.2);
}

.type-leader,
.type-religiousFigure {
  background-color: var(--wine);
}

.type-civilization,
.type-city {
  background-color: var(--teal);
}

.type-army,
.type-event {
  background-color: var(--clay);
}

.type-building,
.type-resource {
  background-color: var(--olive);
}

.type-manuscript,
.type-invention {
  background-color: var(--blue);
}

.type-religion,
.type-wonder,
.type-world {
  background-color: var(--violet);
}

.type-myth {
  background-color: #6f5327;
}

.rarity-Common {
  --rarity-border: rgba(255, 255, 255, 0.34);
}

.rarity-Uncommon {
  --rarity-border: #74b9ff;
  --rarity-glow: 0 0 12px rgba(116, 185, 255, 0.38);
  --rarity-glow-strong: 0 0 14px rgba(116, 185, 255, 0.52), 0 0 28px rgba(116, 185, 255, 0.28);
}

.rarity-Rare {
  --rarity-border: #b67cff;
  --rarity-glow: 0 0 13px rgba(182, 124, 255, 0.42);
  --rarity-glow-strong: 0 0 16px rgba(182, 124, 255, 0.58), 0 0 32px rgba(118, 77, 255, 0.28);
}

.rarity-Epic {
  --rarity-border: #ff6767;
  --rarity-glow: 0 0 14px rgba(255, 80, 80, 0.45);
  --rarity-glow-strong: 0 0 18px rgba(255, 88, 88, 0.62), 0 0 36px rgba(178, 36, 45, 0.34);
}

.rarity-Legendary {
  --rarity-border: #ffd56a;
  --rarity-glow: 0 0 14px rgba(255, 207, 92, 0.5);
  --rarity-glow-strong: 0 0 18px rgba(255, 215, 106, 0.72), 0 0 38px rgba(255, 161, 54, 0.36);
}

.rarity-Mythic {
  --rarity-border: #f5dcff;
  --rarity-glow:
    0 0 10px rgba(88, 210, 255, 0.5),
    0 0 18px rgba(201, 107, 255, 0.44),
    0 0 30px rgba(255, 222, 92, 0.34),
    0 0 44px rgba(96, 255, 178, 0.24);
  --rarity-glow-strong:
    0 0 12px rgba(88, 210, 255, 0.7),
    0 0 24px rgba(201, 107, 255, 0.58),
    0 0 42px rgba(255, 222, 92, 0.44),
    0 0 62px rgba(96, 255, 178, 0.32);
}

.rarity-Special {
  --rarity-border: #fff4b8;
  --rarity-glow:
    0 0 12px rgba(255, 244, 184, 0.64),
    0 0 28px rgba(103, 255, 214, 0.4),
    0 0 42px rgba(255, 95, 137, 0.34);
  --rarity-glow-strong:
    0 0 18px rgba(255, 244, 184, 0.82),
    0 0 38px rgba(103, 255, 214, 0.52),
    0 0 58px rgba(255, 95, 137, 0.44);
}

.disabled-card {
  opacity: 0.5;
  filter: grayscale(0.45);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  --rarity-glow-strong: 0 0 0 rgba(0, 0, 0, 0);
}

.search-input,
.select-input {
  min-height: 36px;
  border: 1px solid rgba(23, 22, 20, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease;
}

.search-input:hover,
.select-input:hover,
.search-input:focus,
.select-input:focus {
  border-color: rgba(29, 118, 111, 0.42);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(29, 118, 111, 0.08);
}

.search-input {
  width: min(260px, 52vw);
}

.online-empty,
.online-hero,
.online-card {
  border: 1px solid rgba(244, 234, 217, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.62), rgba(255, 248, 236, 0.2)),
    rgba(255, 248, 236, 0.96);
  box-shadow: 0 10px 26px rgba(23, 22, 20, 0.12);
  position: relative;
  overflow: hidden;
}

.online-card::after,
.online-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.32), transparent 24%, transparent 72%, rgba(29, 118, 111, 0.08));
  opacity: 0.32;
}

.online-card > *,
.online-empty > * {
  position: relative;
  z-index: 1;
}

.online-empty {
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 4vw, 34px);
}

.online-empty h2,
.online-hero h2 {
  margin: 4px 0 8px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.online-empty p,
.online-hero p {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

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

.online-section-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(23, 22, 20, 0.1);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
  overflow-x: auto;
}

.online-section-tab {
  flex: 1 0 132px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 950;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.online-section-tab:hover,
.online-section-tab:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.22);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
}

.online-section-tab.is-selected {
  color: #fff8eb;
  border-color: rgba(23, 22, 20, 0.72);
  background: var(--ink);
  box-shadow: 0 8px 18px rgba(23, 22, 20, 0.16);
}

.online-panel-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.online-panel-layout > .wide {
  grid-column: 1 / -1;
}

.online-panel-forum,
.online-panel-trading,
.online-panel-collection {
  grid-template-columns: 1fr;
}

.online-hero {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  color: var(--paper-strong);
  background:
    linear-gradient(135deg, rgba(23, 22, 20, 0.96), rgba(29, 118, 111, 0.78)),
    #171614;
}

.online-hero p {
  color: rgba(255, 248, 236, 0.72);
}

.online-pack-bank {
  min-width: 190px;
  border: 1px solid rgba(244, 234, 217, 0.22);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.16), rgba(255, 248, 236, 0.06)),
    rgba(255, 248, 236, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 30px rgba(0, 0, 0, 0.16);
}

.online-pack-bank strong {
  margin-bottom: 10px;
  font-size: 3rem;
}

.online-pack-bank small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 248, 236, 0.72);
  font-weight: 850;
}

.online-card {
  padding: 14px;
  color: var(--ink);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
}

.online-card:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.22);
  box-shadow:
    0 16px 34px rgba(23, 22, 20, 0.14),
    var(--inner-highlight),
    0 0 0 1px rgba(29, 118, 111, 0.1);
}

.online-card.wide {
  grid-column: 1 / -1;
}

.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(23, 22, 20, 0.14);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 236, 0.34)),
    rgba(255, 255, 255, 0.58);
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.mode-chip:hover,
.mode-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.48);
}

.mode-chip.is-selected {
  border-color: rgba(29, 118, 111, 0.68);
  box-shadow: 0 0 0 2px rgba(29, 118, 111, 0.14);
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.2), rgba(246, 207, 123, 0.22)),
    rgba(255, 255, 255, 0.72);
}

.mode-chip.is-selected::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 10px rgba(29, 118, 111, 0.5);
}

.online-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.online-search .search-input {
  width: 100%;
}

.online-list,
.match-room-list {
  display: grid;
  gap: 8px;
}

.online-deck-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.online-deck-stats > div {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 248, 236, 0.26)),
    rgba(255, 255, 255, 0.38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
  transition:
    transform 140ms ease,
    border-color 140ms ease;
}

.online-deck-stats > div:hover {
  transform: translateY(-1px);
  border-color: rgba(185, 130, 61, 0.28);
}

.online-deck-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.online-deck-stats strong {
  display: block;
  margin-top: 2px;
  font-size: 1.35rem;
}

.online-deck-builder {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(280px, 1.08fr);
  gap: 12px;
}

.online-deck-builder h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.online-deck-list,
.online-pick-list {
  display: grid;
  gap: 6px;
  max-height: 380px;
  overflow: auto;
  padding-right: 3px;
}

.online-deck-row,
.online-pick-row {
  --rarity-border: rgba(23, 22, 20, 0.15);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  padding: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.58), rgba(255, 248, 236, 0.28)),
    rgba(255, 255, 255, 0.42);
  box-shadow: var(--rarity-glow);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.online-deck-row:hover,
.online-pick-row:hover {
  transform: translateX(2px);
  box-shadow: var(--rarity-glow-strong, var(--rarity-glow)), 0 8px 20px rgba(23, 22, 20, 0.08);
}

.online-deck-row strong,
.online-pick-row strong {
  display: block;
  line-height: 1.1;
}

.online-deck-row span,
.online-pick-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.online-row,
.match-room {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(23, 22, 20, 0.1);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 248, 236, 0.22)),
    rgba(255, 255, 255, 0.42);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.online-row:hover,
.match-room:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.28);
  box-shadow: 0 10px 24px rgba(23, 22, 20, 0.1);
}

.online-profile-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mini-seal {
  width: 42px;
  height: 42px;
}

.mini-seal svg {
  width: 22px;
  height: 22px;
}

.online-profile-line strong,
.match-room h3 {
  display: block;
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.1;
}

.online-profile-line span,
.match-room span,
.match-room p,
.online-subtle {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.friend-row .row-actions,
.match-room .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.online-active-match-card {
  border-color: rgba(29, 118, 111, 0.24);
  background:
    radial-gradient(circle at 18% 8%, rgba(29, 118, 111, 0.16), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(185, 130, 61, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 236, 0.34)),
    rgba(255, 255, 255, 0.52);
}

.online-match-title {
  align-items: start;
}

.online-match-title h2 span {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.online-auto-sync-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(29, 118, 111, 0.24);
  border-radius: 8px;
  background: rgba(29, 118, 111, 0.1);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  white-space: nowrap;
}

.online-auto-sync-pill svg {
  width: 15px;
  height: 15px;
  animation: soft-spin 2.8s linear infinite;
}

.online-match-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  grid-template-areas:
    "rival log"
    "player log"
    "hand log";
  gap: 12px;
}

.online-table-side,
.online-duel-side,
.online-hand-panel,
.online-match-log,
.online-table-waiting {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.online-table-side:nth-of-type(1),
.online-duel-side:nth-of-type(1) {
  grid-area: rival;
}

.online-table-side:nth-of-type(2),
.online-duel-side:nth-of-type(2) {
  grid-area: player;
}

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

.online-match-log {
  grid-area: log;
  max-height: 720px;
  overflow: auto;
}

.online-match-log h3 {
  margin: 0 0 8px;
}

.online-match-log p {
  margin: 0 0 8px;
  border-bottom: 1px solid rgba(23, 22, 20, 0.08);
  padding-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.35;
}

.online-table-side.is-current-turn,
.online-duel-side.is-current-turn {
  border-color: rgba(29, 118, 111, 0.45);
  box-shadow:
    0 0 0 1px rgba(29, 118, 111, 0.12),
    0 18px 42px rgba(29, 118, 111, 0.14);
}

.online-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.online-side-head h3 {
  margin: 0;
  font-size: 1rem;
}

.online-score-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.online-score-meter {
  min-width: 0;
  border: 1px solid rgba(23, 22, 20, 0.08);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.52);
}

.online-score-meter span,
.online-score-meter strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-score-meter span {
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 950;
  text-transform: uppercase;
}

.online-score-meter strong {
  margin-top: 2px;
  font-size: 0.72rem;
}

.online-score-meter i {
  display: block;
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 22, 20, 0.09);
}

.online-score-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.online-score-meter b.military { background: #9f312d; }
.online-score-meter b.knowledge { background: #2f6fa3; }
.online-score-meter b.wealth { background: #b9823d; }
.online-score-meter b.prestige { background: #7755a8; }
.online-score-meter b.faith { background: #4d8b6f; }

.online-board-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 8px;
}

.online-board-slot {
  min-width: 0;
  border: 1px solid rgba(23, 22, 20, 0.08);
  border-radius: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.34);
}

.online-board-slot .game-card {
  min-height: 0;
  height: 174px;
  font-size: 0.72rem;
}

.online-board-slot .game-card .card-body,
.online-board-slot .game-card .stats-row {
  display: none;
}

.online-board-slot .card-art-normal {
  min-height: 98px;
}

.online-board-slot .slot-empty {
  min-height: 174px;
}

.online-resource-slot {
  grid-column: span 2;
}

.online-campaign-board {
  grid-template-columns: repeat(auto-fit, minmax(82px, 104px));
  justify-content: center;
  gap: 7px;
}

.online-campaign-board .board-slot {
  padding: 6px;
  gap: 6px;
}

.online-campaign-board .slot-label {
  font-size: 0.58rem;
}

.online-campaign-board .game-card,
.online-campaign-board .slot-empty {
  min-height: 0;
}

.online-hand-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
}

.online-hand-card {
  flex: 0 0 188px;
  display: grid;
  gap: 7px;
  scroll-snap-align: start;
}

.online-hand-card .game-card {
  min-height: 292px;
}

.online-table-waiting {
  text-align: center;
}

.online-table-waiting h3 {
  margin: 0 0 6px;
}

.online-table-waiting p {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
  font-weight: 780;
}

.online-duel-table {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.online-duel-field {
  display: grid;
  grid-template-columns: repeat(3, minmax(132px, 1fr));
  gap: 8px;
}

.online-duel-hero {
  min-height: 235px;
}

.online-duel-hand {
  overflow-x: auto;
  padding-bottom: 8px;
}

.online-duel-hand .duel-card {
  flex: 0 0 190px;
}

.win-badge {
  display: inline-flex !important;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: #3f2a09 !important;
  background: #f6cf7b;
  font-size: 0.72rem !important;
  text-transform: uppercase;
}

.serial-pack-section {
  background:
    linear-gradient(135deg, rgba(23, 22, 20, 0.92), rgba(69, 45, 31, 0.84) 42%, rgba(29, 118, 111, 0.78)),
    #171614;
  color: var(--paper-strong);
}

.serial-pack-section .section-title h2,
.serial-pack-section .section-title p,
.serial-pack-section .eyebrow {
  color: var(--paper-strong);
}

.serial-pack-section .empty-state {
  color: rgba(255, 248, 236, 0.74);
  border-color: rgba(244, 234, 217, 0.24);
}

.pack-type-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.pack-type-card {
  --rarity-border: rgba(244, 234, 217, 0.18);
  --rarity-glow: 0 0 0 transparent;
  min-height: 116px;
  display: grid;
  gap: 4px;
  align-content: start;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  padding: 10px;
  color: var(--paper-strong);
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.16), rgba(255, 248, 236, 0.06)),
    rgba(23, 22, 20, 0.28);
  box-shadow: var(--rarity-glow);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.pack-type-card.is-selected {
  border-color: rgba(255, 248, 236, 0.78);
  outline: 2px solid rgba(255, 248, 236, 0.18);
  box-shadow:
    var(--rarity-glow-strong, var(--rarity-glow)),
    0 18px 38px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pack-type-card span,
.pack-type-card small {
  color: rgba(255, 248, 236, 0.7);
  font-size: 0.67rem;
  font-weight: 950;
  text-transform: uppercase;
}

.pack-type-card strong {
  font-size: 2rem;
  line-height: 0.95;
}

.pack-type-card small {
  min-height: 32px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: none;
}

.serial-vault {
  display: grid;
  grid-template-columns: minmax(160px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.serial-vault-count,
.serial-supply,
.serial-last-pack,
.trade-friends,
.trade-card-column,
.trade-row,
.serial-summary > div {
  border: 1px solid rgba(244, 234, 217, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 248, 236, 0.14), rgba(255, 248, 236, 0.05)),
    rgba(23, 22, 20, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.serial-vault-count {
  min-height: 132px;
  display: grid;
  align-content: center;
  padding: 16px;
}

.serial-vault-count span,
.serial-vault-count small,
.serial-supply span,
.serial-supply small,
.serial-last-pack h3,
.trade-column-head span,
.trade-row-head span,
.trade-sides span,
.serial-summary span {
  color: rgba(255, 248, 236, 0.72);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.serial-vault-count strong {
  display: block;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: 0.9;
}

.serial-supply-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.serial-supply {
  --rarity-border: rgba(244, 234, 217, 0.18);
  --rarity-glow: 0 0 0 transparent;
  border-color: var(--rarity-border);
  display: grid;
  gap: 3px;
  min-height: 86px;
  padding: 10px;
  box-shadow: var(--rarity-glow);
}

.serial-supply strong {
  color: var(--paper-strong);
  font-size: 1.35rem;
  line-height: 1;
}

.serial-last-pack {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
  padding: 12px;
}

.serial-last-pack h3,
.trade-friends h3,
.trade-card-column h3,
.trade-ledger h3 {
  margin: 0;
  font-size: 1rem;
}

.serial-mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
}

.serial-mini,
.serial-card-button {
  --rarity-border: rgba(23, 22, 20, 0.16);
  --rarity-glow: 0 0 0 transparent;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 236, 0.34)),
    rgba(255, 255, 255, 0.52);
  box-shadow: var(--rarity-glow);
}

.serial-mini {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 58px;
  padding: 7px;
  color: var(--ink);
}

.serial-mini .card-art,
.serial-card-art .card-art {
  min-height: 42px;
  height: 42px;
  border-radius: 6px;
}

.serial-mini strong,
.serial-card-button strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.serial-mini span,
.serial-card-button small,
.trade-empty {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
}

.serial-inventory-panel {
  min-height: 100%;
}

.serial-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.serial-summary > div {
  border-color: rgba(23, 22, 20, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 248, 236, 0.26)),
    rgba(255, 255, 255, 0.42);
  padding: 10px;
}

.serial-summary span {
  color: var(--muted);
}

.serial-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1.45rem;
}

.inventory-grid {
  max-height: 438px;
  overflow: auto;
  padding-right: 3px;
}

.online-error {
  margin: 10px 0 0;
  color: #ffd3d3;
  font-weight: 850;
}

.trading-panel {
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(238, 244, 235, 0.92)),
    var(--paper);
}

.trade-builder {
  display: grid;
  grid-template-columns: minmax(170px, 0.72fr) minmax(260px, 1fr) minmax(260px, 1fr);
  gap: 10px;
}

.trade-friends,
.trade-card-column {
  border-color: rgba(23, 22, 20, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 248, 236, 0.24)),
    rgba(255, 255, 255, 0.46);
  padding: 10px;
}

.trade-friend-list,
.serial-select-grid,
.trade-ledger {
  display: grid;
  gap: 7px;
}

.trade-friend-list,
.serial-select-grid {
  max-height: 330px;
  overflow: auto;
  padding-right: 3px;
}

.trade-friend,
.serial-card-button {
  width: 100%;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.trade-friend {
  border: 1px solid rgba(23, 22, 20, 0.12);
  padding: 9px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(236, 246, 242, 0.34)),
    rgba(255, 255, 255, 0.5);
}

.trade-friend:hover,
.serial-card-button:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.36);
}

.trade-friend.is-selected,
.serial-card-button.is-selected {
  border-color: rgba(29, 118, 111, 0.72);
  box-shadow: 0 0 0 2px rgba(29, 118, 111, 0.16), var(--rarity-glow);
}

.trade-friend strong,
.trade-friend span {
  display: block;
}

.trade-friend span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.trade-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.trade-column-head span,
.trade-row-head span,
.trade-sides span {
  color: var(--muted);
}

.serial-card-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
  min-height: 58px;
  padding: 7px;
}

.serial-card-button.is-disabled {
  opacity: 0.52;
}

.serial-card-inspect {
  min-width: 0;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.serial-card-action {
  position: relative;
  width: 42px;
  min-height: 42px;
  align-self: center;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 248, 236, 0.28)),
    rgba(255, 255, 255, 0.5);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.serial-card-action svg {
  width: 17px;
  height: 17px;
}

.serial-card-action span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.serial-card-action:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.serial-card-copy {
  min-width: 0;
}

.trade-ledger {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.trade-row {
  border-color: rgba(23, 22, 20, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 236, 0.24)),
    rgba(255, 255, 255, 0.48);
  padding: 10px;
}

.trade-row.accepted {
  border-color: rgba(29, 118, 111, 0.26);
}

.trade-row.declined,
.trade-row.canceled {
  opacity: 0.72;
}

.trade-row-head,
.trade-sides {
  display: grid;
  gap: 6px;
}

.trade-row-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin-bottom: 8px;
}

.trade-row-head strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.trade-row-head small {
  color: var(--muted);
  font-weight: 850;
}

.trade-sides {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 8px;
}

.trade-card-chip,
.serial-chip {
  --rarity-border: rgba(23, 22, 20, 0.14);
  --rarity-glow: 0 0 0 transparent;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--rarity-border);
  border-radius: 999px;
  padding: 3px 8px;
  margin: 4px 4px 0 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--rarity-glow);
  font-size: 0.66rem;
  font-weight: 900;
}

button.trade-card-chip,
button.market-card-chip,
.serial-mini {
  font-family: inherit;
  cursor: pointer;
}

.pack-card-shell {
  position: relative;
  display: block;
}

.pack-card-shell .serial-chip {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(255, 248, 236, 0.92);
}

.matchmaking-panel {
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(238, 248, 244, 0.9)),
    var(--paper);
}

.matchmaking-mode-row,
.forum-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.matchmaking-status {
  margin: 12px 0;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(246, 207, 123, 0.12)),
    rgba(255, 255, 255, 0.44);
}

.matchmaking-status.is-queued {
  border-color: rgba(29, 118, 111, 0.38);
  box-shadow: inset 0 0 0 1px rgba(29, 118, 111, 0.12), 0 14px 30px rgba(29, 118, 111, 0.1);
}

.matchmaking-status strong,
.matchmaking-status span {
  display: block;
}

.matchmaking-status span {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.marketplace-panel {
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(241, 246, 239, 0.92)),
    var(--paper);
}

.marketplace-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.86fr) minmax(280px, 1.08fr) minmax(280px, 1fr);
  gap: 10px;
}

.market-maker,
.market-listings,
.market-offer-builder,
.market-ledger > div {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 248, 236, 0.28)),
    rgba(255, 255, 255, 0.5);
}

.market-maker h3,
.market-listings h3,
.market-offer-builder h3,
.market-ledger h3 {
  margin: 0 0 8px;
}

.compact-market-list {
  max-height: 278px;
  margin: 8px 0;
}

.market-list,
.forum-list,
.market-ledger {
  display: grid;
  gap: 8px;
}

.market-list {
  max-height: 392px;
  overflow: auto;
  padding-right: 3px;
}

.market-listing,
.market-offer-row,
.forum-post,
.market-mini-row {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 236, 0.2)),
    rgba(255, 255, 255, 0.5);
}

.market-listing,
.market-offer-row,
.forum-post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.market-listing.is-selected {
  border-color: rgba(29, 118, 111, 0.7);
  box-shadow: 0 0 0 2px rgba(29, 118, 111, 0.13);
}

.market-listing p,
.market-offer-row p,
.forum-post p {
  margin: 6px 0;
  color: var(--ink-soft);
  line-height: 1.38;
}

.market-listing small,
.forum-post small {
  color: var(--muted);
  font-weight: 850;
}

.market-card-chip {
  --rarity-border: rgba(23, 22, 20, 0.14);
  --rarity-glow: 0 0 0 transparent;
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  max-width: 100%;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--rarity-glow);
}

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

.market-card-chip small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.market-ledger {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.market-offer-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.market-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.market-mini-row > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.forum-panel {
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(244, 239, 248, 0.9)),
    var(--paper);
}

.forum-form {
  display: grid;
  grid-template-columns: 160px minmax(160px, 0.8fr) minmax(220px, 1fr) auto;
  gap: 8px;
  margin: 10px 0;
  align-items: start;
}

.forum-body-input {
  grid-column: 1 / -2;
  min-height: 86px;
  resize: vertical;
}

.forum-post span {
  display: inline-block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.forum-post h3 {
  margin: 3px 0 0;
}

.forum-vote-box {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.forum-vote-box strong {
  color: var(--ink);
}

.deck-layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.history-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 12px;
}

.deck-summary,
.deck-builder {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.96), rgba(244, 234, 217, 0.88)),
    var(--paper);
}

.deck-summary::before,
.deck-builder::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(29, 118, 111, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(127, 51, 77, 0.045) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.8;
}

.deck-summary > *,
.deck-builder > * {
  position: relative;
}

.deck-progress-card {
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background:
    linear-gradient(135deg, rgba(246, 207, 123, 0.2), rgba(104, 216, 204, 0.12)),
    rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 24px rgba(23, 22, 20, 0.08);
  position: relative;
  overflow: hidden;
}

.deck-progress-card::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -34px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(185, 130, 61, 0.24);
  transform: rotate(18deg);
  pointer-events: none;
}

.deck-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.deck-progress-head strong {
  display: block;
  font-size: 2.15rem;
  line-height: 0.95;
}

.deck-ready-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(127, 51, 77, 0.24);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--wine);
  background: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
  white-space: nowrap;
}

.deck-ready-pill.is-ready {
  border-color: rgba(47, 125, 82, 0.3);
  color: var(--success);
  background: rgba(47, 125, 82, 0.12);
}

.deck-progress-track,
.deck-balance-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(23, 22, 20, 0.12);
}

.deck-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold-soft), var(--wine));
  box-shadow: 0 0 16px rgba(246, 207, 123, 0.42);
}

.deck-progress-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.deck-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.deck-stat {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.28)),
    rgba(255, 255, 255, 0.34);
  box-shadow: var(--inner-highlight);
  transition:
    transform 140ms ease,
    border-color 140ms ease;
}

.deck-stat:hover {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.26);
}

.deck-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.deck-stat strong {
  font-size: 1.3rem;
}

.deck-balance,
.deck-influence {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  border: 1px solid rgba(23, 22, 20, 0.1);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.28);
}

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

.deck-balance-row,
.deck-influence-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(46px, 1fr) 20px;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 900;
}

.deck-balance-row.is-empty {
  opacity: 0.46;
}

.deck-balance-row span,
.deck-influence-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-balance-row strong,
.deck-influence-row strong {
  text-align: right;
}

.deck-balance-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.deck-balance-track .type-army,
.deck-balance-track .type-event {
  background: var(--clay);
}

.deck-balance-track .type-invention,
.deck-balance-track .type-manuscript {
  background: var(--blue);
}

.deck-balance-track .type-resource,
.deck-balance-track .type-building {
  background: var(--brass);
}

.deck-balance-track .type-leader,
.deck-balance-track .type-wonder,
.deck-balance-track .type-world {
  background: var(--wine);
}

.deck-balance-track .type-religion,
.deck-balance-track .type-religiousFigure,
.deck-balance-track .type-myth {
  background: var(--violet);
}

.deck-influence {
  gap: 7px;
}

.deck-influence-row {
  grid-template-columns: 78px minmax(90px, 1fr) 34px;
}

.recipe-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 7px;
  margin-bottom: 12px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.recipe-preset {
  flex: 0 0 214px;
  min-height: 62px;
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  padding: 9px;
  background:
    linear-gradient(135deg, rgba(42, 39, 33, 0.94), rgba(29, 118, 111, 0.8)),
    var(--ink-soft);
  color: var(--paper-strong);
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(23, 22, 20, 0.12);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.recipe-preset:hover,
.recipe-preset:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(246, 207, 123, 0.54);
  box-shadow: 0 14px 28px rgba(23, 22, 20, 0.18);
}

.recipe-preset svg {
  width: 22px;
  height: 22px;
  stroke: var(--gold-soft);
  fill: none;
}

.recipe-preset strong,
.recipe-preset small {
  display: block;
}

.recipe-preset strong {
  font-size: 0.82rem;
  line-height: 1.05;
}

.recipe-preset small {
  margin-top: 4px;
  color: rgba(255, 248, 236, 0.72);
  font-size: 0.64rem;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
}

.deck-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 950;
  text-transform: uppercase;
}

.deck-list-header.compact {
  margin: 0;
}

.deck-list-header strong {
  color: var(--ink);
}

.deck-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 42vh;
  overflow: auto;
}

.deck-list + .deck-balance {
  margin-top: 12px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 74vh;
  overflow: auto;
}

.deck-row {
  --rarity-border: rgba(23, 22, 20, 0.15);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(246, 207, 123, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.4);
  padding: 8px;
  box-shadow: var(--rarity-glow);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.history-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.34);
  padding: 8px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.deck-row:hover,
.history-row:hover {
  transform: translateX(3px);
  border-color: rgba(185, 130, 61, 0.36);
  box-shadow:
    var(--rarity-glow-strong, var(--rarity-glow)),
    0 10px 22px rgba(23, 22, 20, 0.1),
    inset 3px 0 0 rgba(246, 207, 123, 0.44);
}

.deck-row-copy {
  width: 36px;
  min-height: 34px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  background: rgba(255, 248, 236, 0.7);
  display: inline-grid;
  place-items: center;
  font-weight: 950;
  color: var(--ink);
}

.deck-row strong,
.history-row strong {
  display: block;
  line-height: 1.1;
}

.deck-row span,
.history-row span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.deck-row .deck-row-copy {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 950;
}

.row-actions {
  display: flex;
  gap: 5px;
}

.round-icon {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(23, 22, 20, 0.16);
  border-radius: 8px;
  background: var(--paper-strong);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.round-icon:hover,
.round-icon:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.38);
  box-shadow: 0 8px 18px rgba(23, 22, 20, 0.12);
}

.round-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.deck-pool-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
}

.deck-pool-meta span,
.copy-meter {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.38);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.deck-type-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 0 8px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

.deck-type-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.36);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 950;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.deck-type-chip:hover,
.deck-type-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(29, 118, 111, 0.35);
}

.deck-type-chip.is-selected {
  background: var(--ink-soft);
  color: var(--paper-strong);
  border-color: rgba(246, 207, 123, 0.45);
  box-shadow: 0 8px 20px rgba(23, 22, 20, 0.12);
}

.deck-type-chip.is-selected svg {
  stroke: var(--gold-soft);
}

.deck-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 9px;
  max-height: 76vh;
  overflow: auto;
  padding: 2px 4px 2px 0;
}

.deck-pick-card {
  --rarity-border: rgba(23, 22, 20, 0.15);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.2)),
    rgba(255, 248, 236, 0.44);
  box-shadow: var(--rarity-glow);
  overflow: hidden;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
  position: relative;
}

.deck-pick-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.24), transparent 34%, rgba(246, 207, 123, 0.08));
  opacity: 0;
  transition: opacity 150ms ease;
}

.deck-pick-card:hover,
.deck-pick-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--rarity-glow-strong, var(--rarity-glow)), 0 12px 26px rgba(23, 22, 20, 0.12);
}

.deck-pick-card:hover::after,
.deck-pick-card:focus-within::after {
  opacity: 1;
}

.deck-pick-card.is-capped {
  opacity: 0.68;
}

.deck-pick-main {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 8px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: stretch;
  gap: 9px;
  text-align: left;
  position: relative;
}

.deck-pick-card .card-art {
  min-height: 86px;
  height: 100%;
  border-color: rgba(23, 22, 20, 0.12);
  background: rgba(23, 22, 20, 0.12);
}

.deck-pick-card .card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.deck-pick-copy {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(23, 22, 20, 0.78);
  color: var(--paper-strong);
  font-size: 0.66rem;
  font-weight: 950;
}

.deck-pick-text,
.deck-pick-name,
.deck-pick-meta,
.deck-pick-history {
  display: block;
  min-width: 0;
}

.deck-pick-name {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.08;
  font-weight: 950;
}

.deck-pick-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.deck-pick-history {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.32;
}

.deck-pick-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 8px;
}

.deck-pick-actions .icon-button {
  min-height: 34px;
  padding: 7px 10px;
}

.deck-pick-actions .icon-button:disabled {
  opacity: 0.48;
  box-shadow: none;
}

.compact-gallery {
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  max-height: 78vh;
  overflow: auto;
  padding-right: 4px;
}

.compact-gallery .game-card {
  min-height: 220px;
}

.history-detail {
  min-height: 0;
}

.history-vault {
  min-height: 420px;
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(39, 33, 25, 0.96), rgba(29, 118, 111, 0.78)),
    var(--ink-soft);
  color: var(--paper-strong);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}

.history-vault::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(246, 207, 123, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(104, 216, 204, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.64;
}

.history-vault > * {
  position: relative;
}

.history-vault .eyebrow {
  color: rgba(246, 207, 123, 0.86);
}

.history-vault h2 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.95;
}

.history-vault-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.history-vault-stats div {
  border: 1px solid rgba(244, 234, 217, 0.15);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.history-vault-stats span,
.history-rarity-row span {
  display: block;
  color: rgba(255, 248, 236, 0.68);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.history-vault-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 1.35rem;
}

.history-rarity-stack {
  display: grid;
  gap: 8px;
}

.history-rarity-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
}

.history-rarity-row strong {
  text-align: right;
}

.history-rarity-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.history-rarity-track div {
  height: 100%;
  border-radius: inherit;
  background: var(--rarity-border, var(--gold-soft));
  box-shadow: var(--rarity-glow);
}

.detail-hero {
  --rarity-border: rgba(23, 22, 20, 0.2);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  min-height: 160px;
  border-radius: 8px;
  padding: 18px;
  color: #fff8eb;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--rarity-border);
  box-shadow: var(--rarity-glow);
}

.detail-hero h2 {
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 0.98;
}

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

.detail-box {
  border: 1px solid rgba(23, 22, 20, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.36);
  padding: 12px;
  box-shadow: var(--inner-highlight);
  transition:
    transform 140ms ease,
    border-color 140ms ease;
}

.detail-box:hover {
  transform: translateY(-1px);
  border-color: rgba(185, 130, 61, 0.28);
}

.detail-box p,
.detail-box li {
  color: var(--ink-soft);
  line-height: 1.45;
}

.detail-box ul {
  padding-left: 18px;
  margin: 8px 0 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(23, 22, 20, 0.86), rgba(29, 118, 111, 0.34)),
    rgba(23, 22, 20, 0.72);
  backdrop-filter: blur(9px);
}

.modal-backdrop.hidden,
.board-card-backdrop.hidden,
.toast.hidden {
  display: none;
}

.modal-panel {
  width: min(980px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  animation: modalRise 220ms ease both;
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(244, 234, 217, 0.9)),
    var(--paper);
}

.reward-modal-backdrop {
  z-index: 42;
  background:
    linear-gradient(135deg, rgba(23, 22, 20, 0.9), rgba(29, 118, 111, 0.42)),
    rgba(23, 22, 20, 0.76);
}

.reward-modal-panel {
  width: min(820px, 100%);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(246, 207, 123, 0.38);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.reward-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}

.founder-reward {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(230px, 0.8fr);
  gap: 18px;
  padding: clamp(18px, 4vw, 34px);
  background:
    linear-gradient(135deg, rgba(255, 248, 236, 0.98), rgba(244, 234, 217, 0.88)),
    radial-gradient(circle at 86% 18%, rgba(246, 207, 123, 0.24), transparent 36%);
}

.founder-reward-copy {
  display: grid;
  align-content: center;
  gap: 14px;
}

.founder-reward-copy h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 4.1rem);
  line-height: 0.92;
}

.founder-reward-copy p {
  max-width: 54ch;
  margin: 0;
  color: var(--ink-soft);
  font-weight: 780;
  line-height: 1.5;
}

.founder-reward-stats,
.founder-reward-note {
  border: 1px solid rgba(23, 22, 20, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.founder-reward-stats span,
.founder-reward-note span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1.4;
}

.founder-reward-stats strong {
  display: block;
  margin-top: 2px;
  color: var(--clay);
  font-size: 1.35rem;
  font-weight: 1000;
}

.founder-reward-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 1000;
}

.founder-reward-card {
  align-self: center;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(185, 130, 61, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(23, 22, 20, 0.92), rgba(39, 33, 25, 0.96)),
    var(--ink);
  color: var(--paper-strong);
  box-shadow: var(--card-shadow), 0 0 34px rgba(246, 207, 123, 0.2);
}

.founder-reward-card .card-art-reward {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  min-height: 0;
  border-radius: 7px;
}

.founder-reward-card strong,
.founder-reward-card span {
  display: block;
}

.founder-reward-card strong {
  font-size: 1rem;
  font-weight: 1000;
}

.founder-reward-card span {
  color: rgba(255, 248, 236, 0.72);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: capitalize;
}

.pack-grid {
  display: block;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  perspective: 1200px;
}

.pack-grid .game-card,
.pack-grid .pack-card-shell {
  transform-origin: 50% 70%;
  animation: packReveal 680ms cubic-bezier(0.18, 0.9, 0.24, 1.12) both;
}

.pack-grid .game-card::after,
.pack-grid .pack-card-shell::after {
  content: "";
  position: absolute;
  inset: -35%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.46) 50%, transparent 58%);
  opacity: 0;
  transform: translateX(-38%) rotate(8deg);
  animation: packSheen 720ms ease both;
}

.pack-grid .game-card:nth-child(2),
.pack-grid .pack-card-shell:nth-child(2) { animation-delay: 45ms; }
.pack-grid .game-card:nth-child(3),
.pack-grid .pack-card-shell:nth-child(3) { animation-delay: 90ms; }
.pack-grid .game-card:nth-child(4),
.pack-grid .pack-card-shell:nth-child(4) { animation-delay: 135ms; }
.pack-grid .game-card:nth-child(5),
.pack-grid .pack-card-shell:nth-child(5) { animation-delay: 180ms; }
.pack-grid .game-card:nth-child(6),
.pack-grid .pack-card-shell:nth-child(6) { animation-delay: 225ms; }
.pack-grid .game-card:nth-child(7),
.pack-grid .pack-card-shell:nth-child(7) { animation-delay: 270ms; }
.pack-grid .game-card:nth-child(8),
.pack-grid .pack-card-shell:nth-child(8) { animation-delay: 315ms; }

.pack-opening-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid rgba(246, 207, 123, 0.16);
  border-radius: 8px;
  padding: clamp(14px, 3vw, 26px);
  background:
    radial-gradient(circle at 20% 24%, rgba(246, 207, 123, 0.18), transparent 28%),
    radial-gradient(circle at 84% 12%, rgba(104, 216, 204, 0.18), transparent 26%),
    linear-gradient(145deg, rgba(23, 22, 20, 0.96), rgba(39, 33, 25, 0.92));
}

.pack-stage-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.pack-stage-orbit span {
  position: absolute;
  width: 160px;
  height: 160px;
  border: 1px solid rgba(246, 207, 123, 0.22);
  border-radius: 50%;
  animation: packOrbit 8s linear infinite;
}

.pack-stage-orbit span:nth-child(1) {
  left: 8%;
  top: 9%;
}

.pack-stage-orbit span:nth-child(2) {
  right: 11%;
  top: 18%;
  width: 110px;
  height: 110px;
  animation-duration: 6s;
  animation-direction: reverse;
}

.pack-stage-orbit span:nth-child(3) {
  left: 42%;
  bottom: 8%;
  width: 220px;
  height: 220px;
  border-color: rgba(104, 216, 204, 0.16);
  animation-duration: 10s;
}

.pack-stack-panel,
.pack-revealed-panel {
  position: relative;
  z-index: 1;
}

.pack-stack-panel {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.pack-stack {
  position: relative;
  width: min(240px, 70vw);
  aspect-ratio: 5 / 7;
  filter: drop-shadow(0 24px 35px rgba(0, 0, 0, 0.32));
}

.pack-back-card {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transform:
    translateX(calc(var(--stack-index) * 5px))
    translateY(calc(var(--stack-index) * -5px))
    rotate(calc((var(--stack-index) - 2) * 1.8deg));
  z-index: var(--stack-depth);
  transition:
    transform 220ms ease,
    filter 220ms ease;
  animation: packPulse 2.8s ease-in-out infinite;
}

.pack-back-card:not(.is-top) {
  pointer-events: none;
  filter: brightness(0.88);
}

.pack-back-card.is-top:hover,
.pack-back-card.is-top:focus-visible {
  transform: translateY(-12px) rotate(-1deg) scale(1.018);
  filter: brightness(1.06);
}

.pack-back-card.is-loading-reveal {
  cursor: wait;
  pointer-events: none;
  animation:
    packRevealCharge 1.08s cubic-bezier(0.42, 0, 0.2, 1) infinite,
    packPulse 2.8s ease-in-out infinite;
  filter: brightness(1.08) saturate(1.14);
}

.pack-back-card.is-loading-reveal::before,
.pack-back-card.is-loading-reveal::after {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 12px;
  pointer-events: none;
}

.pack-back-card.is-loading-reveal::before {
  background:
    conic-gradient(from 0deg, rgba(246, 207, 123, 0), rgba(246, 207, 123, 0.72), rgba(61, 199, 179, 0.54), rgba(246, 207, 123, 0));
  filter: blur(10px);
  opacity: 0.76;
  animation: packRevealHaloSpin 900ms linear infinite;
}

.pack-back-card.is-loading-reveal::after {
  border: 1px solid rgba(255, 248, 236, 0.34);
  box-shadow: 0 0 26px rgba(246, 207, 123, 0.28);
  animation: packRevealFramePulse 900ms ease-in-out infinite;
}

.pack-back-card .card-art {
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(246, 207, 123, 0.24), 0 18px 40px rgba(0, 0, 0, 0.3);
}

.pack-reveal-status {
  color: rgba(255, 248, 236, 0.88);
  text-align: center;
}

.pack-reveal-status strong,
.pack-reveal-status span {
  display: block;
}

.pack-reveal-status span {
  margin-top: 4px;
  color: rgba(255, 248, 236, 0.62);
  font-weight: 800;
}

.pack-opening-stage.is-preparing .pack-reveal-status strong {
  color: #ffe7a0;
}

.pack-opening-stage.is-preparing .pack-reveal-status span::after {
  content: "";
  display: inline-block;
  width: 1.7em;
  text-align: left;
  animation: loadingDots 1.05s steps(4, end) infinite;
}

.pack-revealed-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  align-self: stretch;
}

.pack-pile-title {
  width: min(250px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 248, 236, 0.76);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.pack-pile-title strong {
  color: var(--paper-strong);
}

.pack-revealed-stack {
  position: relative;
  width: min(250px, 72vw);
  aspect-ratio: 5 / 7;
  display: grid;
  place-items: center;
  perspective: 1400px;
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.38));
}

.pack-revealed-stack .empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 0;
  border-color: rgba(244, 234, 217, 0.24);
  color: rgba(255, 248, 236, 0.62);
}

.pack-card-shell.is-revealed {
  position: absolute;
  inset: 0;
  z-index: var(--reveal-depth);
  aspect-ratio: 5 / 7;
  min-height: 0;
  border-radius: 8px;
  transform: translate(var(--stack-x), var(--stack-y)) rotate(var(--stack-rotate)) scale(var(--stack-scale));
  transform-origin: 50% 64%;
  box-shadow: var(--rarity-glow-strong, var(--rarity-glow)), 0 18px 42px rgba(0, 0, 0, 0.32);
  transition:
    transform 260ms ease,
    filter 260ms ease;
}

.pack-card-shell.is-revealed.is-stacked {
  filter: brightness(0.88) saturate(0.94);
}

.pack-card-shell.is-revealed.is-latest {
  animation: packFlipToStack 980ms cubic-bezier(0.14, 0.8, 0.18, 1) both;
}

.pack-card-shell.is-revealed::before {
  content: "";
  position: absolute;
  inset: -18%;
  z-index: -1;
  pointer-events: none;
  border-radius: 18px;
  opacity: 0;
  background:
    radial-gradient(circle, var(--pack-aura, rgba(255, 255, 255, 0.16)), transparent 64%);
}

.pack-card-shell.is-revealed.is-latest::before {
  animation: packRarityBloom 1180ms ease both;
}

.pack-card-shell.is-revealed.is-latest .game-card {
  animation: packFaceSettle 980ms ease both;
}

.pack-card-shell.is-revealed .game-card {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.pack-card-shell.is-revealed.rarity-Uncommon { --pack-aura: rgba(116, 185, 255, 0.48); }
.pack-card-shell.is-revealed.rarity-Rare { --pack-aura: rgba(182, 124, 255, 0.52); }
.pack-card-shell.is-revealed.rarity-Epic { --pack-aura: rgba(255, 80, 80, 0.5); }
.pack-card-shell.is-revealed.rarity-Legendary { --pack-aura: rgba(255, 207, 92, 0.58); }
.pack-card-shell.is-revealed.rarity-Special { --pack-aura: rgba(255, 244, 184, 0.62); }

.pack-card-shell.is-revealed.rarity-Mythic::before {
  background:
    conic-gradient(from 0deg, rgba(255, 111, 199, 0.5), rgba(116, 185, 255, 0.46), rgba(128, 255, 177, 0.44), rgba(255, 213, 106, 0.5), rgba(255, 111, 199, 0.5));
  filter: blur(16px);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid rgba(246, 207, 123, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(39, 33, 25, 0.98), rgba(29, 118, 111, 0.86)),
    #272119;
  color: var(--paper-strong);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-weight: 800;
  animation: toastIn 180ms ease both;
  backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: no-preference) {
  body::before {
    animation: ambientMapDrift 32s linear infinite alternate;
  }

  .brand-mark svg {
    animation: sealBreath 4.8s ease-in-out infinite;
  }

  .mode-tabs {
    animation: navSettle 420ms ease both;
  }

  .tab.is-active {
    animation: activeTabPop 260ms ease both;
  }

  .icon-button:active,
  .round-icon:active,
  .mode-chip:active,
  .pack-type-card:active,
  .serial-card-action:active {
    animation: pressPop 180ms ease both;
  }

  .view.is-view-entering {
    animation: viewFadeUp 260ms ease both;
  }

  .view.is-view-entering .score-band,
  .view.is-view-entering .civilization-panel,
  .view.is-view-entering .command-panel,
  .view.is-view-entering .hand-panel,
  .view.is-view-entering .duel-health-card,
  .view.is-view-entering .duel-command-card,
  .view.is-view-entering .duel-board-panel,
  .view.is-view-entering .duel-log-panel,
  .view.is-view-entering .duel-hand-panel,
  .view.is-view-entering .campaign-overview,
  .view.is-view-entering .combo-journal,
  .view.is-view-entering .deck-summary,
  .view.is-view-entering .deck-builder,
  .view.is-view-entering .history-list-wrap,
  .view.is-view-entering .history-detail,
  .view.is-view-entering .online-card,
  .view.is-view-entering .online-empty {
    animation: panelLiftIn 440ms cubic-bezier(0.16, 0.82, 0.22, 1) both;
  }

  .view.is-view-entering .campaign-card,
  .view.is-view-entering .combo-item,
  .view.is-view-entering .deck-row,
  .view.is-view-entering .deck-pick-card,
  .view.is-view-entering .history-row,
  .view.is-view-entering .online-row,
  .view.is-view-entering .match-room,
  .view.is-view-entering .serial-mini,
  .view.is-view-entering .serial-card-button {
    animation: itemRiseIn 360ms cubic-bezier(0.16, 0.82, 0.22, 1) both;
  }

  .view.is-view-entering .campaign-card:nth-child(2n),
  .view.is-view-entering .deck-row:nth-child(2n),
  .view.is-view-entering .deck-pick-card:nth-child(2n),
  .view.is-view-entering .history-row:nth-child(2n),
  .view.is-view-entering .online-row:nth-child(2n),
  .view.is-view-entering .serial-mini:nth-child(2n),
  .view.is-view-entering .serial-card-button:nth-child(2n) {
    animation-delay: 35ms;
  }

  .view.is-view-entering .campaign-card:nth-child(3n),
  .view.is-view-entering .deck-row:nth-child(3n),
  .view.is-view-entering .deck-pick-card:nth-child(3n),
  .view.is-view-entering .history-row:nth-child(3n),
  .view.is-view-entering .online-row:nth-child(3n),
  .view.is-view-entering .serial-mini:nth-child(3n),
  .view.is-view-entering .serial-card-button:nth-child(3n) {
    animation-delay: 70ms;
  }

  .view.is-view-entering .card-gallery .game-card,
  .view.is-view-entering .hand-grid .game-card,
  .view.is-view-entering .duel-card {
    animation: cardFanIn 420ms cubic-bezier(0.16, 0.82, 0.22, 1) both;
  }

  .view.is-view-entering .card-gallery .game-card:nth-child(2n),
  .view.is-view-entering .hand-grid .game-card:nth-child(2n),
  .view.is-view-entering .duel-card:nth-child(2n) {
    animation-delay: 45ms;
  }

  .view.is-view-entering .card-gallery .game-card:nth-child(3n),
  .view.is-view-entering .hand-grid .game-card:nth-child(3n),
  .view.is-view-entering .duel-card:nth-child(3n) {
    animation-delay: 90ms;
  }

  .game-card.is-fresh-card {
    animation: cardLand 900ms cubic-bezier(0.14, 0.84, 0.2, 1) both;
    z-index: 2;
  }

  .game-card.is-fresh-card.fresh-ability {
    animation-name: cardAbilityPulse;
  }

  .game-card.is-fresh-card.fresh-event {
    animation-name: cardEventBurst;
  }

  .game-card.is-fresh-card.fresh-draw {
    animation-name: cardDrawGlow;
  }

  .game-card.is-fresh-card::after {
    opacity: 0.92;
    animation: cardArrivalSheen 760ms ease both;
  }

  .board-slot:has(.is-fresh-card) {
    animation: boardSlotGlow 820ms ease both;
  }

  .score-meter.is-surging .meter-fill {
    animation: meterSurge 1.6s ease-in-out infinite;
  }

  .score-meter.is-complete {
    animation: completeTrackPulse 1.4s ease-in-out infinite;
  }

  .log-line.is-latest {
    animation: logLineIn 420ms ease both;
  }

  .duel-health-fill {
    transition: width 360ms cubic-bezier(0.16, 0.82, 0.22, 1);
  }

  .pack-type-card.is-selected {
    animation: selectedPackGlow 2.6s ease-in-out infinite;
  }

  .card-inspector-hero {
    animation: inspectorHeroIn 360ms cubic-bezier(0.16, 0.82, 0.22, 1) both;
  }

  .card-inspector-grid .card-inspector-box {
    animation: itemRiseIn 320ms ease both;
  }

  .card-inspector-grid .card-inspector-box:nth-child(2n) {
    animation-delay: 35ms;
  }

  .card-inspector-grid .card-inspector-box:nth-child(3n) {
    animation-delay: 70ms;
  }

  body.fx-menu-swap .mode-tabs {
    animation: navSettle 280ms ease both, menuSweep 360ms ease both;
  }

  body.fx-card-play .match-layout .civilization-panel:last-child,
  body.fx-resource-play .match-layout .civilization-panel:last-child {
    animation: playerBoardPulse 680ms ease both;
  }

  body.fx-resource-play .resource-stack {
    animation: resourceBankPulse 700ms ease both;
  }

  body.fx-event-cast .score-band,
  body.fx-special-cast .score-band,
  body.fx-turn-resolve .score-band {
    animation: scoreResolvePulse 720ms ease both;
  }

  body.fx-board-impact .match-layout .civilization-panel:first-child,
  body.fx-board-destroy .match-layout,
  body.fx-duel-attack .duel-layout,
  body.fx-duel-special .duel-layout {
    animation: battlefieldPulse 620ms ease both;
  }

  body.fx-card-draw .hand-panel {
    animation: handCommandPulse 540ms ease both;
  }

  body.fx-duel-summon .duel-hand-panel {
    animation: handCommandPulse 620ms ease both;
  }

  body.fx-pack-flip .pack-stack-panel {
    animation: packStackHit 560ms ease both;
  }

  body.fx-pack-open .pack-opening-stage {
    animation: packCompleteBloom 880ms ease both;
  }

  body.fx-deny .game-root {
    animation: denyNudge 340ms ease both;
  }

  body.fx-victory .game-root::after {
    animation: victoryWash 900ms ease both;
  }

  body.fx-defeat .game-root::after {
    animation: defeatWash 640ms ease both;
  }

  .duel-hero-card.duel-fx-attack::after {
    animation: duelSlashFlash 420ms ease both;
  }

  .duel-hero-card.duel-fx-hit::after {
    animation: duelHitFlash 360ms ease both;
  }

  .duel-hero-card.duel-fx-special::after,
  .duel-hero-card.duel-fx-buff::after {
    animation: duelAuraFlash 680ms ease both;
  }
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes viewFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes packOrbit {
  from {
    transform: rotate(0deg) translateX(10px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(10px) rotate(-360deg);
  }
}

@keyframes packPulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(246, 207, 123, 0);
  }
  50% {
    box-shadow: 0 0 34px rgba(246, 207, 123, 0.18);
  }
}

@keyframes cardArtLoadingSheen {
  0% {
    transform: translateX(-125%);
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    transform: translateX(125%);
    opacity: 0;
  }
}

@keyframes packRevealCharge {
  0% {
    transform: translateY(-4px) rotateY(0deg) rotateZ(-1deg) scale(1.018);
  }
  50% {
    transform: translateY(-14px) rotateY(178deg) rotateZ(1deg) scale(1.045);
  }
  100% {
    transform: translateY(-4px) rotateY(360deg) rotateZ(-1deg) scale(1.018);
  }
}

@keyframes packRevealHaloSpin {
  from {
    transform: rotate(0deg) scale(1);
  }
  to {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes packRevealFramePulse {
  0%, 100% {
    opacity: 0.45;
    transform: scale(0.985);
  }
  50% {
    opacity: 1;
    transform: scale(1.025);
  }
}

@keyframes loadingDots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

@keyframes packFlipReveal {
  from {
    opacity: 0;
    transform: rotateY(-82deg) translateY(18px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotateY(0) translateY(0) scale(1);
  }
}

@keyframes packFlipToStack {
  0% {
    opacity: 0;
    transform: translateY(24px) rotateY(-92deg) rotateZ(-5deg) scale(0.9);
    filter: brightness(1.35) saturate(1.2);
  }
  48% {
    opacity: 1;
    transform: translateY(-16px) rotateY(18deg) rotateZ(2deg) scale(1.055);
    filter: brightness(1.7) saturate(1.35);
  }
  72% {
    transform: translateY(-4px) rotateY(-7deg) rotateZ(-1deg) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translate(var(--stack-x), var(--stack-y)) rotate(var(--stack-rotate)) scale(var(--stack-scale));
    filter: brightness(1) saturate(1);
  }
}

@keyframes packFaceSettle {
  0%, 32% {
    box-shadow: var(--card-shadow), var(--rarity-glow-strong);
  }
  62% {
    box-shadow: var(--card-shadow), var(--rarity-glow-strong), 0 0 42px var(--pack-aura, rgba(255, 255, 255, 0.2));
  }
  100% {
    box-shadow: var(--card-shadow), var(--rarity-glow-strong);
  }
}

@keyframes packRarityBloom {
  0% {
    opacity: 0;
    transform: scale(0.62) rotate(0deg);
  }
  38% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: scale(1.42) rotate(18deg);
  }
}

@keyframes soft-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes duelSummon {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.84);
    filter: saturate(1.2) brightness(1.35);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: saturate(1) brightness(1);
  }
}

@keyframes duelStrike {
  0% {
    transform: translateX(0) scale(1);
  }
  45% {
    transform: translateX(18px) scale(1.035);
    filter: brightness(1.22);
  }
  100% {
    transform: translateX(0) scale(1);
  }
}

@keyframes duelHit {
  0%, 100% {
    transform: translateX(0);
    filter: brightness(1);
  }
  24% {
    transform: translateX(-7px) rotate(-1deg);
    filter: brightness(1.55) saturate(1.35);
  }
  50% {
    transform: translateX(6px) rotate(1deg);
  }
}

@keyframes duelClash {
  0%, 100% {
    transform: translateX(0) scale(1);
  }
  30% {
    transform: translateX(12px) scale(1.025);
  }
  62% {
    transform: translateX(-8px) scale(0.985);
    filter: brightness(1.36);
  }
}

@keyframes duelSpecialPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  45% {
    transform: scale(1.05);
    filter: brightness(1.55) saturate(1.35);
    box-shadow: var(--card-shadow), var(--rarity-glow-strong), 0 0 34px rgba(255, 244, 184, 0.46);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes duelBuff {
  0%, 100% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.035);
    filter: brightness(1.28) saturate(1.2);
  }
}

@keyframes packReveal {
  from {
    opacity: 0;
    transform: translateY(28px) rotateX(58deg) rotateZ(-2deg) scale(0.88);
  }
  54% {
    opacity: 1;
    transform: translateY(-8px) rotateX(-8deg) rotateZ(1deg) scale(1.04);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0) rotateZ(0) scale(1);
  }
}

@keyframes packSheen {
  0% {
    opacity: 0;
    transform: translateX(-55%) rotate(8deg);
  }
  40% {
    opacity: 0;
  }
  66% {
    opacity: 0.78;
  }
  100% {
    opacity: 0;
    transform: translateX(55%) rotate(8deg);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ambientMapDrift {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 0.74;
  }
  to {
    transform: translate3d(-18px, 14px, 0);
    opacity: 0.94;
  }
}

@keyframes sealBreath {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(246, 207, 123, 0));
  }
  50% {
    transform: scale(1.045);
    filter: drop-shadow(0 0 10px rgba(246, 207, 123, 0.28));
  }
}

@keyframes navSettle {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes activeTabPop {
  0% {
    transform: translateY(0) scale(0.985);
  }
  70% {
    transform: translateY(-1px) scale(1.018);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes pressPop {
  0% {
    transform: translateY(0) scale(1);
  }
  55% {
    transform: translateY(1px) scale(0.97);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes panelLiftIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes itemRiseIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardFanIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(-1.6deg) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes cardLand {
  0% {
    transform: translateY(-24px) rotate(-2deg) scale(1.06);
    filter: brightness(1.16) saturate(1.16);
  }
  58% {
    transform: translateY(4px) rotate(0.6deg) scale(0.992);
  }
  100% {
    transform: translateY(0) rotate(0) scale(1);
    filter: brightness(1) saturate(1);
  }
}

@keyframes cardAbilityPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: var(--card-shadow), var(--rarity-glow), 0 0 0 rgba(104, 216, 204, 0);
  }
  38% {
    transform: scale(1.04);
    filter: brightness(1.18) saturate(1.12);
    box-shadow: var(--card-shadow), var(--rarity-glow-strong), 0 0 34px rgba(104, 216, 204, 0.48);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: var(--card-shadow), var(--rarity-glow);
  }
}

@keyframes cardEventBurst {
  0% {
    transform: scale(0.96) rotate(-2deg);
    filter: brightness(1.22) saturate(1.18);
  }
  42% {
    transform: scale(1.07) rotate(1.4deg);
    filter: brightness(1.28) saturate(1.28);
  }
  100% {
    transform: scale(1) rotate(0);
    filter: brightness(1) saturate(1);
  }
}

@keyframes cardDrawGlow {
  0% {
    transform: translateY(18px) scale(0.92);
    filter: brightness(1.3) saturate(1.18);
    box-shadow: var(--card-shadow), var(--rarity-glow-strong), 0 0 32px rgba(104, 216, 204, 0.42);
  }
  48% {
    transform: translateY(-8px) scale(1.035);
    filter: brightness(1.2) saturate(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1) saturate(1);
    box-shadow: var(--card-shadow), var(--rarity-glow);
  }
}

@keyframes cardArrivalSheen {
  0% {
    opacity: 0;
    transform: translateX(-58%) rotate(8deg);
  }
  34% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
    transform: translateX(58%) rotate(8deg);
  }
}

@keyframes battleSceneIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.94);
  }
  12%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-18px) scale(0.98);
  }
}

@keyframes battleAttackerLunge {
  0% {
    transform: translateX(-18px) rotate(-2deg) scale(0.98);
  }
  36% {
    transform: translateX(30px) rotate(3deg) scale(1.05);
    filter: brightness(1.34) saturate(1.18);
  }
  62% {
    transform: translateX(4px) rotate(0) scale(1);
  }
  100% {
    transform: translateX(0) rotate(0) scale(1);
  }
}

@keyframes battleTargetBrace {
  0% {
    transform: translateX(14px) rotate(2deg);
  }
  36% {
    transform: translateX(-20px) rotate(-3deg) scale(1.02);
    filter: brightness(1.42);
  }
  68% {
    transform: translateX(7px) rotate(1deg);
  }
  100% {
    transform: translateX(0) rotate(0);
  }
}

@keyframes battleLoserKnockout {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0) rotate(0) scale(1);
    filter: brightness(1.2) saturate(1.18);
  }
  45% {
    opacity: 1;
    transform: translateX(18px) translateY(-12px) rotate(7deg) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translateX(74px) translateY(66px) rotate(24deg) scale(0.74);
    filter: grayscale(0.3) brightness(0.72);
  }
}

@keyframes battleBurst {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-22deg);
  }
  34% {
    opacity: 1;
    transform: scale(1.22) rotate(9deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.55) rotate(20deg);
  }
}

@keyframes boardSlotGlow {
  0% {
    border-color: rgba(246, 207, 123, 0.2);
    box-shadow: 0 0 0 rgba(246, 207, 123, 0);
  }
  40% {
    border-color: rgba(246, 207, 123, 0.78);
    box-shadow: 0 0 0 3px rgba(246, 207, 123, 0.14), 0 18px 36px rgba(185, 130, 61, 0.16);
  }
  100% {
    border-color: rgba(23, 22, 20, 0.28);
    box-shadow: 0 0 0 rgba(246, 207, 123, 0);
  }
}

@keyframes meterSurge {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.24);
  }
}

@keyframes completeTrackPulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
  }
}

@keyframes logLineIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
    background: rgba(246, 207, 123, 0.16);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    background: transparent;
  }
}

@keyframes selectedPackGlow {
  0%,
  100% {
    box-shadow: var(--rarity-glow), 0 0 0 rgba(246, 207, 123, 0);
  }
  50% {
    box-shadow: var(--rarity-glow-strong, var(--rarity-glow)), 0 0 22px rgba(246, 207, 123, 0.22);
  }
}

@keyframes inspectorHeroIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menuSweep {
  0% {
    filter: brightness(1);
  }
  42% {
    filter: brightness(1.18) saturate(1.08);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes playerBoardPulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: var(--panel-shadow), var(--inner-highlight);
  }
  38% {
    transform: translateY(-2px);
    box-shadow:
      var(--panel-shadow),
      var(--inner-highlight),
      0 0 0 3px rgba(246, 207, 123, 0.16),
      0 18px 42px rgba(185, 130, 61, 0.2);
  }
}

@keyframes resourceBankPulse {
  0%, 100% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.22) saturate(1.14);
  }
}

@keyframes scoreResolvePulse {
  0%, 100% {
    transform: translateY(0);
    filter: brightness(1);
  }
  42% {
    transform: translateY(-2px);
    filter: brightness(1.13) saturate(1.08);
  }
}

@keyframes battlefieldPulse {
  0%, 100% {
    transform: translateX(0);
    filter: brightness(1);
  }
  24% {
    transform: translateX(-2px);
    filter: brightness(1.15) saturate(1.1);
  }
  48% {
    transform: translateX(2px);
  }
}

@keyframes handCommandPulse {
  0%, 100% {
    transform: translateY(0);
  }
  45% {
    transform: translateY(-4px);
    box-shadow:
      var(--panel-shadow),
      var(--inner-highlight),
      0 0 28px rgba(104, 216, 204, 0.24);
  }
}

@keyframes packStackHit {
  0%, 100% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.018) rotate(-0.4deg);
    filter: brightness(1.24) saturate(1.14);
  }
}

@keyframes packCompleteBloom {
  0% {
    filter: brightness(1);
  }
  45% {
    filter: brightness(1.28) saturate(1.2);
  }
  100% {
    filter: brightness(1);
  }
}

@keyframes denyNudge {
  0%, 100% {
    transform: translateX(0);
  }
  24% {
    transform: translateX(-4px);
  }
  48% {
    transform: translateX(4px);
  }
  72% {
    transform: translateX(-2px);
  }
}

@keyframes victoryWash {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  35% {
    opacity: 0.9;
    background:
      radial-gradient(circle at 50% 45%, rgba(246, 207, 123, 0.42), transparent 32%),
      radial-gradient(circle at 30% 70%, rgba(104, 216, 204, 0.22), transparent 30%);
  }
  100% {
    opacity: 0;
    transform: scale(1.08);
  }
}

@keyframes defeatWash {
  0% {
    opacity: 0;
  }
  34% {
    opacity: 0.62;
    background:
      radial-gradient(circle at 50% 45%, rgba(170, 63, 54, 0.34), transparent 34%),
      radial-gradient(circle at 70% 64%, rgba(127, 51, 77, 0.2), transparent 30%);
  }
  100% {
    opacity: 0;
  }
}

@keyframes duelSlashFlash {
  0% {
    opacity: 0;
    transform: translateX(-55%) skewX(-18deg);
  }
  42% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(55%) skewX(-18deg);
  }
}

@keyframes duelHitFlash {
  0% {
    opacity: 0;
  }
  32% {
    opacity: 0.95;
    background:
      radial-gradient(circle at 50% 44%, rgba(255, 248, 236, 0.44), transparent 30%),
      radial-gradient(circle at 50% 50%, rgba(170, 63, 54, 0.34), transparent 50%);
  }
  100% {
    opacity: 0;
  }
}

@keyframes duelAuraFlash {
  0% {
    opacity: 0;
    transform: scale(0.92);
  }
  42% {
    opacity: 0.85;
    transform: scale(1.04);
  }
  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.mobile-turn-bar {
  display: none;
}

.board-card-backdrop {
  position: fixed;
  inset: 0;
  z-index: 36;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(23, 22, 20, 0.74);
}

.board-card-panel {
  position: relative;
  width: min(980px, 100%);
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 12px;
}

.board-card-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.board-detail-hero {
  --rarity-border: rgba(23, 22, 20, 0.2);
  --rarity-glow: 0 0 0 rgba(0, 0, 0, 0);
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  align-items: end;
  gap: 16px;
  border: 1px solid var(--rarity-border);
  border-radius: 8px;
  color: #fff8eb;
  box-shadow: var(--rarity-glow);
  padding: 16px;
}

.card-inspector-hero {
  grid-template-columns: minmax(210px, 310px) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(23, 22, 20, 0.86), rgba(29, 118, 111, 0.62)),
    var(--ink);
}

.card-inspector-art {
  position: relative;
  min-width: 0;
}

.card-inspector-art .card-art-detail {
  width: 100%;
  height: 100%;
  min-height: 280px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.26);
}

.card-inspector-art .serial-chip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(255, 248, 236, 0.94);
}

.board-detail-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 6vw, 3.4rem);
  line-height: 1;
}

.board-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.board-detail-tags span,
.board-detail-tag-cloud span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 248, 236, 0.86);
  font-size: 0.68rem;
  font-weight: 900;
}

.board-detail-stats {
  margin: 10px 0;
}

.card-inspector-serial {
  display: inline-grid;
  gap: 2px;
  margin-top: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(0, 0, 0, 0.18);
}

.card-inspector-serial strong {
  font-size: 1.12rem;
}

.card-inspector-serial span {
  color: rgba(255, 248, 236, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-inspector-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
  border: 1px solid rgba(29, 118, 111, 0.22);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.13), rgba(246, 207, 123, 0.14)),
    rgba(255, 255, 255, 0.52);
  box-shadow: 0 14px 30px rgba(23, 22, 20, 0.09);
}

.card-inspector-actions > div:first-child {
  min-width: 0;
}

.card-inspector-actions > div:last-child {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.card-inspector-actions > div:first-child > span {
  display: block;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.card-inspector-actions .primary-button span {
  color: inherit;
}

.card-inspector-actions strong {
  display: block;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.05;
}

.card-inspector-actions p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.32;
}

.card-inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card-inspector-box {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 248, 236, 0.24)),
    rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.card-inspector-box.wide {
  grid-column: 1 / -1;
}

.card-inspector-box h3,
.card-inspector-box p,
.card-inspector-box dl {
  margin: 0;
}

.card-inspector-box h3 {
  color: var(--ink);
  font-size: 1rem;
}

.card-inspector-box p {
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.45;
}

.card-inspector-box small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 850;
}

.card-inspector-box dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.card-inspector-box dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

.card-inspector-box dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 950;
}

.card-inspector-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-inspector-duel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.card-inspector-duel span {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.74rem;
  font-weight: 950;
}

.card-inspector-duel strong {
  color: var(--ink);
}

.card-inspector-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.card-inspector-links button,
.card-inspector-links span {
  border: 1px solid rgba(23, 22, 20, 0.12);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.54);
  font-size: 0.72rem;
  font-weight: 900;
}

.card-inspector-links button {
  cursor: pointer;
  font-family: inherit;
}

.card-inspector-links button:hover,
.card-inspector-links button:focus-visible {
  border-color: rgba(29, 118, 111, 0.36);
  color: var(--ink);
}

.board-ability-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(29, 118, 111, 0.22);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(29, 118, 111, 0.14), rgba(246, 207, 123, 0.18)),
    rgba(255, 255, 255, 0.46);
  box-shadow: 0 12px 28px rgba(23, 22, 20, 0.08);
}

.board-ability-panel h3,
.board-ability-panel p {
  margin: 0;
}

.board-ability-panel p {
  margin-top: 4px;
  color: var(--ink-soft);
}

.board-ability-panel small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 850;
}

.battle-panel {
  align-items: stretch;
}

.battle-target-list {
  min-width: min(330px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 8px;
}

.battle-target-card {
  border: 1px solid var(--rarity-border, rgba(29, 118, 111, 0.22));
  border-radius: 8px;
  padding: 9px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(244, 234, 217, 0.68)),
    rgba(255, 255, 255, 0.62);
  box-shadow: var(--rarity-glow), 0 10px 22px rgba(23, 22, 20, 0.08);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.battle-target-card:hover,
.battle-target-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(185, 130, 61, 0.48);
  box-shadow: var(--rarity-glow-strong), 0 14px 26px rgba(23, 22, 20, 0.12);
}

.battle-target-card:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.battle-target-card span,
.battle-target-card strong,
.battle-target-card small {
  display: block;
}

.battle-target-card span {
  font-size: 0.82rem;
  font-weight: 950;
}

.battle-target-card strong {
  margin-top: 4px;
  font-size: 0.78rem;
}

.battle-target-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.board-detail-copy {
  display: grid;
  gap: 10px;
  color: var(--ink-soft);
}

.board-detail-copy p {
  margin: 0;
  line-height: 1.42;
}

.board-detail-copy dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.board-detail-copy dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.board-detail-copy dd {
  margin: 2px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.board-detail-copy dl > div {
  border: 1px solid rgba(23, 22, 20, 0.11);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.36);
}

.board-detail-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.board-detail-tag-cloud span {
  border-color: rgba(23, 22, 20, 0.12);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink-soft);
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(23, 22, 20, 0.25);
  border-radius: 8px;
  text-align: center;
  padding: 20px;
}

@media (min-width: 761px) {
  .app-topbar {
    padding-block: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand-mark svg {
    width: 24px;
    height: 24px;
  }

  h1 {
    font-size: clamp(1.65rem, 2.35vw, 2.35rem);
  }

  .top-actions .icon-button {
    min-height: 34px;
    padding: 7px 10px;
  }

  .mode-tabs {
    padding-bottom: 10px;
  }

  .score-band {
    gap: 10px;
    margin-bottom: 8px;
    padding: 9px 10px;
  }

  .match-layout {
    grid-template-columns: minmax(0, 1fr) 270px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .match-layout > .civilization-panel,
  .match-layout > .command-panel,
  .hand-panel {
    padding: 10px;
  }

  .match-layout > .civilization-panel .section-title {
    margin-bottom: 7px;
  }

  .board-grid {
    grid-template-columns: repeat(3, minmax(92px, 112px));
    justify-content: center;
    gap: 6px;
  }

  .board-slot {
    gap: 4px;
    padding: 5px;
  }

  .slot-label {
    gap: 4px;
    font-size: 0.58rem;
    line-height: 1;
  }

  .slot-icon {
    width: 13px;
    height: 13px;
  }

  .slot-empty,
  .card-mode-board {
    aspect-ratio: 5 / 7;
    height: auto;
  }

  .card-mode-board:not(.has-card-image) {
    padding: 5px;
  }

  .card-mode-board:not(.has-card-image) .card-name {
    font-size: 0.72rem;
    line-height: 1.05;
  }

  .card-mode-board:not(.has-card-image) .card-art {
    min-height: 30px;
  }

  .card-mode-board:not(.has-card-image) .stats-row {
    gap: 2px;
  }

  .card-mode-board:not(.has-card-image) .stat-pill {
    padding: 1px;
  }

  .resource-stack-inner {
    grid-template-columns: repeat(3, minmax(92px, 112px));
    justify-content: center;
    gap: 5px;
  }

  .command-panel {
    gap: 10px;
    position: sticky;
    top: 132px;
  }

  .turn-number {
    font-size: 2.7rem;
  }

  .command-stats div {
    padding: 6px;
  }

  .command-stats strong {
    font-size: 1.15rem;
  }

  .log-panel {
    min-height: 120px;
    max-height: 190px;
    font-size: 0.78rem;
  }

  .hand-panel {
    margin-top: 8px;
  }

  .hand-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 176px));
    gap: 8px;
    justify-content: start;
  }

  .hand-grid .game-card {
    min-height: 190px;
    padding: 7px;
    gap: 5px;
  }

  .hand-grid .card-body {
    font-size: 0.68rem;
    line-height: 1.18;
  }

  .hand-grid .card-art {
    min-height: 56px;
  }
}

@media (max-width: 1180px) {
  .launcher-frame {
    grid-template-columns: 1fr;
  }

  .launcher-overview {
    min-height: auto;
  }

  .tutorial-shell {
    grid-template-columns: 1fr;
  }

  .tutorial-progress {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tutorial-meter {
    grid-column: 1 / -1;
  }

  .match-layout,
  .duel-status-band,
  .duel-layout,
  .campaign-layout,
  .online-grid,
  .online-panel-layout,
  .serial-vault,
  .serial-last-pack,
  .trade-builder,
  .trade-ledger,
  .marketplace-layout,
  .market-ledger,
  .pack-opening-stage,
  .deck-layout,
  .history-layout {
    grid-template-columns: 1fr;
  }

  .forum-form {
    grid-template-columns: 1fr;
  }

  .forum-body-input {
    grid-column: auto;
  }

  .serial-supply-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .online-section-tabs {
    gap: 6px;
    padding: 5px;
  }

  .online-section-tab {
    flex-basis: 104px;
    min-height: 34px;
    padding: 7px 9px;
  }

  .command-panel {
    order: -1;
  }

  .score-band {
    grid-template-columns: 1fr;
  }

  .online-match-table,
  .online-duel-table {
    grid-template-columns: 1fr;
    grid-template-areas:
      "rival"
      "player"
      "hand"
      "log";
  }

  .online-match-log {
    max-height: 260px;
  }

  .online-board-grid {
    grid-template-columns: repeat(3, minmax(84px, 1fr));
  }

  .online-campaign-board {
    grid-template-columns: repeat(auto-fit, minmax(76px, 96px));
  }
}

@media (max-width: 760px) {
  body {
    padding-bottom: calc(74px + var(--safe-bottom));
  }

  body.launcher-active {
    padding-bottom: 0;
  }

  .pack-type-grid,
  .serial-supply-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pack-type-card {
    min-height: 104px;
  }

  .online-match-title {
    gap: 12px;
  }

  .online-match-title .row-actions {
    justify-content: stretch;
  }

  .online-match-title .row-actions .icon-button,
  .online-match-title .row-actions .online-auto-sync-pill {
    flex: 1 1 140px;
  }

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

  .online-board-grid {
    grid-template-columns: repeat(2, minmax(96px, 1fr));
  }

  .online-campaign-board {
    grid-template-columns: repeat(4, minmax(66px, 1fr));
    gap: 6px;
  }

  .online-campaign-board .board-slot {
    padding: 5px;
  }

  .online-campaign-board .slot-label {
    font-size: 0.52rem;
  }

  .online-resource-slot {
    grid-column: 1 / -1;
  }

  .online-board-slot .game-card {
    height: 152px;
  }

  .online-board-slot .card-art-normal {
    min-height: 82px;
  }

  .online-board-slot .slot-empty {
    min-height: 152px;
  }

  .online-hand-card {
    flex-basis: 158px;
  }

  .online-hand-card .game-card {
    min-height: 248px;
  }

  .online-duel-field {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .online-duel-hand .duel-card {
    flex-basis: 168px;
  }

  .launcher-screen {
    min-height: 100svh;
    padding: 12px;
    align-items: start;
    justify-items: center;
  }

  .launcher-frame {
    gap: 8px;
    width: min(100%, 294px);
    max-width: calc(100vw - 24px);
  }

  .launcher-overview,
  .launcher-panel {
    padding: 14px;
    width: 100%;
    max-width: 100%;
  }

  .launcher-title {
    gap: 12px;
  }

  .launcher-title h1 {
    font-size: clamp(2.05rem, 9vw, 2.65rem);
    line-height: 0.92;
  }

  .launcher-feature {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
  }

  .launcher-feature .card-art-launcher {
    width: 76px;
  }

  .launcher-feature p {
    overflow-wrap: anywhere;
  }

  .launcher-panel-head {
    margin-bottom: 12px;
    gap: 10px;
  }

  .launcher-panel-head h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .profile-seal {
    width: 46px;
    height: 46px;
  }

  .profile-seal svg {
    width: 25px;
    height: 25px;
  }

  .launcher-fields,
  .launcher-choice-grid.focus-grid,
  .launcher-action-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-head {
    align-items: center;
  }

  .tutorial-head h2 {
    font-size: clamp(1.65rem, 9vw, 2.35rem);
    line-height: 0.96;
  }

  .tutorial-progress {
    gap: 6px;
  }

  .tutorial-step-tab {
    min-height: 44px;
    grid-template-columns: auto;
    justify-items: center;
    padding: 7px 5px;
    text-align: center;
  }

  .tutorial-step-tab span {
    width: 24px;
    height: 24px;
  }

  .tutorial-step-tab strong {
    font-size: 0.62rem;
  }

  .tutorial-body {
    padding: 11px;
  }

  .tutorial-preview {
    min-height: 140px;
    padding: 10px;
  }

  .tutorial-overview-demo,
  .tutorial-online-demo,
  .tutorial-board-demo,
  .tutorial-choice-demo {
    grid-template-columns: 1fr;
  }

  .tutorial-overview-demo > div,
  .tutorial-online-demo > div {
    min-height: 76px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .tutorial-overview-demo span,
  .tutorial-online-demo span {
    grid-column: 2;
  }

  .tutorial-track {
    grid-template-columns: 78px minmax(0, 1fr) 40px;
    gap: 6px;
    font-size: 0.62rem;
  }

  .tutorial-hand-demo {
    flex-direction: column;
  }

  .tutorial-action-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-health-demo {
    grid-template-columns: 48px minmax(0, 1fr) 46px;
    font-size: 0.62rem;
  }

  .tutorial-field-demo {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tutorial-field-demo span {
    min-height: 58px;
  }

  .tutorial-list {
    padding-left: 16px;
    font-size: 0.82rem;
  }

  .tutorial-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .tutorial-controls > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tutorial-controls .icon-button {
    width: 100%;
  }

  .launcher-choice-grid.emblem-grid,
  .launcher-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .launcher-pack-strip,
  .starter-pack-preview,
  .online-deck-stats,
  .serial-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .online-deck-builder {
    grid-template-columns: 1fr;
  }

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

  .serial-mini-grid {
    grid-template-columns: 1fr;
  }

  .trade-friend-list,
  .serial-select-grid {
    max-height: 260px;
  }

  .serial-vault-count {
    min-height: 104px;
  }

  .account-tabs,
  .pack-status-card,
  .online-empty,
  .online-hero,
  .online-row,
  .match-room {
    align-items: stretch;
  }

  .pack-status-card,
  .online-empty,
  .online-hero,
  .online-row,
  .match-room {
    flex-direction: column;
  }

  .online-search {
    grid-template-columns: 1fr;
  }

  .online-pack-bank {
    width: 100%;
    min-width: 0;
  }

  .pack-opening-stage {
    min-height: 0;
    padding: 12px;
  }

  .pack-stack {
    width: min(190px, 62vw);
  }

  .pack-revealed-stack {
    width: min(190px, 62vw);
  }

  .market-listing,
  .market-offer-row,
  .forum-post,
  .board-ability-panel {
    grid-template-columns: 1fr;
  }

  .market-listing,
  .market-offer-row,
  .forum-post {
    display: grid;
  }

  .board-ability-panel {
    display: grid;
  }

  .friend-row .row-actions,
  .match-room .row-actions {
    justify-content: stretch;
  }

  .friend-row .row-actions .icon-button,
  .match-room .row-actions .icon-button {
    flex: 1 1 120px;
  }

  .launcher-actions .icon-button,
  .launcher-actions .primary-button {
    width: 100%;
  }

  .profile-pass {
    grid-template-columns: 1fr;
  }

  .app-topbar {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    padding: 7px 8px;
  }

  .brand-block {
    gap: 8px;
  }

  .brand-block .eyebrow {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-mark svg {
    width: 21px;
    height: 21px;
  }

  h1 {
    font-size: 1.24rem;
  }

  h2 {
    font-size: 0.94rem;
  }

  .top-actions {
    width: auto;
    display: flex;
    flex: 0 0 auto;
    gap: 5px;
    margin-left: auto;
  }

  .top-actions .icon-button {
    width: 36px;
    min-width: 36px;
    min-height: 34px;
    padding: 0;
  }

  .top-actions .text-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .mode-tabs {
    position: sticky;
    top: 0;
    z-index: 15;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 5px;
    padding: 5px 8px;
    background: rgba(23, 22, 20, 0.92);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .mode-tabs::-webkit-scrollbar,
  .hand-grid::-webkit-scrollbar,
  .recipe-bar::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.75rem;
    scroll-snap-align: start;
  }

  .text-button span {
    white-space: nowrap;
  }

  .app-shell {
    width: calc(100% - 10px);
    margin-bottom: 8px;
  }

  .score-band,
  .civilization-panel,
  .command-panel,
  .hand-panel,
  .duel-health-card,
  .duel-command-card,
  .duel-board-panel,
  .duel-log-panel,
  .duel-hand-panel,
  .campaign-overview,
  .combo-journal,
  .deck-summary,
  .deck-builder,
  .history-list-wrap,
  .history-detail {
    padding: 10px;
  }

  .score-band {
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
  }

  .score-band .eyebrow {
    font-size: 0.5rem;
    margin-bottom: 3px;
  }

  .score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 6px;
  }

  .score-meter-head {
    margin-bottom: 1px;
    font-size: 0.48rem;
    gap: 2px;
  }

  .meter-track {
    height: 4px;
  }

  .duel-status-band {
    gap: 6px;
    margin-top: 5px;
    margin-bottom: 6px;
  }

  .duel-health-card,
  .duel-command-card,
  .duel-board-panel,
  .duel-log-panel,
  .duel-hand-panel {
    padding: 8px;
  }

  .duel-health-card {
    gap: 5px;
  }

  .duel-health-head {
    font-size: 0.82rem;
  }

  .duel-health-head span {
    font-size: 0.58rem;
  }

  .duel-health-track {
    height: 8px;
  }

  .duel-command-card {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .duel-command-card h2 {
    font-size: 0.98rem;
  }

  .duel-quick-stats {
    gap: 4px;
  }

  .duel-quick-stats span {
    padding: 4px 7px;
    font-size: 0.62rem;
  }

  .duel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .duel-layout {
    gap: 7px;
  }

  .duel-board-panel.rival {
    order: 1;
  }

  .duel-board-panel.player {
    order: 2;
  }

  .duel-log-panel {
    order: 3;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .duel-field {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .duel-slot-empty {
    min-height: 172px;
    font-size: 0;
  }

  .duel-hero-card {
    min-height: 188px;
  }

  .duel-hero-card .card-art-duel {
    aspect-ratio: auto;
    height: 88px;
  }

  .duel-card .card-art-duel {
    aspect-ratio: auto;
    height: 122px;
  }

  .duel-hero-main,
  .duel-card-copy {
    gap: 5px;
    padding: 6px;
  }

  .duel-hero-main h3,
  .duel-card-copy h3 {
    font-size: 0.78rem;
  }

  .duel-hero-card .eyebrow,
  .duel-card .eyebrow {
    font-size: 0.48rem;
  }

  .duel-special-text,
  .duel-card-copy p {
    font-size: 0.58rem;
    line-height: 1.18;
    max-height: 3.6em;
    overflow: hidden;
  }

  .duel-hero-actions {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .duel-hero-actions .icon-button {
    min-height: 30px;
    padding: 4px;
    font-size: 0.64rem;
  }

  .duel-log-panel {
    max-height: 190px;
    overflow: hidden;
  }

  .duel-log {
    max-height: 128px;
    font-size: 0.68rem;
  }

  .duel-hand-panel {
    margin-top: 7px;
  }

  .duel-hand-panel .section-title {
    flex-direction: row;
    align-items: center;
    margin-bottom: 6px;
  }

  .duel-hand-panel h2,
  .duel-hand-panel .target-pill {
    display: none;
  }

  .duel-hand {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    padding: 1px 2px 5px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .duel-hand::-webkit-scrollbar {
    display: none;
  }

  .duel-card {
    flex: 0 0 112px;
    min-height: 244px;
    scroll-snap-align: start;
  }

  .match-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-items: start;
  }

  .command-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 5px;
    padding: 5px;
  }

  .command-panel > div:first-child {
    align-self: center;
  }

  .command-panel .eyebrow {
    font-size: 0.5rem;
    margin-bottom: 0;
  }

  .turn-number {
    font-size: 1.55rem;
  }

  .command-stats {
    align-self: center;
    gap: 4px;
  }

  .command-stats div {
    padding: 3px;
    border-radius: 6px;
  }

  .command-stats span {
    font-size: 0.48rem;
  }

  .command-stats strong {
    font-size: 0.82rem;
  }

  .command-panel #endTurnBtn {
    display: none;
  }

  .log-panel {
    display: none;
  }

  .board-grid {
    grid-template-columns: repeat(3, minmax(0, 44px));
    justify-content: center;
    gap: 2px;
  }

  .board-slot {
    padding: 2px;
    border-radius: 5px;
    display: block;
  }

  .match-layout > .civilization-panel {
    min-width: 0;
    padding: 4px;
  }

  .match-layout > .civilization-panel .section-title {
    margin-bottom: 3px;
  }

  .match-layout > .civilization-panel .eyebrow {
    font-size: 0.48rem;
  }

  .match-layout > .civilization-panel h2 {
    max-width: 100%;
    font-size: 0.66rem;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .match-layout > .civilization-panel .target-pill {
    display: none;
  }

  .slot-label {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 2;
    min-height: 0;
    width: auto;
    border-radius: 999px;
    padding: 1px;
    background: rgba(255, 255, 255, 0.72);
    font-size: 0;
    pointer-events: none;
  }

  .slot-icon {
    width: 8px;
    height: 8px;
  }

  .slot-empty {
    aspect-ratio: 5 / 7;
    border-radius: 4px;
    font-size: 0;
  }

  .resource-stack {
    grid-column: 1 / -1;
  }

  .resource-stack-inner {
    grid-template-columns: repeat(3, minmax(0, 44px));
    justify-content: center;
    gap: 2px;
  }

  .resource-stack > .slot-label {
    top: 3px;
    left: 3px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .target-pill {
    min-height: 30px;
    white-space: normal;
    line-height: 1.15;
  }

  .hand-panel {
    position: relative;
    z-index: 4;
    margin-top: 7px;
    margin-bottom: calc(8px + var(--safe-bottom));
    border-color: rgba(244, 234, 217, 0.24);
    background: rgba(39, 33, 25, 0.96);
    color: var(--paper-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    padding: 6px;
  }

  .hand-panel .section-title {
    flex-direction: row;
    align-items: center;
    margin-bottom: 4px;
  }

  .hand-panel .eyebrow {
    font-size: 0.5rem;
  }

  .hand-panel h2,
  .hand-panel .target-pill {
    display: none;
  }

  .hand-grid {
    display: flex;
    grid-template-columns: none;
    gap: 7px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 1px 2px 4px;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .hand-grid .game-card {
    flex: 0 0 88px;
    height: 123px;
    min-height: 0;
    scroll-snap-align: start;
  }

  .card-gallery,
  .pack-grid,
  .compact-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .reward-modal-backdrop {
    padding: 10px;
  }

  .founder-reward {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .founder-reward-copy {
    gap: 10px;
  }

  .founder-reward-copy h2 {
    padding-right: 34px;
    font-size: clamp(1.75rem, 10vw, 2.45rem);
  }

  .founder-reward-card {
    width: min(210px, 100%);
    justify-self: center;
  }

  .game-card {
    min-height: 0;
    padding: 8px;
    gap: 6px;
  }

  .game-card.has-card-image {
    min-height: 0;
  }

  .card-mode-board {
    min-height: 0;
    border-radius: 4px;
    padding: 2px;
  }

  .card-mode-board .card-body,
  .card-mode-board .stats-row,
  .card-mode-board .card-footer {
    display: none;
  }

  .card-mode-board:not(.has-card-image) .card-art {
    min-height: 22px;
  }

  .card-mode-board:not(.has-card-image) .card-name {
    font-size: 0.48rem;
    line-height: 1.05;
  }

  .card-mode-board:not(.has-card-image) .card-topline {
    justify-content: center;
  }

  .card-mode-board:not(.has-card-image) .rarity-chip {
    display: none;
  }

  .card-name {
    font-size: 0.9rem;
  }

  .card-body {
    min-height: 42px;
    font-size: 0.68rem;
    line-height: 1.22;
  }

  .card-art {
    min-height: 50px;
  }

  .stat-pill {
    padding: 3px 1px;
  }

  .stat-pill span {
    font-size: 0.49rem;
  }

  .stat-pill strong {
    font-size: 0.74rem;
  }

  .card-footer,
  .rarity-chip {
    font-size: 0.56rem;
  }

  .recipe-bar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .recipe-preset {
    flex: 0 0 220px;
    min-height: 70px;
  }

  .deck-list,
  .history-list,
  .deck-pool-grid,
  .compact-gallery,
  .combo-list {
    max-height: none;
  }

  .deck-list {
    max-height: min(380px, 46svh);
    overflow: auto;
  }

  .deck-summary .deck-balance,
  .deck-summary .deck-influence {
    display: none;
  }

  .deck-progress-head strong {
    font-size: 1.8rem;
  }

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

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

  .deck-balance-row,
  .deck-influence-row {
    grid-template-columns: 100px minmax(74px, 1fr) 24px;
  }

  .deck-list {
    gap: 5px;
  }

  .deck-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 50px;
  }

  .history-row {
    min-height: 48px;
  }

  .deck-row-copy {
    width: 32px;
    min-height: 32px;
  }

  .deck-pool-grid {
    grid-template-columns: 1fr;
    gap: 7px;
    padding-right: 0;
  }

  .deck-pick-main {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
  }

  .deck-pick-card .card-art {
    min-height: 78px;
  }

  .deck-pick-history {
    display: none;
  }

  .deck-pick-actions {
    padding: 0 7px 7px;
  }

  .deck-type-chips {
    margin-inline: -2px;
  }

  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .search-input,
  .select-input {
    width: 100%;
    min-height: 44px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .history-vault {
    min-height: auto;
  }

  .history-vault-stats,
  .board-detail-copy dl {
    grid-template-columns: 1fr;
  }

  .card-art-detail {
    width: 100%;
    min-height: 230px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 8px;
  }

  .board-card-backdrop {
    align-items: end;
    padding: 8px;
  }

  .modal-panel {
    max-height: calc(100vh - 24px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .toast {
    right: 8px;
    bottom: calc(186px + var(--safe-bottom));
    max-width: calc(100vw - 16px);
  }

  .board-card-panel {
    max-height: calc(100vh - 54px);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    padding: 10px;
  }

  .board-detail-hero {
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 172px;
    gap: 10px;
    padding: 10px;
  }

  .card-inspector-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .board-detail-hero .card-art-detail {
    min-height: 0;
    width: 118px;
  }

  .card-inspector-art .card-art-detail {
    width: 100%;
    min-height: 260px;
  }

  .card-inspector-grid,
  .card-inspector-box dl {
    grid-template-columns: 1fr;
  }

  .card-inspector-box-head {
    align-items: stretch;
    flex-direction: column;
  }

  .card-inspector-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .card-inspector-actions > div:last-child {
    display: grid;
    grid-template-columns: 1fr;
  }

  .card-inspector-actions .icon-button {
    width: 100%;
  }

  .board-detail-heading h2 {
    font-size: 1.45rem;
  }

  .board-detail-copy {
    font-size: 0.88rem;
  }

  .mobile-turn-bar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + var(--safe-bottom));
    z-index: 28;
    display: none;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(244, 234, 217, 0.24);
    border-radius: 8px;
    background: rgba(39, 33, 25, 0.96);
    color: var(--paper-strong);
    box-shadow: var(--shadow);
    padding: 7px;
    backdrop-filter: blur(12px);
  }

  .mobile-turn-bar.is-visible {
    display: grid;
  }

  .mobile-turn-bar div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    min-width: 0;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .mobile-turn-bar strong {
    font-size: 0.9rem;
  }

  .mobile-turn-bar .primary-button {
    min-height: 40px;
    width: auto;
    padding-inline: 10px;
  }
}

@media (hover: none) {
  .icon-button:hover {
    transform: none;
  }

  .game-card:hover {
    box-shadow: var(--card-shadow), var(--rarity-glow);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* Online match table: keep the multiplayer board aligned with the solo match layout. */
.online-solo-table {
  display: grid;
  gap: 12px;
}

.online-score-band {
  margin: 0;
}

.online-match-table.match-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px minmax(0, 1fr);
  grid-template-areas: none;
  align-items: stretch;
}

.online-match-table .online-table-side,
.online-match-table .online-duel-side,
.online-match-table .online-command-panel {
  grid-area: auto;
}

.online-match-table .online-table-side:nth-of-type(1),
.online-match-table .online-table-side:nth-of-type(2),
.online-match-table .online-duel-side:nth-of-type(1),
.online-match-table .online-duel-side:nth-of-type(2) {
  grid-area: auto;
}

.online-match-table .online-table-side {
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 248, 236, 0.98), rgba(244, 234, 217, 0.88)),
    repeating-linear-gradient(135deg, rgba(185, 130, 61, 0.055) 0 1px, transparent 1px 18px),
    var(--paper);
}

.online-match-table .online-table-side:first-child {
  border-color: rgba(170, 63, 54, 0.26);
}

.online-match-table .online-table-side.is-current-turn {
  box-shadow:
    var(--panel-shadow),
    0 0 0 1px rgba(29, 118, 111, 0.2),
    0 18px 42px rgba(29, 118, 111, 0.12),
    var(--inner-highlight);
}

.online-match-table .online-side-head {
  margin-bottom: 10px;
}

.online-match-table .online-side-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

.online-match-table .online-campaign-board {
  grid-template-columns: repeat(auto-fit, minmax(82px, 104px));
  justify-content: center;
}

.online-command-panel {
  min-width: 0;
}

.online-mini-piles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.online-mini-piles span {
  display: block;
  border: 1px solid rgba(244, 234, 217, 0.16);
  border-radius: 8px;
  padding: 8px;
  color: rgba(244, 234, 217, 0.72);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.online-mini-piles strong {
  display: block;
  color: var(--paper-strong);
  font-size: 1.12rem;
}

.online-command-panel .online-match-log {
  grid-area: auto;
  max-height: 340px;
  margin: 0;
  padding-top: 10px;
  border: 0;
  border-top: 1px solid rgba(244, 234, 217, 0.18);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.online-command-panel .online-match-log .log-line {
  color: rgba(244, 234, 217, 0.82);
}

.online-solo-table > .online-hand-panel {
  grid-area: auto;
}

.online-hand-panel {
  margin-top: 0;
}

.online-opponent-hand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.online-opponent-hand div {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
}

.online-opponent-hand i {
  width: 24px;
  aspect-ratio: 5 / 7;
  margin-left: -8px;
  border: 1px solid rgba(23, 22, 20, 0.2);
  border-radius: 4px;
  background-color: #171614;
  background-position: center;
  background-size: cover;
  box-shadow: 0 4px 10px rgba(23, 22, 20, 0.18);
}

.online-opponent-hand i:first-child {
  margin-left: 0;
}

.online-opponent-hand strong {
  color: var(--ink);
}

.online-hand-strip {
  display: flex;
  grid-template-columns: none;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 8px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.online-hand-card {
  flex: 0 0 152px;
  display: grid;
  gap: 7px;
  scroll-snap-align: start;
}

.online-hand-card .game-card {
  min-height: 213px;
}

.online-hand-card .icon-button {
  width: 100%;
  min-width: 0;
}

.online-duel-solo-table {
  display: grid;
  gap: 12px;
}

.online-duel-status-band {
  margin: 0;
}

.online-duel-layout {
  gap: 10px;
}

.online-duel-layout .online-duel-side,
.online-duel-layout .online-duel-log-panel {
  grid-area: auto;
}

.online-duel-layout .online-duel-side:nth-of-type(1),
.online-duel-layout .online-duel-side:nth-of-type(2) {
  grid-area: auto;
}

.online-duel-layout .online-duel-side {
  padding: 14px;
}

.online-duel-layout .online-side-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.online-duel-layout .online-duel-field {
  grid-template-columns: repeat(3, minmax(112px, 148px));
}

.online-duel-log-panel {
  max-height: none;
}

.online-duel-log-panel .duel-log {
  max-height: 112px;
}

.online-duel-hand-panel {
  margin-top: 0;
}

.online-duel-hand-panel .online-duel-hand {
  display: flex;
  grid-template-columns: none;
}

@media (max-width: 1020px) {
  .online-match-table.match-layout {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .online-match-table .online-command-panel {
    order: -1;
  }

  .online-command-panel .online-match-log {
    max-height: 180px;
  }

  .online-match-table .online-campaign-board {
    grid-template-columns: repeat(auto-fit, minmax(76px, 96px));
  }

  .online-duel-layout .online-duel-field {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .online-active-match-card {
    padding: 8px;
  }

  .online-score-band {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
  }

  .online-score-band .eyebrow {
    font-size: 0.5rem;
    margin-bottom: 3px;
  }

  .online-score-band .online-score-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px 6px;
  }

  .online-match-table.match-layout {
    gap: 7px;
  }

  .online-match-table .online-table-side,
  .online-match-table .online-command-panel {
    padding: 8px;
  }

  .online-match-table .online-table-side:first-child {
    order: 1;
  }

  .online-match-table .online-table-side:nth-of-type(2) {
    order: 2;
  }

  .online-match-table .online-command-panel {
    order: 0;
  }

  .online-match-table .online-side-head {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .online-match-table .online-side-head .eyebrow {
    font-size: 0.5rem;
  }

  .online-match-table .online-side-head h2 {
    font-size: 0.78rem;
  }

  .online-match-table .online-side-head .target-pill {
    display: inline-flex;
    min-height: 24px;
    padding: 3px 6px;
    font-size: 0.56rem;
    white-space: nowrap;
  }

  .online-match-table .online-campaign-board {
    grid-template-columns: repeat(4, minmax(58px, 1fr));
    gap: 5px;
  }

  .online-match-table .online-campaign-board .board-slot {
    padding: 4px;
    gap: 4px;
  }

  .online-match-table .online-campaign-board .slot-label {
    font-size: 0;
  }

  .online-command-panel .turn-number {
    font-size: 2.2rem;
  }

  .online-command-panel .command-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
  }

  .online-command-panel .command-stats div {
    padding: 5px;
  }

  .online-command-panel .command-stats span {
    font-size: 0.48rem;
  }

  .online-command-panel .command-stats strong {
    font-size: 0.92rem;
  }

  .online-mini-piles {
    display: none;
  }

  .online-command-panel .online-match-log {
    max-height: 104px;
    font-size: 0.68rem;
  }

  .online-hand-panel {
    position: relative;
    z-index: 4;
    margin-top: 7px;
    margin-bottom: calc(8px + var(--safe-bottom));
    border-color: rgba(244, 234, 217, 0.24);
    background: rgba(39, 33, 25, 0.96);
    color: var(--paper-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    padding: 6px;
  }

  .online-hand-panel .section-title {
    flex-direction: row;
    align-items: center;
    margin-bottom: 4px;
  }

  .online-hand-panel .eyebrow {
    color: rgba(244, 234, 217, 0.82);
    font-size: 0.5rem;
  }

  .online-hand-panel h2,
  .online-hand-panel .target-pill {
    display: none;
  }

  .online-opponent-hand {
    margin-bottom: 5px;
    color: rgba(244, 234, 217, 0.72);
    font-size: 0.54rem;
  }

  .online-opponent-hand i {
    width: 18px;
    margin-left: -7px;
  }

  .online-opponent-hand strong {
    color: var(--paper-strong);
  }

  .online-hand-strip {
    gap: 7px;
    padding: 1px 2px 4px;
  }

  .online-hand-card {
    flex: 0 0 92px;
    gap: 5px;
  }

  .online-hand-card .game-card {
    height: 129px;
    min-height: 0;
  }

  .online-hand-card .icon-button {
    min-height: 30px;
    padding: 4px;
    font-size: 0.62rem;
  }

  .online-duel-status-band {
    gap: 6px;
    margin-top: 0;
    margin-bottom: 0;
  }

  .online-duel-layout {
    gap: 7px;
  }

  .online-duel-layout .online-duel-side,
  .online-duel-log-panel,
  .online-duel-hand-panel {
    padding: 8px;
  }

  .online-duel-layout .online-duel-field {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .online-duel-layout .online-side-head {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .online-duel-layout .online-side-head .eyebrow {
    font-size: 0.5rem;
  }

  .online-duel-layout .online-side-head h2 {
    font-size: 0.78rem;
  }

  .online-duel-layout .online-side-head .target-pill {
    display: inline-flex;
    min-height: 24px;
    padding: 3px 6px;
    font-size: 0.56rem;
  }

  .online-duel-log-panel {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .online-duel-log-panel .duel-log {
    max-height: 96px;
    font-size: 0.68rem;
  }

  .online-duel-hand-panel {
    position: relative;
    z-index: 4;
    margin-top: 7px;
    margin-bottom: calc(8px + var(--safe-bottom));
    border-color: rgba(244, 234, 217, 0.24);
    background: rgba(39, 33, 25, 0.96);
    color: var(--paper-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    padding: 6px;
  }

  .online-duel-hand-panel .section-title {
    flex-direction: row;
    align-items: center;
    margin-bottom: 4px;
  }

  .online-duel-hand-panel .eyebrow {
    color: rgba(244, 234, 217, 0.82);
    font-size: 0.5rem;
  }

  .online-duel-hand-panel h2,
  .online-duel-hand-panel .target-pill {
    display: none;
  }

  .online-duel-hand-panel .duel-hand {
    gap: 7px;
    padding: 1px 2px 4px;
  }

  .online-duel-hand-panel .online-duel-hand .duel-card {
    flex: 0 0 116px;
  }
}

/* Release polish: responsive battlefields and lighter large collections. */
body.modal-open {
  overflow: hidden;
}

.progressive-load {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  border: 1px dashed rgba(23, 22, 20, 0.2);
  border-radius: 8px;
  padding: 10px;
  color: var(--muted);
  background: rgba(255, 248, 236, 0.72);
  font-size: 0.76rem;
  font-weight: 850;
}

.campaign-load {
  grid-column: 1 / -1;
}

.progress-stats {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

#collectionView > .section-title {
  padding: 4px 2px 10px;
  color: var(--paper-strong);
}

#collectionView > .section-title h2 {
  color: var(--paper-strong);
}

#collectionView > .section-title .eyebrow {
  color: var(--gold-soft);
}

.progressive-load .icon-button {
  color: var(--ink);
  border-color: rgba(23, 22, 20, 0.18);
  background: rgba(255, 255, 255, 0.58);
}

.card-gallery > .game-card,
.forum-feed > .forum-post,
.market-ledger > .market-listing {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

.deck-pool-grid > .deck-pick-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 150px;
}

.campaign-grid > .campaign-card {
  content-visibility: auto;
  contain-intrinsic-size: auto 210px;
}

.duel-layout {
  grid-template-columns: minmax(0, 1fr) 250px minmax(0, 1fr);
  align-items: start;
}

.duel-field {
  grid-auto-rows: 236px;
}

.duel-slot-empty,
.duel-hero-card {
  height: 100%;
  min-height: 0;
}

.duel-hero-card .card-art-duel {
  flex: 0 0 96px;
  height: 96px;
}

.duel-hero-card .duel-hero-main {
  gap: 3px;
  padding: 5px;
}

.duel-hero-card .duel-hero-main .eyebrow,
.duel-hero-card .duel-special-text {
  display: none;
}

.duel-hero-card .duel-hero-main h3 {
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-hero-card .duel-hp-line {
  gap: 2px;
  font-size: 0.58rem;
}

.duel-hero-card .duel-mini-track {
  height: 4px;
}

.duel-hero-card .duel-stat-row {
  gap: 3px;
}

.duel-hero-card .duel-stat-row span {
  padding: 2px;
  font-size: 0.5rem;
}

.duel-hero-card .duel-stat-row strong {
  display: inline;
  font-size: 0.7rem;
}

.duel-hero-card .duel-hero-actions {
  gap: 3px;
}

.duel-hero-card .duel-hero-actions .icon-button {
  min-height: 29px;
  padding: 3px;
  font-size: 0.58rem;
}

.duel-hero-card .duel-hero-actions svg {
  width: 13px;
  height: 13px;
}

.duel-log-panel {
  position: sticky;
  top: 138px;
  grid-template-columns: 1fr;
  max-height: 430px;
}

.duel-log-panel .duel-log {
  max-height: 260px;
}

.icon-button:active,
.tab:active,
.game-card:active,
.duel-card:active,
.deck-pick-card button:active {
  transform: translateY(0) scale(0.975);
}

@media (max-width: 1180px) {
  .score-meter-head [data-short-label] {
    font-size: 0;
  }

  .score-meter-head [data-short-label]::after {
    content: attr(data-short-label);
    font-size: 0.56rem;
  }
}

@media (min-width: 1181px) {
  .match-layout .board-grid {
    grid-template-columns: repeat(4, minmax(78px, 90px));
  }

  .match-layout .resource-stack-inner {
    grid-template-columns: repeat(3, minmax(78px, 90px));
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .score-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
  }

  .score-meter-head {
    gap: 2px;
    font-size: 0.6rem;
  }

  .match-layout {
    grid-template-columns: minmax(0, 1fr) 210px minmax(0, 1fr);
    gap: 7px;
  }

  .match-layout > .command-panel {
    order: 0;
    position: sticky;
    top: 126px;
    align-self: start;
    gap: 8px;
    padding: 8px;
  }

  .match-layout > .civilization-panel {
    min-width: 0;
    padding: 8px;
  }

  .match-layout .board-grid,
  .match-layout .resource-stack-inner {
    grid-template-columns: repeat(3, minmax(56px, 78px));
    gap: 4px;
  }

  .match-layout .board-slot {
    gap: 4px;
    padding: 4px;
  }

  .match-layout .slot-label {
    gap: 3px;
    font-size: 0.55rem;
  }

  .match-layout .slot-icon {
    width: 12px;
    height: 12px;
  }

  .match-layout .compact-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .match-layout .target-pill {
    min-height: 24px;
    padding: 3px 7px;
    font-size: 0.62rem;
    white-space: normal;
  }

  .match-layout .turn-number {
    font-size: 2.25rem;
  }

  .match-layout .command-stats div {
    padding: 5px;
  }

  .match-layout .command-stats strong {
    font-size: 1rem;
  }

  .match-layout .discard-piles {
    gap: 5px;
    margin: 3px 0;
  }

  .match-layout .discard-pile-box {
    padding: 5px;
  }

  .match-layout .discard-pile-stack {
    max-height: 112px;
  }

  .match-layout .log-panel {
    min-height: 98px;
    max-height: 150px;
  }

  .hand-grid {
    display: flex;
    grid-template-columns: none;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 2px 7px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .hand-grid .game-card {
    flex: 0 0 124px;
    height: 174px;
    min-height: 0;
    scroll-snap-align: start;
  }

  .duel-status-band {
    grid-template-columns: minmax(155px, 0.7fr) minmax(300px, 1.35fr) minmax(155px, 0.7fr);
  }

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

  .duel-board-panel.rival {
    order: 1;
  }

  .duel-board-panel.player {
    order: 2;
  }

  .duel-log-panel {
    position: static;
    order: 3;
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 0.4fr) minmax(0, 1fr);
    max-height: 180px;
  }

  .duel-field {
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    grid-auto-rows: 220px;
    gap: 6px;
  }

  .duel-slot-empty,
  .duel-hero-card {
    height: 100%;
    min-height: 0;
  }

  .duel-hero-card .card-art-duel {
    flex-basis: 82px;
    height: 82px;
  }

  .duel-hero-card .duel-hero-main {
    gap: 3px;
    padding: 4px 5px;
  }

  .duel-hero-card .duel-hero-main .eyebrow {
    display: none;
  }

  .duel-hero-card .duel-hero-main h3 {
    overflow: hidden;
    font-size: 0.72rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .duel-hero-card .duel-hp-line {
    gap: 2px;
    font-size: 0.56rem;
  }

  .duel-hero-card .duel-mini-track {
    height: 4px;
  }

  .duel-hero-card .duel-stat-row {
    gap: 3px;
  }

  .duel-hero-card .duel-stat-row span {
    padding: 2px;
    font-size: 0.5rem;
  }

  .duel-hero-card .duel-stat-row strong {
    display: inline;
    font-size: 0.68rem;
  }

  .duel-hero-card .duel-hero-actions {
    gap: 3px;
  }

  .duel-hero-card .duel-hero-actions .icon-button {
    min-height: 29px;
    padding: 3px;
    font-size: 0.58rem;
  }

  .duel-hero-card .duel-hero-actions svg {
    width: 13px;
    height: 13px;
  }

  .duel-hero-card .duel-special-text {
    display: none;
  }

  .duel-hero-main,
  .duel-card-copy {
    padding: 6px;
  }

  .duel-hand {
    scroll-snap-type: x proximity;
  }
}

@media (max-width: 760px) {
  .mode-tabs {
    top: 48px;
    z-index: 17;
  }

  .progressive-load {
    flex-direction: column;
    gap: 7px;
    min-height: 76px;
  }

  .progressive-load .icon-button {
    width: min(220px, 100%);
  }

  .score-meter-head [data-short-label]::after {
    font-size: 0.42rem;
  }

  .campaign-overview {
    padding: 10px;
  }

  .campaign-overview .progress-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .campaign-overview .progress-card {
    min-height: 74px;
    padding: 9px;
  }

  .campaign-overview .progress-card span {
    font-size: 0.57rem;
  }

  .campaign-overview .progress-card strong {
    font-size: 1.35rem;
  }

  .combo-journal {
    padding: 10px;
  }

  .combo-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .combo-item {
    padding: 9px;
  }

  .combo-item p {
    font-size: 0.7rem;
    line-height: 1.28;
  }

  .deck-pool-grid {
    max-height: min(640px, 68svh);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
  }

  .command-panel {
    align-items: center;
  }

  .command-panel .discard-piles {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 4px;
    margin: 0;
  }

  .command-panel .discard-pile-box {
    min-width: 0;
    padding: 4px;
  }

  .command-panel .discard-pile-head {
    margin-bottom: 3px;
  }

  .command-panel .discard-pile-head span,
  .command-panel .discard-empty {
    font-size: 0.52rem;
  }

  .command-panel .discard-pile-head strong {
    min-width: 20px;
    padding: 1px 5px;
    font-size: 0.6rem;
  }

  .command-panel .discard-pile-stack {
    max-height: 36px;
    overflow: hidden;
  }

  .command-panel .discard-card-chip {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 32px;
    gap: 4px;
    padding: 2px;
  }

  .command-panel .discard-card-chip:not(.is-top-card) {
    display: none;
  }

  .command-panel .discard-card-chip .card-art-mini {
    width: 24px;
    min-height: 29px;
  }

  .command-panel .discard-card-chip strong {
    font-size: 0.6rem;
  }

  .command-panel .discard-card-chip small {
    display: none;
  }

  .hand-panel {
    margin-bottom: calc(76px + var(--safe-bottom));
  }

  body[data-active-view="matchView"] .toast {
    bottom: calc(76px + var(--safe-bottom));
  }

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

  .duel-status-band .duel-health-card:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .duel-status-band .duel-health-card:last-child {
    grid-column: 2;
    grid-row: 1;
  }

  .duel-status-band .duel-command-card {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .duel-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .duel-board-panel.rival {
    order: 1;
  }

  .duel-board-panel.player {
    order: 2;
  }

  .duel-log-panel {
    position: static;
    order: 3;
    grid-column: 1 / -1;
    max-height: 116px;
  }

  .duel-board-panel {
    min-width: 0;
    padding: 5px;
  }

  .duel-board-panel .section-title {
    min-height: 40px;
    margin-bottom: 4px;
    gap: 3px;
  }

  .duel-board-panel .eyebrow {
    font-size: 0.48rem;
  }

  .duel-board-panel h2 {
    font-size: 0.7rem;
  }

  .duel-board-panel .target-pill {
    min-height: 22px;
    padding: 2px 5px;
    font-size: 0.54rem;
  }

  .duel-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 142px;
    gap: 4px;
  }

  .duel-slot-empty,
  .duel-hero-card {
    height: 100%;
    min-height: 0;
  }

  .duel-slot-empty {
    font-size: 0;
  }

  .duel-slot-empty span {
    width: 18px;
    height: 4px;
    border: 0;
    padding: 0;
    background: rgba(23, 22, 20, 0.12);
    font-size: 0;
  }

  .duel-hero-card .card-art-duel {
    flex: 0 0 50px;
    height: 50px;
  }

  .duel-hero-card .duel-hero-main {
    gap: 2px;
    padding: 4px;
  }

  .duel-hero-main .eyebrow,
  .duel-special-text {
    display: none;
  }

  .duel-hero-main h3 {
    overflow: hidden;
    font-size: 0.62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .duel-hp-line {
    gap: 2px;
    font-size: 0.52rem;
  }

  .duel-mini-track {
    height: 4px;
  }

  .duel-hero-card .duel-stat-row {
    gap: 2px;
  }

  .duel-hero-card .duel-stat-row span {
    padding: 2px 1px;
    font-size: 0.46rem;
  }

  .duel-hero-card .duel-stat-row strong {
    display: inline;
    font-size: 0.62rem;
  }

  .duel-hero-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }

  .duel-hero-card .duel-hero-actions .icon-button {
    min-height: 24px;
    padding: 2px;
  }

  .duel-hero-actions .icon-button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .duel-hero-actions .icon-button svg {
    width: 14px;
    height: 14px;
  }

  .duel-log-panel .section-title {
    display: none;
  }

  .duel-log-panel .duel-log {
    max-height: 88px;
  }

  .duel-hand-panel {
    margin-bottom: calc(10px + var(--safe-bottom));
  }

  .card-inspector-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin-inline: -2px;
    box-shadow: 0 -12px 24px rgba(23, 22, 20, 0.12);
  }

  .card-inspector-actions > div:last-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-turn-bar {
    left: 6px;
    right: 6px;
    bottom: calc(4px + var(--safe-bottom));
  }

  .battle-fx-scene {
    grid-template-columns: 84px 36px 84px;
    width: min(310px, calc(100vw - 20px));
    padding: 7px;
  }

  .battle-fx-card .game-card {
    min-height: 118px;
  }

  .battle-fx-burst {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 420px) {
  .app-topbar {
    gap: 5px;
  }

  .top-actions {
    gap: 3px;
  }

  .top-actions .icon-button {
    width: 33px;
    min-width: 33px;
  }

  .board-grid,
  .resource-stack-inner {
    grid-template-columns: repeat(3, minmax(0, 42px));
  }

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