:root {
  color-scheme: dark;
  --bg: #0c1013;
  --bg-2: #12191f;
  --panel: #171f26;
  --panel-2: #202a33;
  --surface: #0f151a;
  --ink: #f5f7fb;
  --muted: #a9b4bf;
  --faint: #758290;
  --line: #303b45;
  --accent: #f59e0b;
  --accent-2: #2dd4bf;
  --accent-3: #8b5cf6;
  --danger: #fb7185;
  --ok: #84cc16;
  --shadow: 0 18px 44px rgb(0 0 0 / 34%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #0c1013 0%, #10171d 48%, #0c1013 100%),
    var(--bg);
  color: var(--ink);
}

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

h1,
h2,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input,
textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #10161b;
  color: var(--ink);
}

button {
  min-height: 38px;
  cursor: pointer;
  padding: 0 14px;
  font-weight: 780;
}

button:hover,
select:hover,
input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 0 10px;
  font-weight: 560;
}

textarea {
  min-height: 108px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: var(--faint);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px clamp(16px, 5vw, 58px);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  background: rgb(12 16 19 / 88%);
  backdrop-filter: blur(16px);
}

.site-brand {
  color: #fff;
  font-size: 18px;
  font-weight: 920;
  letter-spacing: 0;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.site-nav a,
.hero-actions a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.site-nav a {
  padding: 0 12px;
}

.site-nav a:hover,
.site-nav a.active {
  border-color: rgb(245 158 11 / 42%);
  background: rgb(245 158 11 / 10%);
  color: #fff;
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-actions a,
.site-actions button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #10161b;
  color: var(--muted);
  font-size: 13px;
  font-weight: 840;
}

.site-actions .auth-unconfigured,
.provider-list .auth-unconfigured {
  opacity: 0.64;
  border-style: dashed;
}

.site-actions a:hover,
.site-actions button:hover {
  border-color: rgb(245 158 11 / 48%);
  color: #fff;
}

.profile-link[data-avatar]::before {
  width: 22px;
  height: 22px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--avatar-url) center / cover;
  content: "";
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.74fr) minmax(420px, 1.26fr);
  gap: clamp(24px, 5vw, 72px);
  min-height: calc(100svh - 128px);
  overflow: hidden;
  padding: clamp(42px, 8vw, 96px) clamp(16px, 5vw, 70px) 42px;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, rgb(255 255 255 / 4%) 1px, transparent 1px),
    linear-gradient(rgb(255 255 255 / 3%) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(90deg, black 0%, rgb(0 0 0 / 68%) 45%, transparent 100%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  gap: 22px;
  max-width: 500px;
}

.hero-copy h1 {
  color: #fff;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.88;
}

.hero-kicker {
  max-width: 44rem;
  color: #d7dee7;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.42;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions a {
  min-width: 92px;
  padding: 0 16px;
  border-color: var(--line);
  background: rgb(15 21 26 / 76%);
}

.hero-actions a:hover,
.hero-actions .primary-link {
  border-color: rgb(245 158 11 / 55%);
  background: rgb(245 158 11 / 13%);
  color: #fff;
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, min(38vw, 420px)) minmax(210px, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(14px, 2vw, 22px);
  align-items: center;
  min-height: clamp(500px, 66vh, 780px);
  perspective: 1100px;
}

.hero-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 190px));
  gap: clamp(10px, 1.6vw, 18px);
  align-content: center;
  justify-content: start;
  min-width: 0;
}

.hero-featured-card,
.hero-card {
  --card-opacity: 0.56;
  position: relative;
  display: block;
  width: 100%;
  max-width: 190px;
  aspect-ratio: 744 / 1039;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 4.6% / 3.5%;
  background: #07090b;
  box-shadow:
    0 34px 88px rgb(0 0 0 / 50%),
    0 0 46px rgb(45 212 191 / 10%);
  animation: hero-float 9s ease-in-out infinite;
  animation-delay: var(--hero-delay, 0s);
}

.hero-featured-card {
  grid-row: span 2;
  justify-self: end;
  max-width: min(38vw, 420px);
  --foil-base-transform: rotate(-2deg);
  box-shadow:
    0 48px 118px rgb(0 0 0 / 62%),
    0 0 78px rgb(45 212 191 / 18%),
    0 0 92px rgb(245 158 11 / 18%);
}

.hero-card img,
.hero-featured-card img,
.deck-thumb img,
.image-wrap img,
.detail-image-shell img {
  position: relative;
  z-index: 1;
}

.hero-featured-card img,
.hero-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-featured-caption,
.hero-card span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 7;
  padding: 4px 7px;
  border-radius: 7px;
  background: rgb(5 8 10 / 72%);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.hero-featured-caption {
  left: 14px;
  right: 14px;
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid rgb(255 255 255 / 14%);
  background: rgb(5 8 10 / 78%);
}

.hero-featured-caption strong {
  color: #fff;
  font-size: 15px;
}

.hero-featured-caption small {
  color: #fde68a;
  font-size: 11px;
  font-weight: 850;
}

.hero-card-1 {
  z-index: 6;
  --foil-base-transform: rotate(6deg);
  box-shadow:
    0 28px 76px rgb(0 0 0 / 50%),
    0 0 42px rgb(45 212 191 / 12%),
    0 0 52px rgb(245 158 11 / 12%);
}

.hero-card-2 {
  z-index: 4;
  --foil-base-transform: rotate(-8deg);
}

.hero-card-3 {
  z-index: 3;
  --foil-base-transform: rotate(-5deg);
}

