/* iPadOS may identify itself as a Mac with a fine pointer. Use actual touch capability. */
html.touch-device{width:100%; overflow-x:hidden}
html.touch-device body{display:flex;flex-direction:column; width:100%;min-height:100vh;min-height:100dvh;
    padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
html.touch-device body:has(#portal-view:not([hidden])){height:100vh;height:100dvh;min-height:0;overflow:hidden}
html.touch-device .top{flex:none;height:auto;min-height:43px;padding:4px 9px;gap:8px}
html.touch-device .brand{font-size:clamp(14px,4vw,20px);gap:5px;min-width:0}
html.touch-device .conhya-logo{width:32px;height:32px;flex:none}
html.touch-device .top-right{min-width:0;flex:none}
html.touch-device .signal{font-size:10px}
html.touch-device .retro-menubar{flex:none;height:auto;min-height:40px;overflow-x:auto;overflow-y:hidden;
    gap:2px;padding:2px 5px;scrollbar-width:thin;white-space:nowrap}
html.touch-device .retro-menubar button{flex:none;min-height:38px;padding:5px 9px;font-size:12px}
html.touch-device .conhya-toolbar{flex:none;min-height:60px;padding:3px 4px;gap:2px}
html.touch-device .toolbar-channels{min-width:0;gap:2px}
html.touch-device .toolbar-channels>button,html.touch-device .conhya-toolbar>.toolbar-customize{min-width:62px;min-height:52px;padding:3px 5px}
html.touch-device .toolbar-channels>button span,html.touch-device .toolbar-customize span{font-size:11px}
html.touch-device .conhya-toolbar .keyword-search{display:none}
html.touch-device body:has(#portal-view[hidden]) .retro-menubar,html.touch-device body:has(#portal-view[hidden]) .conhya-toolbar{display:none}
html.touch-device .login-shell{flex:1;min-height:0;padding:22px 12px;gap:18px;justify-content:flex-start}
html.touch-device .signin-orbit{width:70px;height:70px;font-size:40px}
html.touch-device .auth-card{width:100%;max-width:440px;padding:0 16px 18px}
html.touch-device .auth-card .star{margin:0 -16px 14px}
html.touch-device .auth-card h1{font-size:28px}
html.touch-device .auth-modes{flex-wrap:wrap;margin:14px 0}
html.touch-device .auth-modes button{min-height:44px;white-space:normal}
html.touch-device #portal-view:not([hidden]){display:block;flex:1 1 0;height:auto!important;min-height:0!important;
    min-width:0;width:100%;overflow:hidden;border-width:1px}
html.touch-device #portal-view[hidden]{display:none!important}
html.touch-device .desktop-icon-tray{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(84px,1fr));
    position:absolute;inset:0;width:auto;height:auto;overflow:auto;align-content:start;
    justify-items:center;align-items:start;padding:12px;gap:8px}
html.touch-device .desktop-icon-tray button{width:100%!important;min-width:0!important;min-height:74px!important}
html.touch-device .retro-desktop{inset:0;overflow:hidden}
html.touch-device .retro-desktop .retro-window,html.touch-device .retro-desktop .retro-window.maximized,html.touch-device .retro-desktop .retro-window[data-window-id]{inset:0!important;left:0!important;top:0!important;
    width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
    max-width:none!important;max-height:none!important;resize:none;border-width:1px;border-radius:0;box-shadow:none}
html.touch-device .retro-desktop .retro-window:not(.active),html.touch-device .retro-desktop .retro-window.minimized{display:none!important}
html.touch-device .retro-window .retro-titlebar{height:auto;min-height:46px;padding:2px 5px;gap:5px;cursor:default}
html.touch-device .retro-window-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
html.touch-device .retro-window-controls{flex:none;gap:3px}
html.touch-device .retro-window-controls button,html.touch-device .retro-titlebar .channel-back{min-height:44px;min-width:44px;margin:0;padding:4px}
html.touch-device .retro-window-controls button:nth-child(2){display:none}
html.touch-device .retro-window-foot{display:none}
html.touch-device .retro-window-content{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:7px;
    -webkit-overflow-scrolling:touch;overflow-wrap:anywhere}
html.touch-device .retro-window-content .tile{min-width:0;max-width:100%;padding:8px}
html.touch-device .retro-window-content button:not(.calendar-day),html.touch-device .retro-window-content select,html.touch-device .retro-window-content input:not([type=checkbox]):not([type=radio]):not([type=range]),html.touch-device .retro-window-content textarea,html.touch-device .auth-card input,html.touch-device .auth-card button,html.touch-device .toolbar-dialog button{min-height:44px}
html.touch-device /* 16px prevents iOS Safari auto-zoom when editing text. */
  input:not([type=checkbox]):not([type=radio]):not([type=range]),html.touch-device textarea,html.touch-device select{font-size:16px!important;max-width:100%}
html.touch-device .retro-window-content img,html.touch-device .retro-window-content video,html.touch-device .retro-window-content canvas{max-width:100%}
html.touch-device .retro-window-content audio{max-width:100%}
html.touch-device .retro-window-content pre{white-space:pre-wrap;overflow-wrap:anywhere}
html.touch-device .retro-window-content table{display:block;max-width:100%;overflow-x:auto}
html.touch-device .retro-window-content .form-grid,html.touch-device .retro-window-content .grid.two,html.touch-device .retro-window-content .grid.three,html.touch-device .welcome-workspace #home-panel .grid.two,html.touch-device .welcome-daily,html.touch-device .welcome-explore,html.touch-device .realm-layout,html.touch-device .realm-bottom{grid-template-columns:minmax(0,1fr)}
html.touch-device .retro-window-content .inline{flex-wrap:wrap;min-width:0}
html.touch-device .retro-window-content .inline>input{flex:1 1 140px;min-width:0}
html.touch-device .welcome-workspace{padding:4px}
html.touch-device .welcome-workspace .retro-launchbar{grid-template-columns:repeat(2,minmax(0,1fr))}
html.touch-device .welcome-workspace .welcome-banner{min-height:0;padding:9px}
html.touch-device .welcome-workspace .banner-message strong{font-size:19px}
html.touch-device .welcome-bottom,html.touch-device .connected-actions,html.touch-device .radio-transport,html.touch-device .radio-filters,html.touch-device .storage-row{flex-wrap:wrap}
html.touch-device .mail-workspace{grid-template-columns:minmax(0,1fr);min-height:0}
html.touch-device .mail-workspace .mail-folders{flex-direction:row;flex-wrap:wrap;border-right:0}
html.touch-device .mail-workspace .mail-folders strong{display:none}
html.touch-device .mail-columns,html.touch-device .mail-workspace .mail-line{grid-template-columns:24px minmax(0,1fr) minmax(0,1.4fr) 58px;gap:4px}
html.touch-device .mail-workspace .mail-line>*{min-width:0;overflow-wrap:anywhere}
html.touch-device .mail-reading-actions,html.touch-device .mail-list-heading{flex-wrap:wrap}
html.touch-device .calendar-nav{flex-wrap:wrap}
html.touch-device .calendar-nav strong{min-width:0}
html.touch-device .calendar-day{min-height:52px!important;padding:3px!important}
html.touch-device .calendar-grid[data-mode=week] .calendar-day{min-height:85px!important}
html.touch-device .arcade-channel .arcade-cards,html.touch-device .learning-cards{grid-template-columns:minmax(0,1fr)}
html.touch-device .arcade-channel button.realm-feature{grid-template-columns:minmax(0,1fr)}
html.touch-device .arcade-channel button.arcade-feature{flex-wrap:wrap;min-height:0}
html.touch-device .arcade-channel .game-dpad button,html.touch-device .arcade-player-controls button,html.touch-device .extra-game-controls button{min-width:44px;min-height:44px}
html.touch-device .realm-layout canvas{width:100%;height:auto}
html.touch-device #realm-controls{flex-wrap:wrap}
html.touch-device .neighborhood-results,html.touch-device .entertainment-links{grid-template-columns:minmax(0,1fr)}
html.touch-device .toolbar-dialog{max-width:calc(100% - 16px);max-height:85dvh}
html.touch-device .footer{flex:none;height:auto;min-height:44px;max-width:100%;display:flex;flex-wrap:wrap;
    justify-content:flex-start;gap:4px 8px;padding:4px 7px}
html.touch-device .footer>span:first-child,html.touch-device .footer-right{display:none}
html.touch-device .window-dock{order:-1;flex:1 0 100%;max-width:100%;flex-wrap:nowrap;overflow-x:auto;min-width:0;scrollbar-width:thin}
html.touch-device .window-dock:empty{display:none}
html.touch-device .window-dock button{flex:none;min-height:38px;max-width:170px;font-size:12px}
html.touch-device .footer button{min-height:38px;margin:0;padding:4px 7px}
html.touch-device .footer-sound{margin-left:auto}
html.touch-device .footer-sound input{width:21px;height:21px}
html.touch-device .radio-mini{flex:1 1 100%;max-width:100%}
html.touch-device .radio-mini[hidden]{display:none!important}
html.touch-device #radio-mini-status{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.touch-device #notification-center{position:fixed;inset:auto 8px calc(100px + env(safe-area-inset-bottom)) 8px;
    width:auto;max-height:50dvh}
