/* Impeccable refinement: preserve card artwork and field geometry. */
:root{--ui-ease:cubic-bezier(.22,1,.36,1)}
::selection{background:var(--t-active);color:var(--t-text)}
input,textarea{caret-color:var(--t-focus)}
:is(button,a,input,textarea,select,summary):focus-visible{outline:2px solid var(--t-focus);outline-offset:3px}
:is(button,input,textarea,select){font-variant-numeric:tabular-nums}
button:disabled{cursor:not-allowed}
:is(.cd-sets,.hy-list,.dm-results,.rd-admin-menu){scrollbar-width:thin;scrollbar-color:var(--t-control) transparent;overscroll-behavior:contain}
.cards-page .cd-hero{background:var(--t-surface);justify-items:start;text-align:left;padding:24px;gap:16px}
.cards-page .cd-hero h1{font-size:24px;font-weight:650;line-height:1.3}
.cards-page .cd-hero-search{width:min(720px,100%)}
.cards-page .cd-hero-tiles{max-width:none;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0}
.cards-page .cd-hero-tiles button{min-height:64px;border-radius:8px;padding:12px;gap:8px}
.cards-page .cd-hero-tiles span{font-size:12px;line-height:1.5}
.cards-page .cd-hero-tiles button:is(:hover,:focus-visible){background:var(--t-raised);color:var(--t-text)}
.cards-page .cd-hero-tiles b{min-width:0;flex-wrap:wrap;line-height:1.4}
.cards-page .cd-listhead{flex-wrap:wrap;row-gap:8px}
.cards-page .cd-info{overflow-wrap:anywhere;line-height:1.6}
.cards-page .cd-faces button{min-height:36px}
/* Keep hover and selection visibly different; selection persists after moving away. */
.cards-page{--card-hover:#263854;--card-hover-ink:#fff;--card-selected:#415e9b;--card-selected-ink:#fff}
html[data-theme="light"] .cards-page{--card-hover:#d1def6;--card-hover-ink:var(--t-text);--card-selected:#294f9c;--card-selected-ink:#fff}
.cards-page .cd-card{isolation:isolate}
.cards-page .cd-card>span{position:relative;z-index:1;opacity:1;padding:4px 6px;border-radius:0 0 4px 4px}
.cards-page .cd-card:is(:hover,:focus-visible){background:var(--card-hover);color:var(--card-hover-ink)}
.cards-page .cd-card[aria-current="true"]{background:var(--card-selected);color:var(--card-selected-ink)}
.cards-page .cd-card[aria-current="true"]>span{color:var(--card-selected-ink)}
.cards-page .cd-card[aria-current="true"] img{outline:2px solid var(--card-selected);outline-offset:2px}
.cards-page .cd-sets button[aria-current="true"]{background:var(--card-selected);color:var(--card-selected-ink)}
.cards-page .cd-sets button[aria-current="true"] small{color:inherit}
.cards-page .cd-sets button[aria-current="true"] .cd-set-kind{color:inherit}
.cd-stats .cd-combat-icon{width:18px;height:18px;flex:none;color:var(--t-muted)}
.cd-stats .cd-stat-label{font-size:11px;font-weight:500;color:var(--t-muted)}
.cd-stats .cd-stat{gap:4px}
.cd-detail>.cd-status{margin:0 0 4px;padding:0;display:flex;flex-wrap:wrap;gap:4px}
/* Setup only. No rules here target the duel field, card image, or engine choices. */
body[data-practice-theme] .practice-setup{max-width:1120px}
.practice-setup :is(h1,h2){text-wrap:balance}
.practice-setup :is(button,select,summary){min-height:40px}
.practice-setup input[type=checkbox]{accent-color:var(--t-primary);width:18px;height:18px;flex:none}
.practice-setup .practice-traps label{min-height:44px;align-items:center;gap:8px}
.practice-setup footer{padding:16px 0;gap:12px}
.practice-setup footer button{min-height:44px;padding:8px 16px}
.practice-setup>header>p{color:var(--t-muted);max-width:65ch}
@media(min-width:880px){
 .practice-setup{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;align-items:start;align-content:start}
 .practice-setup>header,.practice-setup>footer,.practice-setup>p,.practice-setup>a,.practice-setup>.practice-error,.practice-setup>.practice-more,.practice-setup>.practice-start{grid-column:1/-1}
 .practice-setup>section{margin:0}
 .practice-setup:not(:has(.md-opening-grid))>section:has(.practice-traps){grid-column:2;grid-row:2/span 2}
 .practice-setup>section:has(.md-opening-grid){grid-column:1/-1}
 .practice-setup .practice-traps{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
 .cards-page .cd-hero{padding:16px;gap:12px}
 .cards-page .cd-hero h1{font-size:20px}
 .cards-page .cd-hero-tiles button{min-height:44px}
 .cards-page .cd-hero-tiles b{font-size:13px}
 .cards-page .cd-hero-tiles span{display:none}
 .topbar .viewnav a{min-height:40px;flex-direction:column;justify-content:center;gap:2px;line-height:1.2}
 .practice-setup :is(button,select,summary){min-height:44px}
}
@media(prefers-reduced-motion:reduce){:root{scroll-behavior:auto} .home-feature-cta svg{transition:none!important}}
