/* Remove decorative edges without changing control fills or useful row dividers. */
button,select,.panel,.library-card,.saved-deck,.score-player,.round-entry,.empty,.alert,
.segmented,.bottom-nav,dialog,.filter-panel,#round-status,.history-row,.fixed-stepper,
#card-grid.card-rail,#builder-results.builder-grid,.deck-sheet .selected-list{border:0!important}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea{border:1px solid #d6dde6!important;outline:0!important}
button:focus,a:focus,select:focus,input:focus,textarea:focus,summary:focus,[tabindex]:focus{outline:0!important;box-shadow:none!important}
button,a,input,select,textarea,summary,[tabindex]{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible{outline:0!important;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:4px}
.filters-toggle[aria-expanded="true"]{background:#eee3c9;color:#725921}
/* Dropdown fills remain visible against white panels, including while focused. */
#app-shell select{background-color:#edf1f5}
#app-shell select[data-filter-active="true"]{background-color:#eee3c9;color:#725921}
#app-shell select option{background-color:#fff;color:#172033}
.text-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 14px;border-radius:10px;background:#e8edf3;color:#42546c;font-size:13px;font-weight:650;line-height:1.2;text-decoration:none}
.text-button:hover{background:#dce4ed}
.text-button.danger,.text-button[data-delete-deck],.text-button[data-delete-match]{background:#f5e7e4;color:#934f45}
.text-button.danger:hover,.text-button[data-delete-deck]:hover,.text-button[data-delete-match]:hover{background:#eed7d2}
.score-stepper input,.fixed-stepper>input{border-radius:7px}
.fixed-stepper{background:none;gap:4px;overflow:visible}
.fixed-arrows{overflow:hidden;border-radius:6px}
.selected-row.leader-row{margin-inline:0;padding-inline:0}
.deck-sheet .selected-list .selected-row{border:0;border-bottom:1px solid #cbd4e0;padding-block:10px}
.deck-sheet .selected-list .selected-row:last-child{border-bottom:0}

.history-empty{display:grid;place-items:center;flex:1 1 0;min-height:0;margin:0;padding:24px;background:none;color:var(--muted);text-align:center;font-size:18px;font-weight:600;line-height:1.4}
.history-empty h2,.history-empty p{margin:0;font-size:inherit;font-weight:inherit;line-height:inherit}

/* A card's strength and combat row remain easy to scan in the selected list. */
.selected-stats .ability-chips{display:contents}
.selected-stats{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin:6px 0}
.deck-sheet .selected-name .selected-strength,.deck-sheet .selected-name .selected-combat,.deck-sheet .selected-name .ability-chip{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:26px;padding:4px 7px;border-radius:7px;font-size:12px;font-weight:700;line-height:1.25;white-space:normal}
.selected-strength{min-width:29px;background:#233044;color:#fff}
.selected-strength>span{font:inherit;opacity:1}
.selected-combat{background:#e0e7f0;color:#42546c;font-weight:700}
.selected-combat .combat-icon{width:16px;height:16px}
.selected-stats .selected-strength strong{display:inline;font:inherit}
.selected-stats .selected-combat small{display:inline;margin:0;font:inherit;color:inherit}

/* Saved decks use the same two-row, sideways card view as the card library. */
.saved-deck-view{display:flex;flex-direction:column;flex:1 1 0;min-height:0;min-width:0;overflow:hidden}
.saved-view-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 auto;min-height:44px;margin-bottom:12px}
.saved-view-title{min-width:0;flex:1 1 0;text-transform:none;overflow-wrap:anywhere}
.saved-view-title h2,.saved-view-title h3{margin:0;font-size:20px;line-height:1.25;text-transform:none;letter-spacing:-.5px}
.saved-view-title p,.saved-view-title small{display:block;margin:5px 0 0;font-size:12px;color:var(--muted);line-height:1.4}
.saved-view-toolbar>.button,.saved-view-toolbar>.text-button{flex:0 0 auto;min-height:44px}
.saved-card-rail{display:grid;grid-auto-flow:column;grid-template-columns:none;grid-template-rows:repeat(2,minmax(0,1fr));grid-auto-columns:clamp(280px,31vw,340px);gap:12px;flex:1 1 0;min-height:0;min-width:0;padding:10px 10px 8px;border-radius:14px;background:#edf1f5;overflow-x:scroll;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:10px;scrollbar-width:auto;scrollbar-color:#8c99ab #edf1f5}
.saved-card-rail::-webkit-scrollbar{height:12px}
.saved-card-rail::-webkit-scrollbar-track{background:#edf1f5;border-radius:8px}
.saved-card-rail::-webkit-scrollbar-thumb{background:#8c99ab;border:3px solid #edf1f5;border-radius:8px}
.saved-card-rail .library-card{min-height:0;scroll-snap-align:start}
.saved-card-rail .card-open{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);grid-template-rows:minmax(0,1fr);align-items:stretch;gap:12px;padding:10px;text-align:left;min-height:0}
.saved-card-rail .card-open img,.saved-card-rail .card-open .art-missing{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;object-position:center 30%;border-radius:8px;margin:0}
.saved-card-rail .card-open .art-missing{display:grid;place-items:center;background:linear-gradient(145deg,#e2e8ef,#cad4df);font-size:36px}
.saved-card-rail .card-copy{display:flex;flex-direction:column;min-height:0;min-width:0;padding:3px 0}
.saved-card-rail .card-copy strong{font-size:15px;line-height:1.3;padding:0}
.saved-card-rail .card-copy small{display:block;font-size:11px;line-height:1.4;margin:9px 0 4px}
.saved-card-rail .card-meta{font-size:11px;line-height:1.4;margin:0}
.saved-card-rail .ability-chips{margin-top:auto;padding-top:10px;gap:4px}
.saved-card-rail .ability-chip{font-size:10px;line-height:1.3;padding:5px 7px}
.saved-card-rail .power-badge{left:16px;right:auto;top:16px;min-width:29px;height:29px;font-size:15px;background:#fffffff0;box-shadow:0 2px 6px #11182724}
.saved-card-rail .library-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;min-height:32px;padding:5px 10px;gap:3px 8px;background:#f8fafc}
.saved-card-rail .deck-copy-count{font-size:12px;font-weight:750;color:#344359}
.saved-card-rail .deck-copy-ids{flex:1 0 100%;display:block;font-size:10px;line-height:1.4;color:var(--muted);white-space:normal;overflow-wrap:anywhere;text-transform:none}
.saved-card-rail .deck-copy-ids code{font-size:inherit}
.saved-card-rail>.empty{grid-row:1 / -1;display:flex;flex-direction:column;justify-content:center;padding:20px}

@media(orientation:portrait) and (min-height:800px){
  .saved-card-rail .card-open{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:10px}
  .saved-card-rail .card-copy{padding:0}
  .saved-card-rail .card-copy small{margin:5px 0 2px}
  .saved-card-rail .ability-chips{margin-top:6px;padding-top:0}
}
@media(max-width:680px){
  .selected-stats{gap:4px;margin:5px 0}
  .deck-sheet .selected-name .selected-strength,.deck-sheet .selected-name .selected-combat,.deck-sheet .selected-name .ability-chip{font-size:11px;min-height:26px;padding:4px 7px}
  .selected-combat .combat-icon{width:14px;height:14px}
  .deck-sheet .deck-actions .text-button{flex:1 1 0;min-width:0;padding:8px 6px;font-size:11px}
  .saved-view-toolbar{gap:8px;margin-bottom:10px}
  .saved-view-title h2,.saved-view-title h3{font-size:17px}
  .saved-view-title p,.saved-view-title small{font-size:10px;margin-top:4px}
  .saved-view-toolbar>.button,.saved-view-toolbar>.text-button{font-size:12px;padding:8px 10px}
  .saved-card-rail{gap:10px}
  .history-empty{font-size:17px}
}
@media(max-height:650px){
  .saved-card-rail{grid-auto-columns:330px}
  .saved-card-rail .card-open{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);padding:8px;gap:10px}
  .saved-card-rail .card-copy{padding:0}
  .saved-card-rail .card-copy strong{font-size:13px}
  .saved-card-rail .card-copy small{font-size:10px;margin:5px 0 2px}
  .saved-card-rail .card-meta{font-size:10px}
  .saved-card-rail .ability-chips{padding-top:5px}
  .saved-card-rail .ability-chip{font-size:9px;padding:3px 5px}
  .saved-card-rail .library-foot{min-height:28px;padding-block:4px}
  .saved-card-rail .power-badge{left:13px;top:13px;height:25px;min-width:25px;font-size:13px}
}

.saved-deck .button.secondary{background:#e8edf3;color:#42546c}
.saved-deck .button.secondary:hover{background:#dce4ed}
.saved-deck .button.danger{background:#f5e7e4;color:#934f45}
.saved-deck .button.danger:hover{background:#eed7d2}