.hero-card-4 {
  z-index: 2;
  --foil-base-transform: rotate(9deg);
}

.hero-card-5 {
  z-index: 1;
  --foil-base-transform: rotate(3deg);
}

.hero-meter {
  grid-column: 2;
  align-self: end;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 8px;
  background: rgb(12 16 19 / 74%);
  backdrop-filter: blur(14px);
}

.hero-meter span {
  display: grid;
  gap: 4px;
  padding: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hero-meter span + span {
  border-left: 1px solid rgb(255 255 255 / 8%);
}

.hero-meter strong {
  color: #fff;
  font-size: clamp(20px, 3vw, 32px);
}

.landing-routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.landing-routes a {
  display: grid;
  gap: 8px;
  min-height: 116px;
  align-content: center;
  padding: 24px clamp(18px, 4vw, 44px);
  background: #11181e;
}

.landing-routes a:hover {
  background: #172129;
}

.landing-routes span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.landing-routes strong {
  color: #fff;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.2;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.layout {
  display: grid;
  gap: 22px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 5vw, 56px) 48px;
}

.page-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.page-head.compact {
  align-items: center;
}

.page-head h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 0.95;
}

.page-head.compact h1 {
  font-size: clamp(30px, 4vw, 44px);
}

#summary,
#deckSummary,
#boardSummary {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) repeat(5, minmax(126px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  box-shadow: 0 10px 28px rgb(0 0 0 / 18%);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.check {
  grid-template-columns: 18px 1fr;
  align-items: center;
  color: var(--ink);
  text-transform: none;
  font-size: 13px;
  font-weight: 760;
}

