:root {
  --white: #ffffff;
  --surface: #f7f7f8;
  --ink: #111111;
  --muted: #616161;
  --line: #d8d8da;
  --red: #e4002b;
  --red-dark: #b80023;
  --max: 1380px;
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --header-height: 72px;
  --rail-height: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--rail-height) + 16px);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-right: var(--safe-right);
  padding-left: var(--safe-left);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.52;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

a,
button,
input,
select,
summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(114, 230, 220, 0.16);
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.04em;
  line-height: 0.98;
  text-wrap: balance;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
.card-ref:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--white);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 290px 1fr auto;
  align-items: stretch;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--ink);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-right: 1px solid var(--ink);
  text-decoration: none;
}

.brand-index {
  color: var(--red);
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 1;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.92rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.025em;
}

.site-header nav {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}

.site-header nav a {
  display: grid;
  min-width: 102px;
  padding: 12px 16px;
  border-left: 1px solid var(--line);
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.site-header nav a:hover {
  background: var(--surface);
}

.site-header nav a.is-active,
.site-header nav a[aria-current="location"] {
  box-shadow: inset 0 -4px 0 var(--red);
  color: var(--red);
}

.copy-button {
  min-width: 112px;
  min-height: var(--header-height);
  border: 0;
  border-left: 1px solid var(--ink);
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 800;
}

.copy-button:hover {
  background: var(--red-dark);
}

.reading-progress {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left center;
}

.mobile-section-rail {
  display: none;
}

main,
.site-footer {
  width: min(100%, var(--max));
  margin-inline: auto;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--white);
}

.hero {
  position: relative;
  min-height: clamp(620px, calc(100svh - var(--header-height)), 720px);
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), var(--line) 50%, transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(33.333% - 1px), var(--line) 33.333%, transparent calc(33.333% + 1px));
}

