.game-topbar { gap: 1rem; }
.game-topbar .topbar-end { display: flex; align-items: center; gap: .5rem; }
.game-topbar .mainnav ul { gap: .15rem; }
.game-topbar .mainnav a { padding-inline: .72rem; }
.game-topbar .theme-toggle { min-height: 44px; padding-inline-start: .8rem; }
.game-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-width: 44px;
  min-height: 44px;
  padding-inline: .6rem;
  border-radius: 9px;
  color: var(--ink);
  font-size: .875rem;
  white-space: nowrap;
}
.game-account svg { width: 19px; height: 19px; flex: none; }
.game-account:hover { background: var(--button-hover); color: var(--ink); }
.site-language { position: relative; }
.site-language summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 44px;
  min-height: 44px;
  padding-inline: .55rem;
  border-radius: 9px;
  cursor: pointer;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 600;
  list-style: none;
}
.site-language summary::-webkit-details-marker { display: none; }
.site-language summary:hover, .site-language[open] summary { background: var(--button-hover); }
.site-language svg { width: 18px; height: 18px; flex: none; }
.site-language ul {
  position: absolute;
  inset: calc(100% + .35rem) 0 auto auto;
  z-index: 20;
  min-width: 9.75rem;
  margin: 0;
  padding: .35rem;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: var(--board-shadow);
}
.site-language a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .4rem .65rem;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
}
.site-language a:hover, .site-language [aria-current] { background: var(--button-hover); }
.board-heading + .game-host { margin-top: .7rem; }
.board-heading + .daily-meta + .game-host { margin-top: .75rem; }
.board-heading .lead { font-size: 1rem; }
.game-page-note { margin: 0 0 .75rem; font-size: .88rem; }
.game-page-note:empty { display: none; }
.play-explainer { border-top: 1px solid var(--line); padding-top: 1.1rem; margin: 1.45rem 0 0; }
.play-explainer h2:first-child { margin-top: 0; }
.play-explainer p { margin-bottom: .7rem; }
.play-explainer .inline-actions { margin-block: .75rem; }
.daily-details { margin-top: 1rem; }
.daily-details p:first-of-type { margin-top: .7rem; }
.puzzle-breadcrumb { margin-bottom: .5rem; font-size: .85rem; color: var(--ink-soft); }
.puzzle-grid + .library-after { margin-top: 1.1rem; }

@media (width >= 781px) and (height <= 850px) {
  .board-heading ~ .game-host .game-board {
    max-height: clamp(290px, calc(100svh - 320px), 490px);
  }
}

@media (width <= 780px) {
  .game-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: .15rem .7rem;
    min-height: 0;
    padding-block: .5rem;
  }
  .game-topbar .brand { grid-column: 1; grid-row: 1; min-width: 0; }
  .game-topbar .topbar-end { grid-column: 2; grid-row: 1; gap: .2rem; }
  .game-topbar .theme-toggle { min-width: 44px; padding: 0 .4rem; border: 0; }
  .game-topbar .mainnav { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .game-topbar .mainnav ul { justify-content: space-between; }
  .game-topbar .mainnav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: .4rem .5rem;
    font-size: .875rem;
  }
}

@media (width <= 540px) {
  .game-topbar .theme-name { display: none; }
  .game-topbar .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .game-account { position: relative; padding-inline: .45rem; }
  .game-account span, .site-language summary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .site-language summary { padding-inline: .4rem; }
  .board-heading .lead { font-size: .94rem; }
  .board-heading { margin-bottom: .7rem; }
}

@media (width <= 360px) {
  .game-topbar .mainnav a { padding-inline: .3rem; font-size: .8rem; }
}
