/* Mobile profile and embedded planner shell repair — 2026-11-05.
   Kept separate from general Arcade/mobile rules; loaded after all site styles. */

/* GrowID player profile: its desktop five-track stat strip overflowed inside
   the narrow header and was clipped by the country-flag background panel. */
@media (max-width: 930px) {
  body[data-theme="glass"] #modal-root .dialog.v5-profile-dialog {
    box-sizing:border-box!important;
    width:min(100% - 16px, 720px)!important;
    max-width:calc(100vw - 16px)!important;
    min-width:0!important;
    max-height:calc(100dvh - 18px)!important;
    height:auto!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding:12px!important;
    border-radius:16px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 42px!important;
    grid-template-rows:auto auto!important;
    gap:12px 8px!important;
    width:100%!important;min-width:0!important;
    margin:0 0 12px!important;
    padding:12px!important;
    overflow:hidden!important;
    align-items:start!important;
    border-radius:13px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head > .title-icon {
    grid-column:1!important;grid-row:1!important;
    display:flex!important;align-items:center!important;flex-wrap:wrap!important;
    min-width:0!important;max-width:100%!important;
    width:100%!important;gap:8px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head .title-icon > div {
    min-width:0!important;max-width:100%!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head .title-icon h2 {
    font-size:clamp(20px,5vw,26px)!important;
    line-height:1.15!important;overflow-wrap:anywhere!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head > .close {
    grid-column:2!important;grid-row:1!important;
    justify-self:end!important;align-self:start!important;
    position:relative!important;z-index:2!important;
    width:42px!important;height:42px!important;min-width:42px!important;
    margin:0!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head > .v60-profile-quickstats.v73-profile-quickstats {
    grid-column:1/-1!important;grid-row:2!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;width:100%!important;min-width:0!important;
    margin:0!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-quickstat {
    display:grid!important;
    grid-template-columns:clamp(23px,5vw,31px) minmax(0,1fr)!important;
    align-items:center!important;gap:7px!important;
    box-sizing:border-box!important;
    min-width:0!important;max-width:100%!important;
    width:100%!important;min-height:58px!important;
    padding:8px 7px!important;border-radius:11px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-stat-3 {
    grid-column:1/-1!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-quickstat-icon,
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-stat-text {
    min-width:0!important;max-width:100%!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-quickstat-icon img,
  body[data-theme="glass"] #modal-root .v73-percent-icon {
    width:clamp(23px,5vw,31px)!important;
    height:clamp(23px,5vw,31px)!important;
    max-width:100%!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-stat-text small {
    font-size:clamp(9px,1.5vw,11px)!important;
    font-weight:800!important;letter-spacing:0!important;
    white-space:normal!important;overflow-wrap:anywhere!important;
    line-height:1.2!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-stat-text b {
    font-size:clamp(17px,3.3vw,23px)!important;
    line-height:1.2!important;
    max-width:100%!important;
    white-space:normal!important;overflow-wrap:anywhere!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v60-summary-layout,
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v60-highlights {
    min-width:0!important;max-width:100%!important;box-sizing:border-box!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v60-highlights {
    padding:12px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v60-highlights-columns {
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;
    min-width:0!important;gap:9px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog :is(.v60-highlight-group,.v59-achievement,.v59-dc-achievement) {
    min-width:0!important;max-width:100%!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog :is(.v59-achievement,.v59-dc-achievement) strong {
    overflow-wrap:anywhere!important;
  }
}
@media(max-width:480px){
  body[data-theme="glass"] #modal-root .dialog.v5-profile-dialog {
    width:calc(100vw - 10px)!important;max-width:calc(100vw - 10px)!important;
    padding:8px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .dialog-head.v60-profile-head {
    padding:10px 9px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v73-profile-quickstats .v60-quickstat {
    min-height:56px!important;padding:6px!important;gap:5px!important;
  }
  body[data-theme="glass"] #modal-root .v5-profile-dialog .v60-highlights {padding:10px!important}
}

/* Parent website iframe must occupy the phone's entire visible workspace.
   Site navigation stays above the iframe and is not duplicated inside it.
   Do not alter desktop or affect World Planner. */
@media (max-width:930px),
       (max-height:600px) and (orientation:landscape) and (max-width:1100px) {
  body[data-current-view="planner-v4"].gtt-shell-v1 .main-area,
  body[data-current-view="planner-v4"].gtt-shell-v1 .app.app-shell>.main.main-area {
    box-sizing:border-box!important;
    height:100dvh!important;max-height:100dvh!important;
    min-height:0!important;width:100%!important;
    min-width:0!important;overflow:hidden!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .main-area>#content.content {
    display:block!important;box-sizing:border-box!important;
    width:100%!important;max-width:100%!important;
    height:100dvh!important;max-height:100dvh!important;
    min-height:0!important;padding:0!important;margin:0!important;
    overflow:hidden!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 #content>.gtt-v4-embedded-shell {
    box-sizing:border-box!important;display:block!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    height:100%!important;min-height:0!important;max-height:100%!important;
    border-radius:0!important;overflow:hidden!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 #content iframe.gtt-v4-embedded-frame {
    display:block!important;box-sizing:border-box!important;
    width:100%!important;height:100%!important;
    min-height:0!important;max-height:100%!important;
    border:0!important;border-radius:0!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock{
    box-sizing:border-box!important;display:flex!important;
    left:calc(6px + env(safe-area-inset-left,0px))!important;
    right:calc(6px + env(safe-area-inset-right,0px))!important;
    top:calc(2px + env(safe-area-inset-top,0px))!important;
    width:auto!important;height:47px!important;
    z-index:180!important;pointer-events:none!important
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock .gtt-shell-left {
    display:flex!important;position:absolute!important;
    left:3px!important;top:3px!important;pointer-events:auto!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock .gtt-shell-search {
    display:flex!important;position:absolute!important;
    left:50%!important;top:4px!important;right:auto!important;
    transform:translateX(-50%)!important;
    pointer-events:auto!important
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock #search-trigger {
    width:43px!important;min-width:43px!important;
    height:41px!important;min-height:41px!important;padding:0!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock #search-trigger span {
    display:none!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock .gtt-shell-right {
    display:flex!important;position:absolute!important;
    top:4px!important;right:4px!important;left:auto!important;
    align-items:center!important;gap:5px!important;pointer-events:auto!important;
  }
  body[data-current-view="planner-v4"].gtt-shell-v1 .gtt-shell-dock .gtt-shell-glass{
    min-height:41px!important;height:41px!important;
  }
}
