/* Match Player Review signature palette, stadium asset and component surfaces. */
@font-face{font-family:'Chakra Petch';src:url('/assets/fonts/chakra-600.ttf');font-weight:600;font-display:swap}
:root{--bg:#06130c;--surface:#0f2819;--surface-2:#163522;--line:rgba(226,241,229,.14);--text:#f4f7ed;--muted:#9cb6a4;--green:#8cdb68;--lime:#a6ef72;--gold:#f2c14e;--danger:#ff776d;--shadow:0 18px 44px #00000038;--site-shell:900px;--stadium-gold:#f1c84d;--stadium-gold-soft:rgba(241,200,77,.36)}
body{color:var(--text);font-family:Anuphan,sans-serif;font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased;background-color:#020a06;background-image:linear-gradient(180deg,rgba(2,10,6,.06),rgba(2,10,6,.2) 72%,#020a06 100%),url('/players/assets/brand/player-review-stadium-mobile-borderless-v2.jpg');background-position:top center;background-repeat:no-repeat;background-size:100% auto;background-attachment:scroll}
h1,h2,h3,h4,button,.heading-font,.slot-name,.count,.eyebrow{font-family:'Chakra Petch',Anuphan,sans-serif}
#app{max-width:var(--site-shell);width:calc(100% - 36px);padding:0 0 40px;margin:24px auto}
#sharedHeader,#sharedFooter{--text:#f4f7ed;--muted:#9cb6a4;--green:#8cdb68;--gold:#f2c14e;--line:rgba(226,241,229,.14);--site-shell:900px}
#sharedHeader .shell,#sharedFooter .shell{width:min(var(--site-shell),calc(100% - 36px))}
.titlebar .eyebrow{color:var(--green)}.titlebar h1{font-size:clamp(26px,3vw,32px);line-height:1.2}.team-toolbar{border-color:var(--line)}
.team-toolbar button,.team-row-actions button,.sheet-buttons>button:not(.primary){background:rgba(2,12,7,.45);border-color:rgba(140,219,104,.3);border-radius:10px}
button.primary,.squad-status button.primary{background:linear-gradient(145deg,#a6ef72,#78cf4f);border:1px solid rgba(140,219,104,.42);color:#07140d;box-shadow:0 4px 14px rgba(140,219,104,.12)}
.team-toolbar .import-button{color:var(--stadium-gold);border-color:var(--stadium-gold-soft);background:rgba(241,200,77,.045)}
.squad-board{border:1px solid rgba(241,200,77,.46);border-radius:14px;background:linear-gradient(145deg,rgba(3,20,11,.9),rgba(1,12,7,.94));box-shadow:inset 0 1px 0 #ffffff06,0 18px 42px #00000047}
.sidepanel .squad-status{background:linear-gradient(145deg,rgba(3,20,11,.9),rgba(1,12,7,.94));border-radius:14px;box-shadow:inset 0 1px 0 #ffffff06}.bench{border-color:var(--line)}
#sheet{background:linear-gradient(145deg,#0b2115,#05150b);border:1px solid var(--stadium-gold-soft);border-radius:20px;box-shadow:0 24px 80px #0009;color:var(--text)}.sheet-top{background:#0b2115}.sheet-top .eyebrow{color:var(--green)}
#sheet input:not([type=checkbox]),#sheet select,#sheet textarea,.squad-board .formationbar #formation,#picker-playstyle .ps-filter-trigger{background:#06170d;border-color:rgba(140,219,104,.3);border-radius:10px;color:var(--text);font-family:Anuphan,sans-serif}
#sheet input:focus-visible,#sheet select:focus-visible,#sheet textarea:focus-visible{border-color:var(--green);box-shadow:0 0 0 3px rgba(140,219,104,.1);outline:0}
.player-result{border:1px solid var(--line);border-radius:10px;background:rgba(0,0,0,.16)}.player-result:hover:not(:disabled){border-color:var(--gold);background:rgba(242,193,78,.07);box-shadow:0 0 0 2px rgba(242,193,78,.08)}.player-result strong{font-family:'Chakra Petch',Anuphan,sans-serif}.player-result .ovr{color:var(--gold);font-family:'Chakra Petch',Anuphan,sans-serif}
.team-manager-row,.bench-card{border-color:var(--line);border-radius:12px;background:rgba(0,0,0,.16)}.team-row-actions .danger{color:#ffac9e;border-color:#ffac9e33}.team-row-actions [data-team]{color:var(--green);background:rgba(140,219,104,.07);border-color:rgba(140,219,104,.38)}
#picker-filters{background:rgba(0,0,0,.12);border-color:var(--line)}#picker-filter-toggle{font-family:Anuphan,sans-serif}.mobile-tactic-dock{background:#06130cf5;border-color:var(--stadium-gold-soft)}
@media(max-width:720px){#app{width:calc(100% - 24px);padding:0 0 24px;margin-top:20px}#sharedHeader .shell,#sharedFooter .shell{width:calc(100% - 24px)}#sheet{border-radius:20px 20px 0 0}.titlebar h1{font-size:26px}}

.auth-gate{max-width:620px;margin:48px auto 72px;padding:40px 28px;text-align:center;background:linear-gradient(145deg,#123321,#081d13);border:1px solid #355b3d;border-radius:24px;box-shadow:0 18px 50px #0003}
.auth-gate h1{font-size:clamp(24px,5vw,34px);line-height:1.4;margin:14px 0}.auth-gate p:not(.eyebrow){color:#b4c6b7;line-height:1.7}.auth-gate .primary{margin:20px auto 12px;min-height:48px;width:min(100%,320px)}.auth-gate small{display:block;color:#9fb3a4;line-height:1.6}.header-account{display:flex;align-items:center;gap:8px}.header-account button{font-size:14px;padding:10px 16px;min-height:42px}.header-account [hidden]{display:none!important}

.auth-gate .google-sign-in{display:flex;align-items:center;justify-content:center;gap:12px;margin:24px auto 16px;width:min(100%,340px);min-height:52px;padding:12px 20px;border:1px solid #dadce0;border-radius:14px;background:#fff;color:#202124;box-shadow:0 3px 12px #0002;font-size:16px;font-weight:600}.auth-gate .google-sign-in img{width:22px;height:22px;flex:none}.auth-gate .google-sign-in:hover{background:#f2f5fa;border-color:#b7c2d2}.auth-gate .google-sign-in:focus-visible{outline:3px solid #8cdb68;outline-offset:4px}

#sharedHeader .product-nav .tab-line:empty{display:none}#sharedHeader .product-nav>a{position:relative}#sharedHeader .product-nav>a.active:after{content:"";position:absolute;bottom:0;left:calc(50% - 14px);width:28px;height:3px;background:#f1c84d;border-radius:3px}

/* Tactile AI action, progress indicator, and suggested-card entrance. */
#ai{transition:transform .14s ease,box-shadow .2s ease}#ai:active{transform:scale(.975);box-shadow:0 0 22px #8cdb6840}
#run-ai.ai-working{display:flex;align-items:center;justify-content:center;gap:10px;opacity:1;cursor:progress}#run-ai.ai-working:before{content:"";width:18px;height:18px;border:2px solid #10241540;border-top-color:#102415;border-radius:50%;animation:ai-spin .7s linear infinite}
.slot.proposed{animation:ai-card-enter .4s cubic-bezier(.2,.8,.2,1) both}.pitch-row:nth-of-type(2) .slot.proposed{animation-delay:.06s}.pitch-row:nth-of-type(3) .slot.proposed{animation-delay:.12s}.pitch-row:nth-of-type(4) .slot.proposed{animation-delay:.18s}.pitch-row:nth-of-type(5) .slot.proposed{animation-delay:.24s}.pitch-row:nth-of-type(6) .slot.proposed{animation-delay:.3s}
@keyframes ai-spin{to{transform:rotate(360deg)}}@keyframes ai-card-enter{from{opacity:0;transform:translateY(14px) scale(.94)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(prefers-reduced-motion:reduce){#ai{transition:none}#ai:active{transform:none}.slot.proposed,#run-ai.ai-working:before{animation:none}}

/* Keep authentication centered, independent of mobile squad bottom-sheet rules. */
dialog.team-login-dialog{position:fixed;inset:0;margin:auto;height:fit-content;max-height:calc(100dvh - 32px);transform:none}

#new-top,#new-team{transition:transform .15s ease,box-shadow .15s ease}#new-top:active,#new-team:active{transform:scale(.96);box-shadow:0 0 18px #8cdb6833}
#app.team-created .titlebar{animation:new-team-enter .3s ease-out both}#app.team-created .squad-board{animation:new-team-enter .42s cubic-bezier(.2,.8,.2,1) both}#app.team-created .empty-art{animation:new-team-slot .45s ease-out both;animation-delay:.1s}
@keyframes new-team-enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}@keyframes new-team-slot{from{opacity:.2;transform:scale(.88)}to{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){#new-top,#new-team{transition:none}#new-top:active,#new-team:active{transform:none}#app.team-created .titlebar,#app.team-created .squad-board,#app.team-created .empty-art{animation:none}}

/* Make the team switcher visibly actionable like the formation selector. */
.titlebar .team-title{width:100%;border:1px solid #557d3b;border-radius:14px;background:linear-gradient(135deg,#10291a,#06160c);padding:12px 16px;justify-content:space-between;gap:16px;margin:8px 0 10px;box-shadow:inset 0 1px 0 #ffffff08}
.titlebar .team-title h1{margin:0;font-size:clamp(22px,2.5vw,28px);line-height:1.3}
.titlebar .team-title .chevron{flex:0 0 28px;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#a2db6f12;color:#a5de78;font-size:20px}
.titlebar .team-title:hover:not(:disabled){background:#15331f;border-color:#a4dc71}
.titlebar .team-title:focus-visible{outline:2px solid #e8ce79;outline-offset:3px}

.titlebar .team-title .chevron{line-height:1;padding:0;align-self:center}
.titlebar .team-title .chevron svg{display:block;width:18px;height:18px}

/* Team manager: a quiet angled pitch behind the existing compact controls. */
#sheet:has(#new-team){isolation:isolate;background:radial-gradient(ellipse at 100% 0,rgba(157,137,49,.16),transparent 60%),linear-gradient(145deg,#0c2819,#05140b)}
#sheet:has(#new-team)::before{content:"";position:absolute;right:-40px;top:-65px;width:330px;height:440px;background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22360%22%20height%3D%22480%22%20viewBox%3D%220%200%20360%20480%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23a8d577%22%20stroke-width%3D%222%22%3E%3Crect%20x%3D%2225%22%20y%3D%2225%22%20width%3D%22310%22%20height%3D%22430%22%20rx%3D%228%22/%3E%3Cpath%20d%3D%22M25%20240h310M105%2025v75h150V25M105%20455v-75h150v75M145%2025v28h70V25M145%20455v-28h70v28%22/%3E%3Ccircle%20cx%3D%22180%22%20cy%3D%22240%22%20r%3D%2257%22/%3E%3Ccircle%20cx%3D%22180%22%20cy%3D%22240%22%20r%3D%224%22%20fill%3D%22%23a8d577%22/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;transform:rotate(-22deg);opacity:.13;pointer-events:none;z-index:-1}
#sheet:has(#new-team) .sheet-top{background:transparent}
#sheet:has(#new-team) .team-row{background:rgba(3,17,9,.8)}

/* Compact team workspace. */
#app{margin-top:12px}.titlebar{position:relative;isolation:isolate}.titlebar>div{width:100%}.titlebar:before{content:"";position:absolute;inset:-12px 0 -60px auto;width:190px;background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20100%20100%22%20fill%3D%22none%22%20stroke%3D%22%2396cb76%22%20stroke-width%3D%223%22%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2224%22%20r%3D%2210%22/%3E%3Ccircle%20cx%3D%2220%22%20cy%3D%2234%22%20r%3D%228%22/%3E%3Ccircle%20cx%3D%2280%22%20cy%3D%2234%22%20r%3D%228%22/%3E%3Cpath%20d%3D%22M32%2075V57a18%2018%200%200%201%2036%200v18M6%2076V60a14%2014%200%200%201%2022-12m44%200a14%2014%200%200%201%2022%2012v16M42%2060v23m16-23v23%22/%3E%3C/svg%3E") center/contain no-repeat;opacity:.1;transform:rotate(-16deg);z-index:-1;pointer-events:none}
.titlebar .team-title{padding:9px 12px;margin:5px 0 6px}.team-toolbar{margin-top:10px;padding-bottom:10px}.workspace{margin-top:12px}.squad-board{padding:14px}.squad-board .formation-control>label{font-weight:700;color:var(--text);font-size:13px}.squad-board .formationbar{padding-bottom:10px;gap:6px}.squad-board .formationbar #formation{appearance:none;-webkit-appearance:none;min-height:44px;padding:9px 40px 9px 12px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5de78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:18px 18px;background-position:right 14px center}
.squad-board .pitch:not(.mini-pitch){padding:8px 2px}.squad-board .pitch:not(.mini-pitch) .pitch-row{height:92px}.bench{position:relative;isolation:isolate;padding:14px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(135deg,#102419e8,#06130cf5);overflow:hidden}.bench:before{content:"";position:absolute;inset:0;background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20480%20220%22%20fill%3D%22none%22%20stroke%3D%22%239fbc8a%22%20stroke-width%3D%222%22%3E%3Cpath%20d%3D%22M20%20180V30h440v150M108%2030v125M196%2030v125M284%2030v125M372%2030v125M10%20164h460v18H10zM40%20182v28m400-28v28%22/%3E%3Cpath%20d%3D%22m44%2064%2018-10%2018%2010-7%2017-7-3v47H44V78l-7%203-7-17m102%200%2018-10%2018%2010-7%2017-7-3v47h-22V78l-7%203-7-17m102%200%2018-10%2018%2010-7%2017-7-3v47h-22V78l-7%203-7-17m102%200%2018-10%2018%2010-7%2017-7-3v47h-22V78l-7%203-7-17%22/%3E%3C/svg%3E") right bottom/auto 190px no-repeat;opacity:.1;z-index:-1;pointer-events:none}.bench .bench-filters{gap:6px;margin:10px 0}.bench .bench-filters button{min-height:30px;height:30px;padding:3px 10px;border-radius:999px;line-height:1.2;font-size:11px}.bench-help,.bench-empty{margin:8px 0}.bench-head h3{margin-bottom:0}
@media(max-width:720px){#app{margin-top:10px}.team-toolbar{margin-top:10px;padding-bottom:10px}.squad-board .pitch:not(.mini-pitch) .pitch-row{height:88px}.squad-board{padding:12px}.titlebar .team-title h1{font-size:23px}}

/* Clear pitch guidance, compact actions and a quiet anonymous-card backdrop. */
.titlebar:before{transform:none}
.squad-board .pitch-instructions{font-size:clamp(13px,1.5vw,16px);font-weight:700;color:#fff;text-align:center;line-height:1.5;margin:0 0 12px}
.squad-board .pitch-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:10px}
.pitch-foot .pitch-ai{min-height:34px;padding:6px 10px;border-radius:999px;border:1px solid #8cdb6855;background:#8cdb6812;color:#a6ef72;font-size:12px;line-height:1.3}
.pitch-foot #undo{flex:none;font-size:12px;padding:6px;min-height:34px}
#sheet #picker-filter-toggle{border-radius:999px;min-height:32px;padding:5px 12px;background:#8cdb6812;border-color:#8cdb6866;color:#a6ef72;line-height:1.2;font-size:12px;gap:6px}
#picker-filter-toggle .team-action-icon{width:16px;height:16px}
.player-result .pick-add{display:inline-flex;align-items:center;justify-content:center;border:1px solid #8cdb6866;border-radius:999px;background:#8cdb6812;color:#a6ef72;padding:6px 9px;font-size:11px;white-space:nowrap;line-height:1.3}
.sidepanel .bench{padding:16px!important;width:100%;box-sizing:border-box}.bench .bench-head{gap:10px}.bench .bench-head h3{font-size:18px}.bench .bench-help{font-size:12px;margin:8px 0}.bench .bench-empty{font-size:12px;line-height:1.6;margin:12px 0 0}.bench:before{background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%20300%20240%22%20fill%3D%22none%22%20stroke%3D%22%23a1c28a%22%20stroke-width%3D%223%22%3E%3Cg%20transform%3D%22translate%28155%2010%29%22%3E%3Cpath%20d%3D%22M0%200h100v150l-50%2024-50-24z%22/%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2252%22%20r%3D%2221%22/%3E%3Cpath%20d%3D%22M18%20122v-9a32%2032%200%200%201%2064%200v9%22/%3E%3C/g%3E%3Cg%20transform%3D%22translate%2825%2068%29%22%3E%3Cpath%20d%3D%22M0%200h100v150l-50%2024-50-24z%22/%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2252%22%20r%3D%2221%22/%3E%3Cpath%20d%3D%22M18%20122v-9a32%2032%200%200%201%2064%200v9%22/%3E%3C/g%3E%3C/svg%3E");background-size:auto 210px;background-position:right center;opacity:.065}.bench .bench-filters{gap:6px}.bench .bench-filters button{flex:none;white-space:nowrap}
@media(max-width:420px){.player-result .pick-add{font-size:10px;padding:6px}.pitch-foot .pitch-ai{font-size:11px;padding:6px 8px}}

.squad-column{min-width:0}.squad-column>.pitch-instructions{font-size:clamp(13px,1.5vw,16px);font-weight:700;color:#fff;text-align:center;line-height:1.5;margin:0 0 10px}

.team-mobile-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.team-roster-jump{display:none}#team-roster{scroll-margin-top:16px}
@media(max-width:720px){.team-mobile-heading .eyebrow,.team-mobile-heading .team-roster-jump{font-size:14px;font-weight:600;line-height:1.5}.team-mobile-heading .eyebrow{margin:0}.team-mobile-heading .team-roster-jump{display:inline-flex;align-items:center;min-height:32px;color:#fff;text-decoration:none;letter-spacing:0}.team-roster-jump:focus-visible{outline:2px solid var(--gold);outline-offset:3px;border-radius:4px}}

/* Center the short AI setup dialog, including on phones. */
#sheet:has(#ai-budget){position:fixed;inset:0;margin:auto;width:min(520px,calc(100% - 28px));height:fit-content;max-height:calc(100dvh - 32px);border-radius:20px;transform:none;background:radial-gradient(ellipse at top right,#8cdb681b,transparent 65%),linear-gradient(145deg,#102a1a,#05140b);box-shadow:0 20px 70px #0009;overflow:auto}
#sheet:has(#ai-budget) .sheet-top{background:transparent}#sheet:has(#ai-budget) .sheet-copy{margin:4px 0 16px;font-size:14px;line-height:1.65}#sheet:has(#ai-budget) .field-label{font-weight:600;color:#dce9d7}
#sheet #ai-budget{appearance:none;-webkit-appearance:none;padding:10px 42px 10px 14px;min-height:44px;border-radius:12px;background-color:#06170d;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a5de78' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:18px 18px;background-position:right 14px center}
#sheet:has(#ai-budget) .sheet-buttons{margin-top:16px}#sheet:has(#ai-budget) #run-ai{min-height:44px;border-radius:12px}

.slot.proposed:after{display:none}.slot.ai-unseen .card{opacity:.5}
#sheet:has(.team-local-profile){position:fixed;inset:0;margin:auto;width:min(640px,calc(100% - 24px));height:fit-content;max-height:calc(100dvh - 24px);border-radius:20px;transform:none;overflow:auto}.team-pr-profile{display:block;width:100%;height:370px;border:0;border-radius:12px;background:#06130c}#sheet:has(.team-local-profile) .sheet-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}#sheet:has(.team-local-profile) .sheet-buttons a,#sheet:has(.team-local-profile) #remove{grid-column:1/-1}

.sidepanel>.roster-tactic{display:block!important;width:100%;margin:0 0 12px;padding:10px 14px;min-height:44px;border-radius:12px;font-size:15px;line-height:1.45}.sidepanel .squad-status{padding:16px;margin-top:12px}.sidepanel .squad-status .status-heading h3{font-size:20px;line-height:1.4;margin:0}.sidepanel .squad-status p{font-size:14px;line-height:1.6;margin:8px 0}.sidepanel .squad-status #analyze{font-size:14px;color:#a6ef72;min-height:38px;padding:6px 0;text-align:left}.help-details{font-size:14px}.footer-note{font-size:13px;line-height:1.6}.mobile-tactic-dock{display:none!important}

.sidepanel{display:flex;flex-direction:column}.sidepanel>.roster-tactic{order:0}.sidepanel>.bench{order:1}.sidepanel>.squad-status{order:2}.sidepanel>.help-details{order:3}

.team-local-profile{border:1px solid #b5a34d70;border-radius:16px;padding:16px;background:radial-gradient(ellipse at 50% 0,#65703b42,transparent 68%),linear-gradient(145deg,#132b1b,#06140c);text-align:center}.team-profile-art{position:relative;width:170px;margin:0 auto 10px}.team-profile-art>.card{display:block;width:170px;height:180px;object-fit:contain}.team-local-profile h2{font-size:23px;line-height:1.3;margin:8px 0 14px}.team-profile-meta{display:grid;grid-template-columns:2fr 1fr;gap:10px}.team-profile-meta small{display:block;color:var(--muted);font-size:12px}.team-profile-meta strong{display:block;font-size:15px}.team-profile-meta .gold{font-size:22px}.team-profile-positions{grid-column:1/-1}#sheet:has(.team-local-profile) .sheet-buttons>button,#sheet:has(.team-local-profile) .sheet-buttons>a{display:flex;align-items:center;justify-content:center;gap:8px;font-size:14px;line-height:1.4;text-decoration:none}#sheet:has(.team-local-profile) .team-action-icon{width:20px;height:20px;flex:none}

/* The pitch wrapper must fill the single-column workspace too. */
.workspace>.squad-column{width:100%;min-width:0;box-sizing:border-box}.squad-column>.squad-board{width:100%;box-sizing:border-box}
@media(max-width:900px){.workspace{display:flex;flex-direction:column;align-items:stretch;gap:14px}.workspace>.squad-column,.workspace>.sidepanel{width:100%;max-width:none;flex:none}.workspace>.sidepanel{display:flex;flex-direction:column;gap:12px}.squad-board .pitch-row>.slot-wrap{min-width:0;max-width:20%;flex-shrink:1}.squad-board .slot{max-width:100%}.squad-board .slot .card{max-width:100%;object-fit:contain}}

/* Player actions stay within the PR-style profile frame. */
#sheet:has(.team-local-profile){width:min(490px,calc(100% - 24px));padding:0;border:0;background:transparent;border-radius:24px}
#sheet:has(.team-local-profile) .sheet-top{display:none}
#sheet:has(.team-local-profile) #sheet-body{padding:0}
.team-local-profile{position:relative;padding:24px 18px 18px;border:3px solid #f5f3df;border-radius:24px;box-shadow:inset 0 0 0 2px #bca257;background:linear-gradient(180deg,#07130d25 20%,#07130d55 55%,#04110bf2 100%),var(--team-profile-bg) center/cover;text-align:center}
.team-profile-close{position:absolute;right:16px;top:16px;z-index:3;width:44px;height:44px;padding:10px;display:grid;place-items:center;border:1px solid #ffffff66;border-radius:50%;background:#ffffff20;color:white}
.team-profile-close svg{width:24px;height:24px;display:block}
.team-profile-art{width:clamp(170px,55vw,260px);margin:12px auto 20px}
.team-profile-art>.card{width:100%;height:clamp(190px,60vw,280px);object-fit:contain}
.team-local-profile h2{font-size:clamp(22px,5.5vw,30px);margin:12px 0 24px;color:white}
.team-profile-meta{grid-template-columns:2fr 1fr;gap:14px;margin-bottom:18px}
.team-profile-meta small{font-size:15px;color:#c2d1c7}.team-profile-meta strong{font-size:16px;color:white}.team-profile-meta .gold{font-size:26px;color:white}
#sheet:has(.team-local-profile) .sheet-buttons{margin:0;gap:10px}
#sheet:has(.team-local-profile) .sheet-buttons>a,#sheet:has(.team-local-profile) .sheet-buttons>button{grid-column:auto;min-width:0;min-height:52px;padding:10px 6px;border:1px solid #ffffffa0;border-radius:14px;background:linear-gradient(#ffffff18,#00150dbb);color:#fff;font-size:14px}
#sheet:has(.team-local-profile) .sheet-buttons .danger{color:#ffb5a4}
@media(max-height:700px){.team-profile-art>.card{height:190px}.team-profile-art{margin:0 auto 8px}.team-local-profile h2{margin:8px 0 14px}.team-profile-meta{gap:8px}}

#sheet:has(#share-code){position:fixed;inset:0;margin:auto;width:min(540px,calc(100% - 28px));height:fit-content;max-height:calc(100dvh - 28px);box-sizing:border-box;overflow:auto;transform:none;border-radius:24px;background:radial-gradient(ellipse at 0 0,rgba(171,236,91,.20),transparent 58%),linear-gradient(145deg,#102d1d,#04120b 80%)}
#sheet:has(#share-code) .sheet-top{background:transparent}
#copy-code{display:flex;align-items:center;justify-content:center;gap:8px}
#copy-code .team-action-icon{width:20px;height:20px;flex:none}

/* Match PR contrast while keeping player details and controls compact. */
.team-local-profile{padding:16px 14px 14px;background:linear-gradient(180deg,rgba(0,0,0,.57),rgba(12,8,21,.82) 72%,rgba(2,17,9,.96)),radial-gradient(ellipse at 50% 28%,#b26cff21,transparent 72%),var(--team-profile-bg) center 48%/cover no-repeat}
.team-profile-art{width:clamp(155px,45vw,210px);margin:4px auto 8px}.team-profile-art>.card{height:clamp(170px,48vw,225px)}
.team-local-profile h2{margin:8px 0 16px;font-size:clamp(22px,5vw,27px)}
.team-profile-meta{grid-template-columns:1fr 1fr;gap:12px 8px;margin-bottom:14px}.team-profile-positions{grid-column:auto}.team-profile-meta small{font-size:14px}.team-profile-meta strong{font-size:15px}.team-profile-meta .gold{font-size:23px}
.team-profile-shards strong{display:flex;align-items:center;justify-content:center;gap:5px}.team-profile-shards img{width:20px;height:20px}
#sheet:has(.team-local-profile) .sheet-buttons>button,#sheet:has(.team-local-profile) .sheet-buttons>a{min-height:46px;padding:8px 5px}

.team-local-profile img.team-action-icon{filter:grayscale(1) brightness(0) invert(1)}
.bench-title-count{display:flex;align-items:baseline;gap:8px;min-width:0}.bench-title-count h3{margin:0}.bench-title-count small{white-space:nowrap}
#arrange-owned{border:1px solid #8cdb6899;border-radius:999px;padding:3px 9px;min-height:26px;height:26px;line-height:18px;color:#e9f3e3;background:rgba(140,219,104,.08);font-size:11px;font-weight:600;white-space:nowrap;flex:none}
#arrange-owned:hover:not(:disabled){background:rgba(140,219,104,.15);box-shadow:0 0 12px #8cdb6822}
.bench-head{gap:10px;align-items:center}

.help-details{font-size:16px;line-height:1.7}.help-details summary{font-size:17px;font-weight:600}.help-details li{margin:10px 0}.footer-note{font-size:14px;line-height:1.75;margin:18px 0 0;padding:16px 0 0}
body{padding-bottom:0!important;display:flex;flex-direction:column;min-height:100dvh}#app{padding-bottom:0;margin-bottom:0;flex:none}#sharedFooter{margin-top:auto;padding:0 14px max(16px,env(safe-area-inset-bottom))}#sharedFooter .news-invitation{width:100%;max-width:900px;margin:20px auto 16px}#sharedFooter .sitefooter{margin:0 auto;padding-top:18px;padding-bottom:0;min-height:0}

.help-details ul,.help-details li{font-size:16px;line-height:1.75}

/* Keep the stadium header separate from the length of the team page. */
body{background-color:#000;background-image:linear-gradient(180deg,rgba(2,10,6,.06),rgba(2,10,6,.2) 72%,#000 100%),url('/players/assets/brand/player-review-stadium-mobile-borderless-v2.jpg');background-size:100% 177.6833vw,100% auto;background-position:top center;background-repeat:no-repeat}
#sharedHeader .header-card .product-nav{margin-top:4px}

.help-details .team-storage-hint{font-size:12px;line-height:1.6;color:var(--muted);margin:8px 0 0}

.team-mobile-heading .team-roster-jump{text-decoration:underline;text-underline-offset:4px;text-decoration-thickness:1px}

@media(max-width:720px){#app{margin-top:0;padding-top:0}.team-mobile-heading{margin-top:0}.team-mobile-heading .team-roster-jump{min-height:26px}}

@media(max-width:720px){.team-mobile-heading{padding-inline:12px}}
/* Center team dialogs within the usable mobile viewport. */
#sheet{position:fixed;inset:0;margin:auto;width:min(640px,calc(100% - 24px));height:fit-content;max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;border-radius:22px;transform:none}
.pitch-foot{display:flex;align-items:center;gap:12px}
.pitch-foot .pitch-ai{flex:1;min-width:0;justify-content:center;text-align:center;min-height:40px;padding:8px 12px;border-color:#8cdb6899;color:#e9f3e3;background:rgba(140,219,104,.08);font-size:13px;font-weight:600}
.pitch-foot .pitch-ai:hover:not(:disabled){background:rgba(140,219,104,.15);box-shadow:0 0 12px #8cdb6822}
.pitch-foot #undo{flex:0 0 auto}

/* One scroll container per modal, with a stable non-overlapping header. */
html.team-modal-open{overflow:hidden;overscroll-behavior:none}
#sheet[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(100dvh - 32px);padding:16px}
#sheet .sheet-top{position:static;flex:0 0 auto;margin:0 0 12px;padding:0;z-index:1;align-items:center}
#sheet #sheet-body{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#sheet:has(.team-local-profile)[open]{padding:0}
#sheet:has(.team-local-profile) .sheet-top{display:none}
#sheet .team-menu-tools{gap:8px;margin-bottom:10px}
#sheet .team-menu-tools button{min-height:36px;padding:7px 10px;font-size:13px}
#sheet .team-manager-list{display:grid;gap:10px}
#sheet .team-manager-row{padding:12px;margin:0}
#sheet .team-manager-heading h3{font-size:17px;margin:0;line-height:1.35}
#sheet .team-manager-row p{font-size:12px;margin:5px 0 9px;line-height:1.4}
#sheet .team-row-actions{gap:6px}
#sheet .team-row-actions button{min-height:34px;padding:6px;font-size:12px;gap:5px}
#sheet .team-row-actions .team-action-icon{width:16px;height:16px}
#sheet:has(#new-team) .sheet-copy{font-size:13px;line-height:1.5;margin:0 0 12px}
@media(max-width:720px){#sheet input:not([type=checkbox]),#sheet textarea,#sheet select,#app input[type=search]{font-size:16px!important}}

/* Compact roster and formation recommendations. */
.team-mobile-heading .team-roster-jump{color:var(--gold,#f4d44b)}
.squad-column>.pitch-instructions{color:var(--green)}
#ai,#arrange-owned{position:relative;isolation:isolate;overflow:hidden}
#ai:not(:disabled)::after,#arrange-owned:not(:disabled)::after{content:"";position:absolute;inset:-60% -50%;pointer-events:none;background:linear-gradient(110deg,transparent 38%,#ffffff08 44%,#ffffff38 50%,#ffffff08 56%,transparent 62%);transform:translateX(-70%);animation:team-ai-sheen 4.8s ease-in-out infinite;z-index:-1}
@keyframes team-ai-sheen{0%,40%{transform:translateX(-70%)}80%,100%{transform:translateX(70%)}}
.bench .bench-card .bench-player{min-height:58px;padding:4px 6px;gap:5px}
.bench .bench-card .bench-player img{width:40px;height:48px;object-fit:contain}
.bench .bench-card{padding-right:28px}
.bench .bench-list{gap:8px}
.bench .bench-position-group h4{margin:12px 0 6px}
.bench .bench-player small{line-height:1.35;margin-top:2px}
.sidepanel>.formation-recommendations{order:2}
.sidepanel>.squad-status{order:3}.sidepanel>.help-details{order:4}
.formation-recommendations{margin-top:14px;padding:14px;border:1px solid var(--line);border-radius:14px;background:radial-gradient(ellipse at top left,#83d75212,transparent 70%),#07170e}
.formation-recommendations h3{font-size:17px;margin:0 0 4px}
.formation-recommendations>p{font-size:12px;color:var(--muted);margin:0 0 10px;line-height:1.5}
.recommended-plan{display:flex;align-items:center;gap:8px;padding:10px 0;border-top:1px solid #ffffff12}
.recommended-plan:last-child{padding-bottom:0}
.plan-rank{color:var(--gold);font-size:16px;font-weight:700;width:16px;flex:none}
.plan-info{flex:1;min-width:0}.plan-info strong{display:block;font-size:13px;line-height:1.4}.plan-info small{display:block;font-size:11px;line-height:1.5;color:var(--muted)}.plan-info b{color:var(--green)}
.recommended-plan button{flex:none;min-height:30px;padding:4px 8px;font-size:11px;border-radius:999px;color:var(--green);border:1px solid #88cd5866;background:#10271a}
/* AI spark: rises in while spinning, rests, drops out, repeats. */
.ai-spark{display:inline-block;width:.95em;height:.95em;margin:0 .08em;vertical-align:-.1em;fill:#f1c84d;transform-origin:50% 50%;animation:ai-spark-cycle 3.6s cubic-bezier(.34,1.3,.5,1) infinite}
button:disabled .ai-spark{animation:none}
@keyframes ai-spark-cycle{0%{transform:translateY(45%) scale(.4) rotate(-180deg);opacity:0}22%{transform:translateY(0) scale(1) rotate(180deg);opacity:1}72%{transform:translateY(0) scale(1) rotate(180deg);opacity:1}90%,100%{transform:translateY(45%) scale(.4) rotate(180deg);opacity:0}}
@media(prefers-reduced-motion:reduce){#ai::after,#arrange-owned::after,.ai-spark{animation:none!important}}
/* On wider screens, keep the tactics action aligned with the pitch frame. */
@media(min-width:721px){
 .squad-column>.roster-tactic{display:block;width:100%;box-sizing:border-box;margin:12px 0 0;padding:10px 14px;min-height:44px;border-radius:12px;font-size:15px;line-height:1.45}
}
/* Team OVR HUD inside the pitch: team badges top left, shield top right, Rank +5 switch beside the goalkeeper. */
.pitch .team-ovr-badge{position:absolute;top:10px;right:10px;width:56px;pointer-events:none;filter:drop-shadow(0 2px 5px #0009)}
.squad-board .pitch.top-3{padding-top:84px}
.pitch .team-ovr-badge svg,.pitch .pitch-hud svg{display:block;position:static;inset:auto;z-index:auto;stroke-opacity:1}
.pitch .team-ovr-badge svg{width:100%;height:auto}
.team-ovr-badge.is-empty{opacity:.5}
.team-ovr-badge text{font-family:'Chakra Petch',Anuphan,sans-serif;fill:#fff;text-anchor:middle}
.team-ovr-badge .ovr-label{font-size:12.5px;font-weight:600;letter-spacing:.6px}
.team-ovr-badge .ovr-value{font-size:38px;font-weight:700}
.pitch .pitch-hud{position:absolute;display:grid;justify-items:center;gap:4px;padding:5px 8px 6px;border:1px solid #8cdb6866;border-radius:12px;background:rgba(3,18,10,.72);color:#e9f3e3;line-height:1.2}
.pitch .pitch-rank:hover:not(:disabled),.pitch-badges:hover:not(:disabled) .hud-slots{background:rgba(12,40,24,.88)}
.pitch .pitch-badges,.pitch .pitch-badges:hover:not(:disabled){top:10px;left:10px;gap:3px;min-height:0;padding:0;border:0;background:none}
.pitch .pitch-badges:before{content:"";position:absolute;inset:-9px}
/* Nudge the empty badge slots now and then until a badge is equipped. */
.pitch-badges.is-empty:not(:disabled) .hud-slots{animation:badge-nudge 3s ease-in-out infinite}
@keyframes badge-nudge{0%,74%,100%{transform:none}78%{transform:translateX(-2px) rotate(-5deg)}82%{transform:translateX(2px) rotate(5deg)}86%{transform:translateX(-2px) rotate(-4deg)}90%{transform:translateX(2px) rotate(4deg)}94%{transform:translateX(-1px) rotate(-2deg)}97%{transform:translateX(1px) rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.pitch-badges.is-empty .hud-slots{animation:none}}
.pitch .pitch-rank{right:10px;bottom:12px;display:flex;align-items:center;gap:6px;min-height:0;padding:4px 5px 4px 10px;border-radius:999px}
.pitch .pitch-rank:before{content:"";position:absolute;inset:-9px}
.hud-switch{position:relative;flex:none;width:30px;height:18px;border-radius:999px;background:#3b4c40}
.hud-switch:after{content:"";position:absolute;left:3px;top:3px;width:12px;height:12px;border-radius:50%;background:#f4f7f2;transition:transform .15s}
.pitch-hud small{font:600 11px Anuphan,sans-serif;letter-spacing:.02em;color:#d5e6d2;text-shadow:0 1px 2px #000c;white-space:nowrap}
.hud-slots{display:flex;gap:3px;padding:2px 3px;border:1px solid #8cdb6866;border-radius:999px;background:rgba(3,18,10,.72)}
.ovr-badge-slot{display:grid;place-items:center;width:22px;height:22px;border:1px dashed #8cdb6877;border-radius:50%;color:#8cdb68b0}
.pitch .ovr-badge-slot svg{width:12px;height:12px}
.ovr-badge-slot.filled{border:0}
.ovr-badge-slot img{display:block;width:22px;height:22px;object-fit:contain}
.hud-rank{font:700 13px 'Chakra Petch',Anuphan,sans-serif;white-space:nowrap}
.hud-rank b{color:var(--muted)}
.pitch-rank[aria-checked=true] .hud-rank b{color:var(--gold)}
.pitch-rank[aria-checked=true] .hud-switch{background:#6fa94c}
.pitch-rank[aria-checked=true] .hud-switch:after{transform:translateX(12px)}
.badge-options{display:grid;gap:8px}
.badge-options button{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:8px 12px;text-align:left;border-radius:12px;background:rgba(2,12,7,.45);border-color:rgba(140,219,104,.3)}
.badge-options img{flex:none;width:44px;height:44px;object-fit:contain}
.badge-options button>span{flex:1;min-width:0}
.badge-options strong{display:block;font:700 14px 'Chakra Petch',Anuphan,sans-serif;letter-spacing:.02em}
.badge-options small{display:block;margin-top:2px;font-size:12px;color:var(--muted)}
.badge-options em{flex:none;font-style:normal;font-size:12px;font-weight:600;color:var(--green)}
.badge-options [aria-pressed=true]{border-color:var(--gold);background:#f1c84d14}
.badge-options [aria-pressed=true] em{color:var(--gold)}
.badge-options button:disabled{opacity:.45}
@media(max-width:720px){.pitch .team-ovr-badge{top:6px;right:8px;width:48px}.squad-board .pitch.top-3{padding-top:64px}.pitch .pitch-badges,.pitch .pitch-badges:hover:not(:disabled){top:6px;left:6px}.pitch-hud small{font-size:10px}.pitch .pitch-rank{right:6px;bottom:10px;padding:3px 4px 3px 9px}.hud-rank{font-size:12px}.ovr-badge-slot,.ovr-badge-slot img{width:20px;height:20px}}
@media(max-width:374px){.squad-board .pitch.top-2{padding-top:54px}}
/* TeeO 5 Oct: tactic button carries the Tactic tab icon and sizes to its content instead of spanning the screen. */
.sidepanel>.roster-tactic,.squad-column>.roster-tactic{display:inline-flex!important;align-items:center;justify-content:center;gap:9px;align-self:center;width:auto!important;max-width:100%;margin-left:auto!important;margin-right:auto!important;padding:10px 22px;font-weight:700}
.squad-column>.roster-tactic{display:flex!important;width:fit-content!important}
.roster-tactic-icon{flex:none;width:22px;height:22px}
.roster-tactic:disabled .roster-tactic-icon{opacity:.5}
/* TeeO 5 Oct: gold tactic button (option B) with a light-to-deep gold gradient. */
button.primary.roster-tactic{background:linear-gradient(145deg,#ffe48a 0%,#f1c84d 48%,#d9a62c 100%);border:1px solid #f6d978;color:#2a1f00;box-shadow:0 4px 16px rgba(241,200,77,.22)}
button.primary.roster-tactic:hover:not(:disabled){background:linear-gradient(145deg,#fff0b0 0%,#f6d566 48%,#e2b23a 100%);border-color:#fbe49a}
button.primary.roster-tactic:disabled{background:linear-gradient(145deg,#ffe48a 0%,#f1c84d 48%,#d9a62c 100%);opacity:.45;box-shadow:none}
/* Same type as the "แผนการเล่น" label: Anuphan bold. */
button.primary.roster-tactic,button.primary.roster-tactic span{font-family:Anuphan,sans-serif;font-weight:700;letter-spacing:0}
