:root {
    color-scheme: dark;
    --bg: #0f172a;
    --panel: #111827;
    --panel-2: #1e293b;
    --text: #f8fafc;
    --muted: #94a3b8;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --border: rgba(148, 163, 184, 0.22);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #1e293b 0, var(--bg) 40%);
    color: var(--text);
}

a { color: inherit; }

.shell { min-height: 100vh; }

.top-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
}

.brand {
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
}

.nav-links a.active,
.nav-links a:hover {
    color: var(--text);
    background: var(--panel-2);
}

.content {
    width: min(1040px, 100%);
    margin: 0 auto;
    padding: 1rem;
}

.hero-card,
.panel,
.collection-card,
.empty-state,
.search-panel,
.set-card,
.tcg-card,
.error-panel {
    border: 1px solid var(--border);
    background: rgba(17, 24, 39, 0.78);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    border-radius: 1.25rem;
}

.hero-card {
    padding: clamp(1.5rem, 4vw, 3.5rem);
    margin-top: 1rem;
}

.hero-card h1 {
    font-size: clamp(2.2rem, 8vw, 4.7rem);
    line-height: 0.96;
    letter-spacing: -0.08em;
    margin: 0 0 1rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    color: #93c5fd;
    font-weight: 800;
}

.hero-actions,
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sticky-page-heading {
    position: sticky;
    top: 4.25rem;
    z-index: 9;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: start;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(18px);
    margin: -0.25rem -0.25rem 1rem;
    padding: 0.75rem;
}

.set-heading-content {
    min-width: 0;
}

.sticky-page-heading h1 {
    margin: 0;
}

.set-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.set-metadata span {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.72);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.25rem 0.55rem;
}

.sticky-set-symbol {
    align-self: center;
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.sticky-back-button {
    align-self: end;
    margin-left: 0;
}

.set-progress {
    align-self: start;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.72);
    margin-top: 1.15rem;
    padding: 0.4rem 0.75rem 0.4rem 0.4rem;
}

.set-progress-chart {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: conic-gradient(#22c55e var(--progress), rgba(148, 163, 184, 0.25) 0);
    position: relative;
}

.set-progress-chart::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: var(--panel);
}

.set-progress-chart span {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    font-weight: 900;
}

.set-progress strong,
.set-progress small {
    display: block;
}

.set-progress small {
    color: var(--muted);
    font-weight: 800;
    text-transform: uppercase;
}

.primary-button,
.secondary-button,
.danger-button,
button {
    border: 0;
    border-radius: 999px;
    padding: 0.78rem 1rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    min-height: 44px;
}

.primary-button {
    background: var(--primary);
    color: white;
}

.primary-button:hover { background: var(--primary-2); }

.secondary-button {
    background: var(--panel-2);
    color: var(--text);
}

.danger-button {
    background: #991b1b;
    color: white;
}

.danger-button:hover:not(:disabled) {
    background: #7f1d1d;
}

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

.grid,
.collection-grid,
.card-grid,
.set-grid {
    display: grid;
    gap: 1rem;
}

.two-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}

.collection-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 1rem;
}

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

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

.panel,
.collection-card,
.empty-state,
.search-panel,
.set-card,
.tcg-card,
.error-panel {
    padding: 1rem;
}

.collection-card h2,
.set-card h3,
.tcg-card h3,
.panel h2 {
    margin-top: 0;
}

.collection-card p,
.set-card p,
.tcg-card p,
.panel p,
.hero-card p {
    color: var(--muted);
}

.collection-link-card {
    color: inherit;
    display: block;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.collection-link-card:hover,
.collection-link-card:focus-visible {
    border-color: rgba(147, 197, 253, 0.8);
    box-shadow: 0 20px 48px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}

.home-set-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.home-set-preview {
    display: grid;
    place-items: center;
    min-height: 86px;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(30, 41, 59, 0.52);
    color: var(--text);
    padding: 0.75rem;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-set-preview:hover,
.home-set-preview:focus-visible {
    border-color: rgba(147, 197, 253, 0.8);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.18);
    transform: translateY(-2px);
}

.home-set-preview img {
    max-width: 100%;
    max-height: 54px;
    object-fit: contain;
}

.home-set-preview span {
    font-weight: 900;
}

.home-collection-preview-grid {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.75rem;
}

.home-collection-preview {
    display: grid;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(30, 41, 59, 0.52);
    color: var(--text);
    padding: 0.75rem;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.home-collection-preview:hover,
.home-collection-preview:focus-visible {
    border-color: rgba(147, 197, 253, 0.8);
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.18);
    transform: translateY(-2px);
}

.home-collection-preview small {
    color: var(--muted);
}

.home-collection-strip {
    display: flex;
    gap: 0.3rem;
    overflow: hidden;
}

.home-collection-strip img {
    width: 34px;
    border-radius: 0.25rem;
}

.collection-manage-card {
    display: grid;
    gap: 0.85rem;
}

.collection-manage-card .danger-button {
    justify-self: end;
}

.search-panel,
.catalog-section {
    margin-top: 1rem;
}

.set-search-panel {
    position: relative;
    margin-bottom: 4rem;
    padding: 1rem;
    overflow: visible;
}

.set-search-panel::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: min(360px, calc(100% - 2rem));
    height: 2px;
    background: rgba(17, 24, 39, 0.78);
    transform: translateX(-50%);
    z-index: 2;
}

