/* Keep click and keyboard feedback contained within the card title. */
#cards-content .card-open,
#decks-content .card-open,
#decks-content .selected-name,
#detail-dialog.card-dialog .dialog-close,
#detail-dialog.feedback-dialog button,
#detail-dialog.match-dialog button,
#detail-dialog.match-dialog summary{outline:none!important;box-shadow:none!important;text-decoration:none}
#cards-content .card-open:focus-visible .card-copy strong,
#decks-content .card-open:focus-visible .card-copy strong,
#decks-content .selected-name:focus-visible>b{color:#8a6a2d}

/* Shared filters: step controls inside the fields, actions below the filters. */
#cards-filter-panel .filter-footer,
#builder-filter-panel .filter-footer{display:flex;grid-column:1 / -1;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding-top:4px}
#cards-filter-panel .filter-footer .text-button,
#builder-filter-panel .filter-footer .text-button{min-height:38px;padding:8px 12px;font-size:12px}
#cards-filter-panel .filter-footer .filter-close,
#builder-filter-panel .filter-footer .filter-close{flex:0 0 38px;min-width:38px;min-height:38px;width:38px;height:38px;margin-left:auto}
#cards-filter-panel .filter-footer button,
#builder-filter-panel .filter-footer button{text-decoration:none}
.filter-panel .strength-stepper{position:relative;display:flex;flex:1 1 0;min-width:0;align-items:stretch}
.filter-panel .strength-stepper input{flex:1 1 auto;min-width:0;width:100%;min-height:46px;height:46px;padding:8px 29px 8px 9px;text-align:left;font-variant-numeric:tabular-nums}
.filter-panel .strength-arrows{position:absolute;right:1px;top:1px;bottom:1px;width:26px;display:flex;flex-direction:column;overflow:hidden;border-radius:0 7px 7px 0}
.filter-panel .strength-arrows button{display:grid;place-items:center;flex:1 1 0;min-height:0;min-width:0;width:26px;padding:0;border-radius:0;background:#edf1f5;color:#637184;text-decoration:none}
.filter-panel .strength-arrows button:hover,
.filter-panel .strength-arrows button:focus-visible{background:#dce4ed;color:#344359}
.filter-panel .strength-arrows svg{display:block;width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}

/* Compact deck actions, with a clear divider above the action row. */
#decks-content .deck-sheet .deck-actions{flex:0 0 auto;align-items:center;gap:7px;margin-top:11px;padding-top:11px;border-top:1px solid #c5cfdb}
#decks-content .deck-sheet .deck-actions .text-button{flex:0 0 auto;min-height:30px;padding:7px 10px;font-size:11px;line-height:1.15;border-radius:8px;text-decoration:none}
#decks-content #save-deck:disabled,
#decks-content [data-action="save-deck"]:disabled{opacity:1;background:#e5e9ee;color:#909ba9;cursor:default}

/* Feedback and match details share the restrained navy and gold palette. */
#detail-dialog.feedback-dialog,
#detail-dialog.match-dialog{width:min(640px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);padding:22px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#a8b3c1 #f5f7fa}
#detail-dialog.feedback-dialog .dialog-close,
#detail-dialog.match-dialog .dialog-close{background:#ffffff1c;color:#e8edf3;width:36px;height:36px;min-width:36px;min-height:36px;top:14px;right:14px}
#detail-dialog.feedback-dialog .dialog-close:hover,
#detail-dialog.feedback-dialog .dialog-close:focus-visible,
#detail-dialog.match-dialog .dialog-close:hover,
#detail-dialog.match-dialog .dialog-close:focus-visible{background:#ffffff32;color:white}
.feedback-summary,
.match-summary{margin:-22px -22px 20px;padding:24px 60px 22px 24px;background:#1f2c40;color:white}
.feedback-summary .eyebrow,
.match-summary .eyebrow{margin:0 0 9px;color:#c7d0dc;font-size:10px;font-weight:650;line-height:1.5;letter-spacing:1.4px}
.feedback-summary h2,
.match-summary h2{margin:0;color:#f5e3b9;font-size:27px;line-height:1.25;letter-spacing:-.7px;overflow-wrap:anywhere}
.feedback-status{display:inline-flex;align-items:center;gap:6px;margin:12px 0 0;padding:6px 9px;border-radius:7px;background:#ffffff16;color:#e3e9f1;font-size:11px;font-weight:650;line-height:1.4}
.feedback-status[data-tone="good"],
.feedback-status[data-ready="true"]{color:#d7eada;background:#c7e7cd16}
.feedback-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 18px}
.feedback-metrics>div{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;padding:15px 8px;background:#eff3f7;border-radius:12px}
.feedback-metrics strong{font-size:28px;font-weight:750;line-height:1.1;letter-spacing:-1px;font-variant-numeric:tabular-nums;color:#253449}
.feedback-metrics span{font-size:11px;font-weight:600;color:#677386}
.feedback-rows{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px 18px;margin:0 0 20px;padding:0 0 18px;border-bottom:1px solid #e0e6ed;color:#677386;font-size:12px;line-height:1.4}
.feedback-rows>div,
.feedback-rows>span{display:inline-flex;align-items:center;gap:6px}
.feedback-rows b,
.feedback-rows strong{color:#344359;font-weight:700;font-variant-numeric:tabular-nums}
.feedback-rows svg{width:16px;height:16px;flex:0 0 16px}
.feedback-notes{display:grid;gap:9px}
.feedback-notes article{display:flex;align-items:flex-start;gap:10px;padding:12px 13px;background:#f3f6f9;border-radius:10px;color:#42546c}
.feedback-notes article[data-tone="good"]{background:#eff5f1;color:#416450}
.feedback-notes article[data-tone="warn"]{background:#f8f2e7;color:#806638}
.feedback-notes article>svg{flex:0 0 19px;display:block;width:19px;height:19px;margin-top:1px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.feedback-notes p{margin:0;font-size:13px;line-height:1.55;text-transform:none}

/* Scores and the decks saved with that match are separate, easy-to-scan blocks. */
.match-players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:20px}
.match-player{display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:start;align-items:center;gap:4px 12px;min-width:0;padding:16px;border-radius:12px;background:#eff3f7;color:#42546c}
.match-player[data-winner="true"]{background:#f3ead6;color:#735b2c}
.match-player-name{min-width:0;font-size:17px;font-weight:750;line-height:1.35}
.match-player-score{display:flex;flex-direction:column;align-items:center;gap:5px;grid-column:2;grid-row:1 / 4;font-variant-numeric:tabular-nums;color:#243247}
.match-player-score strong{font-size:43px;font-weight:800;line-height:1;letter-spacing:-2px}
.match-player-score>span{font-size:9px;font-weight:650;line-height:1.3;letter-spacing:0;white-space:nowrap;color:#677386}
.match-player[data-winner="true"] .match-player-score{color:#8b6a2c}
.match-player-faction{font-size:11px;line-height:1.4;min-width:0;overflow-wrap:anywhere}
.match-player-deck{font-size:11px;line-height:1.4;min-width:0;color:#677386;text-transform:none;overflow-wrap:anywhere}
.match-rounds{display:grid;gap:0;margin:0 0 20px}
.match-round{display:grid;grid-template-columns:1fr 1fr 1fr;align-items:center;gap:12px;min-height:46px;padding:10px 6px;font-size:12px;color:#677386;border-bottom:1px solid #e2e7ee}
.match-round:last-child{border-bottom:0}
.match-round-score{display:flex;justify-content:center;align-items:center;gap:10px;color:#35455b;font-variant-numeric:tabular-nums}
.match-round-score b{font-size:17px;min-width:27px;font-weight:750;text-align:center}
.match-round-result{justify-self:end;font-size:11px;font-weight:650;color:#51627a}
.match-dialog .snapshot-decks{display:grid;gap:10px;margin:0}
.snapshot-deck{min-width:0;background:#f0f3f7;border-radius:12px;overflow:hidden;text-decoration:none}
.snapshot-deck>summary{display:flex;align-items:center;gap:10px;min-height:62px;padding:12px 14px;list-style:none;cursor:pointer;text-decoration:none}
.snapshot-deck>summary::-webkit-details-marker{display:none}
.snapshot-deck>summary::marker{content:""}
.snapshot-name{display:flex;flex-direction:column;gap:3px;flex:1 1 0;min-width:0;color:#344359;font-size:13px;font-weight:700;line-height:1.4;overflow-wrap:anywhere;text-transform:none}
.snapshot-name>span{font-size:13px;font-weight:700;color:inherit}
.snapshot-name>small{font-size:10px;font-weight:600;color:#677386}
.snapshot-deck>summary>small{flex:0 0 auto;font-size:10px;color:#677386;font-weight:600;white-space:nowrap}
.snapshot-deck>summary>svg{display:block;width:17px;height:17px;flex:0 0 17px;fill:none;stroke:#748296;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.snapshot-deck[open]>summary>svg{transform:rotate(180deg)}
.snapshot-deck>summary:focus-visible .snapshot-name{color:#8a6a2d}
.snapshot-list{max-height:260px;overflow:auto;overscroll-behavior:contain;padding:0 14px 10px;scrollbar-width:thin;scrollbar-color:#a8b3c1 #f0f3f7}
.snapshot-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;text-decoration:none}
.snapshot-card+.snapshot-card{border-top:1px solid #dce3eb}
.snapshot-card>span:first-child{display:block;flex:1 1 0;min-width:0}
.snapshot-card b{display:block;font-size:12px;font-weight:650;line-height:1.4;color:#344359;text-transform:none}
.snapshot-card small{display:block;margin-top:3px;font-size:10px;line-height:1.4;color:#7a8799;text-transform:none}
.snapshot-count{display:grid;place-items:center;min-width:29px;min-height:27px;padding:4px 7px;border-radius:7px;background:#e1e7ef;font-size:11px;font-weight:700;color:#506078;white-space:nowrap}
.snapshot-list>.muted{margin:2px 0 4px;font-size:12px;line-height:1.5}
.match-delete{display:flex;justify-content:flex-end;margin-top:20px;padding-top:16px;border-top:1px solid #e2e7ee}
.match-delete .text-button,
.match-dialog button.match-delete{min-height:34px;padding:8px 11px;font-size:11px;border-radius:8px}

@media(max-width:680px){
  .filter-panel .strength-stepper input{padding-left:6px;padding-right:25px;font-size:12px}
  .filter-panel .strength-arrows,.filter-panel .strength-arrows button{width:23px}
  #decks-content .deck-sheet .deck-actions{flex-wrap:wrap;gap:5px;margin-top:10px;padding-top:10px}
  #decks-content .deck-sheet .deck-actions .text-button{min-height:30px;font-size:10px;padding:7px 8px}
  #detail-dialog.feedback-dialog,#detail-dialog.match-dialog{padding:17px;border-radius:18px}
  .feedback-summary,.match-summary{margin:-17px -17px 17px;padding:22px 56px 20px 19px}
  .feedback-summary h2,.match-summary h2{font-size:24px}
  .feedback-metrics{gap:7px;margin-bottom:15px}
  .feedback-metrics>div{padding:13px 6px;border-radius:10px}
  .feedback-metrics strong{font-size:25px}
  .feedback-metrics span{font-size:10px}
  .feedback-rows{gap:8px 12px;font-size:11px;margin-bottom:16px;padding-bottom:15px}
  .feedback-notes article{padding:11px;gap:8px}
  .feedback-notes p{font-size:12px}
  .match-players{gap:9px;margin-bottom:14px}
  .match-player{padding:13px 11px;gap:5px 8px}
  .match-player-name{font-size:15px}
  .match-player-score strong{font-size:35px}
  .match-player-score>span{font-size:8px}
  .match-player-faction,.match-player-deck{font-size:10px}
  .match-round{gap:8px;font-size:11px;padding-inline:2px}
  .match-round-result{font-size:10px}
  .snapshot-deck>summary{padding:11px 12px;gap:8px}
  .snapshot-name{font-size:12px}
  .snapshot-name>span{font-size:12px}
  .snapshot-list{padding-inline:12px}
}
