/* Divertido Aprendo / Braisjo V90 — interfaz visual exclusivamente.
   CSS añadido al final de la V89. No requiere JS y no modifica datos ni eventos. */
:root{
  --v90-ink:#04152d; --v90-navy:#071d3d; --v90-panel:#09274d;
  --v90-blue:#0b3969; --v90-gold:#f1c65d; --v90-sky:#4bd2ff;
  --v90-text:#f4f8ff; --v90-muted:#c3d8ef;
  --v90-edge:rgba(93,171,244,.30);
  --v90-shadow:0 18px 42px rgba(0,4,20,.27);
}
/* Only the community section is redesigned; no global navigation or application logic changes. */
#comunidad.social-section{
  position:relative;isolation:isolate;
  padding-top:28px!important;padding-bottom:34px!important;
  background:radial-gradient(ellipse at 5% 22%,rgba(28,124,214,.22),transparent 38%),
             radial-gradient(ellipse at 95% 62%,rgba(217,162,69,.10),transparent 38%),
             linear-gradient(180deg,#04152e,#05172d 100%);
}
#comunidad::before{content:"";position:absolute;left:0;top:62px;width:min(40vw,480px);height:1px;z-index:-1;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(60,201,255,.5),transparent);box-shadow:0 0 30px 3px rgba(35,168,243,.14)}
#comunidad::after{content:"";position:absolute;right:0;top:70px;width:min(28vw,300px);height:1px;z-index:-1;pointer-events:none;background:linear-gradient(90deg,transparent,rgba(241,198,93,.35),transparent);box-shadow:0 0 24px 2px rgba(241,198,93,.12)}
/* The large promotional hero is de-emphasized visually; the actual community becomes the focal point. */
#comunidad>.social-intro{display:none!important}
#comunidad .social-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(290px,328px);gap:18px;align-items:start}
#comunidad .social-main{display:flex;flex-direction:column;gap:14px;min-width:0}
/* The existing DOM stays untouched. Flex order places chat ahead of discovery and composer. */
#comunidad #socialPosts{order:0;display:flex;flex-direction:column;gap:14px;min-width:0}
#comunidad #socialPosts>.braisjo-conversation{order:0}
#comunidad #socialPosts>.social-post{order:2}
#comunidad #socialPosts>.bc-sponsored{order:3}
#comunidad .social-main>.composer-card{order:1}
#comunidad .social-main>.social-discovery{order:2}
#comunidad .social-main>.social-discovery,#comunidad .social-main>.composer-card{margin-top:4px}
#comunidad .social-sidebar{display:flex;flex-direction:column;gap:12px;position:sticky;top:92px;min-width:0}
#comunidad .braisjo-conversation,#comunidad .join-card,#comunidad .trend-card,#comunidad .people-card,#comunidad .social-post,#comunidad .composer-card,#comunidad .social-discovery,#comunidad .bc-sponsored{
  border-radius:25px!important;border:1px solid var(--v90-edge)!important;
  background:linear-gradient(158deg,rgba(10,44,85,.98),rgba(5,25,54,.99) 70%)!important;
  box-shadow:var(--v90-shadow)!important;color:var(--v90-text);
}
/* Main chat panel, aligned with the approved mockup */
#comunidad .braisjo-conversation{position:relative;overflow:hidden;margin:0!important;isolation:isolate}
#comunidad .braisjo-conversation::before{content:"";pointer-events:none;position:absolute;top:0;right:0;width:63%;height:145px;z-index:-1;background:radial-gradient(ellipse at 65% 40%,rgba(38,190,251,.27),transparent 55%)}
#comunidad .braisjo-conversation::after{content:"";position:absolute;right:35px;top:84px;width:190px;height:54px;transform:rotate(-13deg);border-radius:50%;border-top:1px solid rgba(79,207,255,.29);pointer-events:none;z-index:-1}
#comunidad .bc-head{padding:24px 22px 17px;gap:15px;background:transparent!important;align-items:center;position:relative}
#comunidad .bc-brand-icon{width:70px;height:70px;flex:0 0 70px;border-radius:50%;padding:5px;background:linear-gradient(145deg,#ffe196,#dfad47);box-shadow:0 9px 26px rgba(246,192,66,.24)}
#comunidad .bc-brand-icon img{border-radius:50%}
#comunidad .bc-overline{font-size:10px!important;font-weight:850;letter-spacing:.16em!important;color:var(--v90-gold)!important}
#comunidad .bc-head h3{font-size:clamp(27px,3.1vw,39px);line-height:1.02;margin:6px 0 7px;font-weight:900;letter-spacing:-.035em;color:#fff}
#comunidad .bc-head h3 span{color:var(--v90-gold)}
#comunidad .bc-head p{color:#d8e7fa;font-size:12px;line-height:1.4}
#comunidad .bc-shield{margin-left:auto;align-self:start;white-space:nowrap;border:1px solid rgba(60,219,162,.35);border-radius:999px;background:rgba(7,105,81,.34);padding:10px 13px;color:#d8ffef;font-size:10px}
#comunidad .bc-session-panel{border-radius:14px;margin:0 19px 14px;background:linear-gradient(90deg,rgba(5,67,73,.86),rgba(6,46,67,.86));border:1px solid rgba(55,181,167,.28);padding:10px 13px}
#comunidad .bc-session-panel[hidden]{display:none!important}
#comunidad .bc-session-panel button{background:linear-gradient(135deg,#ffda80,#eab94e);border-radius:10px;color:#09203c;font-weight:850}
#comunidad .bc-tabs{padding:0 19px 13px;gap:10px}
#comunidad .bc-tabs button{min-height:49px;background:linear-gradient(180deg,rgba(12,49,88,.98),rgba(8,30,62,.97));border:1px solid rgba(102,166,227,.28);border-radius:14px;padding:12px 14px;color:#eaf4ff;font-size:12px;font-weight:850;transition:background .18s,border-color .18s,box-shadow .18s}
#comunidad .bc-tabs button.active{background:linear-gradient(135deg,#ffe08d,#efbd53);color:#091d35;border-color:#f9d477;box-shadow:0 8px 20px rgba(248,195,82,.26)}
#comunidad .bc-tabs button:focus-visible,#comunidad .bc-join:focus-visible{outline:3px solid #fff3bf;outline-offset:2px}
#comunidad .bc-tabs button:hover:not(.active){background:#16416e;border-color:rgba(131,205,255,.5)}
#comunidad .bc-view{margin:0 19px 14px;border:1px solid rgba(104,177,241,.26);border-radius:19px;background:linear-gradient(180deg,#082a54,#061e3e);overflow:hidden}
#comunidad .bc-view[hidden]{display:none!important}
#comunidad .bc-chatbar{display:flex;gap:10px;align-items:center;border-bottom:1px solid rgba(105,169,229,.24);background:linear-gradient(180deg,rgba(65,151,225,.10),rgba(17,71,121,.04));padding:13px 15px}
#comunidad .bc-avatar{width:43px;height:43px;background:linear-gradient(155deg,#e9c167,#876a35);color:#fff9d9;box-shadow:0 5px 15px rgba(0,0,0,.16)}
#comunidad .bc-chatbar strong{font-size:16px;color:#fff}
#comunidad .bc-chatbar small{font-size:11px;color:#c2d8f0}
#comunidad .bc-chat-tag{font-size:10px;border-radius:999px;border:1px solid rgba(129,199,255,.30);background:#103b6a;color:#e5f4ff;padding:7px 10px}
#comunidad #bcLiveMessages{max-height:315px;min-height:220px;overflow-y:auto;overscroll-behavior:contain;padding:17px 15px 14px;gap:12px;scrollbar-color:#296194 transparent;scrollbar-width:thin}
#comunidad .bc-message{gap:11px;align-items:start}
#comunidad .bc-msg-avatar{width:39px;height:39px;background:linear-gradient(145deg,#42a2ee,#1467a9);border:2px solid rgba(202,231,255,.2);box-shadow:0 5px 13px rgba(0,0,0,.17)}
#comunidad .bc-message strong{font-size:11px!important;color:#f3f8ff}
#comunidad .bc-chat-username{color:#e7f0ff!important;font-weight:800}
#comunidad .bc-message p{padding:12px 15px;margin:6px 0 0;max-width:630px;font-size:12px;line-height:1.45;color:#fff;border-radius:13px;background:linear-gradient(170deg,#2a568a,#18375e);border:1px solid rgba(116,182,245,.26);box-shadow:0 6px 14px rgba(0,9,28,.14)}
#comunidad .bc-message-own{flex-direction:row-reverse}
#comunidad .bc-message-own .bc-chat-username{text-align:right;color:#ffe4a2!important}
#comunidad .bc-message-own p{background:linear-gradient(135deg,#bb8b3c,#8b632c);border-color:rgba(255,216,125,.36);color:#fff9ef;border-radius:13px}
#comunidad .bc-message-own .bc-msg-avatar{background:linear-gradient(135deg,#f8d577,#a87f33)}
#comunidad .bc-compose{padding:11px 13px;border-top:1px solid rgba(107,177,243,.20);background:rgba(4,24,48,.52);gap:8px}
#comunidad .bc-compose input{min-height:44px;border:1px solid rgba(120,187,240,.35);border-radius:13px;background:rgba(17,52,88,.98);color:#fff;font-size:12px;padding:0 14px}
#comunidad .bc-compose input:focus{border-color:#f0c65d;outline:2px solid rgba(241,198,93,.25);outline-offset:0}
#comunidad .bc-attach button{min-width:41px;height:43px;border:1px solid rgba(125,187,239,.26);border-radius:12px;background:linear-gradient(165deg,#194c7b,#0c3058)}
#comunidad .bc-send{min-width:49px;height:44px;border-radius:12px;background:linear-gradient(140deg,#ffdc7d,#ecb845);box-shadow:0 6px 17px rgba(244,195,75,.24);color:#081d36;font-weight:900}
#comunidad .bc-smallprint{font-size:10px;color:#a9c1dd;padding:0 15px 12px}
#comunidad .bc-footer{padding:4px 19px 17px}
#comunidad .bc-footer strong{font-size:12px;color:#eff7ff}
#comunidad .bc-footer small{font-size:10px;color:#b6cce3}
#comunidad .bc-join,#comunidad .bc-media-tile button{border-radius:11px;background:linear-gradient(135deg,#ffe091,#edbd55);color:#071e38;font-weight:850}
#comunidad .bc-media-grid{gap:12px}
#comunidad .bc-media-tile,#comunidad .bc-rules p{border:1px solid rgba(113,184,246,.20);background:#113861;border-radius:15px}
/* Real Supabase social profile, posts, media and comments: styling only */
#comunidad .bc-social-panel,#comunidad .bc-gallery-section,#comunidad .bc-upload-preview{margin:13px 12px;border:1px solid rgba(104,179,244,.25);border-radius:17px;background:linear-gradient(160deg,#10365f,#082447);color:#f2f7ff;box-shadow:0 7px 18px rgba(0,0,0,.14)}
#comunidad .bc-social-heading strong,#comunidad .bc-gallery-head strong{color:#ffdb83;font-size:16px}
#comunidad .bc-social-heading span,#comunidad .bc-gallery-head p{color:#b9d1eb}
#comunidad .bc-social-profile-fields input,#comunidad .bc-social-comment-form input,#comunidad .bc-publisher textarea,#comunidad .bc-publisher select{border:1px solid rgba(119,184,244,.30);border-radius:12px;background:#092448;color:#f1f7ff;padding:10px}
#comunidad .bc-social-save,#comunidad .bc-social-comment-form button{background:linear-gradient(135deg,#ffe091,#edbd55)!important;color:#091f39!important;border:0;border-radius:11px;padding:10px 14px;font-weight:850}
#comunidad .bc-social-avatar{border-color:rgba(248,202,91,.45)}
#comunidad .bc-gallery-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#comunidad .bc-post-card{background:linear-gradient(160deg,#103760,#071f3f);border:1px solid rgba(99,171,244,.25);border-radius:17px;overflow:hidden;box-shadow:0 9px 24px rgba(0,0,0,.19)}
#comunidad .bc-post-media img,#comunidad .bc-post-media video{max-width:100%;object-fit:contain}
#comunidad .bc-post-bottom button,#comunidad .bc-gallery-head button,#comunidad .bc-social-actions button{border:1px solid rgba(111,181,242,.25);border-radius:999px;padding:9px 11px;background:#123b67;color:#f5f9ff}
#comunidad .bc-social-actions .bc-social-like.active{background:rgba(244,107,138,.15);color:#ffd4dd;border-color:rgba(244,107,138,.4)}
#comunidad .bc-social-comments{border-top-color:rgba(119,186,244,.21)}
#comunidad .bc-social-comment{border-radius:10px;background:rgba(29,73,115,.3);padding:7px 10px}
/* Right rail, visually matching the approved reference, no fake session or counts. */
#comunidad .join-card{position:relative;overflow:hidden;padding:23px 19px 19px;background:radial-gradient(ellipse at 95% 6%,rgba(241,198,93,.20),transparent 36%),linear-gradient(155deg,#123d74,#072145 72%)!important}
#comunidad .join-card::before{content:"";pointer-events:none;position:absolute;right:10px;top:38px;width:94px;height:86px;opacity:.82;background:radial-gradient(circle at 40% 28%,#ffd777 0 12px,transparent 13px),radial-gradient(circle at 75% 36%,#ffd777 0 10px,transparent 11px),radial-gradient(ellipse at 42% 85%,#e7b74d 0 30px,transparent 31px)}
#comunidad .join-card::after{content:"";pointer-events:none;position:absolute;right:2px;top:82px;width:116px;height:40px;border-bottom:2px solid rgba(66,211,255,.65);border-radius:50%;transform:rotate(-10deg);filter:drop-shadow(0 0 8px rgba(66,211,255,.38))}
#comunidad .join-card .eyebrow{color:#ffd46b;font-size:10px;letter-spacing:.17em}
#comunidad .join-card h3{font-size:clamp(25px,2.4vw,32px);line-height:1.03;letter-spacing:-.035em;margin:14px 0 14px;max-width:210px;color:#fff}
#comunidad .join-card p{margin:0 0 16px;color:#e3eefb;font-size:12px;line-height:1.52;max-width:270px}
#comunidad .social-auth{min-height:45px;margin:7px 0;border-radius:13px;font-size:12px;font-weight:850;border-color:rgba(141,190,241,.29);transition:transform .18s,box-shadow .18s}
#comunidad .social-auth:hover{transform:translateY(-1px);box-shadow:0 7px 17px rgba(0,0,0,.15)}
#comunidad .social-auth.google{background:#fff;color:#112844}
#comunidad .social-auth.whatsapp{background:linear-gradient(135deg,#25d87c,#13ad62);color:#fff}
#comunidad .social-auth.email{background:linear-gradient(145deg,#1d4b7b,#0d3159);color:#f4f9ff}
#comunidad .join-card>small{color:#9eb8d3;line-height:1.45}
#comunidad .bc-sidebar-identity{border:1px solid rgba(63,211,163,.28);background:rgba(8,83,72,.48);color:#e9fff6;border-radius:12px;font-size:11px;padding:10px 11px}
#comunidad .trend-card,#comunidad .people-card{padding:20px;background:linear-gradient(170deg,#0d3566,#082348)!important}
#comunidad .trend-card h4,#comunidad .people-card h4{font-size:18px;margin:0 0 11px;color:#fff}
#comunidad .trend-card a{border:1px solid rgba(110,188,248,.26);border-radius:999px;padding:9px 12px;background:rgba(30,82,134,.35);margin:7px 4px 4px 0;display:inline-flex;flex-direction:column;gap:3px;color:#f2f7ff}
#comunidad .trend-card b{font-size:11px;color:#f7faff}
#comunidad .trend-card span{font-size:10px;color:#accce9}
#comunidad .people-card>div{gap:8px}
#comunidad .people-card .follow-btn{border-radius:999px;background:rgba(241,198,93,.09);border-color:rgba(241,198,93,.30);color:#ffe2a2}
/* Existing local demo content is visually separated from the real Supabase gallery. */
#comunidad #socialPosts>.social-post{margin-top:3px}
#comunidad #socialPosts>.social-post::before{content:"PUBLICACIÓN DE EJEMPLO";display:block;padding:10px 15px 0;color:#b9d2ee;font-size:10px;letter-spacing:.12em;font-weight:850}
#comunidad #socialPosts>.social-post header{padding:11px 14px 9px}
#comunidad #socialPosts>.social-post .post-copy{padding:0 14px 12px}
#comunidad #socialPosts>.social-post .post-actions{border-top:1px solid rgba(112,178,238,.18)}
#comunidad .composer-card{border-radius:22px;padding:15px}
#comunidad .composer-prompt{border:1px solid rgba(106,181,246,.27);border-radius:999px;background:#0b2f5a;color:#d9e7fb}
#comunidad .social-discovery{padding:14px;overflow:hidden}
#comunidad .social-controlbar{border-color:rgba(106,181,246,.21)}
#comunidad .feed-tabs button{border-radius:999px}
#comunidad .feed-tabs button.active{background:#f0c65d;color:#081c37}
/* Avoid styling outside this section; preserve authored hidden states. */
#comunidad [hidden]{display:none!important}
@media(max-width:1000px){#comunidad .social-layout{grid-template-columns:1fr}#comunidad .social-sidebar{position:static;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}#comunidad .join-card{grid-row:span 2}}
@media(max-width:680px){#comunidad .social-layout{gap:13px}#comunidad .social-sidebar{grid-template-columns:1fr}#comunidad .join-card{grid-row:auto}#comunidad .bc-head{flex-wrap:wrap;padding:18px 13px 15px}#comunidad .bc-brand-icon{width:54px;height:54px;flex-basis:54px}#comunidad .bc-head h3{font-size:26px}#comunidad .bc-shield{margin-left:0}#comunidad .bc-tabs{padding:0 10px 12px;gap:6px}#comunidad .bc-tabs button{padding:10px 8px;font-size:11px}#comunidad .bc-view{margin:0 10px 12px}#comunidad .bc-chatbar{flex-wrap:wrap}#comunidad #bcLiveMessages{max-height:370px}#comunidad .bc-message p{font-size:12px}#comunidad .bc-message-own{margin-left:10px}#comunidad .bc-footer{flex-direction:column;align-items:stretch}#comunidad .bc-join{width:100%}#comunidad .bc-gallery-grid{grid-template-columns:1fr}#comunidad .join-card h3{max-width:260px}}
@media(prefers-reduced-motion:reduce){#comunidad button{transition:none!important}}
/* Both existing email entry modes use the same original auth modal. */
#comunidad .join-card #bcSidebarJoin::after{content:" · Iniciar sesión";font-weight:850}


/* V90.1: simplificacion segura sin cambiar la logica V89 */
/* Registro principal incorporado al chat; el modal original y sus controles siguen intactos. */
#comunidad .join-card{display:none!important}
#comunidad .bc-v90-access{
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  margin:0 18px 15px;padding:15px 18px;
  border:1px solid rgba(109,190,255,.30);border-radius:17px;
  background:linear-gradient(120deg,rgba(14,60,101,.84),rgba(9,37,72,.94));
  box-shadow:0 7px 20px rgba(0,0,0,.12)
}
#comunidad .bc-v90-access-copy{display:grid;gap:4px;min-width:0}
#comunidad .bc-v90-access-copy strong{color:#fff;font-size:14px}
#comunidad .bc-v90-access-copy span{color:#c1d8ed;font-size:11px;line-height:1.5}
#comunidad .bc-v90-access-button{
  flex:0 0 auto;min-height:43px;padding:10px 16px;
  border:0;border-radius:12px;color:#0b243e;font-weight:850;font-size:12px;cursor:pointer;
  background:linear-gradient(135deg,#ffdf8d,#eab94d);
  box-shadow:0 7px 16px rgba(237,188,69,.19)
}
#comunidad .bc-v90-access-button:hover{filter:brightness(1.06)}
#comunidad #braisjoConversation[data-authenticated="true"] .bc-v90-access{display:none!important}
/* La sesion autenticada y el boton original para cerrarla quedan en #bcSessionPanel. */
/* La publicacion local de demostracion no pertenece al muro persistente de Supabase. */
#comunidad #socialPosts > .social-post[data-category="videos noticias"]{display:none!important}
/* Al retirar la tarjeta promocional, el lateral muestra solamente contenido restante. */
#comunidad .social-sidebar{align-content:start}
@media (max-width:680px){
  #comunidad .bc-v90-access{flex-direction:column;align-items:stretch;margin:0 10px 12px;padding:13px}
  #comunidad .bc-v90-access-button{width:100%}
}

/* V90.5: contador de visitas discreto, responsive, sin cambiar la lógica social */
#comunidad .bc-head-right{display:flex;flex-direction:column;align-items:flex-end;gap:9px;margin-left:auto;min-width:168px}
#comunidad .bc-head-right .bc-shield{margin-left:0;align-self:auto}
#comunidad .bc-visits{display:flex;align-items:center;gap:10px;padding:9px 13px;border:1px solid rgba(247,199,102,.35);background:linear-gradient(120deg,rgba(247,199,102,.12),rgba(33,90,144,.14));border-radius:13px;color:#fff;min-width:160px}
#comunidad .bc-visits-icon{color:#ffd270;font-size:20px;line-height:1}
#comunidad .bc-visits-copy{display:flex;flex-direction:column;gap:1px}
#comunidad .bc-visits strong{font-size:19px;line-height:1.15;color:#ffd270;font-variant-numeric:tabular-nums}
#comunidad .bc-visits small{font-size:10px;color:#daeafa;line-height:1.2}
@media(max-width:680px){#comunidad .bc-head-right{width:100%;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-left:0;min-width:0}#comunidad .bc-visits{min-width:148px}}
