/* rbx/hud.css — the in-experience UI (worlds, NeoStudio playtests, Thunder Battle):
   topbar buttons, chat window, player list, health bar, backpack, the Esc menu and notifications.
   Generic game-UI shapes in Neoblox's own colors; nothing here is copied artwork. */

.rbx-ui{ --rbx-bg: rgba(25,27,29,0.62); --rbx-bg-solid:#232527; --rbx-line: rgba(255,255,255,0.14);
  --rbx-ink:#ffffff; --rbx-dim:#bdbebe; --rbx-green:#00b06f; --rbx-blue:#335fff;
  font-family:'Nunito Sans','Segoe UI',system-ui,-apple-system,sans-serif; color:var(--rbx-ink); }
#rbxRoot{ position:fixed; inset:0; pointer-events:none; z-index:45; display:none; }
#rbxRoot.on{ display:block; }
#rbxRoot .hit{ pointer-events:auto; }

/* hide the old per-mode chrome while the in-experience UI is up (the lobby keeps its own UI) */
body.rbx-exp #modeTopBar, body.rbx-exp #hintBar, body.rbx-exp #emoteBar, body.rbx-exp #chatFeed,
body.rbx-exp #timerChip{ display:none !important; }
body.rbx-exp.rbx-studio #modeTopBar{ display:flex !important; }
body.rbx-exp.rbx-battle #bhMinimapWrap{ top:auto !important; bottom:188px !important; right:72px !important; }
body.rbx-exp.rbx-battle #bhStatsWrap{ bottom:134px !important; right:72px !important; }

/* ---------- topbar (menu + chat buttons) ---------- */
#rbxTopbar{ position:absolute; left:12px; top:12px; display:flex; gap:10px; }
body.rbx-studio #rbxTopbar{ top:196px; }
.rbx-tb-btn{ width:44px; height:44px; border-radius:12px; border:none; background:var(--rbx-bg);
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:#fff; position:relative;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background .12s, transform .08s; }
.rbx-tb-btn:hover{ background:rgba(60,62,66,0.8); }
.rbx-tb-btn:active{ transform:scale(0.95); }
.rbx-tb-btn svg{ width:24px; height:24px; }
.rbx-tb-btn.active{ background:rgba(255,255,255,0.88); color:#1b1d1f; }
.rbx-tb-btn .badge{ position:absolute; top:-3px; right:-3px; min-width:16px; height:16px; padding:0 4px; border-radius:8px;
  background:#e2231a; color:#fff; font-size:10px; font-weight:800; display:none; align-items:center; justify-content:center; }
.rbx-tb-btn .badge.on{ display:flex; }

/* ---------- health bar (top right, next to the player list) ---------- */
#rbxHealth{ position:absolute; top:22px; right:252px; width:180px; height:18px; border-radius:9px; background:rgba(0,0,0,0.45);
  overflow:hidden; display:none; box-shadow: 0 0 0 2px rgba(0,0,0,0.25); }
#rbxHealth.on{ display:block; }
#rbxHealth .fill{ height:100%; width:100%; background:#27c946; transition: width .18s, background .18s; }
#rbxHealth .txt{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:800; text-shadow:0 1px 2px rgba(0,0,0,.7); }
body.rbx-studio #rbxHealth{ top:206px; }

/* ---------- timer (obbies) ---------- */
#rbxTimer{ position:absolute; top:16px; left:50%; transform:translateX(-50%); background:var(--rbx-bg); border-radius:10px; padding:6px 14px;
  font-weight:800; font-size:16px; font-variant-numeric: tabular-nums; display:none; }
#rbxTimer.on{ display:block; }
body.rbx-studio #rbxTimer{ top:200px; }

/* ---------- chat ---------- */
#rbxChat{ position:absolute; left:12px; top:66px; width:min(420px, calc(100vw - 24px)); display:flex; flex-direction:column; }
body.rbx-studio #rbxChat{ top:250px; }
#rbxChat.closed{ display:none; }
#rbxChatLog{ max-height:190px; overflow-y:auto; padding:8px 10px; border-radius:10px 10px 0 0; background:rgba(25,27,29,0.0);
  transition: background .25s; scrollbar-width:thin; }
