/* ---------------------------------------------------------------- tokens */

:root {
    --bg: #0c0e16;
    --bg-raised: #151926;
    --bg-sunken: #090b12;
    --line: #262c3d;
    --line-soft: #1d2230;

    --text: #e8ecf5;
    --text-dim: #98a2ba;
    --text-faint: #6b758d;

    --gold: #d9a441;
    --gold-bright: #f0c069;
    --accent: #6ea8fe;

    --green: #4ec97f;
    --red: #f2555a;
    --amber: #e8a33d;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);

    color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(1100px 620px at 50% -12%, #1b2138 0%, transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: Inter, 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code {
    font-family: 'Cascadia Code', ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: .88em;
    background: var(--bg-sunken);
    border: 1px solid var(--line-soft);
    border-radius: 5px;
    padding: .1em .4em;
    color: var(--gold-bright);
}

h1, h2, h3 {
    font-family: Cinzel, Georgia, 'Times New Roman', serif;
    letter-spacing: .01em;
    line-height: 1.2;
    margin: 0;
}

/* Blazor focuses the heading after navigation; don't paint a ring around it. */
h1:focus, h2:focus {
    outline: none;
}

.dim {
    color: var(--text-dim);
}

/* ----------------------------------------------------------------- shell */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px clamp(16px, 4vw, 40px);
    background: rgba(12, 14, 22, .82);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: Cinzel, Georgia, serif;
    font-size: 18px;
    letter-spacing: .04em;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    color: var(--gold);
    font-size: 20px;
    text-shadow: 0 0 14px rgba(217, 164, 65, .55);
}

.brand-text b {
    color: var(--gold);
    font-weight: 700;
}

.topnav {
    display: flex;
    gap: 22px;
    font-size: 14px;
}

.topnav a {
    color: var(--text-dim);
}

.topnav a:hover,
.topnav a.active {
    color: var(--gold);
    text-decoration: none;
}

.content {
    flex: 1;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 28px clamp(16px, 4vw, 40px) 60px;
}

.site-foot {
    border-top: 1px solid var(--line);
    padding: 20px clamp(16px, 4vw, 40px);
    color: var(--text-faint);
    font-size: 12.5px;
    text-align: center;
}

/* ------------------------------------------------------------------ hero */

.hero {
    text-align: center;
    padding: 26px 0 34px;
}

.hero h1 {
    font-size: clamp(28px, 5vw, 44px);
    color: var(--gold);
    text-shadow: 0 2px 26px rgba(217, 164, 65, .22);
}

.hero-sub {
    margin: 10px auto 24px;
    max-width: 620px;
    color: var(--text-dim);
}

.searchbar {
    display: flex;
    gap: 10px;
    max-width: 760px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    min-width: 0;
    padding: 13px 16px;
    font: inherit;
    color: var(--text);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.search-input::placeholder {
    color: var(--text-faint);
}

.search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217, 164, 65, .16);
}

/* --------------------------------------------------------------- buttons */

