*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  width:100%;
  height:100%;
  overflow:hidden;
}

body{
  font-family:Arial,sans-serif;
  background:linear-gradient(135deg,#0f172a,#1e1b4b,#312e81);
  color:#fff;
}

/* GLOBAL */
.hidden{
  display:none !important;
}

button{
  border:none;
  cursor:pointer;
  font-family:inherit;
}

button:disabled{
  opacity:.45;
  cursor:not-allowed;
}

input,
select{
  font-family:inherit;
  outline:none;
}

/* START SCREEN */
.startScreen{
  width:100%;
  height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.startCard{
  width:100%;
  max-width:720px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.14);
  border-radius:26px;
  padding:28px;
  box-shadow:0 24px 80px rgba(0,0,0,.38);
}

.brandRow{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:24px;
}

h1{
  margin:0;
  font-size:clamp(30px,5vw,52px);
  line-height:1.05;
}

p{
  margin:8px 0 0;
  color:#d1d5db;
  font-size:16px;
}

.onlinePill{
  background:rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.12);
  color:#e5e7eb;
  padding:10px 14px;
  border-radius:999px;
  white-space:nowrap;
  font-size:14px;
}

.formGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}

.field label{
  display:block;
  margin-bottom:8px;
  color:#e5e7eb;
  font-size:14px;
}

.field input,
.field select{
  width:100%;
  height:52px;
  border:none;
  border-radius:14px;
  padding:0 14px;
  font-size:16px;
  background:#fff;
  color:#111827;
}

.option{
  margin-top:14px;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
  padding:12px;
  border-radius:14px;
  font-size:14px;
}

.option label{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
  color:#f3f4f6;
}

.option input{
  width:auto;
  margin:0;
}

.primaryBtn{
  width:100%;
  height:54px;
  margin-top:18px;
  border-radius:14px;
  background:#7c3aed;
  color:#fff;
  font-size:17px;
  font-weight:800;
}

.primaryBtn:hover{
  background:#6d28d9;
}

.startNote{
  margin-top:14px;
  text-align:center;
  color:#cbd5e1;
  font-size:13px;
}

/* CHAT APP */
.chatApp{
  width:100%;
  height:100dvh;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:14px;
  padding:14px;
}

