: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; }
