.team-mode-dialog{width:min(500px,calc(100vw - 28px));box-sizing:border-box;max-height:calc(100dvh - 28px);overflow:auto;padding:22px;border:2px solid #d6b263;border-radius:16px;background:linear-gradient(140deg,#17324a,#071725);color:#fbe6b4;box-shadow:0 18px 70px #000b}.team-mode-dialog::backdrop{background:#020b14bb;backdrop-filter:blur(4px)}.team-mode-dialog header{display:flex;align-items:center;justify-content:space-between}.team-mode-dialog h2{margin:0 0 10px}.team-mode-dialog p{font:14px/1.5 system-ui,sans-serif}.team-mode-choices,.team-build-choices{display:grid;gap:12px}.team-mode-choices button{min-height:70px;font-size:18px}.team-build-choices button{display:flex;align-items:center;gap:12px;min-height:65px}.team-build-choices img{width:54px;height:54px;object-fit:contain}
#lobby.team-lobby .lobby-layout,#lobby.team-lobby .lobby-body{display:block}#lobby.team-lobby #players{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}#lobby.team-lobby .team-lobby-group{min-width:0;padding:12px;border:1px solid #9da08a80;border-radius:14px;background:#06142280}#lobby.team-lobby .team-lobby-group h3{margin:0 0 12px;text-align:center}#lobby.team-lobby .playerrow{display:flex;flex-wrap:wrap;gap:10px;min-height:100px;margin-bottom:10px;padding:12px}#lobby.team-lobby .player-identity{flex:1;min-width:100px}#lobby.team-lobby .playerrow>button{font-size:11px;padding:6px}.team-seat-actions{display:flex;flex-wrap:wrap;gap:6px}.team-seat-actions button{font-size:12px;padding:8px}.team-difficulty{grid-column:1/-1;display:flex;align-items:center;gap:12px;margin:0 0 15px;font:13px system-ui,sans-serif}
#lobby.team-lobby .lobby-content{display:flex;flex-direction:column;gap:24px}
#lobby.team-lobby .lobby-overview,#lobby.team-lobby .lobby-selection{width:100%}
@media(min-width:700px){#lobby.team-lobby .factions{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Team arena: readable boards sized by available width, independent HUD cells. */
body.team-playing[data-menu-screen="game"] main{max-width:1840px;width:100%;box-sizing:border-box;padding:18px 20px 28px}
#game.team-game{max-width:1800px;width:100%;margin:0 auto;--commands-width:310px}
#game.team-game .gamegrid{display:grid;grid-template-columns:minmax(0,1fr) var(--commands-width);gap:22px;align-items:start}
#game.team-game .boardpanel{position:relative;min-width:0;width:auto;max-width:none;padding:14px}
#game.team-game #battlefield{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 18px;width:100%;max-width:none}
#game.team-game #battlefield>.player-area{display:flex;flex-direction:column;grid-column:var(--team-column);grid-row:var(--team-row);align-self:start;gap:0;min-width:0;width:auto;margin:0;padding:0}
#game.team-game .battle-divider{display:none}
#game.team-game #battlefield .boardwrap{order:2;width:100%;max-width:none;padding:0}
#game.team-game #battlefield .board{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(5,minmax(0,1fr));gap:3px;width:100%;max-width:none;height:auto;aspect-ratio:6/5}
#game.team-game #battlefield .tile{width:auto;height:auto;min-width:0;min-height:0;aspect-ratio:1}
#game.team-game #battlefield .colheads{order:1;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;width:100%;height:24px;min-height:24px}
#game.team-game #battlefield .area-head{order:0;position:relative;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:center;gap:9px;box-sizing:border-box;height:112px;min-height:112px;margin:0;padding:11px 32px 10px 11px;overflow:visible}
#game.team-game .area-head .commander-identity{display:grid;grid-template-columns:52px minmax(0,1fr) 38px;align-items:center;gap:11px;width:100%;height:54px;min-height:54px;overflow:visible}
#game.team-game .area-head .commander-portrait{display:block;grid-column:1;grid-row:1;box-sizing:border-box;inline-size:52px;block-size:52px;width:52px;height:52px;min-width:52px;max-width:52px;min-height:52px;max-height:52px;aspect-ratio:1;flex:none;object-fit:cover;border-radius:50%;margin:0}
#game.team-game .area-head .commander-copy{grid-column:2;grid-row:1;position:static;min-width:0;width:auto;min-height:0;padding:0;margin:0}
#game.team-game .area-head .commander-copy strong{display:block;font-size:clamp(13px,1vw,18px);line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#game.team-game .area-head .commander-copy small{display:block;font-size:12px;line-height:1.3;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#game.team-game .commander-copy .eyebrow{display:none}
#game.team-game .area-head .health-track{position:static;inset:auto;width:100%;height:9px;margin:6px 0 0}
#game.team-game .area-head .mini-stats{position:static!important;inset:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:1fr;gap:6px;box-sizing:border-box;width:100%;height:25px;min-height:25px;max-height:25px;margin:0;padding:0;transform:none;overflow:visible;flex:none}
#game.team-game .area-head .mini-stats>span{display:flex;align-items:center;justify-content:center;gap:4px;box-sizing:border-box;width:auto;min-width:0;height:25px;min-height:25px;margin:0;padding:3px 4px;font-size:12px;line-height:1;white-space:nowrap;flex-wrap:nowrap}
#game.team-game .mini-stats .resource-gem{width:14px;height:14px;flex:none}
#game.team-game .area-head .mini-stats .shield-status{display:none}
#game.team-game .area-head .mini-stats i{font-size:9px}
#game.team-game .area-head .battle-chat-button{grid-column:3;grid-row:1;position:relative!important;inset:auto;display:inline-grid;place-items:center;box-sizing:border-box;align-self:center;justify-self:center;width:36px;min-width:36px;max-width:36px;height:36px;min-height:36px;max-height:36px;margin:0;padding:6px!important;overflow:visible;z-index:4}
#game.team-game .area-head .battle-chat-button svg{width:21px;height:21px}
#game.team-game .area-head .battle-chat-button .chat-unread{position:absolute;display:grid;place-items:center;box-sizing:border-box;right:-8px;top:-8px;min-width:21px;height:21px;padding:0 4px;border:2px solid #112537;border-radius:12px;background:#ffda77;color:#142131;font:800 11px/17px system-ui,sans-serif;z-index:6;pointer-events:none}
#game.team-game .area-head .battle-chat-button .chat-unread[hidden]{display:none}
.team-board-nav[hidden],.team-extra-area[hidden],.team-command-panel[hidden],.team-request-panel[hidden],.team-arena-heading[hidden],.team-view-heading[hidden]{display:none!important}
.team-arena-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px;padding:0 2px}
.team-arena-heading strong{font:700 17px/1.3 Georgia,serif;color:#ffe4a8}
.team-arena-heading small{font:12px/1.4 system-ui,sans-serif;color:#c6d7e2}
.team-board-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:0 0 16px;scroll-margin-top:calc(var(--battle-header-height,145px) + 10px)}
.team-board-nav button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 7px;align-items:center;min-width:0;min-height:65px;padding:10px 12px;border:1px solid #9b6577;border-radius:10px;font:600 12px/1.35 system-ui,sans-serif;text-align:left;overflow:visible}
.team-board-nav .team-nav-name{grid-column:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.team-board-nav .team-nav-health{grid-column:2;grid-row:1;color:#ffb8b3;white-space:nowrap}
.team-board-nav .team-nav-status{grid-column:1/-1;font-size:11px;font-weight:400;color:#bdcdd7}
.team-board-nav button.is-ally{border-color:#548c9e}
.team-board-nav button.is-active{border-color:#efd078;box-shadow:inset 0 0 17px #d9b64d24}
.team-board-nav button[aria-pressed=true]{outline:2px solid #ffe1a0;outline-offset:2px;background:linear-gradient(#25475b,#132b3c)}
.team-view-heading{display:none;margin:0 0 8px;padding:0 3px;color:#e8d29e;font:12px/1.4 system-ui,sans-serif}
#game.team-game .player-area[data-team-active=true] .board{box-shadow:0 0 0 2px #efc55c,0 0 15px #edc45866}
#game.team-game #myBoard{box-shadow:0 0 0 2px var(--turn-edge,#bca269)}
#game.team-game .badge{font-size:13px;min-width:18px;min-height:18px;padding:2px 4px}
#game.team-game .sidebar{min-width:0}
#game.team-game .sidebar .battle-history{height:auto!important;min-height:0!important;margin-bottom:16px}
#game.team-game .battle-history .log{height:130px!important;max-height:130px!important;min-height:0!important}
#game.team-game .team-spell-target{width:100%;max-width:100%;margin:0 0 7px;padding:8px;font:12px system-ui,sans-serif}
.team-command-panel{margin:12px 0;padding:13px;border:1px solid #5c93a5;border-radius:12px;background:#102737a6}
.team-command-panel h3{margin:0;text-align:center}.team-command-panel p{font:12px/1.5 system-ui,sans-serif;color:#d6e3eb}
.team-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.team-tools button{min-height:44px;padding:7px 5px;font:600 12px/1.35 system-ui,sans-serif}
.team-request-panel{display:grid;gap:8px;margin:12px 0}.team-request{padding:13px;border:1px solid #ecd18a;border-radius:12px;background:#213d40;box-shadow:0 0 12px #d6bd4e33}.team-request strong{font-size:15px}.team-request p{font:12px/1.5 system-ui,sans-serif}.team-request button{min-height:40px;margin-right:7px}
#game.team-game .boardpanel>.team-request-panel{margin:0 0 14px}
.team-target{outline:3px solid #6fdbff!important;outline-offset:-4px;box-shadow:inset 0 0 18px #45bdff88!important;cursor:pointer}.team-proposal-chip{outline:3px solid #ffe094!important;outline-offset:-4px;box-shadow:inset 0 0 20px #ffd55c88!important}
.team-extra-area .area-head::after{display:none}
@keyframes teamAllyUpdate{0%{filter:brightness(1.5)}100%{filter:brightness(1)}}
.team-ally-update{animation:teamAllyUpdate .35s ease-out}
@media(min-width:760px) and (max-width:1199px){
 body.team-playing[data-menu-screen="game"] main{padding-inline:12px}
 #game.team-game{--commands-width:260px}
 #game.team-game .gamegrid{gap:12px}
 #game.team-game #battlefield{gap:18px 10px}
 #game.team-game .boardpanel{padding:10px}
 #game.team-game .area-head .commander-identity{grid-template-columns:40px minmax(0,1fr) 32px;gap:7px}
 #game.team-game .area-head .commander-portrait{inline-size:40px;block-size:40px;width:40px;height:40px;min-width:40px;max-width:40px;min-height:40px;max-height:40px}
 #game.team-game .area-head .battle-chat-button{width:30px;min-width:30px;max-width:30px;height:30px;min-height:30px;max-height:30px}
 #game.team-game #battlefield .area-head{height:106px;min-height:106px;padding-right:24px}
 #game.team-game .area-head .commander-copy strong{font-size:12px}
 #game.team-game .area-head .commander-copy small{font-size:10px}
 #game.team-game .area-head .mini-stats>span{font-size:10px;gap:2px;padding-inline:1px}
 .team-board-nav button{padding:9px 7px;font-size:11px}
}
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 body.team-playing[data-menu-screen="game"] main{padding:10px 7px 20px;min-height:0}
 #game.team-game{width:100%;max-width:none}
 #game.team-game .gamegrid{grid-template-columns:minmax(0,1fr);gap:14px}
 #game.team-game .boardpanel{padding:10px 8px}
 #game.team-game #battlefield{display:block}
 #game.team-game #battlefield>.player-area[data-team-selected=false]{display:none}
 #game.team-game #battlefield .area-head{height:102px;min-height:102px;padding:8px 27px 8px 8px}
 #game.team-game .area-head .commander-identity{grid-template-columns:44px minmax(0,1fr) 36px;gap:8px;height:48px;min-height:48px}
 #game.team-game .area-head .commander-portrait{inline-size:44px;block-size:44px;width:44px;height:44px;min-width:44px;max-width:44px;min-height:44px;max-height:44px}
 #game.team-game .area-head .commander-copy strong{font-size:14px}
 #game.team-game .area-head .commander-copy small{font-size:11px}
 #game.team-game .area-head .mini-stats>span{font-size:11px}
 .team-arena-heading{display:block;margin-bottom:9px}.team-arena-heading strong{display:block;font-size:15px}.team-arena-heading small{display:block;margin-top:3px;font-size:11px}
 .team-board-nav{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:10px}
 .team-board-nav button{min-height:54px;padding:7px 9px;font-size:12px}.team-board-nav .team-nav-status{font-size:10px}
 .team-view-heading{display:block}
 #game.team-game .battle-actions{width:100%;margin-top:12px}
 #game.team-game .turn-actions{position:static;inset:auto;z-index:auto}
 #game.team-game .sidebar{position:static;max-height:none;overflow:visible;padding:12px}
}
@media(max-width:359px){#game.team-game .area-head .commander-copy strong{font-size:12px}.team-board-nav button{font-size:11px;padding-inline:6px}}
@media(prefers-reduced-motion:reduce){.team-ally-update{animation:none}}

@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 body.team-playing[data-menu-screen="game"] .topbar{position:sticky;top:0;display:grid;grid-template-columns:1fr auto;grid-template-rows:42px 38px;gap:4px 8px;padding:6px 10px;min-height:0}
 body.team-playing[data-menu-screen="game"] .topbar .brand{position:static;grid-column:1;grid-row:1;transform:none;justify-self:start}
 body.team-playing[data-menu-screen="game"] .topbar-logo{width:145px;height:42px;max-height:42px;object-fit:contain}
 body.team-playing[data-menu-screen="game"] .topbar .header-right{display:contents}
 body.team-playing[data-menu-screen="game"] .topbar #soundPanel{grid-column:1;grid-row:2;justify-self:start;margin:0}
 body.team-playing[data-menu-screen="game"] .topbar .sound-panel-toggle{height:36px;min-height:36px;padding:6px 10px;font-size:11px}
 body.team-playing[data-menu-screen="game"] .topbar #mainMenuButton{grid-column:2;grid-row:2;height:36px;min-height:36px;padding:6px 10px;font-size:11px}
 body.team-playing[data-menu-screen="game"] .topbar #roomBadge{position:absolute;right:10px;top:15px;margin:0;font-size:10px;padding:3px 6px}
}
@media(max-width:759px) and (max-height:720px){
 .team-arena-heading small{display:none}.team-arena-heading strong{font-size:13px}.team-board-nav button{min-height:46px;padding-block:5px}
 #game.team-game #battlefield .area-head{height:92px;min-height:92px}
 #game.team-game .area-head .commander-identity{height:42px;min-height:42px}
}

.team-mobile-bar{display:none}.team-mobile-bar[hidden]{display:none!important}
.team-command-sheet{box-sizing:border-box;width:min(520px,calc(100vw - 16px));max-height:calc(100dvh - 24px);margin:auto auto max(8px,env(safe-area-inset-bottom));padding:16px;border:1px solid #d7b36a;border-radius:20px 20px 12px 12px;background:linear-gradient(145deg,#17324a,#071724);color:#fbe4b4;overflow:auto;overscroll-behavior:contain;box-shadow:0 -8px 50px #000a}
.team-command-sheet::backdrop{background:#020c16b8;backdrop-filter:blur(4px)}
.team-command-sheet>header{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:12px;margin-bottom:10px;border-bottom:1px solid #967c4f}
.team-command-sheet h2{margin:0;font:700 23px Georgia,serif}.team-command-sheet>header button{min-width:38px;min-height:38px;padding:3px;font-size:24px}
.team-command-sheet .battle-actions{display:block;width:100%;margin:0}.team-command-sheet .battle-section-title{display:none}
.team-command-sheet #controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:18px}
.team-command-sheet #controls button{min-height:112px;padding:10px 5px;font-size:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
.team-command-sheet .action-emblem{display:grid;place-items:center;width:50px;height:50px}.team-command-sheet .action-emblem svg{width:30px;height:30px;fill:none;stroke:#ffe09a;stroke-width:1.5}
.team-command-sheet .action-caption small{display:block;font-size:11px;margin-top:4px}.team-command-sheet #cardTabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.team-command-sheet #cardTabs>button{min-height:64px;font-size:12px;padding:8px 4px}
.team-command-sheet .battle-cards-title{text-align:center;font-size:18px;margin:12px 0}.team-command-sheet .arcane-choice{margin-bottom:12px}
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 body.team-playing[data-menu-screen="game"] main{padding-bottom:90px}
 .team-mobile-bar{position:fixed;left:10px;right:10px;bottom:max(8px,env(safe-area-inset-bottom));z-index:30;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding:7px;border:1px solid #b99a61;border-radius:14px;background:#091c2af5;box-shadow:0 3px 25px #000b}
 .team-mobile-bar button{min-width:0;min-height:42px;margin:0;padding:7px 4px;font:700 13px/1.3 system-ui,sans-serif;border-radius:9px}.team-mobile-bar button.has-unread{border-color:#ffdc7c;color:#ffe39b;box-shadow:inset 0 0 12px #f0c54d33}
 #game.team-game .battle-actions{display:block}
 #game.team-game .turn-actions{position:static;margin-bottom:8px}
}

.team-nav-short{display:none}
.team-command-sheet .action-emblem{border:1px solid #d7b76b;border-radius:50%;background:#102c40;box-shadow:0 0 0 3px #0b1d2c,0 0 0 4px #977d46}
@media(max-width:759px) and (max-height:720px){
 .team-arena-heading{margin-bottom:7px}.team-arena-heading strong{font-size:13px}
 .team-board-nav{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin-bottom:7px}
 .team-board-nav button{grid-template-columns:minmax(0,1fr) auto;min-height:40px;padding:6px 4px;gap:2px;font-size:10px}
 .team-board-nav .team-nav-name,.team-board-nav .team-nav-status{display:none}.team-board-nav .team-nav-short{display:block;grid-column:1;grid-row:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .team-view-heading{margin-bottom:6px;font-size:11px}
 #game.team-game #battlefield .area-head{height:84px;min-height:84px;padding-top:5px;padding-bottom:5px;gap:5px}
 #game.team-game .area-head .commander-identity{height:42px;min-height:42px}
 #game.team-game #battlefield .boardwrap,#game.team-game #battlefield .colheads{width:min(100%,max(240px,calc((100svh - var(--battle-header-height,96px) - 330px)*1.2)));align-self:center}
 #game.team-game #battlefield .colheads{height:18px;min-height:18px;font-size:10px}
}

@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){.team-mobile-bar{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.team-mobile-bar button{font-size:11px;padding-inline:3px}.team-mobile-bar .primary{color:#211707}}
/* Preserve the established 1vs1 field scale rather than shrinking four boards. */
@media(min-width:1200px){
 #game.team-game{max-width:calc(var(--tile)*12 + 20px + 18px + 32px + var(--commands-width) + 22px)}
 #game.team-game #battlefield>.player-area{max-width:calc(var(--tile)*6 + 10px);width:100%;justify-self:center}
 #game.team-game .team-board-nav{position:sticky;top:calc(var(--battle-header-height,96px) + 6px);z-index:15;padding:6px;background:#081724f5;border-radius:11px;box-shadow:0 4px 12px #0005}
}
@media(min-width:1200px) and (max-width:1399px){#game.team-game{--commands-width:220px}#game.team-game .gamegrid{gap:14px}#game.team-game .boardpanel{padding:10px}}
/* On smaller landscape displays show one full-size duel lane at a time. */
@media(min-width:760px) and (max-width:1199px){
 #game.team-game{--commands-width:250px;max-width:calc(var(--tile)*6 + 10px + 24px + var(--commands-width) + 18px)}
 #game.team-game #battlefield{grid-template-columns:minmax(0,1fr);gap:20px}
 #game.team-game #battlefield>.player-area{grid-column:1;max-width:calc(var(--tile)*6 + 10px);width:100%;justify-self:center}
 #game.team-game #battlefield>.player-area[data-pair-selected=false]{display:none}
 #game.team-game .team-board-nav{position:sticky;top:calc(var(--battle-header-height,96px) + 6px);z-index:15;padding:6px;background:#081724f5;border-radius:11px}
 #game.team-game .team-board-nav button{padding:7px 5px;min-height:54px;font-size:10px}
}
/* Identical resource marks and typography on every status window. */
#game.team-game .area-head .mini-stats b{font:700 12px/1 Georgia,serif;color:#fff0d2;text-shadow:none}
#game.team-game #myAP,#game.team-game #enemyAP{font-size:12px;color:#fff0d2;text-shadow:none}
#game.team-game .mini-stats [data-resource="health"] b::after{content:'/12';font-weight:400}
#game.team-game .mini-stats [data-resource="ap"] b::before{content:none}
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game.team-game{max-width:none}
 #game.team-game #battlefield{display:flex;flex-direction:column;gap:10px}
 #game.team-game #battlefield>.player-area{width:100%;max-width:none;order:2}
 #game.team-game #battlefield>.player-area[data-preview-own=false]{order:1}
 #game.team-game #battlefield>.player-area[data-team-selected=false]{display:none}
 #game.team-game #battlefield>.player-area[data-team-preview=true]{display:flex;pointer-events:none;opacity:.9}
 #game.team-game #battlefield>.player-area[data-team-preview=true]>.area-head,
 #game.team-game #battlefield>.player-area[data-team-preview=true]>.colheads{display:none}
 #game.team-game #battlefield>.player-area[data-team-preview=true]::before{content:attr(data-preview-label);display:block;position:static;font:11px/1.4 system-ui,sans-serif;color:#bed0dc;margin:0 0 4px;padding:0 4px;background:none;opacity:1}
 #game.team-game #battlefield>.player-area[data-team-preview=true]>.boardwrap{position:relative;height:clamp(48px,8svh,72px);min-height:0;overflow:hidden;border-radius:5px;aspect-ratio:auto}
 #game.team-game #battlefield>.player-area[data-team-preview=true] .board{position:absolute;left:0;bottom:0;top:auto;width:100%;height:auto;aspect-ratio:6/5;box-shadow:none}
 #game.team-game #battlefield>.player-area[data-team-preview=true][data-preview-own=true] .board{top:0;bottom:auto}
 #game.team-game #battlefield .boardwrap,#game.team-game #battlefield .colheads{width:min(100%,max(240px,calc((100svh - var(--battle-header-height,96px) - 480px)*1.2)));align-self:center}
 #game.team-game .team-board-nav{position:static;padding:0;background:none;box-shadow:none}
}
/* The own castle HUD sits below its board, as it does in the duel layout. */
@media(min-width:760px){#game.team-game #battlefield>.player-area[data-preview-own=true]>.area-head{order:3;margin-top:7px}}
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){#game.team-game #battlefield>.player-area[data-preview-own=true]>.area-head{order:0;margin-top:0}}#game.team-game #battlefield .board,#game.team-game #battlefield .colheads{gap:2px}
@media(min-width:760px) and (orientation:landscape), (min-width:1001px){#game.team-game .sidebar{position:sticky;top:calc(var(--battle-header-height,96px) + 12px);align-self:start;max-height:calc(100svh - var(--battle-header-height,96px) - 24px);overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}}@media(min-width:760px) and (max-width:1199px) and (orientation:landscape){
 body.team-playing[data-menu-screen="game"] .topbar .brand{position:static!important;left:auto!important;transform:none!important;flex:0 0 180px;width:180px}
 body.team-playing[data-menu-screen="game"] .topbar-logo{width:180px;max-height:64px}
 body.team-playing[data-menu-screen="game"] .topbar .header-right{flex:1 1 0;max-width:calc(100% - 200px);width:auto;margin-left:auto}
}

/* Team actions belong to the normal action grid, in a dedicated second row. */
#game.team-game #controls{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.team-command-panel{display:none!important}
.boardwrap.own-turn-notice{position:relative}
.boardwrap.own-turn-notice::after{content:'';position:absolute;inset:-4px;z-index:12;pointer-events:none;border:3px solid #ffe18b;border-radius:6px;box-shadow:0 0 18px #ffd351aa,inset 0 0 16px #ffdc6866;opacity:0;animation:ownTurnArrival .6s ease-in-out 2}
@keyframes ownTurnArrival{0%,100%{opacity:0}40%,60%{opacity:1}}
@media(prefers-reduced-motion:reduce){.boardwrap.own-turn-notice::after{animation:none;opacity:1;box-shadow:none}}

/* The mobile turn status scrolls with the board instead of covering it. */
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game.team-game #turnActions,#game.team-game #turnActions .gametop,#game.team-game .team-arena-heading,#game.team-game .team-board-nav{position:static!important;inset:auto!important;z-index:auto}
}
/* Uniform resource values and symbols across all player HUDs. */
#game .area-head .mini-stats{--hud-value-size:13px;--hud-symbol-size:17px}
#game.team-game .area-head .mini-stats{--hud-value-size:12px;--hud-symbol-size:15px}
#game .area-head .mini-stats>span{font-size:var(--hud-value-size);line-height:1;gap:4px}
#game .area-head .mini-stats b{font-size:var(--hud-value-size)!important;font-weight:700;line-height:1}
#game .area-head .mini-stats .resource-gem{width:var(--hud-symbol-size);height:var(--hud-symbol-size);flex:none}
#game #myAP::before,#game #enemyAP::before,#game .mini-stats [data-resource="ap"] b::before{content:none!important}
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game .area-head .mini-stats{--hud-value-size:10px;--hud-symbol-size:12px}
 #game.team-game .area-head .mini-stats{--hud-value-size:11px;--hud-symbol-size:13px}
 #game .area-head .mini-stats>span{gap:3px}
}
/* Both fields of the selected duel remain fully reachable on phones. */
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game.team-game #battlefield>.player-area[data-team-preview=true]{pointer-events:auto;opacity:1}
 #game.team-game #battlefield>.player-area[data-team-preview=true]>.area-head{display:flex}
 #game.team-game #battlefield>.player-area[data-team-preview=true]>.colheads{display:grid}
 #game.team-game #battlefield>.player-area[data-team-preview=true]::before{display:none}
 #game.team-game #battlefield .boardwrap,#game.team-game #battlefield .colheads{width:100%;max-width:490px;flex:none}
 #game.team-game #battlefield>.player-area[data-team-preview=true]>.boardwrap{position:relative;height:auto;min-height:0;overflow:visible;aspect-ratio:auto;flex:none}
 #game.team-game #battlefield>.player-area[data-team-preview=true] .board{position:relative;inset:auto;width:100%;height:auto;aspect-ratio:6/5}
 #game.team-game #battlefield>.player-area[data-team-preview=true][data-preview-own=true] .board{top:auto;bottom:auto}
}
/* Keep the local player's status beneath their field on every screen size. */
#game.team-game #battlefield>.player-area.bottom-area>.area-head{order:3!important;margin-top:7px}
.team-mobile-bar button.draw-available{color:#dcf5ff;border-color:#88d9ff;background:radial-gradient(ellipse at 35% 20%,#387395,#143b59 60%,#081c2c);box-shadow:inset 0 0 12px #4bbcff22,0 0 12px #4fc3ff55}

/* Team status and field navigation stay in the page flow on desktop too. */
#game.team-game .team-arena-heading,#game.team-game .team-board-nav{position:static!important;inset:auto!important;z-index:auto}


@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game.team-game #battlefield>.player-area[data-preview-own=true]>.area-head{order:3!important;margin-top:7px}
}
.team-mobile-bar.is-other-field{grid-template-columns:repeat(3,minmax(0,1fr))}
.team-mobile-bar button[hidden]{display:none!important}
.team-mobile-bar button:disabled{opacity:.4;filter:saturate(.4);cursor:default}

/* Avoid two visible scrollbars when the battle history is open. */
#game .sidebar:has(.battle-history[open]){scrollbar-width:none;scrollbar-gutter:auto}
#game .sidebar:has(.battle-history[open])::-webkit-scrollbar{display:none;width:0;height:0}
/* The 1vs1 landscape shortcut bar does not change the board arrangement. */
.team-mobile-bar.is-duel{grid-template-columns:repeat(3,minmax(0,1fr))}
@media(max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game.duel-phone-toolbar{padding-bottom:76px}

}

/* Wide, compact action and building windows for landscape screens. */
@media(orientation:landscape) and (max-height:650px){
 .team-command-sheet{width:min(920px,calc(100vw - 20px));max-height:calc(100dvh - 16px);margin:auto;padding:10px 14px;border-radius:12px}
 .team-command-sheet>header{padding-bottom:7px;margin-bottom:8px;min-height:30px}
 .team-command-sheet h2{font-size:19px}
 .team-command-sheet>header button{min-width:30px;min-height:30px;height:30px;padding:0;font-size:22px}
 .team-command-sheet .battle-actions{display:grid;grid-template-columns:minmax(0,2fr) minmax(180px,1fr);gap:6px 14px;align-items:start}
 .team-command-sheet #controls{grid-column:1;grid-row:1 / span 4;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px;margin:0}
 .team-command-sheet #controls button{min-height:82px;height:auto;padding:6px 3px;font-size:11px;gap:5px}
 .team-command-sheet .action-emblem{width:36px;height:36px;flex:none}
 .team-command-sheet .action-emblem svg{width:25px;height:25px}
 .team-command-sheet .action-caption{line-height:1.15}
 .team-command-sheet .action-caption small{font-size:10px;margin-top:3px}
 .team-command-sheet .battle-cards-title{grid-column:2;grid-row:1;margin:0;padding:0;font-size:16px}
 .team-command-sheet #cardTabs{grid-column:2;grid-row:2;grid-template-columns:minmax(0,1fr)!important;gap:5px;margin:0}
 .team-command-sheet #cardTabs>button{min-height:40px;padding:6px;font-size:12px;overflow-wrap:normal}
 .team-command-sheet #pendingBox,.team-command-sheet .arcane-choice{grid-column:2;grid-row:3;font-size:11px;margin:0}
 .team-command-sheet #turnActions{display:none}
 .building-picker{width:min(700px,calc(100vw - 20px));padding:8px}
 .building-picker-grid{grid-template-columns:repeat(auto-fit,minmax(80px,1fr));gap:5px;margin:6px 0}
 .building-picker-choice{min-height:86px;padding:5px 3px;font-size:10px;gap:3px}
 .building-picker-choice>img{width:44px;height:44px}
 .building-picker-heading{padding-bottom:6px;font-size:13px}
 .building-picker-hint{font-size:10px;line-height:1.3}
 .building-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 20px));max-height:calc(100dvh - 16px);padding:10px 14px}
 .building-dialog header{margin-bottom:8px;padding-bottom:8px;min-height:30px}
 .building-dialog h2{font-size:19px}
 .building-dialog-content{display:grid;grid-template-columns:minmax(110px,30%) minmax(0,1fr);gap:8px 16px;align-items:center;text-align:left}
 .building-dialog-content>img{grid-column:1;grid-row:1 / span 4;justify-self:center;width:min(160px,40svh);max-width:100%;height:auto}
 .building-dialog-content>p,.building-dialog-content>button{grid-column:2}
 .building-dialog-content>p{font-size:12px;line-height:1.4}
 .building-dialog-content>button{min-height:36px;padding:7px;font-size:12px;margin:0}
 .team-mode-dialog:has(.team-build-choices),.team-mode-dialog:has(.team-mode-choices){width:min(760px,calc(100vw - 20px));max-height:calc(100dvh - 16px);padding:12px 16px}
 .team-mode-dialog h2{font-size:20px;margin-bottom:8px}
 .team-mode-dialog p{font-size:12px;line-height:1.4;margin:8px 0}
 .team-build-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 .team-build-choices button{min-height:52px;padding:6px;font-size:11px;gap:6px}
 .team-build-choices img{width:36px;height:36px}
 .team-mode-choices{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 .team-mode-choices button{min-height:40px;padding:8px;font-size:13px}
}
/* A held chip belongs to the game, not the browser image menu or drag action. */
#game .tile{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:pan-y}
#game .tile .chip{pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-user-drag:none}
/* Leave breathing room between column numbers and the active board glow. */
#game #battlefield .colheads{position:relative;z-index:5;align-items:center;line-height:1;margin-bottom:6px}
#game #battlefield .colheads>div{align-self:center;line-height:1;transform:translateY(-1px)}


@media(min-width:1200px){
 #game.team-game .boardpanel{overflow-x:auto;overscroll-behavior-x:contain}
 #game.team-game #battlefield{grid-template-columns:repeat(2,calc(var(--tile)*6 + 10px));width:max-content;max-width:none;margin-inline:auto}
}
/* Hide outer PC scrollbars without removing access to any field or action. */
@media(min-width:1001px){
 html:has(#game.team-game:not(.hidden)),body:has(#game.team-game:not(.hidden)),#game.team-game .boardpanel,#game.team-game .sidebar{scrollbar-width:none;scrollbar-gutter:auto}
 html:has(#game.team-game:not(.hidden))::-webkit-scrollbar,body:has(#game.team-game:not(.hidden))::-webkit-scrollbar,#game.team-game .boardpanel::-webkit-scrollbar,#game.team-game .sidebar::-webkit-scrollbar{display:none;width:0;height:0}
}

/* Six team actions form two rows of three on mobile. */
@media(max-width:759px), (max-width:1000px) and (orientation:portrait), (max-width:1000px) and (max-height:600px) and (orientation:landscape){
 #game.team-game #controls,body.team-playing .team-command-sheet #controls{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px}
 #game.team-game #controls>button,body.team-playing .team-command-sheet #controls>button{font-size:11px;gap:6px;padding-inline:3px;min-width:0}
 #game.team-game #controls .action-emblem,body.team-playing .team-command-sheet #controls .action-emblem{width:44px;height:44px}
 #game.team-game #controls .action-emblem svg,body.team-playing .team-command-sheet #controls .action-emblem svg{width:27px;height:27px}
}
/* A visible team-field divider with a dedicated view-switch control. */
.team-field-divider[hidden]{display:none!important}
#game.team-game .team-field-divider{display:flex;grid-row:2;grid-column:1/-1;order:1;align-items:center;justify-content:center;gap:14px;width:100%;min-height:44px;margin:0;padding:0 3px;box-sizing:border-box}
.team-field-divider::before,.team-field-divider::after{content:'';height:2px;flex:1;background:linear-gradient(90deg,transparent,#d7b265 40%,#ffe6a6);box-shadow:0 1px #4c351b}
.team-field-divider::after{transform:scaleX(-1)}
#game.team-game .team-field-switch{display:grid;place-items:center;flex:0 0 38px;width:38px;min-width:38px;height:38px;min-height:38px;margin:0;padding:7px;border:1px solid #e8c77e;border-radius:50%;background:radial-gradient(circle at 35% 20%,#37556b,#102b40 60%,#081726);color:#ffe6a5;box-shadow:0 0 0 2px #071321,0 0 0 3px #94723c}
.team-field-switch svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#game.team-game .team-field-switch:hover{border-color:#fff1c2;filter:brightness(1.15)}
#game.team-game .team-field-switch:focus-visible{outline:2px solid #fff1c2;outline-offset:5px}

/* The divider stays visible; field switching belongs to the phone layout. */
@media(min-width:760px){#game.team-game .team-field-switch{display:none}}

/* Room format shows the two opposing sides, using the existing gold/blue style. */
.team-mode-choices>.room-format-choice{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:116px;padding:16px}
.room-format-players{display:flex;align-items:center;justify-content:center;gap:24px;width:100%}.room-format-side{display:flex;align-items:center;justify-content:center;gap:8px;flex:1}.room-format-player{display:grid;place-items:center;width:38px;height:44px;color:#f5d78f}.room-format-side:last-child .room-format-player{color:#a9dfff}.room-format-player svg{width:32px;height:36px;fill:currentColor;stroke:currentColor;stroke-width:1.5}.room-format-versus{font:700 12px system-ui;letter-spacing:2px;color:#d4b77b}
.team-name-form{display:flex;align-items:flex-end;gap:8px;margin:0 0 14px}.team-name-form label{display:grid;gap:5px;flex:1;min-width:0;font:12px system-ui;color:#d4e0ea}.team-name-form input{width:100%;min-width:0;box-sizing:border-box;min-height:40px;padding:8px 10px;border:1px solid #638397;border-radius:8px;background:#091d2c;color:#fff0c9;font:15px system-ui}.team-name-form button{min-height:40px;padding:8px 12px;white-space:nowrap}
@media(max-width:420px){.room-format-players{gap:12px}.room-format-player{width:29px}.room-format-side{gap:5px}.team-name-form{gap:6px}.team-name-form button{font-size:12px;padding:8px}}

.team-mode-dialog:has(#teamModeTitle)>header{padding-right:32px}

/* Consent stays visible even while the recipient is looking at another field. */
.team-request-dialog{box-sizing:border-box;width:min(460px,calc(100vw - 24px));max-height:calc(100dvh - 28px);overflow:auto;margin:auto;padding:18px;border:2px solid #e6c57c;border-radius:14px;background:linear-gradient(140deg,#17324a,#071725);color:#fbe6b4;box-shadow:0 16px 70px #000b}
.team-request-dialog::backdrop{background:#020b14aa;backdrop-filter:blur(3px)}
.team-request-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.team-request-dialog h2{font:700 clamp(19px,5vw,25px)/1.2 Georgia,serif;margin:0}.team-request-dialog>header button{width:36px;min-width:36px;height:36px;min-height:36px;margin:0;padding:0;border:0;background:none;box-shadow:none;font-size:24px;color:#fbe6b4}.team-request-dialog .team-request{margin-top:10px}.team-request-dialog .team-request button{min-height:44px}.team-request-dialog .team-request button:focus-visible{outline:2px solid #ffe7a5;outline-offset:2px}

.team-consent-actions{display:flex;flex-direction:column;align-items:center;gap:9px;margin-top:14px}
.team-request .team-consent-actions button{display:flex;align-items:center;justify-content:center;gap:10px;width:min(100%,260px);min-height:46px;margin:0;padding:9px 16px;border-radius:10px;box-sizing:border-box}
.team-request .team-consent-accept{background:linear-gradient(135deg,#234d42,#102e28);border:1px solid #74bb92;color:#dbf8e6}
.team-request .team-consent-decline{background:linear-gradient(135deg,#502c34,#311a24);border:1px solid #c77c85;color:#ffe0e1}
.team-consent-icon{display:grid;place-items:center;width:25px;height:25px;flex:0 0 25px;border-radius:50%;background:#ffffff0c}.team-consent-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.team-consent-accept .team-consent-icon{color:#a5e6b9}.team-consent-decline .team-consent-icon{color:#ffa8ab}
.team-request .team-consent-actions button:hover:not(:disabled){filter:brightness(1.15)}

/* Small identity card during a field change; it never blocks the board. */
#teamFieldNotice[hidden]{display:none!important}
#teamFieldNotice{position:fixed;z-index:45;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:13px;width:min(340px,calc(100vw - 28px));box-sizing:border-box;padding:13px 17px;border:1px solid #edcc80;border-radius:13px;background:linear-gradient(135deg,#18324aee,#071622f5);box-shadow:0 9px 35px #0009,0 0 16px #e3bf5526;color:#fff0c9;pointer-events:none;animation:fieldNoticeIn .18s ease-out}
#teamFieldNotice[data-side=partner]{border-color:#77d7cf;box-shadow:0 9px 35px #0009,0 0 16px #59c9cb26}
#teamFieldNotice[data-side=enemy]{border-color:#d9908c}
#teamFieldNotice>div{display:grid;gap:3px;min-width:0}#teamFieldNotice strong{font:700 19px/1.2 Georgia,serif;overflow-wrap:anywhere}.field-notice-label{font:700 10px/1.3 system-ui;letter-spacing:.13em;color:#e5cb94}#teamFieldNotice[data-side=partner] .field-notice-label{color:#a2e8de}.field-notice-opponent{font:12px/1.3 system-ui;color:#c6d7e4}.field-notice-status{font:11px/1.3 system-ui;color:#aac1cb}
.field-notice-emblem{display:grid;place-items:center;flex:0 0 43px;width:43px;height:43px;border:1px solid currentColor;border-radius:50%;color:#edcc80}.field-notice-emblem svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}#teamFieldNotice[data-side=partner] .field-notice-emblem{color:#91dcd3}#teamFieldNotice.is-loading .field-notice-emblem{animation:fieldNoticeLoading 1.2s ease-in-out infinite alternate}
@keyframes fieldNoticeIn{from{opacity:0;translate:0 -7px}to{opacity:1;translate:0 0}}@keyframes fieldNoticeLoading{to{box-shadow:0 0 15px #d6dc9a66}}
@media(prefers-reduced-motion:reduce){#teamFieldNotice,#teamFieldNotice.is-loading .field-notice-emblem{animation:none}}

/* Labels sit above their fields; action buttons share the field baseline. */
#lobby.team-lobby .team-name-form{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;margin:0 0 14px}
#lobby.team-lobby .team-name-form label{display:grid;gap:5px;margin:0;padding:0;min-width:0}
#lobby.team-lobby .team-name-form input,#lobby.team-lobby .team-name-form>button{box-sizing:border-box;height:44px;min-height:44px;margin:0;align-self:end}
#lobby.team-lobby .team-name-form>button{width:auto;line-height:1.2;padding:8px 12px}
#lobby.team-lobby #lobbyInviteRow{display:grid;grid-template-columns:minmax(0,1fr) auto 56px;align-items:end;gap:10px}
#lobby.team-lobby #lobbyInviteRow>p{grid-column:1/-1;max-width:none;margin:0 0 2px}
#lobby.team-lobby #lobbyInviteRow .team-difficulty{grid-column:auto;display:grid;gap:5px;min-width:0;width:100%;max-width:220px;margin:0;padding:0;font:12px/1.3 system-ui,sans-serif}
#lobby.team-lobby #lobbyInviteRow .team-difficulty select{box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:44px;min-height:44px;margin:0;padding:8px;border-radius:10px}
#lobby.team-lobby #lobbyInviteRow>button{box-sizing:border-box;height:44px;min-height:44px;margin:0;align-self:end;white-space:nowrap}
#lobby.team-lobby #lobbyInviteRow:has(#openLobbyInvite.hidden){grid-template-columns:minmax(0,1fr) 56px}
@media(max-width:420px){#lobby.team-lobby #lobbyInviteRow{gap:8px}#lobby.team-lobby #openLobbyInvite{padding:8px 10px;font-size:12px}#lobby.team-lobby .team-name-form>button{padding:8px;font-size:12px}}

/* A compact, optional tactical map only on phones. */
.team-field-tools{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0}.team-field-tool-buttons{display:flex;align-items:center;justify-content:center;gap:12px}.team-minimap-toggle,.team-minimap{display:none}.team-minimap[hidden],.team-minimap-toggle[hidden]{display:none!important}
@media(max-width:759px){
 #game.team-game .team-minimap-toggle{display:grid;place-items:center;width:38px;min-width:38px;height:38px;min-height:38px;margin:0;padding:8px;border:1px solid #c5b57f;border-radius:50%;background:linear-gradient(#254558,#0b2335);color:#f2dc9e;box-sizing:border-box}.team-minimap-toggle svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7}.team-minimap-toggle[aria-expanded=true]{border-color:#82d6cd;color:#b7f1e5}
 #game.team-game .team-minimap{display:block;box-sizing:border-box;width:min(294px,calc(100vw - 65px));padding:11px;border:1px solid #9ab6a282;border-radius:11px;background:#071b29eb;box-shadow:inset 0 1px #ffffff0c}.team-minimap-heading{margin:0 0 9px;text-align:center;color:#edd9a2;font:600 11px/1.3 system-ui}
 #game.team-game .team-minimap-preview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%;min-width:0;min-height:0;margin:0;padding:0;border:0;background:none;box-shadow:none;text-align:center;color:#e5eced;transform:none;white-space:normal}.minimap-player{display:flex;flex-direction:column;min-width:0;gap:3px}.minimap-player-label{color:#a4c2cb;font:10px/1.2 system-ui}.minimap-player>strong{font:600 11px/1.3 system-ui;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.minimap-health{color:#f4b3a9;font:600 10px/1.2 system-ui}
 .minimap-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:2px;margin-top:4px}.minimap-cell{display:grid;place-items:center;aspect-ratio:1;min-width:0;box-sizing:border-box;border:1px solid #3c5660;border-radius:2px;background:#0d2733;font:700 8px/1 system-ui;color:#102535;overflow:hidden}.minimap-cell[data-kind=single],.minimap-cell[data-kind=active]{background:var(--mini-chip);border-color:#f6e2ae77}.minimap-cell[data-kind=active]{outline:1px solid #fce19b;outline-offset:-2px}.minimap-cell[data-kind=wall]{background:#587381;color:#f4e3bc}.minimap-cell[data-kind=builder]{background:#a78e65;color:#fff0ca}.minimap-cell[data-kind=building]{background:#6c897b;color:#f7e5ac;font-size:13px}.team-minimap-legend{margin:9px 0 0;text-align:center;font:9px/1.5 system-ui;color:#a8bec8}
 #game.team-game .team-minimap-preview:focus-visible,#game.team-game .team-minimap-toggle:focus-visible{outline:2px solid #ffe1a0;outline-offset:4px}
}

@media(max-width:759px){#game.team-game .team-minimap-preview .minimap-player{display:flex;flex-direction:column;gap:3px;min-width:0;width:100%;height:auto;min-height:0;margin:0;padding:5px;border:1px solid #486272;border-radius:6px;background:#0c2330;box-shadow:none;color:#e5eced;transform:none;text-align:center}#game.team-game .team-minimap-preview .minimap-player[aria-pressed=true]{border-color:#f0d58d;box-shadow:0 0 0 1px #f0d58d55}#game.team-game .team-minimap-preview .minimap-player[data-player]:last-child[aria-pressed=true]{border-color:#8cded2;box-shadow:0 0 0 1px #8cded255}#game.team-game .minimap-player:focus-visible{outline:2px solid #ffe1a0;outline-offset:3px}.minimap-player .minimap-grid{width:100%}}

/* Give the upper battlefield a little breathing room above the separator. */
#game #battlefield>.top-area,#game.team-game #battlefield>.player-area[data-preview-own="false"]{margin-bottom:6px}

/* The same target selector appears in the card hand and in the card preview. */
select.team-spell-target {
  box-sizing:border-box;
  color-scheme:dark;
  color:#fff0cb;
  border:1px solid #aa8950;
  border-radius:9px;
  background:linear-gradient(#20394e,#102233);
  box-shadow:inset 0 1px #ffffff12;
  min-height:40px;
  min-width:0;
  width:100%;
  padding:7px 10px;
  font:600 14px/1.3 system-ui,sans-serif;
}
select.team-spell-target option {background:#142a3b;color:#fff0cb}
select.team-spell-target:focus-visible {outline:2px solid #f1cb80;outline-offset:2px}

@media (max-width:700px) {
  #lobby.team-lobby #players {grid-template-columns:minmax(0,1fr);gap:14px}
  #lobby.team-lobby .team-lobby-group {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  #lobby.team-lobby .team-lobby-group h3,
  #lobby.team-lobby .team-name-form {grid-column:1/-1;margin:0;overflow-wrap:anywhere}
  #lobby.team-lobby .team-name-form {grid-template-columns:minmax(0,1fr);gap:6px}
  #lobby.team-lobby .team-name-form>button {width:100%}
  #lobby.team-lobby .playerrow {
    box-sizing:border-box;
    display:flex;
    flex-flow:column nowrap;
    align-items:center;
    align-self:stretch;
    gap:8px;
    min-width:0;
    min-height:240px;
    margin:0;
    padding:12px 8px;
    text-align:center;
  }
  #lobby.team-lobby .lobby-player-avatar,
  #lobby.team-lobby .lobby-empty-avatar {
    box-sizing:border-box;
    flex:none;
    width:clamp(52px,15vw,72px);
    height:clamp(52px,15vw,72px);
    margin:0;
  }
  #lobby.team-lobby .lobby-empty-avatar {
    display:grid;
    place-items:center;
    font:400 30px/1 system-ui,sans-serif;
  }
  #lobby.team-lobby .player-identity {flex:0 1 auto;width:100%;min-width:0}
  #lobby.team-lobby .player-identity b,
  #lobby.team-lobby .playerrow>strong {font-size:17px;line-height:1.2;overflow-wrap:anywhere}
  #lobby.team-lobby .player-identity small {font-size:13px;line-height:1.35}
  #lobby.team-lobby .team-seat-actions {display:grid;width:100%;gap:6px;margin-top:auto}
  #lobby.team-lobby .team-seat-actions button,
  #lobby.team-lobby .playerrow>button:not(.seat-invite) {
    box-sizing:border-box;width:100%;min-height:44px;margin:0;padding:6px;
    white-space:normal;overflow-wrap:anywhere;font:600 13px/1.25 system-ui,sans-serif;
  }
  #lobby.team-lobby .playerrow:has(.lobby-player-avatar) {justify-content:center;gap:5px}
  #lobby.team-lobby .lobby-player-avatar {
    width:clamp(64px,19vw,86px);height:clamp(64px,19vw,86px);object-fit:cover;
  }
}
