/* Give touch players a usable stage instead of shrinking the desktop 16:9 frame. */
.fullscreen-toggle {
  position: absolute;
  z-index: 5;
  right: 14px;
  top: 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 999px;
  background: rgba(19, 17, 38, .82);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.fullscreen-toggle:hover { background: rgba(88, 66, 216, .94); }

.fullscreen-icon {
  width: 18px;
  height: 18px;
  display: block;
  background:
    linear-gradient(#fff, #fff) left top / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) left top / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) right top / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) right top / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) left bottom / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) right bottom / 2px 7px no-repeat;
}

.fullscreen-toggle[aria-pressed="true"] .fullscreen-icon { transform: scale(.72); }

.player-shell:fullscreen,
.player-shell:-webkit-full-screen,
.player-shell.is-pseudo-fullscreen {
  width: 100vw;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
  aspect-ratio: auto;
  background: #080713;
}

.player-shell.is-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

body.game-fullscreen-open { overflow: hidden; }

.game-detail .player-shell.has-measured-height {
  height: var(--game-frame-height);
  max-height: 1000px;
  aspect-ratio: auto;
  transition: height .2s ease;
}

@media (max-width: 700px) {
  .game-detail .player-shell {
    width: 100vw;
    height: clamp(360px, 62svh, 560px);
    max-height: none;
    margin-left: calc(50% - 50vw);
    aspect-ratio: auto;
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(34, 27, 80, .18);
  }

  .game-detail .player-shell.has-measured-height {
    height: var(--game-frame-height);
    max-height: 900px;
  }

  .game-detail .player-cover img {
    object-position: center;
  }

  .game-detail .play-button {
    min-width: 148px;
    min-height: 56px;
    padding: 15px 24px;
    font-size: 18px;
  }

  .fullscreen-toggle {
    right: 10px;
    top: 10px;
    min-width: 48px;
    padding: 12px;
  }

  .fullscreen-toggle span:last-child { display: none; }
}

/* Short landscape screens benefit from width without an unnecessarily tall stage. */
@media (max-width: 900px) and (orientation: landscape) {
  .game-detail .player-shell {
    height: min(78svh, 520px);
    max-height: none;
    aspect-ratio: auto;
  }
}
