*{
  box-sizing:border-box;
}

:root{
  --bg:#f6f8fd;
  --card:#ffffff;
  --text:#111827;
  --muted:#778399;
  --border:#e6eaf2;
  --blue:#1d8df2;
  --blue2:#5465f5;
  --purple:#7554e9;
  --green:#20b95a;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  min-height:100vh;
  background:
    linear-gradient(180deg,#f8faff,#f4f6fb);
  color:var(--text);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button{
  font:inherit;
}

button,
a{
  -webkit-tap-highlight-color:transparent;
}

.hidden{
  display:none!important;
}

.app{
  width:100%;
  max-width:620px;
  min-height:100vh;
  margin:0 auto;

  padding:
    max(18px,env(safe-area-inset-top))
    16px
    105px;
}


/* TOP HEADER */

.topbar{
  height:62px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
}

.brand-wrap{
  display:flex;
  align-items:center;
  gap:11px;
}

.brand-wrap img{
  width:47px;
  height:47px;
  object-fit:cover;
  border-radius:15px;
  box-shadow:
    0 10px 25px rgba(48,91,210,.18);
}

.brand{
  font-size:22px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.7px;
}

.brand span{
  color:#327cf1;
}

.subtitle{
  margin-top:5px;
  color:#8a94a7;
  font-size:10px;
  font-weight:600;
}

.online{
  display:flex;
  gap:6px;
  align-items:center;
  color:#7b8799;
  font-size:10px;
  font-weight:700;
}

.online i{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#16c764;
  box-shadow:
    0 0 0 4px rgba(22,199,100,.11);
}


/* HERO */

.hero{
  position:relative;
  overflow:hidden;
  min-height:168px;
  border-radius:27px;
  padding:22px;

  background:
    linear-gradient(
      135deg,
      #1592ef 0%,
      #3472e9 53%,
      #7054e8 100%
    );

  box-shadow:
    0 18px 42px rgba(54,91,213,.20);
}

.hero:before{
  content:"";
  position:absolute;
  width:190px;
  height:190px;
  right:-65px;
  top:-78px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.18);
}

.hero-copy{
  position:relative;
  z-index:2;
  width:72%;
}

.hero-pill{
  display:inline-block;
  padding:5px 9px;
  color:#fff;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.24);
  background:rgba(255,255,255,.13);
  font-size:9px;
  font-weight:800;
}

.hero h1{
  margin:12px 0 7px;
  color:#fff;
  font-size:25px;
  line-height:1.08;
  letter-spacing:-.8px;
}

.hero p{
  margin:0;
  color:rgba(255,255,255,.78);
  font-size:11px;
  line-height:1.45;
}

.hero-button{
  margin-top:15px;
  padding:10px 13px;
  display:inline-flex;
  align-items:center;
  gap:22px;
  border:0;
  border-radius:12px;
  color:#2862d2;
  background:#fff;
  font-size:10px;
  font-weight:850;
  box-shadow:
    0 8px 20px rgba(24,52,143,.12);
}

.hero-art{
  position:absolute;
  right:19px;
  top:50%;
  transform:translateY(-50%);
}

.hero-circle{
  width:72px;
  height:72px;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:30px;
  border-radius:22px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter:blur(10px);
}


/* SECTIONS */

.community-section{
  margin-top:26px;
}

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:13px;
}

.section-title{
  display:flex;
  align-items:center;
  gap:10px;
}

.platform-icon{
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  color:#fff;
  border-radius:12px;
  font-size:16px;
  box-shadow:
    0 8px 20px rgba(37,99,235,.14);
}

.telegram-icon{
  background:
    linear-gradient(
      135deg,
      #22aeef,
      #3376e8
    );
}

.whatsapp-icon{
  background:
    linear-gradient(
      135deg,
      #27ca68,
      #159348
    );
}

.section-title h2{
  margin:0;
  font-size:17px;
  line-height:1.15;
  letter-spacing:-.3px;
}

.section-title p{
  margin:3px 0 0;
  color:#929cad;
  font-size:10px;
}

.view-all{
  border:0;
  color:#347eea;
  background:transparent;
  font-size:10px;
  font-weight:800;
}


/* COMMUNITY CARDS */

.community-grid{
  display:grid;
  grid-template-columns:
    repeat(2,minmax(0,1fr));
  gap:13px;
}

.community-card{
  min-width:0;
  overflow:hidden;

  display:flex;
  flex-direction:column;

  padding:10px;

  border:1px solid var(--border);
  border-radius:20px;

  background:#fff;

  box-shadow:
    0 10px 30px rgba(25,47,91,.07);
}

