.mobile-only{display:none}
@media(max-width:600px){
 html{scroll-padding-top:165px}
 body{background:#edf6ff;padding-bottom:calc(76px + env(safe-area-inset-bottom));font-size:14px}
 .mobile-only{display:block}
 .mobile-header{position:sticky;top:0;z-index:30;padding:14px 18px 0;background:#ffffffed;backdrop-filter:blur(16px);border-bottom:1px solid #deebf6}
 .mobile-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
 .mobile-fund>span{display:block;font-size:11px;font-weight:700;color:#71849c}
 .mobile-fund>strong{display:block;font-size:29px;line-height:1.25;letter-spacing:-1px;color:var(--blue);font-weight:800;min-height:36px}
 .mobile-tools{display:flex;gap:8px}
 .mobile-tools .icon-button{width:44px;height:44px;padding:11px;border-color:#e5ecf4;background:#f5f8fc}
 .mobile-teams{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:4px;background:#eef3f9;border-radius:13px;margin-top:12px;gap:3px}
 .mobile-teams a{display:flex;align-items:center;justify-content:center;min-height:40px;font-size:13px;font-weight:750;border-radius:9px;color:#71819a}
 .mobile-teams a[aria-current="page"]{background:white;color:var(--blue);box-shadow:0 2px 7px #254e7710}
 .mobile-context{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px 1px;font-size:11px}
 .mobile-context strong{font-weight:750;font-size:12px}.mobile-context>span{color:#7d90a8}
 .quest-layout{display:block;min-height:0}
 .adventure-panel{padding:0;min-height:0;overflow:visible;background:#e5f4ff}
 .adventure-panel>.page-nav,.adventure-panel>.map-tools,.world>.treasure-badge,.world>.team-sign,.world>.spark,.world>.cloud{display:none!important}
 .world{width:100%;height:auto;min-height:0;aspect-ratio:1/3;margin:0;overflow:hidden}
 .world .world-art{inset:0;background:url('/assets/world-mobile-v2.png') center/100% 100%!important}
 .world-art>video,.world-art>.world-static,.sky-wash{display:none!important}
 .character{left:var(--mx);top:var(--my);transition:none;filter:drop-shadow(0 4px 3px #1636511c);min-width:100px}
 .character .avatar{width:57px;height:102px;animation:none}
 .character-label{min-width:92px;padding:7px 10px;border-radius:10px;margin-bottom:5px;box-shadow:0 4px 12px #1e4c7920}
 .character-label>span{font-size:12px;max-width:116px;line-height:1.25}
 .character-label>strong{font-size:24px;line-height:1.2;letter-spacing:-.8px}
 .character-label>small{display:none}.character .crown{font-size:17px}
 .character:hover .avatar{transform:none;animation:none}
 .leaderboard{display:none;min-height:0;max-height:none;border:0;background:#f4f8fc;padding-bottom:18px}
 body[data-mobile-view="ranking"] .leaderboard{display:flex}
 body[data-mobile-view="ranking"] .adventure-panel{display:none}
 .leaderboard .panel-heading{padding:22px 20px 10px}.panel-heading h2{font-size:23px;letter-spacing:-.7px}.panel-heading>button{display:none}
 .people-list{display:block;padding:0 12px;overflow:visible;flex:none}
 .person{grid-template-columns:18px 49px minmax(0,1fr);padding:17px 10px;gap:10px;background:white;border:1px solid #e3ebf3;border-radius:15px;margin-bottom:9px;min-height:124px}
 .person .avatar{width:47px;height:85px}.person-name{font-size:14px;white-space:normal;line-height:1.3;letter-spacing:-.25px}.person-top{align-items:flex-start;gap:7px}.person-top strong{font-size:23px;white-space:nowrap}
 .person-surname{font-size:12px;margin-top:4px}.person-meta{font-size:11px;margin-top:10px;white-space:normal;line-height:1.5}.person-progress{font-size:10px;margin-top:10px;gap:9px}.progress-track{height:4px}
 .sidebar-bottom{padding:8px 20px;justify-content:flex-end}.sidebar-actions{gap:10px}.sidebar-actions button{width:44px!important;height:44px!important}
 .mobile-bottom{position:fixed;bottom:0;left:0;right:0;z-index:35;display:grid;grid-template-columns:repeat(3,1fr);padding:7px 14px calc(7px + env(safe-area-inset-bottom));background:#fffffff5;backdrop-filter:blur(18px);border-top:1px solid #e0eaf3;box-shadow:0 -5px 28px #1d50700b}
 .mobile-bottom button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:54px;color:#7a8fa9;border-radius:12px;font-size:11px;font-weight:750}
 .mobile-bottom button .ui-icon{width:23px;height:23px}.mobile-bottom button[aria-current="page"]{color:var(--blue);background:#edf4ff}
 .notice:not(.inline){position:relative;top:auto;left:auto;right:auto;margin:0;padding:12px 18px;border-radius:0;font-size:12px;line-height:1.5}
 .empty-map{top:24%;max-width:86%;font-size:14px}.empty-map strong{font-size:20px}.empty-map p{font-size:13px}.empty-map button,.empty-state button{min-height:44px;padding:10px;font-size:13px}
 dialog{position:fixed;inset:auto 0 0;width:100%;max-width:none;max-height:90dvh;margin:0;padding:28px 20px calc(24px + env(safe-area-inset-bottom));border-radius:24px 24px 0 0;border:0;overflow-y:auto;overscroll-behavior:contain}
 dialog:before{content:'';position:absolute;top:9px;left:calc(50% - 19px);width:38px;height:4px;border-radius:3px;background:#d8e3ef}
 dialog .dialog-close{right:12px;top:17px;width:44px;height:44px;padding:10px}dialog h2{font-size:24px;line-height:1.25;padding-right:25px;margin-top:17px}dialog h3{font-size:16px}dialog p{font-size:13px;line-height:1.6}
 .detail-header{padding-top:17px;gap:15px}.detail-header>.avatar{width:58px;height:108px}.detail-header .dialog-eyebrow{font-size:10px}.detail-header h2{font-size:22px;margin-top:8px}.detail-header p{font-size:12px}
 .change-skin{min-height:44px;font-size:12px;padding:10px}.detail-metrics{gap:8px}.detail-metrics>div{padding:13px 10px}.detail-metrics span{font-size:11px}.detail-metrics strong{font-size:26px}.detail-progress strong{font-size:13px;line-height:1.5}
 .audit-scroll td,.audit-scroll th{font-size:12px;padding:11px 6px}.field{font-size:13px;gap:8px}.field input,.field select{font-size:16px;min-height:46px;padding:10px;max-width:100%}.checks-grid{max-height:220px}.check-field{font-size:13px;min-height:42px}.check-field input{width:19px;height:19px}.form-grid{grid-template-columns:1fr}.form-error{font-size:12px}.primary{font-size:14px;min-height:46px}
 .wardrobe-dialog{width:100%;max-height:92dvh}.wardrobe-controls>.field{width:100%}.skin-tabs button{font-size:12px;min-height:44px}.skin-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-height:43dvh;gap:8px}.skin-option{min-height:156px;padding:12px 5px}.skin-option.selected{padding:11px 4px}.skin-option>.avatar{width:49px;height:89px}.skin-option>strong{font-size:11px}.skin-option>small{font-size:9px}.wardrobe-footer{align-items:stretch}.wardrobe-footer .primary{width:100%}.rule-row strong{font-size:14px}.rule-row p{font-size:13px}.toast{bottom:calc(86px + env(safe-area-inset-bottom));font-size:13px;width:max-content;max-width:calc(100vw - 24px)}
}
@media(max-width:359px){.mobile-header{padding-left:12px;padding-right:12px}.character{min-width:85px}.character .avatar{width:48px;height:88px}.character-label{min-width:80px;padding:5px 8px}.character-label>strong{font-size:21px}.character-label>span{font-size:11px}.person{grid-template-columns:14px 39px minmax(0,1fr);gap:8px}.person .avatar{width:38px}.person-top strong{font-size:20px}.person-name{font-size:13px}}

/* Keep the winner crown readable and place discipline cards beside it. */
.character .crown{left:50%;top:-37px;width:44px;transform:translateX(-50%);font-size:32px;line-height:1;text-align:center;text-shadow:0 2px 0 #a66d10,0 4px 9px #5133004f;z-index:4}.character .penalty-cards.map{left:calc(50% + 42px);right:auto;top:-36px;bottom:auto;z-index:15}.character .penalty-cards.map .penalty-card{width:22px;height:31px;border-width:2px;border-radius:3px;box-shadow:0 4px 10px #122b4a73,0 0 0 2px #ffffff8c;transform:rotate(7deg)}
@media(max-width:359px){.character .crown{top:-33px;font-size:29px}.character .penalty-cards.map{left:calc(50% + 39px);top:-32px;bottom:auto}.character .penalty-cards.map .penalty-card{width:19px;height:27px}}

.world-art>#mobile-world-video{display:none}
@media(max-width:600px){
 body[data-mobile-animation="true"] .world .world-art{background-image:url('/assets/world-mobile-loop-poster.jpg')!important}
 body[data-mobile-animation="true"] .world-art>#mobile-world-video{display:block!important;position:absolute;inset:0;width:100%;height:100%;object-fit:fill;opacity:1}
 body[data-mobile-animation="true"] .character{left:var(--vx);top:var(--vy)}
 .mobile-tools .icon-button:disabled{opacity:.4}
}

@media(max-width:600px){.mobile-fund>#mobile-packs{display:block;font-size:11px;line-height:1.4;color:#71849c;margin-top:3px}.mobile-fund{min-width:0}}
