/* New elements are inert on desktop. Existing desktop rules remain unchanged. */
.rplay-mobile-navigation,.rplay-mobile-menu{display:none}
@media (max-width:820px), (hover:none) and (pointer:coarse) and (max-width:1180px) and (max-height:540px){
 body[data-mobile-shell="true"]{--rplay-mobile-nav-space:calc(86px + env(safe-area-inset-bottom,0px));padding-bottom:var(--rplay-mobile-nav-space);scroll-padding-bottom:var(--rplay-mobile-nav-space)}
 body[data-mobile-shell="true"] .rplay-mobile-navigation{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;position:fixed;z-index:40;bottom:0;left:0;right:0;width:100%;padding:8px max(10px,env(safe-area-inset-right,0px)) calc(10px + env(safe-area-inset-bottom,0px)) max(10px,env(safe-area-inset-left,0px));border-top:1px solid var(--color-border);background:var(--color-surface);box-shadow:0 -3px 16px rgba(23,32,51,.04)}
 body[data-mobile-shell="true"] .rplay-mobile-navigation>a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-width:0;min-height:62px;padding:9px 3px;border-radius:15px;color:var(--color-muted);font-size:.75rem;line-height:1.25;text-decoration:none}
 body[data-mobile-shell="true"] .rplay-mobile-navigation>a[aria-current="page"]{background:#e8effd;color:var(--color-primary);font-weight:700}
 body[data-mobile-shell="true"] .rplay-mobile-navigation svg{flex:none;width:22px;height:22px}
 body[data-mobile-shell="true"] .rplay-mobile-navigation a:focus-visible,body[data-mobile-shell="true"] .rplay-mobile-menu summary:focus-visible,body[data-mobile-shell="true"] .rplay-mobile-menu a:focus-visible,body[data-mobile-shell="true"] .rplay-mobile-menu button:focus-visible{outline:3px solid var(--color-primary);outline-offset:2px}
 body[data-mobile-shell="true"] .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px;margin-bottom:16px}
 body[data-mobile-shell="true"] .topbar .brand{grid-column:1;grid-row:1}
 body[data-mobile-shell="true"] .topbar .brand small{display:none}
 body[data-mobile-shell="true"] .topbar .brand strong{font-size:1rem}
 body[data-mobile-shell="true"] .topbar .public-nav,body[data-mobile-shell="true"] .topbar .top-actions{display:none}
 body[data-mobile-shell="true"] .topbar .topbar-search{grid-column:1/-1;grid-row:2;width:100%;max-width:none;margin:0;min-width:0}
 body[data-mobile-shell="true"] .topbar .topbar-search input{font-size:16px;min-height:44px}
 body[data-mobile-shell="true"] .rplay-mobile-menu{display:block;position:relative;grid-column:2;grid-row:1;justify-self:end;color:var(--color-text)}
 body[data-mobile-shell="true"] .rplay-mobile-menu summary{list-style:none;display:flex;align-items:center;justify-content:center;min-height:44px;padding:9px 12px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:11px;color:var(--color-primary);font-size:.75rem;font-weight:700;cursor:pointer}
 body[data-mobile-shell="true"] .rplay-mobile-menu summary::-webkit-details-marker{display:none}
 body[data-mobile-shell="true"] .rplay-mobile-menu-links{position:absolute;z-index:60;top:calc(100% + 8px);right:0;width:min(300px,calc(100vw - 32px));max-height:calc(100dvh - 230px);overflow-y:auto;overscroll-behavior:contain;padding:8px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:14px;box-shadow:0 12px 30px rgba(23,32,51,.16)}
 body[data-mobile-shell="true"] .rplay-mobile-menu-links>a,body[data-mobile-shell="true"] .rplay-mobile-menu-links button{display:flex;align-items:center;width:100%;min-height:44px;padding:10px;border:0;border-radius:8px;background:var(--color-surface);color:var(--color-text);font-size:.88rem;text-align:left;white-space:normal}
 body[data-mobile-shell="true"] .rplay-mobile-menu-links>a:hover,body[data-mobile-shell="true"] .rplay-mobile-menu-links button:hover{background:var(--color-primary-soft)}
 body[data-mobile-shell="true"] .rplay-mobile-menu-links form{display:block;margin:0}
 body[data-mobile-shell="true"] .dashboard-topbar>.rplay-mobile-menu{margin-left:auto;flex:none}
 body[data-mobile-shell="true"].rplay-mobile-keyboard .rplay-mobile-navigation,html.rplay-iphone-playing body[data-mobile-shell="true"] .rplay-mobile-navigation,body[data-mobile-shell="true"]:fullscreen .rplay-mobile-navigation{display:none}
 body[data-mobile-shell="true"] .main-content :target,body[data-mobile-shell="true"] .dashboard-content :target{scroll-margin-bottom:var(--rplay-mobile-nav-space)}
}
@media (orientation:landscape) and (max-width:820px), (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-width:1180px) and (max-height:540px){
 body[data-mobile-shell="true"]{--rplay-mobile-nav-space:calc(58px + env(safe-area-inset-bottom,0px))}
 body[data-mobile-shell="true"] .rplay-mobile-navigation{padding-top:4px;padding-bottom:calc(4px + env(safe-area-inset-bottom,0px))}
 body[data-mobile-shell="true"] .rplay-mobile-navigation>a{flex-direction:row;gap:8px;min-height:44px;padding:6px}
 body[data-mobile-shell="true"] .rplay-mobile-menu-links{max-height:calc(100dvh - 160px)}
}