.btn {
    padding: 12px 20px;
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s, background .15s, border-color .15s;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:disabled {
    opacity: .55;
    cursor: default;
}

.btn.primary {
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    color: #241b06;
}

.btn.ghost {
    background: var(--bg-raised);
    border-color: var(--line);
    color: var(--text);
    display: inline-block;
}

.btn.ghost:hover:not(:disabled) {
    border-color: var(--gold);
    color: var(--gold);
}

.btn.full {
    width: 100%;
    margin-top: 12px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.chip {
    padding: 6px 14px;
    font: inherit;
    font-size: 13px;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
    transition: all .15s;
}

.chip:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(217, 164, 65, .07);
}

/* ---------------------------------------------------------------- edhrec */

.hero.compact {
    padding: 18px 0 24px;
}

.edhrec {
    margin-bottom: 26px;
    padding: 18px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.salt-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.salt-head b {
    font-family: Cinzel, Georgia, serif;
    font-size: 20px;
    color: var(--gold);
}

.salt-track {
    height: 7px;
    margin: 7px 0 6px;
    border-radius: 999px;
    background: var(--bg-sunken);
    overflow: hidden;
}

.salt-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #4ec97f, var(--gold) 55%, var(--red));
}

.edhrec small {
    color: var(--text-faint);
    font-size: 11.5px;
}

.edhrec-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.flag {
    padding: 3px 10px;
    font-size: 11.5px;
    color: var(--text-dim);
    background: var(--bg-sunken);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.flag-strong {
    color: #241b06;
    background: linear-gradient(180deg, var(--gold-bright), var(--gold));
    border-color: transparent;
    font-weight: 600;
}

.edhrec-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.tag {
    padding: 3px 10px;
    font-size: 11.5px;
    color: var(--accent);
    background: rgba(110, 168, 254, .08);
    border: 1px solid rgba(110, 168, 254, .3);
    border-radius: 999px;
}

.tag:hover {
    text-decoration: none;
    border-color: var(--accent);
    background: rgba(110, 168, 254, .16);
}

.chip-on {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(217, 164, 65, .1);
}

.chip-count {
    color: var(--text-faint);
    font-size: 11px;
    margin-left: 4px;
}

/* ------------------------------------------------------------ auth / admin */

.signed-in {
    color: var(--text-faint);
    font-size: 13px;
}

.logout-form {
    display: inline;
}

.linklike {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 14px;
    color: var(--text-dim);
    cursor: pointer;
}

.linklike:hover {
    color: var(--gold);
}

.auth-card {
    max-width: 400px;
    margin: 40px auto;
    padding: 28px 30px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.auth-card h1 {
    font-size: 24px;
    color: var(--gold);
    margin-bottom: 20px;
}

.field {
    display: block;
    margin-bottom: 16px;
}

.field > span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.field small {
    text-transform: none;
    letter-spacing: 0;
}

.field-row {
    display: flex;
    gap: 8px;
}

.field-row .search-input {
    flex: 1;
    min-width: 0;
}

.field-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-right: 14px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-dim);
}

.validation-message {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--red);
}

.admin-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.admin-panel {
    padding: 18px;
    margin-bottom: 20px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-panel h3 {
    font-size: 15px;
    color: var(--gold);
    margin-bottom: 14px;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 18px;
}

.role-picker {
    display: flex;
    flex-wrap: wrap;
}

.admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.btn.danger:hover:not(:disabled) {
    border-color: var(--red);
    color: var(--red);
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.admin-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
    background: var(--bg-sunken);
    white-space: nowrap;
}

.admin-table td {
    padding: 10px 14px;
    border-top: 1px solid var(--line-soft);
    vertical-align: middle;
}

.admin-table tr.row-locked td {
    opacity: .6;
}

.admin-table tr.row-editor td {
    background: var(--bg-sunken);
    padding: 14px;
}

.role-tag {
    display: inline-block;
    padding: 2px 8px;
    margin-right: 4px;
    font-size: 11px;
    color: var(--gold);
    border: 1px solid rgba(217, 164, 65, .4);
    border-radius: 999px;
}

.status-active { color: var(--green); font-size: 12px; }
.status-locked { color: var(--red); font-size: 12px; }

.you {
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--accent);
    border: 1px solid rgba(110, 168, 254, .4);
    border-radius: 999px;
}

/* --------------------------------------------------------------- brackets */

