html[data-player-layout="portrait"] :is(#tcn-mobile .tc-shell,#app > .wrap,.policy){max-inline-size:min(100%,520px);margin-inline:auto}
html[data-player-layout="portrait"] #tcn-mobile :is(.tc-header,.tc-bottom){padding-inline:max(12px,env(safe-area-inset-left))}
html[data-player-layout="portrait"] #tcn-mobile .tc-catalogue{grid-template-columns:repeat(2,minmax(0,1fr))}
html[data-player-layout="landscape"] #tcn-mobile .tc-main{max-width:min(1080px,100%);padding-inline:clamp(12px,3vw,32px)}
html[data-player-layout="landscape"] #tcn-mobile .tc-catalogue{grid-template-columns:repeat(auto-fit,minmax(min(135px,44%),1fr))}
html[data-player-layout="landscape"] #tcn-mobile .tc-hero{max-height:clamp(150px,43dvh,370px)}
html[data-player-layout="landscape"] #tcn-mobile .tc-fixture-strip{grid-auto-columns:minmax(190px,40%)}
@media(min-width:640px){
html[data-player-layout="landscape"] #tcn-mobile .tc-home-categories{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}
html[data-player-layout="landscape"] #tcn-mobile .tc-league-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px}
}
@media(max-height:520px){
html[data-player-layout] #tcn-mobile .tc-header{height:44px}
html[data-player-layout] #tcn-mobile .tc-navbtn{min-height:44px}
html[data-player-layout] .login-page{overflow-y:auto}
}
html[data-player-layout="portrait"].game-viewport #app{max-width:min(100%,max(360px,72dvh));margin-inline:auto}
html[data-player-layout="portrait"].game-viewport #app > #main{overflow:auto}
html[data-player-layout="portrait"] :is(.tc-profile-info,.tc-member-page){overflow-wrap:anywhere}

html[data-player-layout="portrait"] body:has(>.game .flight),
html[data-player-layout="portrait"] body:has(>.site-top),
html[data-player-layout="portrait"] body:has(main .discovery-grid){max-width:520px;margin-inline:auto}
html[data-player-layout="portrait"] body.policy{max-width:540px}
html[data-player-layout="portrait"] #tcn-mobile .tc-shell{width:min(100%,520px)}
html[data-player-layout="portrait"] #tcn-mobile .tc-main{width:100%;box-sizing:border-box}
html[data-player-layout="portrait"] #tcn-mobile .tc-home-categories{display:block}
html[data-player-layout="landscape"].tcn-mobile-preview #tcn-mobile{width:100%;max-width:none}
html[data-player-layout="landscape"] body.mobile-preview:has(.flight){max-width:none}
html[data-player-layout="landscape"] .policy{max-width:78ch}
html[data-player-layout="portrait"] .platform-panel{display:flex;flex-flow:column;align-items:stretch}
html[data-player-layout="portrait"] .hero-inner{grid-template-columns:1fr}
@media(min-width:640px){
html[data-player-layout="landscape"] #overlay .login-panel{display:grid;width:min(810px,94%);grid-template-columns:minmax(130px,.6fr) minmax(280px,1.4fr);gap:18px;align-items:center}
html[data-player-layout="landscape"] .login-page .login-mast{margin:0}
html[data-player-layout="landscape"] #tcn-mobile .tc-member-page{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
html[data-player-layout="landscape"] #tcn-mobile .tc-member-page>h1{grid-column:1/-1}
}
@media(orientation:landscape) and (max-height:540px){
html[data-player-layout="landscape"] #overlay .login-page{padding-block:48px 12px}
html:not([data-player-layout="portrait"]) body:has(>.game .flight) .board{grid-template-columns:minmax(0,1.1fr) minmax(250px,1fr)}
html:not([data-player-layout="portrait"]) body:has(>.game .flight) .flight{height:clamp(152px,54dvh,270px)}
}
.layout-reel-actions{display:none}
@media(min-aspect-ratio:3/2) and (max-height:650px) and (min-width:520px){
html:not([data-player-layout="portrait"]) body:has(>.layout-reel-actions) {
 display:flex;align-items:center;justify-content:center;gap:clamp(10px,3vw,46px)
}
html:not([data-player-layout="portrait"]) .layout-reel-actions{
 display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));align-content:center;
 width:clamp(140px,25vw,240px);max-height:90dvh;overflow:auto;z-index:1
}
.layout-reel-actions button{box-sizing:border-box;min-height:44px;padding:7px;border:1px solid #818080;border-radius:10px;background:#222529;color:#fff;font:600 14px/1.25 system-ui}
.layout-reel-actions button:first-child{grid-column:1/-1;background:#233f60}
.layout-reel-actions button:disabled{opacity:.45}
body:has(#cover:not([hidden]),#entrance:not([hidden]),dialog[open]) .layout-reel-actions{visibility:hidden}
}

@media(min-width:640px) and (max-height:520px){
html:not([data-player-layout="portrait"]) #tcn-mobile .es-sports{
 display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 16px
}
html:not([data-player-layout="portrait"]) #tcn-mobile .es-sports>h1{font-size:24px;margin:0}
html:not([data-player-layout="portrait"]) #tcn-mobile .es-sports>.tc-sports-channels{margin:0}
html:not([data-player-layout="portrait"]) #tcn-mobile .es-sports>:nth-child(n+3){grid-column:1/-1}
html:not([data-player-layout="portrait"]) #tcn-mobile .tc-main{padding-block:8px 16px}
html:not([data-player-layout="portrait"]) #tcn-mobile .tc-featured-fixtures h2{font-size:16px;margin:0 0 4px}
html:not([data-player-layout="portrait"]) #tcn-mobile .tc-fixture{min-height:78px;padding-block:8px}
}

/* A touch browser may decline a physical orientation lock. Turn document and
   lobby layouts together, keeping scroll, forms and the navigation in one plane. */
@media (orientation:portrait) and (pointer:coarse){
html[data-player-layout="landscape"]:not(.game-viewport) body:is(.policy,.tcn-return,:has(#tcn-mobile,.login-page,#lobby[aria-label="练习游戏"],.site-top,.game>.flight,.game .flight)){
 position:fixed;inset:0 auto auto 0;box-sizing:border-box;width:100dvh;height:100dvw;
 min-height:0;max-width:none;margin:0;transform-origin:0 0;transform:translateX(100dvw) rotate(90deg);overflow:auto
}
html[data-player-layout="landscape"] :is(#sportsRoot,#tcn-mobile,#tcn-mobile .tc-shell){width:100%;max-width:none;height:100dvw;min-height:0}
html[data-player-layout="landscape"] #tcn-mobile .tc-main{box-sizing:border-box;width:100%;padding:8px 16px 16px}
html[data-player-layout="landscape"] #tcn-mobile .tc-hero{max-height:43dvw}
html[data-player-layout="landscape"] #tcn-mobile .tc-catalogue{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}
html[data-player-layout="landscape"] .login-page{max-height:100dvw}
}
