/* BG Studio · app a pantalla completa con la marca < BARGAMES > */
html, body.bgst-page { height: 100%; }
body.bgst-page { margin: 0; overflow: hidden; background: #0a0d14; }
.bgst {
    --o: #0a0d14; --p: #0e131d; --p2: #151b28; --sunk: #080b11; --l: #222b3e; --l2: #2f3a52;
    --t: #f2eee6; --m: #9aa3b5; --d: #646e85; --am: #f2a33a; --gold: #ffd27a; --cy: #34d1e0; --ok: #5fe08a;
    --disp: "Chakra Petch", "Segoe UI", sans-serif; --txt: Inter, system-ui, "Segoe UI", sans-serif; --mono: "JetBrains Mono", Consolas, monospace;
    position: fixed; inset: 0; display: grid; grid-template-rows: 50px minmax(0, 1fr) 26px; color: var(--t); font: 14px/1.5 var(--txt); background: var(--o);
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.bgst *, .bgst *::before, .bgst *::after { box-sizing: border-box; }
.bgst [hidden] { display: none !important; }
.bgst button { font: inherit; color: inherit; cursor: pointer; }
.bgst a { color: inherit; text-decoration: none; }
.bgst kbd { font: 600 11px var(--mono); border: 1px solid var(--l2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--m); }

/* Barra superior */
.bgst-top { display: flex; align-items: center; gap: 12px; padding: 0 12px; border-bottom: 1px solid var(--l); background: var(--p); }
.bgst-brand { display: flex; align-items: center; gap: 10px; flex: none; }
.bgst-brand b { display: inline-flex; align-items: center; height: 30px; padding: 0 7px; border-radius: 8px; border: 1px solid rgba(242, 163, 58, .55); background: linear-gradient(145deg, #1a2233, #07090e); font: 700 14px/1 var(--disp); color: var(--gold); }
.bgst-brand b i { font: 700 14px/1 var(--mono); font-style: normal; color: var(--cy); }
.bgst-brand span { font: 700 16px/1 var(--disp); letter-spacing: .02em; }
.bgst-cmd { flex: 0 1 420px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 8px 0 12px; border-radius: 9px; border: 1px solid var(--l); background: var(--sunk); color: var(--d); text-align: left; }
.bgst-cmd:hover { border-color: var(--l2); color: var(--m); }
.bgst-cmd em { flex: 1; font-style: normal; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgst-top__r { display: flex; gap: 8px; flex: none; }
.bgst-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13px; border: 1px solid transparent; white-space: nowrap; }
.bgst-btn--g { border-color: var(--l2); background: #ffffff05; }
.bgst-btn--g:hover { border-color: var(--cy); }
.bgst-btn--o { background: linear-gradient(180deg, #ffd27a, #f2a33a); color: #2a1a04 !important; }
.bgst-ib { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--l); background: none; display: inline-grid; place-items: center; color: var(--m); }
.bgst-ib:hover { color: var(--t); border-color: var(--l2); }

/* Cuerpo */
.bgst-body { display: grid; grid-template-columns: var(--sw, 236px) 6px minmax(0, 1fr); min-height: 0; }
.bgst-side { overflow-x: hidden; background: linear-gradient(180deg, #0c1019, var(--o)); min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--l2) transparent; }
.bgst-side__in { padding: 10px 8px 16px; display: grid; gap: 1px; }
.bgst-grp { margin: 14px 8px 6px; font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--d); }
.bgst-grp::before { content: "// "; letter-spacing: 0; }
.bgst-grp.is-pro { color: rgba(242, 163, 58, .75); }
.bgst-ed { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 13.5px; color: #c9cfda; position: relative; }
.bgst-ed:hover { background: #ffffff08; color: #fff; }
.bgst-ed.is-on { background: linear-gradient(90deg, rgba(52, 209, 224, .16), rgba(52, 209, 224, .03)); color: #fff; }
.bgst-ed.is-on::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cy); }
.bgst-ed.is-open::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--am); margin-left: auto; flex: none; }
.bgst-ed > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgst-ed i.p { font: 600 9.5px var(--mono); font-style: normal; color: var(--gold); border: 1px solid rgba(242, 163, 58, .45); border-radius: 5px; padding: 1px 5px; }
.bgst-ed.is-open i.p { margin-left: 0; }
.bgst-ei { width: 22px; flex: none; text-align: center; font-size: 15px; line-height: 1; }
.bgst-side__foot { margin-top: 16px; padding: 12px 10px 0; border-top: 1px solid var(--l); font-size: 12.5px; }
.bgst-side__foot a { color: var(--cy); }

.bgst-main { display: grid; grid-template-rows: 38px minmax(0, 1fr); min-width: 0; min-height: 0; }
.bgst-tabs { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--l); background: #0b0f17; }
.bgst-tabs::-webkit-scrollbar { display: none; }
.bgst-tab { display: flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; border: 0; border-right: 1px solid var(--l); background: none; color: var(--m); font-size: 13px; white-space: nowrap; cursor: pointer; flex: none; max-width: 280px; }
.bgst-tab:hover { color: var(--t); background: #ffffff05; }
.bgst-tab.is-on { color: var(--t); background: var(--p); box-shadow: inset 0 2px 0 var(--am); }
.bgst-tab span { overflow: hidden; text-overflow: ellipsis; }
.bgst-tab em { font-style: normal; font: 500 11.5px var(--mono); color: var(--d); margin-left: 6px; }
.bgst-tab--home { padding-right: 14px; gap: 6px; }
.bgst-x { width: 22px; height: 22px; border-radius: 6px; border: 0; background: none; color: var(--d); font-size: 16px; line-height: 1; }
.bgst-x:hover { background: #ff6b4a22; color: #ff9b85; }
.bgst-views { position: relative; min-height: 0; }
.bgst-view { position: absolute; inset: 0; }
.bgst-view iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--o); opacity: 0; transition: opacity .2s; }
.bgst-view.is-ready iframe { opacity: 1; }
.bgst-load { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--m); font: 500 13px var(--mono); pointer-events: none; }
.bgst-load span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--l2); border-top-color: var(--am); animation: bgst-g 0.8s linear infinite; }
.bgst-view.is-ready .bgst-load { display: none; }
@keyframes bgst-g { to { transform: rotate(360deg); } }

/* Inicio */
.bgst-home { overflow-y: auto; background:
    radial-gradient(60% 50% at 80% 0%, rgba(242, 163, 58, .1), transparent 70%),
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 40px 40px, var(--o); }
.bgst-home__in { max-width: 1100px; margin: 0 auto; padding: 36px 28px 60px; }
.bgst-k { margin: 0 0 8px; font: 600 11.5px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--am); }
.bgst-k::before { content: "// "; color: var(--d); letter-spacing: 0; }
.bgst-home h1 { margin: 0; font: 700 clamp(28px, 3.4vw, 42px)/1.08 var(--disp); }
.bgst-home h1 span { background: linear-gradient(180deg, #fff1c4, #ffd27a 40%, #f2a33a 76%, #b8701e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bgst-lead { color: var(--m); max-width: 64ch; margin: 10px 0 22px; font-size: 15px; }
.bgst-dz { display: grid; justify-items: center; gap: 6px; padding: 26px; border: 1.5px dashed var(--l2); border-radius: 16px; background: #0c1019; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.bgst-dz:hover { border-color: var(--am); background: rgba(242, 163, 58, .05); }
.bgst-dz svg { width: 74px; height: 52px; }
.bgst-dz b { font: 700 18px var(--disp); }
.bgst-dz span { color: var(--m); font-size: 13px; }
.bgst-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; margin-top: 30px; }
.bgst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.bgst-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 13px; border: 1px solid var(--l); background: var(--p); text-align: left; transition: border-color .2s, transform .2s; }
.bgst-card:hover { border-color: var(--l2); transform: translateY(-2px); }
.bgst-card .bgst-ei { font-size: 20px; width: auto; }
.bgst-card b { font: 600 15px var(--disp); }
.bgst-card small { color: var(--m); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bgst-card i { margin-top: 4px; font: 600 10px var(--mono); font-style: normal; color: var(--cy); border: 1px solid rgba(52, 209, 224, .4); border-radius: 5px; padding: 1px 6px; }
.bgst-rec { display: grid; gap: 6px; }
.bgst-rec button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--l); background: var(--p); text-align: left; }
.bgst-rec button:hover { border-color: var(--l2); }
.bgst-rec b { display: block; font: 500 13px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bgst-rec small { color: var(--d); font-size: 12px; }
.bgst-rec span:last-child { min-width: 0; }
.bgst-empty { color: var(--d); font-size: 13px; margin: 0; padding: 8px 0; list-style: none; }
.bgst-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--m); font-size: 13px; }

/* Barra de estado */
.bgst-st { display: flex; align-items: center; gap: 18px; padding: 0 12px; border-top: 1px solid var(--l); background: var(--p); font: 500 11.5px var(--mono); color: var(--d); white-space: nowrap; overflow: hidden; }
.bgst-st b { color: var(--cy); font-weight: 500; }
.bgst-net.on { color: var(--ok); }
.bgst-net.off { color: var(--am); }
.bgst-st__r { margin-left: auto; }

/* Soltar archivo, avisos y comandos */
.bgst-drop { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10, 13, 20, .82); border: 2px dashed var(--am); pointer-events: none; }
.bgst-drop div { display: grid; justify-items: center; gap: 4px; }
.bgst-drop b { font: 700 28px var(--disp); color: var(--gold); }
.bgst-drop span { color: var(--m); }
.bgst-toast { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 60; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--p2); border: 1px solid var(--l2); border-left: 4px solid var(--am); box-shadow: 0 20px 50px #000a; font-size: 13.5px; }
.bgst-pal-bg { position: absolute; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(3, 5, 10, .7); backdrop-filter: blur(4px); }
.bgst-pal { width: min(620px, 100%); border-radius: 16px; border: 1px solid var(--l2); background: var(--p2); box-shadow: 0 40px 100px #000; overflow: hidden; }
.bgst-pal input { width: 100%; border: 0; border-bottom: 1px solid var(--l); background: transparent; color: var(--t); padding: 16px 18px; font: 15px var(--txt); outline: none; }
.bgst-pal ul { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow-y: auto; }
.bgst-pal li button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; text-align: left; }
.bgst-pal li button.is-sel, .bgst-pal li button:hover { background: rgba(52, 209, 224, .12); }
.bgst-pal li b { display: block; font-weight: 600; font-size: 14px; }
.bgst-pal li small { display: block; color: var(--d); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.bgst-pal li em { margin-left: auto; font: 600 10px var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--d); }
.bgst-pal li span:nth-child(2) { min-width: 0; }

