/* PS 原有卡片和两栏页面样式保持不变；这里只适配本地游戏 iframe。 */
.arcade-icon > img { display:block; width:100%; height:100%; object-fit:cover; }
.layout.without-sidebar { grid-template-columns:minmax(0,1fr); }
.game.local-game { position:relative; padding:0; overflow:hidden; color:#fff; background:radial-gradient(ellipse at top right,#285762,transparent 65%),#162b41; }
.local-game-player-content { position:relative; width:100%; }
/* 横竖屏游戏都使用原页面的 16:9 窗口，游戏视口由播放器单独缩放。 */
.local-game-stage { position:relative; width:100%; aspect-ratio:16/9; overflow:hidden; }
.local-game-frame-host { position:absolute; inset:0; overflow:hidden; }
.local-game-frame-host[inert] { pointer-events:none; }
.local-game-welcome {
  position:absolute;
  inset:0;
  z-index:1;
  display:grid;
  align-content:center;
  justify-items:center;
  gap:clamp(6px,1vw,12px);
  padding:8px;
  overflow:hidden;
  background:linear-gradient(#72e3f4,#b7f5fa);
}
.local-game-welcome::before,
.local-game-welcome::after {
  content:"";
  position:absolute;
  inset:8% 0 0;
  z-index:-1;
  pointer-events:none;
  background:url("/static/discover/pixel-cloud-bank.svg") repeat-x left bottom / var(--cloud-width) 100%;
  --cloud-width:440px;
  opacity:.5;
  animation:game-cloud-drift 48s linear infinite;
}
.local-game-welcome::after {
  inset-block-start:47%;
  --cloud-width:560px;
  opacity:.78;
  animation:game-cloud-drift 34s linear -11s infinite reverse;
}
@keyframes game-cloud-drift {
  from { background-position-x:0px; }
  to { background-position-x:var(--cloud-width); }
}
@media(prefers-reduced-motion:reduce) {
  .local-game-welcome::before,
  .local-game-welcome::after { animation:none; }
}
.local-game-welcome > .arcade-icon { width:clamp(44px,8vw,90px); aspect-ratio:1; overflow:hidden; border-radius:22%; box-shadow:0 8px 24px #07142266; }
.local-game-loading-title { max-width:90%; text-align:center; color:#102e50; font-size:clamp(18px,2.5vw,30px); font-weight:700; line-height:1.15; }
.local-game-meter {
  box-sizing:border-box;
  width:min(75%,640px);
  height:clamp(14px,1.4vw,18px);
  position:relative;
  margin-top:8px;
  border-radius:999px;
  background:linear-gradient(#cfd3d6,#e3e6e8);
}
.local-game-meter::before {
  content:"";
  position:absolute;
  bottom:calc(100% + 3px);
  left:60%;
  transform:translateX(-50%);
  border-inline:4px solid transparent;
  border-top:5px solid #72edd9;
}
.local-game-meter::after {
  content:"";
  display:block;
  width:60%;
  height:100%;
  border-radius:inherit;
  background:
    linear-gradient(115deg,transparent 30%,#ffffff70 30% 48%,transparent 48% 80%,#ffffff70 80% 98%,transparent 98%) 0 0 / 28px 100% repeat-x,
    linear-gradient(90deg,#008fe7,#73f4d5);
  animation:game-loading 1.2s linear infinite;
}
@keyframes game-loading { to { background-position:28px 0,0 0; } }
@media(prefers-reduced-motion:reduce) { .local-game-meter::after { animation:none; } }
.local-game-stage[aria-busy="false"] .local-game-meter { display:none; }
.local-game-welcome p { min-height:0; margin:0; color:#234466; font-size:clamp(14px,1.3vw,16px); font-weight:600; }
.local-game-retry { justify-self:center; padding-inline:24px; background:#c4f2d7; color:#183f3a; border-radius:24px; }
.local-game-frame-host iframe { position:absolute; left:50%; top:50%; border:0; background:#162b41; transform-origin:top left; }
.local-game .local-game-fullscreen {
  position:absolute;
  z-index:2;
  right:max(6px,env(safe-area-inset-right));
  top:max(6px,env(safe-area-inset-top));
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  box-sizing:border-box;
  padding:0;
  color:white;
  border:5px solid transparent;
  border-radius:50%;
  background:#162b41bf padding-box;
}
.local-game-fullscreen[aria-pressed="false"] .fullscreen-exit,
.local-game-fullscreen[aria-pressed="true"] .fullscreen-enter { display:none; }
.local-game button.local-game-fullscreen[hidden] { display:none; }
.local-game button:disabled { cursor:default; opacity:.5; }
.local-game-stage [hidden],.local-game [hidden] { display:none; }
.game.local-game.expanded { position:fixed; inset:0; z-index:100001; width:100%; height:100dvh; margin:0; border:0; border-radius:0; }
.game.local-game.expanded > .local-game-player-content { position:absolute; inset:0; height:100%; }
.game.local-game.expanded .local-game-stage { height:100%; aspect-ratio:auto; }
html.local-game-expanded,body.local-game-expanded { overflow:hidden; }
/* 与 DS 一样旋转内部容器，避免浏览器重置原生全屏元素的 transform。 */
@media(orientation:portrait) {
  .game.local-game.expanded.local-game-rotate > .local-game-player-content { inset:0 auto auto 0; width:100dvh; height:100dvw; transform-origin:top left; transform:translateX(100dvw) rotate(90deg); }
}
@media (max-width:767px) and (orientation:portrait) {
  .local-game-welcome > .arcade-icon { width:clamp(60px,20vw,88px); }
  .local-game-loading-title { font-size:clamp(22px,6.4vw,28px); }
  .local-game-meter { width:84%; height:18px; }
  .local-game-welcome p { font-size:16px; }
}
@media(max-width:767px), (any-pointer:coarse) {
  body:has([data-local-game]) > header { display:none; }
  main:has([data-local-game]) { padding-top:0; }
  .game.local-game:not(.expanded) { width:100vw; margin:0 calc(50% - 50vw); border-radius:0; border:0; }
  .local-game:not(.expanded)[data-orientation="portrait"] .local-game-stage { aspect-ratio:3/4; }
  @media (orientation:portrait) {
    .local-game:not(.expanded)[data-orientation="responsive"] .local-game-stage { aspect-ratio:3/4; }
  }
  .local-game.expanded[data-orientation="portrait"] .local-game-frame-host {
    width:min(100%,75dvh);
    aspect-ratio:3/4;
    margin:auto;
    height:auto;
    top:50%;
    bottom:auto;
    transform:translateY(-50%);
  }
}
