/* One desktop title anchored to the board's own grid column.
   The title is out of flow, so chessboard sizing and splitter geometry cannot
   change. The phone/compact layout and its existing heading are untouched. */
.desktop-workspace-page-title{display:none}
@media(min-width:1001px){
  #trainerLayout:is(.workspace-play,.workspace-analyze,.workspace-training)>.board-column{
    position:relative!important;
  }
  /* Position the title from the SAME physical board rectangle on every page,
     not from a guessed grid track (Play's layout differs from Analyze/Train).
     The one observer in ui/desktop-page-title.js updates these coordinates
     on splitter drags, navigation, and viewport resize. */
  html #trainerLayout:is(.workspace-play,.workspace-analyze,.workspace-training)>.board-column>#desktopWorkspaceTitle{
    position:absolute!important;
    left:var(--desktop-title-board-x,0px)!important;
    top:var(--desktop-title-board-y,0px)!important;
    right:auto!important;bottom:auto!important;
    grid-column:auto!important;grid-row:auto!important;
    transform:translate(-50%,calc(-100% - .25rem))!important;
    z-index:45!important;
    display:block!important;visibility:hidden!important;
    width:max-content!important;max-width:100%!important;
    min-height:0!important;margin:0!important;padding:0!important;
    border:0!important;border-radius:0!important;
    background:transparent!important;
    color:var(--ai-color-text,#162033)!important;
    font-family:var(--ai-font-interface,system-ui,-apple-system,"Segoe UI",sans-serif)!important;
    font-size:clamp(1.125rem,1.15vw,1.25rem)!important;
    line-height:1.2!important;font-weight:700!important;
    letter-spacing:0!important;text-align:center!important;white-space:nowrap!important;
    box-shadow:none!important;
    pointer-events:none!important;
  }
  html #trainerLayout:is(.workspace-play,.workspace-analyze,.workspace-training)>.board-column>#desktopWorkspaceTitle[data-title-positioned="true"]{
    visibility:visible!important;
  }
  #desktopWorkspaceTitle>[data-desktop-page]{display:none!important}
  html[data-mobile-mode="play"] #desktopWorkspaceTitle>[data-desktop-page="play"],
  html[data-mobile-mode="position"] #desktopWorkspaceTitle>[data-desktop-page="position"],
  html[data-mobile-mode="explain"] #desktopWorkspaceTitle>[data-desktop-page="explain"],
  html[data-mobile-mode="training"] #desktopWorkspaceTitle>[data-desktop-page="training"]{
    display:inline!important;
  }
  /* Play alone still displayed an old second page-level "Play" heading.
     Its action buttons and the Start / Settings card headings are preserved. */
  html #trainerLayout.workspace-play #playModeInfo>.desktop-play-panel-title{
    display:none!important;
  }

  /* Full-page Help owns its content scroller. */
  html .app-help-dialog:not([hidden]) .app-help-content{overscroll-behavior:contain!important;}
}

/* On short desktop viewports the Play board column scrolls vertically. Reserve
   enough room at the scrollport top for the shared title above the board. */
@media(min-width:1001px) and (max-height:700px){
  html #trainerLayout.workspace-play>.board-column{
    padding-top:2rem!important;
  }
}
