.header.header-player {
  height: 52px;
}
.header-player .header-inner {
  max-width: none;
  padding-inline: 12px;
  gap: 24px;
}
.header-player .brand {
  font-size: 17px;
  letter-spacing: -0.6px;
  gap: 8px;
}
.header-player .brand-symbol {
  width: 28px;
  height: 28px;
}
.header-player .header-search,
.mobile-nav.mobile-nav-hidden {
  display: none;
}
.play-page {
  width: 100%;
  padding: 8px;
}
.play-page .player-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 68px);
  height: calc(100dvh - 68px);
  min-height: 160px;
  border-radius: 10px;
}
.play-page .player-stage {
  flex: 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
}
.play-page .player-toolbar {
  flex: 0 0 auto;
  padding: 4px 8px;
  gap: 4px 12px;
}
.play-page .player-title {
  flex: 1;
  min-width: 112px;
  gap: 8px;
}
.play-page .player-title > div {
  min-width: 0;
}
.play-page .player-title img {
  width: 28px;
  height: 28px;
}
.play-page .player-title h1 {
  font-size: 13px;
}
.play-page .player-help {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.play-page .player-help:hover {
  color: var(--accent);
}
.play-page #how-to-play {
  scroll-margin-top: 72px;
}
.play-page .player-title h1 span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.play-page .player-title h1 svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}
.play-page .save-status {
  line-height: 1.3;
}
.play-page .toolbar-actions {
  flex-wrap: wrap;
  flex-shrink: 0;
  max-width: 100%;
  gap: 2px;
}
.play-page .toolbar-actions .quiet {
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
}
.play-page .player-shell:fullscreen {
  height: 100%;
  min-height: 0;
  border-radius: 0;
}
@media (max-width: 380px) {
  .play-page .player-title img {
    display: none;
  }
}

/* Keep Tidekeeper's anchored board large on a landscape phone. The toolbar
   peeks below the game and remains reachable by scrolling the page. */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  body:has(.play-page[data-game="tidekeeper"]) .header-player {
    display: none;
  }
  .play-page[data-game="tidekeeper"] {
    padding: 0;
  }
  .play-page[data-game="tidekeeper"] .player-shell {
    height: auto;
    border-radius: 0;
  }
  .play-page[data-game="tidekeeper"] .player-stage {
    flex: none;
    height: calc(100dvh - 24px);
  }
}

/* Keep the playfield stable when save status and recovery actions change.
   Reserve both mobile toolbar rows for every player, including scaled frames. */
@media (max-width: 600px) {
  .play-page .player-toolbar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    height: 96px;
    min-height: 96px;
    max-height: 96px;
    gap: 2px;
  }
  .play-page .player-title {
    flex: 0 0 40px;
    min-height: 40px;
  }
  .play-page .player-title > div {
    width: 100%;
  }
  .play-page .save-status {
    white-space: normal;
  }
  .play-page .toolbar-actions {
    height: 44px;
    min-height: 44px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }
}

/* Archery uses a16:9 landscape arena. Keep the draw field stable on phones;
   portrait is an explicit rotate fallback. Other games retain their layout. */
@media (max-height:500px) and (orientation:landscape) {
  body:has(.play-page[data-game="archery-ragdoll"]) .header-player { display:none; }
  .play-page[data-game="archery-ragdoll"] { padding:0; }
  .play-page[data-game="archery-ragdoll"] .player-shell { height:100vh;height:100dvh;border:0;border-radius:0; }
}
@media (max-width:600px) and (orientation:portrait) {
  .play-page[data-game="archery-ragdoll"] .player-toolbar { height:96px;min-height:96px;max-height:96px;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:center;gap:2px; }
  .play-page[data-game="archery-ragdoll"] .player-title { flex:0 0 40px;min-height:40px; }
  .play-page[data-game="archery-ragdoll"] .save-status { white-space:nowrap; }
  .play-page[data-game="archery-ragdoll"] .toolbar-actions { height:44px;min-height:44px;flex-wrap:nowrap;justify-content:flex-end; }
}