/* Bracket 1 reads as unrestricted, 5 as most restricted. */
.bracket-1 { --bracket-hue: #4ec97f; }
.bracket-2 { --bracket-hue: #9ad04b; }
.bracket-3 { --bracket-hue: var(--gold); }
.bracket-4 { --bracket-hue: #e8853d; }
.bracket-5 { --bracket-hue: var(--red); }

.bracket-badge {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 18px;
    margin-bottom: 26px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-left: 3px solid var(--bracket-hue, var(--line));
    border-radius: var(--radius);
}

.bracket-mark {
    display: flex;
    align-items: baseline;
    color: var(--bracket-hue, var(--text));
    font-family: Cinzel, Georgia, serif;
    line-height: 1;
}

.bracket-num {
    font-size: 34px;
    font-weight: 700;
}

.bracket-plus {
    font-size: 18px;
}

.bracket-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.bracket-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.reason {
    padding: 2px 9px;
    font-size: 11px;
    color: var(--bracket-hue, var(--text-dim));
    border: 1px solid currentColor;
    border-radius: 999px;
    opacity: .9;
}

.bracket-caveat {
    margin: 10px 0 0;
    font-size: 11.5px;
    color: var(--text-faint);
    line-height: 1.5;
}

.bracket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 34px;
}

.bracket-card {
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-top: 3px solid var(--bracket-hue, var(--line));
    border-radius: var(--radius);
}

.bracket-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.bracket-card-head h3 {
    font-size: 16px;
    color: var(--bracket-hue, var(--gold));
}

.bracket-card-head .bracket-num {
    font-size: 30px;
    color: var(--bracket-hue, var(--text));
}

.bracket-summary {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.bracket-rules {
    margin: 0 0 12px;
    display: grid;
    gap: 5px;
}

.bracket-rules > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12.5px;
}

.bracket-rules dt {
    color: var(--text-faint);
}

.bracket-rules dd {
    margin: 0;
    text-align: right;
}

.bracket-quote {
    margin: 0 0 14px;
    padding-left: 12px;
    border-left: 2px solid var(--line);
    font-size: 11.5px;
    font-style: italic;
    color: var(--text-faint);
    line-height: 1.5;
}

.bracket-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    font-size: 12px;
}

.btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

.bracket-cards {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.bracket-tile {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bracket-tile .tile-art {
    display: block;
}

/* ---------------------------------------------------------------- combos */

.section-count {
    margin-left: 8px;
    padding: 2px 9px;
    font-size: 11px;
    letter-spacing: 0;
    color: var(--gold);
    background: rgba(217, 164, 65, .1);
    border: 1px solid rgba(217, 164, 65, .35);
    border-radius: 999px;
    vertical-align: 2px;
}

.combo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 8px;
}

/* Long lists scroll inside themselves rather than stretching the page. */
.scroller {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.scroller::-webkit-scrollbar {
    width: 9px;
}

.scroller::-webkit-scrollbar-track {
    background: transparent;
}

.scroller::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 999px;
}

.scroller::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

.combo-list.scroller {
    max-height: 560px;
    padding-right: 8px;
}

.synergy-list.scroller {
    max-height: 420px;
    padding-right: 8px;
}

.combo {
    padding: 12px 16px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.combo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.combo-cards {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
}

.combo-plus {
    margin: 0 6px;
    color: var(--text-faint);
    font-weight: 400;
}

/* The card being viewed, picked out of its own combo. */
.combo-self {
    color: var(--gold);
}

.combo-produces {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.produces {
    padding: 3px 10px;
    font-size: 11.5px;
    color: var(--green);
    background: rgba(78, 201, 127, .09);
    border: 1px solid rgba(78, 201, 127, .28);
    border-radius: 999px;
}

.combo-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    font-size: 11.5px;
    color: var(--text-faint);
}

.combo-more {
    margin: 0 0 26px;
    font-size: 12.5px;
}

/* ------------------------------------------------- commander synergy lists */

.synergy-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.synergy-col {
    padding: 16px 18px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.synergy-col h3 {
    font-size: 15px;
    color: var(--gold);
    margin-bottom: 4px;
}

.synergy-blurb {
    margin: 0 0 12px;
    font-size: 11.5px;
    color: var(--text-faint);
    line-height: 1.45;
}

.synergy-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: syn;
}

.synergy-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line-soft);
    font-size: 13.5px;
}

.synergy-list li:last-child {
    border-bottom: none;
}

.synergy-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.synergy-name a {
    color: var(--text);
}

.synergy-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.inclusion {
    font-size: 11.5px;
    color: var(--text-faint);
    font-variant-numeric: tabular-nums;
}

.synergy-badge {
    min-width: 58px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--green);
}