.advanced-filter-toggle {
    position: absolute;
    left: 50%;
    bottom: -47px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: min(360px, calc(100% - 2rem));
    min-height: 48px;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 1.1rem 1.1rem;
    background: rgba(17, 24, 39, 0.78);
    color: var(--text);
    padding: 0.65rem 1.25rem;
    transform: translateX(-50%);
    z-index: 1;
}

.advanced-filter-toggle:hover,
.advanced-filter-toggle:focus-visible {
    background: rgba(37, 99, 235, 0.35);
}

.advanced-filter-arrow {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.advanced-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    margin: 1rem 0 0;
    padding: 1rem 0 0;
}

.advanced-filter-grid label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 800;
}

.advanced-filter-grid select {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.form-row + .form-row {
    margin-top: 0.85rem;
}

.form-row label {
    color: var(--muted);
    font-weight: 700;
}

.form-row input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.form-row select,
.ownership-filter {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.auth-panel {
    margin-top: 1rem;
}

.form-stack {
    display: grid;
    gap: 0.85rem;
}

.form-stack label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 800;
}

.form-stack input,
.form-stack select {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.section-heading,
.set-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.image-card {
    background-image: var(--card-bg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.text-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(37, 99, 235, 0.18));
}

.text-card h3 {
    color: var(--text);
}

.card-link {
    color: inherit;
    min-height: 148px;
    text-decoration: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-link:hover,
.card-link:focus-visible {
    border-color: rgba(147, 197, 253, 0.8);
    box-shadow: 0 20px 48px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}

.stacked-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.section-heading span,
.tcg-card small,
.set-card small {
    color: var(--muted);
}

.tcg-card img {
    width: 100%;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
}

.card-tile-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-tile-heading h3,
.card-tile-heading p {
    margin: 0;
}

.card-tile-heading h3 {
    text-align: left;
}

.card-tile-heading p {
    flex-shrink: 0;
    font-weight: 800;
    text-align: right;
}

.card-detail-button {
    position: relative;
    color: inherit;
    text-align: left;
    width: 100%;
}

.card-tile {
    position: relative;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-tile:hover,
.card-tile:focus-within {
    border-color: rgba(147, 197, 253, 0.8);
    box-shadow: 0 20px 48px rgba(37, 99, 235, 0.22);
    transform: translateY(-2px);
}

.selected-card {
    border-color: rgba(96, 165, 250, 0.95);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 20px 48px rgba(37, 99, 235, 0.22);
}

.selected-card::after {
    content: "?";
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 900;
}

.multi-select-toolbar {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    right: 0.75rem;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    pointer-events: none;
}

.multi-select-toolbar > * {
    pointer-events: auto;
}

.multi-select-toolbar span {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    font-weight: 900;
    padding: 0.65rem 1rem;
}

.multi-select-close,
.multi-select-menu-button {
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.92);
    color: var(--text);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    font-size: 1.35rem;
    line-height: 1;
    min-width: 44px;
}

.multi-select-menu {
    position: absolute;
    top: 3.4rem;
    right: 0;
    display: grid;
    gap: 0.65rem;
    width: min(300px, calc(100vw - 1.5rem));
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    padding: 0.85rem;
}

.multi-select-menu label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 800;
}

.multi-select-menu select {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.65rem 0.85rem;
}

.card-image-toggle {
    position: relative;
    display: block;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    padding: 0;
}

.card-image-shell {
    position: relative;
}

.card-image-toggle img {
    display: block;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.variant-badge-list {
    position: absolute;
    left: 0.45rem;
    right: 0.45rem;
    bottom: 1.2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    pointer-events: none;
}

.variant-badge {
    border: 1px solid rgba(248, 250, 252, 0.48);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.34);
    color: rgba(248, 250, 252, 0.9);
    font-size: 0.65rem;
    font-weight: 900;
    min-height: 28px;
    padding: 0.2rem 0.45rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    pointer-events: auto;
}

.variant-badge.owned {
    border-color: rgba(134, 239, 172, 0.88);
    background: rgba(22, 101, 52, 0.78);
    color: #dcfce7;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.variant-badge:hover,
.variant-badge:focus-visible {
    border-color: rgba(147, 197, 253, 0.95);
    background: rgba(37, 99, 235, 0.72);
}

.default-owned-card .card-image-toggle img {
    filter: saturate(1.15) brightness(1.08);
}

.default-not-owned-card .card-image-toggle img {
    opacity: 0.72;
    filter: grayscale(0.35);
}

.card-tile-heading {
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    min-height: 0;
    padding: 0;
}

.owned-badge {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1;
    border: 1px solid rgba(134, 239, 172, 0.45);
    border-radius: 999px;
    background: rgba(22, 101, 52, 0.9);
    color: #dcfce7;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0.25rem 0.55rem;
    text-transform: uppercase;
}

.quantity-badge {
    position: absolute;
    left: 0.65rem;
    top: 0.65rem;
    z-index: 1;
    border: 1px solid rgba(147, 197, 253, 0.5);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.9);
    color: white;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 0.confirm-dialog,
.25rem 0.55rem;
}

.card-detail-button:hover,
.card-detail-button:focus-visible {
    border-color: rgba(147, 197, 253, 0.8);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(8px);
}

.card-detail-modal,
.modal-loading {
   
.confirm-dialog {
    width: min(420px, 100%);
    padding: 1.25rem;
}

.confirm-dialog h2 {
    margin-top: 0;
}

.confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
}
 border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 1.25rem;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.card-detail-modal {
    position: relative;
    width: min(980px, 100%);
    max-height: min(92vh, 980px);
    overflow: auto;
    padding: 1rem;
}

.modal-loading {
    padding: 1.25rem;
    font-weight: 800;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1;
    background: var(--panel-2);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    min-width: 44px;
}

.card-detail-layout {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: 1.25rem;
}

.card-detail-image {
    width: 100%;
    border-radius: 1rem;
}

.card-detail-content h2 {
    margin: 0 2.75rem 0.35rem 0;
}

.variant-ownership {
    margin: 1rem 0;
}

.variant-ownership h3 {
    margin: 0 0 0.65rem;
}

.variant-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 0.65rem;
}

.variant-toggle {
    display: grid;
    gap: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem;
    text-align: left;
}

.variant-toggle span {
    font-weight: 900;
}

.variant-toggle small {
    color: var(--muted);
}

.variant-toggle.owned {
    border-color: rgba(134, 239, 172, 0.55);
    background: #166534;
    color: #dcfce7;
}

.variant-toggle.owned small {
    color: #bbf7d0;
}

.collection-picker {
    margin: 1rem 0;
}

.collection-picker h3 {
    margin: 0 0 0.65rem;
}

.collection-create-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.collection-create-row input {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.collection-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.65rem;
}

.collection-dropdown {
    position: relative;
    margin-bottom: 0.75rem;
}

.collection-dropdown-toggle {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    text-align: left;
}

.collection-dropdown-menu {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--panel);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
    margin-top: 0.35rem;
    padding: 0.35rem;
}

