#loult-game-stage { position:fixed; inset:0; z-index:40; background:#100d18; display:block; animation:loult-game-enter .55s ease both; }
#loult-game-stage[hidden], #loult-game-loader[hidden], #loult-game-controls[hidden] { display:none; }
#loult-game-stage iframe { width:100%; height:100%; border:0; display:block; }
#loult-game-loader { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; color:#f6edff; background:radial-gradient(ellipse at center,#38214d,#100d18 70%); text-align:center; padding:30px; }
#loult-game-loader h1 { font:700 clamp(24px,4vw,48px) Verdana,sans-serif; }
#loult-game-progress { width:min(360px,75vw); height:7px; accent-color:#bf8bfa; }
#loult-game-error { max-width:540px; color:#ffb6bc; }
.game-orbit { font-size:72px; color:#d4a3ff; animation:loult-game-pulse 1.5s ease-in-out infinite; }
#loult-game-controls { position:fixed; right:16px; top:12px; z-index:110; display:flex; gap:8px; flex:none; }
#loult-game-controls button { border:1px solid #ffffff38; border-radius:20px; padding:9px 16px; color:#fff; background:#20182bdd; cursor:pointer; }
body.loult-gaming #head, body.loult-gaming #userlist, body.loult-gaming #underlay { display:none !important; }
body.loult-gaming #main { position:fixed !important; left:14px; bottom:150px; width:min(360px,36vw); height:42vh; max-height:430px; z-index:100; display:block; flex:none; min-height:0; background:#130f20c9; border:1px solid #ffffff24; border-radius:14px 14px 0 0; backdrop-filter:blur(12px); opacity:0; pointer-events:none; transform:translateX(-16px); transition:opacity .3s,transform .3s; }
body.loult-gaming #chat { width:100% !important; height:100% !important; padding:12px; box-sizing:border-box; overflow:auto; background:transparent !important; }
body.loult-gaming #foot { position:fixed !important; left:14px; bottom:58px; width:min(360px,36vw); height:92px; z-index:100; opacity:0; pointer-events:none; background:#130f20ec; border-radius:0 0 14px 14px; transition:opacity .3s; padding:6px; box-sizing:border-box; }
body.loult-gaming #room-options, body.loult-gaming #chat-controls { display:none !important; }
body.loult-gaming.loult-chat-visible #main, body.loult-gaming.loult-chat-visible #foot, body.loult-gaming #main:hover, body.loult-gaming #foot:focus-within { opacity:1; pointer-events:auto; transform:none; }
@keyframes loult-game-enter { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
@keyframes loult-game-pulse { 50% { transform:rotate(18deg) scale(1.15); opacity:.6; } }
@media(max-width:650px) { body.loult-gaming #main,body.loult-gaming #foot { width: min(320px,76vw); } }
@media(prefers-reduced-motion:reduce) { #loult-game-stage,.game-orbit { animation:none; } body.loult-gaming #main,body.loult-gaming #foot { transition:none; } }
/* Chat HUD: original live messages and input, drawn directly over the map. */
body.loult-gaming #main { left:20px; bottom:94px; width:min(660px,75vw); height:190px; max-height:30vh; border:0; border-radius:0; background:transparent !important; backdrop-filter:none; transform:none; box-shadow:none; transition:opacity .25s; }
body.loult-gaming #chat { padding:0; scrollbar-width:none; text-shadow:0 1px 3px #000,0 0 5px #000; font:15px/1.4 sans-serif; }
body.loult-gaming #chat > div { display:block !important; margin:3px 0 !important; padding:0 !important; border:0 !important; background:transparent !important; min-height:0 !important; }
body.loult-gaming #chat > div > :first-child, body.loult-gaming #chat > div > :nth-child(3) { display:none !important; }
body.loult-gaming #chat > div > :nth-child(2) { display:block !important; margin:0 !important; padding:0 !important; background:transparent !important; }
body.loult-gaming #chat > div > :nth-child(2) > div { display:inline !important; margin:0 6px 0 0 !important; padding:0 !important; background:transparent !important; }
body.loult-gaming #chat img, body.loult-gaming #chat video { max-height:70px; max-width:150px; }
body.loult-gaming #foot { left:20px; bottom:52px; width:min(660px,75vw); height:36px; padding:0; border:0; border-radius:0; background:transparent !important; }
body.loult-gaming #foot > :not(#input) { display:none !important; }
body.loult-gaming #input { width:100%; height:36px; margin:0; box-sizing:border-box; padding:6px 10px; border:0; border-bottom:1px solid #ffffff80; border-radius:0; background:#0008 !important; color:white; font:15px sans-serif; }
body.loult-gaming.loult-on-map.loult-chat-visible #main, body.loult-gaming.loult-chat-writing #main { opacity:1; pointer-events:none; }
body.loult-gaming #foot, body.loult-gaming.loult-chat-visible #foot { opacity:0; pointer-events:none; }
body.loult-gaming.loult-chat-writing #foot { opacity:1; pointer-events:auto; }
body.loult-gaming #main:hover { pointer-events:none; }
body.loult-gaming #foot > #composer { display:flex !important; width:100%; height:36px; margin:0; padding:0; background:transparent; }
body.loult-gaming #composer > :not(#input) { display:none !important; }

/* LOULT_LOADING_CHAT_V1: the live chat remains usable throughout download. */
#loult-game-loader { overflow:hidden; isolation:isolate; align-items:flex-end; justify-content:flex-end; gap:12px; padding:6vh 5vw 10vh; background:#100d18; }
#loult-game-loader > :not(.game-loading-scene) { position:relative; z-index:1; width:min(440px,42vw); margin:0; text-align:center; text-shadow:0 2px 12px #000; }
#loult-game-loader .game-orbit { font-size:36px; }
#loult-game-loader h1 { font-size:clamp(22px,3vw,38px); }
#loult-game-loader #loult-game-progress { height:10px; accent-color:#a8ddff; }
.game-loading-scene { position:absolute; inset:0; z-index:0; pointer-events:none; background:#100d18; }
.game-loading-scene::before { content:""; position:absolute; inset:-3%; background:url('/game-loading-background.png') center / cover no-repeat; animation:loult-loading-drift 24s ease-in-out infinite alternate; will-change:transform; }
.game-loading-scene::after { content:""; position:absolute; inset:0; background:radial-gradient(ellipse at 49% 16%,#9c43ff30,transparent 48%),radial-gradient(ellipse at 80% 60%,#00c8ff18,transparent 55%),linear-gradient(0deg,#070610ec,transparent 55%); animation:loult-loading-glow 7s ease-in-out infinite alternate; }
body.loult-gaming.loult-game-loading #main { opacity:1; pointer-events:auto; width:min(440px,42vw); height:min(230px,32vh); max-height:none; padding:14px; box-sizing:border-box; border:1px solid #c6a4ff45; border-bottom:0; border-radius:14px 14px 0 0; background:#0e0b1bcc !important; backdrop-filter:blur(10px); transform:none; }
body.loult-gaming.loult-game-loading #foot { opacity:1; pointer-events:auto; width:min(440px,42vw); height:42px; bottom:52px; padding:0 10px 6px; box-sizing:border-box; border:1px solid #c6a4ff45; border-top:0; border-radius:0 0 14px 14px; background:#0e0b1bee !important; }
body.loult-gaming.loult-game-loading #main:hover { pointer-events:auto; }
body.loult-gaming.loult-game-loading #input { background:#ffffff0b !important; }
body.loult-gaming.loult-chat-writing #main { opacity:1; }
@keyframes loult-loading-drift { from { transform:scale(1) translate(-.5%,0); } to { transform:scale(1.055) translate(.5%,-.6%); } }
@keyframes loult-loading-glow { from { opacity:.7; } to { opacity:1; } }
@media(max-width:650px) {
  #loult-game-loader { align-items:center; justify-content:flex-start; padding:16vh 20px 30px; }
  #loult-game-loader > :not(.game-loading-scene) { width:min(440px,90vw); }
  .game-loading-scene::before { background-position:52% center; }
  body.loult-gaming.loult-game-loading #main, body.loult-gaming.loult-game-loading #foot { left:12px; width:calc(100vw - 24px); }
  body.loult-gaming.loult-game-loading #main { height:min(190px,28vh); }
}
@media(prefers-reduced-motion:reduce) { .game-loading-scene::before, .game-loading-scene::after { animation:none; will-change:auto; } }