/* LEFT PANEL */
.leftPanel{
  min-width:0;
  background:rgba(15,23,42,.88);
  border:1px solid rgba(255,255,255,.10);
  border-radius:22px;
  padding:14px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.profileCard{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px;
  background:rgba(255,255,255,.08);
  border-radius:18px;
}

.avatar{
  width:48px;
  height:48px;
  min-width:48px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#7c3aed;
  color:#fff;
  font-size:22px;
  font-weight:900;
}

.profileName{
  font-size:17px;
  font-weight:800;
  color:#fff;
}

.profileMeta{
  margin-top:3px;
  color:#cbd5e1;
  font-size:13px;
}

.sideBlock{
  margin-top:14px;
  padding:14px;
  background:rgba(255,255,255,.06);
  border-radius:18px;
}

.sideTitle{
  font-size:13px;
  color:#c4b5fd;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:10px;
}

.sessionLine{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#d1d5db;
  font-size:14px;
}

.sessionLine:last-child{
  border-bottom:none;
}

.sessionLine b{
  color:#fff;
}

.historyBlock{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
}

.historyList{
  flex:1;
  min-height:0;
  overflow-y:auto;
}

.emptyHistory{
  color:#94a3b8;
  font-size:13px;
  text-align:center;
  padding:20px 8px;
}

.historyItem{
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px;
  margin-bottom:10px;
}

.historyName{
  font-weight:800;
  font-size:14px;
  color:#fff;
}

.historyMeta{
  margin-top:3px;
  font-size:12px;
  color:#94a3b8;
}

.historyBtn{
  width:100%;
  height:36px;
  margin-top:8px;
  border-radius:10px;
  background:#4f46e5;
  color:#fff;
  font-weight:700;
}

/* MAIN PANEL */
.mainPanel{
  min-width:0;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  padding:14px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.chatHeader{
  min-height:64px;
  flex-shrink:0;
  background:rgba(15,23,42,.72);
  border-radius:18px;
  padding:12px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.chatHeader > div:first-child{
  min-width:0;
  flex:1;
}

.chatTitle{
  font-size:18px;
  font-weight:900;
  color:#fff;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.chatSubTitle{
  min-height:18px;
  margin-top:4px;
  color:#facc15;
  font-size:13px;
}

/* CALL CONTROLS */
.callControls{
  display:flex;
  align-items:center;
  gap:8px;
  flex-shrink:0;
}

.callBtn{
  height:42px;
  min-width:112px;
  padding:0 12px;
  border-radius:12px;
  color:#fff;
  font-size:13px;
  font-weight:900;
  white-space:nowrap;
}

.voiceBtn{
  background:#2563eb;
}

.voiceBtn:hover{
  background:#1d4ed8;
}

.videoBtn{
  background:#9333ea;
}

.videoBtn:hover{
  background:#7e22ce;
}

.headerNextBtn{
  width:96px;
  height:42px;
  flex-shrink:0;
  border-radius:12px;
  background:#dc2626;
  color:#fff;
  font-weight:800;
}

.headerNextBtn:hover{
  background:#b91c1c;
}

/* ADS */
.adBox{
  width:100%;
  min-height:72px;
  margin:10px 0;
  border-radius:16px;
  background:rgba(255,255,255,.08);
  border:1px dashed rgba(255,255,255,.28);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#cbd5e1;
  font-size:13px;
  flex-shrink:0;
}

.adTop{
  display:flex;
}

.adBottom{
  display:none !important;
}

/* MESSAGES */
.messages,
#messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  background:rgba(0,0,0,.24);
  border-radius:18px;
  padding:16px;
}

.msg{
  width:fit-content;
  max-width:min(76%,720px);
  padding:10px 14px;
  margin:8px 0;
  border-radius:16px;
  word-wrap:break-word;
  overflow-wrap:anywhere;
  line-height:1.4;
  font-size:15px;
}

.me{
  background:#7c3aed;
  margin-left:auto;
  color:#fff;
}

.stranger{
  background:#374151;
  margin-right:auto;
  color:#fff;
}

.system{
  width:100%;
  max-width:100%;
  background:transparent;
  text-align:center;
  color:#cbd5e1;
  font-size:13px;
}

/* MEDIA */
.mediaStatus,
#mediaStatus{
  min-height:20px;
  flex-shrink:0;
  margin:8px 0 6px;
  text-align:center;
  color:#facc15;
  font-size:13px;
}

.mediaPreview{
  width:100%;
  max-width:320px;
  height:auto;
  border-radius:14px;
  display:block;
}

.videoPreview{
  width:100%;
  max-width:340px;
  max-height:260px;
  border-radius:14px;
  display:block;
}

/* INPUT */
.chatInputRow{
  flex-shrink:0;
  display:flex;
  align-items:center;
  gap:8px;
}

.chatInputRow input{
  flex:1;
  min-width:0;
  height:52px;
  border:none;
  border-radius:14px;
  padding:0 14px;
  font-size:16px;
  background:#fff;
  color:#111827;
}

.iconBtn{
  width:52px;
  min-width:52px;
  height:52px;
  border-radius:14px;
  background:#7c3aed;
  color:#fff;
  font-size:20px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.iconBtn:hover{
  background:#6d28d9;
}

#sendBtn{
  width:104px;
  min-width:88px;
  height:52px;
  border-radius:14px;
  background:#22c55e;
  color:#fff;
  font-size:15px;
  font-weight:900;
}

#sendBtn:hover{
  background:#16a34a;
}

.mobileNextBtn{
  display:none;
  flex-shrink:0;
  height:48px;
  margin-top:10px;
  border-radius:14px;
  background:#dc2626;
  color:#fff;
  font-weight:900;
}

/* VIDEO CALL OVERLAY */
.callOverlay{
  position:fixed;
  inset:0;
  z-index:9998;
  background:rgba(2,6,23,.96);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.callBox{
  width:min(100%,980px);
  height:min(100%,680px);
  background:#0f172a;
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  padding:14px;
  display:flex;
  flex-direction:column;
  box-shadow:0 30px 90px rgba(0,0,0,.6);
}

.callTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:6px 4px 12px;
}

.callTitle{
  font-size:18px;
  font-weight:900;
}

.callStatus{
  color:#facc15;
  font-size:13px;
}

