/* Game pages give the player the full content width; tools live below it. */
.studio-main.game-detail-page { padding-top: 18px; }
.game-detail-page .game-heading { margin: 6px 0 20px; gap: 16px; flex-direction: row; }
.game-detail-page .game-heading h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -1.3px; margin-bottom: 6px; }
.game-detail-page .game-heading p { margin: 0; font-size: 13px; }
.game-detail-page .game-detail-grid,
.game-detail-page .game-detail-grid:has(.game-detail-aside:empty) { grid-template-columns: minmax(0, 1fr); max-width: none; gap: 24px; }
.game-detail-page .game-detail-aside { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; }
.game-detail-page .phone-panel { display: grid; grid-template-columns: auto 1fr auto; column-gap: 16px; align-items: center; }
.game-detail-page .phone-panel > .studio-icon { grid-column: 1; grid-row: 1 / 3; margin: 0; }
.game-detail-page .phone-panel h2 { grid-column: 2; margin: 0 0 6px; font-size: 20px; }
.game-detail-page .phone-panel > p { grid-column: 2; margin: 0; }
.game-detail-page .phone-panel > button { grid-column: 3; grid-row: 1 / 3; }
.game-detail-page .phone-panel [data-phone-target="panel"] { grid-column: 1 / -1; }
.game-detail-page .phone-panel [data-phone-target="code"] { max-width: 220px; }
.game-player-shell { display: flex; flex-direction: column; }
.game-player-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px 8px 16px; background: #191d25; color: #f7f8fa; flex: none; }
.game-player-caption { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.game-player-caption > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-player-caption > svg { flex: none; color: #a7b2c8; }
.game-player-back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; border: 0; border-radius: 6px; padding: 8px 10px; background: transparent; color: #f7f8fa; font-size: 12px; cursor: pointer; }
.game-player-back-button[hidden] { display: none; }
.game-player-back-button:hover { background: #303744; }
.game-player-back-button:focus-visible { outline: 3px solid #e3ff72; outline-offset: 2px; }
.game-expand-button { flex: none; border: 1px solid #5462ff; border-radius: 7px; background: #4655f5; color: #fff; padding: 9px 15px; min-height: 44px; font-size: 13px; font-weight: 600; cursor: pointer; }
.game-expand-button:hover { background: #5967ff; }
.game-expand-button:focus-visible { outline: 3px solid #e3ff72; outline-offset: 3px; }
.game-expand-button > span { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.game-expand-button > span[hidden] { display: none; }
.game-expand-button .studio-icon { width: 18px; height: 18px; }
.game-player-stage { display: flex; align-items: center; justify-content: center; min-height: 0; background: #101116; }
.game-player-shell .game-viewport { width: 100%; max-width: calc(72dvh * 16 / 9); max-height: none; flex: none; }
.game-player-shell .game-viewport[data-orientation="portrait"] { width: min(100%, calc(72dvh * 390 / 844)); max-width: 440px; }
.game-player-shell .game-viewport[data-orientation="adaptive"] { max-width: none; height: 72dvh; }
.game-player-shell.is-expanded,
.game-player-shell:fullscreen { position: fixed; inset: 0; z-index: 10000; width: 100%; height: 100%; height: 100dvh; max-width: none; margin: 0; border: 0; border-radius: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); box-sizing: border-box; }
.game-player-shell.is-expanded .game-player-stage { flex: 1; container-type: size; }
.game-player-shell.is-expanded .game-player-controls { display: grid; grid-template-columns: 1fr minmax(0, 1fr) 1fr; padding-top: 4px; padding-bottom: 4px; }
.game-player-shell.is-expanded .game-player-back-button { justify-self: start; }
.game-player-shell.is-expanded .game-player-caption { justify-content: center; }
.game-player-shell.is-expanded .game-expand-button { justify-self: end; }
.game-player-shell.is-expanded .game-viewport { width: 100%; max-width: calc(100cqh * 16 / 9); }
.game-player-shell.is-expanded .game-viewport[data-orientation="portrait"] { width: min(100%, calc(100cqh * 390 / 844)); max-width: none; }
.game-player-shell.is-expanded .game-viewport[data-orientation="adaptive"] { width: 100%; max-width: none; height: 100%; }
@media (max-width: 650px) {
  .studio-main.game-detail-page { padding-top: 12px; padding-left: 12px; padding-right: 12px; }
  .game-detail-page .game-heading { flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
  .game-detail-page .game-heading .secondary-button { min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .game-player-controls { padding: 6px 8px; gap: 8px; }
  .game-player-caption { font-size: 12px; }
  .game-player-caption > svg { display: none; }
  .game-expand-button { font-size: 12px; padding: 8px 10px; }
  .game-player-shell.is-expanded .game-player-controls { grid-template-columns: 1fr auto; }
  .game-player-shell.is-expanded .game-player-caption { display: none; }
  .game-detail-page .phone-panel { grid-template-columns: auto 1fr; padding: 20px; }
  .game-detail-page .phone-panel > button { grid-column: 2; grid-row: auto; margin-top: 14px; justify-self: start; }
}

/* Dedicated /play route: quiet chrome; support remains on the game page. */
.game-player-page .game-player-toolbar { min-height: 44px; gap: 8px; border: 0; background: #101116; }
.game-player-page .game-player-back, .game-player-screen { box-sizing: border-box; display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 6px; color: #fff; background: transparent; font-size: 23px; cursor: pointer; }
.game-player-title { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; color: #efefee; font-size: 12px; font-weight: 600; }
.game-player-screen:focus-visible { outline: 3px solid #e3ff72; outline-offset: -3px; }
.game-player-screen[hidden] { display: none; }
