/* v20260921_0315 · restored mobile focus + compact native toolbar + full game mirror */
.jukdol-mobile-only-control,#jukdolFocusExit{display:none}
@media (max-width:1024px){
  body[data-page-kind="game"] .jukdol-mobile-only-control{display:inline-flex!important;align-items:center!important;justify-content:center!important}
  body[data-page-kind="game"] .jukdol-mobile-control-active{box-shadow:inset 0 0 0 2px rgba(99,78,232,.28)!important;font-weight:950!important}

  /* Common top controls: larger, simpler, no overlap. */
  body[data-page-kind="game"].mobile-game-fit .game-titlebar,
  body[data-page-kind="game"].mobile-game-fit .fish-game-titlebar,
  body[data-page-kind="game"].mobile-game-fit .luck-topbar,
  body[data-page-kind="game"].mobile-game-fit .online-topbar,
  body[data-page-kind="game"].mobile-game-fit .dig-topbar{
    height:auto!important;min-height:0!important;max-height:none!important;flex-wrap:wrap!important;gap:8px!important;
    padding:8px 9px!important;padding-top:max(8px,env(safe-area-inset-top))!important;
  }
  body[data-page-kind="game"].mobile-game-fit .game-title-group,
  body[data-page-kind="game"].mobile-game-fit .fish-page-title,
  body[data-page-kind="game"].mobile-game-fit .luck-title,
  body[data-page-kind="game"].mobile-game-fit .online-title-wrap,
  body[data-page-kind="game"].mobile-game-fit .dig-title{width:100%!important;min-width:0!important;flex:0 0 100%!important}
  body[data-page-kind="game"].mobile-game-fit .fish-page-title small,
  body[data-page-kind="game"].mobile-game-fit .luck-title small,
  body[data-page-kind="game"].mobile-game-fit .online-title-wrap small,
  body[data-page-kind="game"].mobile-game-fit .dig-title small{display:none!important}
  body[data-page-kind="game"].mobile-game-fit .title-actions,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions{
    width:100%!important;max-width:none!important;flex:0 0 100%!important;margin:0!important;display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:7px!important;overflow:visible!important;align-items:stretch!important;
  }
  body[data-page-kind="game"].mobile-game-fit .title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>a{
    width:100%!important;min-width:0!important;min-height:48px!important;height:auto!important;padding:8px 5px!important;border-radius:12px!important;
    font-size:13px!important;line-height:1.1!important;white-space:nowrap!important;visibility:visible!important;opacity:1!important;
  }
  body[data-page-kind="game"].mobile-game-fit #onlineNetPill{min-height:48px!important;display:flex!important;align-items:center!important;justify-content:center!important;margin:0!important}
  /* Older one-screen CSS hid these controls. Keep the normal mobile toolbar complete. */
  body[data-view="online-game"].online-one-screen #onlineExpandBtn,
  body[data-view="online-game"].online-one-screen .online-top-actions [data-jukdol-bgm-button],
  body[data-view="online-game"].online-one-screen .online-top-actions [data-jukdol-sfx-button]{display:inline-flex!important}

  /* Horse racing: reduce the normal mobile clutter and make controls touch-friendly. */
  body[data-view="horse-racing"] .topbar{padding:8px!important;flex-wrap:wrap!important;gap:7px!important}
  body[data-view="horse-racing"] .topbar .brand{width:100%!important}
  body[data-view="horse-racing"] .topbar nav{width:100%!important;display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:6px!important}
  body[data-view="horse-racing"] .topbar nav>button,
  body[data-view="horse-racing"] .topbar nav>a{min-width:0!important;min-height:46px!important;padding:7px 5px!important;border-radius:12px!important;text-align:center!important;justify-content:center!important}
  body[data-view="horse-racing"] #raceScreen .toolbar{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;padding:8px!important}
  body[data-view="horse-racing"] #raceScreen .toolbar>div:first-child{display:none!important}
  body[data-view="horse-racing"] #raceScreen .toolbar>div:last-child{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin:0!important}
  body[data-view="horse-racing"] #raceScreen .toolbar button{min-width:0!important;min-height:44px!important;padding:7px 5px!important;border-radius:12px!important}
  body[data-view="horse-racing"] #raceScreen .race-info-overlay,
  body[data-view="horse-racing"] #raceScreen .leader-overlay,
  body[data-view="horse-racing"] #raceScreen .race-state-overlay{display:none!important}
  body[data-view="horse-racing"] #raceScreen .timer-overlay{top:8px!important;right:8px!important;left:auto!important;transform:none!important}

  /* Ball roulette top controls and race controls should not pile over each other. */
  body.ball-page .ball-topbar{padding:7px 8px!important;gap:7px!important;flex-wrap:wrap!important}
  body.ball-page .ball-brand{width:100%!important}
  body.ball-page .ball-top-actions{width:100%!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
  body.ball-page .ball-top-actions>.ball-head-btn,
  body.ball-page .ball-top-actions>.jukdol-mobile-only-control{width:100%!important;min-width:0!important;min-height:44px!important;height:44px!important;padding:0 6px!important;border-radius:12px!important;font-size:12px!important}
  /* Keep BGM/SFX visible in normal race view. Expansion mode hides the whole outer UI instead. */
  body.ball-page.race-active .ball-top-actions [data-jukdol-bgm-button],
  body.ball-page.race-active .ball-top-actions [data-jukdol-sfx-button]{display:inline-flex!important}
  body.ball-page.race-active .race-toolbar{min-height:0!important;padding:4px 4px 7px!important;gap:6px!important}
  body.ball-page.race-active .race-toolbar-copy{display:none!important}
  body.ball-page.race-active .race-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;width:100%!important}
  body.ball-page.race-active .race-actions>*{min-width:0!important}
  body.ball-page.race-active .race-actions .secondary-btn,
  body.ball-page.race-active .race-actions .primary-btn,
  body.ball-page.race-active .race-actions .speed-control{width:100%!important;min-height:42px!important;height:42px!important;padding:0 6px!important;font-size:11px!important;border-radius:11px!important}
  body.ball-page.race-active .speed-control{grid-column:1/-1!important}

  /* Custom board top buttons. */
  body[data-view="custom-board-game"] .cb-top-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;gap:6px!important}
  body[data-view="custom-board-game"] .cb-top-actions>.cb-btn{width:100%!important;min-width:0!important;min-height:44px!important;height:44px!important;font-size:10px!important;padding:0 4px!important}

  /* Only the game image/surface is mirrored. The surrounding controls stay readable. */
  body[data-page-kind="game"] .jukdol-mirror-surface{transform:scaleX(-1)!important;transform-origin:center center!important}

  /* Mobile focus mode: everything outside the live game surface disappears. */
  html.jukdol-mobile-focus-html,body.jukdol-mobile-focus{overflow:hidden!important;overscroll-behavior:none!important}
  body.jukdol-mobile-focus{height:100dvh!important;min-height:100dvh!important;background:#050810!important}
  body.jukdol-mobile-focus .jukdol-focus-surface{
    position:fixed!important;inset:0!important;z-index:2147482000!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;
    min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;
    background:#050810!important;overflow:hidden!important;transform-origin:center center!important;
  }
  body.jukdol-mobile-focus .jukdol-focus-surface.jukdol-mirror-surface{transform:scaleX(-1)!important}
  #jukdolFocusExit{
    position:fixed!important;z-index:2147483646!important;top:max(8px,env(safe-area-inset-top))!important;right:max(8px,env(safe-area-inset-right))!important;
    width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;padding:0!important;border:1px solid rgba(255,255,255,.22)!important;
    border-radius:50%!important;background:rgba(5,8,16,.42)!important;color:#fff!important;font:900 21px/1 system-ui,sans-serif!important;box-shadow:0 3px 12px rgba(0,0,0,.22)!important;
    backdrop-filter:blur(7px)!important;-webkit-backdrop-filter:blur(7px)!important;align-items:center!important;justify-content:center!important;
  }
  body.jukdol-mobile-focus #jukdolFocusExit{display:flex!important}

  /* Fill the viewport without bringing outer UI along. */
  body.jukdol-mobile-focus #fishingScene.jukdol-focus-surface,
  body.jukdol-mobile-focus #digWorld.jukdol-focus-surface{height:100dvh!important;min-height:0!important;max-height:none!important;border-radius:0!important}

  body.jukdol-mobile-focus #luckGameContent.jukdol-focus-surface{display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;padding:4px!important;overflow:hidden!important}
  body.jukdol-mobile-focus #onlineGameContent.jukdol-focus-surface{display:block!important;padding:4px!important;overflow:hidden!important}

  body.jukdol-mobile-focus[data-view="custom-board-game"] .cb-board-shell.jukdol-focus-surface{padding:2px!important;background:#e9effa!important}
  body.jukdol-mobile-focus[data-view="custom-board-game"] .cb-board-shell.jukdol-focus-surface .cb-board{width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;border-radius:0!important}

  /* Horse focus mode: canvas + dynamic race moments only. Hide the static HUD that was covering the race. */
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface{display:block!important;background:#07140f!important}
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface #raceCanvas{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;object-fit:contain!important;border-radius:0!important}
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface .race-info-overlay,
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface .timer-overlay,
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface .leader-overlay,
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface .race-state-overlay{display:none!important}

  /* Ball roulette focus mode: race itself fills the phone. Ranking/minimap/toolbars stay out of the picture. */
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface{display:block!important;background:#07101f!important}
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .race-view-hud,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .skill-feed,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .course-minimap-panel,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .course-minimap,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .ranking-card,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .track-caption,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .skip-remaining-btn{display:none!important}
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface #trackScroll{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-height:none!important;border-radius:0!important;overflow-y:auto!important}
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface #trackWorld{width:100%!important;min-height:100%!important}
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface #ballCanvas{width:100%!important;max-width:none!important;max-height:none!important;aspect-ratio:auto!important;border-radius:0!important}

  /* If focus is active, old full-screen classes must not add a second toolbar layer. */
  body.jukdol-mobile-focus.luck-expanded .luck-topbar,
  body.jukdol-mobile-focus.online-expanded .online-topbar,
  body.jukdol-mobile-focus.cb-expanded .cb-topbar,
  body.jukdol-mobile-focus.ball-page.game-expanded .race-toolbar{display:none!important}
}
@media (max-width:620px){
  body[data-page-kind="game"].mobile-game-fit .title-actions,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-page-kind="game"].mobile-game-fit .title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>a{min-height:50px!important;font-size:14px!important}
  body[data-view="horse-racing"] .topbar .brand{display:none!important}
  body[data-view="horse-racing"] .topbar nav{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-view="horse-racing"] .topbar nav>button,
  body[data-view="horse-racing"] .topbar nav>a{min-height:48px!important;font-size:13px!important}
  body.ball-page .ball-brand{display:none!important}
  body.ball-page .ball-top-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.ball-page.race-active .race-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body[data-view="custom-board-game"] .cb-top-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}


/* v20260920_1050 · mobile toolbar balance + horse race UI audit fixes */
@media (max-width:1024px){
  body[data-page-kind="game"].mobile-game-fit .title-actions,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions,
  body[data-view="horse-racing"] .topbar nav,
  body.ball-page .ball-top-actions,
  body[data-view="custom-board-game"] .cb-top-actions{
    display:flex!important;flex-wrap:wrap!important;align-items:stretch!important;justify-content:stretch!important;
    gap:7px!important;width:100%!important;max-width:none!important;overflow:visible!important;
  }
  body[data-page-kind="game"].mobile-game-fit .title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>#onlineNetPill,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>a,
  body[data-view="horse-racing"] .topbar nav>button,
  body[data-view="horse-racing"] .topbar nav>a,
  body.ball-page .ball-top-actions>button,
  body.ball-page .ball-top-actions>a,
  body[data-view="custom-board-game"] .cb-top-actions>button,
  body[data-view="custom-board-game"] .cb-top-actions>a{
    flex:1 1 112px!important;width:auto!important;min-width:0!important;max-width:none!important;
    min-height:46px!important;height:auto!important;padding:8px 8px!important;border-radius:12px!important;
    line-height:1.15!important;white-space:normal!important;word-break:keep-all!important;text-align:center!important;
  }
  body[data-view="horse-racing"] .topbar nav>a,
  body.ball-page .ball-top-actions>a{display:flex!important;align-items:center!important;justify-content:center!important}
  #jukdolFlipBtn{order:97!important}
  #jukdolExpandBtn{order:98!important}
  #backToHubFromGameBtn,#backToHubFromFishGameBtn,#backToHubFromLuckBtn,#leaveOnlineBtn,#backToHubFromDigBtn,#cbBackBtn,
  body[data-view="horse-racing"] .topbar nav>a[href="/"],body.ball-page .ball-top-actions>a[href="/"]{order:99!important}
  body[data-view="horse-racing"] .race-grid aside{position:static!important;inset:auto!important;width:100%!important;margin-top:8px!important;display:block!important}
  body[data-view="horse-racing"] .race-grid aside .rank{padding:10px!important}
  body[data-view="horse-racing"] .race-grid aside .rank ol{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(130px,1fr))!important;gap:6px!important}
  body[data-view="horse-racing"] .race-grid aside .feed{display:none!important}
}
@media (max-width:620px){
  body[data-view="horse-racing"] .topbar nav,
  body.ball-page .ball-top-actions,
  body[data-view="custom-board-game"] .cb-top-actions,
  body[data-page-kind="game"].mobile-game-fit .title-actions,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions{display:flex!important;flex-wrap:wrap!important;gap:7px!important}
  body[data-view="horse-racing"] .topbar nav>button,
  body[data-view="horse-racing"] .topbar nav>a,
  body.ball-page .ball-top-actions>button,
  body.ball-page .ball-top-actions>a,
  body[data-view="custom-board-game"] .cb-top-actions>button,
  body[data-view="custom-board-game"] .cb-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>a,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>button,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>a,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>button,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>a{flex:1 1 112px!important;min-height:48px!important;font-size:13px!important}
}