.check input {
  width: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.reset-button {
  align-self: end;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 24px 14px;
}

.card {
  display: grid;
  min-width: 0;
  border-radius: 8px;
  color: var(--ink);
}

.card button {
  display: grid;
  gap: 10px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.image-wrap,
.detail-image-shell,
.deck-thumb {
  --pointer-x: 50%;
  --pointer-y: 42%;
  --pointer-from-center: 0.18;
  --pointer-from-left: 0.5;
  --pointer-from-top: 0.42;
  --background-x: 50%;
  --background-y: 50%;
  --card-opacity: 0.12;
  --foil-rotate-x: 0deg;
  --foil-rotate-y: 0deg;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #05080a;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #0a0d10, #29313a 48%, #050607),
    #171d23;
  box-shadow:
    0 16px 34px rgb(0 0 0 / 42%),
    0 0 0 1px rgb(255 255 255 / 4%);
}

.image-wrap {
  display: grid;
  aspect-ratio: 744 / 1039;
  place-items: center;
}

.image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-wrap.is-landscape img {
  width: 140%;
  height: 71.5%;
  object-fit: fill;
  transform: rotate(90deg);
}

.card.is-foil-card .image-wrap,
.detail-image-shell.is-foil-detail {
  border-color: color-mix(in srgb, var(--accent) 24%, #05080a);
}

.card.is-premium-foil .image-wrap {
  box-shadow:
    0 18px 42px rgb(0 0 0 / 48%),
    0 0 24px rgb(245 158 11 / 12%);
}

.foil-surface {
  contain: paint;
  transform:
    perspective(var(--foil-perspective, 860px))
    var(--foil-base-transform, translateZ(0))
    rotateX(var(--foil-rotate-x))
    rotateY(var(--foil-rotate-y));
  transform-style: preserve-3d;
  transition:
    transform 260ms ease,
    box-shadow 260ms ease,
    filter 260ms ease;
}

.foil-surface.is-foil-active {
  will-change: transform;
}

.foil-surface.is-foil-active .foil-spectrum {
  opacity: calc(0.11 + (var(--card-opacity) * 0.28));
}

.foil-surface.is-foil-active .foil-glare {
  opacity: calc(0.06 + (var(--card-opacity) * 0.18));
}

.foil-compact.is-foil-active .foil-wash {
  opacity: calc(0.18 + (var(--card-opacity) * 0.26));
}

.foil-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  contain: paint;
  pointer-events: none;
  transform: translateZ(1px);
  transition:
    opacity 150ms ease,
    background-position 100ms ease;
}

.foil-compact .foil-layer {
  transform: translateZ(0);
  transition: opacity 120ms ease;
}

.foil-wash {
  z-index: 2;
  opacity: calc(0.075 + (var(--card-opacity) * 0.14));
  background-image:
    radial-gradient(
      farthest-corner circle at var(--pointer-x) var(--pointer-y),
      rgb(255 255 255 / 40%) 0%,
      rgb(255 255 255 / 12%) 24%,
      transparent 56%
    ),
    radial-gradient(circle at 18% 20%, rgb(94 222 255 / 32%) 0%, transparent 48%),
    radial-gradient(circle at 86% 30%, rgb(255 128 232 / 30%) 0%, transparent 46%),
    radial-gradient(circle at 46% 88%, rgb(255 220 110 / 26%) 0%, transparent 54%);
  background-size: cover;
  background-position: center;
  background-blend-mode: screen;
  mix-blend-mode: screen;
}

.foil-spectrum {
  z-index: 2;
  opacity: calc(0.055 + (var(--card-opacity) * 0.18));
  background-image:
    radial-gradient(
      farthest-corner circle at calc(var(--pointer-x) * 0.78) calc(var(--pointer-y) * 0.84),
      rgb(255 246 186 / 28%) 0%,
      rgb(255 246 186 / 8%) 30%,
      transparent 66%
    ),
    radial-gradient(circle at 22% 24%, rgb(98 232 255 / 24%) 0%, transparent 52%),
    radial-gradient(circle at 78% 34%, rgb(255 118 220 / 20%) 0%, transparent 52%);
  background-size: cover, 150% 150%, 140% 140%;
  background-position:
    center,
    var(--background-x) var(--background-y),
    calc(100% - var(--background-x)) calc(100% - var(--background-y));
  background-blend-mode: screen, screen, screen;
  mix-blend-mode: screen;
}

.foil-sparkle {
  z-index: 4;
  opacity: calc(0.012 + (var(--card-opacity) * 0.09));
  background-image:
    radial-gradient(circle at 13% 18%, rgb(255 255 255 / 58%) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 22%, rgb(255 246 184 / 48%) 0 1px, transparent 2.2px),
    radial-gradient(circle at 41% 72%, rgb(132 245 255 / 46%) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 54%, rgb(255 180 245 / 48%) 0 1px, transparent 2px),
    radial-gradient(
      farthest-corner circle at var(--pointer-x) var(--pointer-y),
      rgb(255 255 255 / 22%) 0%,
      transparent 38%
    );
  background-size:
    92px 128px,
    130px 94px,
    118px 150px,
    154px 118px,
    cover;
  background-position:
    calc(var(--background-x) * -0.35) calc(var(--background-y) * -0.25),
    var(--background-y) var(--background-x),
    calc(100% - var(--background-x)) var(--background-y),
    var(--background-x) calc(100% - var(--background-y)),
    center;
  mix-blend-mode: screen;
}

.foil-glare {
  z-index: 5;
  opacity: calc(0.025 + (var(--card-opacity) * (0.08 + var(--pointer-from-center) * 0.08)));
  background-image:
    radial-gradient(
      farthest-corner circle at var(--pointer-x) var(--pointer-y),
      rgb(255 255 255 / 46%) 0%,
      rgb(255 255 255 / 13%) 18%,
      transparent 48%
    );
  background-size: cover;
  background-position: center;
  mix-blend-mode: overlay;
}

.foil-premium .foil-spectrum {
  opacity: calc(0.08 + (var(--card-opacity) * 0.22));
}

.foil-premium .foil-wash {
  opacity: calc(0.05 + (var(--card-opacity) * 0.14));
}

@media (prefers-reduced-motion: no-preference) {
  .hero-card.foil-premium:not(.is-foil-active) .foil-spectrum {
    animation: foil-drift 16s linear infinite;
  }

  .foil-only-name {
    animation: foil-name-flow 5.2s ease-in-out infinite;
  }
}

.card-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.card-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-title strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title strong.foil-only-name {
  display: -webkit-box;
  line-height: 1.16;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.foil-only-name {
  background-image: linear-gradient(
    96deg,
    #fef08a 0%,
    #22d3ee 14%,
    #a78bfa 30%,
    #fb7185 46%,
    #34d399 62%,
    #f59e0b 78%,
    #fef08a 100%
  );
  background-size: 220% 100%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 16px rgb(103 232 249 / 14%);
}

.is-foil-only .image-wrap {
  border-color: rgb(245 158 11 / 42%);
}

.cost {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #05080a;
  color: #fff7cc;
  font-weight: 850;
}

.meta,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill,
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #26303a;
  color: #dbe3ec;
  font-size: 12px;
  font-weight: 750;
}

.foil-pill {
  background: linear-gradient(110deg, #fef08a, #93c5fd, #f9a8d4, #86efac);
  color: #161a1f;
}

.chip.Body {
  background: #435c37;
}

.chip.Calm {
  background: #225d69;
}

.chip.Chaos {
  background: #6b2f64;
}

.chip.Colorless {
  background: #48515a;
}

.chip.Fury {
  background: #88421f;
}

.chip.Mind {
  background: #3c3d8f;
}

.chip.Order {
  background: #806719;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.card-id {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-price {
  color: #fff;
  font-weight: 850;
  white-space: nowrap;
}

.foil-price {
  color: #fde68a;
}

.effect,
.detail-effect {
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-line;
}

.empty {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.compact-empty {
  padding: 18px;
}

.rb-symbol {
  display: inline-grid;
  width: 1.35em;
  height: 1.35em;
  place-items: center;
  margin: 0 0.08em;
  border: 1px solid rgb(244 247 251 / 22%);
  border-radius: 999px;
  background: #05080a;
  color: #fffdf8;
  font-size: 0.82em;
  font-weight: 900;
  line-height: 1;
  vertical-align: -0.16em;
}

.rb-symbol.might {
  background: #202020;
  color: #fef08a;
}

.rb-symbol.exhaust {
  background: #d6deea;
  color: #10161b;
}

.rb-symbol.energy {
  background: #164e63;
  color: #ecfeff;
}

.rb-symbol.rune.body {
  background: #596d45;
}

.rb-symbol.rune.calm {
  background: #2f7f91;
}

.rb-symbol.rune.chaos {
  background: #7c3a72;
}

.rb-symbol.rune.fury {
  background: #9a3412;
}

.rb-symbol.rune.mind {
  background: #4f46e5;
}

.rb-symbol.rune.order {
  background: #b08918;
}

.rb-symbol.rune.rainbow {
  background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #d946ef, #ef4444);
}

dialog {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / 48%);
}

dialog::backdrop {
  background: rgb(3 6 8 / 72%);
}

.icon-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #10161b;
}

.detail {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 24px;
  padding: 24px;
}

.detail.has-landscape {
  grid-template-columns: minmax(430px, 1.25fr) minmax(280px, 0.75fr);
}

.detail-images {
  display: grid;
  gap: 12px;
}

.detail-images img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
}

.detail-image-shell.is-landscape img {
  aspect-ratio: 1039 / 744;
}

.detail-copy {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-right: 28px;
}

.detail-copy h2 {
  color: #fff;
  font-size: 30px;
  line-height: 1.1;
}

.detail-copy p {
  line-height: 1.5;
}

.price {
  color: var(--accent);
  font-weight: 850;
}

.banned {
  color: var(--danger);
}

.deck-workspace {
  display: grid;
  grid-template-columns: minmax(390px, 0.95fr) minmax(420px, 1fr) minmax(360px, 430px);
  align-items: start;
  gap: 16px;
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 44px) 48px;
}