.videoArea{
  flex:1;
  min-height:0;
  position:relative;
  background:#020617;
  border-radius:18px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;
}

#remoteVideo{
  width:100%;
  height:100%;
  object-fit:cover;
  background:#020617;
}

#localVideo{
  position:absolute;
  right:14px;
  bottom:14px;
  width:180px;
  height:120px;
  object-fit:cover;
  border-radius:14px;
  border:2px solid rgba(255,255,255,.35);
  background:#111827;
}

.callActions{
  display:flex;
  gap:10px;
  padding-top:14px;
}

.callActionBtn{
  flex:1;
  height:48px;
  border-radius:14px;
  color:#fff;
  font-weight:900;
}

.muteBtn{
  background:#2563eb;
}

.cameraToggleBtn{
  background:#7c3aed;
}

.endCallBtn{
  background:#dc2626;
}

/* REQUEST POPUP */
.requestPopup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:16px;
}

.requestBox{
  width:100%;
  max-width:380px;
  background:#111827;
  border:1px solid rgba(255,255,255,.14);
  border-radius:20px;
  padding:18px;
  box-shadow:0 25px 80px rgba(0,0,0,.55);
}

.requestTitle{
  font-size:20px;
  font-weight:900;
  margin-bottom:8px;
}

.requestText{
  color:#d1d5db;
  font-size:14px;
  line-height:1.5;
}

.requestActions{
  display:flex;
  gap:8px;
  margin-top:16px;
}

.requestActions button{
  flex:1;
  height:42px;
  border-radius:12px;
  color:#fff;
  font-weight:800;
}

.acceptBtn{ background:#22c55e; }
.rejectBtn{ background:#6b7280; }
.blockBtn{ background:#dc2626; }

/* TABLET */
@media(max-width:1050px){
  .chatApp{
    grid-template-columns:280px 1fr;
    gap:10px;
    padding:10px;
  }

  .leftPanel,
  .mainPanel{
    border-radius:18px;
    padding:10px;
  }

  .callBtn{
    min-width:96px;
    padding:0 9px;
    font-size:12px;
  }
}

/* MOBILE */
@media(max-width:720px){
  html,
  body{
    overflow:auto;
  }

  .startScreen{
    min-height:100dvh;
    height:auto;
    padding:12px;
  }

  .startCard{
    padding:18px;
    border-radius:20px;
  }

  .brandRow{
    flex-direction:column;
    margin-bottom:18px;
  }

  .onlinePill{
    align-self:flex-start;
  }

  .formGrid{
    grid-template-columns:1fr;
    gap:12px;
  }

  .chatApp{
    height:100dvh;
    display:flex;
    flex-direction:column;
    padding:8px;
    gap:8px;
  }

  .leftPanel{
    max-height:155px;
    flex-shrink:0;
  }

  .profileCard{
    padding:10px;
  }

  .avatar{
    width:38px;
    height:38px;
    min-width:38px;
    font-size:18px;
  }

  .sideBlock{
    display:none;
  }

  .historyBlock{
    display:block;
    padding:0;
    margin-top:8px;
    background:transparent;
  }

  .historyBlock .sideTitle{
    display:none;
  }

  .historyList{
    display:flex;
    gap:8px;
    overflow-x:auto;
    overflow-y:hidden;
  }

  .historyItem{
    min-width:170px;
    margin-bottom:0;
  }

  .mainPanel{
    flex:1;
    min-height:0;
    border-radius:18px;
    padding:10px;
  }

  .chatHeader{
    min-height:auto;
    padding:10px;
    border-radius:14px;
    flex-wrap:wrap;
  }

  .chatHeader > div:first-child{
    flex:1 1 100%;
  }

  .chatTitle{
    font-size:15px;
  }

  .callControls{
    width:100%;
    order:2;
  }

  .callBtn{
    flex:1;
    min-width:0;
    height:38px;
    font-size:12px;
    padding:0 6px;
  }

  .headerNextBtn{
    display:none;
  }

  .adTop{
    display:none !important;
  }

  .messages,
  #messages{
    padding:12px;
    border-radius:14px;
  }

  .msg{
    max-width:88%;
    font-size:14px;
  }

  .chatInputRow{
    gap:6px;
  }

  .iconBtn{
    width:42px;
    min-width:42px;
    height:46px;
    font-size:17px;
    border-radius:12px;
  }

  .chatInputRow input{
    height:46px;
    font-size:14px;
    border-radius:12px;
  }

  #sendBtn{
    width:68px;
    min-width:68px;
    height:46px;
    font-size:13px;
    border-radius:12px;
  }

  .mobileNextBtn{
    display:block;
  }

  .adBottom{
    display:none;
  }

  .mediaPreview,
  .videoPreview{
    max-width:240px;
  }

  .callBox{
    height:100%;
    border-radius:16px;
  }

  #localVideo{
    width:110px;
    height:82px;
    right:10px;
    bottom:10px;
  }

  .callActions{
    gap:6px;
  }

  .callActionBtn{
    height:44px;
    font-size:13px;
  }
}

