/* Season UI, from reference/season-mode-source/web-shell/app.css:
   ui-tokens.css, controls.css and modal-polish.css. The native dialog supplies
   the top layer/backdrop; #dialog-inner uses the original match-sheet structure.
   Dedicated card-flip and card workspaces keep their own layouts. */
#dialog:is(.season-modal,.card-flip-dialog){
 --ui-page:#15181b;--ui-surface:#202428;--ui-raised:#292e33;--ui-hover:#32383f;
 --ui-text:#f0f1ed;--ui-muted:#b0b8bf;--ui-line:#3b4249;--ui-line-strong:#77818a;
 --ui-accent:#b0003a;--ui-on-accent:#fff;--ui-accent-text:#ff9fb7;
 --ui-accent-soft:color-mix(in srgb,var(--ui-accent) 13%,var(--ui-surface));
 --ui-display:Ntreev,system-ui,sans-serif;--ui-font-body:13px;--ui-font-small:12px;
 --ui-font-label:14px;--ui-font-subtitle:16px;--ui-dialog-heading:18px;
 --ui-space-3:8px;--ui-space-4:12px;--ui-radius-control:6px;--ui-radius-modal:10px;
 --modal-pad:18px;--modal-radius:var(--ui-radius-modal);--action-height:42px;
 /* Older result content consumes these aliases; never inherit the initial blue skin. */
 --surface:var(--ui-surface);--soft:var(--ui-raised);--stroke:var(--ui-line);
 --text:var(--ui-text);--sub:var(--ui-muted);--deep:var(--ui-page);
 --panel:var(--ui-surface);--ink:var(--ui-text);--line:var(--ui-line);--border:var(--ui-line);
}
#dialog.season-modal{
 box-sizing:border-box;width:min(640px,calc(100vw - 24px));max-width:calc(100vw - 24px);
 max-height:calc(100dvh - 24px);margin:12px auto auto;padding:0;inset:0;transform:none;
 overflow:hidden;border:1px solid var(--ui-line);border-radius:var(--modal-radius);
 background:var(--ui-surface);color:var(--ui-text);box-shadow:0 24px 90px #000b;
 font:var(--ui-font-body)/1.55 var(--ui-display);color-scheme:dark;
}
body.light #dialog:is(.season-modal,.card-flip-dialog){
 --ui-page:#eeeee9;--ui-surface:#fff;--ui-raised:#f4f4ef;--ui-hover:#e7e9e5;
 --ui-text:#20252a;--ui-muted:#59636c;--ui-line:#d0d5d7;--ui-line-strong:#879299;
 --ui-accent-text:#94143e;color-scheme:light;
}
#dialog.season-modal.narrow{width:min(480px,calc(100vw - 24px))}
#dialog.season-modal::backdrop{background:color-mix(in srgb,var(--ui-page) 60%,transparent);backdrop-filter:blur(2px)}
#dialog.season-modal #dialog-inner.match-sheet{
 display:flex;flex-direction:column;min-width:0;max-height:calc(100dvh - 26px);
 background:var(--ui-surface);color:var(--ui-text);
}
#dialog.season-modal .match-sheet>header{
 display:flex;justify-content:space-between;align-items:center;flex:0 0 auto;
 gap:var(--ui-space-4);padding:12px var(--modal-pad);min-width:0;min-height:50px;
 background:var(--ui-raised);border-bottom:1px solid var(--ui-line);
}
#dialog.season-modal .match-sheet>header h2{
 min-width:0;flex:1;font:var(--ui-dialog-heading)/1.4 var(--ui-display);
 letter-spacing:-.02em;margin:0;overflow-wrap:anywhere;color:var(--ui-text);
}
#dialog.season-modal .match-sheet>header button{
 flex-shrink:0;min-width:44px;width:44px;min-height:44px;padding:0;
 font-size:23px;line-height:1;border:1px solid var(--ui-line);border-radius:var(--ui-radius-control);
}
#dialog.season-modal .match-sheet .sheet-body{
 flex:1 1 auto;min-height:0;min-width:0;overflow:auto;padding:var(--modal-pad);
 font-size:var(--ui-font-body);line-height:1.55;touch-action:pan-x pan-y;
}
#dialog.season-modal .sheet-footer{
 flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--ui-space-3);min-width:0;
 padding:12px var(--modal-pad);border-top:1px solid var(--ui-line);background:var(--ui-raised);
}
#dialog.season-modal button{
 box-sizing:border-box;min-width:0;min-height:36px;margin:0;padding:8px 12px;
 font:400 var(--ui-font-body)/1.4 var(--ui-display);font-synthesis:none;
 color:var(--ui-text);border:1px solid var(--ui-line);border-radius:var(--ui-radius-control);
 background:var(--ui-surface);box-shadow:none;text-shadow:none;
}
#dialog.season-modal .sheet-footer>button{min-height:var(--action-height);padding:8px 10px;white-space:normal;word-break:keep-all;overflow-wrap:anywhere}
#dialog.season-modal button.primary,
#dialog.season-modal button[aria-pressed=true]{background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent)}
#dialog.season-modal button:not(:disabled):hover{border-color:var(--ui-accent-text)}
#dialog.season-modal button:disabled{opacity:.45;cursor:default}
#dialog.season-modal button:focus-visible{outline:3px solid var(--ui-accent-text);outline-offset:2px}
#dialog.season-modal.match-results-dialog{width:min(1000px,calc(100vw - 24px))}
#dialog.season-modal .match-result-scroll tbody tr.selected{background:var(--ui-accent-soft)}
#dialog.season-modal .match-club strong{color:var(--ui-text)}
#dialog.season-modal .match-detail-tabs{gap:var(--ui-space-3)}
.match-scoreboard[data-reveal-skipped=true] :is([data-score-value],[data-score-details],.score-stamp){animation:none!important}
@media(max-width:600px){
 #dialog.season-modal{--modal-pad:12px;max-width:calc(100vw - 16px);width:calc(100vw - 16px)}
 #dialog.season-modal.match-results-dialog{width:calc(100vw - 16px)}
 #dialog.season-modal .match-sheet .sheet-body{padding:var(--modal-pad)}
 #dialog.season-modal .sheet-footer>button{flex:1 1 110px}
}