.deck-board {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 16px;
  min-width: 0;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(23 31 38 / 84%);
}

.deck-browser,
.deck-panel,
.card-inspector,
.community-side,
.post-composer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(23 31 38 / 84%);
}

.deck-browser {
  position: sticky;
  top: 76px;
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 18px;
}

.deck-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.deck-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.deck-result {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #11181e;
}

.deck-result.selected {
  border-color: rgb(245 158 11 / 55%);
  background: rgb(245 158 11 / 9%);
}

.deck-thumb {
  width: 64px;
  aspect-ratio: 744 / 1039;
  border-radius: 6px;
}

.deck-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.deck-result-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.deck-result-copy strong,
.deck-result-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-result-copy strong {
  color: #fff;
  font-size: 14px;
}

.deck-result-copy > span {
  color: var(--muted);
  font-size: 12px;
}

.deck-row-controls {
  display: flex;
  gap: 6px;
}

.deck-row-controls button,
.deck-line button {
  width: 38px;
  min-height: 34px;
  padding: 0;
}

.deck-panel {
  position: sticky;
  top: 76px;
  display: grid;
  align-content: start;
  gap: 14px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 16px;
}

.deck-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.deck-panel h2,
.community-side h2 {
  color: #fff;
  font-size: 22px;
}

.ghost-button {
  background: transparent;
}

.deck-stats,
.board-counts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.deck-stats span,
.board-counts span {
  display: grid;
  gap: 3px;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.deck-stats span + span,
.board-counts span + span {
  border-left: 1px solid var(--line);
}

.deck-stats strong,
.board-counts strong {
  color: #fff;
  font-size: 22px;
}

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

.deck-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161b;
}

.deck-rules span {
  display: grid;
  gap: 2px;
  padding: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.deck-rules span + span {
  border-left: 1px solid var(--line);
}

.deck-rules strong {
  color: #fff;
  font-size: 18px;
}

.deck-validation {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
}

.deck-validation span,
.deck-validation .ok {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.deck-validation .error {
  border-color: rgb(251 113 133 / 44%);
  color: #fecdd3;
}

.deck-validation .warning {
  border-color: rgb(245 158 11 / 44%);
  color: #fde68a;
}

.deck-validation .ok {
  border-color: rgb(132 204 22 / 44%);
  color: #d9f99d;
}

.saved-deck-bar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #10161b;
}

.saved-deck-bar label {
  min-width: 0;
}

.saved-deck-bar input,
.saved-deck-bar select {
  min-height: 38px;
}

.saved-deck-bar button {
  min-height: 38px;
}

.saved-deck-status {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

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

.deck-list-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: start;
}

.deck-list-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  background: #10161b;
}

.deck-list-group-head,
.deck-list-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deck-list-group-head h2 {
  color: #fff;
  font-size: 18px;
}

.deck-list-group-head span,
.deck-list-subhead span {
  color: #fde68a;
  font-size: 12px;
  font-weight: 850;
}

.deck-list-compact {
  display: grid;
  gap: 12px;
}

.deck-list-subsection {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.deck-list-subhead h3 {
  color: #dbe3ec;
  font-size: 13px;
}

.deck-list-rows {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.deck-list-row {
  display: grid;
  grid-template-columns: 42px minmax(92px, 1.2fr) minmax(82px, 0.7fr) 32px 32px;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #11181e;
  cursor: pointer;
}

.deck-list-row span,
.deck-list-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-list-row strong {
  color: #fff;
}

.deck-list-row span {
  color: #dbe3ec;
  font-weight: 780;
}

.deck-list-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.deck-list-row button {
  width: 32px;
  min-height: 30px;
  padding: 0;
}

.deck-section {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #10161b;
}

.deck-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deck-section-title h2 {
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
}

.deck-section-title span,
.deck-section-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.deck-lines {
  display: grid;
  gap: 7px;
  max-height: 340px;
  overflow: auto;
}

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

.deck-line {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px 34px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #10161b;
}

.deck-line span {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-line strong {
  color: #fff;
}

.preview-deck-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-deck-status span {
  display: grid;
  gap: 2px;
  padding: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
}

.preview-deck-status span + span {
  border-left: 1px solid var(--line);
}

.preview-deck-status strong {
  color: #fff;
  font-size: 18px;
}

.preview-rules {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #10161b;
}

.preview-rules h3 {
  color: #fff;
  font-size: 14px;
}

.preview-flavor {
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
}

.deck-io {
  display: grid;
  align-content: start;
  gap: 10px;
}

.deck-io button,
.draw-actions button {
  align-self: start;
  min-height: 40px;
}

.deck-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.draw-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #10161b;
}

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

.draw-actions h2,
.draw-group h3 {
  color: #fff;
  font-size: 16px;
}

.draw-output {
  display: grid;
  gap: 12px;
}

.draw-group {
  display: grid;
  gap: 8px;
}

.draw-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 8px;
}

.draw-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #11181e;
  cursor: pointer;
}

