:root {
  --bg: #111216;
  --bg2: #17181d;
  --panel: #1d1f25;
  --card: #24262d;
  --card2: #2c2f37;
  --line: #2f323a;
  --line2: #3b3f49;
  --text: #f3f4f6;
  --muted: #9aa0ab;
  --dim: #6b717d;
  --green: #2fb36b;
  --green2: #36c878;
  --blue: #3b82f6;
  --red: #ff2d4b;
  --red2: #ff5a6e;
  --cyan: #45e6ff;
  --gold: #ffcc4d;
  --r: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font-family: inherit; }
img { display: block; }
.hidden { display: none !important; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: #33363f; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ================= TOPBAR ================= */
#menu { position: fixed; inset: 0; display: flex; flex-direction: column; animation: fadein .4s var(--ease); }
@keyframes fadein { from { opacity: 0; } }
.topbar { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 0 18px 0 10px;
  background: #17181d; border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.iconbtn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; position: relative; color: #d9dce1; transition: background .15s; }
.iconbtn:hover { background: #2a2d35; }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn .pill { position: absolute; top: 4px; right: 3px; background: var(--red); font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 9px; }
.logo { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin-right: 8px; }
.logomark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(140deg, #fff, #cfd3da); transform: rotate(-12deg); display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 -3px 0 rgba(0,0,0,.12); }
.logomark i { width: 11px; height: 11px; border-radius: 3px; background: #111216; }
.logomark.sm { width: 22px; height: 22px; border-radius: 6px; } .logomark.sm i { width: 8px; height: 8px; border-radius: 2px; }
.logotype { font-weight: 900; font-size: 19px; letter-spacing: .5px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; cursor: pointer; color: #e3e5e9; }
.nav a:hover { background: #2a2d35; }
.search { flex: 1; max-width: 560px; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 10px; background: #0d0e11; border: 1px solid var(--line2); transition: border .15s, box-shadow .15s; margin: 0 auto; }
.search:focus-within { border-color: #6c7380; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font-size: 15px; }
.topright { display: flex; align-items: center; gap: 6px; }
.buxbtn { display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 10px; font-weight: 700; font-size: 15px; }
.buxbtn:hover { background: #2a2d35; }
.buxicon { width: 16px; height: 16px; border: 3px solid currentColor; border-radius: 4px; transform: rotate(45deg); display: inline-block; flex-shrink: 0; position: relative; }
.buxicon::after { content: ""; position: absolute; inset: 2px; border-radius: 1px; background: currentColor; opacity: .35; }
.tophead { width: 36px; height: 36px; border-radius: 50%; background: #2a2d35; cursor: pointer; margin-left: 6px; object-fit: cover; }

/* ================= LAYOUT ================= */
.shell { flex: 1; display: flex; min-height: 0; }
.sidebar { width: 216px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; transition: width .25s var(--ease), padding .25s; overflow: hidden; }
.sidebar.collapsed { width: 0; padding: 12px 0; border: 0; }
.sidebar a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; color: #dfe2e7; cursor: pointer; white-space: nowrap; transition: background .12s; }
.sidebar a:hover { background: #24272e; }
.sidebar a.active { background: #2b2e36; color: #fff; }
.sidebar a svg { width: 22px; height: 22px; flex-shrink: 0; opacity: .9; }
.sidebar a .count { margin-left: auto; font-size: 12px; background: #33363f; padding: 2px 8px; border-radius: 10px; }
.sidebar .me { margin-bottom: 8px; padding: 8px 10px; }
.sidebar .me img { width: 34px; height: 34px; border-radius: 50%; background: #2a2d35; }
.sidebar .me span { font-weight: 800; overflow: hidden; text-overflow: ellipsis; }
.sidefoot { margin-top: auto; font-size: 11px; color: var(--dim); padding: 12px; line-height: 1.5; white-space: nowrap; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { padding: 28px 40px 80px; max-width: 1500px; animation: pagein .35s var(--ease); }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } }

h1 { font-size: 34px; font-weight: 800; margin: 0; letter-spacing: -.5px; }
.sec { margin-top: 34px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-h h2 { font-size: 21px; font-weight: 800; margin: 0; letter-spacing: -.2px; }
.sec-h .more { font-size: 14px; color: var(--muted); font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.sec-h .more:hover { color: #fff; }
.sec-h .arrows { margin-left: auto; display: flex; gap: 6px; }
.sec-h .arrows button { width: 32px; height: 32px; border-radius: 50%; background: #24272e; display: grid; place-items: center; }
.sec-h .arrows button:hover { background: #31353e; }
.sec-h .arrows svg { width: 16px; height: 16px; }

/* home hero */
.hello { display: flex; align-items: center; gap: 22px; }
.hello .av { width: 108px; height: 108px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #3a3e48, #1b1d22); box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.hello h1 span { display: block; font-size: 15px; font-weight: 600; color: var(--muted); margin-top: 6px; letter-spacing: 0; }
.friends { display: flex; gap: 20px; overflow-x: auto; padding: 4px 2px 10px; scroll-behavior: smooth; }
.friend { width: 92px; flex-shrink: 0; text-align: center; cursor: pointer; }
.friend .fh { width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #353943, #1c1e23); position: relative; transition: transform .2s var(--ease); }
.friend:hover .fh { transform: translateY(-3px); }
.friend .fh img { width: 100%; height: 100%; border-radius: 50%; }
.friend .st { position: absolute; right: 3px; bottom: 3px; width: 20px; height: 20px; border-radius: 50%; border: 4px solid var(--bg); background: var(--green); }
.friend .st.game { background: var(--blue); }
.friend .fn { font-size: 13px; font-weight: 600; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend .fs { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.friend.add .fh { display: grid; place-items: center; background: #20232a; border: 2px dashed #3b3f49; }
.friend.add svg { width: 30px; height: 30px; color: var(--muted); }

/* tiles */
.row { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 12px; scroll-behavior: smooth; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 22px 16px; }
.tile { width: 180px; flex-shrink: 0; cursor: pointer; }
.grid .tile { width: auto; }
.tile .th { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #24272e; box-shadow: 0 2px 10px rgba(0,0,0,.3); transition: transform .25s var(--ease), box-shadow .25s; }
.tile .th img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tile:hover .th { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.tile:hover .th img { transform: scale(1.06); }
.tile .tag { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 800; letter-spacing: .5px; padding: 4px 7px; border-radius: 6px; background: var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tile .tag.new { background: var(--blue); }
.tile .tn { font-weight: 700; font-size: 14px; margin-top: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tm { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 500; }
.tile .tm span { display: flex; align-items: center; gap: 4px; }
.tile .tm svg { width: 13px; height: 13px; }
.wide-row .tile { width: 330px; }
.wide-row .tile .th { aspect-ratio: 16/9; }
.skel { background: linear-gradient(90deg, #22252c 0%, #2c3038 50%, #22252c 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ================= GAME PAGE ================= */
.gp { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 32px; }
@media (max-width: 1050px) { .gp { grid-template-columns: 1fr; } }
.carousel { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16/9; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.carousel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.carousel img.on { opacity: 1; }
.carousel .dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; }
.carousel .dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.4); cursor: pointer; transition: width .3s, background .3s; }
.carousel .dots i.on { width: 26px; background: #fff; }
.carousel .cnav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.45); display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.carousel:hover .cnav { opacity: 1; }
.carousel .cnav.l { left: 12px; } .carousel .cnav.r { right: 12px; }
.carousel .cnav svg { width: 18px; height: 18px; }
.ginfo { display: flex; flex-direction: column; }
.ginfo h1 { font-size: 32px; line-height: 1.15; }
.creator { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 15px; }
.creator b { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.verified { width: 16px; height: 16px; border-radius: 50%; background: var(--blue); display: inline-grid; place-items: center; }
.verified svg { width: 10px; height: 10px; stroke-width: 4; }
.chips { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; background: #262930; color: #c9cdd4; }
.playbtn { margin-top: auto; height: 64px; border-radius: 12px; background: var(--green); display: grid; place-items: center; box-shadow: 0 6px 0 #1d7d48, 0 10px 30px rgba(47,179,107,.25);
  transition: transform .1s, box-shadow .1s, background .15s; margin-top: 26px; }
.playbtn:hover { background: var(--green2); }
.playbtn:active { transform: translateY(4px); box-shadow: 0 2px 0 #1d7d48; }
.playbtn svg { width: 34px; height: 34px; fill: #fff; stroke: none; }
.playbtn.disabled { background: #3a3d45; box-shadow: 0 6px 0 #2a2c32; }
.gacts { display: flex; justify-content: space-between; margin-top: 18px; }
.gact { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px; border-radius: 8px; }
.gact:hover { background: #22252c; color: #fff; }
.gact svg { width: 22px; height: 22px; }
.gact.on { color: var(--gold); } .gact.on svg { fill: var(--gold); }
.votes { margin-top: 10px; }
.votes .vbar { height: 4px; border-radius: 2px; background: #4a4e57; overflow: hidden; }
.votes .vbar i { display: block; height: 100%; background: #c9ccd2; }
.votes .vn { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 36px; }
.tabs button { padding: 14px 22px; font-weight: 700; font-size: 15px; color: var(--muted); position: relative; }
.tabs button:hover { color: #fff; }
.tabs button.on { color: #fff; }
.tabs button.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; background: #fff; border-radius: 3px 3px 0 0; }
.tabbody { padding-top: 24px; animation: pagein .3s var(--ease); }
.desc { line-height: 1.7; color: #d2d5db; max-width: 900px; font-size: 15px; }
.desc h3 { color: #fff; margin: 18px 0 6px; font-size: 16px; }
.keys { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
.keys span { display: flex; gap: 6px; align-items: center; font-size: 14px; }
kbd { display: inline-block; font-family: Rajdhani, monospace; font-weight: 700; font-size: 12px; letter-spacing: .5px; padding: 2px 7px; border-radius: 5px; background: #2e313a; border-bottom: 2px solid #1a1c21; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 16px 10px; text-align: center; }
.stats span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.stats b { display: block; font-size: 17px; margin-top: 4px; }
.passes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pass { background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.pass .pimg { aspect-ratio: 1; background: radial-gradient(circle at 50% 40%, #3a1219, #120609); display: grid; place-items: center; }
.pass .pimg img { width: 80%; }
.pass .pb { padding: 12px; }
.pass .pn { font-weight: 700; font-size: 14px; }
.pass .pd { font-size: 12px; color: var(--muted); margin: 4px 0 10px; min-height: 32px; }
.pass button { width: 100%; height: 36px; border-radius: 8px; background: #33363f; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.pass button:hover { background: #3d414b; }
.pass button.owned { background: transparent; border: 1px solid var(--green); color: var(--green); }
.pass button.equip { background: var(--green); }
.servers { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.server { display: flex; align-items: center; gap: 16px; background: var(--card); padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.server .heads { display: flex; }
.server .heads img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--card); margin-left: -8px; background: #33363f; }
.server .heads img:first-child { margin-left: 0; }
.server .sc { font-size: 13px; color: var(--muted); }
.server .sc b { color: #fff; }
.server .sbar { width: 120px; height: 6px; background: #33363f; border-radius: 3px; overflow: hidden; }
.server .sbar i { display: block; height: 100%; background: var(--green); }
.server button { margin-left: auto; padding: 9px 22px; border-radius: 8px; background: #33363f; font-weight: 700; }
.server button:hover { background: var(--green); }

/* avatar editor */
.av-wrap { display: grid; grid-template-columns: 420px 1fr; gap: 32px; margin-top: 22px; }
@media (max-width: 1000px) { .av-wrap { grid-template-columns: 1fr; } }
.av-stage { height: 520px; border-radius: 16px; background: radial-gradient(ellipse at 50% 30%, #3a3e48 0%, #1d1f25 55%, #121317 100%); position: relative; overflow: hidden; cursor: grab; box-shadow: inset 0 0 0 1px var(--line); }
.av-stage:active { cursor: grabbing; }
.av-stage canvas { width: 100% !important; height: 100% !important; }
.av-stage .hint { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); pointer-events: none; }
.av-stage .poses { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; }
.av-stage .poses button { padding: 6px 12px; border-radius: 8px; background: rgba(0,0,0,.4); font-size: 12px; font-weight: 700; }
.av-stage .poses button.on, .av-stage .poses button:hover { background: rgba(255,255,255,.18); }
.av-panel h3 { margin: 22px 0 10px; font-size: 15px; color: #d6d9de; }
.av-panel h3:first-child { margin-top: 0; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, 40px); gap: 8px; }
.sw { width: 40px; height: 40px; border-radius: 10px; cursor: pointer; box-shadow: inset 0 -3px 0 rgba(0,0,0,.2); transition: transform .15s; position: relative; }
.sw:hover { transform: scale(1.08); }
.sw.on::after { content: ""; position: absolute; inset: -4px; border: 2px solid #fff; border-radius: 13px; }
.av-name { background: #0d0e11; border: 1px solid var(--line2); color: var(--text); padding: 11px 14px; border-radius: 10px; font-size: 15px; width: 280px; outline: none; }
.av-name:focus { border-color: #6c7380; }
.outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.outfit { background: var(--card); border-radius: 12px; padding: 6px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.outfit:hover { border-color: #555a66; }
.outfit img { width: 100%; aspect-ratio: 1; border-radius: 8px; background: #1b1d22; }

.empty { padding: 60px 0; text-align: center; color: var(--muted); }
.empty svg { width: 54px; height: 54px; margin-bottom: 10px; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #2c2f37; padding: 13px 22px; border-radius: 12px; font-weight: 600; z-index: 100; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: toastin .3s var(--ease); display: flex; align-items: center; gap: 10px; border: 1px solid var(--line2); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ================= JOIN SCREEN ================= */
#loading { position: fixed; inset: 0; z-index: 30; background: #0b0b0d; display: flex; align-items: center; justify-content: center; animation: fadein .3s; }
#loading.out { opacity: 0; transition: opacity .5s; }
.lcenter { display: flex; flex-direction: column; align-items: center; }
.licon { width: 150px; height: 150px; border-radius: 22px; box-shadow: 0 10px 50px rgba(255, 45, 75, .25); }
.lname { font-size: 30px; font-weight: 800; margin-top: 22px; }
.lby { color: var(--muted); margin-top: 6px; }
.lby b { color: #fff; }
.lspin { width: 54px; height: 54px; margin-top: 40px; display: grid; place-items: center; }
.lspin i { width: 30px; height: 30px; border-radius: 6px; border: 5px solid #fff; animation: lsp 1.3s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes lsp { 0% { transform: rotate(0); } 50% { transform: rotate(180deg) scale(.75); } 100% { transform: rotate(360deg); } }
.lstat { margin-top: 18px; color: #c9ccd2; font-size: 14px; font-weight: 500; min-height: 20px; }
.ltip { position: absolute; bottom: 34px; left: 40px; max-width: 520px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ltip b { color: #fff; display: block; font-size: 12px; letter-spacing: 1px; margin-bottom: 2px; }
.lcancel { position: absolute; bottom: 30px; right: 40px; padding: 10px 30px; border: 1px solid #4a4e57; border-radius: 10px; font-weight: 600; }
.lcancel:hover { background: #1f2126; }

/* ================= GAME HUD ================= */
#game { position: fixed; inset: 0; z-index: 20; background: #000; cursor: default; }
#game canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#hud { position: absolute; inset: 0; pointer-events: none; font-family: Rajdhani, sans-serif; font-weight: 700; color: #fff; user-select: none; }
#hud .shadow, #hud { text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.35) 100%); }

.h-tl { position: absolute; top: 14px; left: 14px; display: flex; gap: 8px; }
.h-tl > div { width: 42px; height: 42px; border-radius: 10px; background: rgba(15,15,18,.7); display: grid; place-items: center; }
.h-tl svg { width: 20px; height: 20px; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 7px; }
#crosshair i { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.45); transition: transform .06s; }
#crosshair .t, #crosshair .b { width: 2px; height: 8px; left: -1px; }
#crosshair .l, #crosshair .r { height: 2px; width: 8px; top: -1px; }
#crosshair .t { top: calc(-8px - var(--gap)); } #crosshair .b { top: var(--gap); }
#crosshair .l { left: calc(-8px - var(--gap)); } #crosshair .r { left: var(--gap); }
#crosshair .dot { width: 3px; height: 3px; left: -1.5px; top: -1.5px; border-radius: 50%; }
#crosshair.grap i { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
#crosshair.sword .t, #crosshair.sword .b, #crosshair.sword .l, #crosshair.sword .r { opacity: .35; }
#hitmark { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#hitmark i { position: absolute; width: 2px; height: 9px; background: #fff; left: -1px; top: -4.5px; box-shadow: 0 0 2px #000; }
#hitmark i:nth-child(1) { transform: rotate(45deg) translateY(-13px); } #hitmark i:nth-child(2) { transform: rotate(135deg) translateY(-13px); }
#hitmark i:nth-child(3) { transform: rotate(225deg) translateY(-13px); } #hitmark i:nth-child(4) { transform: rotate(315deg) translateY(-13px); }
#hitmark.head i { background: var(--red); height: 12px; }
#hitmark.kill i { background: var(--red); height: 14px; width: 3px; }
#dmgdirs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dd { position: absolute; width: 140px; height: 140px; left: -70px; top: -70px; }
.dd::before { content: ""; position: absolute; left: 50%; top: -8px; width: 70px; height: 70px; margin-left: -35px; border-radius: 50%; border-top: 5px solid var(--red); filter: drop-shadow(0 0 6px var(--red)); }

.h-top { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); text-align: center; }
.h-wave { display: flex; align-items: center; gap: 12px; font-size: 22px; letter-spacing: 6px; }
.h-wave .slash { width: 40px; height: 3px; background: linear-gradient(90deg, transparent, var(--red)); }
.h-wave .slash:last-child { transform: scaleX(-1); }
.h-enemies { font-size: 14px; letter-spacing: 2px; color: #ffb3bd; margin-top: 2px; font-weight: 600; }

.h-plist { position: absolute; top: 14px; right: 14px; width: 230px; background: rgba(15,15,18,.7); border-radius: 10px; overflow: hidden; font-family: Inter, sans-serif; text-shadow: none; }
.pl-head { display: flex; justify-content: space-between; font-size: 11px; color: #aab; padding: 7px 12px; background: rgba(255,255,255,.05); font-weight: 600; }
.pl-row { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; }
.pl-row img { width: 22px; height: 22px; border-radius: 50%; background: #333; }
.pl-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row b { font-weight: 700; }

#feed { position: absolute; top: 92px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
#feed div { font-size: 15px; padding: 5px 12px; background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.55) 18%); display: flex; gap: 8px; align-items: center; animation: feedin .25s var(--ease); letter-spacing: .5px; }
#feed div em { font-style: normal; color: var(--red2); }
#feed div .tg { font-size: 11px; padding: 1px 6px; border-radius: 3px; background: var(--red); letter-spacing: 1px; }
#feed div .tg.cy { background: #138aa3; }
#feed div.out { opacity: 0; transform: translateX(20px); transition: all .3s; }
@keyframes feedin { from { opacity: 0; transform: translateX(30px); } }

#combo { position: absolute; right: 23%; top: 46%; text-align: center; opacity: 0; transition: opacity .2s; }
#combo b { display: block; font-size: 46px; font-style: italic; line-height: 1; color: #fff; text-shadow: 0 0 18px rgba(255,45,75,.8); }
#combo span { font-size: 13px; letter-spacing: 5px; color: var(--red2); }
#combo i { display: block; height: 3px; background: var(--red); margin-top: 4px; transform-origin: left; }
#combo.bump b { animation: bump .25s var(--ease); }
@keyframes bump { 0% { transform: scale(1.5); } }

#banner { position: absolute; top: 27%; left: 0; right: 0; text-align: center; opacity: 0; transition: opacity .35s; }
#banner.on { opacity: 1; }
#banner .b-main { font-family: "Russo One", sans-serif; font-size: 68px; letter-spacing: 6px; font-style: italic; text-shadow: 0 0 30px rgba(255,45,75,.7), 0 4px 0 rgba(0,0,0,.4); }
#banner.on .b-main { animation: bannerin .5s var(--ease); }
@keyframes bannerin { from { letter-spacing: 30px; opacity: 0; filter: blur(6px); } }
#banner .b-sub { font-size: 17px; letter-spacing: 8px; color: #ffb3bd; margin-top: 4px; }
#pop { position: absolute; top: 57%; left: 0; right: 0; text-align: center; font-size: 26px; font-style: italic; letter-spacing: 3px; opacity: 0; }
#pop.on { animation: popin .9s var(--ease) forwards; }
@keyframes popin { 0% { opacity: 1; transform: scale(1.5); } 15% { transform: scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

.h-bl { position: absolute; left: 30px; bottom: 26px; }
.hp-row { display: flex; align-items: flex-end; gap: 12px; }
.hp-num { font-size: 52px; line-height: .85; font-style: italic; min-width: 96px; }
.hp-num small { font-size: 16px; letter-spacing: 2px; margin-left: 4px; color: #ffb3bd; font-style: normal; }
.hp-bars { display: flex; gap: 3px; padding-bottom: 4px; }
.hp-bars i { width: 16px; height: 22px; transform: skewX(-18deg); background: rgba(255,255,255,.14); transition: background .2s; }
.hp-bars i.on { background: linear-gradient(180deg, #fff, #ffd0d6); box-shadow: 0 0 8px rgba(255,255,255,.3); }
.hp-bars.low i.on { background: var(--red); box-shadow: 0 0 10px var(--red); animation: lowhp .6s infinite alternate; }
@keyframes lowhp { to { opacity: .5; } }
.abil { display: flex; gap: 12px; margin-top: 14px; }
.ab { width: 48px; height: 48px; position: relative; display: grid; place-items: center; }
.ab svg { position: absolute; inset: 0; transform: rotate(-90deg); stroke-width: 3; }
.ab .trk { stroke: rgba(255,255,255,.15); fill: rgba(10,10,14,.5); }
.ab .fil { stroke: #fff; stroke-dasharray: 106.8; stroke-dashoffset: 0; transition: stroke .15s; }
.ab.cy .fil { stroke: var(--cyan); }
.ab.cd .fil { stroke: rgba(255,255,255,.5); }
.ab.ready { animation: abready .3s var(--ease); }
@keyframes abready { 50% { transform: scale(1.2); } }
.ab .ico { font-size: 20px; position: relative; line-height: 1; }
.ab kbd { position: absolute; bottom: -9px; font-size: 9px; padding: 0 4px; }

.h-speed { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); width: 230px; text-align: center; }
.gauge { width: 230px; display: block; }
.gauge path { stroke-width: 9; fill: none; stroke-linecap: butt; }
.g-trk { stroke: rgba(255,255,255,.12); }
.g-red { stroke: rgba(255,45,75,.35); }
.g-fil { stroke: #fff; stroke-dasharray: 251.3; stroke-dashoffset: 251.3; filter: drop-shadow(0 0 4px rgba(255,255,255,.5)); }
.h-speed.red .g-fil { stroke: var(--red); filter: drop-shadow(0 0 8px var(--red)); }
.g-num { position: absolute; left: 0; right: 0; bottom: 22px; font-size: 44px; font-style: italic; line-height: 1; }
.g-num small { display: block; font-size: 12px; letter-spacing: 4px; color: #bbb; font-style: normal; }
.g-rl { font-size: 13px; letter-spacing: 8px; color: var(--red); opacity: 0; text-shadow: 0 0 10px var(--red); margin-top: -4px; }
.h-speed.red .g-rl { opacity: 1; animation: lowhp .25s infinite alternate; }

.h-br { position: absolute; right: 30px; bottom: 26px; text-align: right; }
.w-name { font-size: 14px; letter-spacing: 3px; color: #ccc; }
.w-ammo { font-size: 60px; line-height: .9; font-style: italic; }
.w-ammo small { font-size: 22px; color: #999; margin-left: 4px; }
.w-ammo.low span { color: var(--red); }
.w-pips { display: flex; gap: 3px; justify-content: flex-end; margin: 6px 0 10px; height: 12px; }
.w-pips i { width: 5px; height: 12px; background: #fff; transform: skewX(-18deg); }
.w-pips i.off { background: rgba(255,255,255,.15); }
.w-slots { display: flex; gap: 6px; justify-content: flex-end; }
.w-slot { font-size: 13px; letter-spacing: 2px; padding: 5px 12px 5px 8px; background: rgba(10,10,14,.5); border: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 8px; opacity: .55; transition: all .2s; }
.w-slot.on { opacity: 1; border-color: var(--red); background: linear-gradient(90deg, rgba(255,45,75,.35), rgba(255,45,75,.1)); }
.w-slot kbd { font-size: 10px; }

/* overlays */
.g-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(10,4,8,.72), rgba(5,2,4,.92)); animation: fadein .25s; }
.g-card { width: min(440px, 92vw); background: rgba(22,23,28,.92); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 28px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.g-card.wide { width: min(760px, 94vw); }
.gc-title { font-family: "Russo One", sans-serif; font-size: 58px; font-style: italic; letter-spacing: 3px; text-align: center; line-height: 1;
  background: linear-gradient(180deg, #fff 30%, #ff8091); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 20px rgba(255,45,75,.5)); }
.gc-sub { text-align: center; font-family: Rajdhani, sans-serif; font-weight: 700; letter-spacing: 6px; color: var(--red2); margin-top: 6px; }
.gc-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; margin: 26px 0 22px; }
@media (max-width: 700px) { .gc-cols { grid-template-columns: 1fr; } }
.gc-keys { display: flex; flex-direction: column; gap: 9px; font-size: 14px; }
.gc-keys div { display: flex; align-items: center; gap: 6px; }
.gc-keys span { color: #c9ccd2; margin-left: 6px; }
.gc-tips { display: flex; flex-direction: column; gap: 10px; }
.tip { background: rgba(255,255,255,.04); border-left: 3px solid var(--red); padding: 9px 12px; font-size: 13px; color: #c9ccd2; border-radius: 0 8px 8px 0; }
.tip b { display: block; font-family: Rajdhani, sans-serif; letter-spacing: 2px; color: #fff; font-size: 13px; }
.gbtn { display: block; width: 100%; height: 50px; border-radius: 12px; font-weight: 700; font-size: 16px; background: #2e313a; margin-top: 10px; transition: background .15s, transform .1s; }
.gbtn:hover { background: #3a3e48; }
.gbtn:active { transform: scale(.98); }
.gbtn.primary { background: #fff; color: #111; font-family: Rajdhani, sans-serif; font-size: 20px; letter-spacing: 3px; }
.gbtn.primary:hover { background: #ffe1e5; }
.gbtn.danger { background: #b3203a; } .gbtn.danger:hover { background: #d12a47; }
.gbtn.ghost { background: transparent; color: var(--muted); } .gbtn.ghost:hover { color: #fff; background: rgba(255,255,255,.05); }
.pm-tabs { display: flex; gap: 10px; margin-bottom: 18px; } .pm-tabs span { font-weight: 800; font-size: 20px; }
.pm-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 14px; }
.pm-row span { width: 110px; color: #c9ccd2; }
.pm-row input[type=range] { flex: 1; accent-color: #fff; }
.pm-row b { width: 38px; text-align: right; font-size: 13px; }
.seg { display: flex; background: #0e0f12; border-radius: 9px; padding: 3px; margin-left: auto; }
.seg button { padding: 6px 16px; border-radius: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
.seg button.on { background: #fff; color: #111; }
.pm-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-title { font-family: "Russo One", sans-serif; font-size: 48px; font-style: italic; text-align: center; color: var(--red); text-shadow: 0 0 30px rgba(255,45,75,.6); letter-spacing: 3px; }
.rs-sub { text-align: center; font-family: Rajdhani, sans-serif; letter-spacing: 4px; color: var(--muted); font-weight: 700; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 16px; }
.rs-grid div { background: rgba(255,255,255,.04); border-radius: 12px; padding: 14px; }
.rs-grid b { display: block; font-family: Rajdhani, sans-serif; font-size: 34px; line-height: 1; }
.rs-grid span { font-size: 12px; color: var(--muted); font-weight: 600; }
.rs-earn { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: #d2d5db; margin-bottom: 8px; }
.rs-earn b { color: #fff; }
.rs-earn em { color: var(--gold); font-style: normal; font-weight: 700; }

/* ================= BLOX ENGINE (third-person games) ================= */
#blox { position: fixed; inset: 0; z-index: 20; background: #000; --accent: #ffcc4d; }
#blox canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bx-hud { position: absolute; inset: 0; pointer-events: none; font-family: Inter, sans-serif; color: #fff; user-select: none; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
.bx-top { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; }
.bx-chip { background: rgba(12,12,16,.72); border-radius: 12px; padding: 8px 16px; font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; text-shadow: none; border: 1px solid rgba(255,255,255,.08); }
.bx-chip small { font-size: 11px; font-weight: 700; color: #b8bdc7; letter-spacing: 1px; text-transform: uppercase; }
.bx-chip.accent { background: var(--accent); color: #111; }
.bx-chip.accent small { color: rgba(0,0,0,.6); }
.bx-board { top: 70px !important; }
.bx-board .pl-row.me { background: rgba(255,255,255,.08); }
.bx-custom { position: absolute; inset: 0; }
.bx-prompt { position: absolute; left: 50%; bottom: 24%; transform: translate(-50%, 10px); background: rgba(12,12,16,.8); border-radius: 12px; padding: 10px 18px; font-weight: 700; font-size: 15px; opacity: 0; transition: all .15s; text-shadow: none; display: flex; gap: 10px; align-items: center; border: 1px solid rgba(255,255,255,.1); }
.bx-prompt.on { opacity: 1; transform: translate(-50%, 0); }
.bx-prompt kbd { font-size: 14px; padding: 3px 9px; background: #fff; color: #111; border: 0; }
.bx-banner { position: absolute; top: 24%; left: 0; right: 0; text-align: center; opacity: 0; transition: opacity .3s; }
.bx-banner.on { opacity: 1; }
.bx-banner .b-main { font-family: "Russo One", sans-serif; font-size: 62px; color: #fff; -webkit-text-stroke: 3px rgba(0,0,0,.6); paint-order: stroke fill; text-shadow: 0 6px 0 rgba(0,0,0,.25), 0 0 30px var(--bc, #ffcc4d); }
.bx-banner.on .b-main { animation: bxpop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes bxpop { from { transform: scale(.4); opacity: 0; } }
.bx-banner .b-sub { font-weight: 800; font-size: 18px; margin-top: 4px; letter-spacing: 1px; }
.bx-toasts { position: absolute; left: 18px; top: 72px; display: flex; flex-direction: column; gap: 6px; }
.bx-toast { background: rgba(12,12,16,.8); border-left: 4px solid var(--accent); padding: 8px 14px; border-radius: 0 10px 10px 0; font-weight: 700; font-size: 14px; animation: feedin .25s; text-shadow: none; }
.bx-toast.out { opacity: 0; transform: translateX(-20px); transition: all .3s; }
.bx-fade { position: absolute; inset: 0; pointer-events: none; }
.bx-title { background: linear-gradient(180deg, #fff 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 18px rgba(0,0,0,.4)); }
#blox .gc-sub { color: var(--accent); }
#blox .tip { border-left-color: var(--accent); }
.bx-rtitle { color: var(--accent); text-shadow: 0 0 30px rgba(0,0,0,.5); }
.bx-bar { width: 260px; height: 14px; border-radius: 8px; background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid rgba(255,255,255,.15); }
.bx-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.bx-panel { position: absolute; background: rgba(12,12,16,.78); border-radius: 14px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.08); text-shadow: none; }
.bx-cross { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.4); display: none; }
.bx-cross.on { display: block; }

/* ---------- multiplayer ---------- */
.bx-chat { position: absolute; left: 18px; top: 72px; width: 360px; pointer-events: none; font-family: Inter, sans-serif; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
#bxChatLog { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
#bxChatLog div { background: rgba(0,0,0,.35); padding: 4px 10px; border-radius: 8px; transition: opacity 1s; width: fit-content; max-width: 360px; }
#bxChatLog div.old { opacity: 0; }
#bxChatLog i { color: #a5b4fc; }
#bxChatIn { display: none; margin-top: 6px; width: 100%; background: rgba(10,10,14,.85); border: 1px solid rgba(255,255,255,.25); color: #fff; border-radius: 10px; padding: 9px 12px; font: 600 14px Inter, sans-serif; outline: none; pointer-events: auto; }
.bx-chat.typing #bxChatIn { display: block; }
.bx-chat.typing #bxChatLog div.old { opacity: 1; }
.bx-toasts { top: 300px !important; }
.bx-net { position: absolute; top: 18px; left: 112px; background: rgba(12,12,16,.72); border-radius: 10px; padding: 8px 12px; font: 700 13px Inter, sans-serif; display: none; align-items: center; gap: 8px; text-shadow: none; }
.bx-net.on { display: flex; }
.bx-net .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.pl-row.live span { color: #7dd3fc; }

/* ================= TOUCH CONTROLS ================= */
.tc-layer { position: absolute; inset: 0; z-index: 4; pointer-events: none; user-select: none; -webkit-user-select: none; touch-action: none; }
.tc-layer * { -webkit-tap-highlight-color: transparent; }
.tc-look { position: absolute; top: 0; right: 0; bottom: 0; left: 40%; pointer-events: auto; touch-action: none; }
.tc-stick { position: absolute; left: max(24px, env(safe-area-inset-left)); bottom: 28px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.08), rgba(255,255,255,.16)); border: 2px solid rgba(255,255,255,.28); pointer-events: auto; touch-action: none; z-index: 2; }
.tc-knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(0,0,0,.4); transition: transform .05s; }
.tc-buttons { position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: 22px; display: grid; grid-template-columns: repeat(3, 66px); gap: 10px; direction: rtl; pointer-events: none; z-index: 2; }
.tc-btn { direction: ltr; pointer-events: auto; touch-action: none; width: 66px; height: 66px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); background: rgba(12,12,16,.55); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-family: Inter, sans-serif; transition: transform .06s, background .06s; }
.tc-btn span { font-size: 24px; line-height: 1; }
.tc-btn small { font-size: 9px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; opacity: .85; }
.tc-btn.big { grid-column: span 2; grid-row: span 2; width: 142px; height: 142px; justify-self: end; }
.tc-btn.big span { font-size: 44px; }
.tc-btn.big small { font-size: 12px; }
.tc-btn.accent { background: rgba(255,45,75,.55); border-color: rgba(255,255,255,.6); }
#blox .tc-btn.accent { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.tc-btn.on { transform: scale(.9); background: rgba(255,255,255,.35); }
.tc-mini { position: absolute; top: max(12px, env(safe-area-inset-top)); width: 46px; height: 46px; border-radius: 12px; border: 0; background: rgba(12,12,16,.7); color: #fff; font-size: 22px; pointer-events: auto; touch-action: none; z-index: 3; }
.tc-pause { left: max(12px, env(safe-area-inset-left)); }
.tc-chat { left: calc(max(12px, env(safe-area-inset-left)) + 54px); }
.tc-rotate { display: none; position: absolute; inset: 0; background: #0b0b0d; color: #fff; font: 800 22px Inter, sans-serif; align-items: center; justify-content: center; text-align: center; padding: 30px; pointer-events: auto; z-index: 10; }
@media (orientation: portrait) and (pointer: coarse) { .tc-rotate { display: flex; } }
[data-tkey] { pointer-events: auto; cursor: pointer; }

/* in-game HUD on touch devices: move things clear of the thumbs */
body.touch-play .h-tl, body.touch-play .bx-hud .h-tl { display: none; }
body.touch-play .h-bl { left: 190px; bottom: 16px; transform: scale(.8); transform-origin: left bottom; }
body.touch-play .h-br { bottom: auto; top: 130px; right: 14px; transform: scale(.7); transform-origin: right top; }
body.touch-play .h-speed { bottom: 6px; transform: translateX(-50%) scale(.7); transform-origin: center bottom; }
body.touch-play .h-plist { transform: scale(.8); transform-origin: right top; }
body.touch-play .bx-net { left: 128px; }
body.touch-play .bx-panel[style*="bottom:18px"], body.touch-play .bx-panel[style*="bottom:22px"] { bottom: auto !important; top: 150px; transform: scale(.82); transform-origin: left top; }
body.touch-play .bx-panel[style*="right:18px;bottom"], body.touch-play .bx-panel[style*="right:22px;bottom"] { transform-origin: right top; }
body.touch-play #kMap { left: auto !important; right: 14px; bottom: auto !important; top: 70px; width: 130px !important; height: 130px !important; }
body.touch-play .bx-prompt { bottom: 46%; }
body.touch-play .bx-chat { top: 66px; width: 300px; }
body.touch-play .gc-keys { display: none; }
body.touch-play .gc-cols { grid-template-columns: 1fr; margin: 14px 0; }

/* ================= MOBILE MENU ================= */
@media (max-width: 820px) {
  .topbar { height: 54px; gap: 6px; padding: 0 8px; }
  .nav, .topright .iconbtn:not(.burger) { display: none; }
  .logotype { font-size: 16px; }
  .search { height: 36px; margin: 0; }
  .buxbtn { padding: 0 6px; font-size: 14px; }
  .sidebar { position: fixed; top: 54px; bottom: 0; left: 0; z-index: 10; width: 240px; box-shadow: 8px 0 30px rgba(0,0,0,.5); transform: translateX(-100%); transition: transform .25s var(--ease); }
  .sidebar.open { transform: none; }
  .sidebar.collapsed { width: 240px; padding: 12px 10px; }
  .page { padding: 18px 16px 60px; }
  h1 { font-size: 24px; }
  .hello .av { width: 72px; height: 72px; }
  .tile { width: 140px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }
  .friend { width: 72px; } .friend .fh { width: 72px; height: 72px; }
  .sec { margin-top: 24px; }
  .sec-h .arrows { display: none; }
  .gp { gap: 18px; }
  .ginfo h1 { font-size: 24px; }
  .playbtn { height: 58px; margin-top: 16px; }
  .tabs button { padding: 12px 14px; }
  .av-stage { height: 380px; }
  .av-name { width: 100%; }
  .server { flex-wrap: wrap; }
  .ltip { left: 16px; right: 16px; bottom: 80px; }
  .lcancel { right: 16px; bottom: 20px; }
  .licon { width: 120px; height: 120px; }
  .g-card { padding: 20px; }
  .gc-title { font-size: 40px; }
}
@media (max-height: 500px) {
  .g-card { padding: 16px 18px; max-height: 94vh; overflow-y: auto; }
  .gc-title { font-size: 34px; }
  .gc-cols { margin: 10px 0; gap: 10px; }
  .tip { padding: 6px 10px; }
  .rs-grid { margin: 10px 0; }
  .rs-grid b { font-size: 24px; }
  .gbtn { height: 42px; margin-top: 6px; }
}
/* touch layout fixes for short landscape phones */
body.touch-play .bx-net { top: 64px; left: 12px; padding: 5px 10px; font-size: 11px; }
body.touch-play .bx-chat { top: 96px; }
body.touch-play .bx-top { top: 12px; transform: translateX(-50%) scale(.85); transform-origin: center top; }
body.touch-play .bx-panel[style*="right:18px;bottom"], body.touch-play .bx-panel[style*="right:22px;bottom"] { top: 12px !important; right: 66px !important; bottom: auto !important; left: auto !important; transform: scale(.72); transform-origin: right top; }
body.touch-play .bx-panel[style*="left:18px;bottom"], body.touch-play .bx-panel[style*="left:22px;bottom"] { top: 120px !important; bottom: auto !important; }
@media (max-height: 520px) {
  body.touch-play .bx-board, body.touch-play #hud .h-plist { display: none; }
  body.touch-play .tc-stick { width: 130px; height: 130px; bottom: 18px; }
  body.touch-play .tc-buttons { grid-template-columns: repeat(3, 58px); gap: 8px; bottom: 14px; }
  body.touch-play .tc-btn { width: 58px; height: 58px; }
  body.touch-play .tc-btn.big { width: 124px; height: 124px; }
}
body.touch-play #zRound { top: 10px !important; left: 118px !important; font-size: 38px !important; }
body.touch-play .h-br { top: 10px; bottom: auto; right: 14px; transform: scale(.62); transform-origin: right top; }
body.touch-play .h-top { top: 6px; transform: translateX(-50%) scale(.8); transform-origin: center top; }
.tc-mode { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); z-index: 6; background: rgba(12,12,16,.85); color: #fff; padding: 10px 18px; border-radius: 12px; font: 700 15px Inter, sans-serif; pointer-events: none; transition: opacity .4s; border: 1px solid rgba(255,255,255,.15); }
.tc-mode.out { opacity: 0; }

/* ---------- dynamic thumbstick + bigger buttons ---------- */
.tc-move { position: absolute; left: 0; top: 64px; bottom: 0; width: 50%; pointer-events: auto; touch-action: none; }
.tc-look { left: 50%; }
.tc-stick { width: 170px; height: 170px; opacity: .35; transition: opacity .2s; }
.tc-stick.active { opacity: 1; transition: none; }
.tc-knob { width: 76px; height: 76px; margin: -38px; }
.tc-buttons { grid-template-columns: repeat(3, 84px); gap: 12px; }
.tc-btn { width: 84px; height: 84px; border-width: 3px; }
.tc-btn span { font-size: 30px; }
.tc-btn small { font-size: 10px; }
.tc-btn.big { width: 180px; height: 180px; }
.tc-btn.big span { font-size: 56px; }
.tc-btn.big small { font-size: 14px; }
.tc-mini { width: 54px; height: 54px; font-size: 26px; border-radius: 14px; }
.tc-chat { left: calc(max(12px, env(safe-area-inset-left)) + 62px); }
@media (max-height: 520px) {
  body.touch-play .tc-stick { width: 150px; height: 150px; bottom: 16px; }
  body.touch-play .tc-knob { width: 66px; height: 66px; margin: -33px; }
  body.touch-play .tc-buttons { grid-template-columns: repeat(3, 72px); gap: 9px; bottom: 12px; }
  body.touch-play .tc-btn { width: 72px; height: 72px; }
  body.touch-play .tc-btn span { font-size: 26px; }
  body.touch-play .tc-btn.big { width: 153px; height: 153px; }
  body.touch-play .tc-btn.big span { font-size: 48px; }
}
.bx-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bx-roles:empty { display: none; }
.bx-roles.compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.bx-roles.compact .bx-role { padding: 10px 12px; }
.bx-roles.compact .bx-role .ri { font-size: 22px; }
.bx-roles.compact .bx-role b { font-size: 14px; }
.bx-roles.compact .bx-role small { font-size: 11px; }
.bx-role { text-align: left; padding: 16px; border-radius: 14px; background: color-mix(in srgb, var(--rc) 18%, #16171c); border: 2px solid color-mix(in srgb, var(--rc) 60%, transparent); color: #fff; display: flex; flex-direction: column; gap: 4px; transition: transform .1s, background .15s; }
.bx-role:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--rc) 30%, #16171c); }
.bx-role .ri { font-size: 34px; line-height: 1; }
.bx-role b { font: 900 20px "Russo One", sans-serif; letter-spacing: 1px; }
.bx-role small { color: #cbd5e1; font-size: 12.5px; line-height: 1.4; }
.bx-role em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--rc); margin-top: 4px; letter-spacing: .5px; }

/* REDSHIFT mode select + duel lobbies */
.mp-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.mp-btn { padding: 18px; border-radius: 14px; background: #fff; color: #111; text-align: left; display: flex; flex-direction: column; gap: 4px; transition: transform .1s, background .15s; }
.mp-btn b { font: 900 italic 24px Rajdhani, sans-serif; letter-spacing: 3px; } .mp-btn span { font-size: 13px; color: #555; font-weight: 600; }
.mp-btn:hover { transform: translateY(-2px); background: #ffe1e5; } .mp-btn.red { background: var(--red, #ff2d4b); color: #fff; } .mp-btn.red span { color: #ffe1e5; } .mp-btn.red:hover { background: #ff4d66; }
.lobby { margin-top: 16px; }
.lb-head { display: flex; justify-content: space-between; align-items: center; } .lb-head b { font: 800 18px Rajdhani, sans-serif; letter-spacing: 3px; }
.lb-back { color: #aab; font-weight: 700; } .lb-back:hover { color: #fff; }
.lb-actions { display: grid; grid-template-columns: 1fr 110px 110px; gap: 8px; align-items: center; } .lb-actions .gbtn { margin-top: 10px; }
.lb-actions input { margin-top: 10px; height: 50px; border-radius: 12px; background: #2e313a; border: 1px solid #444; color: #fff; text-align: center; font: 800 20px Rajdhani, sans-serif; letter-spacing: 6px; text-transform: uppercase; }
.lb-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow: auto; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: #2a2d35; text-align: left; color: #fff; }
.lb-row:hover { background: #343844; } .lb-row b { font: 900 20px Rajdhani, sans-serif; letter-spacing: 4px; color: #ff6b81; } .lb-row span { flex: 1; font-weight: 600; } .lb-row em { font-style: normal; font-weight: 800; font-size: 12px; color: #7dd3fc; }
.lb-empty { padding: 14px; text-align: center; color: #889; font-size: 13px; }
.lb-status { margin-top: 12px; text-align: center; color: #dde; font-weight: 600; line-height: 1.5; } .lb-status .code { font: 900 26px Rajdhani, sans-serif; letter-spacing: 6px; color: #ff6b81; } .lb-status small { color: #889; }
.w-slot.cd { opacity: .55; }

/* real friends */
.nbadge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ef4444; color: #fff; font: 800 12px Inter, sans-serif; display: inline-flex; align-items: center; justify-content: center; }
.fr-top { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; margin-bottom: 22px; }
@media (max-width: 760px) { .fr-top { grid-template-columns: 1fr; } }
.fr-card { background: var(--panel, #1e2027); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.fr-card .lbl { font: 800 12px Inter, sans-serif; letter-spacing: 2px; color: var(--muted, #9ca3af); }
.fr-card small { color: var(--muted, #9ca3af); font-size: 12px; }
.fr-code { font: 900 38px Rajdhani, sans-serif; letter-spacing: 8px; color: #fff; }
.fr-add { display: flex; gap: 8px; } .fr-add input { flex: 1; min-width: 0; height: 42px; border-radius: 10px; background: #2a2d35; border: 1px solid #3a3e48; color: #fff; padding: 0 12px; font: 800 18px Rajdhani, sans-serif; letter-spacing: 5px; text-transform: uppercase; }
.fr-b { height: 36px; padding: 0 14px; border-radius: 10px; background: #2e313a; color: #fff; font-weight: 700; white-space: nowrap; } .fr-b:hover { background: #3a3e48; }
.fr-b.ok { background: #2563eb; } .fr-b.ok:hover { background: #3b82f6; } .fr-add .fr-b { height: 42px; }
#frIn h2, #frList h2, #frOut h2 { font-size: 18px; margin: 18px 0 10px; }
.fr-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.03); margin-bottom: 6px; }
.fr-row .fh { width: 48px; height: 48px; border-radius: 50%; background: #2a2d35; position: relative; flex: none; overflow: visible; } .fr-row .fh img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.fr-row .fh .st { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; border: 3px solid #16171c; } .fr-row .fh .st.game { background: #3b82f6; }
.fr-n { flex: 1; min-width: 0; display: flex; flex-direction: column; } .fr-n b { font-size: 15px; } .fr-n span { font-size: 13px; color: var(--muted, #9ca3af); } .fr-n span.on { color: #22c55e; } .fr-n span.g { color: #60a5fa; }
.fr-note { color: var(--muted, #9ca3af); font-size: 13px; padding: 12px 6px; align-self: center; }

/* chat: click a name while typing to mute that player */
.bx-chat.typing #bxChatLog { pointer-events: auto; }
.bx-chat .bx-cn { cursor: pointer; }
.bx-chat.typing .bx-cn:hover { text-decoration: line-through; color: #fca5a5; }

/* ===== phones & the installed app: keep taps away from the status bar / notch, and HUD buttons above the touch layer ===== */
.topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
.sidebar { padding-left: max(10px, env(safe-area-inset-left)); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
@media (max-width: 700px) { .search { min-width: 0; flex: 1 1 60px; } .search input { min-width: 0; width: 100%; } .topright { flex-shrink: 0; } }
#blox .bx-hud { inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
body.touch-play #blox .bx-hud { z-index: 5; }
body.touch-play #blox .bx-hud button, body.touch-play #blox .bx-hud [data-i], body.touch-play #blox .bx-hud [data-u], body.touch-play #blox .bx-hud [data-go], body.touch-play #blox .bx-hud [data-tkey], body.touch-play #blox .bx-hud input, body.touch-play #blox .bx-hud a { pointer-events: auto; }
.tc-more { left: calc(max(12px, env(safe-area-inset-left)) + 108px); font-size: 26px !important; font-weight: 900; }
.tc-drawer { display: none; position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 56px); left: max(12px, env(safe-area-inset-left)); grid-template-columns: repeat(3, 76px); gap: 8px; padding: 10px; background: rgba(10,12,18,.92); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; pointer-events: auto; z-index: 8; }
.tc-drawer.open { display: grid; }
.tc-dbtn { width: 76px; height: 62px; border: 0; border-radius: 12px; background: #1e293b; color: #e2e8f0; font: 800 11px Inter, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; touch-action: none; }
.tc-dbtn span { font-size: 22px; }
/* start / pause / game-over cards scroll on short (phone landscape) screens instead of running off the bottom */
@media (max-height: 560px) {
  .g-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; place-items: start center; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); touch-action: pan-y; }
  .g-overlay .g-card { margin: 0 auto; max-height: none; }
}
/* centred in-game panels (shops, upgrade screens) never run off a phone screen: they scroll */
body.touch-play #blox .bx-hud [style*="translate(-50%,-50%)"], body.touch-play #blox .bx-hud [style*="translate(-50%, -50%)"], body.touch-play #cShop, body.touch-play #wMenu, body.touch-play #zMenu { max-height: calc(100% - 12px) !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
/* ===== play mode picker (Solo / Online / Private) + saved leaderboard on every game's start card ===== */
.bx-modes { margin: 4px 0 12px; }
.bm-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bm { display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; border-radius: 12px; border: 2px solid rgba(255,255,255,.12); background: #1c1d23; color: #cbd0d8; font: 800 14px Inter, sans-serif; cursor: pointer; }
.bm span { font-size: 18px; }
.bm.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 22%, #16171c); color: #fff; }
.bm-desc { margin-top: 7px; font-size: 12.5px; color: #a7adb8; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-height: 22px; }
.bm-code { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; }
.bm-code input { width: 84px; height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: #0d0e11; color: #fde047; font: 900 15px "Russo One", sans-serif; letter-spacing: 3px; text-align: center; text-transform: uppercase; }
.bx-lb { margin: 0 0 12px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 8px 12px; }
.bx-lb:empty { display: none; }
.lb-h { font: 900 13px Inter, sans-serif; letter-spacing: .06em; color: #fde047; margin-bottom: 4px; }
.lb-l { font-size: 13px; }
.lb-l div { display: flex; gap: 8px; padding: 2px 0; }
.lb-l div i { width: 20px; color: #8b93a1; font-style: normal; font-weight: 800; }
.lb-l div span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-l div b { font-variant-numeric: tabular-nums; }
.lb-l div.me { color: #fde047; }
.lb-l em { color: #8b93a1; font-style: normal; }
/* ===== accounts: login / sign-up window, top-bar account button ===== */
.au-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(5,6,9,.78); backdrop-filter: blur(6px); padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); overflow-y: auto; animation: fadein .2s; }
.au-card { width: min(400px, 100%); background: #16171c; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.6); color: #e7e9ee; font-family: Inter, sans-serif; }
.au-logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 14px; font: 900 20px Inter, sans-serif; letter-spacing: .06em; }
.au-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #0d0e11; padding: 4px; border-radius: 12px; margin-bottom: 14px; }
.au-tabs button { height: 36px; border: 0; border-radius: 9px; background: transparent; color: #9aa1ad; font: 800 14px Inter, sans-serif; cursor: pointer; }
.au-tabs button.on { background: #2b2e36; color: #fff; }
.au-card label { display: block; font-size: 12px; font-weight: 700; color: #b8bdc7; margin: 10px 0 4px; }
.au-card input { display: block; width: 100%; height: 44px; margin-top: 5px; padding: 0 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: #0d0e11; color: #fff; font: 600 16px Inter, sans-serif; }
.au-card input:focus { outline: none; border-color: #8b93a1; }
.au-pw { position: relative; display: block; }
.au-pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-40%); border: 0; background: none; font-size: 17px; cursor: pointer; opacity: .7; }
.au-hint { font-size: 11.5px; color: #8b93a1; margin-top: 5px; min-height: 14px; }
.au-hint.good { color: #4ade80; } .au-hint.bad { color: #f87171; }
.au-err { color: #f87171; font-size: 13px; font-weight: 700; min-height: 18px; margin: 10px 0 4px; }
.au-go { width: 100%; height: 46px; border: 0; border-radius: 12px; background: #fff; color: #111; font: 900 15px Inter, sans-serif; cursor: pointer; }
.au-go:disabled { opacity: .6; }
.au-note { font-size: 12px; color: #8b93a1; text-align: center; margin: 12px 0 6px; }
.au-guest { width: 100%; height: 40px; border: 1px solid rgba(255,255,255,.15); border-radius: 12px; background: transparent; color: #cbd0d8; font: 700 14px Inter, sans-serif; cursor: pointer; }
.au-badge { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: #fff; color: #111; font: 800 14px Inter, sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.au-badge.in { background: #1c1d23; color: #fff; }
.au-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; flex-shrink: 0; }
.au-menu { position: fixed; z-index: 101; width: 230px; background: #16171c; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 8px; box-shadow: 0 16px 40px rgba(0,0,0,.5); font-family: Inter, sans-serif; color: #e7e9ee; }
.au-mh { padding: 6px 8px 10px; font-size: 13px; } .au-mh small { display: block; color: #8b93a1; font-size: 11px; margin-top: 3px; }
.au-menu button { display: block; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: 9px; background: transparent; color: #fff; font: 700 14px Inter, sans-serif; cursor: pointer; }
.au-menu button:hover { background: #24272e; }
.au-toast { position: fixed; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 102; background: #16171c; border: 1px solid rgba(255,255,255,.15); color: #fff; padding: 10px 16px; border-radius: 12px; font: 700 14px Inter, sans-serif; }
body.logged-in #avName { pointer-events: none; opacity: .55; }
@media (max-width: 700px) { .au-badge { max-width: 96px; padding: 0 10px; font-size: 13px; } }
/* REDSHIFT: speed meter + instability (posture) bar under the crosshair */
#rsInst { position: absolute; left: 50%; top: calc(50% + 46px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 5px; pointer-events: none; font-family: Rajdhani, Inter, sans-serif; }
#rsInst .ri-spd { font: 700 13px Rajdhani, sans-serif; color: rgba(255,255,255,.75); letter-spacing: .08em; text-shadow: 0 1px 3px #000; }
#rsInst .ri-spd b { font: 900 italic 20px Rajdhani, sans-serif; color: #fff; }
#rsInst.red .ri-spd b { color: #ff4d6d; text-shadow: 0 0 10px rgba(255,45,75,.9); }
#rsInst .ri-bar { width: 110px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.55); overflow: hidden; transition: opacity .3s; }
#rsInst .ri-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe14d, #ff7a1a); transition: width .12s; }
#rsInst.stag .ri-bar i { background: #ff2d4b; animation: rsStag .2s infinite alternate; }
@keyframes rsStag { to { opacity: .4; } }
#avName[readonly] { opacity: .7; cursor: default; }
.av-name-note { font-size: 12.5px; color: #8b93a1; margin-top: 6px; }
.av-name-note a { color: #fff; font-weight: 800; text-decoration: underline; cursor: pointer; }
/* Single player / Multiplayer lobby (host or join with a code, up to 4) */
.bm-row.two { grid-template-columns: 1fr 1fr; }
#bxStart.need-lobby #bxPlay, #bxStart.need-lobby .bx-roles { display: none !important; }
.lb-act { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.lb-act .gbtn { margin: 0; width: auto; padding: 0 16px; height: 42px; flex-shrink: 0; }
.lb-act span { color: #8b93a1; font-size: 13px; }
.lb-act input { flex: 1; min-width: 0; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: #0d0e11; color: #fde047; font: 900 18px "Russo One", sans-serif; letter-spacing: 4px; text-align: center; text-transform: uppercase; }
.lb-msg { min-height: 18px; margin-top: 6px; font-size: 13px; font-weight: 700; color: #fca5a5; }
.lb-room { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 14%, #121318); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.lb-room small { display: block; font-size: 10px; letter-spacing: .14em; color: #a7adb8; font-weight: 800; }
.lb-room b { font: 900 26px "Russo One", sans-serif; letter-spacing: 5px; color: #fde047; }
.lb-room .lb-n { margin-left: auto; font: 900 18px Inter, sans-serif; }
.lb-room .gbtn { margin: 0; width: auto; height: 36px; padding: 0 14px; }
.lb-players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lb-players span { padding: 4px 10px; border-radius: 999px; background: #22242b; font-size: 13px; font-weight: 700; }

/* =====================================================================
   ROBLOX-STYLE GAME UI — chunky rounded type with black outlines, bright buttons with a 3D lip,
   dark panels with heavy borders. Applies to every Blox game (#blox); games add their own colours on top.
   ===================================================================== */
#blox { --rbx-font: "Fredoka", "Inter", sans-serif; --rbx-panel: rgba(17,19,28,.88); --rbx-stroke: rgba(0,0,0,.62); }
#blox .bx-hud { font-family: var(--rbx-font); }
/* outlined text helper used everywhere */
#blox .gc-title, #blox .rs-title, #blox .bx-banner .b-main, #blox .bx-chip, #blox .gbtn, #blox .bx-role b, #blox .lb-h, #blox .bm, #blox .lb-room b {
  font-family: var(--rbx-font) !important; paint-order: stroke fill; }
/* start / pause / results cards */
#blox .g-card { background: linear-gradient(180deg, rgba(30,33,46,.97), rgba(19,21,30,.97)); border: 3px solid var(--rbx-stroke); border-radius: 22px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08), 0 8px 0 rgba(0,0,0,.45), 0 30px 80px rgba(0,0,0,.55); }
#blox .gc-title { font-style: normal; font-weight: 700; letter-spacing: 1px; -webkit-text-stroke: 7px #000; text-shadow: 0 5px 0 rgba(0,0,0,.55); }
#blox .bx-title { -webkit-text-stroke: 0; filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 2px #000) drop-shadow(0 0 2px #000); }
#blox .gc-sub { font-family: var(--rbx-font); font-weight: 600; letter-spacing: .12em; }
#blox .rs-title { font-style: normal; font-weight: 700; -webkit-text-stroke: 6px #000; text-shadow: 0 5px 0 rgba(0,0,0,.5); }
/* chunky buttons with a bottom lip */
#blox .gbtn { font-family: var(--rbx-font); font-weight: 700; font-size: 18px; letter-spacing: .02em; color: #fff; border: 3px solid var(--rbx-stroke); border-radius: 14px;
  background: linear-gradient(180deg, #4a5068, #343849); box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 5px 0 #1c1f2b; text-shadow: 0 2px 0 rgba(0,0,0,.55);
  transition: transform .08s, box-shadow .08s, filter .15s; }
#blox .gbtn:hover { filter: brightness(1.12); background: linear-gradient(180deg, #4a5068, #343849); }
#blox .gbtn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 1px 0 #1c1f2b; }
#blox .gbtn.primary { background: linear-gradient(180deg, #4ade80, #16a34a); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 #0f6b32; color: #fff; font-size: 24px; letter-spacing: .06em; -webkit-text-stroke: 1px rgba(0,0,0,.35); }
#blox .gbtn.primary:hover { background: linear-gradient(180deg, #5eea8f, #19b350); }
#blox .gbtn.danger { background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 5px 0 #8f1717; }
#blox .gbtn.ghost { background: linear-gradient(180deg, #3a3f52, #2a2e3c); color: #d6d9e0; }
#blox .gbtn:disabled { filter: grayscale(1) brightness(.7); }
/* top counters (points, coins, timers…) */
#blox .bx-chip { font-weight: 700; font-size: 20px; color: #fff; border: 3px solid var(--rbx-stroke); border-radius: 14px; padding: 6px 14px;
  background: linear-gradient(180deg, rgba(44,48,66,.95), rgba(24,27,38,.95)); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 4px 0 rgba(0,0,0,.4); text-shadow: 0 2px 0 rgba(0,0,0,.6); }
#blox .bx-chip small { font-family: var(--rbx-font); font-weight: 600; color: #b9c0d0; letter-spacing: .08em; text-shadow: none; }
#blox .bx-chip.accent { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 100%, #fff 18%), color-mix(in srgb, var(--accent) 85%, #000)); color: #fff; }
#blox .bx-chip.accent small { color: rgba(255,255,255,.85); }
/* big centre banners: thick black outline like Roblox titles */
#blox .bx-banner .b-main { font-weight: 700; letter-spacing: 1px; -webkit-text-stroke: 8px #000; text-shadow: 0 6px 0 rgba(0,0,0,.55); }
#blox .bx-banner .b-sub { font-family: var(--rbx-font); font-weight: 600; font-size: 20px; -webkit-text-stroke: 4px #000; paint-order: stroke fill; color: #fff; }
/* notifications */
#blox .bx-toast { font-family: var(--rbx-font); font-weight: 600; font-size: 15px; border: 2px solid var(--rbx-stroke); border-left: 6px solid var(--accent); border-radius: 12px;
  background: var(--rbx-panel); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
/* interaction prompt (like a ProximityPrompt) */
#blox .bx-prompt { font-family: var(--rbx-font); font-weight: 600; font-size: 16px; background: var(--rbx-panel); border: 3px solid var(--rbx-stroke); border-radius: 14px; box-shadow: 0 4px 0 rgba(0,0,0,.35); }
#blox .bx-prompt kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; border: 3px solid #000; background: #fff; color: #111; font-family: var(--rbx-font); font-weight: 700; box-shadow: 0 3px 0 rgba(0,0,0,.4); }
/* player list (top right), Roblox style */
#blox .h-plist { font-family: var(--rbx-font); background: transparent; width: 220px; }
#blox .h-plist .pl-row { background: rgba(17,19,28,.72); margin-bottom: 3px; border-radius: 8px; font-weight: 600; font-size: 14px; }
#blox .h-plist .pl-row:first-child { background: rgba(0,0,0,.55); font-size: 12px; letter-spacing: .06em; color: #b9c0d0; }
#blox .h-plist .pl-row.me { background: rgba(60,70,110,.75); }
/* game panels */
#blox .bx-panel { background: var(--rbx-panel); border: 3px solid var(--rbx-stroke); border-radius: 16px; box-shadow: inset 0 2px 0 rgba(255,255,255,.07), 0 5px 0 rgba(0,0,0,.35); font-family: var(--rbx-font); }
/* role / kart picker, mode picker, leaderboard */
#blox .bx-role { border-width: 3px; border-radius: 16px; box-shadow: inset 0 2px 0 rgba(255,255,255,.12), 0 5px 0 rgba(0,0,0,.4); transition: transform .08s; }
#blox .bx-role:active { transform: translateY(3px); }
#blox .bx-role b { font-weight: 700; letter-spacing: .02em; -webkit-text-stroke: 3px #000; }
#blox .bm { font-weight: 700; font-size: 16px; border: 3px solid var(--rbx-stroke); background: linear-gradient(180deg, #343849, #262a37); box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 4px 0 rgba(0,0,0,.4); }
#blox .bm.on { background: linear-gradient(180deg, #60a5fa, #2563eb); border-color: #000a; box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 #1e3a8a; color: #fff; }
#blox .bx-lb { border: 3px solid var(--rbx-stroke); border-radius: 14px; background: rgba(0,0,0,.32); font-family: var(--rbx-font); }
#blox .lb-h { font-weight: 700; font-size: 15px; }
#blox .lb-room { border-width: 3px; border-radius: 14px; }
#blox .lb-act input, #blox .bm-code input { border: 3px solid var(--rbx-stroke); border-radius: 12px; font-family: var(--rbx-font); font-weight: 700; }
/* pause menu rows */
#blox .pm-tabs span { font-family: var(--rbx-font); font-weight: 700; }
#blox .pm-row { font-family: var(--rbx-font); font-weight: 600; }
/* results grid */
#blox .rs-grid > div { border: 3px solid var(--rbx-stroke); border-radius: 14px; background: rgba(0,0,0,.3); }
#blox .rs-grid b { font-family: var(--rbx-font); font-weight: 700; }
#blox .rs-earn { font-family: var(--rbx-font); font-weight: 700; }
/* touch buttons: dark round buttons with a white rim and outlined labels */
body.touch-play .tc-btn { border: 3px solid rgba(255,255,255,.75); background: rgba(17,19,28,.55); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
body.touch-play .tc-btn small { font-family: "Fredoka", sans-serif; font-weight: 700; letter-spacing: .04em; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
body.touch-play .tc-btn.accent { background: color-mix(in srgb, var(--accent) 55%, rgba(17,19,28,.4)); }
body.touch-play .tc-mini { border: 3px solid rgba(0,0,0,.6); }
#blox .gc-keys, #blox .gc-tips { font-family: var(--rbx-font); font-weight: 500; }
#blox .gc-keys kbd { font-family: var(--rbx-font); font-weight: 700; border: 2px solid #000; border-radius: 8px; background: linear-gradient(#f4f5f7, #c9ccd4); color: #15171e; box-shadow: 0 3px 0 #000a; }
#blox .tip { border: 2px solid var(--rbx-stroke); border-left: 5px solid var(--accent); border-radius: 12px; background: rgba(0,0,0,.28); }
#blox .tip b { font-family: var(--rbx-font); font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--accent); }
/* chunky Roblox health / progress bars */
#blox .bx-bar { height: 18px; border: 3px solid rgba(0,0,0,.7); border-radius: 10px; background: rgba(0,0,0,.6); box-shadow: 0 3px 0 rgba(0,0,0,.35); }
#blox .bx-bar i { border-radius: 6px; box-shadow: inset 0 4px 0 rgba(255,255,255,.28); }
#blox .bx-panel [style*="letter-spacing:2px"] { font-family: var(--rbx-font) !important; font-weight: 700 !important; }
/* every game's inline HUD text in the old fonts switches to the Roblox-style font; big numbers get an outline */
#blox .bx-custom [style*="Rajdhani"], #blox .bx-custom [style*="Russo One"], #blox .bx-custom [style*="font:700 1"], #blox .bx-custom [style*="font:800 1"] { font-family: "Fredoka", sans-serif !important; font-style: normal !important; }
#blox .bx-custom [style*="font:900"][style*="Rajdhani"], #blox .bx-custom [style*="font:900"][style*="Russo One"], #blox .bx-custom [style*="font:900 italic"] { font-weight: 700 !important; -webkit-text-stroke: 5px #000; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0,0,0,.5) !important; }
/* the full-screen rule is for the 3D view only — HUD canvases (kart track map, city minimap) keep their own position */
#blox .bx-hud canvas { inset: auto; }
#blox .bx-hud #cyMapC { inset: 0; }
/* player list: no broken-image icons for players without a head picture */
#blox .pl-row img[src=""], #blox .pl-row img:not([src]) { visibility: hidden; }
#blox .pl-row img { border: 2px solid rgba(0,0,0,.6); }
#blox .h-plist .pl-head { background: rgba(0,0,0,.6); border-radius: 8px; margin-bottom: 3px; font-family: var(--rbx-font); font-weight: 700; font-size: 12px; letter-spacing: .06em; color: #c9cfdb; }
#blox .h-plist .pl-row:first-child { background: rgba(17,19,28,.72); font-size: 14px; letter-spacing: 0; color: inherit; }
#blox .h-plist .pl-row.me:first-child { background: rgba(60,70,110,.75); }
#blox .bx-chip [style*="italic"], #blox .bx-chip i, #blox .bx-chip em { font-style: normal !important; font-family: var(--rbx-font) !important; }
#blox #kMap { border: 3px solid rgba(0,0,0,.7) !important; border-radius: 16px !important; box-shadow: 0 4px 0 rgba(0,0,0,.35); background: rgba(17,19,28,.75) !important; }
/* Cozy Cafe upgrade shop */
#blox #cShop { background: linear-gradient(180deg, rgba(48,30,44,.97), rgba(28,18,28,.97)) !important; border: 3px solid rgba(0,0,0,.7) !important; border-radius: 22px !important; box-shadow: inset 0 2px 0 rgba(255,255,255,.08), 0 8px 0 rgba(0,0,0,.45) !important; font-family: var(--rbx-font); }
#blox #cShop button { font-family: var(--rbx-font) !important; border: 3px solid rgba(0,0,0,.6) !important; border-radius: 14px !important; box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 4px 0 rgba(0,0,0,.4); cursor: pointer; }
#blox #cShop button:active { transform: translateY(3px); }
#blox #cShop button[data-go] { background: linear-gradient(180deg, #f9a8d4, #db2777) !important; box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 #9d174d !important; font-weight: 700 !important; font-size: 22px !important; -webkit-text-stroke: 4px #000; paint-order: stroke fill; }
#blox #cShop > div:first-child { -webkit-text-stroke: 6px #000; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0,0,0,.5); }
/* top counters never wrap their text onto several lines */
#blox .bx-chip { white-space: nowrap; }
#blox .bx-chip small { white-space: nowrap; }
#blox .bx-top { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 520px); min-width: 300px; }

/* ===== REDSHIFT gets the same Roblox-style UI ===== */
#game { --rbx-font: "Fredoka", "Inter", sans-serif; --rbx-panel: rgba(17,19,28,.88); --rbx-stroke: rgba(0,0,0,.62); }
#game .g-card { background: linear-gradient(180deg, rgba(36,28,40,.97), rgba(19,16,24,.97)); border: 3px solid var(--rbx-stroke); border-radius: 22px; box-shadow: inset 0 2px 0 rgba(255,255,255,.08), 0 8px 0 rgba(0,0,0,.45), 0 30px 80px rgba(0,0,0,.55); }
#game .gc-title, #game .rs-title { font-family: var(--rbx-font); font-style: normal; font-weight: 700; letter-spacing: 1px; -webkit-text-stroke: 7px #000; paint-order: stroke fill; text-shadow: 0 5px 0 rgba(0,0,0,.55); }
#game .gc-sub { font-family: var(--rbx-font); font-weight: 600; letter-spacing: .12em; }
#game .gc-keys, #game .gc-tips { font-family: var(--rbx-font); font-weight: 500; }
#game .gc-keys kbd { font-family: var(--rbx-font); font-weight: 700; border: 2px solid #000; border-radius: 8px; background: linear-gradient(#f4f5f7, #c9ccd4); color: #15171e; box-shadow: 0 3px 0 #000a; }
#game .tip { border: 2px solid var(--rbx-stroke); border-left: 5px solid #ff2d4b; border-radius: 12px; background: rgba(0,0,0,.28); }
#game .tip b { font-family: var(--rbx-font); font-weight: 700; color: #ff7088; }
#game .gbtn { font-family: var(--rbx-font); font-weight: 700; font-size: 18px; color: #fff; border: 3px solid var(--rbx-stroke); border-radius: 14px; background: linear-gradient(180deg, #4a5068, #343849); box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 5px 0 #1c1f2b; text-shadow: 0 2px 0 rgba(0,0,0,.55); transition: transform .08s, box-shadow .08s; }
#game .gbtn:active { transform: translateY(4px); box-shadow: inset 0 2px 0 rgba(255,255,255,.18), 0 1px 0 #1c1f2b; }
#game .gbtn.primary { background: linear-gradient(180deg, #4ade80, #16a34a); box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 5px 0 #0f6b32; color: #fff; font-size: 24px; }
#game .gbtn.danger { background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 5px 0 #8f1717; }
#game .gbtn.ghost { background: linear-gradient(180deg, #3a3f52, #2a2e3c); color: #d6d9e0; }
#game .mp-btn { border: 3px solid var(--rbx-stroke) !important; border-radius: 16px !important; box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 6px 0 rgba(0,0,0,.45) !important; transition: transform .08s; }
#game .mp-btn:active { transform: translateY(4px); }
#game .mp-btn b { font-family: var(--rbx-font) !important; font-style: normal !important; font-weight: 700 !important; -webkit-text-stroke: 4px #000; paint-order: stroke fill; color: #fff !important; }
#game .mp-btn span { font-family: var(--rbx-font) !important; font-weight: 600 !important; }
#game .mp-btn:not(.red) { background: linear-gradient(180deg, #60a5fa, #2563eb) !important; }
#game .mp-btn.red { background: linear-gradient(180deg, #ff6b85, #e11d48) !important; }
#game .lb-head b, #game .lb-status { font-family: var(--rbx-font); font-weight: 700; }
#game #lbCode { border: 3px solid var(--rbx-stroke); border-radius: 12px; font-family: var(--rbx-font); font-weight: 700; }
/* HUD */
#game #hud { font-family: var(--rbx-font); }
#game .h-wave, #game #hWave { font-family: var(--rbx-font) !important; font-weight: 700 !important; -webkit-text-stroke: 4px #000; paint-order: stroke fill; }
#game .h-plist { font-family: var(--rbx-font); background: transparent; }
#game .h-plist .pl-head { background: rgba(0,0,0,.6); border-radius: 8px; margin-bottom: 3px; font-weight: 700; }
#game .h-plist .pl-row { background: rgba(60,70,110,.75); border-radius: 8px; font-weight: 600; }
#game .hp-num, #game .hp-num span, #game .w-ammo, #game .w-ammo span, #game .g-num, #game .g-num span { font-family: var(--rbx-font) !important; font-style: normal !important; font-weight: 700 !important; -webkit-text-stroke: 5px #000; paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0,0,0,.5) !important; }
#game .hp-num small, #game .w-ammo small, #game .g-num small { -webkit-text-stroke: 3px #000; }
#game .w-name, #game .g-rl, #game .w-slot { font-family: var(--rbx-font) !important; font-weight: 700 !important; }
#game .w-slot { border: 2px solid rgba(0,0,0,.6) !important; border-radius: 10px !important; }
#game .ab kbd { font-family: var(--rbx-font); font-weight: 700; -webkit-text-stroke: 2px #000; paint-order: stroke fill; }
#game #banner .b-main, #game #pop, #game #comboX { font-family: var(--rbx-font) !important; font-style: normal !important; font-weight: 700 !important; -webkit-text-stroke: 7px #000; paint-order: stroke fill; }
#game #banner .b-sub { font-family: var(--rbx-font) !important; font-weight: 600 !important; -webkit-text-stroke: 4px #000; paint-order: stroke fill; }
#game #feed > * { font-family: var(--rbx-font) !important; border: 2px solid rgba(0,0,0,.55); border-radius: 10px; }
#game #combo span { font-family: var(--rbx-font); font-weight: 700; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
#game .gc-title { -webkit-text-stroke: 0; text-shadow: none; filter: drop-shadow(0 5px 0 #000) drop-shadow(0 0 2px #000) drop-shadow(0 0 2px #000) drop-shadow(0 0 2px #000); }
#game .gc-cols { gap: 18px; }
#game .tip { padding: 6px 10px; }
#game .pl-row img:not([src]), #game .pl-row img[src=""] { visibility: hidden; }
/* REDSHIFT loadout picker + energy bar */
#game .rs-loadout { margin: 4px 0 12px; font-family: var(--rbx-font); }
#game .rl-h { font-weight: 700; font-size: 13px; letter-spacing: .08em; color: #ff7088; margin-bottom: 6px; }
#game .rl-h small { color: #8b93a1; font-weight: 600; letter-spacing: 0; }
#game .rl-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
#game .rl-g { text-align: left; padding: 7px 9px; border-radius: 12px; border: 3px solid rgba(0,0,0,.6); background: linear-gradient(180deg, #343849, #262a37); color: #fff; box-shadow: inset 0 2px 0 rgba(255,255,255,.1), 0 4px 0 rgba(0,0,0,.4); cursor: pointer; font-family: var(--rbx-font); }
#game .rl-g b { display: block; font-weight: 700; font-size: 14px; }
#game .rl-g small { display: block; font-size: 10.5px; color: #aab3c5; }
#game .rl-g.on { background: linear-gradient(180deg, #ff6b85, #e11d48); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 4px 0 #881337; }
#game .rl-g.on small { color: #ffe4ea; }
#game .rl-g:active { transform: translateY(3px); }
#rsInst .ri-en { width: 110px; height: 4px; border-radius: 3px; background: rgba(0,0,0,.55); overflow: hidden; transition: opacity .3s; }
#rsInst .ri-en i { display: block; height: 100%; background: linear-gradient(90deg, #38bdf8, #a78bfa); }
@media (max-width: 700px) { #game .rl-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- owner tag + owner menu link ---------- */
.own-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px; background: linear-gradient(135deg, #ffd23f, #ff8a00); color: #2a1600; font: 900 10px/1.5 Inter, sans-serif; letter-spacing: .06em; font-style: normal; vertical-align: middle; box-shadow: 0 0 10px rgba(255,190,40,.45); }
.au-menu .au-mi { display: block; padding: 10px; border-radius: 9px; color: #ffd23f; font: 700 14px Inter, sans-serif; text-decoration: none; }
.au-menu .au-mi:hover { background: #24272e; }

/* ================= PLAXA STUDIO ================= */
.st { position: fixed; inset: 0; z-index: 60; background: #0b0d12; font-family: Inter, system-ui, sans-serif; color: #e7e9ee; user-select: none; -webkit-user-select: none; }
.st.hidden { display: none; }
body.in-studio { overflow: hidden; }
.st-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.st button { font: 700 13px Inter, sans-serif; color: #e7e9ee; background: #23262f; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: 8px 11px; cursor: pointer; touch-action: manipulation; }
.st button:hover { background: #2d313c; }
.st button:disabled { opacity: .35; cursor: default; }
.st button.on { background: #ffd23f; color: #241a00; border-color: #ffd23f; }
.st-top { position: absolute; left: 0; right: 0; top: 0; height: 54px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); padding-top: env(safe-area-inset-top); box-sizing: content-box; display: flex; align-items: center; gap: 8px; background: rgba(15,17,23,.94); border-bottom: 1px solid rgba(255,255,255,.07); z-index: 3; }
.st-logo { font: 900 15px "Russo One", Inter, sans-serif; color: #ffd23f; letter-spacing: .04em; white-space: nowrap; }
#stTitle { min-width: 0; width: 220px; background: #1a1d25; border: 1px solid rgba(255,255,255,.1); color: #fff; border-radius: 9px; padding: 8px 10px; font: 800 14px Inter, sans-serif; user-select: text; -webkit-user-select: text; }
.st-saved { color: #8b90a0; font-size: 12px; white-space: nowrap; }
.st-sp { flex: 1; }
.st .st-go { background: #22c55e; border-color: #22c55e; color: #052e14; }
.st .st-pub { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.st-left { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(66px + env(safe-area-inset-top)); bottom: 12px; width: 214px; overflow-y: auto; background: rgba(15,17,23,.92); border: 1px solid rgba(255,255,255,.07); border-radius: 14px; padding: 10px; z-index: 2; box-sizing: border-box; }
.st-h { font: 800 10px Inter, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8b90a0; margin: 10px 2px 6px; }
.st-h:first-child { margin-top: 0; }
.st-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-types { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.st-tools button, .st-types button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; font-size: 18px; }
.st-tools button span, .st-types button span { font: 700 11px Inter, sans-serif; }
.st-colors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.st-colors button { aspect-ratio: 1; padding: 0; border-radius: 7px; border: 2px solid rgba(255,255,255,.15); }
.st-colors button.on { border-color: #fff; box-shadow: 0 0 0 2px #ffd23f; background-color: inherit; }
.st-colors button.auto { background: #23262f; font-size: 11px; }
.st-colors button.auto.on { background: #ffd23f; color: #241a00; }
.st select { width: 100%; background: #1a1d25; color: #fff; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; padding: 7px 8px; font: 600 13px Inter, sans-serif; }
.st-props { position: absolute; right: max(10px, env(safe-area-inset-right)); top: calc(66px + env(safe-area-inset-top)); width: 236px; background: rgba(15,17,23,.94); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px; z-index: 2; box-sizing: border-box; max-height: calc(100% - 80px); overflow-y: auto; }
.st-props.hidden { display: none; }
.st-ph { font: 900 15px Inter, sans-serif; display: flex; align-items: center; justify-content: space-between; }
.st-ph button { padding: 3px 8px; }
.st-pt { color: #9aa0b0; font-size: 12px; margin: 6px 0 8px; line-height: 1.45; }
.st-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 6px; }
.st-row3 label { font: 800 10px Inter, sans-serif; color: #8b90a0; display: flex; flex-direction: column; gap: 3px; }
.st-row3 input { width: 100%; box-sizing: border-box; background: #1a1d25; color: #fff; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 6px; font: 600 13px Inter, sans-serif; user-select: text; -webkit-user-select: text; }
.st-nudge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 8px 0; }
.st-nudge button { padding: 7px 0; }
.st-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.st-acts button { flex: 1; }
.st button.bad { background: #3a1d24; border-color: rgba(244,63,94,.4); color: #fda4af; }
.st-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); background: rgba(15,17,23,.85); color: #cbd0dc; font-size: 12px; padding: 7px 14px; border-radius: 999px; z-index: 2; max-width: calc(100% - 520px); text-align: center; pointer-events: none; }
.st-cam { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: none; grid-template-columns: repeat(2, 44px); gap: 6px; z-index: 2; }
.st-cam button { height: 44px; padding: 0; font-size: 18px; background: rgba(35,38,47,.92); }
.st-panel-t { display: none; }
.st-modal { position: absolute; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 10; padding: 16px; }
.st-modal.hidden { display: none; }
.st-card { width: min(440px, 100%); background: #16181f; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.6); user-select: text; -webkit-user-select: text; }
.st-card h3 { margin: 0 0 10px; font: 900 20px Inter, sans-serif; }
.st-card label { display: flex; flex-direction: column; gap: 5px; font: 700 12px Inter, sans-serif; color: #9aa0b0; margin-bottom: 10px; }
.st-card input, .st-card textarea { background: #1f222b; color: #fff; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 10px; font: 600 14px Inter, sans-serif; resize: vertical; }
.st-err { color: #fda4af; font-size: 13px; min-height: 18px; }
.st-toast { position: absolute; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); background: #ffd23f; color: #241a00; font: 800 13px Inter, sans-serif; padding: 8px 16px; border-radius: 999px; z-index: 11; pointer-events: none; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
@media (pointer: coarse) { .st-cam { display: grid; } }
@media (max-width: 760px) {
  .st-top { gap: 5px; height: 50px; }
  .st-logo, .st-saved { display: none; }
  #stTitle { width: auto; flex: 1; min-width: 60px; font-size: 13px; }
  .st-sp { display: none; }
  .st-top button { padding: 7px 8px; font-size: 12px; }
  .st-left { display: none; top: auto; left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); width: auto; max-height: 52%; }
  .st.panel-open .st-left { display: block; }
  .st-types { grid-template-columns: repeat(4, 1fr); }
  .st-tools { grid-template-columns: repeat(4, 1fr); }
  .st-colors { grid-template-columns: repeat(10, 1fr); }
  .st-panel-t { display: block; position: absolute; left: max(10px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 3; padding: 11px 14px !important; background: #ffd23f !important; color: #241a00 !important; border-color: #ffd23f !important; }
  .st-props { left: 8px; right: 8px; top: auto; width: auto; bottom: calc(64px + env(safe-area-inset-bottom)); max-height: 46%; }
  .st.panel-open .st-props { display: none; }
  .st.has-sel .st-cam, .st.panel-open .st-cam { display: none; }
  .st-hint { display: none; }
}

/* ---------- community games (Create page) ---------- */
.ug-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 18px; }
.ug-new { background: #ffd23f; color: #241a00; border: 0; border-radius: 12px; padding: 12px 18px; font: 900 15px Inter, sans-serif; cursor: pointer; }
.ug-new.alt { background: #23262f; color: #fff; }
.ug-sec { margin: 22px 0 10px; font: 900 18px Inter, sans-serif; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ug-sec .ug-tabs { display: flex; gap: 6px; }
.ug-sec .ug-tabs button { background: #23262f; color: #cbd0dc; border: 0; border-radius: 999px; padding: 5px 12px; font: 700 12px Inter, sans-serif; cursor: pointer; }
.ug-sec .ug-tabs button.on { background: #fff; color: #111; }
.ug-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.ug-card { background: #16181f; border: 1px solid rgba(255,255,255,.07); border-radius: 14px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.ug-card:hover { border-color: rgba(255,210,63,.5); }
.ug-th { aspect-ratio: 16/9; background: linear-gradient(135deg, #1e3a8a, #0f766e); display: flex; align-items: center; justify-content: center; font-size: 36px; overflow: hidden; }
.ug-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ug-b { padding: 10px 12px 12px; }
.ug-t { font: 800 14px Inter, sans-serif; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ug-m { font-size: 12px; color: #8b90a0; margin-top: 3px; }
.ug-acts { display: flex; gap: 6px; margin-top: 8px; }
.ug-acts button { flex: 1; background: #23262f; color: #fff; border: 0; border-radius: 8px; padding: 7px; font: 700 12px Inter, sans-serif; cursor: pointer; }
.ug-acts button.go { background: #22c55e; color: #052e14; }
.ug-acts button.bad { background: #3a1d24; color: #fda4af; }
.ug-empty { color: #8b90a0; padding: 18px 0; }
.ug-page { max-width: 820px; }
.ug-page .ug-th { border-radius: 16px; margin-bottom: 14px; }
.ug-page h1 { margin: 0 0 4px; }
.ug-desc { color: #cbd0dc; margin: 10px 0 16px; white-space: pre-wrap; }

/* ---------- ban screen ---------- */
.bv-ban { position: fixed; inset: 0; z-index: 2147483600; background: rgba(8,9,12,.97); display: flex; align-items: center; justify-content: center; padding: 20px; font-family: Inter, system-ui, sans-serif; }
.bv-ban-c { max-width: 440px; text-align: center; background: #16181f; border: 1px solid rgba(244,63,94,.4); border-radius: 18px; padding: 28px; color: #e7e9ee; }
.bv-ban-c .i { font-size: 46px; }
.bv-ban-c h2 { margin: 8px 0; font-size: 22px; }
.bv-ban-c p { color: #aab0bf; margin: 8px 0; }
.bv-ban-c b { color: #fff; }
.bv-ban-c .s { font-size: 13px; }

/* ---------- Studio: names + scripts editor ---------- */
.st-name { display: flex; flex-direction: column; gap: 3px; font: 800 10px Inter, sans-serif; color: #8b90a0; margin-bottom: 7px; }
.st-name small { font-weight: 600; color: #6b7080; }
.st-name input { background: #1a1d25; color: #fff; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 7px; font: 600 13px Inter, sans-serif; user-select: text; -webkit-user-select: text; }
.st-scr { position: absolute; right: 0; top: calc(55px + env(safe-area-inset-top)); bottom: 0; width: min(620px, 100%); background: #0f1117; border-left: 1px solid rgba(255,255,255,.08); z-index: 6; display: flex; flex-direction: column; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); box-sizing: border-box; user-select: text; -webkit-user-select: text; }
.st-scr.hidden { display: none; }
.st.scr-open .st-props { display: none; }
.sc-top { display: flex; align-items: center; gap: 6px; font: 900 15px Inter, sans-serif; margin-bottom: 8px; }
.sc-tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 6px; flex: none; }
.sc-tabs button { white-space: nowrap; padding: 6px 10px; }
.sc-tabs button.off { opacity: .5; text-decoration: line-through; }
.sc-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex: none; }
.sc-bar input[type=text], #scName { flex: 1; min-width: 0; background: #1a1d25; color: #fff; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 7px 9px; font: 700 13px Inter, sans-serif; }
.sc-on { display: flex; align-items: center; gap: 5px; font: 700 12px Inter, sans-serif; color: #cbd0dc; }
.sc-ed { flex: 1; min-height: 140px; display: flex; background: #0a0b0f; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; }
.sc-gut { width: 40px; flex: none; overflow: hidden; padding: 10px 0; text-align: right; color: #4b5162; font: 13px/1.55 ui-monospace, Consolas, Menlo, monospace; user-select: none; -webkit-user-select: none; background: #0d0e13; }
.sc-gut div { padding-right: 8px; }
.sc-gut div.bad { background: rgba(244,63,94,.25); color: #fda4af; }
#scCode { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: #e6e9f0; font: 13px/1.55 ui-monospace, Consolas, Menlo, monospace; padding: 10px; tab-size: 2; white-space: pre; overflow: auto; caret-color: #ffd23f; }
.sc-stat { font-size: 12px; padding: 6px 2px; flex: none; }
.sc-stat.bad { color: #fda4af; } .sc-stat.good { color: #86efac; }
.sc-empty { flex: 1; color: #9aa0b0; padding: 20px 6px; line-height: 1.5; }
.sc-out { flex: none; height: 120px; display: flex; flex-direction: column; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: #0a0b0f; margin-top: 6px; }
.sc-oh { display: flex; align-items: center; gap: 6px; padding: 5px 8px; font: 800 11px Inter, sans-serif; color: #8b90a0; border-bottom: 1px solid rgba(255,255,255,.06); }
.sc-oh small { font-weight: 600; flex: 1; } .sc-oh button { padding: 3px 8px; font-size: 11px; }
#scOut { flex: 1; overflow: auto; padding: 5px 8px; font: 12px/1.5 ui-monospace, Consolas, monospace; color: #d6dae3; }
#scOut .bad { color: #fda4af; } #scOut .dim { color: #6b7080; font-family: Inter, sans-serif; }
.sc-help { position: absolute; inset: 52px 12px 12px; overflow: auto; background: #12141b; border: 1px solid rgba(255,210,63,.3); border-radius: 12px; padding: 12px 14px; z-index: 2; }
.sc-help.hidden { display: none; }
.sc-help h4 { margin: 12px 0 6px; color: #ffd23f; font: 900 13px Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.sc-help h4:first-child { margin-top: 0; }
.sc-help .hl { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.05); font-size: 12px; color: #aab0bf; }
.sc-help code { color: #e6e9f0; font: 12px ui-monospace, Consolas, monospace; word-break: break-word; }
@media (max-width: 760px) { .st-scr { width: 100%; } .sc-help .hl { grid-template-columns: 1fr; gap: 2px; } .st-top #stScr { padding: 7px 6px; } }

/* ---------- Studio games: script buttons, hints, test console ---------- */
.ug-ui { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.ug-hint { display: none; position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); background: rgba(15,17,23,.82); color: #fff; font: 800 15px Inter, sans-serif; padding: 8px 16px; border-radius: 12px; max-width: 80%; text-align: center; }
.ug-btns { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 90%; }
.ug-btn { pointer-events: auto; background: #ffd23f; color: #241a00; border: 0; border-radius: 12px; padding: 11px 18px; font: 900 15px Inter, sans-serif; box-shadow: 0 6px 0 #b8901a, 0 8px 18px rgba(0,0,0,.35); cursor: pointer; touch-action: manipulation; }
.ug-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8901a; }
.ug-con { display: none; position: absolute; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: min(520px, 70%); background: rgba(10,11,15,.85); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 6px 9px; font: 12px/1.45 ui-monospace, Consolas, monospace; color: #d6dae3; }
.ug-con .bad { color: #fda4af; }
.ug-more { margin-left: auto; background: none; border: 0; color: #8b90a0; font: 700 13px Inter, sans-serif; cursor: pointer; }
.ug-more:hover { color: #fff; }
#homeUGWrap { margin: 6px 0 22px; }

/* ---------- multiplayer: public server list ---------- */
.sv-list { margin: 10px 0 8px; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 8px 10px; text-align: left; }
.sv-h { display: flex; align-items: center; font: 800 11px Inter, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #9aa0b0; margin-bottom: 4px; }
.sv-r { margin-left: auto; background: none; border: 0; color: #cbd0dc; font-size: 15px; cursor: pointer; }
.sv-rows { max-height: 168px; overflow-y: auto; font-size: 13px; color: #cbd0dc; }
.sv-row { display: grid; grid-template-columns: 1fr 70px 44px auto; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid rgba(255,255,255,.06); }
.sv-row:first-child { border-top: 0; }
.sv-row .gbtn { padding: 5px 12px; font-size: 12px; min-width: 64px; }
.sv-row.new span:first-child { color: #9aa0b0; }
.sv-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.sv-bar i { display: block; height: 100%; background: linear-gradient(90deg, #22c55e, #ffd23f); }
.sv-c { font-weight: 800; color: #fff; text-align: right; }
.sv-none { color: #9aa0b0; padding: 4px 0 6px; }
.lb-act.small .gbtn { padding: 8px 12px; font-size: 13px; }

/* ---------- Terms of Service ---------- */
.au-tos { font-size: 12px; color: #9aa0b0; margin: 4px 0 10px; line-height: 1.45; }
.au-tos a, .sidefoot a, .au-tosbar a { color: #ffd23f; text-decoration: none; font-weight: 700; }
.au-tosbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 9000; background: #16181f; border: 1px solid rgba(255,210,63,.4); color: #e7e9ee; font: 600 13px/1.4 Inter, sans-serif; padding: 10px 12px 10px 16px; border-radius: 14px; box-shadow: 0 12px 30px rgba(0,0,0,.5); display: flex; align-items: center; gap: 12px; max-width: calc(100% - 24px); }
.au-tosbar button { background: #ffd23f; color: #241a00; border: 0; border-radius: 9px; padding: 7px 14px; font: 800 13px Inter, sans-serif; cursor: pointer; flex: none; }