/* Final responsive pass after auditing every game toolbar at phone/tablet widths. */
@media (max-width:1024px){
  body[data-page-kind="game"].mobile-game-fit .game-titlebar,
  body[data-page-kind="game"].mobile-game-fit .fish-game-titlebar,
  body[data-page-kind="game"].mobile-game-fit .luck-topbar,
  body[data-page-kind="game"].mobile-game-fit .online-topbar,
  body[data-page-kind="game"].mobile-game-fit .dig-topbar{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    justify-content:flex-start!important;
  }
}

@media (min-width:621px) and (max-width:1024px){
  body[data-page-kind="game"].mobile-game-fit .title-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
  body[data-page-kind="game"].mobile-game-fit .online-top-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body[data-view="horse-racing"] .topbar nav{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important}
  body.ball-page .ball-top-actions{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important}
  body[data-view="custom-board-game"] .cb-top-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
}

@media (max-width:620px){
  body[data-page-kind="game"].mobile-game-fit .title-actions,
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions,
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions,
  body[data-page-kind="game"].mobile-game-fit .online-top-actions,
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions,
  body[data-view="horse-racing"] .topbar nav,
  body.ball-page .ball-top-actions,
  body[data-view="custom-board-game"] .cb-top-actions{
    display:grid!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:7px!important;
    justify-content:stretch!important;
  }

  body[data-page-kind="game"].mobile-game-fit .title-actions>*:not([hidden]),
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>*:not([hidden]),
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>*:not([hidden]),
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>*:not([hidden]),
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>*:not([hidden]),
  body[data-view="horse-racing"] .topbar nav>*:not([hidden]),
  body.ball-page .ball-top-actions>*:not([hidden]),
  body[data-view="custom-board-game"] .cb-top-actions>*:not([hidden]){
    grid-column:span 2!important;
    width:100%!important;
    max-width:none!important;
  }

  /* If the final row contains two controls, let them split the full row evenly. */
  body[data-page-kind="game"].mobile-game-fit .title-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-view="horse-racing"] .topbar nav>*:nth-last-child(2):nth-child(3n+1),
  body.ball-page .ball-top-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-view="custom-board-game"] .cb-top-actions>*:nth-last-child(2):nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .title-actions>*:last-child:nth-child(3n+2),
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>*:last-child:nth-child(3n+2),
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>*:last-child:nth-child(3n+2),
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>*:last-child:nth-child(3n+2),
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>*:last-child:nth-child(3n+2),
  body[data-view="horse-racing"] .topbar nav>*:last-child:nth-child(3n+2),
  body.ball-page .ball-top-actions>*:last-child:nth-child(3n+2),
  body[data-view="custom-board-game"] .cb-top-actions>*:last-child:nth-child(3n+2){grid-column:span 3!important}

  /* A single final control (normally 게임랜드) is centered instead of hanging on one side. */
  body[data-page-kind="game"].mobile-game-fit .title-actions>*:last-child:nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .fish-title-actions>*:last-child:nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .luck-top-actions>*:last-child:nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .online-top-actions>*:last-child:nth-child(3n+1),
  body[data-page-kind="game"].mobile-game-fit .dig-title-actions>*:last-child:nth-child(3n+1),
  body[data-view="horse-racing"] .topbar nav>*:last-child:nth-child(3n+1),
  body.ball-page .ball-top-actions>*:last-child:nth-child(3n+1),
  body[data-view="custom-board-game"] .cb-top-actions>*:last-child:nth-child(3n+1){
    grid-column:2 / span 4!important;
    width:100%!important;
  }
}