.draw-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draw-thumb {
  width: 100%;
  aspect-ratio: 744 / 1039;
  overflow: hidden;
  border-radius: 6px;
}

.draw-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-inspector {
  position: sticky;
  top: 76px;
  display: grid;
  align-content: start;
  min-width: 0;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 16px;
}

.card-preview-inner {
  display: grid;
  gap: 14px;
}

.card-preview-image {
  width: min(100%, 330px);
  aspect-ratio: 744 / 1039;
  overflow: hidden;
  justify-self: center;
  border-radius: 7px;
  background: #06080a;
}

.card-preview-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-preview-copy {
  display: grid;
  gap: 12px;
}

.card-preview-copy h2 {
  color: #fff;
  font-size: 24px;
  line-height: 1.12;
}

.detail-effect {
  color: #dbe3ec;
  line-height: 1.48;
  white-space: pre-line;
}

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

.warnings {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-line;
}

.auto-load-sentinel {
  width: 100%;
  min-height: 1px;
  margin: 1px 0 32px;
  pointer-events: none;
}

.community-frame {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 290px;
  gap: 18px;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 44px) 48px;
}

.board-rail {
  position: sticky;
  top: 76px;
  display: grid;
  align-content: start;
  gap: 8px;
  height: fit-content;
}

.board-tab {
  justify-content: start;
  background: #11181e;
  text-align: left;
}

.board-tab.active {
  border-color: rgb(245 158 11 / 52%);
  background: rgb(245 158 11 / 13%);
  color: #fff;
}

.feed {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.post-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
}

.post-composer input,
.post-composer textarea {
  grid-column: 1 / 2;
}

.post-composer button {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  min-width: 78px;
  height: 100%;
}

.media-drop {
  grid-column: 1 / 2;
  display: grid;
  min-height: 86px;
  align-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed rgb(255 255 255 / 18%);
  border-radius: 8px;
  background: rgb(16 22 27 / 74%);
  color: var(--muted);
  cursor: pointer;
}

.media-drop:hover,
.media-drop.dragging {
  border-color: rgb(245 158 11 / 58%);
  color: #fff;
}

.media-drop input {
  display: none;
}

.media-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.media-status[data-tone="error"] {
  color: #fca5a5;
}

.media-status[data-tone="d1-inline"] {
  color: #facc15;
}

.media-preview,
.post-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.media-preview-item,
.post-media-item {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 8px;
  background: #080b0e;
}

.media-preview-item img,
.media-preview-item video,
.post-media-item img,
.post-media-item video {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.post-list {
  display: grid;
  gap: 10px;
}

.post {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #11181e;
}

.vote-stack {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-right: 1px solid var(--line);
  color: #fff;
}

.vote-stack button {
  width: 30px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.vote-stack button:hover {
  color: var(--accent);
}

.post-body {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 13px 14px 14px 0;
}

.post-body h2 {
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 17px;
  line-height: 1.25;
}

.post-body p {
  color: #dbe3ec;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.post-meta {
  color: var(--muted);
  font-size: 12px;
}

.community-side {
  position: sticky;
  top: 76px;
  display: grid;
  align-content: start;
  gap: 14px;
  height: fit-content;
  padding: 16px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: keep-all;
}

.profile-frame {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) repeat(2, minmax(280px, 360px));
  gap: 18px;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 44px) 48px;
}

.profile-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(23 31 38 / 84%);
}

.profile-form {
  display: grid;
  gap: 12px;
}

.profile-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 840;
}

.avatar-uploader {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.avatar-preview {
  width: 112px;
  height: 112px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #10161b;
}

.avatar-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.provider-list {
  display: grid;
  gap: 10px;
}

.provider-list > a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #10161b;
  color: #fff;
  font-weight: 840;
}

.provider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #10161b;
}

.provider-row strong {
  color: #fff;
}

.provider-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.provider-row span,
.setup-row span,
.setup-row code,
.profile-status {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.setup-list {
  display: grid;
  gap: 10px;
}

.setup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 8px;
  background: #10161b;
}

.setup-row > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.setup-row strong {
  color: #fff;
}

.setup-row code {
  font-family: inherit;
  color: #cbd5e1;
}

.setup-row[data-tone="ready"] > span {
  color: #86efac;
}

.setup-row[data-tone="warning"] > span {
  color: #facc15;
}

