/* Phone-first comfort layer. Desktop retains the approved layout. */
.ce-mobile-nav{display:none}
.ce-mobile-menu:not([open]){display:none}
@media(max-width:700px){
  html{scroll-padding-bottom:100px}
  body:has(.ce-app[data-mobile-ready]){padding-bottom:calc(82px + env(safe-area-inset-bottom,0px))!important}
  body .ce-app{width:100%;max-width:100%;padding:20px 16px 28px!important;margin:0 auto;font-size:15px;line-height:1.6}
  body .ce-app *{box-sizing:border-box;min-width:0}
  body .ce-app[data-mobile-ready] .ce-nav{display:none}
  body .ce-app[data-mobile-ready] .ce-mobile-nav{display:block;position:fixed;inset:auto 0 0;z-index:1000;padding:8px 8px max(8px,env(safe-area-inset-bottom));border-top:1px solid #c7a86b40;background:#101518f5;backdrop-filter:blur(18px);box-shadow:0 -8px 30px #03060b33}
  body .ce-app .ce-mobile-nav ul{display:flex;align-items:stretch;margin:0;padding:0;list-style:none;gap:4px}
  body .ce-app .ce-mobile-nav li{flex:1;margin:0;padding:0;list-style:none}
  body .ce-app .ce-mobile-nav :is(a,button){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:100%;min-height:56px;padding:6px 2px;margin:0;border:0;border-radius:12px;background:transparent;box-shadow:none;color:#adb3ba;font:500 11px/1.2 var(--ce-body);letter-spacing:0;text-transform:none;text-decoration:none;white-space:nowrap}
  body .ce-app .ce-mobile-nav :is(a[aria-current=page],button.is-current){background:#c7a86b15;color:#dcc8a0}
  body .ce-app .ce-mobile-nav a[aria-current=page] svg{stroke-width:2}
  body .ce-app .ce-mobile-nav :is(a,button):active{background:#c7a86b25;transform:scale(.97)}
  body .ce-app .ce-mobile-nav :is(a,button):focus-visible{outline:2px solid #d1b680;outline-offset:-2px}
  body .ce-app dialog.ce-mobile-menu{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;max-height:85dvh;border:1px solid #cdaf7440;border-bottom:0;border-radius:24px 24px 0 0;padding:24px 20px max(28px,env(safe-area-inset-bottom));background:#141b1f;color:#f3e9d6;overflow:auto;overscroll-behavior:contain;box-shadow:0 -16px 80px #03060b88}
  body .ce-app .ce-mobile-menu::backdrop{background:#05090dc7;backdrop-filter:blur(4px)}
  body .ce-app .ce-mobile-menu header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}
  body .ce-app .ce-mobile-menu header p{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#c1a978;margin:0 0 5px}
  body .ce-app .ce-mobile-menu h2{font:500 28px/1.1 var(--ce-editorial);margin:0}
  body .ce-app .ce-mobile-menu [data-ce-menu-close]{min-width:44px;width:44px;height:44px;padding:0;border:1px solid #ffffff26;border-radius:50%;background:#ffffff07;color:#f3e9d6;font:400 28px/1 var(--ce-body);flex:none}
  body .ce-app .ce-mobile-menu nav a{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:82px;padding:16px 4px;border-top:1px solid #ffffff16;color:#efe2c8;text-decoration:none}
  body .ce-app .ce-mobile-menu nav strong{display:block;font-size:17px;font-weight:550}
  body .ce-app .ce-mobile-menu nav small{display:block;font-size:13px;color:#aab0b8;margin-top:3px;line-height:1.5}
  body .ce-app .ce-mobile-menu nav a[aria-current=page]{color:#dcc79e}
  /* Readable controls, including iOS focus without input zoom. */
  body .ce-app :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea){font-size:16px!important;line-height:1.5;min-height:48px;border-radius:12px;padding:12px!important;width:100%;max-width:100%}
  body .ce-app label{font-size:14px!important;line-height:1.5;gap:7px}
  body .ce-app :is(button,.ce-btn,.ce-dashboard-edit){min-height:46px;font-size:14px;line-height:1.35;letter-spacing:0;touch-action:manipulation}
  body .ce-app button{white-space:normal}
  body .ce-app :is(summary,.ce-arena-shortcuts a,.ce-tile-actions a,.ce-section-heading>a){min-height:44px;align-content:center;font-size:14px;line-height:1.5}
  body .ce-app :is(p,li){overflow-wrap:anywhere}
  body .ce-app .ce-dashboard-eyebrow{font-size:10px;letter-spacing:.1em;line-height:1.6}
  body .ce-app form{gap:16px}
  body .ce-app form button[type=submit]{width:100%}
  body .ce-app #ce-status:not(:empty){padding:14px 16px;background:#212e40;border-left:3px solid #cbae74;border-radius:12px;font-size:14px}
  body .ce-app :is(.ce-home-welcome,.ce-competition-hero){min-height:0!important;padding:22px!important;border-radius:16px;margin:0 0 20px}
  body .ce-app :is(.ce-home-welcome h1,.ce-competition-hero h1){font-size:34px!important;line-height:1.08!important;letter-spacing:-.025em;margin:10px 0 14px}
  body .ce-app :is(.ce-home-welcome,.ce-competition-hero) p{font-size:14px;line-height:1.6}
  body .ce-app .ce-competition-mark{font-size:86px;opacity:.15}
  body .ce-app .ce-home-welcome{gap:8px;padding:4px 4px 0!important;margin-bottom:20px}
  body .ce-app .ce-home-player{padding:12px 0 0;border:0;border-top:1px solid #ffffff1c;background:transparent;min-height:64px;width:100%}
  body .ce-app .ce-home-player .ce-community-seal{width:42px;height:42px;flex:none}
  body .ce-app .ce-home-player small{font-size:12px}
  body .ce-app .ce-section-heading{margin:24px 0 14px;gap:8px;flex-direction:row;flex-wrap:wrap;align-items:center}
  body .ce-app .ce-section-heading h2{font-size:28px!important;line-height:1.15;margin:5px 0!important}
  body .ce-app .ce-news-feature{min-height:230px!important;padding:22px!important;border-radius:16px!important;background-position:65% center!important}
  body .ce-app .ce-news-feature>div{max-width:100%}
  body .ce-app .ce-news-feature h3{font-size:29px!important;margin:15px 0!important}
  body .ce-app .ce-news-feature p{font-size:14px;line-height:1.6}
  body .ce-app .ce-news-feature a{font-size:14px;min-height:44px;display:inline-flex;align-items:center;margin-top:4px}
  body .ce-app .ce-dashboard-actions{display:grid;grid-template-columns:1fr;gap:10px;margin:22px 0}
  body .ce-app .ce-dashboard-actions a,body .ce-app .ce-dashboard-actions a:first-child{min-height:110px;grid-column:auto;padding:18px 20px;gap:4px;border-radius:14px;background-position:center 55%}
  body .ce-app .ce-dashboard-actions strong{font-size:25px;line-height:1.15}
  body .ce-app .ce-dashboard-actions small{font-size:13px;line-height:1.5}
  /* Identity and QR fit together; the player's progress is visible immediately. */
  body .ce-app .ce-dashboard-welcome{padding:20px 18px 0;min-height:0;gap:18px;grid-template-columns:1fr;border-radius:16px}
  body .ce-app .ce-player-identity{display:flex;flex-direction:row;align-items:center;text-align:left;gap:18px;padding:0}
  body .ce-app .ce-player-identity>.ce-identity-seals{width:82px;flex:0 0 82px;margin:0;padding:0 0 20px;align-self:center}
  body .ce-app button.ce-qr-orbit{width:76px;height:76px;min-height:76px;box-shadow:0 0 0 4px #111c29b0,0 0 0 5px #cdaf7430}
  body .ce-app .ce-qr-orbit .ce-player-emblem{width:28px;height:40px}
  body .ce-app .ce-qr-orbit span{font-size:10px;left:0;right:0;bottom:-14px;padding:6px 3px}
  body .ce-app .ce-identity-seals>.ce-community-seal{width:34px;height:34px;right:-8px;bottom:20px;border-width:2px}
  body .ce-app .ce-identity-seals>.ce-community-seal img{padding:4px}
  body .ce-app .ce-identity-copy{width:auto;flex:1}
  body .ce-app .ce-dashboard-welcome h2{font-size:29px;line-height:1.1;margin:8px 0;letter-spacing:-.025em}
  body .ce-app .ce-identity-copy>p:not(.ce-dashboard-eyebrow){font-size:13px;line-height:1.5;margin:8px 0}
  body .ce-app .ce-dashboard-welcome .ce-player-tag{font-size:10px;margin:8px 0 0;padding:4px 7px}
  body .ce-app .ce-player-membership{display:block;margin:8px 0 0;text-align:left}
  body .ce-app .ce-player-membership strong{font-size:12px;line-height:1.5}
  body .ce-app .ce-player-membership small{font-size:11px;line-height:1.5}
  body .ce-app .ce-dashboard-edit{position:static;justify-self:start;margin:0;padding:11px 16px;font-size:13px!important;background:#0b111780}
  body .ce-app .ce-player-hud{grid-template-columns:1fr auto;margin:0 -18px;padding:18px;gap:14px;background:#0d1319e8}
  body .ce-app .ce-hud-rank{gap:10px}
  body .ce-app .ce-rank-symbol{width:42px;height:52px}
  body .ce-app .ce-hud-rank strong{font-size:23px}
  body .ce-app .ce-hud-rank small,body .ce-app .ce-hud-rating small{font-size:10px;letter-spacing:.06em}
  body .ce-app .ce-hud-rating{padding:0;border:0;text-align:right}
  body .ce-app .ce-hud-rating strong{font-size:26px}
  body .ce-app .ce-hud-rating span,body .ce-app .ce-hud-xp small{font-size:12px}
  body .ce-app .ce-hud-xp{grid-column:1/-1;grid-row:2}
  body .ce-app .ce-hud-xp>div{font-size:13px}
  body .ce-app .ce-hud-xp progress{height:7px;margin:8px 0 2px}
  body .ce-app .ce-dashboard-grid{gap:16px;margin-top:16px}
  body .ce-app .ce-dashboard-grid>.ce-summary{padding:20px;border-radius:16px}
  body .ce-app .ce-dashboard-grid h2{font-size:28px!important;line-height:1.15}
  body .ce-app .ce-dashboard-grid p,body .ce-app .ce-dashboard-grid li{font-size:14px;line-height:1.65}
  body .ce-app .ce-scope,body .ce-app .ce-player-search,body .ce-app .ce-ranking-filters{grid-template-columns:1fr;gap:14px}
  body .ce-app .ce-player-directory{gap:14px;grid-template-columns:1fr}
  body .ce-app .ce-player-directory article.ce-player-tile{padding:0 18px 16px!important}
  body .ce-app .ce-player-tile-banner{height:62px;margin:0 -18px}
  body .ce-app .ce-player-directory h2{font-size:26px!important;margin-top:14px!important}
  body .ce-app .ce-player-directory p{font-size:14px;margin-bottom:14px}
  body .ce-app .ce-tile-actions a{font-size:14px;min-height:46px;padding:10px 12px}
  body .ce-app .ce-arena-entry{padding:22px;gap:16px;margin:18px 0}
  body .ce-app .ce-arena-entry h2{font-size:28px;line-height:1.15}
  body .ce-app .ce-arena-entry p{font-size:14px;line-height:1.6}
  body .ce-app .ce-arena-entry>button{width:100%;padding:15px}
  body .ce-app .ce-arena-shortcuts{display:flex;gap:10px;justify-content:space-between}
  body .ce-app .ce-arena-shortcuts a{flex:1;text-align:center;padding:10px 8px;border:1px solid #ffffff20;border-radius:12px;background:#ffffff05;text-decoration:none;font-size:13px}
  body .ce-app .ce-arena-panel{padding:18px;border-radius:16px;scroll-margin-top:16px}
  body .ce-app .ce-ranking li{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:6px 10px;padding:16px 0;align-items:center}
  body .ce-app .ce-ranking-person strong{font-size:15px;line-height:1.4}
  body .ce-app .ce-ranking-person span{font-size:12px;line-height:1.5}
  body .ce-app .ce-ranking-points{grid-column:3;grid-row:1 / span 2}
  body .ce-app .ce-ranking-points strong{font-size:23px}
  body .ce-app .ce-ranking-record{display:block;grid-column:2;font-size:12px;color:#b2b7bd}
  /* Dialogs use the phone width, with one scroll area and reachable close actions. */
  body .ce-app dialog:not(.ce-mobile-menu){position:fixed;inset:auto 0 0;top:auto;margin:0;width:100%;max-width:100%;max-height:90dvh;padding:22px 20px max(26px,env(safe-area-inset-bottom));border-radius:22px 22px 0 0;overflow-y:auto;overscroll-behavior:contain}
  body .ce-app dialog h2{font-size:30px!important;line-height:1.1;clear:both}
  body .ce-app dialog :is(p,li){font-size:14px;line-height:1.6}
  body .ce-app dialog [data-close-dialog]{min-height:44px;min-width:74px;padding:10px 14px;margin-bottom:10px}
  body .ce-app .ce-player-card{display:block}
  body .ce-app .ce-player-card:not([open]){display:none}
  body .ce-app .ce-player-card code{display:block;overflow-wrap:anywhere;font-size:11px}
  body .ce-app .ce-challenge-dialog .ce-rival-list{max-height:none;overflow:visible}
  body .ce-app .ce-rival-list li{padding:14px 0;gap:12px;align-items:center}
  body .ce-app .ce-rival-list strong{font-size:15px}
  body .ce-app .ce-rival-list small{font-size:12px}
  body .ce-app .ce-rival-list .ce-btn{min-height:44px;min-width:90px;padding:12px 10px;font-size:13px}
  body .ce-app .ce-rival-pagination{display:flex;gap:12px}
  body .ce-app .ce-rival-pagination button{flex:1;min-height:46px}
  body .ce-app .ce-scan-options summary{font-size:15px}
  body .ce-app .ce-community-hero{padding:22px!important;gap:16px;min-height:0}
  body .ce-app .ce-community-hero h1{font-size:32px;line-height:1.15}
  body .ce-app .ce-community-actions{grid-template-columns:1fr 1fr;gap:10px}
  body .ce-app .ce-community-actions a{display:flex;flex-direction:column;align-items:flex-start;padding:16px;gap:8px;min-height:128px}
  body .ce-app .ce-community-actions strong{font-size:15px;line-height:1.3}
  body .ce-app .ce-community-actions small{font-size:12px;line-height:1.5}
  body .ce-app .ce-community-actions a>span{font-size:23px;line-height:1}
  body .ce-app .ce-community-module{padding:20px!important;margin:16px 0;overflow-wrap:anywhere}
  body .ce-app .ce-community-module:has(table[data-mobile-cards]){overflow:visible}
  body .ce-app table[data-mobile-cards]{display:block;min-width:0;width:100%;border:0}
  body .ce-app table[data-mobile-cards] thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  body .ce-app table[data-mobile-cards] tbody{display:block}
  body .ce-app table[data-mobile-cards] tbody tr{display:block;margin:14px 0;border:1px solid #ffffff1c;border-radius:12px;padding:14px;background:#ffffff03}
  body .ce-app table[data-mobile-cards] td{display:block;width:100%;padding:7px 0;border:0;font-size:14px;text-align:left}
  body .ce-app table[data-mobile-cards] td:before{content:attr(data-label);display:block;color:#b0b5bc;font-size:11px;letter-spacing:.04em;margin-bottom:4px}
  body .ce-app table[data-mobile-cards] td form{margin:0}
  body .ce-app .ce-community-module input[readonly]{font-size:14px!important}
  body .ce-app .ce-editor-preview{padding:18px!important}
  body .ce-app .ce-event-editor>footer{flex-wrap:wrap}
  body .ce-app .ce-account{margin:18px 0}
  body .ce-app .ce-account summary{padding:16px;font-size:15px}
  body .ce-app .ce-account form{padding:16px!important}
  body .ce-landing .ce-hero{min-height:0; background-position:62% center}
  body .ce-landing .ce-hero .ce-hero-body{padding:40px 0 34px}
  body .ce-landing .ce-hero .ce-emblem{width:58px;margin-bottom:18px}
  body .ce-landing .ce-hero h1{font-size:42px;line-height:1.05}
  body .ce-landing .ce-hero .ce-lead{font-size:16px;line-height:1.6}
  body .ce-landing .ce-hero-actions{display:grid;grid-template-columns:1fr;gap:10px}
  body .ce-landing .ce-hero-actions a{margin:0;min-height:50px;font-size:14px;text-align:center}
  body .ce-landing .ce-quicklinks .ce-wrap{display:flex;overflow:auto;gap:18px;padding:4px 20px;scrollbar-width:thin}
  body .ce-landing .ce-quicklinks a{white-space:nowrap;flex:none;min-height:52px;font-size:13px;display:flex;align-items:center}
  body .ce-landing .ce-sec{padding:40px 0}
  body .ce-landing .ce-sec h2{font-size:32px}
  body .ce-landing .ce-intro{font-size:15px;line-height:1.65}
  body .wp-site-blocks>header{padding-block:8px}
  body .wp-site-blocks>header .wp-block-site-title a{font-size:12px;letter-spacing:.02em}
}
@media(max-width:360px){
  body .ce-app{padding-inline:12px!important}
  body .ce-app .ce-mobile-nav :is(a,button){font-size:10px}
  body .ce-app .ce-dashboard-welcome{padding-inline:16px}
  body .ce-app .ce-player-identity{gap:14px}
  body .ce-app .ce-dashboard-welcome h2{font-size:26px}
  body .ce-app .ce-player-hud{margin-inline:-16px;padding-inline:16px}
  body .ce-app .ce-community-actions a{padding:14px;min-height:140px}
}

/* Task-first composers: keep the first controls visible on narrow screens. */
@media(max-width:600px){
 body .ce-app dialog.ce-community-dialog{max-height:94dvh;padding:16px 16px max(20px,env(safe-area-inset-bottom))!important;}
 body .ce-app dialog.ce-community-dialog .ce-community-module{padding:0!important;margin:0;border:0;}
 body .ce-app dialog.ce-community-dialog .ce-dashboard-eyebrow,
 body .ce-app dialog.ce-community-dialog .ce-community-module>p:not([role=status]){display:none!important;}
 body .ce-app dialog.ce-community-dialog .ce-community-module>h3{font-size:24px!important;line-height:1.2;margin:6px 42px 18px 0;}
 body .ce-app dialog.ce-community-dialog form{padding:0;margin:0;border:0;}
 body .ce-app dialog.ce-community-dialog form label{margin:12px 0;}
 body .ce-app dialog.ce-community-dialog .ce-editor-step{margin:18px 0 8px;padding:0;font-size:11px;}
 body .ce-app dialog.ce-community-dialog [data-form-status]:empty{display:none;}
}