/* Preserve each game's natural DOM order; the mirror/expand controls are already inserted before the home button. */
@media (max-width:1024px){
  #jukdolFlipBtn,#jukdolExpandBtn,
  #backToHubFromGameBtn,#backToHubFromFishGameBtn,#backToHubFromLuckBtn,#leaveOnlineBtn,#backToHubFromDigBtn,#cbBackBtn,
  body[data-view="horse-racing"] .topbar nav>a[href="/"],body.ball-page .ball-top-actions>a[href="/"]{order:0!important}
}


/* v20260920_1050 · digging mobile control repair
   Normal mobile: reserve a permanent control row so the drill is always reachable.
   Expanded mobile: expand the whole game screen, not only #digWorld, so the drill button stays on screen. */
@media (max-width:1024px){
  body[data-view="dig-game"] .dig-topbar{
    position:relative!important;top:auto!important;display:flex!important;flex-direction:column!important;
    align-items:stretch!important;gap:6px!important;padding:6px 7px!important;min-height:0!important;
  }
  body[data-view="dig-game"] .dig-title{width:100%!important;min-height:38px!important}
  body[data-view="dig-game"] .dig-title small{display:none!important}
  body[data-view="dig-game"] .dig-title h2{font-size:16px!important;margin:0!important}
  body[data-view="dig-game"] .dig-title-icon{width:38px!important;height:38px!important;flex:0 0 38px!important}
  body[data-view="dig-game"] .dig-title-actions{
    width:100%!important;margin:0!important;display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;
  }
  body[data-view="dig-game"] .dig-title-actions>*{
    grid-column:auto!important;order:0!important;width:100%!important;min-width:0!important;max-width:none!important;
    min-height:40px!important;height:40px!important;padding:4px 3px!important;border-radius:10px!important;
    font-size:10px!important;line-height:1.05!important;white-space:nowrap!important;
  }
  body[data-view="dig-game"] .dig-statbar{padding:4px 5px!important;gap:4px!important}
  body[data-view="dig-game"] .dig-hud{padding:5px 6px!important;border-radius:9px!important}
  body[data-view="dig-game"] .dig-hud strong{font-size:12px!important}
  body[data-view="dig-game"] .dig-hud small{display:none!important}

  body.jukdol-safe-game[data-view="dig-game"] .dig-game-screen:not(.hidden){
    display:grid!important;width:100%!important;height:100%!important;min-height:0!important;max-height:100%!important;
    grid-template-rows:auto auto minmax(190px,1fr) 150px!important;overflow:hidden!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-world{
    width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;overflow:hidden!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-bottom-zone{
    display:grid!important;grid-template-columns:1fr!important;grid-template-areas:"controls" "result"!important;
    grid-template-rows:76px 66px!important;height:150px!important;min-height:150px!important;max-height:150px!important;
    gap:4px!important;padding:4px 5px calc(4px + env(safe-area-inset-bottom))!important;overflow:hidden!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-control-deck{
    grid-area:controls!important;display:grid!important;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr)!important;
    grid-template-areas:"progress start"!important;gap:5px!important;width:100%!important;height:76px!important;min-height:76px!important;
    position:static!important;inset:auto!important;padding:0!important;background:none!important;box-shadow:none!important;backdrop-filter:none!important;
    z-index:80!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-progress{
    grid-area:progress!important;height:76px!important;min-height:76px!important;padding:7px!important;border-radius:12px!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-start-btn{
    grid-area:start!important;display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;
    width:100%!important;height:76px!important;min-height:76px!important;margin:0!important;padding:7px 8px!important;border-radius:13px!important;
    position:relative!important;z-index:90!important;touch-action:none!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-start-btn strong{font-size:12px!important;line-height:1.15!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-start-btn small{font-size:6px!important}
  body.jukdol-safe-game[data-view="dig-game"] .drill-button-icon{width:38px!important;height:38px!important;flex:0 0 38px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-toast{display:none!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-result-card{
    grid-area:result!important;width:100%!important;height:66px!important;min-height:66px!important;padding:5px 6px 5px 70px!important;border-radius:12px!important;
  }
  body.jukdol-safe-game[data-view="dig-game"] .dig-result-icon{left:5px!important;top:16px!important;width:61px!important;height:48px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-result-copy strong{font-size:12px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-result-copy b{font-size:8px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-result-copy p{display:none!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-tier-rail{display:none!important}
}

@media (max-width:620px){
  body[data-view="dig-game"] .dig-title-actions{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body[data-view="dig-game"] .dig-title-actions>*{grid-column:auto!important;font-size:9px!important;min-height:39px!important;height:39px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-game-screen:not(.hidden){grid-template-rows:auto auto minmax(170px,1fr) 146px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-bottom-zone{height:146px!important;min-height:146px!important;max-height:146px!important;grid-template-rows:74px 64px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-control-deck,
  body.jukdol-safe-game[data-view="dig-game"] .dig-progress,
  body.jukdol-safe-game[data-view="dig-game"] .dig-start-btn{height:74px!important;min-height:74px!important}
  body.jukdol-safe-game[data-view="dig-game"] .dig-result-card{height:64px!important;min-height:64px!important}
}

/* Focus/expand mode: scene + drill control only. */
@media (max-width:1024px){
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface{
    display:grid!important;grid-template-rows:minmax(0,1fr) 112px!important;
    width:100vw!important;height:100dvh!important;min-height:0!important;max-height:none!important;
    padding:0!important;margin:0!important;background:#07101a!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-topbar,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-statbar{display:none!important}
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>#digWorld{
    display:block!important;position:relative!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
    margin:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-bottom-zone{
    display:block!important;width:100%!important;height:112px!important;min-height:112px!important;max-height:112px!important;
    padding:7px 8px calc(7px + env(safe-area-inset-bottom))!important;margin:0!important;background:rgba(7,12,19,.97)!important;
    border-top:1px solid rgba(255,255,255,.12)!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-result-card,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-tier-rail{display:none!important}
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-control-deck{
    display:grid!important;grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr)!important;grid-template-areas:"progress start"!important;
    gap:7px!important;width:100%!important;height:96px!important;min-height:96px!important;padding:0!important;margin:0!important;
    position:static!important;background:none!important;box-shadow:none!important;backdrop-filter:none!important;z-index:2147482500!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-progress,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-start-btn{
    height:96px!important;min-height:96px!important;max-height:96px!important;margin:0!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-start-btn{
    display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;z-index:2147482600!important;
    font-size:14px!important;border-radius:16px!important;touch-action:none!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-start-btn strong{font-size:15px!important}
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-start-btn small{font-size:7px!important}
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .drill-button-icon{width:48px!important;height:48px!important;flex:0 0 48px!important;font-size:24px!important}
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-toast{display:none!important}
}


/* v20260921_0315 FINAL OVERRIDES
   Keep native DOM in place. Compact the toolbar only in normal mobile view.
   Expansion is a true viewport overlay; outer UI is hidden behind a backdrop. */
#jukdolFocusBackdrop{display:none;position:fixed;inset:0;z-index:2147481800;background:#050810}
body.jukdol-mobile-focus #jukdolFocusBackdrop.active{display:block!important}
body.jukdol-mobile-focus .jukdol-focus-ancestor{
  transform:none!important;translate:none!important;scale:none!important;rotate:none!important;
  filter:none!important;perspective:none!important;contain:none!important;will-change:auto!important;
  position:relative!important;z-index:2147481900!important;isolation:auto!important;
  overflow:visible!important;clip:auto!important;clip-path:none!important;
}

@media (max-width:1024px){
  /* The mirror applies to the whole in-game surface, including in-game labels and controls. */
  body[data-page-kind="game"] .jukdol-mirror-surface{
    transform:scaleX(-1)!important;transform-origin:center center!important;
  }
  /* Never counter-flip fishing HUD/control text. It must mirror together with the game. */
  body[data-page-kind="game"] #fishingScene.jukdol-mirror-surface>*{
    scale:1 1!important;
  }

  /* Current game's native action row only. No DOM moving, no parent grid rewrite. */
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar{
    display:grid!important;grid-template-columns:repeat(12,minmax(0,1fr))!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    flex:0 0 100%!important;margin:0!important;padding:0!important;gap:5px!important;
    overflow:visible!important;visibility:visible!important;opacity:1!important;
  }
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar>button,
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar>a,
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar>#onlineNetPill{
    display:flex!important;align-items:center!important;justify-content:center!important;
    width:100%!important;min-width:0!important;max-width:none!important;height:38px!important;min-height:38px!important;
    margin:0!important;padding:4px 5px!important;border-radius:10px!important;
    visibility:visible!important;opacity:1!important;pointer-events:auto!important;
    font-size:10.5px!important;line-height:1.05!important;font-weight:900!important;
    white-space:normal!important;word-break:keep-all!important;text-align:center!important;
    position:relative!important;inset:auto!important;transform:none!important;float:none!important;order:0!important;
  }
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="1"]>*{grid-column:span 12!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="2"]>*{grid-column:span 6!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="3"]>*{grid-column:span 4!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="4"]>*{grid-column:span 3!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="5"]>*{grid-column:span 4!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="5"]>*:nth-last-child(-n+2){grid-column:span 6!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="6"]>*{grid-column:span 4!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="7"]>*{grid-column:span 3!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="7"]>*:nth-last-child(-n+3){grid-column:span 4!important}
  body[data-page-kind="game"] .jukdol-native-mobile-toolbar[data-jukdol-count="8"]>*{grid-column:span 3!important}

  /* Keep title bars compact without changing their DOM hierarchy. */
  body[data-page-kind="game"] .game-titlebar,
  body[data-page-kind="game"] .fish-game-titlebar,
  body[data-page-kind="game"] .luck-topbar,
  body[data-page-kind="game"] .online-topbar,
  body[data-page-kind="game"] .dig-topbar{
    height:auto!important;min-height:0!important;max-height:none!important;
    display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;gap:5px!important;
    padding:5px 7px!important;overflow:visible!important;
  }
  body[data-page-kind="game"] .game-title-group,
  body[data-page-kind="game"] .fish-page-title,
  body[data-page-kind="game"] .luck-title,
  body[data-page-kind="game"] .online-title-wrap,
  body[data-page-kind="game"] .dig-title{
    width:100%!important;flex:0 0 100%!important;min-width:0!important;min-height:34px!important;
    margin:0!important;padding:0!important;
  }
  body[data-page-kind="game"] .fish-page-title small,
  body[data-page-kind="game"] .luck-title small,
  body[data-page-kind="game"] .online-title-wrap small,
  body[data-page-kind="game"] .dig-title small{display:none!important}

  /* Digging normal mobile: spend vertical space on the actual cave, not the chrome. */
  body[data-view="dig-game"] #digGameScreen:not(.hidden){
    display:grid!important;height:100dvh!important;min-height:100dvh!important;max-height:100dvh!important;
    grid-template-rows:auto auto minmax(250px,1fr) 142px!important;overflow:hidden!important;
  }
  body[data-view="dig-game"] .dig-title-actions.jukdol-native-mobile-toolbar>button{height:36px!important;min-height:36px!important;font-size:9.5px!important}
  body[data-view="dig-game"] .dig-statbar{padding:3px 5px!important;gap:4px!important}
  body[data-view="dig-game"] .dig-hud{padding:4px 6px!important;border-radius:8px!important}
  body[data-view="dig-game"] .dig-hud span{font-size:6.5px!important}
  body[data-view="dig-game"] .dig-hud strong{font-size:11px!important;margin:1px 0!important}
  body[data-view="dig-game"] .dig-hud small{display:none!important}
  body[data-view="dig-game"] #digWorld{height:100%!important;min-height:0!important;max-height:none!important}
  body[data-view="dig-game"] .dig-bottom-zone{
    height:142px!important;min-height:142px!important;max-height:142px!important;
    grid-template-areas:"controls" "result"!important;grid-template-rows:72px 62px!important;
    padding:4px 5px calc(4px + env(safe-area-inset-bottom))!important;gap:4px!important;overflow:hidden!important;
  }
  body[data-view="dig-game"] .dig-tier-rail{display:none!important}
  body[data-view="dig-game"] .dig-control-deck{height:72px!important;min-height:72px!important;grid-area:controls!important}
  body[data-view="dig-game"] .dig-progress,
  body[data-view="dig-game"] .dig-start-btn{height:72px!important;min-height:72px!important;max-height:72px!important}
  body[data-view="dig-game"] .dig-result-card{grid-area:result!important;height:62px!important;min-height:62px!important;max-height:62px!important}

  /* Expansion: hide every outer title/action layer instead of letting it scroll over the game. */
  body.jukdol-mobile-focus .game-titlebar,
  body.jukdol-mobile-focus .fish-game-titlebar,
  body.jukdol-mobile-focus .luck-topbar,
  body.jukdol-mobile-focus .online-topbar,
  body.jukdol-mobile-focus .dig-topbar,
  body.jukdol-mobile-focus .topbar,
  body.jukdol-mobile-focus .ball-topbar,
  body.jukdol-mobile-focus .cb-topbar,
  body.jukdol-mobile-focus .race-toolbar{
    display:none!important;visibility:hidden!important;pointer-events:none!important;
  }

  body.jukdol-mobile-focus .jukdol-focus-surface{
    position:fixed!important;inset:0!important;z-index:2147482000!important;
    width:100vw!important;height:100dvh!important;min-width:0!important;min-height:0!important;
    max-width:none!important;max-height:none!important;margin:0!important;padding:0!important;
    border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus #luckGameContent.jukdol-focus-surface,
  body.jukdol-mobile-focus #onlineGameContent.jukdol-focus-surface{
    width:100vw!important;height:100dvh!important;padding:0!important;box-sizing:border-box!important;
    overflow:auto!important;-webkit-overflow-scrolling:touch!important;
  }


  /* Force the expanded target itself to become the viewport overlay even when game CSS declares position:relative !important. */
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface,
  body.jukdol-mobile-focus[data-view="fish-game"] #fishingScene.jukdol-focus-surface,
  body.jukdol-mobile-focus[data-view="luck-game"] #luckGameContent.jukdol-focus-surface,
  body.jukdol-mobile-focus[data-view="online-game"] #onlineGameContent.jukdol-focus-surface,
  body.jukdol-mobile-focus[data-view="custom-board-game"] .cb-board-shell.jukdol-focus-surface,
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface{
    position:fixed!important;inset:0!important;left:0!important;top:0!important;right:0!important;bottom:0!important;
    width:100vw!important;height:100dvh!important;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;
    margin:0!important;box-sizing:border-box!important;
  }

  /* Dig expansion: cave fills the screen and the drill control remains pinned at the bottom. */
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface{
    display:grid!important;grid-template-rows:minmax(0,1fr) 104px!important;
    background:#07101a!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-topbar,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-statbar,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-side-panel,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-museum-panel{
    display:none!important;
  }
  /* Discovery result must remain visible while the dig game is expanded. */
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-discovery-overlay{
    display:grid!important;position:fixed!important;inset:0!important;
    width:100vw!important;height:100dvh!important;margin:0!important;padding:16px!important;
    z-index:2147483200!important;box-sizing:border-box!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-discovery-overlay:not(.show){
    opacity:0!important;visibility:hidden!important;pointer-events:none!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-discovery-overlay.show{
    opacity:1!important;visibility:visible!important;pointer-events:none!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-discovery-overlay .discovery-card{
    width:min(390px,88vw)!important;max-height:min(520px,76dvh)!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>#digWorld{
    display:block!important;width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
    margin:0!important;border:0!important;border-radius:0!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface>.dig-bottom-zone{
    display:block!important;width:100%!important;height:104px!important;min-height:104px!important;max-height:104px!important;
    padding:5px 7px calc(5px + env(safe-area-inset-bottom))!important;margin:0!important;
    background:#09111b!important;border-top:1px solid rgba(255,255,255,.1)!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-result-card,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-tier-rail,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-toast{display:none!important}
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-control-deck{
    display:grid!important;grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr)!important;grid-template-areas:"progress start"!important;
    gap:6px!important;width:100%!important;height:90px!important;min-height:90px!important;margin:0!important;padding:0!important;
    position:static!important;background:none!important;box-shadow:none!important;backdrop-filter:none!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-progress,
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-start-btn{
    display:flex!important;height:90px!important;min-height:90px!important;max-height:90px!important;margin:0!important;
    visibility:visible!important;opacity:1!important;pointer-events:auto!important;
  }
  body.jukdol-mobile-focus[data-view="dig-game"] #digGameScreen.jukdol-focus-surface .dig-start-btn{z-index:2147482600!important;touch-action:none!important}
}

/* v20260921_0315 · result-centering / ball-fit / landscape expand corrections */
@media (max-width:1024px){
  /* Fishing result: every species stays fully visible and centered. */
  body[data-view="fish-game"] #fishingScene .caught-fish,
  body[data-view="fish-game"] #fishingScene .caught-fish.jumping,
  body[data-view="fish-game"] #fishingScene .caught-fish.winner,
  body[data-view="fish-game"] #fishingScene .caught-fish.blank-fish,
  body[data-view="fish-game"] #fishingScene .caught-fish.legendary{
    left:50%!important;top:51%!important;right:auto!important;bottom:auto!important;
    width:min(72vw,520px)!important;height:min(30dvh,300px)!important;
    max-width:calc(100% - 40px)!important;max-height:34dvh!important;
    translate:-50% -50%!important;transform:none!important;overflow:visible!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
  }
  body[data-view="fish-game"] #fishingScene .caught-fish .chibi-fish-art{
    position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
    display:flex!important;align-items:center!important;justify-content:center!important;
    overflow:visible!important;transform:none!important;
  }
  body[data-view="fish-game"] #fishingScene .caught-fish .fish-photo,
  body[data-view="fish-game"] #fishingScene .caught-fish .chibi-fish-art img,
  body[data-view="fish-game"] #fishingScene .caught-fish .chibi-fish-art svg{
    display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;
    object-fit:contain!important;object-position:center center!important;overflow:visible!important;
  }
  body.jukdol-mobile-focus[data-view="fish-game"] #fishingScene.jukdol-focus-surface .caught-fish{
    top:53%!important;width:min(68vw,560px)!important;height:min(32dvh,320px)!important;max-width:calc(100vw - 56px)!important;
  }
  body.jukdol-mobile-focus[data-view="fish-game"] #fishingScene.jukdol-focus-surface .fish-result-card{
    top:9%!important;left:50%!important;right:auto!important;bottom:auto!important;
    width:min(92vw,680px)!important;max-width:min(92vw,680px)!important;min-width:0!important;
    transform:translateX(-50%)!important;text-align:left!important;
  }
  body.jukdol-mobile-focus[data-view="fish-game"] #fishingScene.jukdol-focus-surface .fish-control-deck{
    left:50%!important;right:auto!important;bottom:5.5%!important;transform:translateX(-50%)!important;
    width:min(88vw,650px)!important;align-items:center!important;
  }
  body.jukdol-mobile-focus[data-view="fish-game"] #fishingScene.jukdol-focus-surface .fish-toast{display:none!important}

  /* Ball roulette normal mobile: one compact toolbar, no duplicate top chrome. */
  body.ball-page.race-active .ball-topbar{display:none!important}
  body.ball-page.race-active .race-section{padding:5px!important}
  body.ball-page.race-active .race-toolbar{
    display:block!important;min-height:0!important;padding:0 0 5px!important;margin:0!important;
  }
  body.ball-page.race-active .race-toolbar-copy{display:none!important}
  body.ball-page.race-active .race-actions.jukdol-native-mobile-toolbar{
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;
    padding:0!important;margin:0!important;
  }
  body.ball-page.race-active .race-actions.jukdol-native-mobile-toolbar>*{
    min-width:0!important;width:100%!important;height:38px!important;min-height:38px!important;max-height:38px!important;
    padding:3px 5px!important;font-size:10px!important;border-radius:10px!important;overflow:hidden!important;
  }
  body.ball-page.race-active .race-actions.jukdol-native-mobile-toolbar .speed-control{
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:4px!important;
  }
  body.ball-page.race-active .race-actions.jukdol-native-mobile-toolbar .speed-control span{font-size:9px!important}
  body.ball-page.race-active .race-actions.jukdol-native-mobile-toolbar .speed-control select{min-width:0!important;width:auto!important;height:28px!important;padding:0 18px 0 5px!important;font-size:10px!important}
  body.ball-page.race-active .track-card{height:calc(100dvh - 92px)!important;min-height:420px!important}

  /* 공 룰렛 확대: 코스 높이와 화면 높이를 분리하여 카메라 추적을 유지한다. */
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface{
    display:grid!important;place-items:center!important;background:#090d18!important;padding:8px!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface #trackScroll{
    position:absolute!important;inset:0!important;display:block!important;
    width:100%!important;height:100%!important;min-height:0!important;aspect-ratio:auto!important;
    max-width:100%!important;max-height:100%!important;margin:0!important;overflow:hidden!important;border-radius:0!important;
  }
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface #trackWorld{
    position:relative!important;width:100%!important;min-height:100%!important;max-height:none!important;margin:0!important;
  }
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface #ballCanvas{
    position:sticky!important;top:0!important;width:100%!important;max-width:100%!important;max-height:none!important;
    aspect-ratio:auto!important;border-radius:12px!important;
  }
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .race-view-hud{
    top:10px!important;left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:min(88vw,520px)!important;z-index:40!important;
  }
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .skill-feed,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .course-minimap-panel,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .ranking-card,
  body.jukdol-mobile-focus.ball-page .track-card.jukdol-focus-surface .track-caption{display:none!important}

  /* Horse intro card must not cover the runner, mirrored or not. */
  body[data-view="horse-racing"] .track .horse-intro{
    left:50%!important;bottom:8px!important;width:min(520px,88%)!important;transform:translateX(-50%)!important;
  }
  body[data-view="horse-racing"] .track .intro-plate{grid-template-columns:56px minmax(0,1fr) 72px!important;border-radius:12px!important}
  body[data-view="horse-racing"] .track .intro-kicker{padding:4px 8px!important;font-size:8px!important}
  body[data-view="horse-racing"] .track .intro-number{min-height:56px!important;font-size:34px!important}
  body[data-view="horse-racing"] .track .intro-copy{padding:6px 8px!important}
  body[data-view="horse-racing"] .track .intro-copy small{font-size:9px!important}
  body[data-view="horse-racing"] .track .intro-copy strong{font-size:16px!important;margin-top:1px!important}
  body[data-view="horse-racing"] .track .intro-skill{padding:4px!important}
  body[data-view="horse-racing"] .track .intro-skill-art{width:52px!important;height:34px!important}
  body[data-view="horse-racing"] .track .intro-skill b{font-size:9px!important}
}

/* Landscape-priority expand for horse racing, Lucky Card 9 and Thief Catch. */
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="horse-racing"] .track.jukdol-focus-surface,
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="luck-game"][data-boot-game="scratch"] #luckGameContent.jukdol-focus-surface,
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="luck-game"][data-boot-game="yabawi"] #luckGameContent.jukdol-focus-surface{
  width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;overflow:hidden!important;
}
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="luck-game"][data-boot-game="scratch"] #luckGameContent.jukdol-focus-surface .scratch-broadcast-shell,
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="luck-game"][data-boot-game="scratch"] #luckGameContent.jukdol-focus-surface .scratch-stage{
  width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;overflow:auto!important;
}
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="luck-game"][data-boot-game="yabawi"] #luckGameContent.jukdol-focus-surface{
  padding:6px!important;overflow:auto!important;
}
body.jukdol-mobile-focus.jukdol-landscape-focus[data-view="luck-game"][data-boot-game="yabawi"] .yabawi-stage{
  height:min(74dvh,540px)!important;max-height:74dvh!important;margin-top:2px!important;
}

/* Fallback when the browser refuses Screen Orientation API. Render the expanded surface as landscape inside portrait. */
body.jukdol-mobile-focus.jukdol-landscape-fallback .jukdol-focus-surface{
  left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;
  width:100dvh!important;height:100vw!important;max-width:none!important;max-height:none!important;
  transform:translate(-50%,-50%) rotate(90deg)!important;transform-origin:center center!important;
}
body.jukdol-mobile-focus.jukdol-landscape-fallback .jukdol-focus-surface.jukdol-mirror-surface{
  transform:translate(-50%,-50%) rotate(90deg) scaleX(-1)!important;
}

@media (max-width:1024px){
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface{
    display:grid!important;place-items:center!important;background:#06100d!important;overflow:hidden!important;
  }
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface #raceCanvas{
    width:min(100vw,calc(100dvh * 1.7647059))!important;height:auto!important;max-width:100vw!important;max-height:100dvh!important;
    aspect-ratio:1200/680!important;object-fit:contain!important;margin:auto!important;
  }
  body.jukdol-mobile-focus[data-view="horse-racing"] .track.jukdol-focus-surface .horse-intro{
    width:min(500px,74%)!important;bottom:8px!important;
  }
}
