body.rail-shell .shell{max-width:1600px;width:100%;padding:0 28px;min-height:100dvh}body.rail-shell .train-tabs{display:flex;align-items:center;gap:16px;min-height:64px;border-bottom:1px solid var(--line)}.train-tabs #profile{margin-left:auto}.train-tabs #home{font-size:16px}.train-tabs #mode-name{color:var(--muted)}body.rail-shell #chips{display:none}body.rail-shell #app-bar .brand{font-size:16px;letter-spacing:0}#shellMenu #sound,#shellMenu #language{width:100%;text-align:left;justify-content:flex-start}body.rail-shell main{padding:0;animation:none}body.rail-shell .game-screen{padding-top:16px}@media(max-width:899px){body.rail-shell .shell{padding:0 14px 90px}body.rail-shell .train-tabs{min-height:52px}body.rail-shell .train-workspace{min-height:0}}
.train-tabs button{min-height:44px;scroll-margin-top:76px}#shellMenu #arcade-profile-controls{display:contents}
@media(max-width:899px) and (max-height:600px) and (orientation:landscape){body.rail-shell #mode-navigation{max-height:calc(100svh - 58px);overflow-y:auto}}
@media(max-width:899px){html{scroll-padding-top:76px;scroll-padding-bottom:76px}body.rail-shell .shell{min-height:calc(100dvh - 136px)}body.rail-shell #game-screen .coach:has(.solver-panel:not([hidden])){bottom:64px}.train-tabs{position:relative}}
@media(max-width:899px){body.rail-shell #app-bar.top{flex-wrap:nowrap}body.rail-shell #app-bar .rail-foot{flex-shrink:0}body.rail-shell #importSlot:empty{display:none}}
@media(max-width:899px) and (max-height:600px) and (orientation:landscape){
 body.rail-shell .train-tabs{position:fixed;top:8px;left:150px;right:112px;min-height:44px;height:44px;z-index:41;border:0}
 body.rail-shell .train-workspace{padding-top:6px;grid-template-columns:160px minmax(0,1fr);gap:14px}
 body.rail-shell #game-screen{padding-top:0}
 body.rail-shell #game-screen .arena{display:grid;grid-template-columns:minmax(0,1fr) 124px;gap:0 8px}
 body.rail-shell #game-screen .arena-top{grid-column:1/-1}
 body.rail-shell #game-screen .diamond-table{height:200px;min-height:200px;max-height:200px;aspect-ratio:auto}
 body.rail-shell #game-screen .diamond-table #hero-cards .card{height:50px;width:36px}
 body.rail-shell #game-screen .diamond-table #hero-cards .card-corner{font-size:12px}
 body.rail-shell #game-screen .diamond-table #hero-cards .card-suit{font-size:22px}
 body.rail-shell #game-screen .diamond-table #hero-cards .card-bottom{display:none}
 body.rail-shell #game-screen .decision-area{padding-top:0;align-self:start;margin-top:-16px}
 body.rail-shell #game-screen .actions{flex-direction:column;gap:4px}
 body.rail-shell #game-screen .action{min-height:44px;min-width:0;width:100%;padding:4px}
 body.rail-shell #run-progress{padding-bottom:6px}
 body.rail-shell #title-screen{max-height:calc(100dvh - 140px);overflow-y:auto}
}
@media(max-width:700px) and (max-height:600px) and (orientation:portrait){
 body.rail-shell #app-bar .brand{font-size:12px}
 body.rail-shell .train-tabs{position:fixed;top:8px;left:120px;right:108px;min-height:44px;height:44px;gap:4px;z-index:41;border:0}
 .train-tabs #mode-name{display:none}body.rail-shell .train-tabs #home{font-size:0;min-width:28px;padding:4px}.train-tabs #profile{font-size:10px;padding:4px;min-width:44px}
 body.rail-shell .train-workspace{padding-top:8px}
 body.rail-shell #game-screen{padding-top:0}
 body.rail-shell #game-screen .diamond-table{height:270px;min-height:270px;max-height:270px;aspect-ratio:auto}
 body.rail-shell #run-progress{padding-bottom:6px}
 body.rail-shell #game-screen .decision-area{padding-top:8px}
 body.rail-shell #game-screen .actions{flex-wrap:nowrap}
 body.rail-shell #game-screen .action{min-width:0;flex:1}
}
@media(max-width:899px){
 body.rail-shell:has(#game-screen:not([hidden])) .shell{min-height:calc(100dvh - 136px);height:auto;padding:0 14px}
}
@media(max-width:700px){
 body.rail-shell[data-mode=rush].correcting #game-screen .diamond-table{height:200px;min-height:200px;max-height:200px;aspect-ratio:auto}
}
@media(max-width:700px) and (max-height:600px){
 body.rail-shell[data-mode=rush] #game-screen .diamond-table{height:140px;min-height:140px;max-height:140px;aspect-ratio:auto}
}
@media(max-width:899px) and (max-height:600px) and (orientation:landscape){
 body.rail-shell:has(#game-screen:not([hidden])) .shell{min-height:0}
 body.rail-shell #title-screen{min-height:0}
}
@media(max-width:700px) and (max-height:600px) and (orientation:portrait){
 body.rail-shell{padding:44px 0 56px}
 body.rail-shell #app-bar.top{height:44px;padding:0 8px}
 body.rail-shell #app-bar .nav{height:48px;padding:0}
 body.rail-shell #app-bar .nav .navlink{height:44px;gap:2px;font-size:8px}
 body.rail-shell .train-tabs{top:0}
 body.rail-shell:has(#game-screen:not([hidden])) .shell{min-height:calc(100dvh - 100px)}
 body.rail-shell .train-workspace{gap:8px}
 body.rail-shell #game-screen .arena-top{margin-bottom:0}
 body.rail-shell[data-mode=rush].correcting #game-screen .diamond-table{height:140px;min-height:140px;max-height:140px}
}
@media(max-width:700px){
 body.rail-shell.correcting:is([data-mode=icm],[data-mode=reshove],[data-mode=nash]) #game-screen .diamond-table{height:200px;min-height:200px;max-height:200px;aspect-ratio:auto}
}
@media(max-width:700px) and (max-height:600px){body.rail-shell[data-mode=equity] #game-screen .diamond-table .opponent-seat{top:12%}}

#shellMenu #sound-label{display:inline}#shellMenu #sound-icon,#shellMenu #sound-icon svg{display:block;width:20px;height:20px;flex-shrink:0}
@media(max-width:899px) and (max-height:600px) and (orientation:landscape){
 body.rail-shell[data-mode=equity] #game-screen .diamond-table .opponent-seat{top:0}
}

/* Toute la correction reste au-dessus de la navigation, encoche comprise. */
@media(max-width:899px){
 body.rail-shell{--arcade-nav-height:64px}
 body.rail-shell:has(#solver-panel:not([hidden])){padding-bottom:calc(var(--arcade-nav-height) + env(safe-area-inset-bottom) + 16px)}
 body.rail-shell #app-bar .nav{height:calc(var(--arcade-nav-height) + env(safe-area-inset-bottom))}
 html{scroll-padding-bottom:calc(80px + env(safe-area-inset-bottom))}
}
@media(max-width:700px) and (max-height:600px) and (orientation:portrait){body.rail-shell{--arcade-nav-height:48px}}

/* Le verdict agrandi peut défiler au lieu d'être coupé par le shell. */
body.rail-shell:has(#game-screen:not([hidden])) .shell{height:auto;overflow:visible}
/* Desktop Train: the verdict fits the viewport instead of adding a page scrollbar. */
@media(min-width:900px){
 body.rail-shell{--grid-w:clamp(208px,calc(100dvh - 560px),260px)}
 body.rail-shell .train-workspace{padding-top:12px}
 body.rail-shell #run-progress{padding-bottom:10px}
 body.rail-shell #game-screen .decision-area{padding-top:12px}
 body.rail-shell:is([data-mode=fullhand],[data-mode=nash],[data-mode=reshove],[data-mode=icm]) #game-screen #solver-panel #range-grid{width:var(--grid-w);max-width:var(--grid-w)}
 body.rail-shell:is([data-mode=fullhand],[data-mode=nash],[data-mode=reshove],[data-mode=icm]) #game-screen #solver-panel .grid-cell{font-size:max(8px,calc(var(--grid-w)/29))}
}

/* Import progress takes its own row; keep the phone's dock below the table. */
@media(max-width:899px){
 body.rail-shell[data-screen=game]:has(#importNotice) .shell{height:auto;overflow:visible}
 body.rail-shell[data-screen=game]:has(#importNotice) #game-screen#game-screen .arena{height:auto;flex-direction:column;align-items:stretch;gap:12px}
 body.rail-shell[data-screen=game]:has(#importNotice) #game-screen#game-screen #table-stage{height:300px}
 body.rail-shell[data-screen=game]:has(#importNotice) #game-screen#game-screen .diamond-table{height:300px;min-height:300px;max-height:300px}
 body.rail-shell[data-screen=game]:has(#importNotice) #game-screen#game-screen :is(.decision-area,.coach){position:relative;inset:auto;height:auto;width:100%;padding:0}
}
