/* Play focus: mobile/tablet expanded game (footer + below-fold copy hidden visually only) */

@media (max-width: 1024px) {
  .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn,
  .qg-page .qg-head .word-search-game-shell__expand-btn,
  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn,
  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn,
  .ae-page .ae-header .word-search-game-shell__expand-btn,
  .tg-page .tg-header .word-search-game-shell__expand-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ws-toolbar-control-height, 2.35rem);
    height: var(--ws-toolbar-control-height, 2.35rem);
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--ws-border-strong, rgba(19, 27, 45, 0.14));
    background: var(--ws-surface-2, var(--surface-strong));
    color: var(--ws-text, var(--text));
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  }

  [data-theme="dark"] .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn,
  [data-theme="dark"] .qg-page .qg-head .word-search-game-shell__expand-btn,
  [data-theme="dark"] .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn,
  [data-theme="dark"] .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn,
  [data-theme="dark"] .ae-page .ae-header .word-search-game-shell__expand-btn,
  [data-theme="dark"] .tg-page .tg-header .word-search-game-shell__expand-btn {
    box-shadow: none;
  }

  .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn:focus-visible,
  .qg-page .qg-head .word-search-game-shell__expand-btn:focus-visible,
  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn:focus-visible,
  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn:focus-visible,
  .ae-page .ae-header .word-search-game-shell__expand-btn:focus-visible,
  .tg-page .tg-header .word-search-game-shell__expand-btn:focus-visible {
    outline: 2px solid var(--ws-focus, var(--focus-ring, #7c3aed));
    outline-offset: 2px;
  }

  .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn-icon,
  .qg-page .qg-head .word-search-game-shell__expand-btn-icon,
  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn-icon,
  .ae-page .ae-header .word-search-game-shell__expand-btn-icon,
  .tg-page .tg-header .word-search-game-shell__expand-btn-icon,
  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn-icon {
    display: block;
    flex-shrink: 0;
  }

  .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn-icon--compress,
  .qg-page .qg-head .word-search-game-shell__expand-btn-icon--compress,
  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn-icon--compress,
  .ae-page .ae-header .word-search-game-shell__expand-btn-icon--compress,
  .tg-page .tg-header .word-search-game-shell__expand-btn-icon--compress,
  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn-icon--compress {
    display: none;
  }

  .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand,
  .qg-page .qg-head .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand,
  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand,
  .ae-page .ae-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand,
  .tg-page .tg-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand,
  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand {
    display: none;
  }

  .zip-game-page .zip-toolbar .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress,
  .qg-page .qg-head .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress,
  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress,
  .ae-page .ae-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress,
  .tg-page .tg-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress,
  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress {
    display: block;
  }

  .qg-page .qg-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ws-toolbar-control-height, 2.35rem);
    align-items: start;
    gap: 0.35rem 0.5rem;
  }

  .qg-page .qg-head .word-search-game-shell__expand-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .qg-page .qg-head > div:has(.qg-title) {
    grid-column: 1;
    grid-row: 1;
  }

  .qg-page .qg-controls {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .color-rush-page .color-rush-shell__toolbar {
    grid-template-columns: 1fr auto 1fr var(--ws-toolbar-control-height, 2.35rem);
  }

  .color-rush-page .color-rush-shell__toolbar .word-search-game-shell__expand-btn {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  body.site-shell--game-play-focus {
    overflow: hidden;
  }

  body.site-shell--game-play-focus .site-footer {
    display: none;
  }

  /* —— Zip —— */
  body.site-shell--game-play-focus main.main-content:has(.zip-game-page--play-focus) {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .zip-game-page--play-focus {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .zip-game-page--play-focus .word-search-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .zip-game-page--play-focus .zip-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .zip-game-page--play-focus .zip-help,
  .zip-game-page--play-focus .zip-status {
    display: none;
  }

  .zip-game-page--play-focus .zip-header {
    flex: 0 0 auto;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .zip-game-page--play-focus .zip-header h1 {
    font-size: 1.1rem;
  }

  .zip-game-page--play-focus .zip-toolbar {
    flex: 0 0 auto;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .zip-game-page--play-focus .zip-board-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: none;
    border-right: none;
    border-radius: 0;
    padding: 0.25rem;
  }

  /* —— Queens —— */
  body.site-shell--game-play-focus main.main-content:has(.qg-page--play-focus) {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .qg-page--play-focus {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .qg-page--play-focus .word-search-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .qg-page--play-focus .qg-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .qg-page--play-focus .qg-how,
  .qg-page--play-focus .qg-status {
    display: none;
  }

  .qg-page--play-focus .qg-head {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ws-toolbar-control-height, 2.35rem);
    align-items: start;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .qg-page--play-focus .qg-head > div:has(.qg-title) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .qg-page--play-focus .qg-title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.2;
  }

  .qg-page--play-focus .qg-head .word-search-game-shell__expand-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .qg-page--play-focus .qg-controls {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .qg-page--play-focus .qg-stats {
    flex: 0 0 auto;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .qg-page--play-focus .qg-board-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline: auto;
  }

  /* —— Color Rush —— */
  body.site-shell--game-play-focus main.main-content:has(.color-rush-page--play-focus) {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .color-rush-page--play-focus {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    min-height: 0;
  }

  .color-rush-page--play-focus .word-search-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .color-rush-page--play-focus .color-rush-shell-wrap {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
  }

  .color-rush-page--play-focus .color-rush-shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
  }

  .color-rush-page--play-focus .color-rush-help,
  .color-rush-page--play-focus .color-rush-status {
    display: none;
  }

  .color-rush-page--play-focus .color-rush-shell__header {
    flex: 0 0 auto;
    padding: 0.25rem 0.35rem;
    border-bottom: none;
  }

  .color-rush-page--play-focus .color-rush-shell__toolbar {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr var(--ws-toolbar-control-height, 2.35rem);
    align-items: center;
    gap: 0.35rem 0.45rem;
    padding-inline: 0.35rem;
  }

  .color-rush-page--play-focus .color-rush-shell__toolbar .word-search-game-shell__expand-btn {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  .color-rush-page--play-focus .color-rush-shell__play {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .color-rush-page--play-focus .color-rush-board-wrap {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* —— Fill-Ins (word-search-page shell) —— */
  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins-header {
    flex: 0 0 auto;
    padding: 0.25rem 0.35rem 0;
    border-bottom: none;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins-header__title {
    font-size: 1.1rem;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins-word-panel__tip--below,
  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins-word-panel__tip--cross {
    display: none;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .word-search-game-shell__body--fill-ins {
    flex: 1 1 auto;
    min-height: 0;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins__play {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins__board-cluster {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
  }

  .word-search-page--play-focus.word-search-page:has(.word-search-game-shell--fill-ins) .fill-ins__delete-btn--outside {
    margin: 0.4rem auto 0.25rem;
  }

  .word-search-game-shell--fill-ins .fill-ins-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.35rem;
  }

  .word-search-game-shell--fill-ins .fill-ins-header .word-search-game-shell__expand-btn {
    flex: 0 0 auto;
    order: -1;
    margin-left: auto;
  }

  .word-search-game-shell--fill-ins .fill-ins-header__row {
    flex: 1 1 100%;
    order: 0;
  }

  /* —— Arrow Escape —— */
  body.site-shell--game-play-focus main.main-content:has(.ae-page--play-focus) {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .ae-page--play-focus {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    max-height: none;
  }

  .ae-page--play-focus .ae-copy,
  .ae-page--play-focus .word-search-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .ae-page--play-focus .ae-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0 0;
  }

  .ae-page--play-focus .ae-status {
    display: none;
  }

  .ae-page--play-focus .ae-header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ws-toolbar-control-height, 2.35rem);
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .ae-page--play-focus .ae-header .word-search-game-shell__expand-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  .ae-page--play-focus .ae-header-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .ae-page--play-focus .ae-header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .ae-page--play-focus .ae-toolbar {
    flex: 0 0 auto;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .ae-page--play-focus .ae-board-outer {
    flex: 1 1 auto;
    min-height: 0;
  }

  /* —— Wordscapes —— */
  .wordscapes-page .ws-header .word-search-game-shell__expand-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--ws-toolbar-control-height, 2.35rem);
    height: var(--ws-toolbar-control-height, 2.35rem);
    margin: 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(31, 51, 89, 0.28);
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }

  .wordscapes-page .ws-header .word-search-game-shell__expand-btn-icon {
    display: block;
    flex-shrink: 0;
  }

  .wordscapes-page .ws-header .word-search-game-shell__expand-btn-icon--compress {
    display: none;
  }

  .wordscapes-page .ws-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--expand {
    display: none;
  }

  .wordscapes-page .ws-header .word-search-game-shell__expand-btn--active .word-search-game-shell__expand-btn-icon--compress {
    display: block;
  }

  body.site-shell--game-play-focus main.main-content:has(.wordscapes-page--play-focus) {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .wordscapes-page--play-focus {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }

  .wordscapes-page--play-focus .wordscapes-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .wordscapes-page--play-focus .ws-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.5rem 0.6rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .wordscapes-page--play-focus .ws-header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ws-toolbar-control-height, 2.35rem);
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .wordscapes-page--play-focus .ws-header .word-search-game-shell__expand-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  .wordscapes-page--play-focus .ws-header-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .wordscapes-page--play-focus .ws-header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }

  .wordscapes-page--play-focus .ws-board-area {
    flex: 1 1 auto;
    min-height: 0;
  }

  .wordscapes-page--play-focus .ws-input {
    flex: 0 0 auto;
  }

  /* —— Tangram —— */
  body.site-shell--game-play-focus main.main-content:has(.tg-page--play-focus) {
    padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
    overflow: hidden;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
  }

  .tg-page--play-focus {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    max-height: none;
  }

  .tg-page--play-focus .tg-page__seo,
  .tg-page--play-focus .word-search-page__seo {
    display: none !important;
    content-visibility: hidden;
  }

  .tg-page--play-focus .tg-shell {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    max-height: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0 0;
  }

  .tg-page--play-focus .tg-status {
    display: none;
  }

  .tg-page--play-focus .tg-header {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--ws-toolbar-control-height, 2.35rem);
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .tg-page--play-focus .tg-header .word-search-game-shell__expand-btn {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }

  .tg-page--play-focus .tg-header-title {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .tg-page--play-focus .tg-header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
  }

  .tg-page--play-focus .tg-toolbar {
    flex: 0 0 auto;
    margin-bottom: 0.35rem;
    padding-inline: 0.35rem;
  }

  .tg-page--play-focus .tg-board-outer {
    flex: 1 1 auto;
    min-height: 0;
  }
}
