/* One viewport for the playing surface. Long collections and menus still scroll. */
html.clean-play {
  background: var(--paper);
}
html.clean-play:has(body.playing) {
  overscroll-behavior: none;
}
.clean-play body.playing {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.clean-play body.playing .app {
  height: calc(
    100dvh - var(--safe-top, env(safe-area-inset-top)) -
      var(--safe-bottom, env(safe-area-inset-bottom))
  );
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 52px minmax(0, 1fr);
}
.clean-play body.playing .game-header {
  height: 52px;
  padding: 0;
  gap: 8px;
}
.clean-play body.playing .brand img {
  height: 46px;
  width: 106px;
}
.clean-play body.playing .bottom-nav,
.clean-play body.playing .site-foot {
  display: none;
}
.clean-play body.playing #main {
  min-height: 0;
  min-width: 0;
}
.clean-play .game-layout {
  height: 100%;
  min-height: 0;
  padding: 12px 0 8px;
  gap: 28px;
}
.clean-play .game-main {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clean-play .game-title,
.clean-play .game-stats,
.clean-play .phrase-strip,
.clean-play .tutorial-tip,
.clean-play .tool-hint,
.clean-play .tools-bar,
.clean-play .game-bottom {
  flex: none;
  margin: 0;
}
.clean-play .game-title h1 {
  font-size: 22px;
  line-height: 1.15;
}
.clean-play .game-title .eyebrow {
  margin-bottom: 3px;
}
.clean-play .game-stats {
  font-size: 12px;
}
.clean-play .phrase-strip {
  min-height: 0;
  padding: 0 2px 4px;
  font-size: 19px;
  line-height: 1.5;
}
.clean-play .phrase-strip.compact {
  font-size: 17px;
}
.clean-play .board-space {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}
.clean-play .board-paper {
  max-width: 100%;
  padding: 7px;
  margin: 0;
}
.clean-play .cell {
  min-height: 0;
  line-height: 1;
  font-size: clamp(14px, calc(var(--cell-size, 32px) * 0.58), 28px);
}
.clean-play .tool-hint {
  min-height: 0;
  padding: 0;
  font-size: 11px;
  line-height: 1.35;
}
.clean-play .tools-bar {
  width: 100%;
}
.clean-play .tool-button {
  min-height: 44px;
  padding: 5px 8px;
  font-size: 11px;
}
.clean-play .game-bottom .small-btn {
  min-height: 38px;
  padding: 5px 10px;
  font-size: 11px;
}
.clean-play .game-bottom > span {
  text-align: center;
  padding: 0 6px;
  font-size: 10px;
}
.clean-play .tutorial-tip {
  padding: 7px 10px;
  font-size: 12px;
  line-height: 1.35;
}
@media (max-width: 1000px), (max-height: 700px) {
  .clean-play .game-layout {
    display: block;
  }
  .clean-play .game-side {
    display: none;
  }
  .clean-play .game-main {
    max-width: 740px;
    margin: auto;
  }
  .clean-play body.playing .brand {
    display: none;
  }
  .clean-play body.playing .player-supplies {
    flex: 1;
    width: auto;
    justify-content: space-between;
  }
  .clean-play body.playing .inventory-caption {
    display: none;
  }
}
@media (max-width: 599px) and (max-height: 650px) {
  .clean-play .game-layout {
    padding-top: 6px;
  }
  .clean-play .game-main {
    gap: 4px;
  }
  .clean-play .game-title h1 {
    font-size: 18px;
  }
  .clean-play .game-title .eyebrow {
    font-size: 8px;
    line-height: 1.3;
  }
  .clean-play .game-stats {
    font-size: 10px;
  }
  .clean-play .phrase-strip {
    font-size: 16px;
    padding-bottom: 2px;
  }
  .clean-play .phrase-strip.compact {
    font-size: 15px;
  }
  .clean-play .word-slot {
    line-height: 1.4;
  }
  .clean-play .tool-hint {
    font-size: 10px;
    line-height: 1.25;
  }
  .clean-play .game-bottom > span {
    display: none;
  }
  .clean-play .tutorial-tip {
    padding: 5px 8px;
    font-size: 11px;
  }
}
/* Landscape gives the grid its full height; controls sit alongside it. */
@media (min-width: 500px) and (max-height: 550px) {
  .clean-play .game-main {
    max-width: 1020px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 38%);
    grid-template-rows: repeat(8, auto);
    column-gap: 20px;
    row-gap: 4px;
    align-content: stretch;
    align-items: center;
  }
  .clean-play .board-space {
    grid-area: 1 / 1 / 9 / 2;
    height: 100%;
    align-self: stretch;
  }
  .clean-play .game-title {
    grid-area: 1 / 2;
  }
  .clean-play .game-stats {
    grid-area: 2 / 2;
  }
  .clean-play .phrase-strip {
    grid-area: 3 / 2;
  }
  .clean-play .tutorial-tip {
    grid-area: 4 / 2;
  }
  .clean-play .tool-hint {
    grid-area: 5 / 2;
  }
  .clean-play .tools-bar {
    grid-area: 7 / 2;
  }
  .clean-play .game-bottom {
    grid-area: 8 / 2;
  }
  .clean-play .game-title h1 {
    font-size: 19px;
  }
  .clean-play .tools-bar {
    gap: 4px;
  }
  .clean-play .tool-button {
    flex-direction: column;
    gap: 2px;
    padding: 4px;
  }
  .clean-play .tool-button .icon {
    width: 21px;
    height: 21px;
  }
  .clean-play .game-bottom > span {
    display: none;
  }
}
@media (min-width: 500px) and (max-height: 360px) {
  .clean-play .game-layout {
    padding-top: 6px;
  }
  .clean-play .game-main {
    row-gap: 2px;
    column-gap: 12px;
  }
  .clean-play .game-title h1 {
    font-size: 16px;
  }
  .clean-play .game-title .eyebrow {
    font-size: 8px;
    line-height: 1.2;
  }
  .clean-play .game-stats {
    font-size: 10px;
  }
  .clean-play .phrase-strip,
  .clean-play .phrase-strip.compact {
    font-size: 14px;
  }
  .clean-play .word-slot {
    line-height: 1.4;
  }
  .clean-play .tool-hint {
    font-size: 10px;
  }
  .clean-play .tutorial-tip {
    font-size: 10px;
    padding: 4px 7px;
  }
  .clean-play .tool-button .icon {
    width: 18px;
    height: 18px;
  }
  .clean-play .tool-button {
    font-size: 10px;
  }
}
/* Accessibility escape hatch for text zoom or windows smaller than a usable board. */
.clean-play.play-scroll body.playing {
  overflow-y: auto;
  height: auto;
}
.clean-play.play-scroll body.playing .app {
  height: auto;
  min-height: calc(
    100dvh - var(--safe-top, env(safe-area-inset-top)) -
      var(--safe-bottom, env(safe-area-inset-bottom))
  );
  grid-template-rows: 52px auto;
}
.clean-play.play-scroll .board-space {
  min-height: var(--board-min-height);
}
