.scene-game [hidden], .scene-game .scene-game-dialog:not([open]) { display: none !important; }

.scene-game {
  word-break: keep-all;
  overflow-wrap: break-word;
}
.scene-game button { font-family: inherit; }
.scene-game :focus-visible {
  outline: 3px solid var(--scene-focus, #1d4ed8);
  outline-offset: 3px;
}
.scene-game .scene-game-dialog {
  position: fixed;
  inset: 0;
  width: min(100% - 32px, 500px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: auto;
}
.scene-game .scene-game-dialog::backdrop { background: rgb(2 6 23 / 65%); }
.scene-game .scene-game-dialog-card { max-width: none; padding: clamp(16px, 4vw, 24px); }
.scene-game .scene-game-dialog-card img { max-width: 100%; object-fit: contain; }
.scene-game .scene-game-reset-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scene-game .scene-game-reset-actions button { flex: 1 0 auto; }
.scene-game .scene-game-start { width: min(100%, 260px); }
.scene-game .scene-game-topbar { gap: 8px 14px; }
.scene-game .scene-game-topbar :is(a, button),
.scene-game .scene-game-actions button { min-height: 44px; }
.scene-game .scene-game-art {
  display: none;
  z-index: 0;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.scene-game .scene-game-app > :is(header, main) { position: relative; }
.scene-game:has(#screen-play:not([hidden])) .scene-game-art { display: block; }
.scene-game:has(#screen-play:not([hidden])) .scene-game-app {
  width: min(100%, 1800px);
  max-width: none;
  min-height: 100dvh;
  padding: clamp(10px, 1.4vw, 20px) clamp(12px, 3.5vw, 52px) 24px;
  gap: clamp(10px, 1.15vw, 17px);
}
.scene-game .scene-game-entry { width: 100%; }
.scene-game .scene-game-feedback { text-wrap: pretty; }

@media (max-width: 600px) {
  .scene-game .scene-game-topbar { padding: 8px 10px; }
  .scene-game .scene-game-topbar h1 { font-size: 1rem; }
  .scene-game .scene-game-topbar :is(a, button),
  .scene-game .scene-game-actions button { font-size: .875rem; padding-inline: 8px; }
  .scene-game .scene-game-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  .scene-game .scene-game-actions button { padding-inline: 3px; }
  .scene-game .scene-game-entry > div { padding: 12px; gap: 14px; }
}

.scene-game-cover--water_sort { --cover-canvas: #ecfeff; --cover-ink: #0f172a; }
.scene-game-cover--frog_rps { --cover-canvas: #f0fdf4; --cover-ink: #0f172a; }
.scene-game-cover--star_euler { --cover-canvas: #0f172a; --cover-ink: #f8fafc; }
.scene-game .scene-game-cover { --cover-width: min(100%, 1050px, calc((100svh - 245px) * 1.77778)); }
.scene-game .scene-game-cover [data-opening-part="poster"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
  box-shadow: none;
}
.scene-game .scene-game-cover [data-opening-part="art"] { border-radius: 18px; aspect-ratio: 16 / 9; }
.scene-game .scene-game-cover [data-opening-part="title"] {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 12px 0 0 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: normal !important;
  font-size: clamp(32px, 4vw, 47px);
  line-height: 1.12;
}
.scene-game .scene-game-cover [data-opening-part="goal"] { margin: 9px auto 0; }
.scene-game .scene-game-cover [data-opening-part="actions"] { position: static; padding: 14px 0 12px; }
.scene-game #screen-play:focus { outline: none; }
.scene-game .scene-game-app:has(#screen-lobby:not([hidden])):not([data-cover-pending]) { padding-block-start: 18px; }
@media (max-width: 600px) {
  .scene-game .scene-game-cover { --cover-width: 100%; }
  .scene-game .scene-game-cover [data-opening-part="title"] { margin-top: 16px !important; }
  .scene-game .scene-game-cover [data-opening-part="actions"] { width: min(100%, 280px); }
}