.synergy-badge.negative {
    color: var(--text-faint);
}

.salt-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.salt-row {
    display: grid;
    grid-template-columns: 30px 46px 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.salt-rank {
    font-family: Cinzel, Georgia, serif;
    color: var(--text-faint);
    text-align: right;
}

.salt-thumb {
    display: block;
    width: 46px;
    aspect-ratio: 488 / 680;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-sunken);
}

.salt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.salt-main .salt-track {
    margin: 6px 0 0;
    max-width: 420px;
}

.salt-name {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 600;
}

.salt-name a {
    color: var(--text);
}

.salt-score {
    font-family: Cinzel, Georgia, serif;
    font-size: 19px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
    .salt-row {
        grid-template-columns: 24px 38px 1fr auto;
        gap: 10px;
        padding: 8px 10px;
    }

    .salt-thumb { width: 38px; }
}

.stored-note {
    margin: 18px 0 0;
    font-size: 12.5px;
    color: var(--text-faint);
}

.stored-note b {
    color: var(--gold);
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: var(--text-dim);
    font-size: 14px;
}

/* --------------------------------------------------------------- results */

.results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 14px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.results-count b {
    color: var(--gold);
    font-size: 18px;
}

.results-controls {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-dim);
}

.results-controls label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.results-controls select {
    padding: 7px 10px;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
    gap: 20px;
}

.card-tile {
    display: flex;
    flex-direction: column;
    gap: 9px;
    color: var(--text);
    transition: transform .16s ease;
}

.card-tile:hover {
    transform: translateY(-5px);
    text-decoration: none;
}

.tile-art {
    position: relative;
    aspect-ratio: 488 / 680;
    border-radius: 4.75% / 3.5%;
    overflow: hidden;
    background: var(--bg-sunken);
    box-shadow: var(--shadow);
}

.tile-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-tile:hover .tile-art {
    box-shadow: 0 14px 34px rgba(0, 0, 0, .6), 0 0 0 1px var(--gold);
}

.tile-noart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 100%;
    padding: 16px;
    text-align: center;
    color: var(--text-dim);
    border: 1px dashed var(--line);
    border-radius: inherit;
}

.tile-noart small {
    color: var(--text-faint);
    font-size: 11px;
}

.tile-rarity {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    background: rgba(9, 11, 18, .85);
    border: 1px solid currentColor;
}