/* Móvil y pantallas estrechas */
@media (max-width: 900px) {
    .bgst-ib { display: inline-grid; place-items: center; }
    .bgst-body { grid-template-columns: minmax(0, 1fr) !important; }
    .bgst-side { position: absolute; top: 50px; bottom: 26px; left: 0; width: min(280px, 85vw); z-index: 40; transform: translateX(-102%); transition: transform .2s; box-shadow: 20px 0 40px #0008; }
    .bgst.is-side .bgst-side { transform: none; }
    .bgst-cmd em, .bgst-cmd kbd { display: none; }
    .bgst-cmd { flex: none; margin: 0 0 0 auto; width: 34px; padding: 0; justify-content: center; }
    .bgst-cols { grid-template-columns: minmax(0, 1fr); }
    .bgst-st span:not(.bgst-net) { display: none; }
}
@media (max-width: 560px) {
    .bgst-brand span { display: none; }
    .bgst-home__in { padding: 24px 16px 50px; }
}
@media (prefers-reduced-motion: reduce) { .bgst * { transition: none !important; animation: none !important; } }

/* Borde para cambiar el ancho de la barra lateral */
.bgst-grip { position: relative; cursor: col-resize; background: var(--l); touch-action: none; transition: background .15s; z-index: 2; }
.bgst-grip::after { content: ""; position: absolute; top: 50%; left: 1px; width: 4px; height: 36px; margin-top: -18px; border-radius: 3px; background: var(--l2); }
.bgst-grip:hover, .bgst-grip:focus-visible, .bgst.is-drag .bgst-grip { background: var(--am); outline: none; }
.bgst.is-drag, .bgst.is-drag * { cursor: col-resize !important; user-select: none; }
.bgst.is-drag iframe { pointer-events: none; }
.bgst.is-plegada .bgst-side { visibility: hidden; }
.bgst-ed, .bgst-side__in { min-width: 0; }
@media (max-width: 900px) { .bgst-grip { display: none; } .bgst.is-plegada .bgst-side { visibility: visible; } }
/* Botón de instalar resaltado al venir de «Instalar app» de la web */
#bgst-instalar { font-size: 17px; color: var(--gold); border-color: rgba(242, 163, 58, .5); }
#bgst-instalar.is-pulso { animation: bgst-pulso 1.2s ease-in-out 4; box-shadow: 0 0 0 0 rgba(242, 163, 58, .6); }
@keyframes bgst-pulso { 50% { box-shadow: 0 0 0 8px rgba(242, 163, 58, 0); background: rgba(242, 163, 58, .18); } }
/* Iconos de la barra superior (dibujados, centrados) */
.bgst-svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bgst-cmd .bgst-svg { width: 16px; height: 16px; }
.bgst-ib { padding: 0; }
.bgst-abrir { gap: 7px; }
.bgst-abrir .bgst-svg { color: var(--gold); }
.bgst-s { display: none; }
@media (max-width: 560px) { .bgst-abrir { padding: 0 11px; } .bgst-l { display: none; } .bgst-s { display: inline; } .bgst-top { gap: 8px; } .bgst-top__r { gap: 6px; } .bgst-btn--o { padding: 0 11px; } }

/* Entrar o crear cuenta sin salir del Studio */
.bgst-login { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(4, 6, 10, .74); backdrop-filter: blur(3px); }
.bgst-login__box { position: relative; width: min(420px, 100%); max-height: calc(100% - 8px); overflow: auto; padding: 22px; border-radius: 16px; border: 1px solid var(--l2); background: linear-gradient(180deg, var(--p2), var(--p)); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.bgst-login__box h2 { margin: 0 0 14px; font: 700 19px/1.25 var(--disp); text-wrap: balance; }
.bgst-login__x { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--l); background: transparent; font-size: 20px; line-height: 1; color: var(--m); }
.bgst-login__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 11px; background: var(--sunk); }
.bgst-login__tabs button { height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--m); font-weight: 600; }
.bgst-login__tabs button.is-on { background: var(--p2); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(242, 163, 58, .4); }
.bgst-login form { display: grid; gap: 12px; }
.bgst-login label { display: grid; gap: 5px; font-weight: 600; font-size: 13px; }
.bgst-login label small { font-weight: 400; color: var(--d); font-size: 12px; }
.bgst-login input:not([type=checkbox]) { height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--l2); background: var(--sunk); color: var(--t); font: 500 16px var(--txt); }
.bgst-login input:focus { outline: 0; border-color: var(--cy); box-shadow: 0 0 0 3px rgba(52, 209, 224, .15); }
.bgst-login form > .bgst-btn { justify-content: center; height: 42px; background: linear-gradient(180deg, #ffc061, var(--am)); color: #2a1a04; border: 0; font-size: 14px; }
.bgst-login__chk { display: flex !important; grid-template-columns: none; align-items: flex-start; gap: 8px; font-weight: 400 !important; color: var(--m); }
.bgst-login__chk input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--am); flex: none; }
.bgst-login a { color: var(--cy); }
.bgst-login__small { margin: 0; font-size: 12.5px; }
.bgst-login__msg { margin: 0; font-size: 13px; min-height: 1em; }
.bgst-login__msg.is-bad { color: #ff8a8a; }
.bgst-login__msg.is-ok { color: var(--ok); }
.bgst-login__done b { color: var(--ok); font: 700 16px var(--disp); }
.bgst-login__done p { color: var(--m); }
.bgst-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 560px) { .bgst-login { place-items: end stretch; padding: 0; } .bgst-login__box { width: 100%; border-radius: 18px 18px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); } }

/* Inicio: acceso al Panel de jugadores (lo que más se usa desde el móvil) */
.bgst-srvcard { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 560px; margin: 4px 0 18px; padding: 14px 16px; border-radius: 14px; cursor: pointer; text-align: left;
	background: linear-gradient(135deg, rgba(242, 163, 58, .16), rgba(52, 209, 224, .06)); border: 1px solid rgba(242, 163, 58, .4); color: #e9e4d8; font: inherit; }
.bgst-srvcard:hover { border-color: #f2a33a; }
.bgst-srvcard__i { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: linear-gradient(160deg, #ffd27a, #f2a33a); color: #2a1a04; }
.bgst-srvcard__i svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bgst-srvcard b { display: block; font: 700 1.05rem "Chakra Petch", sans-serif; }
.bgst-srvcard small { color: #9aa3b5; font-size: .85rem; }
.bgst-srvcard i { margin-left: auto; font-style: normal; font-size: 1.6rem; color: #f2a33a; }
