/* The player owns one loading surface and a separate, persistent control dock. */
.runtime {
  --player-dock-height: 76px;
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  border-radius: var(--radius);
  background: #100f15;
  color: #fff;
  display: grid;
  grid-template-rows: minmax(0, 1fr) var(--player-dock-height);
  isolation: isolate;
}
.player-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #090a10; }
.player-viewport { position: absolute; inset: 0; overflow: hidden; }
.game-mount { position: absolute; inset: 0; }
.runtime[data-fitted=true] .game-mount { inset: auto; top: 50%; left: 50%; width: var(--game-width); height: var(--game-height); transform: translate(-50%, -50%); }
.runtime iframe { display: block; width: 100%; height: 100%; border: 0; }
.runtime-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #17131d;
  color: #fff;
}
.runtime-loading .launch-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .2; pointer-events: none; }
.launch-card { position: relative; width: min(320px, 100%); display: flex; flex-direction: column; align-items: center; padding: 28px 20px; border: 1px solid #ffffff18; border-radius: 20px; background: #17131de8; }
.runtime-loading .launch-icon { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; margin-bottom: 18px; }
.runtime-loading strong { font: 500 27px/1.15 Fredoka, sans-serif; }
.runtime-loading p { color: #ddd1df; font-size: 13px; line-height: 1.6; }
.runtime-progress { width: min(220px, 80%); height: 4px; border: 0; border-radius: 4px; overflow: hidden; accent-color: var(--pink); background: #ffffff20; }
.runtime-progress::-webkit-progress-bar { background: #ffffff20; border-radius: 4px; }
.runtime-progress::-webkit-progress-value { background: var(--pink); border-radius: 4px; }
.runtime-progress::-moz-progress-bar { background: var(--pink); border-radius: 4px; }
.launch-progress {
  --progress: 0;
  position: relative;
  width: min(240px, 100%);
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #ffffff24;
}
.launch-progress i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform: scaleX(var(--progress));
  transform-origin: left center;
  will-change: transform;
  background: linear-gradient(90deg, #ff338e, #ff9bc7);
  transition: transform .18s ease-out;
}
.launch-progress:is([data-mode=engine],[data-mode=activity]) i {
  width: 42%;
  transform: translateX(-110%);
  animation: launch-activity 1.2s ease-in-out infinite;
}
.launch-detail { min-height: 1.2em; margin-top: 9px; color: #e8d9e8; font-size: 12px; font-variant-numeric: tabular-nums; }
@keyframes launch-activity { from { transform: translateX(-110%); } to { transform: translateX(240%); } }
@media (prefers-reduced-motion: reduce) {
  .launch-progress i { transition: none; }
  .launch-progress:is([data-mode=engine],[data-mode=activity]) i { animation: none; transform: translateX(70%); }
}
.runtime-loading button { min-height: 44px; padding: 12px 24px; background: #db005d; color: #fff; border-radius: 8px; }
.player-dock {
  position: relative;
  inset: auto;
  z-index: 3;
  height: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 56px;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #ffffff18;
  background: #211b26;
}
.player-return {
  --return-progress: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: 220px;
  justify-self: start;
  min-width: 0;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #ffffff30;
  border-radius: 14px;
  background: #382b3d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
.player-return:hover, .player-return:focus-visible { background: #503a54; }
.player-return.is-armed { background: #803250; }
.player-return svg { width: 18px; height: 18px; flex: none; transform: rotate(180deg); }
.player-return span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-fullscreen { grid-column: 2; grid-row: 1; }
.player-action[data-action=like] { grid-column: 3; grid-row: 1; }
.player-action { min-width: 0; min-height: 48px; padding: 4px 0; color: #eee5ef; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 8px; }
.player-action:hover { background: #ffffff0c; }
.player-action svg { width: 21px; height: 21px; }
.player-action small { font-size: 10px; line-height: 1.2; }
.player-action[aria-pressed=true][data-action=like] { color: #ff6ca9; }
.player-action[aria-pressed=true][data-action=like] svg { fill: currentColor; }
.player-back { display: none; }
.runtime :focus-visible { outline: 2px solid #ff86b9; outline-offset: -2px; }
#feed:focus { outline: none; }
#feed:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
body.player-open #feed { outline: none; }
body.player-expanded { overflow: hidden; }
/* The feed keeps its exact dimensions and scroll position behind this stage. */
@media (min-width: 761px) {
  .runtime {
    --player-gap: clamp(12px, 1.6vw, 24px);
    position: fixed;
    inset: calc(var(--hub-topbar-height, 88px) + var(--player-gap)) var(--player-gap) var(--player-gap) calc(var(--hub-sidebar-width, 256px) + var(--player-gap));
    width: auto;
    height: auto;
    max-width: 1600px;
    max-height: 1000px;
    margin: auto;
    border: 1px solid #ffffff18;
    box-shadow: 0 12px 48px #100b2033;
  }
}
.runtime:is(:fullscreen, :-webkit-full-screen, .is-expanded) {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  z-index: 100;
  --player-dock-height: calc(76px + env(safe-area-inset-bottom, 0px));
}
.runtime:is(:fullscreen, :-webkit-full-screen, .is-expanded) .player-dock { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.runtime:is(:fullscreen, :-webkit-full-screen, .is-expanded) .player-viewport { top: env(safe-area-inset-top, 0px); left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); }
.runtime::backdrop { background: #100f15; }
@media (max-width: 760px) {
  body.player-open { overflow: hidden; }
  body.player-open .mobile-nav { display: none; }
  .runtime { position: fixed; top: var(--hub-topbar-height, 62px); bottom: 0; left: 0; right: 0; border-radius: 0; --player-dock-height: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .player-dock { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .runtime:is(:fullscreen, :-webkit-full-screen, .is-expanded) { top: 0; --player-dock-height: calc(72px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 340px) { .player-dock { column-gap: 4px; padding-left: 8px; padding-right: 8px; grid-template-columns: minmax(0, 1fr) 58px 48px; } }
@media (max-height: 520px) { body.player-open { overflow: hidden; } .runtime { position: fixed; inset: 0; border-radius: 0; --player-dock-height: calc(72px + env(safe-area-inset-bottom, 0px)); } .player-dock { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); } }
.runtime.is-expanded { inset: auto; left: var(--player-viewport-x, 0px); top: var(--player-viewport-y, 0px); width: var(--player-viewport-width, 100dvw); height: var(--player-viewport-height, 100dvh); }
/* Retain at most one paused trusted runtime without reparenting its iframe. */
.runtime[hidden]{display:none}