@media (max-width: 1120px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-stage {
    min-height: 560px;
  }

  .deck-workspace,
  .community-frame,
  .profile-frame {
    grid-template-columns: 1fr;
  }

  .deck-board,
  .deck-browser,
  .deck-panel,
  .card-inspector,
  .board-rail,
  .community-side {
    position: static;
    max-height: none;
  }

  .deck-rules,
  .saved-deck-bar,
  .deck-list-top,
  .deck-sections,
  .deck-tools {
    grid-template-columns: 1fr 1fr;
  }

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

@media (max-width: 980px) {
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .site-header,
  .page-head {
    align-items: start;
  }

  .site-header {
    display: grid;
  }

  .site-actions {
    width: 100%;
    overflow-x: auto;
  }

  .site-nav {
    width: 100%;
    overflow-x: auto;
  }

  .detail,
  .detail.has-landscape {
    grid-template-columns: 1fr;
  }

  .landing-routes {
    grid-template-columns: 1fr;
  }

  .hero-meter {
    left: 0;
    right: 0;
  }
}

@media (max-width: 640px) {
  .layout,
  .deck-workspace,
  .community-frame {
    padding-inline: 12px;
  }

  .hero {
    padding-inline: 14px;
  }

  .hero-stage {
    min-height: 460px;
  }

  .hero-card-1 {
    left: 50%;
  }

  .hero-card-2 {
    left: 76%;
  }

  .hero-card-3 {
    left: 20%;
  }

  .filters,
  .deck-filters,
  .deck-rules,
  .saved-deck-bar,
  .deck-list-top,
  .deck-sections,
  .deck-tools,
  .post-composer {
    grid-template-columns: 1fr;
  }

  .post-composer input,
  .post-composer textarea,
  .post-composer button,
  .media-drop {
    grid-column: auto;
    grid-row: auto;
  }

  .avatar-uploader {
    grid-template-columns: 1fr;
  }

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

  .card-title strong {
    font-size: 13px;
  }

  .meta,
  .chips {
    display: none;
  }

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

  .deck-result {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .deck-row-controls {
    grid-column: 1 / -1;
    justify-content: end;
  }

  .hero-meter,
  .deck-rules,
  .deck-stats,
  .board-counts {
    grid-template-columns: 1fr;
  }

  .hero-meter span + span,
  .deck-rules span + span,
  .deck-stats span + span,
  .board-counts span + span {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

.playground-shell {
  display: grid;
  grid-template-columns: minmax(208px, 244px) minmax(760px, 1fr) minmax(220px, 268px);
  gap: 8px;
  min-height: calc(100svh - 61px);
  padding: 6px clamp(6px, 0.8vw, 12px);
  background:
    linear-gradient(180deg, rgb(246 247 239 / 5%), rgb(4 8 10 / 52%)),
    #0b0f11;
}

.playground-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(18 25 31 / 74%);
}

.playground-lobby,
.playground-table,
.playground-side {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
}

.playground-lobby,
.playground-side {
  max-height: calc(100svh - 78px);
  overflow: auto;
}

.playground-lobby {
  max-height: calc(100svh - 78px);
}

.playground-side {
  max-height: calc(100svh - 78px);
}

.playground-table {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "topline"
    "board"
    "tools";
  align-items: start;
  min-height: calc(100svh - 77px);
  border-color: rgb(222 226 218 / 20%);
  background:
    linear-gradient(180deg, rgb(27 31 30 / 92%), rgb(10 14 15 / 92%)),
    #101413;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 5%),
    0 18px 54px rgb(0 0 0 / 30%);
}

.playground-table::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0 calc(50% - 1px), rgb(234 238 228 / 18%) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px) 100%),
    linear-gradient(90deg, transparent 0 calc(50% - 1px), rgb(234 238 228 / 10%) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px) 100%),
    radial-gradient(ellipse at 18% 35%, rgb(172 57 48 / 18%), transparent 42%),
    radial-gradient(ellipse at 82% 64%, rgb(47 112 106 / 18%), transparent 44%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 3%) 0 1px, transparent 1px 68px);
  opacity: 0.92;
}

.playground-toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.playground-toolbar label,
.chat-form {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 840;
}

.table-list {
  display: grid;
  gap: 9px;
}

.table-card {
  display: grid;
  height: auto;
  min-height: 82px;
  justify-items: start;
  gap: 4px;
  padding: 11px;
  text-align: left;
}

.table-card.active {
  border-color: rgb(45 212 191 / 72%);
  background: rgb(45 212 191 / 9%);
}

.table-card span,
.table-card small,
.empty-state {
  color: var(--muted);
}

.table-topline {
  grid-area: topline;
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 6px;
  border: 1px solid rgb(255 255 255 / 7%);
  border-radius: 7px;
  background: rgb(6 9 10 / 58%);
  backdrop-filter: blur(10px);
}

.table-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

#tableTitle {
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-role-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  overflow: hidden;
  padding: 4px 10px;
  border: 1px solid rgb(45 212 191 / 25%);
  border-radius: 999px;
  background: rgb(45 212 191 / 9%);
  color: #bff9ee;
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: 100%;
  max-width: none;
  overflow: visible;
  gap: 6px;
  padding-bottom: 2px;
}

.table-actions,
.selected-card-tools,
.table-zones,
.seat-board,
.zone-grid,
.seat-hud {
  min-width: 0;
}

.table-actions button {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.turn-phase-control {
  display: inline-grid;
  flex: 0 0 auto;
  min-width: 96px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  gap: 4px;
}

.turn-phase-control select {
  min-height: 32px;
}

.selected-card-tools {
  grid-area: tools;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  align-items: end;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 7px;
  background: rgb(5 9 13 / 58%);
  backdrop-filter: blur(10px);
}

.selected-card-tools span {
  grid-column: 1 / -1;
  align-self: center;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-card-tools label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.selected-card-tools button,
.selected-card-tools select {
  width: 100%;
  min-width: 0;
}

.table-zones {
  grid-area: board;
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  height: clamp(520px, calc(100svh - 238px), 850px);
  overflow: hidden;
  gap: clamp(8px, 1.5svh, 18px);
  padding: clamp(8px, 1vw, 14px);
  border: 1px solid rgb(231 235 224 / 12%);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgb(234 238 228 / 8%) 0 1px, transparent 1px calc(50% - 1px), rgb(234 238 228 / 12%) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px) 100%),
    linear-gradient(90deg, rgb(255 255 255 / 5%) 0 50%, rgb(255 255 255 / 7%) 50% 100%),
    rgb(15 18 18 / 58%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 9%),
    inset 0 0 34px rgb(0 0 0 / 24%);
}

.seat-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.seat-board.is-current-player {
  align-self: end;
  grid-template-rows: minmax(0, 1fr) auto;
}

