/* Shared game-player layout for canonical /play/<game>/ pages. */
.player-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player { max-width: 1100px; margin: 0 auto; padding: 24px 22px 70px; }
.game-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.game-head h1 { font-family: var(--display); font-size: 1.6rem; margin: 0; letter-spacing: -.02em; }
.game-head p { color: var(--muted); margin: 0; flex: 1; min-width: 240px; }

.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e5ddf3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage:fullscreen { border-radius: 0; border: 0; aspect-ratio: auto; }
.stage:fullscreen iframe { height: 100vh; }

.stage-bar {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(0,0,0,.55), transparent);
  opacity: 0; transition: opacity .18s;
  pointer-events: none;
}
.stage:hover .stage-bar, .stage:focus-within .stage-bar { opacity: 1; }
.stage-bar .btn { pointer-events: auto; }
.stage-bar .spacer { flex: 1; }

.related-wrap { margin-top: 44px; }
.related-wrap h2 { font-family: var(--display); font-size: 1.25rem; margin: 0 0 16px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}

.notfound { text-align: center; padding: 90px 20px; color: var(--muted); }
.notfound .big { font-size: 3.4rem; margin-bottom: 12px; }
.notfound h1 { color: var(--text); font-family: var(--display); }
.notfound .btn { margin-top: 18px; display: inline-block; }

/* Multiplayer invite chip (shown by js/multiplayer.js when in a room) */
.mp-invite {
  position: absolute; bottom: 12px; left: 12px; z-index: 3;
  display: none; align-items: center; gap: 8px;
  padding: 7px 8px 7px 12px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .82rem; color: var(--muted);
}
.mp-invite .mp-dot { width: 8px; height: 8px; border-radius: 50%; background: #3fc77f; }
.mp-invite .mp-code-label { color: var(--muted); }
.mp-invite .mp-code {
  color: var(--text); font-weight: 700; letter-spacing: .12em;
  font-variant-numeric: tabular-nums;
}
.mp-invite .mp-count { color: var(--muted); padding-left: 4px; border-left: 1px solid var(--line); }
.mp-invite .mp-copy {
  cursor: pointer; border: 0; border-radius: 999px;
  padding: 5px 12px; font-weight: 600; font-size: .8rem;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.mp-invite .mp-copy:hover { filter: brightness(1.06); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  /* On a phone, the GAME should own the screen. Put the stage first and give
     it the full viewport under the header; the page title, related games and
     SEO copy move below it (still early in the DOM for crawlers). */
  .breadcrumbs-static { display: none; }
  .player {
    display: flex;
    flex-direction: column;
    max-width: none;
    margin: 0;
    padding: 0 0 48px;
  }
  .stage {
    order: -1;
    aspect-ratio: auto;
    height: calc(100vh - var(--header-h) - 6px);
    height: calc(100dvh - var(--header-h) - 6px);
    min-height: 460px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .game-head { order: 1; margin: 0; padding: 18px 16px 0; }
  .game-head h1 { font-size: 1.3rem; }
  .related-wrap { order: 2; margin-top: 26px; padding: 0 16px; }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .mp-invite { font-size: .76rem; padding: 6px 6px 6px 10px; }
  .mp-invite .mp-copy { padding: 5px 10px; }
}