/* INCOMING CALL POPUP */
.incomingCallPopup{
  position:fixed;
  inset:0;
  z-index:10000;
  background:rgba(0,0,0,.65);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.incomingCallBox{
  width:100%;
  max-width:360px;
  background:#111827;
  border:1px solid rgba(255,255,255,.16);
  border-radius:22px;
  padding:22px;
  text-align:center;
  box-shadow:0 30px 90px rgba(0,0,0,.65);
  animation:callPop .25s ease-out;
}

@keyframes callPop{
  from{
    transform:scale(.88);
    opacity:0;
  }
  to{
    transform:scale(1);
    opacity:1;
  }
}

.callPulse{
  width:78px;
  height:78px;
  margin:0 auto 16px;
  border-radius:50%;
  background:#22c55e;
  position:relative;
}

.callPulse:before,
.callPulse:after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:50%;
  border:2px solid rgba(34,197,94,.7);
  animation:pulseRing 1.4s infinite;
}

.callPulse:after{
  animation-delay:.7s;
}

@keyframes pulseRing{
  from{
    transform:scale(1);
    opacity:1;
  }
  to{
    transform:scale(1.75);
    opacity:0;
  }
}

.incomingCallTitle{
  font-size:22px;
  font-weight:900;
  margin-bottom:8px;
}

.incomingCallText{
  color:#d1d5db;
  font-size:14px;
  line-height:1.5;
}

.incomingCallActions{
  display:flex;
  gap:10px;
  margin-top:18px;
}

.incomingCallActions button{
  flex:1;
  height:44px;
  border-radius:14px;
  color:#fff;
  font-weight:900;
}

.acceptCallBtn{
  background:#22c55e;
}

.rejectCallBtn{
  background:#dc2626;
}

/* SPONSORED CHAT BREAK */

.chatPauseOverlay{
  position:fixed !important;
  inset:0 !important;
  z-index:2147483647 !important;

  width:100vw !important;
  height:100dvh !important;

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

  padding:16px;

  background:rgba(2,6,23,.97);
}

.chatPauseOverlay.hidden{
  display:none !important;
}

.chatPauseModal{
  position:relative;

  width:min(100%,680px);
  max-height:94dvh;

  overflow-y:auto;

  padding:24px;

  border:1px solid rgba(255,255,255,.14);
  border-radius:22px;

  background:#111827;
  color:#fff;

  text-align:center;

  box-shadow:0 30px 90px rgba(0,0,0,.65);
}

.chatPauseTitle{
  margin-bottom:8px;

  font-size:22px;
  font-weight:900;
}

.chatPauseMessage{
  margin-bottom:18px;

  color:#e5e7eb;

  font-size:16px;
  line-height:1.5;
}

.sponsoredContentBox{
  width:100%;
  min-height:250px;

  overflow:hidden;

  border-radius:14px;

  background:#fff;
}

.closeChatPauseBtn{
  position:absolute;

  top:10px;
  right:12px;

  width:42px;
  height:42px;

  border-radius:50%;

  background:#dc2626;
  color:#fff;

  font-size:28px;
  font-weight:700;
  line-height:1;
}

.continueChatPauseBtn{
  width:100%;
  height:50px;

  margin-top:18px;

  border-radius:14px;

  background:#22c55e;
  color:#fff;

  font-size:16px;
  font-weight:900;
}

.continueChatPauseBtn:hover{
  background:#16a34a;
}

@media(max-width:600px){
  .chatPauseModal{
    padding:20px 14px;
  }

  .sponsoredContentBox{
    min-height:220px;
  }
}