.community-image,
.community-placeholder{
  width:100%;
  aspect-ratio:1.28/1;
  border-radius:15px;
}

.community-image{
  object-fit:cover;
  background:#edf1f8;
}

.community-placeholder{
  display:grid;
  place-items:center;
  font-size:31px;
  color:#fff;

  background:
    linear-gradient(
      135deg,
      #22a7ed,
      #5265ec
    );
}

.community-card.whatsapp .community-placeholder{
  background:
    linear-gradient(
      135deg,
      #2bcc6d,
      #16934a
    );
}

.community-card h3{
  margin:11px 2px 4px;
  color:#172033;
  font-size:13px;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.card-type{
  margin:0 2px;
  color:#9099a9;
  font-size:9px;
}

.join-btn{
  margin-top:11px;
  padding:10px;

  display:flex;
  align-items:center;
  justify-content:space-between;

  border-radius:11px;

  text-decoration:none;

  color:#fff;

  font-size:9px;
  font-weight:850;

  background:
    linear-gradient(
      135deg,
      #218fed,
      #6259e8
    );
}

.community-card.whatsapp .join-btn{
  background:
    linear-gradient(
      135deg,
      #23bb60,
      #168e49
    );
}


/* PAGE */

.page{
  display:none;
}

.page.active{
  display:block;
  animation:fadePage .18s ease;
}

@keyframes fadePage{
  from{
    opacity:0;
    transform:translateY(5px);
  }

  to{
    opacity:1;
    transform:none;
  }
}

.page-header{
  min-height:88px;

  display:flex;
  align-items:center;
  gap:13px;

  padding:17px;

  margin-bottom:18px;

  border-radius:22px;

  color:#fff;

  box-shadow:
    0 14px 32px rgba(43,83,194,.16);
}

.telegram-header{
  background:
    linear-gradient(
      135deg,
      #1b98ee,
      #5e5ae7
    );
}

.whatsapp-header{
  background:
    linear-gradient(
      135deg,
      #24bd61,
      #168e49
    );
}

.page-header-icon{
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border-radius:16px;
  background:rgba(255,255,255,.14);
  font-size:22px;
}

.page-header h1{
  margin:0;
  font-size:20px;
}

.page-header p{
  margin:4px 0 0;
  color:rgba(255,255,255,.75);
  font-size:10px;
}


/* BOTTOM NAVIGATION */

.bottom-nav{
  position:fixed;
  z-index:50;

  left:50%;
  transform:translateX(-50%);

  bottom:
    max(12px,env(safe-area-inset-bottom));

  width:
    min(calc(100% - 24px),596px);

  display:flex;
  align-items:center;

  gap:4px;

  padding:7px;

  border:1px solid #e3e8f2;

  border-radius:24px;

  background:rgba(255,255,255,.96);

  backdrop-filter:blur(20px);

  box-shadow:
    0 16px 45px rgba(31,51,91,.15);
}

.nav-item{
  flex:1;
  min-width:0;
  height:58px;

  border:0;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  gap:3px;

  border-radius:17px;

  color:#8c96a7;
  background:transparent;
}

.nav-item > span{
  font-size:19px;
  line-height:1;
}

.nav-item small{
  font-size:8px;
  font-weight:800;
  white-space:nowrap;
}

.nav-item.active{
  color:#287cea;

  background:
    linear-gradient(
      135deg,
      #edf5ff,
      #f2efff
    );
}


/* NOTIFICATION MODAL */

.modal{
  position:fixed;
  z-index:500;

  inset:0;

  display:flex;
  align-items:center;
  justify-content:center;

  padding:20px;
}

.modal-overlay{
  position:absolute;
  inset:0;

  background:rgba(15,23,42,.48);

  backdrop-filter:blur(6px);
}

.modal-box{
  position:relative;
  z-index:2;

  width:min(100%,350px);

  padding:26px 21px 18px;

  text-align:center;

  border-radius:25px;

  background:#fff;

  box-shadow:
    0 30px 80px rgba(15,23,42,.24);
}

.modal-bell{
  width:60px;
  height:60px;

  margin:0 auto;

  display:grid;
  place-items:center;

  border-radius:18px;

  font-size:26px;

  background:
    linear-gradient(
      135deg,
      #eaf3ff,
      #efebff
    );
}

.modal-box h2{
  margin:15px 0 7px;
  font-size:20px;
}

.modal-box p{
  margin:0 auto 18px;

  max-width:285px;

  color:#7d8798;

  font-size:11px;
  line-height:1.55;
}

.modal-primary,
.modal-secondary{
  width:100%;
  border:0;
  border-radius:12px;
  padding:12px;
  font-size:10px;
  font-weight:850;
}

.modal-primary{
  color:#fff;

  background:
    linear-gradient(
      135deg,
      #238ded,
      #6358e7
    );
}

.modal-secondary{
  margin-top:7px;
  color:#8a94a5;
  background:#f6f7fa;
}

.modal-close{
  position:absolute;
  top:11px;
  right:13px;

  border:0;
  background:transparent;

  color:#9ba3b0;

  font-size:22px;
}


/* SMALL DEVICES */

@media(max-width:380px){

  .app{
    padding-left:12px;
    padding-right:12px;
  }

  .hero{
    min-height:158px;
  }

  .hero h1{
    font-size:22px;
  }

  .hero-circle{
    width:61px;
    height:61px;
  }

  .community-grid{
    gap:9px;
  }

}


/* ==========================
   PREMIUM COMMUNITY UPGRADE
========================== */

.community-grid{
  gap:16px;
}

.community-card{
  padding:0;
  border-radius:22px;
  overflow:hidden;

  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fbfcff 100%
    );

  border:
    1px solid #e8edf5;

  box-shadow:
    0 10px 24px rgba(35,55,90,.06),
    0 2px 6px rgba(35,55,90,.04);

  transform:
    translateY(0)
    scale(1);

  transition:
    transform .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;

  animation:
    cardEnter .45s ease both;
}