html.touch-device #notification-toast{bottom:calc(100px + env(safe-area-inset-bottom));right:8px}

@media (max-height:500px) and (orientation:landscape){
html.touch-device .top{display:flex;min-height:32px;padding:2px 8px}
html.touch-device .top .brand small,html.touch-device .top .top-date{display:none}
html.touch-device .conhya-toolbar{min-height:48px}
html.touch-device .toolbar-channels>button,html.touch-device .conhya-toolbar>.toolbar-customize{min-height:44px}
html.touch-device .conhya-toolbar .toolbar-icon{width:23px;height:23px}
html.touch-device .footer .window-dock{flex:1 1 100px}

}
html.touch-device .top-date,html.touch-device .top .brand small{display:none}
html.touch-device .top .brand{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html.touch-device #portal-view:not([hidden]){position:relative}
html.touch-device #retro-desktop{position:absolute;inset:0;overflow:hidden}
html.touch-device .child-session #portal-view:not([hidden]){display:flex!important;flex-direction:column}
html.touch-device .child-session #portal-view>.content{display:none!important}
html.touch-device .child-session #retro-desktop{order:0}
html.touch-device .child-session #kids-quickbar{order:1}
html.touch-device .child-session #retro-desktop{position:relative;inset:auto;flex:1 1 0;min-height:0;width:100%}
html.touch-device .child-session #kids-quickbar{position:relative;inset:auto;flex:0 0 auto;flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:5px}
html.touch-device .kids-quickbar button{flex:1 0 auto;margin:0;min-height:44px;white-space:nowrap;padding:6px 9px}
html.touch-device .retro-window-content{padding:clamp(6px,1.2vw,14px);overflow-x:hidden}
html.touch-device .retro-window .retro-window-content>.view{min-width:0;max-width:100%}
html.touch-device .retro-window-content .tile{width:100%;box-sizing:border-box}
html.touch-device .retro-window-content .inline>*{min-width:0}
html.touch-device .retro-window-content .tile h2{overflow-wrap:anywhere}
html.touch-device .kids-launch{grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:10px}
html.touch-device .kids-launch button{min-height:96px;margin:0;padding:8px}
html.touch-device .kids-mission{margin-top:10px}
html.touch-device .arcade-channel{padding:8px!important}
html.touch-device .arcade-channel .arcade-cards,html.touch-device .learning-cards{grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr))}
html.touch-device .arcade-channel .arcade-cover{height:clamp(84px,13vw,140px)}
html.touch-device .arcade-channel #arcade-play:not([hidden]){min-width:0}
html.touch-device .arcade-player-top{gap:5px;justify-content:space-between}
html.touch-device .arcade-channel #game-name{font-size:clamp(18px,2.8vw,26px)}
html.touch-device .arcade-instructions{font-size:13px;min-height:0}
html.touch-device .arcade-player-controls{gap:6px}
html.touch-device .arcade-player-controls button{min-height:44px}
html.touch-device .arcade-stage{display:flex;flex-direction:column;gap:8px;align-items:center}
html.touch-device .arcade-board{width:min(100%,var(--board-limit,680px));margin:0;min-width:0}
html.touch-device .arcade-channel #game-canvas{width:100%!important;height:auto;max-width:100%;aspect-ratio:440/360;border-radius:4px}
html.touch-device .arcade-touch-panel{width:min(100%,680px)}
html.touch-device .arcade-channel .extra-game-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));gap:8px;margin:0}
html.touch-device .arcade-channel .extra-game-controls button{min-height:48px;font-size:15px;white-space:normal;margin:0}
html.touch-device .arcade-channel .game-dpad{display:grid;grid-template-columns:repeat(3,minmax(48px,72px));gap:6px;justify-content:center;margin:6px auto;width:max-content;max-width:100%}
html.touch-device .arcade-channel .game-dpad button{min-height:54px;min-width:48px;width:100%;font-size:24px;padding:4px;touch-action:none}
html.touch-device .game-dpad [data-dir=up]{grid-column:2;grid-row:1}
html.touch-device .game-dpad [data-dir=left]{grid-column:1;grid-row:2}
html.touch-device .game-dpad [data-dir=down]{grid-column:2;grid-row:2}
html.touch-device .game-dpad [data-dir=right]{grid-column:3;grid-row:2}
html.touch-device .arcade-channel #game-munch{grid-column:1/-1;font-size:18px;min-height:52px}
html.touch-device #arcade-play[data-game=pinball] .game-dpad{grid-template-columns:repeat(2,minmax(90px,150px));width:100%;justify-content:center}
html.touch-device #arcade-play[data-game=pinball] .game-dpad :is([data-dir=up],[data-dir=down]){display:none}
html.touch-device #arcade-play[data-game=pinball] .game-dpad [data-dir=left]{grid-row:1;grid-column:1}
html.touch-device #arcade-play[data-game=pinball] .game-dpad [data-dir=right]{grid-row:1;grid-column:2}
html.touch-device .typing-key-row{gap:3px}
html.touch-device .typing-key-row button{flex:1 1 0;min-width:0;min-height:48px;font-size:clamp(14px,2.5vw,21px);max-width:62px}
html.touch-device .typing-key-row .typing-space{flex:0 1 65%;max-width:300px}
html.touch-device #library-content .library-shelf{grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr))}
html.touch-device #library-content .library-cover img{height:clamp(100px,19vw,190px);width:100%;object-fit:contain}
html.touch-device #library-content .library-picture{max-height:min(62dvh,620px)}
html.touch-device .color-paper{max-width:min(100%,850px)}
html.touch-device .color-palette button{min-height:48px;min-width:48px}
html.touch-device #realm-controls button{min-width:54px;min-height:48px;touch-action:none}
html.touch-device #realm-spells button,html.touch-device #realm-supplies button{min-height:48px}