.collection-checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border-radius: 0.65rem;
    cursor: pointer;
    padding: 0.55rem;
}

.collection-checkbox-row:hover {
    background: var(--panel-2);
}

.collection-checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.collection-add-row {
    display: grid;
    grid-template-columns: minmax(110px, 150px) auto;
    align-items: end;
    gap: 0.75rem;
}

.collection-add-row label {
    display: grid;
    gap: 0.3rem;
    color: var(--muted);
    font-weight: 800;
}

.collection-add-row input {
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem 1rem;
}

.collection-add-button {
    display: grid;
    gap: 0.2rem;
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: var(--panel-2);
    color: var(--text);
    padding: 0.75rem;
    text-align: left;
}

.collection-add-button small {
    color: var(--muted);
}

.collection-create-panel {
    margin-bottom: 1rem;
}

.collection-item-strip {
    display: flex;
    gap: 0.35rem;
    margin: 0.75rem 0;
    overflow-x: auto;
}

.collection-item-strip img {
    width: 48px;
    border-radius: 0.35rem;
}

.muted,
.card-description,
.attack-list p {
    color: var(--muted);
}

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

.metadata-list div,
.attack-list article {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(30, 41, 59, 0.52);
    padding: 0.75rem;
}

.metadata-list dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metadata-list dd {
    margin: 0.2rem 0 0;
}

.attack-list {
    display: grid;
    gap: 0.75rem;
}

.attack-list article {
    display: grid;
    gap: 0.35rem;
}

.attack-list span {
    color: #93c5fd;
    font-weight: 800;
}

.type-icon-row,
.matchup-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.type-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

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

.matchup-grid section {
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    background: rgba(30, 41, 59, 0.52);
    padding: 0.75rem;
}

.matchup-grid h3 {
    margin: 0 0 0.65rem;
}

.matchup-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.52);
    padding: 0.25rem 0.55rem 0.25rem 0.3rem;
}

.set-card img {
    max-width: 56px;
    max-height: 56px;
    object-fit: contain;
}

.error-panel {
    border-color: rgba(248, 113, 113, 0.5);
    color: #fecaca;
    margin: 1rem 0;
}

.loading-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #7f1d1d;
    color: white;
    padding: 0.8rem 1rem;
}

@media (max-width: 700px) {
    .top-bar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sticky-page-heading {
        top: 7.75rem;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .sticky-set-symbol {
        display: none;
    }

    .set-progress {
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    .sticky-back-button {
        justify-self: end;
    }

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

    .two-column {
        grid-template-columns: 1fr;
    }

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

    .advanced-filter-toggle {
        min-width: calc(100% - 1.5rem);
        bottom: -48px;
    }

    .card-detail-layout {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 0.85rem;
    }
}