.community-card:nth-child(2){
  animation-delay:.06s;
}

.community-card:nth-child(3){
  animation-delay:.12s;
}

.community-card:nth-child(4){
  animation-delay:.18s;
}

@keyframes cardEnter{
  from{
    opacity:0;
    transform:
      translateY(12px)
      scale(.98);
  }

  to{
    opacity:1;
    transform:
      translateY(0)
      scale(1);
  }
}

.community-card:active{
  transform:
    scale(.985);
}

@media(hover:hover){

  .community-card:hover{
    transform:
      translateY(-4px);

    border-color:
      #d8e5fb;

    box-shadow:
      0 18px 38px rgba(33,71,135,.12);
  }

}


/* IMAGE */

.community-image-link{
  position:relative;
  display:block;
  overflow:hidden;

  margin:10px 10px 0;

  border-radius:17px;

  text-decoration:none;
}

.community-image,
.community-placeholder{
  display:block;

  width:100%;

  aspect-ratio:
    1.34 / 1;

  border-radius:17px;

  transition:
    transform .35s ease,
    filter .35s ease;
}

.community-image{
  object-fit:cover;
}

.community-image-link:active
.community-image{
  transform:
    scale(1.025);
}

@media(hover:hover){

  .community-image-link:hover
  .community-image{
    transform:
      scale(1.045);
  }

}

.image-overlay{
  position:absolute;

  right:10px;
  bottom:10px;

  width:34px;
  height:34px;

  display:grid;
  place-items:center;

  border-radius:11px;

  color:white;

  background:
    rgba(17,32,62,.70);

  border:
    1px solid rgba(255,255,255,.35);

  backdrop-filter:
    blur(10px);

  box-shadow:
    0 6px 18px rgba(0,0,0,.16);
}

.image-overlay span{
  font-size:15px;
}


/* BODY */

.community-body{
  padding:
    13px 13px 14px;
}

.community-topline{
  display:flex;
  align-items:center;
  gap:7px;
}