.seat-board.is-opponent-player {
  align-self: start;
  opacity: 0.94;
}

.seat-board.is-current-player .seat-hud {
  order: 2;
}

.seat-board.is-current-player .zone-grid {
  order: 1;
}

.seat-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 999px;
  background: rgb(2 6 10 / 62%);
  box-shadow: 0 8px 24px rgb(0 0 0 / 22%);
  backdrop-filter: blur(10px);
}

.seat-hud h3,
.playground-side h2 {
  font-size: 15px;
  line-height: 1.2;
}

.seat-hud h3 {
  margin: 0;
}

.seat-hud small {
  display: block;
  max-width: 24ch;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-role-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 20px;
  align-items: center;
  overflow: hidden;
  padding: 2px 7px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 999px;
  color: #bff9ee;
  background: rgb(45 212 191 / 9%);
  font-size: 10px;
  font-weight: 880;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-counters {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.seat-counters span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 999px;
  color: #dce8f3;
  background: #02060a;
  font-size: 10px;
  font-weight: 850;
}

.seat-counters b {
  color: #fff;
  font-size: 15px;
  line-height: 1;
}

.zone-grid {
  display: grid;
  grid-template-columns: minmax(54px, 0.38fr) minmax(76px, 0.52fr) minmax(0, 1fr) minmax(0, 1fr) minmax(72px, 0.5fr);
  grid-auto-rows: minmax(42px, 1fr);
  align-items: stretch;
  gap: clamp(4px, 0.72vw, 8px);
}

.seat-board.is-current-player .zone-grid {
  grid-template-areas:
    "legend champion battlefields main_deck rune_deck"
    "discard battlefield battlefield chain revealed"
    "base battlefield battlefield hand hand"
    "removed rune_pool rune_pool rune_pool rune_pool";
}

.seat-board.is-opponent-player .zone-grid {
  grid-template-areas:
    "hand hand battlefield battlefield base"
    "revealed chain battlefield battlefield discard"
    "rune_deck main_deck battlefields champion legend"
    "rune_pool rune_pool rune_pool rune_pool removed";
}

.zone-legend_zone {
  grid-area: legend;
}

.zone-champion_zone {
  grid-area: champion;
}

.zone-battlefields {
  grid-area: battlefields;
}

.zone-base {
  grid-area: base;
}

.zone-main_deck {
  grid-area: main_deck;
}

.zone-rune_deck {
  grid-area: rune_deck;
}

.zone-rune_pool {
  grid-area: rune_pool;
}

.zone-hand {
  grid-area: hand;
}

.zone-chain {
  grid-area: chain;
}

.zone-battlefield {
  grid-area: battlefield;
}

.zone-discard {
  grid-area: discard;
}

.zone-removed {
  grid-area: removed;
}

.zone-revealed {
  grid-area: revealed;
}

.zone-cell {
  position: relative;
  display: grid;
  min-height: 52px;
  align-content: stretch;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgb(232 236 226 / 12%);
  border-radius: 8px;
  background: rgb(234 238 228 / 5%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 6%),
    inset 0 -12px 24px rgb(0 0 0 / 10%);
}

.zone-cell.can-drop {
  border-color: rgb(45 212 191 / 52%);
  background: rgb(45 212 191 / 10%);
}

.zone-cell.drag-over {
  border-color: rgb(245 158 11 / 78%);
  background: rgb(245 158 11 / 15%);
  box-shadow:
    inset 0 0 0 2px rgb(245 158 11 / 28%),
    0 0 20px rgb(245 158 11 / 12%);
}

.zone-private {
  background: rgb(2 6 10 / 46%);
}

.zone-tabletop {
  border-color: rgb(231 235 224 / 15%);
  background: rgb(231 235 224 / 7%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%);
}

.zone-hand,
.zone-battlefield {
  min-height: 132px;
}

.zone-battlefield {
  border-color: rgb(231 235 224 / 20%);
  background:
    linear-gradient(180deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 4%)),
    rgb(231 235 224 / 7%);
}

.zone-battlefields {
  border-color: rgb(245 158 11 / 18%);
  background: rgb(245 158 11 / 6%);
}

.zone-empty {
  min-height: 40px;
  opacity: 0.88;
}

.zone-empty .zone-preview {
  min-height: 0;
  padding-top: 14px;
}

.zone-metadata {
  position: absolute;
  top: auto;
  bottom: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 12px);
  overflow: hidden;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 999px;
  background: rgb(2 6 10 / 62%);
  backdrop-filter: blur(8px);
}

.zone-metadata strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.zone-metadata span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 920;
}

.zone-preview {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 100%;
  padding-top: 4px;
  padding-bottom: 22px;
}

.zone-hand .zone-preview,
.zone-battlefield .zone-preview,
.zone-rune_pool .zone-preview {
  align-content: end;
  align-items: end;
  min-height: 76px;
}

.seat-board.is-current-player .zone-hand .zone-preview,
.seat-board.is-opponent-player .zone-hand .zone-preview {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.card-chip {
  display: grid;
  width: clamp(44px, 4vw, 72px);
  height: clamp(66px, 6vw, 108px);
  min-height: 0;
  max-width: 72px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 5px;
  background: rgb(255 255 255 / 4%);
  color: #dbe6ef;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: normal;
  place-items: stretch;
  box-shadow: 0 8px 18px rgb(0 0 0 / 28%);
}

.zone-hand .card-chip,
.zone-battlefield .card-chip,
.zone-base .card-chip {
  width: clamp(60px, 4.8vw, 88px);
  height: clamp(90px, 7.2vw, 132px);
  max-width: 88px;
}

.zone-main_deck .card-chip,
.zone-rune_deck .card-chip,
.zone-discard .card-chip,
.zone-removed .card-chip {
  width: clamp(42px, 3.25vw, 58px);
  height: clamp(63px, 4.9vw, 87px);
}

.card-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  grid-area: 1 / 1;
}

