*{box-sizing:border-box}:root{--blue:#0a57c7;--dark:#10213a;--light:#f5f8fc;--red:#b93434;--border:#dce3ec}body{margin:0;font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--light);color:var(--dark)}header{background:linear-gradient(135deg,#073d91,#0a63df);color:#fff;padding:20px 24px;display:flex;justify-content:space-between;gap:20px;align-items:center}header h1{margin:0 0 4px;font-size:1.6rem}header p{margin:0;opacity:.85}button{border:0;border-radius:9px;background:var(--blue);color:#fff;padding:10px 14px;font-weight:700;cursor:pointer}button.secondary{background:#5b6879}button.danger{background:var(--red)}button.small{padding:3px 9px;font-size:18px}.top-actions{display:flex;gap:8px}.tabs{display:flex;gap:6px;padding:10px 16px;background:#fff;border-bottom:1px solid var(--border);overflow-x:auto}.tab{background:#e8eef7;color:var(--dark)}.tab.active{background:var(--blue);color:#fff}main{padding:18px;max-width:1450px;margin:auto}.panel{display:none}.panel.active{display:block}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:16px}.section-heading h2{margin-bottom:4px}.section-heading p{margin:0;color:#5a687a}.card-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:14px}.player-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:14px;box-shadow:0 2px 10px rgba(15,40,80,.05)}.player-card-top{display:flex;gap:8px;margin-bottom:10px}.player-name{width:100%;font-size:1.05rem;font-weight:800}input,select{width:100%;padding:8px;border:1px solid #cdd6e2;border-radius:7px;background:#fff}label{font-size:.82rem;font-weight:700;color:#48566a}.prefs-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.ratings{margin-top:12px;display:grid;grid-template-columns:repeat(2,1fr);gap:6px 10px}.rating-row{display:grid;grid-template-columns:1fr 58px;gap:7px;align-items:center}.rating-row input{text-align:center}.game-settings{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px;background:#fff;padding:14px;border-radius:12px;border:1px solid var(--border);margin-bottom:14px;align-items:end}.attendance-list{display:grid;gap:8px}.attendance-row{display:grid;grid-template-columns:minmax(160px,1.3fr) 160px 110px minmax(180px,1fr);gap:10px;align-items:center;background:#fff;border:1px solid var(--border);border-radius:10px;padding:10px}.status-badge{display:inline-flex;align-items:center;justify-content:center;font-weight:800;border-radius:999px;padding:6px 10px;font-size:.8rem}.present{background:#dff4e7;color:#176b3a}.late{background:#fff3ce;color:#8a6510}.absent{background:#f8dede;color:#8e2727}.injured{background:#ece8f8;color:#5b4788}.lineup-layout{display:grid;grid-template-columns:2fr 1fr;gap:16px}.field{position:relative;min-height:780px;border:4px solid #fff;border-radius:18px;background:radial-gradient(circle at 50% 50%,transparent 0 78px,rgba(255,255,255,.9) 79px 82px,transparent 83px),linear-gradient(to bottom,transparent 49.6%,rgba(255,255,255,.9) 49.6%,rgba(255,255,255,.9) 50.4%,transparent 50.4%),repeating-linear-gradient(90deg,#3d9b55 0 90px,#37914e 90px 180px);box-shadow:inset 0 0 0 2px rgba(255,255,255,.55),0 3px 16px rgba(0,0,0,.08);overflow:hidden}.position-slot{position:absolute;transform:translate(-50%,-50%);width:145px;background:rgba(255,255,255,.94);border:2px solid #0b4ea1;border-radius:12px;padding:8px;text-align:center}.position-slot .pos{font-size:.72rem;font-weight:900;color:#0b4ea1}.position-slot .name{font-weight:900;margin-top:2px}.position-slot .fit{font-size:.68rem;color:#66758a;margin-top:3px}.bench{display:grid;gap:8px}.bench-player{background:#fff;border:1px solid var(--border);border-radius:10px;padding:10px}.bench-player strong{display:block}.bench-player small{color:#657488}.clock-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:16px;display:flex;justify-content:space-between;align-items:center}.clock-label{font-weight:800;color:#68768a}.clock{font-size:2.7rem;font-weight:900;letter-spacing:1px}.clock-actions{display:flex;gap:8px;flex-wrap:wrap}.sub-plan{margin-top:14px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.sub-column{background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px}.sub-column h3{margin-top:0}.sub-item{padding:8px;border-bottom:1px solid #edf1f6}.sub-item:last-child{border-bottom:0}.sub-actions{display:flex;gap:8px;margin:14px 0}.minutes-table-wrap{background:#fff;border:1px solid var(--border);border-radius:12px;padding:12px;overflow-x:auto}table{border-collapse:collapse;width:100%}th,td{padding:9px;border-bottom:1px solid #edf1f5;text-align:left}th{color:#536176;font-size:.78rem;text-transform:uppercase}.notice{padding:12px;background:#fff6d8;border:1px solid #f0d171;border-radius:10px;color:#6f5711}@media(max-width:800px){header{align-items:flex-start;flex-direction:column}.game-settings{grid-template-columns:1fr 1fr}.attendance-row{grid-template-columns:1fr 1fr}.lineup-layout{grid-template-columns:1fr}.field{min-height:700px}.sub-plan{grid-template-columns:1fr}.position-slot{width:120px;padding:6px;font-size:.85rem}}


.attendance-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.attendance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-badge.unknown,
.status-choice.unknown {
  background: #eceff3;
  color: #596575;
}

.attendance-row.simple {
  grid-template-columns: minmax(160px, 1fr) minmax(430px, 2fr) 130px;
}

.attendance-name {
  font-size: 1rem;
}

.quick-status {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.status-choice {
  background: #eef2f7;
  color: #314056;
  border: 2px solid transparent;
  padding: 8px 11px;
  font-size: .82rem;
}

.status-choice.present { background: #e4f4ea; color: #176b3a; }
.status-choice.late { background: #fff4d7; color: #85620d; }
.status-choice.absent { background: #f8e1e1; color: #902929; }

.status-choice.selected {
  border-color: #173f7a;
  box-shadow: 0 0 0 2px rgba(23,63,122,.08);
}

@media (max-width: 800px) {
  .attendance-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .attendance-row.simple {
    grid-template-columns: 1fr;
  }
  .quick-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}


.arrived-btn {
  background: #1b8a4b;
  color: white;
}

.bench-player.waiting {
  border-style: dashed;
  background: #f8fafc;
}

.bench-player.waiting .bench-arrived {
  margin-top: 8px;
  width: 100%;
  background: #1b8a4b;
}


.brand-wrap{display:flex;align-items:center;gap:16px}.app-logo{width:72px;height:72px;object-fit:contain;filter:drop-shadow(0 4px 10px rgba(0,0,0,.25))}.field-watermark{position:absolute;right:20px;bottom:20px;width:150px;opacity:.13;pointer-events:none}@media(max-width:800px){.brand-wrap{align-items:flex-start}.app-logo{width:56px;height:56px}.field-watermark{width:110px;right:12px;bottom:12px}}


.lineup-controls{display:flex;gap:10px;align-items:end;flex-wrap:wrap}.lineup-controls label{min-width:170px}.lineup-hint{background:#eaf2ff;border:1px solid #b8d0f4;color:#294f82;border-radius:10px;padding:10px 12px;margin:-4px 0 14px;font-size:.9rem}.position-slot.interactive,.bench-player.interactive{cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}.position-slot.interactive:hover{box-shadow:0 5px 16px rgba(0,0,0,.18)}.position-slot.selected{border:4px solid #ffc928;box-shadow:0 0 0 4px rgba(255,201,40,.25),0 6px 18px rgba(0,0,0,.18);z-index:5}.position-slot.locked{border-color:#173f7a}.lock-btn{position:absolute;right:-9px;top:-11px;width:31px;height:31px;border-radius:50%;padding:0;background:#fff;color:#173f7a;border:2px solid #173f7a;font-size:15px;display:flex;align-items:center;justify-content:center}.position-slot.locked .lock-btn{background:#173f7a;color:#fff}.bench-player.swap-ready{border:2px solid #ffc928;background:#fffaf0}.bench-player.swap-ready:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,0,0,.1)}.swap-label{display:inline-block;margin-top:7px;background:#ffc928;color:#543f00;border-radius:999px;padding:3px 8px;font-size:.7rem;font-weight:800}

#unlockAllBtn{white-space:nowrap}


.game-bar{display:grid;grid-template-columns:1.05fr .75fr 1.35fr;gap:12px;background:#fff;border:1px solid var(--border);border-radius:14px;padding:12px 14px;margin-bottom:16px;box-shadow:0 2px 10px rgba(15,40,80,.05)}.game-bar-section{display:flex;align-items:center;gap:12px;min-height:70px}.game-bar-label{font-size:.75rem;font-weight:800;text-transform:uppercase;color:#66758a}.clock-section{flex-wrap:wrap}.game-bar-clock{font-size:2.15rem;font-weight:900;letter-spacing:1px;color:#10213a;min-width:112px}.game-bar-actions{display:flex;gap:6px}.game-bar-actions button{padding:8px 11px}.half-section{flex-direction:column;align-items:flex-start;justify-content:center}.half-picker{display:flex;gap:6px}.half-btn{background:#e8eef7;color:#10213a;padding:8px 12px}.half-btn.active{background:#0a57c7;color:#fff}.score-section{justify-content:center}.team-score{text-align:center;min-width:125px}.team-name{font-weight:900;margin-bottom:6px}.score-controls{display:flex;align-items:center;justify-content:center;gap:8px}.score-btn{width:38px;height:38px;padding:0;font-size:1.35rem}.score-number{font-size:2rem;font-weight:900;min-width:32px}.score-divider{font-size:1.8rem;font-weight:900;color:#8a96a6}.lineup-controls{display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap}.lineup-controls label{min-width:130px}@media(max-width:900px){.game-bar{grid-template-columns:1fr}.game-bar-section{justify-content:space-between}.half-section{flex-direction:row;align-items:center}.score-section{justify-content:space-around}}@media(max-width:560px){.game-bar-section{align-items:center;flex-wrap:wrap}.score-section{gap:4px}.team-score{min-width:110px}.game-bar-clock{font-size:1.8rem}.score-number{font-size:1.7rem}}


.quick-subs-card{
  background:white;
  border:1px solid var(--border);
  border-left:5px solid var(--blue);
  border-radius:12px;
  padding:12px 14px;
  margin:10px 0 16px;
}
.quick-subs-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}
.quick-subs-head>div{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap}
.quick-subs-eyebrow{font-size:.72rem;font-weight:900;letter-spacing:.08em;color:var(--blue)}
.quick-subs-head strong{font-size:.9rem;color:#536176}
.small-control{padding:7px 10px;font-size:.76rem}
.quick-subs-list{display:flex;gap:8px;flex-wrap:wrap}
.quick-sub-pair{display:grid;gap:3px;background:#f7f9fc;border:1px solid #e2e8f0;border-radius:9px;padding:8px 10px;min-width:220px}
.quick-in{font-weight:800;color:#176b3a}
.quick-out{font-size:.8rem;color:#8e2727}
.quick-subs-empty{color:#69788c;font-size:.88rem}

.planner-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0}
.planner-summary-item{background:white;border:1px solid var(--border);border-radius:10px;padding:11px 13px;display:flex;justify-content:space-between;gap:12px;align-items:center}
.planner-summary-item span{font-size:.78rem;color:#68768a;font-weight:800;text-transform:uppercase}
.planner-summary-item strong{font-size:1.15rem}

.detailed-sub-plan{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}
.detailed-sub-card{background:white;border:1px solid var(--border);border-radius:12px;overflow:hidden}
.detailed-sub-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;background:#eef4fb;color:#173f7a}
.detailed-player{padding:11px 12px;border-top:1px solid #edf1f5}
.detailed-player.in{border-left:4px solid #1b8a4b}
.detailed-player.out{border-left:4px solid #b93434}
.detailed-player>div:first-child{display:flex;justify-content:space-between;gap:10px;align-items:center}
.detailed-player small{color:#657488;font-weight:700}
.detail-stats{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.detail-stats span{background:#f1f4f8;border-radius:999px;padding:4px 7px;font-size:.72rem;font-weight:800;color:#536176}
.detailed-player p{margin:8px 0 0;color:#66758a;font-size:.8rem}

.sub-alternates{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0 16px}
.detail-card{background:white;border:1px solid var(--border);border-radius:12px;padding:12px}
.detail-card h3{margin:0 0 8px;font-size:1rem}
.detail-row{display:flex;justify-content:space-between;gap:14px;padding:7px 0;border-top:1px solid #edf1f5}
.detail-row:first-of-type{border-top:0}
.detail-row span,.detail-muted{font-size:.8rem;color:#66758a;text-align:right}
.minutes-over{color:#8e2727;font-weight:800}
.minutes-under{color:#176b3a;font-weight:800}

@media(max-width:800px){
  .planner-summary{grid-template-columns:1fr}
  .sub-alternates{grid-template-columns:1fr}
  .quick-sub-pair{min-width:100%}
}


.cloud-overlay{position:fixed;inset:0;z-index:10000;background:rgba(9,25,48,.72);backdrop-filter:blur(5px);display:flex;align-items:center;justify-content:center;padding:20px}
.cloud-overlay.hidden{display:none}
.cloud-card{width:min(520px,100%);background:white;border-radius:18px;padding:24px;box-shadow:0 22px 70px rgba(0,0,0,.3)}
.cloud-card h2{text-align:center;margin:8px 0 5px}.cloud-card>p{text-align:center;color:#64748b;margin:0 0 20px}.cloud-logo{display:block;width:90px;height:90px;object-fit:contain;margin:auto}.cloud-card label{display:block;margin:10px 0}.cloud-card input{margin-top:5px}.cloud-actions{display:flex;gap:9px;margin-top:14px}.cloud-actions button{flex:1}.cloud-message{min-height:22px;margin-top:12px;font-size:.85rem;color:#536176}.cloud-message.error{color:#a12a2a}.team-setup-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.team-option{border:1px solid #dde5ef;border-radius:12px;padding:14px}.team-option h3{margin-top:0}.cloud-top-actions{align-items:center;flex-wrap:wrap;justify-content:flex-end}.cloud-status{border-radius:999px;padding:6px 10px;font-size:.72rem;font-weight:900;white-space:nowrap}.cloud-status.offline{background:#e8edf3;color:#586678}.cloud-status.syncing{background:#fff1c8;color:#80610e}.cloud-status.online{background:#dff4e7;color:#176b3a}.cloud-status.error{background:#f7dddd;color:#8e2727}.team-badge{display:flex;flex-direction:column;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.25);padding:6px 10px;border-radius:9px;line-height:1.1}.team-badge small{margin-top:4px;opacity:.9}.hidden{display:none!important}
@media(max-width:800px){.team-setup-grid{grid-template-columns:1fr}.cloud-top-actions{justify-content:flex-start}.team-badge{order:-1;width:100%}}


.roster-actions{display:flex;gap:8px;flex-wrap:wrap}
.import-status{
  margin:-4px 0 14px;
  padding:10px 12px;
  border-radius:9px;
  background:#e5f5eb;
  border:1px solid #b8dfc7;
  color:#176b3a;
}
.import-card{max-width:650px}
.import-file-name{font-weight:800;color:#536176;word-break:break-word}
.check-row{display:flex!important;gap:10px;align-items:flex-start;margin:12px 0}
.check-row input{width:auto;margin-top:3px}
.import-preview{
  margin:14px 0;
  padding:12px;
  background:#f7f9fc;
  border:1px solid #dce3ec;
  border-radius:10px;
}
.import-preview-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}
.import-preview-grid>div{
  background:white;
  border:1px solid #e1e7ef;
  border-radius:8px;
  padding:9px;
  display:grid;
  gap:4px;
}
.import-preview-grid span{font-size:.7rem;text-transform:uppercase;color:#6a788a;font-weight:800}
.import-preview-grid strong{font-size:1.05rem}
.rating-source-summary{
  margin-top:10px;
  padding-top:8px;
  border-top:1px solid #e6ebf1;
  color:#68768a;
  font-size:.75rem;
  font-weight:700;
}
@media(max-width:800px){
  .import-preview-grid{grid-template-columns:1fr 1fr}
  .roster-actions{width:100%}
  .roster-actions button{flex:1}
}


.text-button{
  display:block;
  margin:10px auto 0;
  padding:6px 8px;
  border:0;
  background:transparent;
  color:#0a57c7;
  font-weight:800;
  text-decoration:underline;
}
.text-button:hover{background:transparent}
#passwordResetOverlay .cloud-card{max-width:440px}


.account-email{
  padding:8px 10px;
  border-radius:8px;
  background:#f3f6fa;
  color:#536176;
  font-weight:700;
  word-break:break-word;
}
#accountOverlay .cloud-card{max-width:440px}
#accountOverlay h3{margin:18px 0 6px}


.quick-subs-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.apply-all-subs{
  background:#1b8a4b;
  color:white;
  padding:9px 13px;
}
.apply-all-subs:disabled{
  background:#aab4c1;
  cursor:not-allowed;
}
@media(max-width:800px){
  .quick-subs-head{align-items:flex-start}
  .quick-subs-actions{width:100%}
  .quick-subs-actions button{flex:1}
}


.field-minutes{
  margin-top:4px;
  font-size:.68rem;
  line-height:1.1;
  font-weight:900;
  color:#536176;
}
.position-slot.locked .field-minutes{color:#7a6110}
.position-slot.selected .field-minutes{color:#173f7a}


.game-history-card{
  background:white;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 14px;
  margin:0 0 16px;
}
.game-history-head h3{margin:0 0 3px}
.game-history-head p{margin:0;color:#68768a;font-size:.84rem}
.game-history-list{display:grid;gap:8px;margin-top:10px}
.history-game{
  display:grid;
  gap:4px;
  padding:9px 10px;
  background:#f7f9fc;
  border:1px solid #e2e8f0;
  border-radius:9px;
}
.history-game>div{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
.history-game span{font-weight:800;color:#173f7a}
.history-game small{color:#68768a}


.history-game-button{
  width:100%;
  text-align:left;
  font:inherit;
  color:inherit;
  cursor:pointer;
}
.history-game-button:hover{
  border-color:#9eb7d8;
  background:#f1f6fc;
}
.game-history-modal-card{
  width:min(620px,94vw);
  max-height:85vh;
  overflow:auto;
}
.history-score{
  margin:10px 0 14px;
  padding:12px 14px;
  border-radius:10px;
  background:#eef4fb;
  text-align:center;
  font-size:1.15rem;
}
.history-player-list{
  display:grid;
  gap:7px;
}
.history-player-row{
  display:grid;
  grid-template-columns:34px 1fr auto;
  gap:10px;
  align-items:center;
  padding:9px 10px;
  border:1px solid #e1e7ef;
  border-radius:9px;
  background:#fff;
}
.history-player-rank{
  width:26px;
  height:26px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#eef2f7;
  font-size:.8rem;
  font-weight:800;
  color:#526174;
}
.history-player-name{
  font-weight:800;
}


.team-manage-card{width:min(760px,94vw);max-height:88vh;overflow:auto}
.team-manage-title{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.team-manage-title h2{margin:0 0 4px}
.team-manage-title p{margin:0;color:#66758a}
.join-code-panel{display:flex;justify-content:space-between;gap:16px;align-items:center;background:#eef5ff;border:1px solid #cfe0f5;border-radius:12px;padding:12px 14px;margin:14px 0 10px}
.join-code-panel span,.join-code-panel small{display:block;color:#66758a}
.join-code-panel strong{font-size:1.45rem;letter-spacing:.08em}
.join-code-actions{display:flex;gap:8px;flex-wrap:wrap}
.role-help{background:#f7f9fc;border:1px solid #e3e9f1;border-radius:10px;padding:10px 12px;font-size:.86rem;line-height:1.45}
.team-members-list{display:grid;gap:9px;margin-top:12px}
.team-member-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 12px;border:1px solid #e0e7ef;border-radius:10px;background:#fff}
.member-identity{display:grid;gap:2px;min-width:0}
.member-identity strong{overflow-wrap:anywhere}
.member-identity small{color:#738095}
.member-controls{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.member-role-select{min-width:150px}
.owner-pill{background:#173f7a;color:white;border-radius:999px;padding:6px 10px;font-size:.78rem;font-weight:800}
.member-readonly-note{padding:14px;border:1px solid #e2e8f0;background:#f7f9fc;border-radius:10px;line-height:1.5}
.viewer-mode main button:not(.history-game-button),
.viewer-mode main input,
.viewer-mode main select{opacity:.58;cursor:not-allowed}
.viewer-mode main input,
.viewer-mode main select{pointer-events:none}
@media(max-width:640px){
  .join-code-panel,.team-member-row{align-items:stretch;flex-direction:column}
  .join-code-actions,.member-controls{width:100%}
  .join-code-actions button,.member-controls button,.member-controls select{flex:1}
}


/* v27: saved-game report must behave like a true modal, not page content */
#gameHistoryModal.modal-overlay{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(12,22,36,.62);
  overflow:auto;
}
#gameHistoryModal.modal-overlay.hidden{
  display:none !important;
}
#gameHistoryModal .game-history-modal-card{
  width:min(640px,96vw);
  max-height:min(86vh,760px);
  overflow:auto;
  margin:auto;
  background:#fff;
  border-radius:14px;
  box-shadow:0 22px 70px rgba(0,0,0,.28);
}
#gameHistoryModal .modal-head{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  padding:14px 0 10px;
  background:#fff;
}
.game-history-modal-actions{
  position:sticky;
  bottom:0;
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:14px 0 2px;
  margin-top:14px;
  background:#fff;
  border-top:1px solid #e3e8ef;
}
.game-history-modal-actions button{
  min-width:120px;
}
@media(max-width:560px){
  #gameHistoryModal.modal-overlay{
    align-items:flex-end;
    padding:10px;
  }
  #gameHistoryModal .game-history-modal-card{
    width:100%;
    max-height:92vh;
    border-radius:14px 14px 10px 10px;
  }
  .game-history-modal-actions{
    flex-direction:column;
  }
  .game-history-modal-actions button{
    width:100%;
  }
}


/* v28: keep only one Close button in the header */
#gameHistoryModal .game-history-modal-actions{
  justify-content:flex-start;
}


.rating-sources-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 14px;
  margin:0 0 16px;
}
.rating-sources-head h3{margin:0 0 3px}
.rating-sources-head p{margin:0;color:#68768a;font-size:.84rem}
.rating-sources-list{display:grid;gap:7px;margin-top:10px}
.rating-source-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:9px 10px;
  background:#f7f9fc;
  border:1px solid #e2e8f0;
  border-radius:9px;
}
.rating-source-row span{color:#68768a;font-size:.84rem}


.team-switch-panel{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid #e2e8f0;
}
.team-switch-panel h3{margin:0 0 4px}
.team-switch-panel>p{margin:0 0 10px;color:#68768a;font-size:.86rem}
.my-teams-list{display:grid;gap:8px;margin-bottom:12px}
.my-team-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 11px;
  border:1px solid #e1e7ef;
  border-radius:10px;
  background:#fff;
}
.my-team-row.active{
  background:#eef5ff;
  border-color:#bdd3ee;
}
.my-team-row>div{display:grid;gap:2px}
.my-team-row small{color:#6d7b8f}
.current-team-pill{
  padding:5px 9px;
  border-radius:999px;
  background:#173f7a;
  color:#fff;
  font-size:.75rem;
  font-weight:800;
}
.join-another-team{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:end;
}
.join-another-team label{margin:0}
@media(max-width:600px){
  .join-another-team{grid-template-columns:1fr}
  .join-another-team button{width:100%}
}


/* v31 playing-time balance alerts */
.playtime-legend{
  display:flex;
  flex-wrap:wrap;
  gap:8px 14px;
  align-items:center;
  margin:7px 0 10px;
  font-size:.76rem;
  color:#637186;
}
.playtime-legend span{display:flex;align-items:center;gap:5px}
.playtime-dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  vertical-align:middle;
}
.playtime-dot.red{background:#d92d20}
.playtime-dot.orange{background:#f79009}
.playtime-dot.yellow{background:#f5c542}
.playtime-dot.green{background:#27ae60}

.playtime-alert{
  margin:8px 0 4px;
  padding:9px 11px;
  border-radius:9px;
  border:1px solid transparent;
  font-size:.86rem;
}
.playtime-alert-red{background:#fff0ee;border-color:#f3aaa3;color:#9f2017}
.playtime-alert-orange{background:#fff5e8;border-color:#f6c27d;color:#995700}
.playtime-alert-yellow{background:#fffbe8;border-color:#edd96f;color:#725d00}
.playtime-alert-green{background:#ecf8f0;border-color:#addbbb;color:#1d6938}

.position-slot.playtime-red{box-shadow:0 0 0 4px #d92d20,0 5px 14px rgba(0,0,0,.2)}
.position-slot.playtime-orange{box-shadow:0 0 0 4px #f79009,0 5px 14px rgba(0,0,0,.2)}
.position-slot.playtime-yellow{box-shadow:0 0 0 4px #f5c542,0 5px 14px rgba(0,0,0,.2)}
.position-slot.playtime-green{box-shadow:0 0 0 2px rgba(39,174,96,.45),0 5px 14px rgba(0,0,0,.16)}

.bench-player.playtime-red{border:2px solid #d92d20;background:#fff0ee}
.bench-player.playtime-orange{border:2px solid #f79009;background:#fff5e8}
.bench-player.playtime-yellow{border:2px solid #f5c542;background:#fffbe8}
.bench-player.playtime-green{border-left:4px solid #27ae60}

.playtime-chip{
  display:inline-flex;
  width:max-content;
  margin-top:5px;
  border-radius:999px;
  padding:3px 7px;
  font-size:.7rem;
  font-weight:800;
}
.playtime-chip.red{background:#d92d20;color:#fff}
.playtime-chip.orange{background:#f79009;color:#fff}
.playtime-chip.yellow{background:#f5c542;color:#4c4100}
.playtime-chip.green{background:#daf2e2;color:#176332}

#minutesTable tr.playtime-row-red td{background:#fff0ee}
#minutesTable tr.playtime-row-orange td{background:#fff5e8}
#minutesTable tr.playtime-row-yellow td{background:#fffbe8}
#minutesTable tr.playtime-row-green td:first-child{border-left:4px solid #27ae60}

@media(max-width:600px){
  .playtime-alert{font-size:.82rem}
  .playtime-legend{gap:6px 10px}
}


/* v32 roster deletion protection */
.player-card-actions{
  display:flex;
  align-items:center;
  gap:6px;
}
.roster-lock-btn{
  min-width:38px;
  padding:6px 8px;
  font-size:1rem;
  line-height:1;
}
.player-card.roster-locked{
  border-color:#d7e0ea;
}
.player-card.roster-locked .remove-player{
  opacity:.28;
  cursor:not-allowed;
  filter:grayscale(.4);
}
.player-card.roster-unlocked{
  border-color:#f0b0aa;
  box-shadow:0 0 0 2px rgba(217,45,32,.08);
}
.player-card.roster-unlocked .roster-lock-btn{
  background:#fff4e8;
  border-color:#f2c37d;
}


/* v33 collectible card style selection */
.card-style-summary{
  display:flex;
  align-items:center;
  gap:8px;
  margin:10px 0 12px;
  padding:8px 10px;
  border-radius:9px;
  border:1px solid #e1e7ef;
  background:#f8fafc;
  font-size:.78rem;
  color:#657287;
}
.card-style-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:78px;
  padding:4px 8px;
  border-radius:999px;
  font-weight:900;
  font-size:.72rem;
}
.card-style-silver .card-style-badge{
  background:linear-gradient(135deg,#d9dde3,#f6f7f9,#aab2bd);
  color:#27313e;
  border:1px solid #a9b1bc;
}
.card-style-gold .card-style-badge{
  background:linear-gradient(135deg,#b98512,#f4d76a,#c9971f);
  color:#3a2a05;
  border:1px solid #b98718;
}
.card-style-black-gold .card-style-badge{
  background:linear-gradient(135deg,#111,#3a2f17,#b58b28);
  color:#ffe39a;
  border:1px solid #9c7928;
}
.card-style-special .card-style-badge{
  background:linear-gradient(135deg,#32135d,#6a2ccf,#0a8cd8);
  color:white;
  border:1px solid #6f48d6;
}


/* v34 dark blue theme + theme toggle */
.theme-toggle-btn{
  min-width:118px;
  white-space:nowrap;
}

body[data-theme="dark"]{
  --blue:#3f8cff;
  --dark:#edf4ff;
  --light:#081322;
  --card:#0f2442;
  --muted:#aec2dd;
  --border:#2c4c74;
  --good:#39c883;
  --warn:#ffbd59;
  --bad:#ff7c7c;
  background:
    radial-gradient(circle at top left, rgba(34,84,170,.42), transparent 30%),
    radial-gradient(circle at top right, rgba(16,56,118,.35), transparent 28%),
    linear-gradient(180deg, #06101f 0%, #09152b 45%, #07111f 100%);
  color:#edf4ff;
}

body[data-theme="dark"] header{
  background:linear-gradient(135deg,#071223 0%, #0c2447 45%, #1152b0 100%);
  color:#fff;
  box-shadow:0 14px 30px rgba(0,0,0,.34);
}
body[data-theme="dark"] header h1,
body[data-theme="dark"] header p,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] label,
body[data-theme="dark"] strong,
body[data-theme="dark"] th,
body[data-theme="dark"] td,
body[data-theme="dark"] .detail-strong,
body[data-theme="dark"] .player-name-display{
  color:#edf4ff;
}
body[data-theme="dark"] .section-heading p,
body[data-theme="dark"] .detail-muted,
body[data-theme="dark"] .minutes-caption,
body[data-theme="dark"] .rating-source-summary,
body[data-theme="dark"] .planner-meta,
body[data-theme="dark"] .planner-note,
body[data-theme="dark"] .attendance-note,
body[data-theme="dark"] .clock-note,
body[data-theme="dark"] .quick-subs-empty,
body[data-theme="dark"] .subtle,
body[data-theme="dark"] small,
body[data-theme="dark"] p{
  color:#aec2dd;
}

body[data-theme="dark"] .tabs{
  background:rgba(7,18,35,.92);
  border-bottom:1px solid rgba(93,132,191,.28);
}
body[data-theme="dark"] .tab{
  background:#10213b;
  color:#dbe8ff;
  border:1px solid #2c4c74;
}
body[data-theme="dark"] .tab.active{
  background:linear-gradient(135deg,#115ed3,#3b89ff);
  color:#fff;
  border-color:#60a1ff;
}

body[data-theme="dark"] .panel,
body[data-theme="dark"] .player-card,
body[data-theme="dark"] .rating-sources-card,
body[data-theme="dark"] .recent-games-card,
body[data-theme="dark"] .attendance-toolbar,
body[data-theme="dark"] .attendance-row,
body[data-theme="dark"] .clock-card,
body[data-theme="dark"] .score-card,
body[data-theme="dark"] .scoreboard,
body[data-theme="dark"] .lineup-panel,
body[data-theme="dark"] .lineup-hint,
body[data-theme="dark"] .quick-subs-strip,
body[data-theme="dark"] .quick-subs-card,
body[data-theme="dark"] .quick-sub-card,
body[data-theme="dark"] .planner-summary-item,
body[data-theme="dark"] .detailed-sub-card,
body[data-theme="dark"] .detailed-player,
body[data-theme="dark"] .minutes-table-wrap,
body[data-theme="dark"] .history-card,
body[data-theme="dark"] .history-game-button,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .cloud-card,
body[data-theme="dark"] .cloud-modal,
body[data-theme="dark"] .team-card,
body[data-theme="dark"] .manage-card,
body[data-theme="dark"] .account-card,
body[data-theme="dark"] .import-preview-card,
body[data-theme="dark"] .card-style-summary,
body[data-theme="dark"] .planner-card{
  background:#0f2442 !important;
  color:#edf4ff;
  border-color:#2c4c74 !important;
  box-shadow:0 10px 26px rgba(0,0,0,.18);
}

body[data-theme="dark"] .detailed-sub-head,
body[data-theme="dark"] .planner-summary-item,
body[data-theme="dark"] .minutes-table-wrap thead tr,
body[data-theme="dark"] .history-header,
body[data-theme="dark"] .scoreboard,
body[data-theme="dark"] .cloud-head{
  background:#132d53 !important;
  color:#edf4ff;
}

body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea{
  background:#0a1a30;
  color:#edf4ff;
  border:1px solid #34577f;
}
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder{
  color:#86a0bf;
}

body[data-theme="dark"] button.secondary{
  background:#16355d;
  color:#edf4ff;
  border:1px solid #34577f;
}
body[data-theme="dark"] button.secondary:hover{
  background:#1a416f;
}
body[data-theme="dark"] button:not(.secondary):not(.danger):not(.tab){
  background:linear-gradient(135deg,#0d63df,#3f90ff);
  color:#fff;
  border:1px solid #5da0ff;
}
body[data-theme="dark"] button.danger{
  background:linear-gradient(135deg,#9f2323,#db4545);
  color:#fff;
  border:1px solid #ef7474;
}

body[data-theme="dark"] .team-badge{
  background:rgba(255,255,255,.08);
  color:#fff;
  border-color:rgba(255,255,255,.18);
}
body[data-theme="dark"] .cloud-status.offline{
  background:#5d1b1b;
  color:#ffd8d8;
}
body[data-theme="dark"] .cloud-status.online{
  background:#163d2b;
  color:#d8ffe7;
}
body[data-theme="dark"] .cloud-status.syncing{
  background:#47350d;
  color:#ffe7a3;
}

body[data-theme="dark"] table,
body[data-theme="dark"] th,
body[data-theme="dark"] td{
  border-color:#2c4c74;
}
body[data-theme="dark"] thead tr,
body[data-theme="dark"] th{
  background:#0a1930;
}
body[data-theme="dark"] tbody tr:nth-child(even){
  background:rgba(255,255,255,.02);
}

body[data-theme="dark"] .modal-overlay,
body[data-theme="dark"] .cloud-overlay{
  background:rgba(0,0,0,.62);
}

body[data-theme="dark"] .field-player-card,
body[data-theme="dark"] .bench-player,
body[data-theme="dark"] .position-slot{
  background:#0a1a30;
  color:#edf4ff;
  border-color:#395d88;
}

body[data-theme="dark"] .player-card.roster-unlocked{
  border-color:#b66767 !important;
  box-shadow:0 0 0 2px rgba(217,45,32,.15), 0 10px 26px rgba(0,0,0,.18);
}
body[data-theme="dark"] .player-card.roster-locked .remove-player{
  opacity:.35;
}

body[data-theme="dark"] .card-style-silver .card-style-badge{
  box-shadow:0 0 0 1px rgba(255,255,255,.08) inset;
}
body[data-theme="dark"] .card-style-gold .card-style-badge,
body[data-theme="dark"] .card-style-black-gold .card-style-badge,
body[data-theme="dark"] .card-style-special .card-style-badge{
  box-shadow:0 0 0 1px rgba(255,255,255,.08) inset;
}


/* v35 undo last sideline action */
.undo-btn{
  min-width:96px;
  white-space:nowrap;
}
.undo-btn:disabled{
  opacity:.42;
  cursor:not-allowed;
}
body[data-theme="dark"] .undo-btn:not(:disabled){
  background:#16355d;
  color:#edf4ff;
  border:1px solid #34577f;
}


/* v36 Big Sideline Mode */
.sideline-mode-btn.active{
  background:#0f7a45 !important;
  color:#fff !important;
  border-color:#33aa72 !important;
}
.sideline-exit-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  margin-bottom:14px;
  border-radius:12px;
  background:#eaf4ff;
  border:1px solid #bdd3ee;
}
.sideline-exit-bar strong{
  display:block;
  color:#173f7a;
  font-size:1.05rem;
}
.sideline-exit-bar span{
  color:#5c6f86;
  font-size:.82rem;
}
.sideline-exit-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

body.sideline-mode header{
  padding:10px 14px;
}
body.sideline-mode header .brand-wrap{
  display:none;
}
body.sideline-mode header .top-actions{
  width:100%;
  justify-content:flex-end;
  flex-wrap:wrap;
}
body.sideline-mode #teamManageBtn,
body.sideline-mode #accountBtn,
body.sideline-mode #saveBtn,
body.sideline-mode #signOutBtn,
body.sideline-mode #themeToggleBtn,
body.sideline-mode #teamBadge,
body.sideline-mode .tabs{
  display:none !important;
}
body.sideline-mode main{
  max-width:none;
  padding:10px;
}
body.sideline-mode .panel{
  display:none !important;
}
body.sideline-mode #lineup.panel{
  display:block !important;
}

body.sideline-mode .game-bar{
  grid-template-columns:1fr 1fr 1.5fr;
  padding:18px 20px;
  gap:18px;
  border-width:2px;
}
body.sideline-mode .game-bar-label{
  font-size:.9rem;
}
body.sideline-mode .game-bar-clock{
  font-size:3.5rem;
  min-width:170px;
}
body.sideline-mode .score-number{
  font-size:3rem;
}
body.sideline-mode .team-name{
  font-size:1.05rem;
}
body.sideline-mode .game-bar-actions button,
body.sideline-mode .half-btn,
body.sideline-mode .score-btn{
  min-height:46px;
  font-size:1rem;
}
body.sideline-mode .score-btn{
  width:48px;
  height:48px;
}

body.sideline-mode .lineup-controls button,
body.sideline-mode .lineup-controls select,
body.sideline-mode .quick-subs-actions button{
  min-height:48px;
  font-size:1rem;
}
body.sideline-mode .lineup-hint{
  font-size:1rem;
  padding:12px 14px;
}
body.sideline-mode .playtime-alert{
  font-size:1rem;
  padding:12px 14px;
}
body.sideline-mode .playtime-legend{
  font-size:.86rem;
}
body.sideline-mode .quick-subs-card{
  padding:16px;
  border-left-width:7px;
}
body.sideline-mode .quick-subs-eyebrow{
  font-size:.9rem;
}
body.sideline-mode .quick-subs-head strong{
  font-size:1.05rem;
}
body.sideline-mode .quick-sub-pair{
  min-width:260px;
  padding:12px 14px;
  font-size:1rem;
}
body.sideline-mode .quick-out{
  font-size:.92rem;
}

body.sideline-mode .lineup-layout{
  grid-template-columns:minmax(0,2.2fr) minmax(300px,.8fr);
  gap:18px;
}
body.sideline-mode .field{
  min-height:860px;
}
body.sideline-mode .position-slot{
  width:165px;
  padding:10px;
}
body.sideline-mode .position-slot .name{
  font-size:1.05rem;
}
body.sideline-mode .position-slot .fit,
body.sideline-mode .field-minutes{
  font-size:.78rem;
}
body.sideline-mode .bench-player{
  padding:14px;
  min-height:72px;
  font-size:1rem;
}
body.sideline-mode .bench-player strong{
  font-size:1.05rem;
}
body.sideline-mode .bench-player small{
  font-size:.82rem;
}
body.sideline-mode .playtime-chip{
  font-size:.78rem;
  padding:5px 9px;
}
body.sideline-mode .lock-btn{
  width:36px;
  height:36px;
  font-size:17px;
}

body[data-theme="dark"].sideline-mode .sideline-exit-bar{
  background:#102c51;
  border-color:#315d8f;
}
body[data-theme="dark"].sideline-mode .sideline-exit-bar strong{
  color:#eef5ff;
}
body[data-theme="dark"].sideline-mode .sideline-exit-bar span{
  color:#b9cbe2;
}

@media(max-width:900px){
  body.sideline-mode .game-bar{
    grid-template-columns:1fr;
  }
  body.sideline-mode .lineup-layout{
    grid-template-columns:1fr;
  }
  body.sideline-mode .field{
    min-height:780px;
  }
  body.sideline-mode .sideline-exit-bar{
    align-items:stretch;
    flex-direction:column;
  }
  body.sideline-mode .sideline-exit-actions button{
    flex:1;
  }
}
@media(max-width:560px){
  body.sideline-mode main{
    padding:6px;
  }
  body.sideline-mode .game-bar-clock{
    font-size:2.8rem;
  }
  body.sideline-mode .score-number{
    font-size:2.4rem;
  }
  body.sideline-mode .field{
    min-height:720px;
  }
  body.sideline-mode .position-slot{
    width:128px;
    padding:7px;
  }
}


/* v38 Halftime Summary */
.halftime-summary{
  margin:0 0 18px;
  padding:16px;
  border-radius:14px;
  border:2px solid #78a9e6;
  background:linear-gradient(135deg,#f7fbff,#eaf3ff);
  box-shadow:0 8px 22px rgba(14,71,145,.10);
}
.halftime-summary-head,
.halftime-suggestion-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}
.halftime-summary h2,
.halftime-summary h3{
  margin:3px 0 5px;
}
.halftime-summary p{
  margin:0;
  color:#5b6d83;
}
.halftime-eyebrow{
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.12em;
  color:#0a57c7;
}
.halftime-status-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
  margin:15px 0;
}
.halftime-status-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:11px;
}
.halftime-status-card span{
  font-size:.82rem;
  font-weight:800;
}
.halftime-status-card strong{
  font-size:1.5rem;
}
.halftime-status-card.behind{border-left:5px solid #d85a36}
.halftime-status-card.pace{border-left:5px solid #2f9b62}
.halftime-status-card.ahead{border-left:5px solid #4b7ed1}

.halftime-player-list{
  display:grid;
  gap:6px;
  margin-bottom:16px;
}
.halftime-player-row{
  display:grid;
  grid-template-columns:minmax(150px,1.2fr) 120px minmax(150px,1fr);
  gap:10px;
  align-items:center;
  padding:9px 11px;
  border-radius:9px;
  background:#fff;
  border:1px solid var(--border);
}
.halftime-player-row.behind{border-left:4px solid #d85a36}
.halftime-player-row.pace{border-left:4px solid #2f9b62}
.halftime-player-row.ahead{border-left:4px solid #4b7ed1}
.halftime-player-row span{
  font-size:.82rem;
  color:#627187;
}
.halftime-player-status{
  font-weight:800;
}

.halftime-suggestion{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
}
.halftime-lineup-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:8px;
  margin:14px 0;
}
.halftime-lineup-player{
  display:grid;
  gap:3px;
  padding:10px;
  border-radius:9px;
  border:1px solid #dce3ec;
  background:#f8fafc;
}
.halftime-lineup-player.behind{border-top:4px solid #d85a36}
.halftime-lineup-player.pace{border-top:4px solid #2f9b62}
.halftime-lineup-player.ahead{border-top:4px solid #4b7ed1}
.halftime-pos{
  color:#0a57c7;
  font-size:.72rem;
  font-weight:900;
}
.halftime-lineup-player small{
  color:#67758a;
}
.halftime-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.halftime-empty{
  padding:12px;
  border-radius:9px;
  background:#f7f9fc;
  color:#657488;
}

/* Dark theme */
body[data-theme="dark"] .halftime-summary{
  background:linear-gradient(135deg,#0b1c35,#102c51);
  border-color:#3b6da7;
  box-shadow:0 10px 26px rgba(0,0,0,.20);
}
body[data-theme="dark"] .halftime-eyebrow,
body[data-theme="dark"] .halftime-pos{
  color:#74adff;
}
body[data-theme="dark"] .halftime-status-card,
body[data-theme="dark"] .halftime-player-row,
body[data-theme="dark"] .halftime-suggestion,
body[data-theme="dark"] .halftime-lineup-player,
body[data-theme="dark"] .halftime-empty{
  background:#0f2442;
  border-color:#2c4c74;
  color:#edf4ff;
}
body[data-theme="dark"] .halftime-player-row span,
body[data-theme="dark"] .halftime-lineup-player small,
body[data-theme="dark"] .halftime-summary p{
  color:#aec2dd;
}

/* Bigger in sideline mode */
body.sideline-mode .halftime-summary{
  padding:20px;
  border-width:2px;
}
body.sideline-mode .halftime-status-card{
  padding:15px 16px;
}
body.sideline-mode .halftime-status-card strong{
  font-size:1.8rem;
}
body.sideline-mode .halftime-player-row{
  padding:12px 14px;
  font-size:1rem;
}
body.sideline-mode .halftime-lineup-player{
  padding:13px;
}
body.sideline-mode .halftime-actions button,
body.sideline-mode .halftime-summary-head button,
body.sideline-mode .halftime-suggestion-head button{
  min-height:46px;
  font-size:.95rem;
}

@media(max-width:700px){
  .halftime-summary-head,
  .halftime-suggestion-head{
    flex-direction:column;
  }
  .halftime-status-grid{
    grid-template-columns:1fr;
  }
  .halftime-player-row{
    grid-template-columns:1fr;
    gap:3px;
  }
  .halftime-actions{
    display:grid;
    grid-template-columns:1fr;
  }
}


/* v39 End First Half + halftime countdown */
.end-half-btn{
  background:linear-gradient(135deg,#c76a12,#e08a21) !important;
  border:1px solid #f0a34b !important;
  color:#fff !important;
  white-space:nowrap;
}
.end-half-btn:hover{filter:brightness(1.06)}

.halftime-timer-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:14px 16px;
  margin-bottom:16px;
  border-radius:12px;
  background:linear-gradient(135deg,#0a57c7,#173f7a);
  color:#fff;
}
.halftime-timer-card>div:first-child{
  display:grid;
  gap:2px;
}
.halftime-timer-label{
  font-size:.72rem;
  letter-spacing:.12em;
  font-weight:900;
  opacity:.85;
}
#halftimeCountdown{
  font-size:2.7rem;
  line-height:1;
  letter-spacing:.04em;
}
#halftimeTimerMessage{
  color:#dbe9ff;
  font-weight:700;
}
.halftime-timer-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.halftime-timer-actions .secondary{
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.28);
}
.halftime-timer-actions #startSecondHalfBtn{
  background:#1b8a4b;
  border:1px solid #54bd82;
}

body[data-theme="dark"] .halftime-timer-card{
  background:linear-gradient(135deg,#071a33,#124d98);
  border:1px solid #356fae;
}
body.sideline-mode .halftime-timer-card{
  padding:18px 20px;
}
body.sideline-mode #halftimeCountdown{
  font-size:3.5rem;
}
body.sideline-mode .halftime-timer-actions button{
  min-height:48px;
  font-size:1rem;
}

@media(max-width:700px){
  .halftime-timer-card{
    align-items:stretch;
    flex-direction:column;
  }
  .halftime-timer-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .halftime-timer-actions #startSecondHalfBtn{
    grid-column:1/-1;
  }
}


/* v39.2 dark-mode contrast fixes */
body[data-theme="dark"] .game-bar,
body[data-theme="dark"] .game-history-card,
body[data-theme="dark"] .rating-source-row,
body[data-theme="dark"] .detail-card,
body[data-theme="dark"] .quick-sub-pair{
  background:#0f2442 !important;
  color:#edf4ff !important;
  border-color:#2c4c74 !important;
}

/* Game bar was still using the light-theme white surface */
body[data-theme="dark"] .game-bar-label,
body[data-theme="dark"] .game-bar-clock,
body[data-theme="dark"] .team-name,
body[data-theme="dark"] .score-number{
  color:#edf4ff !important;
}
body[data-theme="dark"] .score-divider{
  color:#8fb1dc !important;
}
body[data-theme="dark"] .half-btn:not(.active){
  background:#16355d !important;
  color:#edf4ff !important;
  border:1px solid #34577f !important;
}

/* Ratings Sources */
body[data-theme="dark"] .rating-source-row strong{
  color:#edf4ff !important;
}
body[data-theme="dark"] .rating-source-row span,
body[data-theme="dark"] .rating-sources-head p{
  color:#b9cbe2 !important;
}

/* Recent Games */
body[data-theme="dark"] .game-history-card{
  box-shadow:0 10px 26px rgba(0,0,0,.18);
}
body[data-theme="dark"] .game-history-head h3{
  color:#edf4ff !important;
}
body[data-theme="dark"] .game-history-head p,
body[data-theme="dark"] .history-game small{
  color:#b9cbe2 !important;
}
body[data-theme="dark"] .history-game{
  background:#102a4d !important;
  border-color:#34577f !important;
}
body[data-theme="dark"] .history-game span{
  color:#84b7ff !important;
}
body[data-theme="dark"] .history-game-button:hover{
  background:#16355d !important;
  border-color:#4b79ad !important;
}

/* Next-subs detail cards */
body[data-theme="dark"] .detail-card h3,
body[data-theme="dark"] .detail-row b{
  color:#edf4ff !important;
}
body[data-theme="dark"] .detail-row{
  border-color:#2c4c74 !important;
}
body[data-theme="dark"] .detail-row span,
body[data-theme="dark"] .detail-muted{
  color:#b9cbe2 !important;
}

/* Quick substitution pair cards */
body[data-theme="dark"] .quick-sub-pair{
  background:#102a4d !important;
}
body[data-theme="dark"] .quick-in{
  color:#72e3a7 !important;
}
body[data-theme="dark"] .quick-out{
  color:#ffaaaa !important;
}

/* Playing-time status banners: use dark-tinted surfaces with readable text */
body[data-theme="dark"] .playtime-alert-red{
  background:#4a1d24 !important;
  border-color:#a64d5a !important;
  color:#ffd9de !important;
}
body[data-theme="dark"] .playtime-alert-orange{
  background:#4b3217 !important;
  border-color:#a56f27 !important;
  color:#ffe0ad !important;
}
body[data-theme="dark"] .playtime-alert-yellow{
  background:#454017 !important;
  border-color:#91852d !important;
  color:#fff1a8 !important;
}
body[data-theme="dark"] .playtime-alert-green{
  background:#163a2a !important;
  border-color:#347b59 !important;
  color:#d7ffe7 !important;
}
body[data-theme="dark"] .playtime-alert strong,
body[data-theme="dark"] .playtime-alert span{
  color:inherit !important;
}

/* Keep light-theme status colors from making dark-theme bench cards unreadable */
body[data-theme="dark"] .bench-player.playtime-red{
  background:#351923 !important;
}
body[data-theme="dark"] .bench-player.playtime-orange{
  background:#392817 !important;
}
body[data-theme="dark"] .bench-player.playtime-yellow{
  background:#393616 !important;
}
body[data-theme="dark"] .bench-player.playtime-green{
  background:#0a1a30 !important;
}


/* v39.3 exact nested-card dark mode fixes + stronger contrast */
body[data-theme="dark"] .game-bar{
  background:#0f2442 !important;
  border-color:#34577f !important;
  color:#edf4ff !important;
}
body[data-theme="dark"] .game-bar *{
  color:inherit;
}
body[data-theme="dark"] .game-bar .half-btn:not(.active),
body[data-theme="dark"] .game-bar .secondary{
  background:#17395f !important;
  color:#edf4ff !important;
  border-color:#456b97 !important;
}
body[data-theme="dark"] .game-bar .half-btn.active,
body[data-theme="dark"] .game-bar .score-btn:not(.secondary){
  color:#fff !important;
}
body[data-theme="dark"] .score-divider{color:#9db6d8 !important}

/* Exact nested cards that were remaining light */
body[data-theme="dark"] .rating-sources-card{
  background:#0f2442 !important;
  border-color:#34577f !important;
}
body[data-theme="dark"] .rating-source-row{
  background:#132d53 !important;
  border:1px solid #34577f !important;
  color:#edf4ff !important;
}
body[data-theme="dark"] .rating-source-row strong{color:#ffffff !important}
body[data-theme="dark"] .rating-source-row span{color:#bdd0e9 !important}

body[data-theme="dark"] .game-history-card{
  background:#0f2442 !important;
  border-color:#34577f !important;
  color:#edf4ff !important;
}
body[data-theme="dark"] .game-history-head h3{color:#ffffff !important}
body[data-theme="dark"] .game-history-head p{color:#bdd0e9 !important}
body[data-theme="dark"] .history-game,
body[data-theme="dark"] .history-game-button{
  background:#132d53 !important;
  border-color:#34577f !important;
  color:#edf4ff !important;
}
body[data-theme="dark"] .history-game strong{color:#ffffff !important}
body[data-theme="dark"] .history-game span{color:#8ec0ff !important}
body[data-theme="dark"] .history-game small{color:#bdd0e9 !important}

body[data-theme="dark"] .sub-alternates .detail-card,
body[data-theme="dark"] .detail-card{
  background:#132d53 !important;
  border:1px solid #34577f !important;
  color:#edf4ff !important;
}
body[data-theme="dark"] .detail-card h3,
body[data-theme="dark"] .detail-row b{color:#ffffff !important}
body[data-theme="dark"] .detail-row{
  border-color:#34577f !important;
}
body[data-theme="dark"] .detail-row span,
body[data-theme="dark"] .detail-muted{
  color:#bdd0e9 !important;
}

/* Keep the status banner dark even if earlier light-theme rules are more specific */
body[data-theme="dark"] #playTimeAlert.playtime-alert-green{
  background:#163a2a !important;
  border-color:#347b59 !important;
  color:#d7ffe7 !important;
}
body[data-theme="dark"] #playTimeAlert.playtime-alert-red{
  background:#4a1d24 !important;
  border-color:#a64d5a !important;
  color:#ffd9de !important;
}
body[data-theme="dark"] #playTimeAlert.playtime-alert-orange{
  background:#4b3217 !important;
  border-color:#a56f27 !important;
  color:#ffe0ad !important;
}
body[data-theme="dark"] #playTimeAlert.playtime-alert-yellow{
  background:#454017 !important;
  border-color:#91852d !important;
  color:#fff1a8 !important;
}


/* v39.4 dark-mode Playing Time table row highlights */
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-red,
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-red td{
  background:#4a1d24 !important;
  color:#ffd9de !important;
  border-color:#6f3340 !important;
}
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-orange,
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-orange td{
  background:#4b3217 !important;
  color:#ffe0ad !important;
  border-color:#745126 !important;
}
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-yellow,
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-yellow td{
  background:#454017 !important;
  color:#fff1a8 !important;
  border-color:#6f6725 !important;
}
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-green,
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-green td{
  background:#163a2a !important;
  color:#d7ffe7 !important;
  border-color:#285b43 !important;
}

/* Keep emphasized delta values readable inside highlighted rows */
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-red .minutes-under,
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-orange .minutes-under,
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-yellow .minutes-under{
  color:#fff !important;
  font-weight:800;
}
body[data-theme="dark"] #minutesTable tbody tr.playtime-row-green .minutes-over{
  color:#fff !important;
  font-weight:800;
}


/* v39.5 main End Match button */
.end-match-btn{
  background:#b4232f !important;
  border:1px solid #d6505d !important;
  color:#fff !important;
  white-space:nowrap;
}
.end-match-btn:hover{
  filter:brightness(1.08);
}
body.sideline-mode .end-match-btn{
  min-height:48px;
  font-size:1rem;
  font-weight:800;
}


/* v39.7 Check In All */
.attendance-toolbar-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.check-in-all-btn{
  background:#16834a;
  border-color:#2aa866;
  color:#fff;
}
.check-in-all-btn:hover:not(:disabled){
  filter:brightness(1.06);
}
.check-in-all-btn:disabled{
  opacity:.58;
  cursor:not-allowed;
}
body[data-theme="dark"] .check-in-all-btn{
  background:#176b43;
  border-color:#319264;
  color:#ecfff5;
}
@media(max-width:700px){
  .attendance-toolbar-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr;
  }
}


/* v39.8 compact halftime controls on live Lineup screen */
.halftime-compact-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  margin:0 0 14px;
  border:1px solid #4b79ad;
  border-radius:12px;
  background:#102a4d;
  color:#edf4ff;
}
.halftime-compact-bar>div:first-child{
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
}
.halftime-compact-label{
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.11em;
  color:#84b7ff;
}
#halftimeCompactCountdown{
  font-size:1.7rem;
  line-height:1;
}
#halftimeCompactMessage{
  color:#b9cbe2;
  font-weight:700;
}
.halftime-compact-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
body[data-theme="dark"] .halftime-compact-bar{
  background:#0d2342;
  border-color:#3b6da7;
}
body.sideline-mode #halftimeSummary{
  display:none !important;
}
body.sideline-mode .halftime-compact-bar{
  padding:14px 16px;
  margin-bottom:12px;
}
body.sideline-mode #halftimeCompactCountdown{
  font-size:2rem;
}
@media(max-width:800px){
  .halftime-compact-bar{
    align-items:stretch;
    flex-direction:column;
  }
  .halftime-compact-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .halftime-compact-actions #reviewHalftimeBtn,
  .halftime-compact-actions #startSecondHalfCompactBtn{
    grid-column:1/-1;
  }
}


/* v40.2 Refined shield-style player card redesign */
.fc-card-preview{
  display:flex;
  justify-content:center;
  margin:0 0 16px;
}

.fc-card{
  --fc-ink:#fff;
  --fc-muted:rgba(255,255,255,.85);
  --fc-name-bg:rgba(9,18,43,.42);
  --fc-name-color:var(--fc-ink);
  --fc-stat-color:var(--fc-ink);
  --fc-silhouette-fill:rgba(12,20,44,.82);
  --fc-silhouette-stroke:rgba(255,255,255,.16);
  --fc-silhouette-glow:rgba(255,255,255,.14);
  --fc-logo-shell:rgba(8,17,44,.26);
  --fc-logo-ring:rgba(255,255,255,.22);
  --fc-logo-filter:drop-shadow(0 1px 2px rgba(0,0,0,.38));
  --fc-logo-shadow:0 3px 8px rgba(0,0,0,.18);
  position:relative;
  width:252px;
  height:360px;
  margin:0 auto;
  color:var(--fc-ink);
  font-family:inherit;
  filter:drop-shadow(0 14px 18px rgba(0,0,0,.22));
  overflow:hidden;
}

.fc-card-compact{width:196px;height:284px}

.fc-card-surface,
.fc-card-shine,
.fc-card-noise{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.fc-card-surface{
  background-repeat:no-repeat;
  background-position:center;
  background-size:100% 100%;
}

.fc-card-shine{
  background:linear-gradient(115deg,transparent 0 30%,rgba(255,255,255,.15) 45%,transparent 62%);
  mix-blend-mode:screen;
  opacity:.55;
}

.fc-card-noise{
  background-image:radial-gradient(circle at 22% 18%,rgba(255,255,255,.16) 0 1px,transparent 1.5px),radial-gradient(circle at 70% 62%,rgba(0,0,0,.18) 0 1px,transparent 1.6px);
  background-size:14px 14px,16px 16px;
  opacity:.09;
  mix-blend-mode:overlay;
}

.fc-card-header,
.fc-portrait-wrap,
.fc-name-banner,
.fc-stats,
.fc-card-footer{position:relative;z-index:2}

.fc-card-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  position:absolute;
  left:0;
  right:0;
  top:26px;
  padding:0 28px;
}

.fc-rating-block{display:flex;flex-direction:column;line-height:.9;max-width:76px}
.fc-ovr{font-size:3rem;font-weight:1000;letter-spacing:-.08em;text-shadow:0 2px 6px rgba(0,0,0,.18)}
.fc-pos{font-size:1rem;font-weight:900;margin-top:4px;letter-spacing:.03em;text-shadow:0 2px 5px rgba(0,0,0,.16)}
.fc-pos-alt{display:flex;flex-direction:column;align-items:flex-start;gap:1px;margin-top:3px;opacity:.68;text-transform:uppercase;text-shadow:0 1px 4px rgba(0,0,0,.12)}
.fc-pos-alt span{display:block;font-size:.43rem;font-weight:800;line-height:1.08;letter-spacing:.08em}
.fc-header-side{display:flex;justify-content:center;align-items:center;min-width:30px;width:30px;height:30px;padding:4px;border-radius:999px;background:var(--fc-logo-shell);border:1px solid var(--fc-logo-ring);box-shadow:var(--fc-logo-shadow);backdrop-filter:blur(2px)}
.fc-club-logo{width:18px;height:18px;object-fit:contain;filter:var(--fc-logo-filter);opacity:1}

.fc-portrait-wrap{
  position:absolute;
  left:22px;
  right:22px;
  top:84px;
  height:128px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  margin:0;
}

.fc-card-compact .fc-portrait-wrap{top:70px;height:102px;left:18px;right:18px}

.fc-portrait-photo{
  max-width:80%;
  max-height:100%;
  object-fit:contain;
  object-position:center bottom;
  filter:drop-shadow(0 10px 10px rgba(0,0,0,.25));
}

.fc-silhouette-svg{
  width:76%;
  height:100%;
  overflow:visible;
}

.fc-shadow-floor{fill:rgba(0,0,0,.18)}
.fc-shadow-glow{fill:var(--fc-silhouette-glow)}
.fc-silhouette-person{
  fill:var(--fc-silhouette-fill);
  stroke:var(--fc-silhouette-stroke);
  stroke-width:3;
  filter:drop-shadow(0 5px 7px rgba(0,0,0,.18));
}

.fc-name-banner{
  position:absolute;
  left:50%;
  top:210px;
  transform:translateX(-50%);
  width:72%;
  margin:0;
  padding:7px 10px 6px;
  text-align:center;
  font-weight:1000;
  font-size:1.08rem;
  line-height:1.05;
  color:var(--fc-name-color);
  background:var(--fc-name-bg);
  border-radius:8px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-shadow:0 1px 1px rgba(0,0,0,.12);
}

.fc-stats{
  position:absolute;
  left:50%;
  bottom:40px;
  transform:translateX(-50%);
  width:72%;
  margin:0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:2px 14px;
}

.fc-stats-col{display:grid;gap:2px}
.fc-stat{display:grid;grid-template-columns:29px 1fr;align-items:end;gap:4px;color:var(--fc-stat-color)}
.fc-stat strong{font-size:.92rem;line-height:1;text-align:right}
.fc-stat span{font-size:.58rem;font-weight:1000;line-height:1.02;letter-spacing:.06em}

.fc-card-footer{display:none !important}
.fc-footer-logo{display:none !important}

/* Unified shield card family based on the Special card template */
.fc-card-gold,
.fc-card-silver,
.fc-card-black-gold,
.fc-card-special{
  background:transparent;
}

.fc-card-gold .fc-card-surface,
.fc-card-silver .fc-card-surface,
.fc-card-black-gold .fc-card-surface,
.fc-card-special .fc-card-surface{
  background-image:url('fc_frame_special.png');
  background-repeat:no-repeat;
  background-position:center;
  background-size:100% 100%;
}

/* Gold */
.fc-card-gold{
  --fc-ink:#201404;
  --fc-muted:rgba(86,59,8,.90);
  --fc-name-bg:rgba(255,219,102,.62);
  --fc-name-color:#1e1407;
  --fc-stat-color:#1e1407;
  --fc-silhouette-fill:rgba(100,64,4,.74);
  --fc-silhouette-stroke:rgba(255,238,171,.34);
  --fc-silhouette-glow:rgba(255,224,138,.18);
}
.fc-card-gold .fc-card-surface{filter:sepia(1) saturate(8) hue-rotate(338deg) brightness(1.42) contrast(1.05)}
.fc-card-gold .fc-card-shine{opacity:.44}

/* Silver / icon-like */
.fc-card-silver{
  --fc-ink:#1d2436;
  --fc-muted:rgba(36,46,68,.78);
  --fc-name-bg:rgba(255,255,255,.70);
  --fc-name-color:#1c2742;
  --fc-stat-color:#202c46;
  --fc-silhouette-fill:rgba(70,79,100,.58);
  --fc-silhouette-stroke:rgba(250,252,255,.48);
  --fc-silhouette-glow:rgba(236,245,255,.22);
}
.fc-card-silver .fc-card-surface{filter:grayscale(1) brightness(1.34) contrast(.92)}
.fc-card-silver .fc-card-shine{opacity:.40}

/* Black & Gold */
.fc-card-black-gold{
  --fc-ink:#f3d98f;
  --fc-muted:rgba(243,217,143,.82);
  --fc-name-bg:rgba(15,15,16,.56);
  --fc-name-color:#f4da92;
  --fc-stat-color:#f4da92;
  --fc-silhouette-fill:rgba(3,4,7,.78);
  --fc-silhouette-stroke:rgba(247,224,153,.20);
  --fc-silhouette-glow:rgba(247,224,153,.10);
}
.fc-card-black-gold .fc-card-surface{filter:sepia(1) saturate(2.2) hue-rotate(330deg) brightness(.46) contrast(1.36)}
.fc-card-black-gold .fc-card-shine{opacity:.22}

/* Special / neon blue */
.fc-card-special{
  --fc-ink:#ffffff;
  --fc-muted:rgba(228,242,255,.92);
  --fc-name-bg:rgba(39,26,78,.5);
  --fc-name-color:#ffffff;
  --fc-stat-color:#ffffff;
  --fc-silhouette-fill:rgba(8,18,56,.76);
  --fc-silhouette-stroke:rgba(153,245,255,.35);
  --fc-silhouette-glow:rgba(71,227,255,.18);
}
.fc-card-special .fc-card-surface{filter:none}
.fc-card-special .fc-card-shine{opacity:.52}

.fc-card-gold .fc-card-header,
.fc-card-silver .fc-card-header,
.fc-card-black-gold .fc-card-header,
.fc-card-special .fc-card-header{padding-top:0}

.player-card{padding:16px}
.player-card .fc-card-preview + .player-card-top{margin-top:4px;padding-top:12px;border-top:1px solid var(--border)}
.photo-url-label.hidden{display:none}
.photo-url-label input{margin-top:6px}

/* Field lineup now uses mini FC cards instead of simple blocks */
.position-slot.fc-field-card{
  width:136px;
  min-height:214px;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
  overflow:visible;
}
.position-slot.fc-field-card .fc-field-mini{
  width:136px;
  height:196px;
  margin:0;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.24));
}
.position-slot.fc-field-card .fc-field-mini .fc-card-header{top:13px;padding:0 14px}
.position-slot.fc-field-card .fc-field-mini .fc-rating-block{max-width:48px}
.position-slot.fc-field-card .fc-field-mini .fc-ovr{font-size:1.15rem;line-height:.94;text-shadow:0 1px 3px rgba(0,0,0,.24)}
.position-slot.fc-field-card .fc-field-mini .fc-pos{font-size:.53rem;margin-top:2px;letter-spacing:.02em}
.position-slot.fc-field-card .fc-field-mini .fc-pos-alt{display:none}
.position-slot.fc-field-card .fc-field-mini .fc-header-side{width:18px;height:18px;min-width:18px;padding:2px}
.position-slot.fc-field-card .fc-field-mini .fc-club-logo{width:10px;height:10px}
.position-slot.fc-field-card .fc-field-mini .fc-portrait-wrap{top:44px;left:13px;right:13px;height:62px}
.position-slot.fc-field-card .fc-field-mini .fc-name-banner{top:108px;width:72%;padding:4px 6px 4px;font-size:.58rem;border-radius:6px}
.position-slot.fc-field-card .fc-field-mini .fc-stats{bottom:14px;width:76%;gap:1px 8px}
.position-slot.fc-field-card .fc-field-mini .fc-stats-col{gap:1px}
.position-slot.fc-field-card .fc-field-mini .fc-stat{grid-template-columns:16px 1fr;gap:2px}
.position-slot.fc-field-card .fc-field-mini .fc-stat strong{font-size:.47rem}
.position-slot.fc-field-card .fc-field-mini .fc-stat span{font-size:.28rem;letter-spacing:.04em}
.position-slot.fc-field-card .field-card-meta{
  margin-top:4px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1px;
  font-size:.54rem;
  font-weight:800;
  color:#eef5ff;
  text-shadow:0 1px 2px rgba(0,0,0,.34);
}
.position-slot.fc-field-card .field-card-fit,
.position-slot.fc-field-card .field-card-minutes{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(8,28,61,.58);
  backdrop-filter:blur(2px);
}
.position-slot.fc-field-card .lock-btn{z-index:6;right:-7px;top:-8px;width:28px;height:28px}
.position-slot.fc-field-card.selected .fc-field-mini{filter:drop-shadow(0 0 0 rgba(0,0,0,0)) drop-shadow(0 0 0 4px rgba(255,201,40,.18)) drop-shadow(0 10px 18px rgba(0,0,0,.28));outline:3px solid #ffc928;outline-offset:2px;border-radius:20px}
.position-slot.fc-field-card.locked .lock-btn{background:#173f7a;color:#fff}
.position-slot.fc-field-card.playtime-red .fc-field-mini{filter:drop-shadow(0 0 0 3px #d92d20) drop-shadow(0 8px 14px rgba(0,0,0,.24))}
.position-slot.fc-field-card.playtime-orange .fc-field-mini{filter:drop-shadow(0 0 0 3px #f79009) drop-shadow(0 8px 14px rgba(0,0,0,.24))}
.position-slot.fc-field-card.playtime-yellow .fc-field-mini{filter:drop-shadow(0 0 0 3px #f5c542) drop-shadow(0 8px 14px rgba(0,0,0,.24))}
.position-slot.fc-field-card.playtime-green .fc-field-mini{filter:drop-shadow(0 0 0 2px rgba(39,174,96,.50)) drop-shadow(0 8px 14px rgba(0,0,0,.22))}
body[data-theme="dark"] .position-slot.fc-field-card{color:inherit}

@media(max-width:800px){
  .fc-card{width:216px;height:312px}
  .fc-card-compact{width:176px;height:254px}
  .fc-ovr{font-size:2.6rem}
  .fc-card-header{top:21px;padding:0 24px}
  .fc-header-side{width:26px;height:26px;padding:4px}
  .fc-club-logo{width:16px;height:16px}
  .fc-portrait-wrap{top:74px;left:18px;right:18px;height:108px;margin:0}
  .fc-pos{font-size:.9rem;margin-top:4px}
  .fc-pos-alt{gap:1px;margin-top:2px;opacity:.66}
  .fc-pos-alt span{font-size:.39rem}
  .fc-name-banner{top:178px;width:74%;font-size:.98rem}
  .fc-stats{bottom:28px;width:80%;gap:2px 12px}
  .fc-stat{grid-template-columns:27px 1fr;gap:4px}
  .fc-stat strong{font-size:.85rem}
  .fc-stat span{font-size:.54rem}
  .position-slot.fc-field-card{width:116px;min-height:184px}
  .position-slot.fc-field-card .fc-field-mini{width:116px;height:168px}
  .position-slot.fc-field-card .fc-field-mini .fc-card-header{top:11px;padding:0 12px}
  .position-slot.fc-field-card .fc-field-mini .fc-rating-block{max-width:42px}
  .position-slot.fc-field-card .fc-field-mini .fc-ovr{font-size:1rem}
  .position-slot.fc-field-card .fc-field-mini .fc-pos{font-size:.47rem}
  .position-slot.fc-field-card .fc-field-mini .fc-header-side{width:16px;height:16px;min-width:16px;padding:2px}
  .position-slot.fc-field-card .fc-field-mini .fc-club-logo{width:9px;height:9px}
  .position-slot.fc-field-card .fc-field-mini .fc-portrait-wrap{top:38px;left:11px;right:11px;height:54px}
  .position-slot.fc-field-card .fc-field-mini .fc-name-banner{top:92px;font-size:.52rem;padding:4px 5px 3px}
  .position-slot.fc-field-card .fc-field-mini .fc-stats{bottom:12px;width:78%;gap:1px 6px}
  .position-slot.fc-field-card .fc-field-mini .fc-stat{grid-template-columns:14px 1fr;gap:2px}
  .position-slot.fc-field-card .fc-field-mini .fc-stat strong{font-size:.41rem}
  .position-slot.fc-field-card .fc-field-mini .fc-stat span{font-size:.24rem}
  .position-slot.fc-field-card .field-card-meta{font-size:.48rem}
  .position-slot.fc-field-card .lock-btn{width:24px;height:24px;right:-5px;top:-6px}
}


/* v42.3 selectable card artwork sets */
.fc-design-badge.fc-card-silver .fc-card-surface{
  background-image:url('fc_frame_silver.svg');
  filter:none;
}
.fc-design-badge.fc-card-gold .fc-card-surface{
  background-image:url('fc_frame_gold.svg');
  filter:none;
}
.fc-design-badge.fc-card-black-gold .fc-card-surface{
  background-image:url('fc_frame_blackgold.webp');
  filter:none;
}
.fc-design-badge.fc-card-special .fc-card-surface{
  background-image:url('fc_frame_special.png');
  filter:none;
}

/* Keep the v40.4 recolored Special-template cards available as a second design. */
.fc-design-shield.fc-card-gold .fc-card-surface,
.fc-design-shield.fc-card-silver .fc-card-surface,
.fc-design-shield.fc-card-black-gold .fc-card-surface,
.fc-design-shield.fc-card-special .fc-card-surface{
  background-image:url('fc_frame_special.png');
}
.fc-design-shield.fc-card-gold .fc-card-surface{filter:sepia(1) saturate(8) hue-rotate(338deg) brightness(1.42) contrast(1.05)}
.fc-design-shield.fc-card-silver .fc-card-surface{filter:grayscale(1) brightness(1.34) contrast(.92)}
.fc-design-shield.fc-card-black-gold .fc-card-surface{filter:sepia(1) saturate(2.2) hue-rotate(330deg) brightness(.46) contrast(1.36)}
.fc-design-shield.fc-card-special .fc-card-surface{filter:none}

/* Badge artwork has slightly different safe areas than the unified shield. */
.fc-design-badge .fc-card-header{top:31px;padding:0 34px}
.fc-design-badge .fc-portrait-wrap{top:92px;left:28px;right:28px;height:120px}
.fc-design-badge .fc-name-banner{top:214px;width:68%}
.fc-design-badge .fc-stats{bottom:38px;width:70%}
.fc-design-badge .fc-card-footer{display:none}

.fc-design-badge.fc-card-gold{
  --fc-ink:#251b08;--fc-muted:rgba(70,52,17,.86);--fc-name-bg:rgba(255,235,163,.66);
  --fc-name-color:#251b08;--fc-stat-color:#251b08;--fc-silhouette-fill:rgba(93,67,18,.70);
}
.fc-design-badge.fc-card-silver{
  --fc-ink:#263244;--fc-muted:rgba(40,51,67,.78);--fc-name-bg:rgba(255,255,255,.72);
  --fc-name-color:#263244;--fc-stat-color:#263244;--fc-silhouette-fill:rgba(76,88,102,.58);
}
.fc-design-badge.fc-card-black-gold{
  --fc-ink:#f3d98f;--fc-muted:rgba(243,217,143,.82);--fc-name-bg:rgba(8,8,8,.62);
  --fc-name-color:#f4da92;--fc-stat-color:#f4da92;--fc-silhouette-fill:rgba(2,3,5,.78);
}
.fc-design-badge.fc-card-special{
  --fc-ink:#fff;--fc-muted:rgba(228,242,255,.92);--fc-name-bg:rgba(18,25,85,.56);
  --fc-name-color:#fff;--fc-stat-color:#fff;--fc-silhouette-fill:rgba(8,18,56,.76);
}

@media(max-width:800px){
  .fc-design-badge .fc-card-header{top:26px;padding:0 29px}
  .fc-design-badge .fc-portrait-wrap{top:80px;left:23px;right:23px;height:100px}
  .fc-design-badge .fc-name-banner{top:181px;width:72%}
  .fc-design-badge .fc-stats{bottom:28px;width:76%}
  .fc-design-badge .fc-card-footer{display:none}
}


/* Uploaded badge set supplied by user */
.fc-design-uploaded.fc-card-silver .fc-card-surface{
  background-image:url('fc_frame_uploaded_silver.png');
  filter:none;
}
.fc-design-uploaded.fc-card-gold .fc-card-surface{
  background-image:url('fc_frame_uploaded_gold.png');
  filter:none;
}
.fc-design-uploaded.fc-card-black-gold .fc-card-surface{
  background-image:url('fc_frame_uploaded_blackgold.png');
  filter:none;
}
.fc-design-uploaded.fc-card-special .fc-card-surface{
  background-image:url('fc_frame_uploaded_special.png');
  filter:none;
}

.fc-design-uploaded .fc-card-header{top:31px;padding:0 34px}
.fc-design-uploaded .fc-portrait-wrap{top:88px;left:28px;right:28px;height:118px}
.fc-design-uploaded .fc-name-banner{top:202px;width:70%}
.fc-design-uploaded .fc-stats{bottom:43px;width:72%}
.fc-design-uploaded .fc-card-footer{display:none}

.fc-design-uploaded.fc-card-gold{
  --fc-ink:#261c08;--fc-muted:rgba(73,56,15,.86);--fc-name-bg:rgba(255,236,168,.68);
  --fc-name-color:#261c08;--fc-stat-color:#261c08;--fc-silhouette-fill:rgba(102,74,18,.70);
  --fc-silhouette-stroke:rgba(255,241,193,.34);--fc-silhouette-glow:rgba(255,226,140,.16);
}
.fc-design-uploaded.fc-card-silver{
  --fc-ink:#243246;--fc-muted:rgba(45,58,78,.80);--fc-name-bg:rgba(255,255,255,.72);
  --fc-name-color:#243246;--fc-stat-color:#243246;--fc-silhouette-fill:rgba(72,87,104,.58);
  --fc-silhouette-stroke:rgba(250,252,255,.48);--fc-silhouette-glow:rgba(234,243,255,.20);
}
.fc-design-uploaded.fc-card-black-gold{
  --fc-ink:#f3d98f;--fc-muted:rgba(243,217,143,.84);--fc-name-bg:rgba(7,7,7,.60);
  --fc-name-color:#f4da92;--fc-stat-color:#f4da92;--fc-silhouette-fill:rgba(2,3,4,.80);
  --fc-silhouette-stroke:rgba(247,224,153,.18);--fc-silhouette-glow:rgba(247,224,153,.09);
}
.fc-design-uploaded.fc-card-special{
  --fc-ink:#ffffff;--fc-muted:rgba(232,241,255,.94);--fc-name-bg:rgba(42,22,86,.52);
  --fc-name-color:#ffffff;--fc-stat-color:#ffffff;--fc-silhouette-fill:rgba(8,18,56,.78);
  --fc-silhouette-stroke:rgba(170,235,255,.30);--fc-silhouette-glow:rgba(120,226,255,.18);
}

@media(max-width:800px){
  .fc-design-uploaded .fc-card-header{top:25px;padding:0 29px}
  .fc-design-uploaded .fc-portrait-wrap{top:77px;left:23px;right:23px;height:98px}
  .fc-design-uploaded .fc-name-banner{top:171px;width:74%}
  .fc-design-uploaded .fc-stats{bottom:32px;width:78%}
  .fc-design-uploaded .fc-card-footer{display:none}
}


/* v41.0 per-card readability tuning */
.fc-card-gold{
  --fc-logo-shell:rgba(255,243,200,.50);
  --fc-logo-ring:rgba(103,73,11,.22);
  --fc-logo-filter:drop-shadow(0 1px 1px rgba(255,255,255,.25)) drop-shadow(0 1px 2px rgba(75,54,8,.30));
}
.fc-card-silver{
  --fc-logo-shell:rgba(255,255,255,.52);
  --fc-logo-ring:rgba(84,101,132,.20);
  --fc-logo-filter:drop-shadow(0 1px 1px rgba(255,255,255,.45)) drop-shadow(0 1px 2px rgba(48,60,80,.22));
}
.fc-card-black-gold{
  --fc-logo-shell:rgba(239,242,246,.55);
  --fc-logo-ring:rgba(243,217,143,.34);
  --fc-logo-filter:drop-shadow(0 0 2px rgba(255,240,193,.50)) drop-shadow(0 1px 3px rgba(0,0,0,.35));
  --fc-logo-shadow:0 3px 8px rgba(0,0,0,.22);
}
.fc-card-special{
  --fc-logo-shell:rgba(235,241,247,.58);
  --fc-logo-ring:rgba(113,234,255,.42);
  --fc-logo-filter:drop-shadow(0 0 3px rgba(120,235,255,.72)) drop-shadow(0 0 6px rgba(255,78,230,.28));
  --fc-logo-shadow:0 3px 8px rgba(0,0,0,.22);
}
.fc-design-uploaded.fc-card-special .fc-name-banner{
  background:rgba(36,21,88,.68);
  box-shadow:0 0 10px rgba(84,228,255,.18);
}
.fc-design-uploaded.fc-card-special .fc-stat,
.fc-design-uploaded.fc-card-black-gold .fc-stat{
  text-shadow:0 1px 4px rgba(0,0,0,.40);
}
.fc-design-uploaded.fc-card-special .fc-stats{bottom:42px;width:74%}
.fc-design-uploaded.fc-card-black-gold .fc-stats{bottom:41px;width:73%}
.fc-design-uploaded.fc-card-gold .fc-stats,
.fc-design-uploaded.fc-card-silver .fc-stats{bottom:43px;width:72%}
@media(max-width:800px){
  .fc-design-uploaded.fc-card-special .fc-stats{bottom:31px;width:80%}
  .fc-design-uploaded.fc-card-black-gold .fc-stats{bottom:30px;width:79%}
  .fc-design-uploaded.fc-card-gold .fc-stats,
  .fc-design-uploaded.fc-card-silver .fc-stats{bottom:31px;width:78%}
}


/* v41.8 continued card-position refinement */
/* Keep the nameplate and bottom stats where they are. */
/* Gold / Silver: almost there, so move the text side a little and the crest a bit more. */
.fc-design-uploaded .fc-card-header{top:49px}
.fc-design-uploaded.fc-card-gold .fc-card-header,
.fc-design-uploaded.fc-card-silver .fc-card-header{top:73px}
.fc-design-uploaded.fc-card-gold .fc-header-side,
.fc-design-uploaded.fc-card-silver .fc-header-side{margin-top:6px}

/* Black & Gold still needs a larger drop, especially the crest. */
.fc-design-uploaded.fc-card-black-gold .fc-card-header{top:77px}
.fc-design-uploaded.fc-card-black-gold .fc-header-side{margin-top:10px}

/* Special stays locked in place except for its already-tuned crest offset. */
.fc-design-uploaded.fc-card-special .fc-header-side{margin-top:8px}

.fc-design-uploaded .fc-stats{bottom:69px}
.fc-design-uploaded.fc-card-special .fc-stats{bottom:68px;width:74%}
.fc-design-uploaded.fc-card-black-gold .fc-stats{bottom:74px;width:73%}
.fc-design-uploaded.fc-card-gold .fc-stats,
.fc-design-uploaded.fc-card-silver .fc-stats{bottom:76px;width:72%}

/* Secondary positions stay on separate lines with restored readability. */
.fc-design-uploaded .fc-pos-alt{opacity:.60;margin-top:2px;gap:1px}
.fc-design-uploaded .fc-pos-alt span{font-size:.42rem;font-weight:780;letter-spacing:.07em}

@media(max-width:800px){
  .fc-design-uploaded .fc-card-header{top:39px}
  .fc-design-uploaded.fc-card-gold .fc-card-header,
  .fc-design-uploaded.fc-card-silver .fc-card-header{top:58px}
  .fc-design-uploaded.fc-card-gold .fc-header-side,
  .fc-design-uploaded.fc-card-silver .fc-header-side{margin-top:4px}

  .fc-design-uploaded.fc-card-black-gold .fc-card-header{top:62px}
  .fc-design-uploaded.fc-card-black-gold .fc-header-side{margin-top:7px}

  .fc-design-uploaded.fc-card-special .fc-header-side{margin-top:6px}

  .fc-design-uploaded .fc-stats{bottom:50px}
  .fc-design-uploaded.fc-card-special .fc-stats{bottom:49px;width:80%}
  .fc-design-uploaded.fc-card-black-gold .fc-stats{bottom:54px;width:79%}
  .fc-design-uploaded.fc-card-gold .fc-stats,
  .fc-design-uploaded.fc-card-silver .fc-stats{bottom:56px;width:78%}

  .fc-design-uploaded .fc-pos-alt{opacity:.58;margin-top:2px}
  .fc-design-uploaded .fc-pos-alt span{font-size:.39rem}
}


/* v42.0 clean roster card view + expandable editor */
#rosterGrid{
  grid-template-columns:repeat(auto-fit,minmax(285px,1fr));
  align-items:start;
}
#rosterGrid .roster-fc-card{
  min-width:0;
  padding:14px 12px 12px;
  transition:border-color .18s ease,box-shadow .18s ease;
}
#rosterGrid .roster-fc-card .fc-card-preview{
  margin-bottom:8px;
}
.roster-card-toolbar{
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:38px;
}
.edit-player-btn{
  width:min(170px,86%);
  padding:8px 12px;
  font-size:.82rem;
  border:1px solid color-mix(in srgb,var(--border) 72%,transparent);
}
.player-edit-panel{display:none}
.roster-fc-card.editing{
  grid-column:span 2;
  display:grid;
  grid-template-columns:minmax(260px,300px) minmax(0,1fr);
  grid-template-rows:auto auto;
  column-gap:20px;
  row-gap:8px;
  padding:16px;
  box-shadow:0 8px 24px rgba(8,31,67,.10);
}
.roster-fc-card.editing .fc-card-preview{
  grid-column:1;
  grid-row:1;
  margin:0;
  align-self:start;
}
.roster-fc-card.editing .roster-card-toolbar{
  grid-column:1;
  grid-row:2;
  align-self:start;
}
.roster-fc-card.editing .player-edit-panel{
  display:block;
  grid-column:2;
  grid-row:1 / span 2;
  min-width:0;
  padding-left:18px;
  border-left:1px solid var(--border);
}
.roster-fc-card.editing .player-card-top{
  margin-top:0;
  padding-top:0;
  border-top:0;
}
.roster-fc-card:not(.editing) .player-edit-panel{display:none}
body[data-theme="dark"] .roster-fc-card.editing{
  box-shadow:0 8px 24px rgba(0,0,0,.22);
}
@media(max-width:900px){
  #rosterGrid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
  .roster-fc-card.editing{
    grid-column:1/-1;
    grid-template-columns:1fr;
  }
  .roster-fc-card.editing .fc-card-preview,
  .roster-fc-card.editing .roster-card-toolbar,
  .roster-fc-card.editing .player-edit-panel{grid-column:1}
  .roster-fc-card.editing .fc-card-preview{grid-row:1}
  .roster-fc-card.editing .roster-card-toolbar{grid-row:2}
  .roster-fc-card.editing .player-edit-panel{
    grid-row:3;
    padding:14px 0 0;
    border-left:0;
    border-top:1px solid var(--border);
  }
}


/* v42.2 field-card cleanup: smaller cards, no legacy square wrapper */
.position-slot.fc-field-card,
body[data-theme="dark"] .position-slot.fc-field-card,
body.sideline-mode .position-slot.fc-field-card,
body[data-theme="dark"].sideline-mode .position-slot.fc-field-card{
  width:112px !important;
  min-height:176px !important;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
  border-color:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
  color:inherit;
  overflow:visible !important;
}

.position-slot.fc-field-card .fc-field-mini{
  width:108px !important;
  height:156px !important;
  margin:0 auto !important;
  outline:0;
  border:0;
  border-radius:0;
  filter:drop-shadow(0 5px 7px rgba(0,0,0,.23));
}

/* Override the full-size Uploaded Set placements for the pitch mini cards. */
.position-slot.fc-field-card .fc-field-mini .fc-card-header,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-card-header,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-gold .fc-card-header,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-silver .fc-card-header,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-black-gold .fc-card-header,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-special .fc-card-header{
  top:10px !important;
  padding:0 11px !important;
}
.position-slot.fc-field-card .fc-field-mini .fc-rating-block{max-width:40px !important;line-height:.92}
.position-slot.fc-field-card .fc-field-mini .fc-ovr{font-size:.92rem !important;line-height:.92}
.position-slot.fc-field-card .fc-field-mini .fc-pos{font-size:.43rem !important;margin-top:2px !important}
.position-slot.fc-field-card .fc-field-mini .fc-pos-alt{display:none !important}
.position-slot.fc-field-card .fc-field-mini .fc-header-side,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-special .fc-header-side,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-gold .fc-header-side,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-silver .fc-header-side,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-black-gold .fc-header-side{
  width:14px !important;
  height:14px !important;
  min-width:14px !important;
  padding:2px !important;
  margin-top:0 !important;
}
.position-slot.fc-field-card .fc-field-mini .fc-club-logo{width:8px !important;height:8px !important}
.position-slot.fc-field-card .fc-field-mini .fc-portrait-wrap,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-portrait-wrap{
  top:33px !important;
  left:10px !important;
  right:10px !important;
  height:48px !important;
}
.position-slot.fc-field-card .fc-field-mini .fc-name-banner,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-name-banner,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-special .fc-name-banner{
  top:82px !important;
  width:72% !important;
  padding:3px 4px !important;
  font-size:.47rem !important;
  border-radius:5px !important;
}
.position-slot.fc-field-card .fc-field-mini .fc-stats,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-stats,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-gold .fc-stats,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-silver .fc-stats,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-black-gold .fc-stats,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-special .fc-stats{
  bottom:11px !important;
  width:78% !important;
  gap:1px 5px !important;
}
.position-slot.fc-field-card .fc-field-mini .fc-stats-col{gap:1px !important}
.position-slot.fc-field-card .fc-field-mini .fc-stat{grid-template-columns:13px 1fr !important;gap:1px !important}
.position-slot.fc-field-card .fc-field-mini .fc-stat strong{font-size:.37rem !important}
.position-slot.fc-field-card .fc-field-mini .fc-stat span{font-size:.22rem !important;letter-spacing:.03em !important}

/* Keep the useful information from the old square, just without the initials bubble or box. */
.position-slot.fc-field-card .field-card-meta,
body.sideline-mode .position-slot.fc-field-card .field-card-meta{
  margin-top:1px !important;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0;
  font-size:.48rem !important;
  line-height:1.15;
  font-weight:850;
  color:#fff;
  text-align:center;
  text-shadow:0 1px 2px rgba(0,0,0,.55);
}
.position-slot.fc-field-card .field-card-fit,
.position-slot.fc-field-card .field-card-minutes{
  display:block !important;
  padding:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  backdrop-filter:none !important;
}
.position-slot.fc-field-card .field-card-minutes{font-size:.44rem;opacity:.88;margin-top:1px}

.position-slot.fc-field-card .lock-btn{
  z-index:8;
  right:-1px !important;
  top:-3px !important;
  width:23px !important;
  height:23px !important;
  font-size:12px !important;
}

/* Selection/playtime indicators follow the card silhouette instead of creating a square. */
.position-slot.fc-field-card.selected{
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}
.position-slot.fc-field-card.selected .fc-field-mini{
  outline:2px solid #ffc928 !important;
  outline-offset:1px !important;
  border-radius:12px !important;
  filter:drop-shadow(0 7px 10px rgba(0,0,0,.26));
}
.position-slot.fc-field-card.playtime-red,
.position-slot.fc-field-card.playtime-orange,
.position-slot.fc-field-card.playtime-yellow,
.position-slot.fc-field-card.playtime-green{
  box-shadow:none !important;
}
.position-slot.fc-field-card.playtime-red .fc-field-mini{filter:drop-shadow(0 0 3px rgba(217,45,32,.95)) drop-shadow(0 5px 7px rgba(0,0,0,.22))}
.position-slot.fc-field-card.playtime-orange .fc-field-mini{filter:drop-shadow(0 0 3px rgba(247,144,9,.95)) drop-shadow(0 5px 7px rgba(0,0,0,.22))}
.position-slot.fc-field-card.playtime-yellow .fc-field-mini{filter:drop-shadow(0 0 3px rgba(245,197,66,.90)) drop-shadow(0 5px 7px rgba(0,0,0,.22))}
.position-slot.fc-field-card.playtime-green .fc-field-mini{filter:drop-shadow(0 0 2px rgba(39,174,96,.65)) drop-shadow(0 5px 7px rgba(0,0,0,.22))}

@media(max-width:800px){
  .position-slot.fc-field-card,
  body[data-theme="dark"] .position-slot.fc-field-card,
  body.sideline-mode .position-slot.fc-field-card{
    width:96px !important;
    min-height:151px !important;
  }
  .position-slot.fc-field-card .fc-field-mini{width:92px !important;height:133px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-card-header,
  .position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-card-header{top:8px !important;padding:0 9px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-ovr{font-size:.80rem !important}
  .position-slot.fc-field-card .fc-field-mini .fc-pos{font-size:.38rem !important}
  .position-slot.fc-field-card .fc-field-mini .fc-header-side{width:12px !important;height:12px !important;min-width:12px !important;padding:1px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-club-logo{width:7px !important;height:7px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-portrait-wrap,
  .position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-portrait-wrap{top:28px !important;height:41px !important;left:8px !important;right:8px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-name-banner,
  .position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-name-banner{top:70px !important;font-size:.41rem !important;padding:3px 4px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-stats,
  .position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-stats{bottom:9px !important;width:80% !important;gap:1px 4px !important}
  .position-slot.fc-field-card .fc-field-mini .fc-stat{grid-template-columns:11px 1fr !important}
  .position-slot.fc-field-card .fc-field-mini .fc-stat strong{font-size:.32rem !important}
  .position-slot.fc-field-card .fc-field-mini .fc-stat span{font-size:.19rem !important}
  .position-slot.fc-field-card .field-card-meta{font-size:.42rem !important}
  .position-slot.fc-field-card .field-card-minutes{font-size:.39rem}
  .position-slot.fc-field-card .lock-btn{width:21px !important;height:21px !important;font-size:11px !important}
}


/* v42.3 simplified field cards: only position, name, choice, and minutes */
.position-slot.fc-field-card,
body[data-theme="dark"] .position-slot.fc-field-card,
body.sideline-mode .position-slot.fc-field-card,
body[data-theme="dark"].sideline-mode .position-slot.fc-field-card{
  width:104px !important;
  min-height:148px !important;
}

.position-slot.fc-field-card .fc-field-mini{
  width:100px !important;
  height:143px !important;
}

/* Hide all roster-style extras on field cards. */
.position-slot.fc-field-card .fc-field-mini .fc-card-header,
.position-slot.fc-field-card .fc-field-mini .fc-stats,
.position-slot.fc-field-card .field-card-meta{
  display:none !important;
}

.position-slot.fc-field-card .fc-field-mini .fc-field-position{
  position:absolute;
  z-index:4;
  left:50%;
  top:20px;
  transform:translateX(-50%);
  width:70%;
  text-align:center;
  font-size:.76rem;
  line-height:1;
  font-weight:1000;
  letter-spacing:.04em;
  color:var(--fc-ink);
  text-shadow:0 1px 4px rgba(0,0,0,.32);
}

.position-slot.fc-field-card .fc-field-mini .fc-portrait-wrap,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-portrait-wrap{
  top:30px !important;
  left:10px !important;
  right:10px !important;
  height:54px !important;
}

.position-slot.fc-field-card .fc-field-mini .fc-name-banner,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-name-banner,
.position-slot.fc-field-card .fc-field-mini.fc-design-uploaded.fc-card-special .fc-name-banner{
  top:82px !important;
  width:74% !important;
  padding:3px 4px !important;
  font-size:.49rem !important;
  border-radius:5px !important;
}

.position-slot.fc-field-card .fc-field-mini .fc-field-details{
  position:absolute;
  z-index:4;
  left:50%;
  bottom:22px;
  transform:translateX(-50%);
  width:78%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  text-align:center;
  color:var(--fc-stat-color);
  text-shadow:0 1px 3px rgba(0,0,0,.28);
}
.position-slot.fc-field-card .fc-field-mini .fc-field-choice{
  font-size:.42rem;
  line-height:1;
  font-weight:950;
}
.position-slot.fc-field-card .fc-field-mini .fc-field-minutes{
  font-size:.38rem;
  line-height:1;
  font-weight:850;
  opacity:.88;
}

.position-slot.fc-field-card .lock-btn{
  right:1px !important;
  top:-2px !important;
}

@media(max-width:800px){
  .position-slot.fc-field-card,
  body[data-theme="dark"] .position-slot.fc-field-card,
  body.sideline-mode .position-slot.fc-field-card{
    width:92px !important;
    min-height:132px !important;
  }
  .position-slot.fc-field-card .fc-field-mini{
    width:88px !important;
    height:126px !important;
  }
  .position-slot.fc-field-card .fc-field-mini .fc-field-position{
    left:50%;
    top:17px;
    transform:translateX(-50%);
    width:70%;
    text-align:center;
    font-size:.68rem;
  }
  .position-slot.fc-field-card .fc-field-mini .fc-portrait-wrap,
  .position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-portrait-wrap{
    top:27px !important;
    left:9px !important;
    right:9px !important;
    height:47px !important;
  }
  .position-slot.fc-field-card .fc-field-mini .fc-name-banner,
  .position-slot.fc-field-card .fc-field-mini.fc-design-uploaded .fc-name-banner{
    top:72px !important;
    font-size:.43rem !important;
    padding:3px 4px !important;
  }
  .position-slot.fc-field-card .fc-field-mini .fc-field-details{
    bottom:18px;
    width:80%;
    gap:1px;
  }
  .position-slot.fc-field-card .fc-field-mini .fc-field-choice{font-size:.37rem}
  .position-slot.fc-field-card .fc-field-mini .fc-field-minutes{font-size:.34rem}
}


/* v42.4 hard field-only simplification; intentionally last in the stylesheet */
.position-slot.fc-field-card .fc-field-mini .fc-card-header,
.position-slot.fc-field-card .fc-field-mini .fc-rating-block,
.position-slot.fc-field-card .fc-field-mini .fc-ovr,
.position-slot.fc-field-card .fc-field-mini .fc-pos,
.position-slot.fc-field-card .fc-field-mini .fc-pos-alt,
.position-slot.fc-field-card .fc-field-mini .fc-header-side,
.position-slot.fc-field-card .fc-field-mini .fc-club-logo,
.position-slot.fc-field-card .fc-field-mini .fc-stats,
.position-slot.fc-field-card .fc-field-mini .fc-stat,
.position-slot.fc-field-card .field-card-meta{display:none !important}
.position-slot.fc-field-card .fc-field-mini .fc-field-position{
  left:50% !important;
  right:auto !important;
  transform:translateX(-50%) !important;
  width:72% !important;
  text-align:center !important;
}


/* v42.5 field-card spacing refinement */
/* Current field position sits slightly lower; choice/fit and minutes sit slightly higher. */


/* v42.6 clock correction + six interactive quick substitutions */
.game-bar-clock.clock-adjustable,
.clock.clock-adjustable{
  cursor:pointer;
  border-radius:9px;
  padding:2px 7px;
  margin-left:-7px;
  transition:background .12s ease,box-shadow .12s ease;
  user-select:none;
}
.game-bar-clock.clock-adjustable:hover,
.clock.clock-adjustable:hover,
.game-bar-clock.clock-adjustable:focus-visible,
.clock.clock-adjustable:focus-visible{
  background:rgba(10,87,199,.10);
  box-shadow:0 0 0 2px rgba(10,87,199,.18);
  outline:none;
}
.clock-adjust-menu{
  position:fixed;
  z-index:10050;
  width:min(330px,calc(100vw - 16px));
  padding:12px;
  border-radius:12px;
  background:#fff;
  color:#10213a;
  border:1px solid #cdd8e7;
  box-shadow:0 12px 32px rgba(0,0,0,.24);
}
.clock-adjust-menu.hidden{display:none}
.clock-adjust-title{font-size:.82rem;font-weight:900;margin-bottom:8px}
.clock-adjust-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.clock-adjust-buttons button{padding:9px 7px;font-size:.82rem}
.clock-adjust-menu small{display:block;margin-top:8px;color:#68768a;font-size:.68rem;line-height:1.3}

.quick-sub-pair{
  appearance:none;
  text-align:left;
  color:inherit;
  font-family:inherit;
  cursor:pointer;
  transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease,background .12s ease;
}
.quick-sub-pair:hover,
.quick-sub-pair:focus-visible{
  transform:translateY(-2px);
  border-color:#65a3ee;
  box-shadow:0 5px 13px rgba(10,87,199,.14);
  outline:none;
}
.quick-sub-one-hint{
  margin-top:2px;
  font-size:.62rem;
  font-weight:800;
  color:#5e7390;
  opacity:.9;
}
body[data-theme="dark"] .clock-adjust-menu{
  background:#0f2442;
  color:#edf4ff;
  border-color:#34577f;
}
body[data-theme="dark"] .clock-adjust-menu small,
body[data-theme="dark"] .quick-sub-one-hint{color:#a9c4e7}
body[data-theme="dark"] .game-bar-clock.clock-adjustable:hover,
body[data-theme="dark"] .clock.clock-adjustable:hover,
body[data-theme="dark"] .game-bar-clock.clock-adjustable:focus-visible,
body[data-theme="dark"] .clock.clock-adjustable:focus-visible{
  background:rgba(76,145,235,.16);
  box-shadow:0 0 0 2px rgba(76,145,235,.24);
}
body.sideline-mode .quick-sub-one-hint{font-size:.72rem}


/* v42.8 recalculate feedback */
button.recalc-feedback{
  min-width:118px;
  transition:background .15s ease, transform .15s ease;
  transform:translateY(-1px);
}


/* v42.9 roster real-estate cleanup */
.rating-sources-card.compact{
  padding:8px 12px;
  margin-bottom:12px;
}
.rating-sources-head.compact{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.rating-sources-title-row{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  flex-wrap:wrap;
}
.rating-sources-title-row>strong{
  font-size:.92rem;
  white-space:nowrap;
}
.rating-sources-summary{
  color:#68768a;
  font-size:.82rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.rating-sources-toggle{
  padding:6px 9px;
  font-size:.74rem;
  white-space:nowrap;
}
.rating-sources-card.compact .rating-sources-list{
  margin-top:8px;
}
.reports-history-card{
  margin-bottom:0;
}
body[data-theme="dark"] .rating-sources-summary{color:#bdd0e9}
@media(max-width:700px){
  .rating-sources-head.compact{align-items:flex-start}
  .rating-sources-title-row{display:grid;gap:2px}
  .rating-sources-summary{white-space:normal}
}


/* v43.1 editable opponent name */
.opponent-name-input{
  display:block;
  width:100%;
  max-width:170px;
  margin:0 auto 6px;
  padding:2px 6px;
  border:1px solid transparent;
  border-radius:6px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:900;
  text-align:center;
  line-height:1.2;
}
.opponent-name-input:hover:not(:disabled){border-color:rgba(10,87,199,.35);background:rgba(10,87,199,.05)}
.opponent-name-input:focus{outline:2px solid rgba(10,87,199,.35);border-color:#0a57c7;background:rgba(255,255,255,.9)}
body[data-theme="dark"] .opponent-name-input:focus{background:rgba(7,26,55,.9);color:#fff}
.opponent-name-input:disabled{opacity:1;cursor:default}
body.sideline-mode .opponent-name-input{font-size:1.08rem;max-width:190px}


/* v43.2.1: extra field room, keeping the proven v43.2 deployment structure */
.lineup-layout .field{min-height:920px}
body.sideline-mode .lineup-layout .field{min-height:1020px}
@media(max-width:900px){.lineup-layout .field{min-height:840px}body.sideline-mode .lineup-layout .field{min-height:920px}}
@media(max-width:560px){.lineup-layout .field{min-height:760px}body.sideline-mode .lineup-layout .field{min-height:820px}}


/* v43.2.2 sideline cleanup */
body.sideline-mode .sideline-exit-bar{display:none !important;}
body.sideline-mode header .top-actions{width:100%;justify-content:flex-end;gap:10px;align-items:center;}
body.sideline-mode #cloudStatus{order:1;}
body.sideline-mode #undoBtn{display:inline-flex !important;order:2;align-items:center;justify-content:center;min-height:40px;}
body.sideline-mode #sidelineModeBtn{order:3;}
body.sideline-mode .lineup-side-column{display:flex;flex-direction:column;gap:16px;}
#quickSubsSideMount:empty{display:none;}
body.sideline-mode #quickSubsTopMount{display:none;}
body.sideline-mode .quick-subs-card.side-mounted{margin:0;padding:14px;border-left-width:5px;}
body.sideline-mode .quick-subs-card.side-mounted .quick-subs-head{display:flex;flex-direction:column;align-items:stretch;gap:10px;}
body.sideline-mode .quick-subs-card.side-mounted .quick-subs-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
body.sideline-mode .quick-subs-card.side-mounted .quick-subs-list{display:grid;grid-template-columns:1fr;gap:10px;max-height:560px;overflow:auto;}
body.sideline-mode .quick-subs-card.side-mounted .quick-sub-pair{min-width:0;width:100%;}
body.sideline-mode .lineup-layout{align-items:start;}
body.sideline-mode .lineup-layout{grid-template-columns:minmax(0,2.15fr) minmax(320px,.95fr);}
@media(max-width:900px){
  body.sideline-mode .lineup-layout{grid-template-columns:1fr;}
  body.sideline-mode .lineup-side-column{order:-1;}
  body.sideline-mode .quick-subs-card.side-mounted .quick-subs-list{max-height:none;}
}


/* v43.2.3 bench-first manual swapping */
.bench-player.interactive{position:relative;}
.bench-player .bench-swap-label{display:inline-block;margin-top:7px;}
.bench-player.bench-selected{
  border:3px solid #ffc928 !important;
  background:#fff8da !important;
  box-shadow:0 0 0 4px rgba(255,201,40,.22),0 6px 16px rgba(0,0,0,.12);
}
.bench-player.bench-selected .bench-swap-label{background:#ffc928;color:#543f00;}
body[data-theme="dark"] .bench-player.bench-selected{
  background:#27314a !important;
  border-color:#ffc928 !important;
}
body.sideline-mode .bench-player .bench-swap-label{font-size:.75rem;padding:4px 8px;}


/* v43.2.4 automatic phone / tablet / desktop responsive system */
html,body{max-width:100%;}
body[data-layout="tablet"] main,
body[data-layout="phone"] main{max-width:none;width:100%;}

/* TABLET --------------------------------------------------------------- */
body[data-layout="tablet"] header{padding:12px 14px;gap:12px;align-items:flex-start;}
body[data-layout="tablet"] header .brand-wrap{min-width:0;}
body[data-layout="tablet"] header h1{font-size:1.28rem;}
body[data-layout="tablet"] header p{font-size:.82rem;}
body[data-layout="tablet"] header .top-actions{max-width:62%;justify-content:flex-end;}
body[data-layout="tablet"] main{padding:12px;}
body[data-layout="tablet"] .section-heading{align-items:flex-start;flex-wrap:wrap;}
body[data-layout="tablet"] .card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
body[data-layout="tablet"] .roster-fc-card{min-width:0;}
body[data-layout="tablet"] .game-settings{grid-template-columns:repeat(2,minmax(0,1fr));}
body[data-layout="tablet"] .attendance-row{grid-template-columns:minmax(0,1.4fr) minmax(130px,.7fr);}
body[data-layout="tablet"] .game-bar{grid-template-columns:1fr 1fr;gap:10px;}
body[data-layout="tablet"] .game-bar .score-section{grid-column:1/-1;}
body[data-layout="tablet"] .game-bar-section{min-width:0;}
body[data-layout="tablet"] .lineup-layout{grid-template-columns:1fr;gap:14px;}
body[data-layout="tablet"] .lineup-layout>div{min-width:0;}
body[data-layout="tablet"] .lineup-side-column{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start;}
body[data-layout="tablet"] .bench{grid-template-columns:repeat(2,minmax(0,1fr));}
body[data-layout="tablet"] .quick-subs-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
body[data-layout="tablet"] .quick-sub-pair{min-width:0;width:100%;}
body[data-layout="tablet"] .sub-plan{grid-template-columns:1fr 1fr;}
body[data-layout="tablet"] .clock-card{gap:12px;flex-wrap:wrap;}
body[data-layout="tablet"] input,
body[data-layout="tablet"] select,
body[data-layout="tablet"] button{min-height:42px;}

/* In sideline mode, keep the coaching rail below the full-width field on tablets. */
body[data-layout="tablet"].sideline-mode .lineup-layout{grid-template-columns:1fr !important;}
body[data-layout="tablet"].sideline-mode .lineup-side-column{display:grid;grid-template-columns:1fr 1fr;gap:14px;order:0;}
body[data-layout="tablet"].sideline-mode .quick-subs-card.side-mounted .quick-subs-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none;}

/* PHONE ---------------------------------------------------------------- */
body[data-layout="phone"]{overflow-x:hidden;}
body[data-layout="phone"] header{padding:9px 10px;gap:9px;align-items:flex-start;flex-direction:column;}
body[data-layout="phone"] header .brand-wrap{width:100%;min-width:0;}
body[data-layout="phone"] header .app-logo{width:42px;height:42px;}
body[data-layout="phone"] header h1{font-size:1.05rem;line-height:1.1;}
body[data-layout="phone"] header p{font-size:.72rem;line-height:1.25;}
body[data-layout="phone"] header .top-actions{width:100%;max-width:none;display:flex;justify-content:flex-start;gap:7px;overflow-x:auto;flex-wrap:nowrap;padding-bottom:2px;-webkit-overflow-scrolling:touch;}
body[data-layout="phone"] header .top-actions>*{flex:0 0 auto;}
body[data-layout="phone"] .tabs{padding:7px 8px;gap:5px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;}
body[data-layout="phone"] .tab{flex:0 0 auto;min-height:42px;scroll-snap-align:start;}
body[data-layout="phone"] main{padding:7px;overflow:hidden;}
body[data-layout="phone"] .section-heading{display:grid;grid-template-columns:1fr;gap:8px;align-items:start;margin-bottom:10px;}
body[data-layout="phone"] .section-heading h2{font-size:1.25rem;margin:0;}
body[data-layout="phone"] .roster-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:7px;}
body[data-layout="phone"] .roster-actions button{width:100%;}
body[data-layout="phone"] .card-grid{grid-template-columns:1fr;gap:10px;}
body[data-layout="phone"] #rosterGrid .roster-fc-card{min-width:0;width:100%;}
body[data-layout="phone"] .game-settings{grid-template-columns:1fr;gap:8px;padding:10px;}
body[data-layout="phone"] .attendance-row,
body[data-layout="phone"] .attendance-row.simple{grid-template-columns:1fr;gap:7px;}
body[data-layout="phone"] .attendance-toolbar{display:grid;grid-template-columns:1fr;gap:8px;}
body[data-layout="phone"] .attendance-toolbar-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;}
body[data-layout="phone"] .game-bar{grid-template-columns:1fr;padding:9px;gap:8px;}
body[data-layout="phone"] .game-bar-section{min-width:0;justify-content:space-between;gap:8px;}
body[data-layout="phone"] .clock-section{display:grid;grid-template-columns:auto 1fr;}
body[data-layout="phone"] .clock-section .game-bar-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;}
body[data-layout="phone"] .game-bar-clock{font-size:2rem;min-width:0;text-align:right;}
body[data-layout="phone"] .half-section{flex-direction:row;align-items:center;}
body[data-layout="phone"] .score-section{display:grid;grid-template-columns:1fr auto 1fr;gap:5px;align-items:center;}
body[data-layout="phone"] .team-score{min-width:0;}
body[data-layout="phone"] .team-name{font-size:.86rem;}
body[data-layout="phone"] .score-controls{gap:5px;}
body[data-layout="phone"] .score-btn{width:42px;height:42px;}
body[data-layout="phone"] .score-number{font-size:1.65rem;}
body[data-layout="phone"] .lineup-controls{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:7px;}
body[data-layout="phone"] .lineup-controls label{grid-column:1/-1;min-width:0;}
body[data-layout="phone"] .lineup-controls button{width:100%;}
body[data-layout="phone"] .playtime-legend{display:flex;overflow-x:auto;white-space:nowrap;gap:10px;padding-bottom:3px;-webkit-overflow-scrolling:touch;}
body[data-layout="phone"] .quick-subs-head{display:grid;grid-template-columns:1fr;gap:8px;align-items:start;}
body[data-layout="phone"] .quick-subs-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:7px;}
body[data-layout="phone"] .quick-subs-list{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:8px;padding-bottom:5px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;}
body[data-layout="phone"] .quick-sub-pair{flex:0 0 min(82vw,290px);min-width:0;scroll-snap-align:start;}
body[data-layout="phone"] .lineup-layout{display:block;min-width:0;}
body[data-layout="phone"] .lineup-layout>div:first-child{width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;padding-bottom:4px;}
body[data-layout="phone"] .lineup-layout .field{min-width:660px;min-height:780px !important;}
body[data-layout="phone"][data-orientation="landscape"] .lineup-layout .field{min-width:760px;min-height:720px !important;}
body[data-layout="phone"] .lineup-side-column{display:grid;grid-template-columns:1fr;gap:10px;margin-top:10px;}
body[data-layout="phone"] .bench{grid-template-columns:1fr;gap:7px;}
body[data-layout="phone"] .bench-player{min-width:0;}
body[data-layout="phone"] .sub-plan{grid-template-columns:1fr;}
body[data-layout="phone"] .clock-card{display:grid;grid-template-columns:1fr;gap:10px;align-items:start;}
body[data-layout="phone"] .clock-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;}
body[data-layout="phone"] .minutes-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;}
body[data-layout="phone"] input,
body[data-layout="phone"] select,
body[data-layout="phone"] textarea{font-size:16px !important;min-height:44px;}
body[data-layout="phone"] button{min-height:44px;}

/* Sideline phone mode: field first, then compact subs and bench. */
body[data-layout="phone"].sideline-mode main{padding:5px;overflow:hidden;}
body[data-layout="phone"].sideline-mode .game-bar{grid-template-columns:1fr !important;padding:9px;}
body[data-layout="phone"].sideline-mode .lineup-layout{display:block !important;}
body[data-layout="phone"].sideline-mode .lineup-side-column{display:grid;grid-template-columns:1fr;gap:10px;order:0;}
body[data-layout="phone"].sideline-mode .quick-subs-card.side-mounted .quick-subs-list{display:flex;grid-template-columns:none;overflow-x:auto;max-height:none;}
body[data-layout="phone"].sideline-mode .quick-subs-card.side-mounted .quick-sub-pair{flex:0 0 min(82vw,290px);}
body[data-layout="phone"].sideline-mode .lineup-layout .field{min-height:820px !important;}
body[data-layout="phone"][data-orientation="landscape"].sideline-mode .lineup-layout .field{min-height:760px !important;}

/* Keep desktop unchanged; make tablet/phone transitions smooth without page cropping. */
body[data-layout="tablet"] *,body[data-layout="phone"] *{min-width:0;}
body[data-layout="tablet"] img,body[data-layout="phone"] img{max-width:100%;}
