/* Site-wide mobile UX layer.
   Loaded only on non-game fan-site pages. Desktop layout remains unchanged. */

@media(max-width:760px){
  html{overflow-x:clip;scroll-padding-top:66px}
  body[data-page]:not([data-game]){
    min-width:0;
    overflow-x:clip;
    padding-bottom:env(safe-area-inset-bottom);
    -webkit-text-size-adjust:100%;
  }
  body.mobile-site-nav-open{overflow:hidden}

  /* Compact shared header */
  body[data-page]:not([data-game]) .site-header{
    height:58px!important;min-height:58px!important;
    backdrop-filter:blur(8px)!important;
    padding:0 9px!important;gap:7px!important;
    padding-left:max(9px,env(safe-area-inset-left))!important;
    padding-right:max(9px,env(safe-area-inset-right))!important;
  }
  body[data-page]:not([data-game]) .brand{margin-right:auto!important;gap:0!important}
  body[data-page]:not([data-game]) .brand-mark{
    width:38px!important;height:38px!important;border-radius:12px!important;
    font-size:14px!important
  }
  body[data-page]:not([data-game]) .brand-copy,
  body[data-page]:not([data-game]) .header-live{display:none!important}
  body[data-page]:not([data-game]) :is(.nav-toggle,.theme-toggle,.changelog-button,.activity-bell){
    width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;
    padding:8px!important;border-radius:12px!important;flex:0 0 40px!important
  }
  body[data-page]:not([data-game]) .nav-toggle{display:block!important}
  body[data-page]:not([data-game]) .main-nav{
    position:fixed!important;z-index:190!important;
    top:64px!important;left:8px!important;right:8px!important;bottom:auto!important;
    max-height:calc(100dvh - 74px)!important;
    overflow-y:auto!important;overscroll-behavior:contain!important;
    display:none!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:stretch!important;gap:6px!important;
    padding:9px!important;
    border:1px solid #343434!important;border-radius:17px!important;
    background:#0d0d0df8!important;
    box-shadow:0 16px 44px #000b!important;
    backdrop-filter:blur(8px)!important;
  }
  body[data-page]:not([data-game]) .main-nav.open{display:grid!important}
  body[data-page]:not([data-game]) .main-nav :is(.nav-group,.nav-group-submenu,.nav-minigames){display:contents!important}
  body[data-page]:not([data-game]) .main-nav :is(.nav-group-trigger,.nav-minigames-submenu){display:none!important}
  body[data-page]:not([data-game]) .main-nav a{
    display:flex!important;align-items:center!important;justify-content:flex-start!important;
    min-width:0!important;min-height:48px!important;padding:10px 12px!important;
    border:1px solid #252525!important;border-radius:12px!important;
    background:#121212!important;color:#d7d1cb!important;
    font-size:12px!important;line-height:1.25!important;font-weight:850!important;
    white-space:normal!important
  }
  body[data-page]:not([data-game]) .main-nav a.active{
    border-color:#ff6b185e!important;background:#21130c!important;color:#ff9d5b!important
  }

  /* Shared spacing and readable type */
  body[data-page]:not([data-game]) :is(.page-shell,.hero,.portal-section){
    width:calc(100% - 24px)!important;max-width:none!important
  }
  body[data-page]:not([data-game]) .page-hero{
    padding:28px 0 22px!important;overflow:hidden!important
  }
  body[data-page]:not([data-game]) .page-hero:before{
    width:300px!important;height:300px!important;top:-170px!important;right:-120px!important
  }
  body[data-page]:not([data-game]) .page-hero .page-shell>div[class$="-hero-grid"],
  body[data-page]:not([data-game]) .page-hero .page-shell>.minigames-hero-layout{
    display:grid!important;grid-template-columns:1fr!important;gap:16px!important
  }
  body[data-page]:not([data-game]) .page-hero h1{
    margin:8px 0 10px!important;font-size:clamp(36px,11vw,48px)!important;
    line-height:.98!important;letter-spacing:-.055em!important
  }
  body[data-page]:not([data-game]) .page-hero p{
    margin-top:0!important;font-size:14px!important;line-height:1.65!important
  }
  body[data-page]:not([data-game]) .page-hero figure[class$="-hero-media"],
  body[data-page]:not([data-game]) .minigames-hero-art{
    margin:0!important;width:100%!important
  }
  body[data-page]:not([data-game]) .page-hero figure img,
  body[data-page]:not([data-game]) .minigames-hero-art img{
    display:block!important;width:100%!important;height:auto!important;
    aspect-ratio:16/9!important;object-fit:cover!important;border-radius:16px!important
  }
  body[data-page]:not([data-game]) .kicker,
  body[data-page]:not([data-game]) .eyebrow{font-size:10px!important;letter-spacing:.13em!important}
  body[data-page]:not([data-game]) .page-actions,
  body[data-page]:not([data-game]) .hero-actions{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;margin-top:16px!important
  }
  body[data-page]:not([data-game]) .page-actions .btn,
  body[data-page]:not([data-game]) .hero-actions .btn{
    width:100%!important;min-height:44px!important;padding:10px 11px!important;
    font-size:11px!important;border-radius:12px!important;text-align:center!important
  }
  body[data-page]:not([data-game]) .content-section{padding:28px 0 58px!important}
  body[data-page]:not([data-game]) .section-head{
    display:flex!important;align-items:flex-start!important;flex-direction:column!important;
    gap:6px!important;margin-bottom:18px!important
  }
  body[data-page]:not([data-game]) .section-head h2{
    font-size:clamp(25px,8vw,34px)!important;margin-top:5px!important
  }
  body[data-page]:not([data-game]) .section-head>p{
    font-size:11px!important;line-height:1.45!important
  }
  body[data-page]:not([data-game]) :is(.loading-card,.empty-card,.content-error){
    padding:20px 14px!important;border-radius:15px!important;font-size:12px!important
  }
  body[data-page]:not([data-game]) .source-note{
    margin-top:18px!important;padding:14px 14px!important;font-size:11px!important;line-height:1.6!important
  }
  body[data-page]:not([data-game]) :is(button,a,.btn,[role="button"]){touch-action:manipulation}
  body[data-page]:not([data-game]) :is(button,.btn,input,select,textarea){min-height:44px}

  /* Mobile rendering budget: skip painting long off-screen card lists until needed. */
  body[data-page]:not([data-game]) :is(.portal-card,.schedule-card,.notice-card,.video-list-card,.fanart-card,.data-kpi,.data-chart-card,.changelog-entry){
    content-visibility:auto;
    contain-intrinsic-size:auto 150px
  }

  /* Home */
  body[data-page="home"] .hero{
    min-height:auto!important;display:grid!important;grid-template-columns:1fr!important;
    gap:6px!important;padding:24px 0 34px!important
  }
  body[data-page="home"] .hero-art{
    order:-1!important;min-height:230px!important;height:230px!important
  }
  body[data-page="home"] .hero-art:before{
    width:230px!important;height:230px!important
  }
  body[data-page="home"] .hero-character{
    width:min(72vw,280px)!important;max-height:230px!important
  }
  body[data-page="home"] .status-card{
    left:6px!important;bottom:3px!important;padding:8px 10px!important;border-radius:12px!important
  }
  body[data-page="home"] .status-card small{font-size:8px!important}
  body[data-page="home"] .status-card strong{font-size:11px!important}
  body[data-page="home"] .hero-copy{text-align:left!important}
  body[data-page="home"] .hero-copy .eyebrow{justify-content:flex-start!important}
  body[data-page="home"] .hero-copy h1{
    margin:12px 0 14px!important;font-size:clamp(42px,13vw,56px)!important;line-height:.91!important
  }
  body[data-page="home"] .hero-description{font-size:14px!important;line-height:1.65!important}
  body[data-page="home"] .hero-tags{
    justify-content:flex-start!important;display:flex!important;flex-wrap:nowrap!important;
    gap:6px!important;margin-top:14px!important;overflow-x:auto!important;
    padding-bottom:5px!important;scrollbar-width:none!important
  }
  body[data-page="home"] .hero-tags::-webkit-scrollbar{display:none}
  body[data-page="home"] .hero-tags :is(span,a){flex:0 0 auto!important;font-size:10px!important}
  body[data-page="home"] .portal-section{padding:18px 0 54px!important}
  body[data-page="home"] .portal-head{gap:4px!important;margin-bottom:14px!important}
  body[data-page="home"] .portal-head h2{font-size:30px!important}
  body[data-page="home"] .portal-head p{font-size:11px!important}
  body[data-page="home"] .portal-grid{grid-template-columns:1fr!important;gap:8px!important}
  body[data-page="home"] .portal-card{
    min-height:122px!important;padding:15px 16px!important;border-radius:16px!important
  }
  body[data-page="home"] .portal-card small{font-size:9px!important}
  body[data-page="home"] .portal-card strong{font-size:19px!important;margin-top:4px!important}
  body[data-page="home"] .portal-card p{font-size:11px!important;margin:6px 0!important;line-height:1.45!important}
  body[data-page="home"] .portal-card b{font-size:22px!important}
  body[data-page="home"] .official-strip{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important
  }
  body[data-page="home"] .official-strip a{
    min-height:44px!important;display:grid!important;place-items:center!important;
    padding:9px!important;font-size:10px!important;text-align:center!important
  }
  body[data-page="home"] .home-dday-dialog{
    width:calc(100vw - 20px)!important;max-height:calc(100dvh - 24px)!important;
    border-radius:18px!important
  }
  body[data-page="home"] .home-dday-dialog-card{padding:15px!important}
  body[data-page="home"] .home-dday-detail-grid article{min-height:130px!important;padding:14px!important}

  /* Schedules */
  body[data-page="schedule"] .schedule-view-toolbar,
  body[data-page="schedule"] .schedule-week-nav,
  body[data-page="schedule"] .schedule-calendar-toolbar{
    display:flex!important;gap:6px!important;overflow-x:auto!important;scrollbar-width:none!important
  }
  body[data-page="schedule"] .schedule-view-toolbar::-webkit-scrollbar,
  body[data-page="schedule"] .schedule-week-nav::-webkit-scrollbar,
  body[data-page="schedule"] .schedule-calendar-toolbar::-webkit-scrollbar{display:none}
  body[data-page="schedule"] :is(.schedule-view-button,.schedule-week-nav button,.schedule-calendar-toolbar button){
    flex:0 0 auto!important;min-height:44px!important;padding:9px 12px!important
  }
  body[data-page="schedule"] .schedule-grid{grid-template-columns:1fr!important;gap:10px!important}
  body[data-page="schedule"] .schedule-card{
    min-height:230px!important;padding:18px!important;border-radius:17px!important
  }
  body[data-page="schedule"] .schedule-card h2{font-size:22px!important;margin:34px 0 3px!important}
  body[data-page="schedule"] .schedule-card p{font-size:12px!important;margin:12px 0 18px!important}
  body[data-page="schedule"] .schedule-calendar-shell{padding:10px!important;border-radius:16px!important}
  body[data-page="schedule"] .schedule-calendar-scroll{
    overflow-x:auto!important;overscroll-behavior-x:contain!important;padding-bottom:6px!important
  }
  body[data-page="schedule"] .schedule-calendar-scroll>div{min-width:620px!important}

  /* Notice */
  body[data-page="notice"] .notice-list{gap:8px!important}
  body[data-page="notice"] .notice-card{border-radius:14px!important}
  body[data-page="notice"] .notice-toggle{
    grid-template-columns:34px minmax(0,1fr) 24px!important;
    gap:8px!important;padding:13px 11px!important;min-height:68px!important
  }
  body[data-page="notice"] .notice-index{font-size:15px!important}
  body[data-page="notice"] .notice-main small{font-size:9px!important}
  body[data-page="notice"] .notice-main strong{
    font-size:14px!important;line-height:1.38!important;overflow-wrap:anywhere!important
  }
  body[data-page="notice"] .notice-body{
    padding:0 13px 16px!important
  }
  body[data-page="notice"] .notice-detail{padding-top:14px!important}
  body[data-page="notice"] .notice-content{
    font-size:14px!important;line-height:1.75!important;overflow-wrap:anywhere!important
  }
  body[data-page="notice"] .notice-content :is(img,video,iframe){max-width:100%!important;height:auto!important}
  body[data-page="notice"] .notice-image-modal{
    width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important;border-radius:14px!important
  }
  body[data-page="notice"] .notice-image-modal-media{min-height:0!important;padding:8px!important}
  body[data-page="notice"] .notice-image-modal-media img{max-height:calc(100dvh - 30px)!important}

  /* VOD / Clips / YouTube */
  body[data-page="vod"] .video-layout,
  body[data-page="clips"] .video-layout,
  body[data-page="youtube"] .video-layout{
    display:grid!important;grid-template-columns:1fr!important;gap:12px!important
  }
  body[data-page="vod"] .video-viewer,
  body[data-page="clips"] .video-viewer,
  body[data-page="youtube"] .video-viewer{
    position:static!important;border-radius:15px!important
  }
  body[data-page="vod"] .player-stage,
  body[data-page="clips"] .player-stage,
  body[data-page="youtube"] .player-stage{aspect-ratio:16/9!important}
  body[data-page="vod"] .player-info,
  body[data-page="clips"] .player-info,
  body[data-page="youtube"] .player-info{
    display:flex!important;align-items:flex-start!important;flex-direction:column!important;
    gap:7px!important;padding:12px!important
  }
  body[data-page="vod"] .player-info h2,
  body[data-page="clips"] .player-info h2,
  body[data-page="youtube"] .player-info h2{font-size:16px!important;margin:0!important}
  body[data-page="vod"] .video-list,
  body[data-page="clips"] .video-list,
  body[data-page="youtube"] .video-list{gap:7px!important}
  body[data-page="vod"] .video-list-card,
  body[data-page="clips"] .video-list-card,
  body[data-page="youtube"] .video-list-card{
    grid-template-columns:96px minmax(0,1fr)!important;gap:10px!important;
    min-height:72px!important;padding:7px!important;border-radius:13px!important
  }
  body[data-page="vod"] .video-copy strong,
  body[data-page="clips"] .video-copy strong,
  body[data-page="youtube"] .video-copy strong{
    font-size:12px!important;line-height:1.35!important;
    display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important
  }
  body[data-page="clips"] .clip-tabs,
  body[data-page="youtube"] .youtube-tabs{
    width:100%!important;overflow-x:auto!important;display:flex!important;scrollbar-width:none!important
  }
  body[data-page="clips"] .clip-tabs::-webkit-scrollbar,
  body[data-page="youtube"] .youtube-tabs::-webkit-scrollbar{display:none}
  body[data-page="clips"] .clip-tab,
  body[data-page="youtube"] .clip-tab{flex:1 0 auto!important;min-height:44px!important;padding:9px 13px!important}

  /* Fan art */
  body[data-page="fanart"] .fanart-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important
  }
  body[data-page="fanart"] .fanart-card{border-radius:13px!important}
  body[data-page="fanart"] .fanart-copy{padding:9px!important}
  body[data-page="fanart"] .fanart-copy strong{font-size:11px!important}
  body[data-page="fanart"] .fanart-modal{
    width:100vw!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;
    margin:0!important;border:0!important;border-radius:0!important
  }
  body[data-page="fanart"] .fanart-modal-media{height:calc(100dvh - 118px)!important;min-height:0!important}
  body[data-page="fanart"] .fanart-modal-media img{max-height:100%!important}
  body[data-page="fanart"] .fanart-modal-copy{
    min-height:118px!important;padding:12px!important;gap:8px!important
  }
  body[data-page="fanart"] .fanart-modal-copy .btn{width:100%!important}

  /* Tarot */
  body[data-page="tarot"] .tarot-shell{width:100%!important}
  body[data-page="tarot"] .tarot-setup{padding:14px!important;border-radius:16px!important}
  body[data-page="tarot"] .tarot-choice-group{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important
  }
  body[data-page="tarot"] .tarot-choice-group legend{grid-column:1/-1!important;font-size:13px!important}
  body[data-page="tarot"] .tarot-choice-group label{
    min-height:46px!important;padding:8px!important;border-radius:11px!important
  }
  body[data-page="tarot"] .tarot-stage{min-height:360px!important;padding:14px!important;border-radius:17px!important}
  body[data-page="tarot"] .tarot-reading-grid{
    grid-template-columns:1fr!important;gap:12px!important
  }
  body[data-page="tarot"] .tarot-summary,
  body[data-page="tarot"] .tarot-ai-panel{padding:15px!important;border-radius:16px!important}
  body[data-page="tarot"] .tarot-result-actions{
    display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important
  }
  body[data-page="tarot"] .tarot-card-dialog{
    width:100vw!important;max-width:none!important;height:100dvh!important;max-height:100dvh!important;
    margin:0!important;border-radius:0!important
  }
  body[data-page="tarot"] .tarot-card-dialog-inner{padding:12px!important}

  /* Minigames portal only */
  body[data-page="minigames"] .minigames-hero{padding-top:20px!important}
  body[data-page="minigames"] .minigames-hero-layout{grid-template-columns:1fr!important}
  body[data-page="minigames"] .minigames-hero-art{order:initial!important}
  body[data-page="minigames"] .minigames-hero-art img{aspect-ratio:16/9!important}
  body[data-page="minigames"] .minigame-grid{grid-template-columns:1fr!important;gap:8px!important}
  body[data-page="minigames"] .minigame-card{
    min-height:150px!important;padding:17px!important;border-radius:16px!important
  }
  body[data-page="minigames"] .minigame-card strong{font-size:21px!important}
  body[data-page="minigames"] .minigame-card p{font-size:12px!important;line-height:1.5!important}

  /* History */
  body[data-page="history"] .history-layout{
    display:grid!important;grid-template-columns:1fr!important;gap:10px!important
  }
  body[data-page="history"] .history-guide{
    position:static!important;padding:14px!important;border-radius:15px!important
  }
  body[data-page="history"] .history-guide dl{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important
  }
  body[data-page="history"] .history-guide dl div{
    min-width:0!important;padding:7px!important;border-radius:9px!important
  }
  body[data-page="history"] .history-guide dt{font-size:8px!important}
  body[data-page="history"] .history-guide dd{font-size:9px!important;overflow-wrap:anywhere!important}
  body[data-page="history"] .history-content-shell{
    min-width:0!important;padding:13px!important;border-radius:15px!important
  }
  body[data-page="history"] .history-content{
    min-width:0!important;overflow-wrap:anywhere!important;font-size:13px!important
  }
  body[data-page="history"] .history-content :is(img,video,iframe){max-width:100%!important;height:auto!important}
  body[data-page="history"] .history-content table{
    display:block!important;max-width:100%!important;overflow-x:auto!important;white-space:nowrap!important
  }

  /* Data dashboard */
  body[data-page="data"] .data-shell{gap:24px!important}
  body[data-page="data"] .data-status{
    display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;
    gap:8px!important;padding:13px!important;border-radius:14px!important
  }
  body[data-page="data"] .data-status .btn{grid-column:1/-1!important;width:100%!important}
  body[data-page="data"] .data-platform-tabs,
  body[data-page="data"] .data-soop-view-tabs,
  body[data-page="data"] .data-period-controls{
    display:flex!important;overflow-x:auto!important;gap:6px!important;
    scroll-snap-type:x proximity!important;overscroll-behavior-x:contain!important;
    scrollbar-width:none!important;padding-bottom:4px!important
  }
  body[data-page="data"] .data-platform-tabs::-webkit-scrollbar,
  body[data-page="data"] .data-soop-view-tabs::-webkit-scrollbar,
  body[data-page="data"] .data-period-controls::-webkit-scrollbar{display:none}
  body[data-page="data"] :is(.data-platform-tab,.data-soop-view-tabs button,.data-period-controls button){
    flex:0 0 auto!important;scroll-snap-align:start!important;min-height:44px!important
  }
  body[data-page="data"] .data-platform-tab{min-width:210px!important;padding:11px!important}
  body[data-page="data"] .data-kpi-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important
  }
  body[data-page="data"] .data-kpi{min-height:118px!important;padding:13px!important;border-radius:14px!important}
  body[data-page="data"] .data-chart-grid{grid-template-columns:1fr!important;gap:9px!important}
  body[data-page="data"] .data-chart-card{padding:12px!important;border-radius:14px!important}
  body[data-page="data"] .data-table-card{border-radius:14px!important;overflow:hidden!important}
  body[data-page="data"] .data-table-head{padding:11px!important}
  body[data-page="data"] .data-detail-table{
    width:100%!important;max-width:100%!important;overflow-x:auto!important;
    overscroll-behavior-x:contain!important;scrollbar-width:thin!important
  }
  body[data-page="data"] .data-detail-table :is(table,.data-table-grid){min-width:680px!important}
  body[data-page="data"] .data-calendar-wrap{
    display:block!important;overflow-x:auto!important;padding-bottom:8px!important
  }
  body[data-page="data"] .data-calendar-wrap>div:first-child{min-width:620px!important}
  body[data-page="data"] .data-calendar-detail{
    width:100%!important;min-width:0!important;margin-top:10px!important
  }
  body[data-page="data"] .data-category-list,
  body[data-page="data"] .data-session-list,
  body[data-page="data"] .data-top-content,
  body[data-page="data"] .data-recent-grid{
    grid-template-columns:1fr!important;gap:8px!important
  }

  /* Changelog */
  body[data-page="changelog"] .changelog-hero{padding:32px 0 24px!important}
  body[data-page="changelog"] .changelog-hero h1{font-size:40px!important}
  body[data-page="changelog"] .changelog-section{padding:28px 0 54px!important}
  body[data-page="changelog"] .changelog-toolbar{
    display:flex!important;flex-direction:column!important;align-items:flex-start!important;
    gap:12px!important;margin-bottom:18px!important
  }
  body[data-page="changelog"] .changelog-legend{
    display:flex!important;gap:6px!important;flex-wrap:wrap!important
  }
  body[data-page="changelog"] .changelog-layout{
    display:grid!important;grid-template-columns:1fr!important;gap:10px!important
  }
  body[data-page="changelog"] .changelog-index{
    display:block!important;position:static!important;width:100%!important;min-width:0!important
  }
  body[data-page="changelog"] .changelog-index-inner{
    position:static!important;width:100%!important;padding:8px!important;border-radius:13px!important
  }
  body[data-page="changelog"] .changelog-index-inner>p,
  body[data-page="changelog"] .changelog-index-home{display:none!important}
  body[data-page="changelog"] #changelog-index-list{
    display:flex!important;gap:6px!important;overflow-x:auto!important;
    overscroll-behavior-x:contain!important;scrollbar-width:none!important;padding:1px!important
  }
  body[data-page="changelog"] #changelog-index-list::-webkit-scrollbar{display:none}
  body[data-page="changelog"] #changelog-index-list a{
    flex:0 0 auto!important;min-height:40px!important;padding:8px 11px!important;border-radius:10px!important
  }
  body[data-page="changelog"] .changelog-timeline{min-width:0!important}

  /* Activity center becomes a bottom sheet. */
  body[data-page]:not([data-game]) .activity-panel{
    position:fixed!important;z-index:260!important;
    left:8px!important;right:8px!important;top:auto!important;
    bottom:max(8px,env(safe-area-inset-bottom))!important;
    width:auto!important;max-width:none!important;max-height:min(78dvh,680px)!important;
    border-radius:18px!important;overflow:auto!important
  }
  body[data-page]:not([data-game]) .activity-panel-head{position:sticky!important;top:0!important;z-index:2!important}
  body[data-page]:not([data-game]) .activity-tabs{
    display:flex!important;overflow-x:auto!important;gap:5px!important;scrollbar-width:none!important
  }
  body[data-page]:not([data-game]) .activity-tabs::-webkit-scrollbar{display:none}
  body[data-page]:not([data-game]) .activity-tabs button{flex:0 0 auto!important;min-height:40px!important}

  /* Footer */
  body[data-page]:not([data-game]) footer{
    display:grid!important;grid-template-columns:1fr!important;gap:14px!important;
    padding:24px 14px calc(24px + env(safe-area-inset-bottom))!important
  }
  body[data-page]:not([data-game]) .footer-brand p{font-size:10px!important}
  body[data-page]:not([data-game]) .footer-links{
    display:flex!important;gap:7px!important;overflow-x:auto!important;scrollbar-width:none!important
  }
  body[data-page]:not([data-game]) .footer-links::-webkit-scrollbar{display:none}
  body[data-page]:not([data-game]) .footer-links a{
    flex:0 0 auto!important;min-height:40px!important;display:flex!important;align-items:center!important;
    padding:7px 9px!important;border:1px solid #272727!important;border-radius:10px!important
  }
  body[data-page]:not([data-game]) .copyright{font-size:9px!important}
  body[data-page]:not([data-game]) .to-top{
    width:44px!important;height:44px!important;right:12px!important;
    bottom:max(12px,env(safe-area-inset-bottom))!important
  }
}

