/* Keep collection navigation beside the game, including in browser fullscreen. */
body.halloween.overhaul.worlds:has(#player-dialog[open]) {
  overflow:hidden;
  overscroll-behavior:none;
}
body.halloween.overhaul.worlds #player-dialog {
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  height:100dvh;
  min-width:0;
  min-height:0;
  max-width:none;
  max-height:none;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  overflow:hidden;
  background:var(--xg-deep);
  box-shadow:none;
  color:var(--text);
  isolation:isolate;
  overscroll-behavior:none;
}
body.halloween.overhaul.worlds #player-dialog::backdrop {
  background:#000;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
body.halloween.overhaul.worlds #player-dialog:fullscreen {width:100vw;height:100vh;height:100dvh;background:var(--xg-deep)}
body.halloween.overhaul.worlds #player-dialog .player-shell {
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  overflow:hidden;
  background:var(--xg-deep);
}
body.halloween.overhaul.worlds .player-bar {
  position:relative;
  z-index:5;
  display:flex;
  align-items:center;
  gap:13px;
  min-width:0;
  min-height:64px;
  padding:8px max(16px,env(safe-area-inset-right)) 8px max(16px,env(safe-area-inset-left));
  padding-top:max(8px,env(safe-area-inset-top));
  border-bottom:1px solid rgba(var(--xg-accent-rgb),.18);
  background:linear-gradient(180deg,#ffffff05,transparent),var(--xg-deep);
  box-shadow:0 4px 14px #0003;
}
body.halloween.overhaul.worlds .player-icon-button {
  display:inline-flex;
  flex:0 0 48px;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  min-width:48px;
  min-height:48px;
  padding:0;
  border:1px solid var(--xg-border);
  border-radius:10px;
  background:linear-gradient(145deg,#ffffff0b,transparent 60%),var(--xg-surface);
  box-shadow:inset 0 1px 0 #ffffff0b;
  color:var(--xg-soft);
  font:500 22px/1 var(--font);
  cursor:pointer;
  touch-action:manipulation;
  transition:background .16s,border-color .16s,color .16s;
}
body.halloween.overhaul.worlds #player-close {color:var(--lime);border-color:rgba(var(--xg-accent-rgb),.3)}
body.halloween.overhaul.worlds .player-icon-button svg {width:20px;height:20px}
body.halloween.overhaul.worlds .player-icon-button:hover {border-color:var(--lime);background:rgba(var(--xg-accent-rgb),.1);color:var(--lime)}
body.halloween.overhaul.worlds .player-icon-button:disabled {opacity:.45;cursor:default}
body.halloween.overhaul.worlds #player-dialog :is(button,a):focus-visible {outline:2px solid var(--lime);outline-offset:3px}
body.halloween.overhaul.worlds .player-heading {display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;gap:3px;min-width:0;overflow:hidden}
body.halloween.overhaul.worlds .player-eyebrow {display:block;color:var(--lime);font:600 7.5px/1.3 ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:1.5px;white-space:nowrap}
body.halloween.overhaul.worlds #player-title {display:block;min-width:0;max-width:100%;margin:0;overflow:hidden;color:var(--text);font:650 16px/1.3 var(--display);letter-spacing:-.35px;white-space:nowrap;text-overflow:ellipsis}
body.halloween.overhaul.worlds .player-actions {display:flex;flex:0 0 auto;align-items:center;gap:7px;margin-left:auto}
body.halloween.overhaul.worlds .player-stage {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
  min-width:0;
  min-height:0;
  padding:0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
  overflow:hidden;
  background:#000;
  isolation:isolate;
}
body.halloween.overhaul.worlds #game-frame {
  position:relative;
  z-index:0;
  display:block;
  grid-area:1/1;
  width:100%;
  height:100%;
  min-width:0;
  min-height:0;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  background:#000;
  color-scheme:dark;
}
body.halloween.overhaul.worlds #player-loading {
  position:absolute;
  inset:0;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:11px;
  padding:24px;
  background:radial-gradient(ellipse at 50% 40%,rgba(var(--xg-accent-rgb),.055),transparent 60%),#070d10ed;
  color:var(--xg-soft);
  font-size:12px;
  line-height:1.5;
  text-align:center;
  pointer-events:none;
}
body.halloween.overhaul.worlds .player-loader {display:block;flex:0 0 22px;width:22px;height:22px;border:2px solid rgba(var(--xg-accent-rgb),.2);border-top-color:var(--lime);border-radius:50%;animation:xg-player-loading .9s linear infinite}
body.halloween.overhaul.worlds .player-focus {
  position:absolute;
  left:50%;
  top:50%;
  z-index:4;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  max-width:calc(100% - 32px);
  padding:12px 22px;
  border:1px solid var(--lime);
  border-radius:10px;
  background:linear-gradient(180deg,#ffffff24,transparent),var(--lime);
  box-shadow:inset 0 1px 0 #ffffff38,0 8px 28px #0008;
  color:var(--console-ink);
  font-size:13px;
  font-weight:700;
  line-height:1.4;
  transform:translate(-50%,-50%);
  cursor:pointer;
}
body.halloween.overhaul.worlds .player-help {
  position:absolute;
  left:50%;
  bottom:18px;
  z-index:6;
  width:min(460px,calc(100% - 36px));
  max-height:calc(100% - 36px);
  padding:20px;
  border:1px solid rgba(var(--xg-accent-rgb),.35);
  border-radius:13px;
  overflow:auto;
  overscroll-behavior:contain;
  background:linear-gradient(145deg,#ffffff09,transparent 50%),var(--xg-surface);
  box-shadow:inset 0 1px 0 #ffffff13,0 15px 45px #0009;
  color:var(--text);
  transform:translateX(-50%);
}
body.halloween.overhaul.worlds .player-help h3 {margin:0;color:var(--text);font:650 22px/1.3 var(--display);letter-spacing:-.55px}
body.halloween.overhaul.worlds .player-help p {margin:8px 0 12px;color:var(--xg-soft);font-size:12px;line-height:1.7}
body.halloween.overhaul.worlds .player-help :is(#player-direct,#player-try-again) {display:inline-flex;align-items:center;justify-content:center;min-height:48px;margin-top:5px;padding:11px 16px;border:1px solid var(--xg-border);border-radius:9px;font-size:12px;font-weight:650;line-height:1.4;cursor:pointer}
body.halloween.overhaul.worlds #player-direct {background:var(--lime);border-color:var(--lime);color:var(--console-ink)}
body.halloween.overhaul.worlds #player-try-again {margin-left:6px;background:var(--xg-deep);color:var(--text)}
body.halloween.overhaul.worlds .player-footer {position:relative;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;min-height:54px;padding:3px max(16px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));border-top:1px solid rgba(var(--xg-accent-rgb),.14);background:linear-gradient(180deg,#ffffff06,transparent),var(--xg-deep)}
body.halloween.overhaul.worlds #player-save-note {min-width:0;color:var(--xg-dim);font-size:10px;line-height:1.5}
body.halloween.overhaul.worlds #player-help-toggle {display:inline-flex;flex:0 0 auto;align-items:center;justify-content:center;min-height:48px;margin:0;padding:9px 10px;border:1px solid transparent;border-radius:8px;color:var(--xg-soft);font-size:11px;line-height:1.4;white-space:nowrap;cursor:pointer}
body.halloween.overhaul.worlds #player-help-toggle:hover,body.halloween.overhaul.worlds #player-help-toggle[aria-expanded=true] {border-color:rgba(var(--xg-accent-rgb),.25);background:rgba(var(--xg-accent-rgb),.06);color:var(--lime)}
body.halloween.overhaul.worlds #player-dialog [hidden] {display:none!important}
@keyframes xg-player-loading {to {transform:rotate(360deg)}}
@media(max-width:600px) {
  body.halloween.overhaul.worlds .player-bar {gap:8px;min-height:60px;padding:6px max(10px,env(safe-area-inset-right)) 6px max(10px,env(safe-area-inset-left));padding-top:max(6px,env(safe-area-inset-top))}
  body.halloween.overhaul.worlds .player-eyebrow {display:none}
  body.halloween.overhaul.worlds #player-title {font-size:14px;letter-spacing:-.3px}
  body.halloween.overhaul.worlds .player-actions {gap:5px}
  body.halloween.overhaul.worlds .player-icon-button {border-radius:9px}
  body.halloween.overhaul.worlds .player-footer {gap:8px;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  body.halloween.overhaul.worlds #player-save-note {font-size:8.5px;line-height:1.45}
  body.halloween.overhaul.worlds #player-help-toggle {padding-left:7px;padding-right:7px;font-size:10px}
  body.halloween.overhaul.worlds .player-help {bottom:12px;width:calc(100% - 24px);max-height:calc(100% - 24px);padding:18px;border-radius:11px}
  body.halloween.overhaul.worlds .player-help :is(#player-direct,#player-try-again) {width:100%;margin-left:0}
}
@media(orientation:landscape) and (max-height:500px) {
  body.halloween.overhaul.worlds .player-bar {min-height:56px;gap:10px;padding-top:max(4px,env(safe-area-inset-top));padding-bottom:4px}
  body.halloween.overhaul.worlds .player-eyebrow {display:none}
  body.halloween.overhaul.worlds #player-title {font-size:14px}
  body.halloween.overhaul.worlds .player-footer {min-height:50px;padding-top:1px;padding-bottom:max(1px,env(safe-area-inset-bottom))}
  body.halloween.overhaul.worlds #player-save-note {font-size:8.5px}
  body.halloween.overhaul.worlds #player-help-toggle {font-size:10px}
  body.halloween.overhaul.worlds .player-help {bottom:10px;max-height:calc(100% - 20px);padding:15px 18px}
}
html.motion-paused body.halloween.overhaul.worlds .player-loader,
body.halloween.overhaul.worlds.motion-paused .player-loader {animation:none}
@media(prefers-reduced-motion:reduce) {
  body.halloween.overhaul.worlds .player-loader {animation:none}
  body.halloween.overhaul.worlds .player-icon-button {transition:none}
}