/* Stage 2: shorten mobile openings; keep all desktop styling and game services. */
.rplay-mobile-title,.rplay-mobile-game-intro,.rplay-mobile-page-about{display:none}
@media (max-width:820px), (hover:none) and (pointer:coarse) and (max-width:1180px) and (max-height:540px){
 body[data-mobile-shell="true"] .topbar{grid-template-areas:none;grid-template-rows:auto}
 body[data-mobile-shell="true"] .rplay-wide-title{display:none}
 body[data-mobile-shell="true"] .rplay-mobile-title{display:inline}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery{padding:0;background:none;border:0;box-shadow:none}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery>div{display:flex;flex-direction:column;gap:10px}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery h1{order:0;font-size:1.55rem;line-height:1.2;margin:0}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery .chips{order:1;margin:0;gap:6px}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery>div>p{display:none}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery .chip{padding:7px 10px;font-size:.73rem}
 body[data-mobile-shell="true"] .home-discovery-page>.hero-home-discovery+.home-section{margin-top:14px}
 body[data-mobile-shell="true"] .discovery-section .section-head{gap:8px;margin-bottom:10px}
 body[data-mobile-shell="true"] .discovery-section .section-head h2{font-size:1.15rem;margin:0 0 5px}
 body[data-mobile-shell="true"] .discovery-section .section-head p{font-size:.76rem;line-height:1.4;margin:0}
 body[data-mobile-shell="true"] .discovery-section .section-head .eyebrow{font-size:.61rem;margin-bottom:4px}
 body[data-mobile-shell="true"] .discovery-section .section-more{display:inline-flex;align-items:center;min-height:44px;flex:none;font-size:.72rem}
 body[data-mobile-shell="true"] .home-discovery-page .discovery-game-grid,body[data-mobile-shell="true"] .game-recommendations-sidebar .game-recommendations-grid{display:flex;gap:10px;overflow-x:auto;scroll-snap-type:x mandatory;scroll-padding-inline:2px;overscroll-behavior-x:contain;padding:2px 2px 12px;scrollbar-width:thin}
 body[data-mobile-shell="true"] .home-discovery-page .discovery-game-grid>.public-game-card,body[data-mobile-shell="true"] .game-recommendations-sidebar .game-recommendations-grid>.public-game-card{flex:0 0 44%;min-width:145px;scroll-snap-align:start;align-self:stretch;border-radius:12px}
 body[data-mobile-shell="true"] .home-discovery-page .public-game-card-body{padding:9px}
 body[data-mobile-shell="true"] .home-discovery-page .public-game-card h3{font-size:.86rem;line-height:1.3;margin:5px 0 7px;overflow-wrap:anywhere}
 body[data-mobile-shell="true"] .home-discovery-page .game-card-dev,body[data-mobile-shell="true"] .home-discovery-page .game-card-status-inline,body[data-mobile-shell="true"] .home-discovery-page .game-card-tags-inline{font-size:.65rem}
 body[data-mobile-shell="true"] .home-discovery-page .game-card-summary,body[data-mobile-shell="true"] .home-discovery-page .game-card-open{display:none}
 body[data-mobile-shell="true"] .home-discovery-page .game-card-stats{display:flex;gap:4px;margin-top:8px}
 body[data-mobile-shell="true"] .home-discovery-page .game-card-stats>div{font-size:.7rem;padding:0;border:0}
 body[data-mobile-shell="true"] .home-discovery-page .game-card-stats>div:not(:first-child){display:none}
 body[data-mobile-shell="true"] .home-discovery-page .game-card-stats small{font-size:.65rem}
 body[data-mobile-shell="true"] .catalog-hero{padding:0;margin:0 0 8px;gap:0}
 body[data-mobile-shell="true"] .catalog-hero h1{font-size:1.55rem;line-height:1.2;margin:0;overflow-wrap:anywhere}
 body[data-mobile-shell="true"] .catalog-hero .eyebrow,body[data-mobile-shell="true"] .catalog-hero p,body[data-mobile-shell="true"] .catalog-hero .catalog-search{display:none}
 body[data-mobile-shell="true"] .catalog-result-head{margin-bottom:10px}
 body[data-mobile-shell="true"] .catalog-result-head>.text-muted{display:none}
 body[data-mobile-shell="true"] .catalog-hero+.rplay-ad{margin:10px 0}
 body[data-mobile-shell="true"] .catalog-collections{margin:10px 0 8px;padding-bottom:5px}
 body[data-mobile-shell="true"] .catalog-mobile-tools{margin-bottom:8px}
 body[data-mobile-shell="true"] .rplay-mobile-page-about{display:block;margin:16px 0;padding:12px;border:1px solid var(--color-border);border-radius:12px;background:var(--color-surface)}
 body[data-mobile-shell="true"] .rplay-mobile-page-about-head{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--color-text);font-size:.85rem}
 body[data-mobile-shell="true"] .rplay-mobile-page-about button{flex:none;min-height:44px;padding:9px 14px;border:0;border-radius:10px;background:var(--color-primary);color:#fff;font:inherit;font-weight:700;cursor:pointer}
 body[data-mobile-shell="true"] .rplay-mobile-page-about button:focus-visible{outline:3px solid var(--color-primary);outline-offset:3px}
 body[data-mobile-shell="true"] .rplay-mobile-page-about [hidden]{display:none!important}
 body[data-mobile-shell="true"] .rplay-mobile-page-about p{margin:10px 0 0;font-size:.85rem;line-height:1.6;color:var(--color-muted)}
 body[data-mobile-shell="true"][data-mobile-page="game"] .topbar-search{display:none}
 body[data-mobile-shell="true"] .game-public-page>.game-public-hero{display:none}
 body[data-mobile-shell="true"] .rplay-mobile-game-intro{display:flex;gap:11px;align-items:center;margin:0 0 12px}
 body[data-mobile-shell="true"] .rplay-mobile-game-thumb{display:grid;place-items:center;flex:0 0 56px;width:56px;height:56px;border-radius:11px;overflow:hidden;border:1px solid var(--color-border);background:var(--color-surface-alt)}
 body[data-mobile-shell="true"] .rplay-mobile-game-thumb img{width:100%;height:100%;object-fit:cover}
 body[data-mobile-shell="true"] .rplay-mobile-game-copy{min-width:0}
 body[data-mobile-shell="true"] .rplay-mobile-game-copy h1{font-size:1.18rem;line-height:1.25;margin:0 0 5px;overflow-wrap:anywhere}
 body[data-mobile-shell="true"] .rplay-mobile-game-copy a{color:var(--color-primary);font-size:.78rem}
 body[data-mobile-shell="true"] .rplay-mobile-game-copy small{display:block;font-size:.7rem;color:var(--color-muted);margin-top:3px}
 body[data-mobile-shell="true"] .game-player-heading h1{display:none}
 body[data-mobile-shell="true"] .game-play-main .embedded-game{display:flex;flex-direction:column;gap:9px;margin-top:0}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .embedded-game-head,body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar{display:contents}
 body[data-mobile-shell="true"] .embedded-game-head>.game-player-heading{order:0}
 body[data-mobile-shell="true"] .game-player-heading .game-online-status{margin:0;font-size:.7rem}
 body[data-mobile-shell="true"] .game-dev-toolbar>.embedded-game-select,body[data-mobile-shell="true"] .embedded-orientation-hint{order:1}
 body[data-mobile-shell="true"] .embedded-game-stage{order:2;margin:0}
 body[data-mobile-shell="true"] .game-dev-toolbar-identity{order:3;display:flex;justify-content:flex-end;margin:0}
 body[data-mobile-shell="true"] .game-dev-toolbar-identity .game-dev-toolbar-profile{display:none}
 body[data-mobile-shell="true"] .game-dev-toolbar-controls{order:4;display:flex;justify-content:flex-start;align-items:center;gap:8px;margin:0}
 body[data-mobile-shell="true"] .game-dev-toolbar-controls .game-dev-toolbar-follow{flex:0 0 auto}
 body[data-mobile-shell="true"] .game-dev-toolbar-support{display:grid;gap:3px;text-align:left;position:static}
 body[data-mobile-shell="true"] .game-dev-toolbar-support small{position:static;white-space:normal}
 body[data-mobile-shell="true"] .game-dev-toolbar .btn{width:auto;min-height:44px;font-size:.78rem;padding:9px 12px}
 body[data-mobile-shell="true"] .game-free-time-notice{order:5;margin:0}
 body[data-mobile-shell="true"] .embedded-game-foot{order:6;margin:0;font-size:.68rem}
 body[data-mobile-shell="true"] .game-player-postplay{margin-top:12px}
 body[data-mobile-shell="true"] .game-play-main .game-player-ad{margin-bottom:14px}
 body[data-mobile-shell="true"] .game-description{margin-top:18px}
}
@media (orientation:landscape) and (max-width:820px), (orientation:landscape) and (hover:none) and (pointer:coarse) and (max-width:1180px) and (max-height:540px){
 body[data-mobile-shell="true"] .home-discovery-page .discovery-game-grid>.public-game-card,body[data-mobile-shell="true"] .game-recommendations-sidebar .game-recommendations-grid>.public-game-card{flex-basis:27%;min-width:155px}
}