.hero-number {
  position: absolute;
  top: -7vw;
  right: 0;
  color: var(--surface);
  font-size: clamp(20rem, 43vw, 40rem);
  font-weight: 900;
  letter-spacing: -0.11em;
  line-height: 0.9;
  pointer-events: none;
  user-select: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(1040px, 82%);
  padding: clamp(54px, 6vw, 88px) clamp(24px, 6vw, 86px) 174px;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 30px;
  font-size: clamp(3.6rem, 6.8vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.075em;
}

.hero h1 span {
  color: var(--red);
}

.hero-intro {
  max-width: 690px;
  margin-bottom: 34px;
  font-size: clamp(1.03rem, 1.4vw, 1.25rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

.primary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid var(--red);
  background: var(--red);
  color: var(--white);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.primary-action:hover {
  background: var(--red-dark);
}

.text-action {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero-facts {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  width: min(600px, 50%);
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  background: var(--white);
}

.hero-facts div {
  min-height: 108px;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.hero-facts div:last-child {
  border-right: 0;
}

.hero-facts dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 16px 0 0;
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 1;
}

.proof-strip {
  display: grid;
  grid-template-columns: 0.7fr 1.4fr 1.8fr 1fr;
  border-bottom: 1px solid var(--ink);
}

.proof-strip p {
  margin: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line);
  font-size: 0.74rem;
}

.proof-strip p:last-child {
  border-right: 0;
}

.quick-section {
  background: var(--ink);
  color: var(--white);
}

.quick-header {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.7fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 44px;
}

.quick-header .eyebrow,
.quick-index {
  color: #ff7188;
}

.quick-header h2 {
  max-width: 860px;
  margin: 0;
  font-size: clamp(2.8rem, 5.8vw, 5.8rem);
  font-weight: 900;
}

.quick-header > p {
  margin: 0;
  color: #c8c8c8;
  font-size: 0.9rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid #5a5a5a;
  border-left: 1px solid #5a5a5a;
}

.quick-grid article {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 24px;
  border-right: 1px solid #5a5a5a;
  border-bottom: 1px solid #5a5a5a;
}

.quick-index {
  margin-bottom: 28px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-grid h3 {
  margin-bottom: 22px;
  font-size: clamp(1.55rem, 2.4vw, 2.45rem);
}

.quick-grid article > p:not(.quick-index) {
  color: #c8c8c8;
  font-size: 0.86rem;
}

.quick-grid article > a {
  margin-top: auto;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
}

.quick-jumps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 24px;
  border-top: 1px solid #5a5a5a;
  border-left: 1px solid #5a5a5a;
}

.quick-jumps a {
  min-height: 78px;
  padding: 14px 18px;
  border-right: 1px solid #5a5a5a;
  border-bottom: 1px solid #5a5a5a;
  color: var(--white);
  text-decoration: none;
}

.quick-jumps a:hover {
  background: #242424;
}

.quick-jumps span,
.quick-jumps strong {
  display: block;
}

.quick-jumps span {
  margin-bottom: 5px;
  color: #a9a9a9;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quick-jumps strong {
  font-size: 0.84rem;
}

.section {
  padding: clamp(70px, 8vw, 120px) clamp(24px, 5.5vw, 78px);
  border-bottom: 1px solid var(--ink);
}

.section-header {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 50px;
}

.section-number {
  margin: 0;
  color: var(--red);
  font-size: 3.6rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  line-height: 0.8;
}

.section-header h2 {
  max-width: 980px;
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 6rem);
  font-weight: 900;
}

.section-header > div > p:last-child {
  max-width: 760px;
  margin-top: 20px;
}

.tab-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
}

.tab-button {
  min-height: 54px;
  border: 0;
  border-right: 1px solid var(--ink);
  background: var(--white);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button.is-active {
  background: var(--red);
  color: var(--white);
}

.mulligan-panel {
  border: 1px solid var(--ink);
  border-top: 0;
}

.mulligan-panel h3 {
  margin: 0;
  padding: 30px;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.mulligan-panel ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.mulligan-panel li {
  min-height: 190px;
  padding: 22px;
  border-right: 1px solid var(--line);
}

.mulligan-panel li:last-child {
  border-right: 0;
}

.mulligan-panel strong,
.mulligan-panel span {
  display: block;
}

.mulligan-panel strong {
  margin-bottom: 30px;
  font-size: 1rem;
}

.mulligan-panel span {
  color: var(--muted);
  font-size: 0.84rem;
}

.phase-grid,
.battlefield-grid,
.matchup-grid {
  display: grid;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.phase-grid {
  grid-template-columns: repeat(3, 1fr);
}

.phase-grid article,
.battlefield-grid article,
.matchup-grid article {
  padding: 28px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.phase-grid article {
  min-height: 390px;
}

.phase-index,
.battlefield-grid span {
  color: var(--red);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.phase-grid h3,
.battlefield-grid h3,
.matchup-grid h3 {
  margin: 34px 0 24px;
  font-size: clamp(2rem, 3.2vw, 3.6rem);
}

.phase-grid article > p:not(.phase-index, .phase-rule),
.battlefield-grid p,
.matchup-grid p {
  color: var(--muted);
}

.phase-rule {
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
}

.battlefield-grid {
  grid-template-columns: repeat(3, 1fr);
}

.battlefield-grid article {
  min-height: 300px;
}

.line-list {
  border-top: 1px solid var(--ink);
}

.line-list details {
  border-bottom: 1px solid var(--ink);
}

.line-list summary {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 24px;
  align-items: center;
  min-height: 92px;
  padding: 18px 6px;
  cursor: pointer;
  list-style: none;
}

.line-list summary::-webkit-details-marker {
  display: none;
}

.line-list summary span {
  color: var(--red);
  font-size: 1.55rem;
  font-weight: 900;
}

.line-list summary strong {
  font-size: clamp(1.1rem, 2vw, 1.8rem);
}

.line-list summary em {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
}

.line-list summary::after {
  content: "+";
  grid-column: 4;
  color: var(--red);
  font-size: 1.8rem;
}

.line-list details[open] summary::after {
  content: "−";
}

.line-list details > div {
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 40px;
  padding: 12px 92px 38px;
  background: var(--surface);
}

.line-list details > div p,
.line-list details > div ol {
  margin: 0;
  font-size: 0.9rem;
}

.line-list details > div ol {
  padding-left: 18px;
}

.line-list details > div li + li {
  margin-top: 8px;
}

.interaction-table {
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2.2fr;
}

.table-row > * {
  min-height: 72px;
  padding: 20px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  font-size: 0.85rem;
}

.table-head {
  background: var(--ink);
  color: var(--white);
  font-weight: 800;
  text-transform: uppercase;
}

.matchup-grid {
  grid-template-columns: repeat(3, 1fr);
}

.matchup-grid article {
  min-height: 250px;
}

.matchup-grid h3 {
  margin-top: 0;
  font-size: 1.7rem;
}

.mistakes ol {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
}

.mistakes li {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  align-items: center;
  min-height: 90px;
  border-bottom: 1px solid var(--ink);
}

.mistakes li > span {
  color: var(--red);
  font-size: 1.5rem;
  font-weight: 900;
}

.mistakes li p {
  margin: 0;
}

.gallery-section {
  padding-inline: clamp(16px, 3vw, 42px);
}

.gallery-section .section-header {
  padding-inline: clamp(8px, 2.5vw, 36px);
}

.card-ref {
  display: inline;
  margin: 0;
  padding: 0 0.08em;
  border: 0;
  border-bottom: 1px dotted currentColor;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: inherit;
}

.card-ref:hover {
  border-bottom-style: solid;
  color: var(--red);
}

.quick-section .card-ref:hover {
  color: #ff7188;
}

.card-peek {
  position: fixed;
  z-index: 45;
  width: min(220px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--ink);
  background: var(--white);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.26);
  color: var(--ink);
  pointer-events: none;
}

.card-peek img {
  width: 100%;
  max-height: 286px;
  object-fit: contain;
}

.card-peek > div {
  padding: 10px 4px 2px;
}

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

.card-peek strong {
  font-size: 0.84rem;
}

.card-peek span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.gallery-toolbar {
  position: sticky;
  top: var(--header-height);
  z-index: 10;
  padding: 12px;
  border: 1px solid var(--ink);
  background: var(--white);
}

.gallery-topline,
.gallery-bottomline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.gallery-topline {
  align-items: end;
}

.gallery-bottomline {
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.gallery-search {
  width: min(520px, 55%);
}

.gallery-search label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-search > div {
  display: flex;
}

.gallery-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 0.82rem;
}

.gallery-search button {
  min-width: 64px;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-left: 0;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.filter-controls,
.view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.view-controls {
  flex: 0 0 auto;
}

.filter-button,
.view-button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--ink);
  background: var(--white);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 800;
}

.filter-button span {
  color: var(--red);
}

.filter-button.is-active,
.view-button.is-active {
  background: var(--ink);
  color: var(--white);
}

.filter-button.is-active span {
  color: var(--white);
}

.gallery-status {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.gallery-empty {
  margin: 0;
  padding: 44px 20px;
  border: 1px solid var(--ink);
  border-top: 0;
  background: var(--surface);
  font-weight: 800;
  text-align: center;
}

.card-gallery {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-left: 1px solid var(--ink);
}

.card-tile {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  background: var(--surface);
}

.card-tile.is-hidden {
  display: none;
}

.card-tile button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.card-tile img {
  width: 100%;
  aspect-ratio: 560 / 782;
  object-fit: contain;
  transition: transform 180ms ease;
}

.card-tile.battlefield-card img {
  aspect-ratio: 760 / 544;
}

.card-tile button:hover img {
  transform: scale(1.018);
}

.card-tile figcaption {
  display: grid;
  min-height: 102px;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-content: start;
  padding-top: 13px;
}

.card-tile .quantity {
  grid-column: 1 / -1;
  color: var(--red);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-tile strong {
  font-size: 0.84rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.card-tile small {
  color: var(--muted);
  font-size: 0.62rem;
}

.card-gallery.is-list {
  grid-template-columns: repeat(2, 1fr);
}

.card-gallery.is-list .card-tile {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 112px;
  padding: 10px;
}

.card-gallery.is-list .card-tile.is-hidden {
  display: none;
}

.card-gallery.is-list .card-tile button {
  height: 92px;
}

.card-gallery.is-list .card-tile img {
  height: 92px;
  object-fit: contain;
}

.card-gallery.is-list .card-tile figcaption {
  min-height: 0;
}

.art-note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.decklist-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  border: 1px solid var(--ink);
}

.deck-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.deck-columns article {
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.deck-columns h3 {
  margin-bottom: 22px;
  color: var(--red);
  font-size: 1rem;
  text-transform: uppercase;
}

.deck-columns article h3:not(:first-child) {
  margin-top: 30px;
}

.deck-columns p {
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.deck-columns b {
  display: inline-block;
  width: 20px;
  color: var(--red);
}

.deck-actions {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: flex-end;
  padding: 22px;
  border-left: 1px solid var(--ink);
  background: var(--surface);
}

.deck-actions p {
  font-size: 0.8rem;
}

.upgrade-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  list-style: none;
  counter-reset: upgrade;
}

.upgrade-list li {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  min-height: 82px;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  counter-increment: upgrade;
}

.upgrade-list li::before {
  content: "0" counter(upgrade);
  color: var(--red);
  font-size: 1.4rem;
  font-weight: 900;
}

.upgrade-list span {
  color: var(--muted);
}

.site-footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1.5fr;
  gap: 30px;
  padding: 42px;
  background: var(--ink);
  color: var(--white);
  font-size: 0.75rem;
}

.site-footer a {
  color: var(--white);
}

.site-footer p {
  margin-bottom: 8px;
}

.legal {
  color: #c8c8c8;
}

.card-dialog {
  width: min(92vw, 880px);
  max-height: 94vh;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--white);
  color: var(--ink);
}

.card-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.card-dialog[open] {
  display: grid;
  grid-template-columns: minmax(260px, 560px) 1fr;
  gap: 24px;
  align-items: end;
}

.card-dialog img {
  max-height: calc(94vh - 40px);
  margin: auto;
  object-fit: contain;
}

.card-dialog h2 {
  margin-bottom: 18px;
  font-size: 2rem;
}

.card-dialog a {
  color: var(--red);
  font-weight: 800;
}

.dialog-meta {
  padding: 0 4px 8px;
}

.dialog-meta .eyebrow {
  margin-bottom: 10px;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-width: 56px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--ink);
  background: var(--white);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: calc(16px + var(--safe-right));
  bottom: calc(16px + var(--safe-bottom));
  z-index: 50;
  max-width: 420px;
  padding: 14px 18px;
  border: 1px solid var(--white);
  background: var(--ink);
  color: var(--white);
  font-size: 0.8rem;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 260px 1fr auto;
  }

  .site-header nav a {
    min-width: 0;
    padding-inline: 10px;
  }

  .mulligan-panel ul {
    grid-template-columns: repeat(3, 1fr);
  }

  .mulligan-panel li {
    border-bottom: 1px solid var(--line);
  }

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

  .quick-grid article {
    min-height: 260px;
  }

  .card-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .deck-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 64px;
    --rail-height: 48px;
  }

  .site-header {
    min-height: var(--header-height);
    grid-template-columns: 1fr auto;
  }

  .brand {
    border-right: 0;
  }

  .site-header nav {
    display: none;
  }

  .copy-button {
    min-width: 86px;
    min-height: var(--header-height);
  }

  .mobile-section-rail {
    position: sticky;
    top: var(--header-height);
    z-index: 25;
    display: flex;
    height: var(--rail-height);
    overflow-x: auto;
    border-bottom: 1px solid var(--ink);
    background: rgba(255, 255, 255, 0.98);
    scrollbar-width: none;
  }

  .mobile-section-rail::-webkit-scrollbar {
    display: none;
  }

  .mobile-section-rail a {
    display: grid;
    flex: 0 0 auto;
    min-width: 76px;
    min-height: var(--rail-height);
    padding: 8px 12px;
    border-right: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 800;
    place-items: center;
    text-decoration: none;
  }

  .mobile-section-rail a.is-active,
  .mobile-section-rail a[aria-current="location"] {
    background: var(--ink);
    color: var(--white);
  }

  .hero {
    min-height: 0;
  }

  .hero-copy {
    width: 100%;
    padding: 58px clamp(24px, 7vw, 58px) 44px;
  }

  .hero-facts {
    position: static;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
    border-left: 0;
  }

  .hero-facts div {
    min-height: 82px;
    border-bottom: 1px solid var(--line);
  }

  .hero-facts dd {
    margin-top: 10px;
    font-size: 2rem;
  }

  .proof-strip {
    grid-template-columns: 1fr 1fr;
  }

  .proof-strip p {
    border-bottom: 1px solid var(--line);
  }

  .quick-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .quick-header > p {
    max-width: 620px;
  }

  .quick-jumps {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-header {
    grid-template-columns: 58px 1fr;
  }

  .section-number {
    font-size: 2.5rem;
  }

  .mulligan-panel ul,
  .phase-grid,
  .battlefield-grid,
  .matchup-grid {
    grid-template-columns: 1fr;
  }

  .mulligan-panel li,
  .phase-grid article,
  .battlefield-grid article,
  .matchup-grid article {
    min-height: auto;
    border-right: 0;
  }

  .line-list summary {
    grid-template-columns: 44px 1fr auto;
  }

  .line-list summary em {
    display: none;
  }

  .line-list summary::after {
    grid-column: 3;
  }

  .line-list details > div {
    grid-template-columns: 1fr;
    padding: 12px 44px 30px;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
  }

  .table-row > *:last-child {
    grid-column: 1 / -1;
  }

  .gallery-toolbar {
    top: calc(var(--header-height) + var(--rail-height));
  }

  .gallery-search {
    width: min(620px, 70%);
  }

  .card-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .decklist-layout {
    grid-template-columns: 1fr;
  }

  .deck-actions {
    border-top: 1px solid var(--ink);
    border-left: 0;
  }

  .upgrade-list li {
    grid-template-columns: 58px 1fr;
    padding-block: 14px;
  }

  .upgrade-list span {
    grid-column: 2;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .card-dialog[open] {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .card-dialog img {
    max-height: calc(94vh - 190px);
  }

  .dialog-meta {
    display: block;
    padding: 16px 4px 4px;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .brand small {
    display: none;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 14.5vw, 4.2rem);
  }

  .hero-intro {
    font-size: 0.95rem;
  }

  .hero-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-facts div {
    min-height: 76px;
    padding: 14px 18px;
  }

  .hero-facts dd {
    margin-top: 8px;
    font-size: 1.8rem;
  }

  .proof-strip {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 64px 18px;
  }

  .section-header {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .section-header h2 {
    font-size: 2.8rem;
  }

  .quick-header h2 {
    font-size: 2.8rem;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .quick-grid article {
    min-height: 0;
  }

  .quick-grid article > a {
    margin-top: 24px;
  }

  .quick-jumps {
    grid-template-columns: repeat(2, 1fr);
  }

  .tab-controls {
    grid-template-columns: 1fr;
  }

  .tab-button {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .tab-button:last-child {
    border-bottom: 0;
  }

  .mulligan-panel h3 {
    padding: 22px;
  }

  .mulligan-panel ul {
    grid-template-columns: 1fr;
  }

  .mulligan-panel li {
    min-height: auto;
  }

  .mulligan-panel strong {
    margin-bottom: 10px;
  }

  .line-list summary {
    min-height: 76px;
    gap: 10px;
  }

  .line-list details > div {
    padding-inline: 18px;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row > *:last-child {
    grid-column: auto;
  }

  .gallery-section {
    padding-inline: 8px;
  }

  .gallery-bottomline {
    display: block;
  }

  .gallery-topline {
    gap: 8px;
  }

  .gallery-search {
    width: calc(100% - 112px);
    min-width: 0;
  }

  .view-controls {
    flex-wrap: nowrap;
    margin-top: 0;
  }

  .view-button {
    padding-inline: 9px;
  }

  .gallery-status {
    margin-top: 8px;
    white-space: normal;
  }

  .filter-controls {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
  }

  .filter-controls::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: 0 0 auto;
  }

  .card-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-tile {
    padding: 8px;
  }

  .card-tile figcaption {
    display: block;
    min-height: 92px;
  }

  .card-tile strong,
  .card-tile small,
  .card-tile .quantity {
    display: block;
    margin-bottom: 4px;
  }

  .card-gallery.is-list {
    grid-template-columns: 1fr;
  }

  .deck-columns {
    grid-template-columns: 1fr;
  }

  .deck-columns article {
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Mystical dreamfield theme */

:root {
  --white: #fbfffe;
  --surface: #eaf5f1;
  --ink: #10282b;
  --muted: #536f6e;
  --line: rgba(43, 91, 91, 0.2);
  --red: #7952b3;
  --red-dark: #5d3b8d;
  --night: #07171f;
  --night-soft: #0d2630;
  --forest: #143a37;
  --mist: #f1faf6;
  --aqua: #72e6dc;
  --lilac: #bca3ff;
  --pink: #f3a6d4;
  --gold: #e8d7a5;
  --font: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  --font-display: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

html {
  scrollbar-color: var(--red) var(--night-soft);
}

body {
  background:
    radial-gradient(circle at 12% 6%, rgba(85, 211, 202, 0.15), transparent 28rem),
    radial-gradient(circle at 88% 28%, rgba(167, 111, 221, 0.16), transparent 32rem),
    linear-gradient(180deg, #07171f 0%, #0a2227 48%, #07171f 100%);
  color: var(--ink);
}

::selection {
  background: rgba(188, 163, 255, 0.55);
  color: var(--night);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.045em;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
.card-ref:focus-visible {
  outline-color: var(--aqua);
  box-shadow: 0 0 0 6px rgba(114, 230, 220, 0.2);
}

.skip-link {
  border: 1px solid rgba(114, 230, 220, 0.55);
  border-radius: 999px;
  background: var(--night);
  color: var(--white);
}

.site-header {
  border-bottom-color: rgba(167, 224, 218, 0.22);
  background: rgba(5, 20, 28, 0.91);
  box-shadow: 0 12px 38px rgba(1, 10, 15, 0.26);
  color: #effcf9;
  backdrop-filter: blur(18px) saturate(130%);
}

.brand {
  border-right-color: rgba(167, 224, 218, 0.2);
}

.brand-index {
  background: linear-gradient(145deg, var(--aqua), var(--lilac) 58%, var(--pink));
  color: transparent;
  text-shadow: 0 0 24px rgba(114, 230, 220, 0.35);
  -webkit-background-clip: text;
  background-clip: text;
}

.brand strong {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: -0.025em;
}

.brand small {
  color: #a9c9c4;
}

.site-header nav a {
  border-left-color: rgba(167, 224, 218, 0.14);
  color: #d9eeea;
}

.site-header nav a:hover {
  background: rgba(114, 230, 220, 0.08);
  color: var(--white);
}

.site-header nav a.is-active,
.site-header nav a[aria-current="location"] {
  box-shadow: inset 0 -3px 0 var(--aqua);
  color: var(--aqua);
}

.copy-button {
  border-left-color: rgba(167, 224, 218, 0.2);
  background: linear-gradient(135deg, var(--aqua), var(--lilac) 60%, var(--pink));
  color: var(--night);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

.copy-button:hover {
  background: linear-gradient(135deg, #9bf5ec, #cbb8ff 60%, #ffc1e0);
}

.reading-progress span {
  background: linear-gradient(90deg, var(--aqua), var(--lilac), var(--pink));
  box-shadow: 0 0 14px rgba(114, 230, 220, 0.75);
}

.mobile-section-rail {
  border-bottom-color: rgba(167, 224, 218, 0.22);
  background: rgba(7, 23, 31, 0.96);
  box-shadow: 0 10px 24px rgba(1, 10, 15, 0.18);
  backdrop-filter: blur(16px);
}

.mobile-section-rail a {
  border-right-color: rgba(167, 224, 218, 0.14);
  color: #d9eeea;
}

.mobile-section-rail a.is-active,
.mobile-section-rail a[aria-current="location"] {
  background: linear-gradient(145deg, rgba(114, 230, 220, 0.2), rgba(188, 163, 255, 0.22));
  color: var(--aqua);
  box-shadow: inset 0 -3px 0 var(--aqua);
}

main,
.site-footer {
  border-right-color: rgba(196, 233, 227, 0.16);
  border-left-color: rgba(196, 233, 227, 0.16);
}

main {
  overflow: hidden;
  background: var(--mist);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.34);
}

.hero {
  isolation: isolate;
  border-bottom-color: rgba(198, 241, 235, 0.2);
  background:
    linear-gradient(90deg, rgba(3, 14, 21, 0.96) 0%, rgba(5, 22, 29, 0.82) 40%, rgba(5, 22, 29, 0.28) 69%, rgba(4, 14, 20, 0.14) 100%),
    linear-gradient(0deg, rgba(4, 18, 25, 0.74) 0%, transparent 42%),
    url("assets/lillia/spirit-blossom.jpg") center 34% / cover no-repeat;
  color: var(--white);
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  content: "";
}

.hero::before {
  top: 9%;
  left: 4%;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(114, 230, 220, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 80px rgba(114, 230, 220, 0.08),
    inset 0 0 70px rgba(188, 163, 255, 0.05);
}

.hero::after {
  inset: 0;
  background:
    radial-gradient(circle at 10% 24%, rgba(114, 230, 220, 0.24) 0 1px, transparent 2px),
    radial-gradient(circle at 32% 16%, rgba(243, 166, 212, 0.28) 0 1px, transparent 2px),
    radial-gradient(circle at 43% 68%, rgba(232, 215, 165, 0.25) 0 1px, transparent 2px);
  background-size: 96px 96px, 138px 138px, 170px 170px;
  opacity: 0.65;
}

.hero-number {
  display: none;
}

.hero-copy {
  z-index: 2;
  width: min(820px, 72%);
}

.hero .eyebrow {
  color: var(--aqua);
  text-shadow: 0 0 18px rgba(114, 230, 220, 0.34);
}

.hero h1 {
  color: #f6fffd;
  font-weight: 700;
  line-height: 0.9;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.48);
}

.hero h1 span {
  background: linear-gradient(90deg, var(--aqua), var(--lilac) 55%, var(--pink));
  color: transparent;
  text-shadow: none;
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-intro {
  color: rgba(238, 252, 249, 0.86);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.42);
}

.primary-action {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--aqua), var(--lilac) 62%, var(--pink));
  box-shadow:
    0 12px 32px rgba(94, 78, 167, 0.24),
    0 0 22px rgba(114, 230, 220, 0.15);
  color: var(--night);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-action:hover {
  background: linear-gradient(135deg, #9bf5ec, #cbb8ff 62%, #ffc1e0);
  box-shadow:
    0 16px 38px rgba(94, 78, 167, 0.3),
    0 0 28px rgba(114, 230, 220, 0.24);
  filter: saturate(108%);
  transform: translateY(-2px);
}

.text-action {
  color: var(--red-dark);
  text-decoration-color: rgba(121, 82, 179, 0.4);
}

.hero .text-action {
  color: #e7fbf7;
  text-decoration-color: rgba(114, 230, 220, 0.5);
}

.hero-facts {
  overflow: hidden;
  border-color: rgba(188, 232, 226, 0.24);
  border-radius: 24px 0 0 0;
  background: rgba(5, 22, 29, 0.76);
  box-shadow: 0 -16px 46px rgba(0, 0, 0, 0.17);
  color: var(--white);
  backdrop-filter: blur(16px) saturate(130%);
}

.hero-facts div {
  border-right-color: rgba(188, 232, 226, 0.2);
}

.hero-facts dt {
  color: #a9c9c4;
}

.hero-facts dd {
  color: var(--gold);
  font-family: var(--font-display);
}

.proof-strip {
  border-bottom-color: rgba(180, 224, 217, 0.18);
  background:
    radial-gradient(circle at 15% 50%, rgba(114, 230, 220, 0.1), transparent 34%),
    linear-gradient(100deg, #0b252b, #17243b 60%, #30234a);
  color: #eaf9f6;
}

.proof-strip p {
  border-right-color: rgba(188, 232, 226, 0.17);
}

.quick-section {
  position: relative;
  background:
    linear-gradient(105deg, rgba(4, 17, 25, 0.96), rgba(10, 27, 38, 0.9) 58%, rgba(35, 20, 54, 0.88)),
    url("assets/lillia/night-sprite.jpg") center / cover no-repeat;
  color: var(--white);
}

.quick-section::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(188, 163, 255, 0.18), transparent 24rem),
    radial-gradient(circle at 10% 90%, rgba(114, 230, 220, 0.13), transparent 30rem);
  pointer-events: none;
  content: "";
}

.quick-section > * {
  position: relative;
}

.quick-header .eyebrow,
.quick-index {
  color: var(--pink);
  text-shadow: 0 0 18px rgba(243, 166, 212, 0.26);
}

.quick-header h2,
.quick-grid h3 {
  color: #f8fffd;
}

.quick-header > p,
.quick-grid article > p:not(.quick-index) {
  color: #bdd4d0;
}

.quick-grid,
.quick-jumps {
  gap: 12px;
  border: 0;
}

.quick-grid article,
.quick-jumps a {
  border: 1px solid rgba(177, 225, 219, 0.2);
  border-radius: 18px;
  background: rgba(10, 35, 42, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}

.quick-grid article {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.quick-grid article:hover {
  border-color: rgba(114, 230, 220, 0.44);
  background: rgba(15, 47, 54, 0.7);
  transform: translateY(-3px);
}

.quick-grid article > a {
  color: var(--aqua);
}

.quick-jumps a:hover {
  border-color: rgba(188, 163, 255, 0.45);
  background: rgba(52, 37, 74, 0.68);
}

.quick-jumps span {
  color: #9abcb7;
}

.section {
  position: relative;
  border-bottom-color: rgba(46, 96, 95, 0.16);
  background:
    radial-gradient(circle at 100% 0%, rgba(188, 163, 255, 0.12), transparent 27rem),
    radial-gradient(circle at 0% 100%, rgba(114, 230, 220, 0.11), transparent 30rem),
    linear-gradient(180deg, #f5fbf8, #edf7f3);
}

.section.quick-section {
  background:
    linear-gradient(105deg, rgba(4, 17, 25, 0.96), rgba(10, 27, 38, 0.9) 58%, rgba(35, 20, 54, 0.88)),
    url("assets/lillia/night-sprite.jpg") center / cover no-repeat;
  color: var(--white);
}

#game-plan,
#interaction,
#decklist {
  background:
    radial-gradient(circle at 5% 8%, rgba(114, 230, 220, 0.13), transparent 25rem),
    radial-gradient(circle at 92% 90%, rgba(188, 163, 255, 0.13), transparent 28rem),
    #e8f4f0;
}

#battlefields {
  background:
    linear-gradient(rgba(244, 251, 247, 0.88), rgba(236, 247, 242, 0.94)),
    url("assets/lillia/spring-bloom.jpg") center / cover no-repeat;
}

#gallery {
  background:
    linear-gradient(rgba(242, 250, 246, 0.93), rgba(234, 246, 241, 0.96)),
    url("assets/lillia/dreaming-bloom.jpg") center top / cover no-repeat;
}

#upgrades {
  background:
    linear-gradient(90deg, rgba(244, 251, 247, 0.99) 0%, rgba(238, 248, 244, 0.98) 56%, rgba(232, 243, 240, 0.72) 100%),
    url("assets/lillia/winter-lullaby.jpg") right center / auto 100% no-repeat;
}

#upgrades .section-header,
#upgrades .upgrade-list {
  max-width: 76%;
}

.eyebrow,
.phase-index,
.battlefield-grid span {
  color: var(--red);
}

.section-number {
  color: var(--red);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  text-shadow: 0 8px 24px rgba(121, 82, 179, 0.18);
}

.section-header h2 {
  color: #163c3c;
  font-weight: 700;
}

.section-header > div > p:last-child {
  color: var(--muted);
}

.tab-controls {
  gap: 4px;
  padding: 4px;
  border-color: rgba(80, 118, 117, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 12px 34px rgba(27, 71, 70, 0.08);
}

.tab-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
}

.tab-button.is-active {
  background: linear-gradient(135deg, var(--red), #9a71c9);
  box-shadow: 0 8px 22px rgba(89, 58, 137, 0.22);
  color: var(--white);
}

.mulligan-panel {
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid rgba(57, 108, 105, 0.2);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 48px rgba(29, 74, 71, 0.09);
  backdrop-filter: blur(10px);
}

.mulligan-panel h3 {
  border-bottom-color: rgba(57, 108, 105, 0.18);
  background: linear-gradient(90deg, rgba(114, 230, 220, 0.08), rgba(188, 163, 255, 0.08));
  color: #173f3e;
}

.mulligan-panel ul {
  gap: 12px;
  padding: 14px;
}

.mulligan-panel li {
  border: 1px solid rgba(57, 108, 105, 0.16);
  border-radius: 16px;
  background: rgba(250, 255, 253, 0.78);
}

.mulligan-panel span,
.phase-grid article > p:not(.phase-index, .phase-rule),
.battlefield-grid p,
.matchup-grid p {
  color: var(--muted);
}

.phase-grid,
.battlefield-grid,
.matchup-grid {
  gap: 16px;
  border: 0;
}

.phase-grid article,
.battlefield-grid article,
.matchup-grid article {
  border: 1px solid rgba(50, 105, 101, 0.18);
  border-radius: 22px;
  background: rgba(251, 255, 253, 0.76);
  box-shadow: 0 16px 42px rgba(30, 75, 72, 0.08);
  backdrop-filter: blur(9px);
}

.phase-grid h3,
.battlefield-grid h3,
.matchup-grid h3 {
  color: #173e3d;
}

.phase-rule {
  border-top-color: rgba(50, 105, 101, 0.17);
}

.line-list {
  display: grid;
  gap: 12px;
  border: 0;
}

.line-list details {
  overflow: hidden;
  border: 1px solid rgba(50, 105, 101, 0.19);
  border-radius: 18px;
  background: rgba(251, 255, 253, 0.72);
  box-shadow: 0 12px 34px rgba(30, 75, 72, 0.06);
}

.line-list summary {
  padding-inline: 18px;
}

.line-list summary span,
.line-list summary::after {
  color: var(--red);
}

.line-list summary strong {
  color: #173e3d;
}

.line-list details > div {
  border-top: 1px solid rgba(50, 105, 101, 0.17);
  background:
    linear-gradient(120deg, rgba(114, 230, 220, 0.08), rgba(188, 163, 255, 0.08)),
    rgba(247, 252, 250, 0.92);
}

.interaction-table {
  overflow: hidden;
  border: 1px solid rgba(50, 105, 101, 0.22);
  border-radius: 22px;
  background: rgba(251, 255, 253, 0.76);
  box-shadow: 0 18px 48px rgba(30, 75, 72, 0.08);
}

.table-row > * {
  border-right-color: rgba(50, 105, 101, 0.17);
  border-bottom-color: rgba(50, 105, 101, 0.17);
}

.table-head {
  background: linear-gradient(105deg, #0e3436, #222c4b 68%, #3c2857);
  color: #effcf9;
}

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

.mistakes li {
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgba(50, 105, 101, 0.18);
  border-radius: 18px;
  background: rgba(251, 255, 253, 0.72);
  box-shadow: 0 12px 34px rgba(30, 75, 72, 0.06);
}

.mistakes li > span {
  color: var(--red);
  font-family: var(--font-display);
}

.card-ref {
  text-decoration-color: rgba(121, 82, 179, 0.44);
}

.card-ref:hover {
  color: var(--red-dark);
}

.quick-section .card-ref {
  text-decoration-color: rgba(114, 230, 220, 0.5);
}

.quick-section .card-ref:hover {
  color: var(--aqua);
}

.gallery-toolbar {
  border-color: rgba(73, 117, 115, 0.28);
  border-radius: 20px;
  background: rgba(244, 251, 248, 0.9);
  box-shadow:
    0 16px 42px rgba(25, 64, 64, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(18px) saturate(125%);
}

.gallery-bottomline {
  border-top-color: rgba(73, 117, 115, 0.19);
}

.gallery-search input {
  border-color: rgba(55, 102, 100, 0.32);
  border-radius: 12px 0 0 12px;
  background: rgba(255, 255, 255, 0.86);
}

.gallery-search button {
  border-color: rgba(55, 102, 100, 0.32);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(135deg, rgba(114, 230, 220, 0.22), rgba(188, 163, 255, 0.2));
}

.filter-button,
.view-button {
  border-color: rgba(55, 102, 100, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}

.filter-button:hover,
.view-button:hover {
  border-color: rgba(121, 82, 179, 0.55);
  background: rgba(188, 163, 255, 0.12);
}

.filter-button.is-active,
.view-button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--red), #9270c5);
  box-shadow: 0 8px 20px rgba(89, 58, 137, 0.2);
  color: var(--white);
}

.filter-button span,
.filter-button.is-active span,
.card-tile .quantity {
  color: var(--red);
}

.filter-button.is-active span {
  color: #f7f2ff;
}

.card-gallery {
  gap: 14px;
  margin-top: 16px;
  border: 0;
}

.card-tile {
  border: 1px solid rgba(51, 105, 101, 0.17);
  border-radius: 18px;
  background: rgba(252, 255, 254, 0.82);
  box-shadow: 0 14px 38px rgba(30, 75, 72, 0.08);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.card-tile:hover {
  border-color: rgba(121, 82, 179, 0.36);
  box-shadow:
    0 18px 44px rgba(30, 75, 72, 0.13),
    0 0 24px rgba(188, 163, 255, 0.1);
  transform: translateY(-3px);
}

.card-tile button,
.card-tile img {
  border-radius: 13px;
}

.card-gallery.is-list {
  gap: 12px;
}

.gallery-empty {
  margin-top: 12px;
  border-color: rgba(51, 105, 101, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.decklist-layout {
  gap: 16px;
  border: 0;
}

.deck-columns {
  gap: 12px;
}

.deck-columns article {
  border: 1px solid rgba(51, 105, 101, 0.17);
  border-radius: 16px;
  background: rgba(252, 255, 254, 0.74);
  box-shadow: 0 12px 34px rgba(30, 75, 72, 0.06);
}

.deck-columns h3 {
  color: var(--red);
}

.deck-columns b {
  color: var(--red-dark);
}

.deck-actions {
  border: 1px solid rgba(114, 230, 220, 0.2);
  border-radius: 20px;
  background:
    radial-gradient(circle at 80% 10%, rgba(188, 163, 255, 0.24), transparent 13rem),
    linear-gradient(145deg, #0d3033, #1f2c49 64%, #3d2855);
  box-shadow: 0 18px 44px rgba(15, 45, 48, 0.18);
  color: #eaf9f6;
}

.deck-actions .text-action {
  color: var(--aqua);
}

.upgrade-list {
  display: grid;
  gap: 10px;
  border: 0;
}

.upgrade-list li {
  padding: 14px 18px;
  border: 1px solid rgba(51, 105, 101, 0.18);
  border-radius: 16px;
  background: rgba(252, 255, 254, 0.76);
  box-shadow: 0 10px 28px rgba(30, 75, 72, 0.05);
}

.upgrade-list li::before {
  color: var(--red);
  font-family: var(--font-display);
}

.upgrade-list span {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid rgba(188, 232, 226, 0.18);
  background:
    radial-gradient(circle at 8% 30%, rgba(114, 230, 220, 0.1), transparent 20rem),
    radial-gradient(circle at 90% 50%, rgba(188, 163, 255, 0.12), transparent 24rem),
    linear-gradient(110deg, #071b22, #15263a 62%, #302244);
  color: #effcf9;
}

.site-footer a {
  color: var(--aqua);
  text-decoration-color: rgba(114, 230, 220, 0.4);
}

.legal {
  color: #aec8c4;
}

.card-dialog {
  border-color: rgba(114, 230, 220, 0.35);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 10%, rgba(188, 163, 255, 0.18), transparent 18rem),
    rgba(7, 26, 34, 0.97);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.55),
    0 0 42px rgba(114, 230, 220, 0.12);
  color: #effcf9;
}

.card-dialog::backdrop {
  background: rgba(3, 12, 18, 0.82);
  backdrop-filter: blur(8px);
}

.card-dialog img {
  border-radius: 18px;
}

.card-dialog h2 {
  color: #f7fffd;
}

.card-dialog a {
  color: var(--aqua);
}

.dialog-meta {
  border-color: rgba(188, 232, 226, 0.18);
}

.dialog-close {
  border: 1px solid rgba(114, 230, 220, 0.4);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--aqua), var(--lilac));
  color: var(--night);
}

.card-peek {
  border-color: rgba(114, 230, 220, 0.35);
  border-radius: 18px;
  background: rgba(7, 26, 34, 0.97);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.38),
    0 0 30px rgba(114, 230, 220, 0.12);
  color: #effcf9;
}

.card-peek img {
  border-radius: 12px;
}

.card-peek span {
  color: #a9c9c4;
}

.toast {
  border-color: rgba(114, 230, 220, 0.45);
  border-radius: 999px;
  background: linear-gradient(110deg, #0d3033, #30234a);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  color: #effcf9;
}

@media (max-width: 820px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(3, 15, 22, 0.5) 0%, rgba(5, 22, 29, 0.72) 56%, rgba(5, 20, 27, 0.96) 100%),
      url("assets/lillia/spirit-blossom.jpg") 62% center / cover no-repeat;
  }

  .hero-copy {
    width: 100%;
  }

  .hero-facts {
    border-radius: 0;
    background: rgba(5, 22, 29, 0.93);
  }

  .mistakes ol {
    grid-template-columns: 1fr;
  }

  #upgrades {
    background:
      linear-gradient(rgba(242, 250, 246, 0.93), rgba(234, 246, 241, 0.96)),
      url("assets/lillia/winter-lullaby.jpg") center top / cover no-repeat;
  }

  #upgrades .section-header,
  #upgrades .upgrade-list {
    max-width: none;
  }

  .tab-controls {
    border-radius: 18px;
  }

  .tab-button {
    border-radius: 13px;
  }

  .gallery-toolbar {
    border-radius: 16px;
  }
}

@media (max-width: 560px) {
  .hero h1 {
    font-size: clamp(3.15rem, 14vw, 4.05rem);
  }

  .quick-grid article,
  .quick-jumps a,
  .phase-grid article,
  .battlefield-grid article,
  .matchup-grid article,
  .mulligan-panel,
  .line-list details,
  .interaction-table,
  .mistakes li,
  .card-tile,
  .deck-columns article,
  .deck-actions,
  .upgrade-list li {
    border-radius: 15px;
  }

  .mulligan-panel ul {
    gap: 10px;
    padding: 10px;
  }

  .card-gallery {
    gap: 10px;
  }
}

@media (display-mode: standalone) {
  html {
    scroll-padding-top: calc(var(--header-height) + var(--rail-height) + var(--safe-top) + 16px);
  }

  .site-header {
    padding-top: var(--safe-top);
  }

  .site-footer {
    padding-bottom: calc(42px + var(--safe-bottom));
  }
}

@media (display-mode: standalone) and (max-width: 820px) {
  .mobile-section-rail {
    top: calc(var(--header-height) + var(--safe-top));
  }
}

@media print {
  .site-header,
  .mobile-section-rail,
  .hero-number,
  .hero-actions,
  .gallery-toolbar,
  .card-dialog,
  .card-peek,
  .toast,
  .deck-actions {
    display: none !important;
  }

  body,
  main,
  .site-footer {
    background: var(--white) !important;
  }

  .hero,
  .section,
  .section.quick-section,
  #battlefields,
  #gallery,
  #upgrades {
    background: var(--white) !important;
    color: var(--ink) !important;
  }

  .hero h1,
  .hero h1 span,
  .hero-intro,
  .hero .eyebrow,
  .quick-header h2,
  .quick-grid h3,
  .quick-header > p,
  .quick-grid article > p:not(.quick-index),
  .quick-grid article > a {
    background: none !important;
    color: var(--ink) !important;
    text-shadow: none !important;
    -webkit-text-fill-color: currentColor !important;
  }

  .quick-grid article,
  .quick-jumps a,
  .phase-grid article,
  .battlefield-grid article,
  .matchup-grid article,
  .mulligan-panel,
  .line-list details,
  .interaction-table,
  .mistakes li,
  .card-tile,
  .deck-columns article,
  .upgrade-list li {
    background: var(--white) !important;
    box-shadow: none !important;
    color: var(--ink) !important;
  }

  #upgrades .section-header,
  #upgrades .upgrade-list {
    max-width: none;
  }

  main,
  .site-footer {
    border: 0;
  }

  .section {
    break-inside: avoid;
    padding: 24px 0;
  }

  .card-gallery {
    grid-template-columns: repeat(5, 1fr);
  }
}