@media(max-width:390px){
  body[data-page]:not([data-game]) .main-nav{grid-template-columns:1fr!important}
  body[data-page]:not([data-game]) .page-actions,
  body[data-page]:not([data-game]) .hero-actions{grid-template-columns:1fr!important}
  body[data-page="home"] .official-strip{grid-template-columns:1fr!important}
  body[data-page="fanart"] .fanart-grid{grid-template-columns:1fr!important}
  body[data-page="data"] .data-kpi-grid{grid-template-columns:1fr!important}
}

@media(min-width:761px) and (max-width:1024px) and (pointer:coarse){
  body[data-page]:not([data-game]) :is(button,.btn,a[role="button"]){min-height:44px}
  body[data-page]:not([data-game]) .page-shell{width:min(calc(100% - 32px),var(--max))}
  body[data-page]:not([data-game]) .fanart-grid{gap:12px}
  body[data-page]:not([data-game]) .data-platform-tab{min-height:72px}
}

/* Mobile bottom navigation (browser + installed app). */
@media(max-width:760px){
  body.mobile-tabbar-mode:not([data-game]){
    padding-bottom:calc(78px + env(safe-area-inset-bottom))!important;
  }
  body.pwa-app-mode:not([data-game]){
    padding-bottom:calc(78px + env(safe-area-inset-bottom))!important;
  }
  body.mobile-tabbar-mode.pwa-app-more-open,
  body.pwa-ios-guide-open{overflow:hidden!important}

  body[data-page].mobile-tabbar-mode:not([data-game]) .nav-toggle{display:none!important}
  body[data-page].pwa-app-mode:not([data-game]) .site-header{
    padding-left:max(11px,env(safe-area-inset-left))!important;
    padding-right:max(11px,env(safe-area-inset-right))!important
  }
  body[data-page].pwa-app-mode:not([data-game]) .brand-mark{width:40px!important;height:40px!important}

  .pwa-app-tabbar{
    position:fixed;z-index:275;left:0;right:0;bottom:0;
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:start;
    min-height:calc(64px + env(safe-area-inset-bottom));
    padding:6px max(8px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    border-top:1px solid #2a2a2e;background:#0d0d0df7;
    box-shadow:0 -8px 24px #0007;backdrop-filter:blur(10px) saturate(1.08);
    transition:transform .2s ease,opacity .2s ease
  }
  .pwa-app-tabbar :is(a,button){
    appearance:none;display:flex;min-width:0;min-height:54px!important;
    align-items:center;justify-content:center;flex-direction:column;gap:3px;
    padding:5px 2px!important;border:0;border-radius:12px;background:transparent;
    color:#817d78;text-decoration:none;font:inherit;cursor:pointer
  }
  .pwa-app-tabbar svg{
    width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;
    stroke-linecap:round;stroke-linejoin:round
  }
  .pwa-app-tabbar span{font-size:9px;font-weight:900;white-space:nowrap;letter-spacing:-.02em}
  .pwa-app-tabbar :is(a,button).is-active{
    background:#ff6b1815;color:#ff9856
  }
  .pwa-app-tabbar :is(a,button).is-active svg{filter:drop-shadow(0 0 7px #ff6b184d)}
  body.pwa-app-keyboard-open .pwa-app-tabbar{
    opacity:0;pointer-events:none;transform:translateY(110%)
  }

  .pwa-app-more-backdrop{
    position:fixed;z-index:268;inset:0;
    background:#000a;backdrop-filter:blur(2px)
  }
  .pwa-app-more-backdrop[hidden]{display:none!important}
  .pwa-app-more-sheet{
    position:absolute;left:8px;right:8px;
    bottom:calc(70px + env(safe-area-inset-bottom));
    max-height:min(620px,calc(var(--mobile-visual-height,100dvh) - 92px));
    overflow:auto;overscroll-behavior:contain;
    padding:15px;border:1px solid #313136;border-radius:22px;
    background:linear-gradient(180deg,#171719,#101012);
    color:#f6f1ec;box-shadow:0 28px 90px #000d
  }
  .pwa-app-more-head{
    display:flex;align-items:center;justify-content:space-between;gap:14px;
    padding:2px 2px 13px
  }
  .pwa-app-more-head>div{display:flex;flex-direction:column;gap:2px}
  .pwa-app-more-head small{color:#ff8e47;font-size:8px;font-weight:950;letter-spacing:.16em}
  .pwa-app-more-head strong{font-size:20px;letter-spacing:-.04em}
  .pwa-app-more-close,.pwa-ios-guide-close{
    width:38px;height:38px!important;min-height:38px!important;padding:0!important;
    border:1px solid #343438;border-radius:12px;background:#202023;color:#ddd;
    font-size:24px;line-height:1;cursor:pointer
  }
  .pwa-app-more-grid{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px
  }
  .pwa-app-more-grid a{
    display:flex;flex-direction:column;justify-content:center;gap:4px;
    min-height:72px;padding:12px 13px;border:1px solid #29292d;border-radius:15px;
    background:#151517;color:#eee;text-decoration:none
  }
  .pwa-app-more-grid a span{font-size:13px;font-weight:900}
  .pwa-app-more-grid a small{font-size:9px;color:#77716c}
  .pwa-app-more-grid a.is-active{
    border-color:#ff6b1866;background:#22140d;color:#ff9b59
  }

  body.mobile-tabbar-mode .to-top{
    bottom:calc(82px + env(safe-area-inset-bottom))!important
  }
  body.mobile-tabbar-mode .pwa-install-chip,
  body.mobile-tabbar-mode .pwa-ios-install-chip,
  body.mobile-tabbar-mode .pwa-update-toast,
  body.mobile-tabbar-mode .deploy-sync-chip{
    bottom:calc(82px + env(safe-area-inset-bottom))!important
  }
  body.pwa-app-mode .daily-fortune-launcher,
  body.mobile-tabbar-mode .daily-fortune-launcher{
    bottom:calc(78px + env(safe-area-inset-bottom))!important
  }
  body.pwa-app-mode .pwa-update-toast{
    bottom:calc(76px + env(safe-area-inset-bottom))!important
  }
  body.pwa-app-mode .activity-panel,
  body.mobile-tabbar-mode .activity-panel{
    bottom:calc(74px + env(safe-area-inset-bottom))!important
  }

  .pwa-ios-install-chip{
    position:fixed;z-index:238;left:10px;bottom:max(10px,env(safe-area-inset-bottom));
    display:flex;align-items:center;gap:7px;min-height:42px!important;padding:0 12px!important;
    border:1px solid #ff7e3475;border-radius:999px;background:#0e0e0eee;color:#fff;
    box-shadow:0 12px 36px #0007;backdrop-filter:blur(12px);font:inherit;cursor:pointer
  }
  .pwa-ios-install-chip span{
    display:grid;place-items:center;width:22px;height:22px;border-radius:50%;
    background:#ff6b18;font-size:16px
  }
  .pwa-ios-install-chip strong{font-size:11px}
  .pwa-ios-guide-backdrop{
    position:fixed;z-index:310;inset:0;display:grid;align-items:end;
    padding:8px max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
    background:#000a;backdrop-filter:blur(6px)
  }
  .pwa-ios-guide-backdrop[hidden]{display:none!important}
  .pwa-ios-guide{
    position:relative;padding:20px 17px 18px;border:1px solid #343438;border-radius:22px;
    background:linear-gradient(180deg,#19191c,#101012);color:#f8f3ef;
    box-shadow:0 28px 90px #000d
  }
  .pwa-ios-guide>small{color:#ff914b;font-size:9px;font-weight:950;letter-spacing:.15em}
  .pwa-ios-guide h2{margin:7px 44px 16px 0;font-size:22px;line-height:1.15;letter-spacing:-.05em}
  .pwa-ios-guide-close{position:absolute;right:14px;top:14px}
  .pwa-ios-guide ol{display:grid;gap:9px;margin:0;padding:0;list-style:none}
  .pwa-ios-guide li{
    display:grid;grid-template-columns:30px minmax(0,1fr);align-items:center;gap:10px;
    padding:11px;border:1px solid #29292d;border-radius:14px;background:#151517
  }
  .pwa-ios-guide li b{
    display:grid;place-items:center;width:28px;height:28px;border-radius:9px;
    background:#ff6b1817;color:#ff9b5a;font-size:12px
  }
  .pwa-ios-guide li span{font-size:12px;line-height:1.5;color:#c9c2bc}

  [data-theme="light"] .pwa-app-tabbar{
    border-top-color:#ddd3ca;background:#fffaf6f2;color:#6f655e;
    box-shadow:0 -12px 34px #6d4c2a1c
  }
  [data-theme="light"] .pwa-app-tabbar :is(a,button){color:#84786f}
  [data-theme="light"] .pwa-app-tabbar :is(a,button).is-active{
    background:#ff6b1812;color:#d7570d
  }
  [data-theme="light"] .pwa-app-more-sheet,
  [data-theme="light"] .pwa-ios-guide{
    border-color:#ded5cd;background:linear-gradient(180deg,#fff,#f9f4ef);color:#261d17
  }
  [data-theme="light"] .pwa-app-more-grid a,
  [data-theme="light"] .pwa-ios-guide li{
    border-color:#e8dfd8;background:#fff;color:#342820
  }
  [data-theme="light"] .pwa-app-more-grid a small,
  [data-theme="light"] .pwa-ios-guide li span{color:#766b63}
  [data-theme="light"] .pwa-app-more-close,
  [data-theme="light"] .pwa-ios-guide-close{
    border-color:#ddd3cb;background:#f8f2ed;color:#493a30
  }
  [data-theme="light"] .pwa-ios-install-chip{
    border-color:#f19a6870;background:#fffaf6f3;color:#34251b
  }
}
@media(prefers-reduced-motion:reduce){
  .pwa-app-tabbar{transition:none!important}
}


@media(min-width:761px){
  .pwa-app-tabbar,
  .pwa-app-more-backdrop{display:none!important}
}