/* Mobile only: one compact action row; preserve native controls and touch targets. */
@media (max-width:820px), (hover:none) and (pointer:coarse) and (max-width:1180px) and (max-height:540px){
 body[data-mobile-shell="true"] .game-public-page .game-play-main .embedded-game{flex-direction:row;flex-wrap:wrap;gap:8px 6px}
 body[data-mobile-shell="true"] .embedded-game-head>.game-player-heading,
 body[data-mobile-shell="true"] .game-dev-toolbar>.embedded-game-select,
 body[data-mobile-shell="true"] .embedded-orientation-hint,
 body[data-mobile-shell="true"] .embedded-game-stage,
 body[data-mobile-shell="true"] .game-free-time-notice,
 body[data-mobile-shell="true"] .embedded-game-foot{flex:0 0 100%;min-width:0}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar-identity,
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar-controls{display:contents}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar-follow{order:3;flex:1 1 21%;min-width:0;width:auto;margin:0}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar-support{order:4;flex:1.4 1 39%;min-width:0;width:auto;margin:0;display:flex;align-items:stretch;position:relative}
 body[data-mobile-shell="true"] .game-public-page .game-play-main [data-game-fullscreen]{order:5;flex:1.1 1 29%;min-width:0;width:auto;margin:0}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar .btn{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;height:auto;padding:7px 6px;font-size:.7rem;line-height:1.25;white-space:normal;text-align:center;border-radius:10px}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-dev-toolbar-support small{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body[data-mobile-shell="true"] .game-public-page .game-play-main .game-support-emoji{display:none}
 body[data-mobile-shell="true"] .game-free-time-notice{order:6}
 body[data-mobile-shell="true"] .embedded-game-foot{order:7}
}

/* Mobile reading gutters: align text with the header's comfortable inset. */
@media (max-width:820px), (hover:none) and (pointer:coarse) and (max-width:1180px) and (max-height:540px){
 body[data-mobile-shell="true"] .main-content{padding-inline:12px}
 body[data-mobile-shell="true"] .footer{padding-inline:12px}
 body[data-mobile-shell="true"] .dashboard-content{padding-inline:18px}
}