#rbxChat.hover #rbxChatLog, #rbxChat.focused #rbxChatLog{ background:rgba(25,27,29,0.45); }
.rbx-msg{ font-size:15px; font-weight:700; line-height:1.3; margin:2px 0; text-shadow:0 1px 2px rgba(0,0,0,.85), 0 0 1px rgba(0,0,0,.9); word-wrap:break-word; transition: opacity .6s; }
.rbx-msg.faded{ opacity:0; }
#rbxChat.hover .rbx-msg.faded, #rbxChat.focused .rbx-msg.faded{ opacity:1; }
.rbx-msg .who{ margin-right:4px; }
.rbx-msg.sys{ color:#d7d7d7; font-style:italic; }
#rbxChatBar{ display:flex; align-items:center; gap:6px; background:rgba(25,27,29,0.6); border-radius:0 0 10px 10px; padding:6px 8px; opacity:0.55; transition:opacity .2s; }
#rbxChat.hover #rbxChatBar, #rbxChat.focused #rbxChatBar{ opacity:1; }
#rbxChatInput{ flex:1; background:transparent; border:none; outline:none; color:#fff; font:inherit; font-size:15px; font-weight:600; padding:4px; user-select:text; -webkit-user-select:text; }
#rbxChatInput::placeholder{ color:#cfd0d1; }
#rbxChatSend{ border:none; background:transparent; color:#fff; font-size:18px; cursor:pointer; padding:0 4px; }

/* ---------- player list ---------- */
#rbxPlayers{ position:absolute; right:12px; top:12px; min-width:220px; max-width:320px; border-radius:10px; overflow:hidden; background:var(--rbx-bg);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
body.rbx-studio #rbxPlayers{ top:196px; }
#rbxPlayers.closed{ display:none; }
.rbx-pl-row{ display:flex; align-items:center; gap:8px; padding:7px 12px; font-size:14px; font-weight:700; }
.rbx-pl-row + .rbx-pl-row{ border-top:1px solid rgba(255,255,255,0.06); }
.rbx-pl-row.head{ font-size:12px; color:var(--rbx-dim); background:rgba(0,0,0,0.25); font-weight:800; }
.rbx-pl-row.me{ background:rgba(255,255,255,0.08); }
.rbx-pl-row .nm{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rbx-pl-row .st{ width:62px; text-align:right; font-variant-numeric: tabular-nums; }
.rbx-pl-row .ico{ width:22px; height:22px; border-radius:50%; flex:none; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25); }
.rbx-pl-row.dead .nm{ opacity:.5; }

/* ---------- backpack / hotbar ---------- */
#rbxHotbar{ position:absolute; left:50%; bottom:16px; transform:translateX(-50%); display:none; gap:8px; }
#rbxHotbar.on{ display:flex; }
.rbx-slot{ width:62px; height:62px; border-radius:10px; background:var(--rbx-bg); border:2px solid transparent; position:relative; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:28px; transition: border-color .1s, transform .08s; }
.rbx-slot .k{ position:absolute; left:6px; top:3px; font-size:12px; font-weight:800; color:#e6e6e6; }
.rbx-slot .n{ position:absolute; left:0; right:0; bottom:3px; text-align:center; font-size:9.5px; font-weight:800; color:#e6e6e6; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:0 3px; }
.rbx-slot.sel{ border-color:#ffffff; background:rgba(60,62,66,0.85); }
.rbx-slot.empty{ opacity:.45; cursor:default; }

/* ---------- notifications (bottom right) ---------- */
#rbxNotes{ position:absolute; right:14px; bottom:96px; display:flex; flex-direction:column; gap:8px; align-items:flex-end; }
.rbx-note{ min-width:220px; max-width:320px; background:var(--rbx-bg-solid); border-radius:10px; padding:10px 14px; font-size:14px; font-weight:700;
  box-shadow:0 6px 20px rgba(0,0,0,.35); animation: rbxNoteIn .22s ease-out; }
.rbx-note .t{ font-size:12px; color:var(--rbx-dim); font-weight:800; margin-bottom:2px; }
.rbx-note.out{ transition: opacity .3s, transform .3s; opacity:0; transform:translateX(20px); }
@keyframes rbxNoteIn{ from{ opacity:0; transform:translateX(24px); } to{ opacity:1; transform:none; } }

/* ---------- respawn note ---------- */
#rbxDeath{ position:absolute; left:50%; top:38%; transform:translate(-50%,-50%); font-size:18px; font-weight:800; text-shadow:0 2px 6px rgba(0,0,0,.6);
  background:rgba(25,27,29,0.55); padding:10px 20px; border-radius:12px; display:none; }
#rbxDeath.on{ display:block; }

/* ---------- Esc menu ---------- */
#rbxMenu{ position:fixed; inset:0; background:rgba(12,13,14,0.62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display:none; align-items:center; justify-content:center; z-index:60; pointer-events:auto; }
#rbxMenu.on{ display:flex; }
.rbx-menu-card{ width:min(780px, calc(100vw - 32px)); height:min(560px, calc(100vh - 40px)); display:flex; flex-direction:column; }
.rbx-menu-tabs{ display:flex; gap:4px; justify-content:center; margin-bottom:14px; }
.rbx-menu-tab{ border:none; background:transparent; color:#cfd0d1; font:inherit; font-weight:800; font-size:16px; padding:10px 18px; border-radius:10px; cursor:pointer; display:flex; gap:8px; align-items:center; }
.rbx-menu-tab:hover{ background:rgba(255,255,255,0.08); color:#fff; }
.rbx-menu-tab.on{ background:rgba(255,255,255,0.14); color:#fff; }
.rbx-menu-body{ flex:1; overflow-y:auto; background:rgba(25,27,29,0.75); border-radius:14px; padding:16px 18px; }
.rbx-menu-actions{ display:flex; gap:14px; justify-content:center; margin-top:16px; flex-wrap:wrap; }
.rbx-big-btn{ min-width:170px; border:none; border-radius:10px; padding:13px 18px; font:inherit; font-weight:800; font-size:16px; cursor:pointer; color:#fff;
  background:rgba(255,255,255,0.12); display:flex; align-items:center; justify-content:center; gap:10px; }
.rbx-big-btn:hover{ background:rgba(255,255,255,0.2); }
.rbx-big-btn.primary{ background:#ffffff; color:#1b1d1f; }
.rbx-big-btn.primary:hover{ background:#e7e7e7; }
.rbx-big-btn.danger{ background:#e2231a; }
.rbx-big-btn kbd{ font:inherit; font-size:12px; font-weight:800; padding:1px 7px; border-radius:6px; background:rgba(0,0,0,0.25); }
.rbx-big-btn.primary kbd{ background:rgba(0,0,0,0.1); }
.rbx-big-btn:disabled{ opacity:.4; cursor:default; }
.rbx-set-row{ display:flex; align-items:center; justify-content:space-between; gap:16px; padding:12px 4px; border-bottom:1px solid var(--rbx-line); font-weight:700; }
.rbx-set-row:last-child{ border-bottom:none; }
.rbx-set-row .lab{ font-size:15px; }
.rbx-set-row .sub{ font-size:12px; color:var(--rbx-dim); font-weight:600; }
.rbx-set-row input[type=range]{ width:200px; accent-color:#fff; }
.rbx-switch{ width:46px; height:26px; border-radius:13px; background:rgba(255,255,255,0.2); position:relative; border:none; cursor:pointer; flex:none; }
.rbx-switch::after{ content:''; position:absolute; left:3px; top:3px; width:20px; height:20px; border-radius:50%; background:#fff; transition:left .15s; }
.rbx-switch.on{ background:var(--rbx-green); }
.rbx-switch.on::after{ left:23px; }
.rbx-plist-row{ display:flex; align-items:center; gap:12px; padding:10px 6px; border-bottom:1px solid var(--rbx-line); font-weight:800; }
.rbx-plist-row .av{ width:40px; height:40px; border-radius:50%; flex:none; box-shadow: inset 0 0 0 3px rgba(255,255,255,0.2); }
.rbx-plist-row .nm{ flex:1; }
.rbx-plist-row .sm{ font-size:12px; color:var(--rbx-dim); font-weight:700; }
.rbx-small-btn{ border:none; border-radius:8px; padding:7px 12px; font:inherit; font-weight:800; font-size:13px; cursor:pointer; background:rgba(255,255,255,0.14); color:#fff; }
.rbx-small-btn:hover{ background:rgba(255,255,255,0.24); }
.rbx-help-grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap:10px; }
.rbx-help-item{ background:rgba(255,255,255,0.06); border-radius:10px; padding:10px 12px; font-weight:700; font-size:14px; display:flex; justify-content:space-between; gap:10px; }
.rbx-help-item kbd{ font:inherit; font-weight:800; font-size:12px; padding:2px 8px; border-radius:6px; background:rgba(255,255,255,0.16); white-space:nowrap; }
.rbx-confirm{ text-align:center; padding:40px 10px; }
.rbx-confirm h3{ font-family:inherit; font-size:24px; font-weight:900; margin:0 0 6px; }
.rbx-confirm p{ color:var(--rbx-dim); font-weight:700; margin:0 0 22px; }

/* ---------- win confetti ---------- */
.rbx-confetti{ position:fixed; top:-12px; width:10px; height:14px; z-index:70; pointer-events:none; animation: rbxFall linear forwards; }
@keyframes rbxFall{ to{ transform: translateY(110vh) rotate(720deg); } }

@media (max-width: 720px){
  #rbxPlayers{ min-width:160px; font-size:12px; }
  #rbxHealth{ right:12px; top:62px; width:140px; }
  .rbx-slot{ width:52px; height:52px; font-size:22px; }
  #rbxChat{ width:min(300px, calc(100vw - 24px)); }
  .rbx-menu-tab{ padding:8px 10px; font-size:14px; }
  .rbx-big-btn{ min-width:0; flex:1; }
}

/* lobby music + the token counter aren't needed inside a game (and the music button sat on top
   of the touch jump button) */
body.rbx-exp #musicDock, body.rbx-exp #tokenDock{ display:none !important; }