/* Dedicated workspaces use the same season shell with their existing dimensions. */
#dialog.season-modal.club-create-dialog{width:min(920px,calc(100vw - 24px));--create-surface:var(--ui-surface);--create-raised:var(--ui-raised);--create-edge:var(--ui-line);--create-text:var(--ui-text)}
#dialog.season-modal.core-select-dialog{width:min(680px,calc(100vw - 24px))}
#dialog.season-modal.instructor-picker{width:min(800px,calc(100vw - 24px))}
#dialog.season-modal.team-color-dialog{width:min(1000px,calc(100vw - 24px))}
#dialog.season-modal.training-player-dialog{width:min(744px,calc(100vw - 24px))}
#dialog.season-modal.lineup-replacement-dialog{width:min(900px,calc(100vw - 24px))}
#dialog.season-modal.pack-opening-dialog{width:min(960px,calc(100vw - 24px))}
#dialog.season-modal.fusion-result-dialog{width:calc(286px * var(--fusion-card-scale,1) + 32px)}
#dialog.season-modal:is(.training-player-dialog,.team-color-dialog,.lineup-replacement-dialog,.pack-opening-dialog) #dialog-inner.match-sheet{height:100%;max-height:100%}
#dialog.season-modal:is(.training-player-dialog,.team-color-dialog,.lineup-replacement-dialog) .sheet-body{overflow:hidden}
#dialog.season-modal.training-player-dialog .sheet-body{padding:0}
#dialog.season-modal.team-color-dialog .sheet-body{padding:10px}
#dialog.season-modal.lineup-replacement-dialog .sheet-body{padding:8px 10px}
#dialog.season-modal.pack-opening-dialog .sheet-body{padding:6px}
#dialog.season-modal.instructor-picker .sheet-body{padding:0;overflow-x:hidden}
#dialog.season-modal.fusion-result-dialog .sheet-body{padding:12px 14px}
#dialog.season-modal .club-options button.selected,
#dialog.season-modal.core-select-dialog .core-option.selected{color:var(--ui-text);background:var(--ui-accent-soft);border-color:var(--ui-accent);outline-color:var(--ui-accent);box-shadow:inset 0 0 0 1px var(--ui-accent)}
#dialog.season-modal .core-choice-section{background:var(--ui-raised);border-color:var(--ui-line)}
#dialog.season-modal .core-option{background:var(--ui-surface);border-color:var(--ui-line)}
#dialog.season-modal :is(.core-selection-count,.core-card-stats b){color:var(--ui-accent-text)}
#dialog.season-modal .core-chosen{color:var(--ui-on-accent);background:var(--ui-accent);border-color:var(--ui-accent)}
#dialog.card-flip-dialog .dialog-footer>button{min-height:42px;padding:9px 12px;font:13px/1.4 Ntreev,system-ui;border:1px solid var(--ui-line);border-radius:6px;color:var(--ui-text);background:var(--ui-surface);box-shadow:none}
#dialog.card-flip-dialog .dialog-footer>button.primary{background:var(--ui-accent);border-color:var(--ui-accent);color:var(--ui-on-accent)}
@media(max-width:600px){
 #dialog.season-modal:is(.club-create-dialog,.core-select-dialog,.instructor-picker,.team-color-dialog,.training-player-dialog,.lineup-replacement-dialog,.pack-opening-dialog){width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
 #dialog.season-modal.team-color-dialog .sheet-body{padding:7px}
 #dialog.season-modal.lineup-replacement-dialog .sheet-body{padding:6px 8px}
 #dialog.season-modal.core-select-dialog .sheet-body{padding:8px}
 #dialog.season-modal.core-select-dialog .sheet-footer>button{font-size:12px;padding-inline:5px}
}

#dialog.season-modal .reference-panel>h2{background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line)}

/* Card flip hit areas stay transparent over the artwork. */
#dialog.season-modal button.pack-card-toggle{background:transparent;border:0;border-radius:0;box-shadow:none;text-shadow:none;padding:0;min-height:0}