.card-chip span {
  align-self: end;
  grid-area: 1 / 1;
  padding: 16px 4px 4px;
  background: linear-gradient(180deg, transparent, rgb(0 0 0 / 82%));
  text-shadow: 0 1px 2px rgb(0 0 0 / 80%);
}

.card-chip:hover,
.card-chip.selected {
  border-color: rgb(245 158 11 / 72%);
  background: rgb(245 158 11 / 12%);
  color: #fff;
}

.card-chip[draggable="true"] {
  cursor: grab;
}

.card-chip.dragging {
  cursor: grabbing;
  opacity: 0.62;
  transform: scale(0.96);
}

.card-chip.face-down {
  border-style: dashed;
  color: #facc15;
}

.card-chip.exhausted {
  transform: rotate(8deg);
  border-color: rgb(251 191 36 / 58%);
  box-shadow: inset 0 0 0 1px rgb(251 191 36 / 18%);
}

.card-chip.controlled {
  border-color: rgb(45 212 191 / 62%);
  box-shadow: inset 0 0 0 2px rgb(45 212 191 / 22%);
}

.card-chip.contested {
  border-color: rgb(248 113 113 / 70%);
  box-shadow:
    inset 0 0 0 2px rgb(248 113 113 / 26%),
    0 0 0 1px rgb(248 113 113 / 30%);
}

.card-chip.hidden-card {
  cursor: default;
  border-color: rgb(148 163 184 / 34%);
  background:
    linear-gradient(135deg, rgb(20 28 35 / 96%), rgb(7 11 16 / 96%)),
    repeating-linear-gradient(45deg, rgb(245 158 11 / 18%) 0 6px, transparent 6px 12px);
  color: #e5eef6;
}

.card-chip.hidden-card span {
  display: grid;
  width: 100%;
  height: 100%;
  align-items: end;
  padding: 8px 5px;
  background: linear-gradient(180deg, transparent 28%, rgb(0 0 0 / 72%));
}

.card-chip.hidden-card:hover {
  border-color: rgb(148 163 184 / 34%);
  background:
    linear-gradient(135deg, rgb(20 28 35 / 96%), rgb(7 11 16 / 96%)),
    repeating-linear-gradient(45deg, rgb(245 158 11 / 18%) 0 6px, transparent 6px 12px);
}

.card-hover-preview {
  position: absolute;
  top: 72px;
  right: 14px;
  z-index: 4;
  display: grid;
  width: min(220px, 26%);
  max-height: min(480px, calc(100svh - 132px));
  min-height: 128px;
  align-self: start;
  overflow: auto;
  gap: 7px;
  margin-top: 0;
  padding: 10px;
  border: 1px solid rgb(245 158 11 / 42%);
  border-radius: 7px;
  background: rgb(11 16 20 / 94%);
  box-shadow: 0 18px 42px rgb(0 0 0 / 35%);
}

.card-hover-preview.is-empty {
  display: none;
}

.card-hover-preview img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 6px;
  background: #05080b;
}

.card-hover-preview strong {
  color: #fff;
  font-size: 14px;
}

.card-hover-preview span,
.card-hover-preview p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.playground-side section {
  display: grid;
  gap: 9px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.playground-side section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.result-status {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 7px;
  background: rgb(255 255 255 / 4%);
}

.result-status strong {
  color: #fff;
  font-size: 12px;
}

.result-status p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.event-log,
.chat-log,
.replay-log {
  display: grid;
  max-height: 168px;
  overflow: auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 7px;
  background: #0f151a;
}

.replay-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.replay-controls span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.event-log p,
.chat-log p,
.replay-log p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.voice-status {
  padding: 9px;
  border: 1px solid rgb(45 212 191 / 20%);
  border-radius: 7px;
  color: #d7fff8;
  background: rgb(45 212 191 / 8%);
  font-weight: 850;
}

.remote-audio {
  display: grid;
  min-height: 34px;
}

.remote-audio audio {
  width: 100%;
  min-height: 34px;
}

.ghost-button {
  background: transparent;
}

@media (max-width: 1180px) {
  .playground-shell {
    grid-template-columns: minmax(280px, 0.9fr) minmax(460px, 1.2fr);
  }

  .playground-side {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

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

  .playground-table {
    grid-template-columns: 1fr;
    grid-template-areas:
      "topline"
      "board"
      "tools"
      "preview";
  }

  .card-hover-preview {
    position: static;
    grid-area: preview;
    width: 100%;
    max-height: none;
  }

  .table-topline,
  .selected-card-tools,
  .playground-side {
    grid-template-columns: 1fr;
  }

  .zone-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    grid-template-areas: none;
  }

  .zone-legend_zone,
  .zone-champion_zone,
  .zone-battlefields,
  .zone-base,
  .zone-main_deck,
  .zone-rune_deck,
  .zone-rune_pool,
  .zone-hand,
  .zone-chain,
  .zone-battlefield,
  .zone-discard,
  .zone-removed,
  .zone-revealed {
    grid-area: auto;
  }
}

@keyframes foil-drift {
  from {
    background-position: 0% 50%, center, 0% 50%;
  }
  to {
    background-position: 100% 50%, center, 100% 50%;
  }
}

@keyframes foil-name-flow {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes hero-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -12px;
  }
}