@media (min-width:780px) and (orientation:landscape){
html.touch-device .arcade-stage{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(210px,1fr);align-items:start;gap:14px}
html.touch-device .arcade-board{width:100%;max-width:var(--board-limit,680px);justify-self:center}
html.touch-device .arcade-touch-panel{width:100%;max-width:100%;align-self:center}
html.touch-device .arcade-stage:has(.arcade-touch-panel>div:not([hidden])){align-items:center}
html.touch-device .arcade-stage:not(:has(.arcade-touch-panel>div:not([hidden]))){display:flex}
html.touch-device .arcade-channel .extra-game-controls{grid-template-columns:repeat(auto-fit,minmax(min(100%,130px),1fr))}
html.touch-device .arcade-channel .game-dpad button{min-height:65px}
html.touch-device #arcade-play[data-game=typing] .arcade-stage{grid-template-columns:minmax(0,1fr) minmax(330px,1fr)}
html.touch-device .realm-layout{grid-template-columns:minmax(0,1fr) minmax(220px,31%)}
html.touch-device #realm-side{max-height:65dvh;overflow:auto}

}
@media (max-height:550px) and (orientation:landscape){
html.touch-device .arcade-player-top button,html.touch-device .arcade-player-controls button{min-height:36px}
html.touch-device .arcade-board{max-width:min(100%,calc((100dvh - 160px)*1.22))}
html.touch-device .arcade-channel .game-dpad button{min-height:48px}
html.touch-device .typing-key-row button{min-height:40px}

}
html.touch-device .arcade-channel #arcade-play:not([hidden]){padding:4px 0}
html.touch-device .arcade-channel #game-name{font-size:clamp(20px,3vw,29px)}
html.touch-device .arcade-channel .arcade-player-controls span,html.touch-device .arcade-channel .arcade-player-top span{font-size:15px}
html.touch-device .arcade-channel .arcade-instructions{font-size:15px;line-height:1.35}
html.touch-device .game-readable:not([hidden]){display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;margin:6px 0;padding:9px 12px;background:#1b344a;color:#fff4c6;border:1px solid #6e8ba9;border-radius:8px}
html.touch-device .game-readable strong{font-size:clamp(19px,3.2vw,29px);line-height:1.25;overflow-wrap:anywhere}
html.touch-device .game-readable span{color:#c8e1ee;font-size:14px}
html.touch-device .arcade-channel .extra-game-controls button{min-height:55px;font-size:clamp(16px,2.3vw,21px);line-height:1.25;border-radius:9px;padding:10px}
html.touch-device .arcade-stage{--board-limit:860px}
html.touch-device .arcade-touch-panel{width:min(100%,860px)}
html.touch-device .thumbstick-panel:not([hidden]){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-weight:bold;min-width:0}
html.touch-device .thumbstick-panel>strong{font-size:12px;letter-spacing:.14em}
html.touch-device .thumbstick-panel button{min-height:36px;font-size:12px;margin:0}
html.touch-device .arcade-big-actions:not([hidden]){display:flex;flex-direction:column;gap:9px;align-items:center;justify-content:center}
html.touch-device .arcade-big-actions>button{min-height:48px;min-width:90px;margin:0;font-size:16px}
html.touch-device .arcade-channel .touch-action-button,html.touch-device .realm-shell .touch-action-button{width:clamp(90px,13vw,144px);height:clamp(76px,11vw,120px);border-radius:50%;background:linear-gradient(#b1f18e,#55ab55);color:#143821;border:3px solid #d0f7b7;box-shadow:0 5px 0 #326739,0 7px 12px #0004;font-weight:900;font-size:clamp(16px,2vw,22px);touch-action:manipulation}
html.touch-device .touch-action-button:active{transform:translateY(3px);box-shadow:0 2px 0 #326739}
html.touch-device #arcade-play.has-thumbstick:not(.use-arrow-pad) #arcade-dpad{display:none!important}
html.touch-device #arcade-play.has-thumbstick.use-arrow-pad .thumbstick{display:none}
html.touch-device #arcade-play.has-thumbstick.use-arrow-pad #game-munch{display:none}
html.touch-device #arcade-play[data-game=pinball] .game-dpad button{min-height:82px;font-size:28px;border-radius:16px;background:linear-gradient(#8568c4,#4e3d87);color:#fff}
html.touch-device #arcade-play.has-thumbstick .arcade-stage{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:8px}
html.touch-device #arcade-play.has-thumbstick .arcade-board{grid-column:1/-1;grid-row:1;width:min(100%,var(--board-limit,860px));justify-self:center}
html.touch-device #arcade-play.has-thumbstick .thumbstick-panel{grid-column:1;grid-row:2}
html.touch-device #arcade-play.has-thumbstick .arcade-touch-panel{grid-column:2;grid-row:2;width:100%}
html.touch-device .realm-touch-controls{display:flex;justify-content:space-around;align-items:center;gap:12px;margin:8px 0}
html.touch-device .realm-touch-actions{display:flex;flex-direction:column;align-items:center;gap:8px}
html.touch-device .realm-touch-actions>button{min-width:100px;min-height:48px;font-weight:bold}
html.touch-device .realm-hint{font-size:13px}
html.touch-device #realm-stats,html.touch-device #realm-zone{font-size:15px}

@media (min-width:820px) and (orientation:landscape){
html.touch-device #arcade-play.has-thumbstick .arcade-stage{grid-template-columns:minmax(120px,.7fr) minmax(0,3fr) minmax(114px,.7fr);gap:10px}
html.touch-device #arcade-play.has-thumbstick .thumbstick-panel{grid-column:1;grid-row:1}
html.touch-device #arcade-play.has-thumbstick .arcade-board{grid-column:2;grid-row:1;width:100%;max-width:var(--board-limit,860px)}
html.touch-device #arcade-play.has-thumbstick .arcade-touch-panel{grid-column:3;grid-row:1}
html.touch-device #arcade-play[data-game=deepsea] .arcade-stage{grid-template-columns:minmax(120px,.7fr) minmax(0,2.5fr) minmax(170px,1fr)}
html.touch-device #arcade-play.has-thumbstick.use-arrow-pad .arcade-stage{grid-template-columns:minmax(100px,.6fr) minmax(0,2.4fr) minmax(160px,1fr)}

}
@media (min-width:820px) and (orientation:landscape){
html.touch-device #arcade-play[data-game=dungeon2] .arcade-stage{grid-template-columns:minmax(110px,.65fr) minmax(0,2.9fr) minmax(160px,1fr)}
html.touch-device #arcade-play[data-game=dungeon2] #extra-game-controls{grid-template-columns:1fr}
html.touch-device #arcade-play[data-game=dungeon2] .arcade-big-actions{flex-direction:row;flex-wrap:wrap}
html.touch-device #arcade-play[data-game=dungeon2] .touch-action-button{width:85px;height:75px}
}
html.touch-device .game-music-settings button,html.touch-device [data-game-sfx-toggle]{min-height:44px}
html.touch-device .game-music-settings input[type=range]{min-height:40px}

html.touch-device .retro-window .retro-titlebar button.game-mode-toggle{display:inline-flex}html.touch-device .game-mode-toggle[hidden]{display:none!important}