.rarity-common { color: #b8bcc4; }
.rarity-uncommon { color: #9fb4c7; }
.rarity-rare { color: var(--gold); }
.rarity-mythic { color: #f0640c; }
.rarity-special, .rarity-bonus { color: #c77dff; }

.rarity-text {
    font-weight: 600;
}

.tile-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
}

.tile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tile-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-sub {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: var(--text-faint);
    font-size: 12px;
}

.tile-sub span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tile-price {
    color: var(--green);
    flex-shrink: 0;
}

.load-more {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

/* ----------------------------------------------------------- mana symbols */

.mana-cost {
    display: inline-flex;
    gap: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.mana-symbol {
    width: 15px;
    height: 15px;
    vertical-align: -2px;
}

.mana-cost.large .mana-symbol {
    width: 22px;
    height: 22px;
}

.mana-symbol.inline {
    margin: 0 1px;
}

/* ---------------------------------------------------------------- detail */

.detail {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 40px;
    align-items: start;
}

.detail-art {
    position: sticky;
    top: 84px;
}

.art-frame {
    aspect-ratio: 488 / 680;
    border-radius: 4.75% / 3.5%;
    overflow: hidden;
    background: var(--bg-sunken);
    box-shadow: var(--shadow);
}

.art-frame img {
    width: 100%;
    display: block;
}

.price-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.price {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.price-label {
    font-size: 10.5px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.price-value {
    font-weight: 600;
    color: var(--green);
}

.face {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line-soft);
}

.face:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
}

.face-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.face-head h1 {
    font-size: clamp(22px, 3.4vw, 32px);
    color: var(--gold);
}

.type-line {
    margin: 6px 0 14px;
    color: var(--text-dim);
    font-weight: 500;
}

.oracle p {
    margin: 0 0 10px;
}

.oracle p:last-child {
    margin-bottom: 0;
}

.flavor {
    margin: 14px 0 0;
    padding-left: 14px;
    border-left: 2px solid var(--line);
    color: var(--text-dim);
    font-style: italic;
    white-space: pre-line;
}

.stat-line {
    margin: 14px 0 0;
    font-family: Cinzel, Georgia, serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
}

.keyword-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
}

.keyword {
    padding: 3px 10px;
    font-size: 12px;
    color: var(--text-dim);
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 22px;
    margin: 0 0 26px;
    padding: 18px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.meta-grid dt {
    font-size: 10.5px;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 2px;
}

.meta-grid dd {
    margin: 0;
    font-size: 14px;
}

.section-head {
    font-size: 15px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 0 0 12px;
}

.legality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 8px;
    margin-bottom: 26px;
}

.legality {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12.5px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
}

.legality-format {
    color: var(--text-dim);
}

.legality-status {
    font-weight: 600;
    font-size: 11.5px;
}

.legality-legal { border-left-color: var(--green); }
.legality-legal .legality-status { color: var(--green); }

.legality-not_legal { border-left-color: var(--line); }
.legality-not_legal .legality-status { color: var(--text-faint); }

.legality-banned { border-left-color: var(--red); }
.legality-banned .legality-status { color: var(--red); }

.legality-restricted { border-left-color: var(--amber); }
.legality-restricted .legality-status { color: var(--amber); }

.link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}

.rulings {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rulings li {
    padding: 12px 16px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.ruling-date {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: .05em;
    color: var(--text-faint);
}

.ruling-text p {
    margin: 0 0 6px;
}

/* -------------------------------------------------------- starter / notes */

.starter {
    max-width: 780px;
    margin: 10px auto 0;
    padding: 26px 30px;
    background: var(--bg-raised);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.starter h2 {
    font-size: 17px;
    color: var(--gold);
    margin-bottom: 16px;
}

.cheats {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 9px 24px;
}

.cheats li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13.5px;
}

.cheats span {
    color: var(--text-dim);
}

.notice {
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--bg-raised);
    margin-bottom: 22px;
}

.notice.error {
    border-color: rgba(242, 85, 90, .45);
    background: rgba(242, 85, 90, .09);
}

/* -------------------------------------------------------------- skeletons */

@keyframes shimmer {
    0% { opacity: .45; }
    50% { opacity: .8; }
    100% { opacity: .45; }
}

.skeleton, .skeleton-line {
    background: var(--bg-raised);
    animation: shimmer 1.3s ease-in-out infinite;
}

.card-tile.skeleton {
    background: none;
}

.card-tile.skeleton .tile-art {
    background: var(--bg-raised);
}

.skeleton-line {
    display: block;
    height: 13px;
    border-radius: 4px;
    margin-bottom: 9px;
}

.skeleton-line.wide {
    height: 26px;
    width: 55%;
}

/* ------------------------------------------------------------ error strip */

#blazor-error-ui {
    color-scheme: light only;
    background: #ffe17d;
    color: #2b2b2b;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 860px) {
    .detail {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .detail-art {
        position: static;
        max-width: 330px;
        margin: 0 auto;
    }
}

@media (max-width: 620px) {
    .searchbar {
        flex-wrap: wrap;
    }

    .search-input {
        flex-basis: 100%;
    }

    .btn {
        flex: 1;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .topnav {
        gap: 14px;
        font-size: 13px;
    }
}
