.lab { --lab-panel: var(--panel, #102323); --lab-line: #86ada52b; --lab-muted: #95aca6; --lab-control-font: clamp(13px,.84vw,16px); max-width: 1840px; margin: 0 auto; padding: 12px 0 32px; }
.lab [hidden] { display: none !important; }
.lab button,.lab input,.lab select { font: inherit; }
.lab button { cursor: pointer; }
.lab :is(button,input,select):focus-visible { outline: 2px solid #b8e967; outline-offset: 3px; }
.lab-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.lab-eyebrow { font-size: 10px; font-weight: 800; letter-spacing: .2em; color: #b8d892; }
.lab h1 { display: flex; align-items: center; gap: 14px; margin: 4px 0; font-size: clamp(24px,2.2vw,34px); letter-spacing: -.035em; }
.lab h1 span { padding: 4px 9px; border: 1px solid #b3e58b4d; border-radius: 5px; color: #bfe989; font-size: 11px; letter-spacing: 0; }
.lab h2 { font-size: 18px; margin: 0; }
.lab h3 { font-size: 14px; margin: 0; }
.lab-heading p { color: var(--lab-muted); font-size: 13px; margin: 7px 0 0; }
.lab-backup-tools,.lab-team-bar,.lab-dialog-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lab button:not(.lineup-card-slot,.lab-player-item,.lab-bench-card,.lab-dialog-close) { min-height: 34px; padding: 7px 12px; border-radius: 7px; border: 1px solid var(--lab-line); background: #6b9e8820; color: inherit; font-size: var(--lab-control-font); line-height: 1.35; font-weight: 650; }
.lab button.button-link { background: #c7ed7e; border-color: #c7ed7e; color: #142d1b; font-weight: 800; }
.lab button.secondary { color: inherit; background: transparent; }
.lab button:disabled { cursor: default; opacity: .4; }
.lab input,.lab select { min-width: 0; min-height: 34px; box-sizing: border-box; padding: 6px 9px; color: inherit; background: #07171988; border: 1px solid #80a59640; border-radius: 6px; }
.lab option { background: #112922; color: #eef7e8; }
.lab label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.lab-local-note { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 0 14px; color: var(--lab-muted); font-size: 11px; }
.lab-local-dot { width: 6px; height: 6px; border-radius: 50%; background: #c7ed7e; box-shadow: 0 0 9px #b9e97755; }
#lab-save-status { margin-left: auto; }
.lab-warning { padding: 12px 16px; margin: 8px 0 16px; border: 1px solid #e4b976; border-radius: 8px; background: #80632920; color: #f0cc98; font-size: 13px; }
.lab-publish-form { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 10px; color: var(--lab-muted); font-size: 11px; }
.lab-empty { padding: 40px 20px; text-align: center; color: var(--lab-muted); }
.lab-team-bar { padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--lab-line); border-radius: 10px; background: var(--lab-panel); }
#lab-team { width: clamp(130px,16vw,240px); font-weight: 800; }
.lab-game-binding { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 0 4px 14px; }
.lab-game-binding label { font-size: 13px; white-space: nowrap; }
.lab-bound-team { display: flex; align-items: center; gap: 10px; position: relative; flex: 1; max-width: 620px; min-width: 260px; }
.lab-team-combobox { display: flex; align-items: center; flex: 1; min-width: 0; gap: 8px; padding: 4px 6px 4px 9px; border: 1px solid var(--lab-line); border-radius: 9px; background: #102522; }
.lab .lab-team-combobox input { width: 100%; flex: 1; background: transparent; border: 0; padding: 5px 0; font-size: 13px; }
.lab .lab-team-combobox input:focus-visible { outline-offset: 0; }
.lab .lab-team-combobox button { padding: 0; width: 28px; min-height: 30px; flex: 0 0 28px; border: 0; font-size: 19px; background: transparent; }
.lab-binding-crest { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; }
.lab-binding-crest img { display: block; width: 100%; height: 100%; object-fit: contain; }
.lab-team-crest-fallback { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid #9bc89d55; border-radius: 50%; background: radial-gradient(circle at 30% 25%,#508e6355,#284e3833); color: #cde7cb; font-size: 15px; font-weight: 800; }
.lab-team-popup { position: absolute; z-index: 90; top: calc(100% + 6px); left: 0; right: 0; display: flex; flex-direction: column; box-sizing: border-box; border: 1px solid #729e8666; border-radius: 12px; background: #142923; color: #eef5e8; box-shadow: 0 15px 40px #0007; overflow: hidden; transition: none !important; }
.lab-team-popup.is-above { top: auto; bottom: calc(100% + 6px); }
.lab-team-result-status { flex: 0 0 auto; padding: 10px 13px; color: var(--lab-muted); font-size: 11px; border-bottom: 1px solid var(--lab-line); }
.lab-team-results { min-height: 0; flex: 1 1 auto; max-height: 330px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 5px; }
.lab button.lab-team-option { display: flex; width: 100%; min-width: 0; align-items: center; gap: 11px; border: 0; border-radius: 7px; background: transparent; text-align: left; padding: 8px; }
.lab .lab-team-option:is(:hover,.is-active) { background: #a6d28622; box-shadow: inset 3px 0 #c7ed7e; }
.lab .lab-team-option[aria-selected="true"] { background: #a6d28614; }
.lab .lab-team-option-name { display: block; min-width: 0; flex: 1; }
.lab-team-option-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lab-team-option-name small { display: block; color: var(--lab-muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.lab-team-picker-actions { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 8px; padding: 9px; border-top: 1px solid var(--lab-line); }
.lab .lab-team-picker-actions button { font-size: 12px; }
.lab .lab-custom-team-dialog { width: min(470px,calc(100vw - 32px)); }
.lab-custom-team-dialog h2 { font-size: 24px; margin: 8px 0 12px; }
.lab-custom-team-dialog form > label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 18px 0; font-size: 13px; }
.lab-custom-team-dialog label input { width: 100%; flex: 0 0 100%; min-height: 42px; }
.lab-custom-team-dialog input[readonly] { opacity: .75; cursor: default; }
.lab-custom-team-preview { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--lab-line); border-radius: 10px; background: #76997812; }
.lab-custom-team-preview > div { min-width: 0; overflow-wrap: anywhere; }
.lab-custom-team-preview .lab-binding-crest { width: 46px; height: 46px; flex-basis: 46px; }
.lab-custom-team-preview strong { font-size: 15px; }
.lab-custom-team-preview p { margin: 5px 0 0; }
.lab-custom-team-dialog .lab-dialog-actions { justify-content: flex-end; margin-top: 16px; }
.lab-binding-error { min-height: 18px; margin: 9px 0 0; color: #f4ba98; font-size: 12px; }
.lab-export-bound-team { display: flex; flex: 1; gap: 10px; align-items: center; min-width: 180px; }
.lab-game-binding #lab-binding-status { margin-left: auto; }
.lab-team-summary { color: var(--lab-muted); font-size: 12px; margin-left: auto; }
.lab-workspace-grid { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,1fr); gap: 14px; align-items: stretch; }
.lab-pitch-panel,.lab-library,.lab-tactics { min-width: 0; border: 1px solid var(--lab-line); border-radius: 12px; background: var(--lab-panel); }
.lab-pitch-panel { padding: 12px; }
.lab-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 12px; }
.lab-panel-heading h2 { display: inline-block; margin-right: 10px; }
.lab-panel-heading span,.lab-bench-heading span { color: var(--lab-muted); font-size: 11px; }
.lab-panel-heading > label,.lab-tactic-fields > label { white-space: nowrap; }
.lab .lineup-card-slot { cursor: grab; }
.lab .lineup-card-slot.is-target { filter: drop-shadow(0 0 8px #d7ed7a); }
.lab .lineup-card-slot.is-dragging { opacity: .35; }
.lab :is(.lineup-card-slot,.lab-bench-card).drag-over { outline: 2px solid #c7ed7e; outline-offset: 5px; border-radius: 8px; }
.lab .pitch-role-summary { display: block; max-width: 130px; padding: 2px 6px; border: 1px solid #8fd2af4a; border-radius: 4px; color: #d5f8ce; background: linear-gradient(110deg,#092923f7,#284b32f2); box-shadow: 0 0 8px #bdd88616; font: 600 10px/1.4 "Segoe UI","Microsoft YaHei",sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab .lineup-card-slot .lab-card-button { display: block; width: 100%; padding: 0; background: none; border: 0; }
.lab-bench-heading { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0 8px; }
.lab-bench { display: flex; align-items: start; justify-content: center; gap: 6px; padding: 6px 2px 4px; overflow-x: auto; }
.lab-bench-card { flex: 0 0 var(--lineup-card-width); padding: 0; border: 0; color: inherit; background: none; }
.lab-library { display: flex; flex-direction: column; height: 100%; min-height: 0; max-height: 1100px; overflow: hidden; }
.lab-library-tabs { display: flex; border-bottom: 1px solid var(--lab-line); gap: 0; }
.lab .lab-library-tabs button { flex: 1; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 12px 4px; background: none; color: var(--lab-muted); font-weight: 700; white-space: nowrap; }
.lab .lab-library-tabs button[aria-selected="true"] { color: #ceef94; background: #9bc5720a; border-bottom-color: #c7ed7e; }
.lab-filters { padding: 12px 12px 0; }
#lab-search { width: 100%; margin-bottom: 8px; }
.lab-filter-row { display: flex; gap: 6px; align-items: center; }
.lab-filter-row > * { flex: 1; width: 0; }
.lab-filter-row label { flex-wrap: wrap; }
.lab-filter-row label select { width: 100%; }
.lab-catalog-status { display: flex; gap: 6px; justify-content: space-between; padding: 9px 12px; color: var(--lab-muted); font-size: 11px; }
.lab-players { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-content: start; gap: 1px; padding: 0 10px; overflow-y: auto; min-height: 170px; flex: 1; scrollbar-width: thin; }
.lab-player-item { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 6px; border: 0; border-bottom: 1px solid var(--lab-line); color: inherit; text-align: left; background: transparent; }
.lab-player-item:hover { background: #93c48f13; }
.lab-player-item > img { flex: 0 0 44px; height: 50px; width: 44px; object-fit: contain; align-self: end; background: transparent; }
.lab-player-item > span { min-width: 0; flex: 1; }
.lab-player-item strong { display: block; font-size: 12px; font-weight: 750; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lab-player-item small { display: block; color: var(--lab-muted); font-size: 10px; margin-top: 3px; }
.lab-player-item .lab-rating { color: #d5ea9d; font-size: 18px; font-weight: 850; }
.lab-player-item .lab-in-team { color: #a5d5b1; }
.lab-pagination { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--lab-line); font-size: 11px; }
.lab-dataset-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; color: var(--lab-muted); font-size: 10px; background: #00000012; }
.lab .lab-subtle { font-size: var(--lab-control-font); background: transparent; color: var(--lab-muted); }
.lab-draw-controls { padding: 10px 12px; background: radial-gradient(ellipse at top,#a6ce7330,transparent); }
.lab-draw-controls p { margin: 0 0 10px; color: var(--lab-muted); font-size: 12px; }
.lab-draw-controls > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lab-tactics { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-top: 14px; padding: 18px; }
.lab-tactic-fields { display: flex; flex-direction: column; gap: 16px; }
.lab-tactic-fields label { justify-content: space-between; }
.lab-tactic-fields input { flex: 1; max-width: 220px; accent-color: #b9df78; }
.lab-assignments { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.lab-assignments label { flex-direction: column; align-items: stretch; gap: 4px; color: var(--lab-muted); }
.lab-assignments select { width: 100%; }
.lab-dialog { color: #edf4eb; border: 1px solid #92bfa14d; background: radial-gradient(ellipse at top left,#234437,#101e21 60%); border-radius: 18px; padding: 28px; width: min(760px,calc(100vw - 40px)); max-height: calc(100dvh - 36px); overflow: auto; box-shadow: 0 28px 100px #0009; }
.lab-dialog::backdrop { background: #041511b8; backdrop-filter: blur(8px); }
.lab .lab-dialog-close { position: absolute; top: 10px; right: 12px; z-index: 5; border: 0; width: 32px; height: 32px; color: #d7e7da; background: #799c8030; border-radius: 50%; font-size: 23px; }
.lab-player-dialog-grid { display: grid; grid-template-columns: minmax(220px,1fr) minmax(220px,.85fr); gap: 30px; align-items: center; }
.lab-full-card { width: 100%; aspect-ratio: 3 / 4; position: relative; }
.lab-player-config { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lab-player-config label { display: flex; flex-direction: column; align-items: stretch; gap: 6px; color: var(--lab-muted); }
.lab-player-config h2 { font-size: 25px; }
.lab-player-config p { margin: 0; font-size: 12px; }
.lab-muted { color: var(--lab-muted); font-size: 12px; line-height: 1.6; }
.lab-export-dialog { width: min(1040px,calc(100vw - 40px)); }
.lab-export-dialog > h2 { margin: 8px 0 20px; font-size: 25px; }
.lab-export-target { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--lab-line); }
.lab-export-target strong { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.lab-export-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 20px 0; }
.lab-export-step { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--lab-line); border-radius: 12px; background: linear-gradient(160deg,#a7c5820b,#6598880b); min-width: 0; }
.lab-step-number { color: #bddd82; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lab .lab-export-step h3 { font-size: 16px; }
.lab-export-step p { margin: 0; color: var(--lab-muted); font-size: 13px; line-height: 1.7; }
.lab-step-actions { display: grid; gap: 9px; margin-top: auto; }
.lab .lab-tactics-code { width: 100%; box-sizing: border-box; font: 700 clamp(18px,1.5vw,23px)/1.5 Consolas,monospace; text-align: center; letter-spacing: .035em; min-height: 48px; }
.lab .lab-tactics-code::placeholder { font: 12px/1.5 "Microsoft YaHei",sans-serif; letter-spacing: 0; }
.lab-export-step #lab-copy-tactics { margin-top: auto; }
.lab-export-step .lab-code-help { font-size: 12px; }
.lab-export-update { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #b9dc8155; border-radius: 8px; font-size: 13px; }
.lab-export-backup { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 14px; border: 1px solid var(--lab-line); border-radius: 9px; margin-bottom: 22px; }
.lab-export-backup p { margin: 4px 0 0; color: var(--lab-muted); font-size: 11px; }
.lab-export-dialog > label { margin: 12px 0; }
.lab-export-dialog > label input { flex: 1; }
#lab-export-error { color: #f0bd8a; font-size: 12px; }
.lab-name-dialog { width: min(400px,calc(100vw - 40px)); }
.lab-name-dialog h2 { margin-bottom: 20px; }
.lab-name-dialog label { flex-direction: column; align-items: stretch; margin-bottom: 20px; }
.lab-name-dialog .lab-dialog-actions { justify-content: flex-end; }
.lab-draw-dialog { width: min(920px,calc(100vw - 40px)); text-align: center; background: radial-gradient(ellipse at 50% 20%,#4b6041,#0c2221 60%); }
.lab-draw-dialog > h2 { font-size: 27px; margin: 6px 0 20px; }
#lab-draw-results { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.lab-draw-card { position: relative; width: clamp(130px,18vw,220px); aspect-ratio: 3/4; animation: lab-reveal .65s ease both; animation-delay: var(--delay,0s); }
.lab-draw-card:first-child:last-child { width: min(290px,70vw); }
#lab-draw-note { color: #d9e9c6; font-size: 13px; }
#lab-toast { position: fixed; z-index: 3000; bottom: 28px; left: 50%; transform: translateX(-50%); max-width: min(580px,90vw); border: 1px solid #cce99c55; border-radius: 10px; padding: 12px 20px; color: #ecf5dc; background: #123526f5; box-shadow: 0 7px 24px #0004; font-size: 13px; }
@keyframes lab-reveal { from { opacity: 0; transform: translateY(28px); filter: brightness(2.2); } to { opacity: 1; transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) { .lab-draw-card { animation: none; } }
html[data-theme="light"] .lab { --lab-panel: #f5f8f0; --lab-line: #456a442b; --lab-muted: #566a5a; color: #263e32; }
html[data-theme="light"] .lab input,html[data-theme="light"] .lab select { background: #fff; color: #20372b; border-color: #6d8c654d; }
html[data-theme="light"] .lab option { background: #fff; color: #20372b; }
html[data-theme="light"] .lab :is(.lab-eyebrow,.lab-player-item .lab-rating) { color: #526e20; }
html[data-theme="light"] .lab h1 span { color: #536c23; border-color: #789c5055; }
html[data-theme="light"] .lab .lab-library-tabs button[aria-selected="true"] { color: #416124; border-bottom-color: #689138; }
html[data-theme="light"] .lab-step-number { color: #527329; }
html[data-theme="light"] .lab .lab-player-item .lab-in-team { color: #347a42; }
html[data-theme="light"] .lab-warning { color: #765017; }
html[data-theme="light"] .lab-dialog { background: radial-gradient(ellipse at top left,#edf3dd,#f7f9f1 70%); color: #263e32; }
html[data-theme="light"] .lab .lab-dialog-close { color: #314c36; }
html[data-theme="light"] #lab-export-error { color: #a04c19; }
html[data-theme="light"] .lab-team-combobox { background: #fff; }
html[data-theme="light"] .lab .lab-team-combobox input { background: transparent; }
html[data-theme="light"] .lab-team-popup { background: #fbfdf7; color: #263e32; box-shadow: 0 12px 32px #243e3026; }
html[data-theme="light"] .lab-team-crest-fallback { color: #355b3c; background: radial-gradient(circle at 30% 25%,#e6f0e2,#d4e5d3); border-color: #85a98477; }
html[data-theme="light"] .lab .lab-team-option:is(:hover,.is-active) { background: #e9f1de; box-shadow: inset 3px 0 #648638; }
html[data-theme="light"] .lab-binding-error { color: #a04c19; }
html[data-theme="light"] .lab-draw-dialog { background: radial-gradient(ellipse at top,#e8edbd,#f1f6e9); }
html[data-theme="light"] #lab-draw-note { color: #395332; }
@media (min-width:2200px) { .lab-players { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width:850px) { .lab-export-steps { grid-template-columns: 1fr; }.lab-export-step { gap: 10px; }.lab-step-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }.lab-game-binding #lab-binding-status { margin-left: 0; width: 100%; }.lab-bound-team { flex: 1 1 280px; }.lab-export-update { flex-wrap: wrap; } }
@media (max-width:1100px) { .lab-workspace-grid { grid-template-columns: minmax(0,1.5fr) minmax(270px,1fr); }.lab-players { grid-template-columns: 1fr; }.lab-panel-heading span { display: none; }.lab-assignments { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:800px) { .lab-heading { align-items: start; flex-direction: column; gap: 12px; }.lab-workspace-grid { grid-template-columns: 1fr; }.lab-library { height: 520px !important; }.lab-players { grid-template-columns: repeat(2,minmax(0,1fr)); }.lab-team-summary { width: 100%; margin: 0; }.lab-tactics { grid-template-columns: 1fr; }.lab-player-dialog-grid { grid-template-columns: 1fr; gap: 18px; }.lab-full-card { max-width: 250px; margin: auto; }.lab-player-dialog { width: min(420px,calc(100vw - 24px)); }.lab-dialog { box-sizing: border-box; padding: 28px 18px 20px; }.lab-bench { justify-content: flex-start; } }
@media (max-width:430px) { .lab-players { grid-template-columns: 1fr; }.lab-panel-heading { align-items: start; }.lab-panel-heading label { flex-direction: column; align-items: start; }.lab-local-note { font-size: 10px; }.lab-export-backup { flex-direction: column; align-items: start; }.lab-filter-row { flex-wrap: wrap; }.lab-filter-row > * { flex: 1 1 40%; }.lab-assignments { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) { .lab-bound-team { flex: 1 1 100%; min-width: 0; flex-wrap: wrap; gap: 7px; }.lab-bound-team > label { width: 100%; }.lab-team-combobox { flex-basis: 100%; }.lab .lab-team-combobox input { font-size: 16px; }.lab-team-picker-actions { flex-wrap: wrap; }.lab-export-bound-team { min-width: 0; flex-basis: 100%; } }