.community-card h3{
  margin:0;

  flex:1;

  font-size:14px;
  line-height:1.2;

  font-weight:850;

  color:#172033;

  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.verified-mini{
  width:18px;
  height:18px;

  display:grid;
  place-items:center;

  border-radius:50%;

  color:#fff;
  background:#2e8ef0;

  font-size:9px;
  font-weight:900;

  box-shadow:
    0 4px 10px rgba(46,142,240,.22);
}

.card-type{
  margin-top:5px;

  color:#8a95a6;

  font-size:9px;
  font-weight:600;
}


/* JOIN BUTTON */

.join-btn{
  margin-top:13px;

  min-height:45px;

  display:flex;
  align-items:center;
  justify-content:space-between;

  padding:
    8px 10px 8px 8px;

  border-radius:14px;

  color:#fff;

  text-decoration:none;

  background:
    linear-gradient(
      135deg,
      #139af3 0%,
      #3477ef 50%,
      #6658eb 100%
    );

  box-shadow:
    0 9px 20px rgba(54,104,225,.22);

  transition:
    transform .18s ease,
    box-shadow .18s ease,
    filter .18s ease;
}

.community-card.whatsapp
.join-btn{
  background:
    linear-gradient(
      135deg,
      #2aca69 0%,
      #20b75c 50%,
      #14904a 100%
    );

  box-shadow:
    0 9px 20px rgba(29,167,85,.20);
}

.join-btn:active{
  transform:
    scale(.97);

  box-shadow:
    0 5px 12px rgba(54,104,225,.18);
}

@media(hover:hover){

  .join-btn:hover{
    transform:
      translateY(-1px);

    filter:
      brightness(1.04);

    box-shadow:
      0 12px 24px rgba(54,104,225,.27);
  }

}

.join-left{
  display:flex;
  align-items:center;
  gap:8px;

  font-size:10px;
  font-weight:850;
}

.join-icon{
  width:29px;
  height:29px;

  display:grid;
  place-items:center;

  border-radius:9px;

  background:
    rgba(255,255,255,.16);

  border:
    1px solid rgba(255,255,255,.16);

  font-size:12px;
}

.join-arrow{
  width:29px;
  height:29px;

  display:grid;
  place-items:center;

  border-radius:9px;

  background:
    rgba(255,255,255,.15);

  font-size:14px;

  transition:
    transform .2s ease;
}

.join-btn:active
.join-arrow{
  transform:
    translateX(3px);
}


/* SLIGHTLY BIGGER CARDS ON NORMAL PHONES */

@media(min-width:390px){

  .community-card h3{
    font-size:15px;
  }

  .card-type{
    font-size:10px;
  }

  .join-left{
    font-size:11px;
  }

  .join-btn{
    min-height:48px;
  }

}


/* KEEP TWO CARDS PER ROW */

@media(max-width:370px){

  .community-grid{
    gap:10px;
  }

  .community-body{
    padding:
      10px 10px 12px;
  }

  .community-image-link{
    margin:
      8px 8px 0;
  }

}

/* ===== PREMIUM TELEGRAM ICON ===== */

.telegram-icon,
.page-header-icon.telegram-premium{
  position:relative;
  overflow:hidden;
  background:linear-gradient(145deg,#32b5f3,#1689d8)!important;
  border-radius:50%!important;
  box-shadow:
    0 9px 22px rgba(20,145,216,.25),
    inset 0 1px 1px rgba(255,255,255,.35);
}

.telegram-icon{
  font-size:0!important;
}

.telegram-icon::after{
  content:"";
  width:21px;
  height:18px;
  display:block;
  background:#fff;
  clip-path:polygon(
    3% 45%,
    96% 4%,
    74% 94%,
    49% 69%,
    35% 83%,
    38% 62%
  );
  transform:rotate(-4deg);
}


/* ===== HERO FULL CLICK ===== */

.hero{
  cursor:pointer;
  transition:
    transform .18s ease,
    box-shadow .18s ease;
}

.hero:active{
  transform:scale(.985);
}

.hero::after{
  content:"Tap to view all communities  →";
  position:absolute;
  right:20px;
  bottom:15px;
  color:rgba(255,255,255,.62);
  font-size:9px;
  font-weight:700;
}


/* ===== SMALLER PREMIUM CARDS ===== */

.community-grid{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;
}

.community-card{
  padding:8px!important;
  border-radius:18px!important;
  box-shadow:
    0 10px 25px rgba(32,61,119,.08)!important;
}

.community-image,
.community-placeholder{
  aspect-ratio:1.38/1!important;
  border-radius:13px!important;
}

.community-card h3{
  margin:9px 2px 3px!important;
  font-size:12px!important;
  line-height:1.25!important;

  white-space:normal!important;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.card-type{
  font-size:8px!important;
}

.join-btn{
  min-height:41px!important;
  margin-top:9px!important;
  padding:0 8px 0 11px!important;
  border-radius:12px!important;
  font-size:9px!important;
}

.join-btn-arrow{
  width:25px!important;
  height:25px!important;
}

.card-open-badge{
  height:24px!important;
  padding:0 8px!important;
  right:7px!important;
  bottom:7px!important;
  font-size:8px!important;
}


/* Card image soft zoom */

.card-cover-link{
  overflow:hidden;
  border-radius:13px;
}

.community-image{
  transition:
    transform .25s ease,
    filter .25s ease!important;
}

.card-cover-link:active .community-image{
  transform:scale(1.05)!important;
  filter:brightness(.92);
}


/* Remove old single-column mobile rule */

@media(max-width:470px){

  .community-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }

  .community-card{
    min-width:0!important;
  }

}

@media(max-width:350px){

  .community-grid{
    gap:7px!important;
  }

  .community-card{
    padding:7px!important;
  }

  .join-btn{
    font-size:8px!important;
  }

}
