/* Responsive layout layer: loaded after the desktop theme and pack artwork. */
.mobile-menu-toggle{display:none}
.squad-rules{margin-bottom:20px}.squad-rules summary{padding:10px 0}.squad-rules p{margin-top:12px}
@media (max-width:800px){
 html{scroll-padding-top:64px}
 body.cards-app{min-height:100dvh;background-attachment:scroll}
 .cards-layout{grid-template-columns:minmax(0,1fr)}
 .cards-topbar{padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left));min-height:60px;gap:8px}
 .cards-topbar .brand{flex:none;padding:0;min-height:44px}
 .cards-topbar .brand-mark{width:34px;height:34px;font-weight:700;box-shadow:none;border-radius:8px}
 .topbar-right{gap:6px;min-width:0}.cards-topbar .club-chip{display:none}
 .cards-topbar .wallet{gap:6px;font-size:13px;font-weight:600;white-space:nowrap}
 .wallet>span{padding:7px 8px;gap:4px}.cards-topbar .wallet .pts{display:inline-flex;font-size:12px}
 .cards-topbar .account-chip{min-height:44px;font-size:12px;padding:8px}
 .cards-topbar .icon-btn{width:44px;min-height:44px;justify-content:center;padding:8px}
 .cards-topbar .icon-btn span{display:none}
 .cards-sidebar{position:sticky;top:0;padding:4px max(10px,env(safe-area-inset-right)) 4px max(10px,env(safe-area-inset-left));height:auto;overflow:visible;z-index:7;background:#0c1322;border-bottom:1px solid var(--line)}
 .mobile-menu-toggle{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;border:0;background:none;color:var(--text);padding:8px 4px;font-size:14px;font-weight:600;border-radius:0}
 .mobile-menu-toggle>.ic{color:var(--accent2)}.menu-label{margin-left:auto;display:flex;align-items:center;gap:8px;color:#b9c8db;font-size:13px}
 .cards-sidebar nav{display:none;margin:0;overflow:visible;gap:6px;padding:4px 0 10px}
 .cards-sidebar.menu-open nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));max-height:calc(100dvh - 124px);overflow-y:auto}
 .cards-sidebar nav button{min-width:0;min-height:48px;padding:10px;gap:8px;font-size:13px;border-radius:8px;white-space:normal;text-align:left}
 .cards-sidebar nav button.selected{box-shadow:inset 3px 0 0 var(--accent);padding-left:10px}
 .cards-sidebar .nav-badge{min-width:18px;padding:0 5px;font-weight:600;font-size:11px}
 #cards-main{padding:20px max(12px,env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));min-width:0}
 #cards-main>*,.cards-panel>*,.card-inspect>*,.lineup-slot,.squad-layout>div,.play-hero>div{min-width:0}
 .cards-heading{gap:6px;margin-bottom:18px}.cards-heading h1{font-size:25px;font-weight:700}.cards-heading>span{font-size:12px}
 .cards-panel,.panel{padding:16px;border-radius:12px;box-shadow:none}
 .cards-panel h2{font-size:18px;font-weight:700}.panel-title{gap:10px}.panel-title>span{line-height:1.5}
 button,input,select{min-height:44px;border-radius:8px}
 input,select{width:100%;font-size:16px;padding:10px 9px}
 button{touch-action:manipulation;font-weight:600}
 button.primary{font-weight:700;box-shadow:none}
 .btn-row,.actions{gap:8px;flex-wrap:wrap}.actions>button{flex:1 1 130px}
 .btn-row>button{font-size:12px;padding:10px}
 /* Keep welcome copy in a real single column; desktop's late theme rule used to overlap it with cards. */
 .cards-welcome{display:flex;flex-direction:column;align-items:stretch;padding:24px 18px;gap:24px;min-height:100dvh}
 .welcome-copy{min-width:0;gap:8px}.cards-welcome .brand{margin:0 0 18px}
 .cards-welcome h1{font-size:clamp(34px,9vw,48px);font-weight:700;line-height:1.08;max-width:560px}
 .cards-welcome .lede{font-size:15px;line-height:1.65;margin-bottom:8px}
 .cards-welcome .feature-list{gap:6px}.feature-list li{font-size:12px;padding:6px 10px}
 .cards-welcome form{display:flex;flex-direction:column;width:100%;max-width:none;align-items:stretch;margin:12px 0}
 .cards-welcome form input{font-size:16px}.cards-welcome form button{justify-content:center}
 .welcome-alt .link-btn{display:block;min-height:44px;margin:0;text-align:left;line-height:1.5;padding:8px 0}
 .welcome-cards{order:0;flex:none;min-width:0;width:100%;height:280px;overflow:hidden}
 .welcome-cards .fan{height:235px}.welcome-cards .fan-0{transform:translateX(-75px) translateY(12px) rotate(-8deg)}.welcome-cards .fan-2{transform:translateX(75px) translateY(12px) rotate(8deg)}
 .home-hero{padding:20px 16px;border-radius:12px;gap:8px}
 .hero-copy{gap:14px}.hero-copy h1{font-size:30px;font-weight:700}.hero-stats b{font-weight:700}
 .hero-actions{display:grid;grid-template-columns:minmax(0,1fr)}.hero-actions button.big{min-height:48px;white-space:normal}
 .hero-cards{height:260px;overflow:hidden}.hero-cards .fan-0,.hero-cards:hover .fan-0{transform:translateX(-68px) translateY(12px) rotate(-8deg)}.hero-cards .fan-2,.hero-cards:hover .fan-2{transform:translateX(68px) translateY(12px) rotate(8deg)}
 .eyebrow,.tile-head small{letter-spacing:0;text-transform:none;font-weight:600}
 .tile{border-radius:12px}.tile-head b{font-weight:600}.tile .streak{gap:3px}.tile .streak span{font-size:12px;font-weight:600}
 .collection-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:18px;align-items:end}
 .collection-tools label{min-width:0;font-size:12px}.collection-tools label:first-child{grid-column:1/-1}.collection-tools>span{grid-column:1/-1;padding:2px 0}
 .collection-tools input{width:100%}.collection-tools select{font-size:14px}
 .card-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 10px}
 .collectible{width:100%;min-width:0}.collectible>img{height:145px}
 .card-name{min-height:0;padding:9px 7px}.card-name>button{min-height:44px;line-height:1.3;overflow-wrap:anywhere}
 .card-top{padding:7px 6px;gap:5px!important}.card-top>strong{font-size:22px}.card-top>span{font-size:12px}.card-top>b{font-size:9px}
 .card-skills{flex-wrap:wrap;gap:4px;font-size:9px}.extra-actions{flex-wrap:wrap}.extra-actions button{flex:1;font-size:11px;padding:6px}
 .sets-grid{grid-template-columns:minmax(0,1fr)}.set-cards{grid-template-columns:repeat(6,minmax(0,1fr))}.series-head{font-size:20px}.series-head small{display:block;font-size:12px;margin-top:6px}
 /* Roster comes first; compact player rows keep all three selections close together. */
 .squad-layout{display:flex;flex-direction:column;gap:16px}.squad-layout>div:last-child{order:-1}
 .squad-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:20px}
 .lineup-slot{display:grid;grid-template-columns:108px minmax(0,1fr);column-gap:12px;align-content:start;align-items:start}
 .lineup-slot h3{grid-column:1/-1;margin:0 0 12px;font-size:13px}
 .lineup-slot>.collectible{grid-column:1;grid-row:2/10;margin:0;max-width:108px}
 .lineup-slot>.collectible>img{height:96px}.lineup-slot .collectible .card-top{height:44px;padding:5px;gap:4px!important}.lineup-slot .collectible .card-top>span{font-size:10px}.lineup-slot .collectible .card-top>b{font-size:8px}.lineup-slot .collectible .card-top>strong{font-size:18px}
 .lineup-slot .collectible .card-top strong small{font-size:7px}.lineup-slot .collectible .card-name{padding:6px 5px}.lineup-slot .collectible .card-name>button{font-size:11px;min-height:36px}.lineup-slot .collectible .card-name small{font-size:8px;line-height:1.4}
 .lineup-slot .collectible .card-skills,.lineup-slot .collectible .ability-chips{display:none}
 .lineup-slot .trait-pills b{display:none}.lineup-slot .trait-pills .tp{padding-right:0}
 .lineup-slot>:not(.collectible):not(h3){grid-column:2;width:100%;margin:0 0 10px}
 .lineup-slot .xp-line{text-align:left;font-size:11px}.lineup-slot .career-line{font-size:11px;line-height:1.5}
 .lineup-slot label{gap:8px}.lineup-slot select{font-size:14px;width:100%;max-width:100%}.lineup-slot .energy{font-size:11px}
 .lineup-slot .rest-btn{font-size:11px;white-space:normal;padding:8px}
 .chem{margin-top:0;font-size:12px}.squad-rules{font-size:13px;margin-bottom:16px}.squad-rules summary{min-height:44px;line-height:1.5}.squad-rules p{line-height:1.6}
 .squad-builder .panel-title{align-items:start}.trait-guide{grid-template-columns:minmax(0,1fr)}.tg button{min-height:44px}
 .play-hero{grid-template-columns:minmax(0,1fr);gap:16px}.play-options{flex-wrap:wrap}.play-options>*{min-width:0;max-width:100%}
 .circuit-grid{grid-template-columns:minmax(0,1fr);gap:12px}.circuit-grid>section.circuit{padding:16px;border-radius:12px}.circuit button{width:100%;min-height:48px}
 .versus-panel{grid-template-columns:minmax(0,1fr)}.versus-pick{min-width:0}.versus-pick button{width:100%}
 .track{grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.track-head{flex-direction:column;align-items:stretch;gap:12px}.track .tier{min-width:0}
 table{display:table;white-space:normal;overflow:visible;table-layout:fixed;font-size:12px}
 th,td{padding:10px 6px;overflow-wrap:anywhere}td button{min-height:44px;white-space:normal;padding:6px;font-size:11px}
 .box-score{table-layout:auto}.box-score th,.box-score td{font-size:10px;padding:6px 3px}
 dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);padding:16px;border-radius:12px;overscroll-behavior:contain}
 .dialog-close{position:sticky;top:0;z-index:4;min-height:44px;background:var(--panel2)}
 .card-inspect{display:flex;flex-direction:column;gap:20px}.card-inspect>.collectible{width:180px;max-width:180px;margin:auto}
 .card-inspect section{width:100%;min-width:0}.career{table-layout:auto}.career td,.career th{font-size:9px;padding:6px 2px}.career small{font-size:8px}
 .train{flex-direction:column;align-items:stretch}.train label{min-width:0}.train select{font-size:14px}
 .auth-forms,.sync-choice{grid-template-columns:minmax(0,1fr)}.auth-forms form{min-width:0;padding:12px}
 #rename-club{flex-direction:column;align-items:stretch;gap:12px}#rename-club label{width:100%}
 .shop-head{align-items:start}.shop-head .pts-big{font-size:24px;flex:none}
 #cards-toast{width:calc(100% - 24px);max-width:500px;bottom:calc(12px + env(safe-area-inset-bottom));padding:12px;font-size:13px;overflow-wrap:anywhere}
 .po-stage{padding-top:64px;padding-bottom:calc(16px + env(safe-area-inset-bottom));gap:18px;overscroll-behavior:contain}
 .po-pack{margin-top:0;flex:none}.po-cards{flex:none}.po-top{font-size:12px;letter-spacing:0;font-weight:600}
 .po-actions{width:100%;max-width:440px;background:#0b1322;border:1px solid var(--line);border-radius:8px;padding:8px;flex:none;z-index:3;margin-top:auto}
 .po-actions button{font-size:13px;min-height:44px}.po-open-label{padding-bottom:12px}
}
@media (max-width:359px){
 .cards-topbar .wallet .pts{display:none}
 .cards-topbar .wallet>span{padding:7px 6px}
 .lineup-slot{grid-template-columns:96px minmax(0,1fr);gap:10px}
 .lineup-slot>.collectible{max-width:96px}.lineup-slot select{font-size:13px}
 .collectible>img{height:125px}.card-top>b{font-size:8px}
}
@media (max-height:500px) and (max-width:1000px){
 .cards-topbar{position:static}.cards-sidebar{position:static}
 .po-stage{justify-content:flex-start;overflow-y:auto;padding-top:58px}
 .po-pack .pack-art{width:150px;height:200px}.po-actions{position:sticky;bottom:0}
}
@media (prefers-reduced-motion:reduce){.pulse,.collectible.holo::after{animation:none}.fan,.pack-tile{transition:none}}
@media (max-width:800px){
 /* iOS zooms focused form fields below 16px. */
 .collection-tools select,.lineup-slot select,.train select{font-size:16px}
 .page-squad>.cards-panel:last-child th:first-child{width:25%}
 .page-squad>.cards-panel:last-child th:nth-child(2){width:21%}
}
@media (min-width:801px) and (max-width:1100px){
 .cards-welcome{grid-template-columns:minmax(0,1fr);max-width:760px;gap:30px;padding:36px 30px}
 .welcome-cards{height:440px;min-width:0;overflow:hidden}
}

/* Account-only entry: keep authentication forms within the welcome column. */
.cards-welcome .auth-forms{grid-template-columns:minmax(0,1fr);min-width:0;max-width:520px;gap:12px}
.cards-welcome .auth-forms form{display:flex;flex-direction:column;align-items:stretch;max-width:none;width:100%;margin:0;gap:12px}
.cards-welcome .auth-forms form label{flex:initial}
.cards-welcome .auth-forms h3{font-weight:600}
.cards-welcome .auth-forms button{white-space:normal}
.public-home{max-width:1180px;margin:40px auto;padding:28px;border-top:1px solid var(--line)}
.public-home h2{font-size:26px;font-weight:600}.public-home h3{font-size:19px;font-weight:600}.public-home p{color:var(--muted);line-height:1.7;max-width:900px}
.public-home-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px;margin:32px 0}.public-home a{color:#9cc8fb}.public-home nav{display:flex;gap:20px;flex-wrap:wrap;margin-top:26px}.public-home article{min-width:0}
@media(max-width:800px){.public-home-grid{grid-template-columns:minmax(0,1fr)}.public-home{padding:20px}}
.cards-topbar img.brand-mark{width:32px;height:34px;background:none;border-radius:0}
