/* Visual inspirado no chat aleatório clássico (2010–2023) */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 1em; color: #000; background: #fff;
}
body.chatting { background: #fff; overflow: hidden; }
a { color: #0090e0; }
.hidden { display: none !important; }

/* ---------- Cabeçalho ---------- */
#header {
  position: relative; height: 70px; background: #fff;
  border-bottom: 1px solid #ccc;
  box-shadow: 0 0 8px rgba(0,0,0,.08);
  padding: 0 16px; white-space: nowrap; overflow: hidden;
}
body.chatting #header { height: 56px; }
#logo { position: absolute; left: 16px; top: 8px; text-decoration: none; }
body.chatting #logo { top: 3px; }
.logo-text {
  font-family: "Trebuchet MS", "Helvetica Neue", Arial, sans-serif;
  font-size: 46px; font-weight: bold; letter-spacing: -2px; line-height: 52px;
  color: #3ba7f2;
  background: linear-gradient(#7fcbff 0%, #2a9df4 55%, #1578c9 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.04);
}
body.chatting .logo-text { font-size: 38px; }
#tagline {
  position: absolute; top: 27px; display: inline-block;
  font-family: "Trebuchet MS", Arial, sans-serif; font-weight: bold; font-size: 24px;
  color: #ff7d00; transform: rotate(-5deg); transform-origin: left center;
}
body.chatting #tagline { top: 20px; font-size: 20px; }
#onlinecount {
  position: absolute; right: 22px; top: 22px;
  font-size: 1.1em; color: #a3c7f0; font-weight: normal;
}
#onlinecount strong { font-size: 1.35em; color: #4aa1ec; font-weight: bold; }
body.chatting #onlinecount { top: 16px; }

/* ---------- Página inicial ---------- */
#homepage { max-width: 760px; margin: 0 auto; padding: 18px 16px 30px; }
#intro {
  background: #fff; border: 1px solid #ccc; border-radius: 12px;
  padding: 6px 22px 2px; font-size: 1.02em; line-height: 1.38;
  box-shadow: 0 0 4px rgba(0,0,0,.06);
}
#intro p { margin: .8em 0; }
.mobilenote { text-align: center; background: #e9f3fd; border-radius: 8px; padding: 8px; color: #333; font-size: .95em; }
.sectiontitle { text-align: center; font-size: 1.25em; margin: .8em 0 .4em; color: #222; }
.videowarn { color: #c33; font-size: 1.1em; }
.agewarn { color: #000; }

#startbox {
  margin: 18px 0 0; background: #f4f4f4; border: 1px solid #ccc; border-radius: 12px;
  padding: 10px 14px 16px; box-shadow: 0 0 4px rgba(0,0,0,.06);
}
#startbox table { width: 100%; border-collapse: collapse; }
#startbox td { vertical-align: top; padding: 0 8px; }
#startbox td.topicscell { width: 50%; border-right: 1px solid #ddd; }
#startbox h3 { font-size: 1.15em; margin: .5em 0 .55em; color: #444; text-align: center; font-weight: bold; }
#interestsbox {
  background: #fff; border: 1px solid #ccc; border-radius: 4px; min-height: 40px;
  padding: 4px; cursor: text; box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}
#interestsbox input { border: 0; outline: 0; font-size: 1em; padding: 6px 4px; width: 230px; max-width: 100%; background: transparent; }
#tags { display: inline; }
.tag {
  display: inline-block; background: #e5eefa; border: 1px solid #b6cff0; color: #1d5ea8;
  border-radius: 3px; padding: 3px 6px; margin: 2px; font-size: .9em;
}
.tag .x { margin-left: 6px; cursor: pointer; color: #6b8fbf; font-weight: bold; }
.smallopt { display: block; font-size: .85em; color: #666; margin-top: 6px; }
.startcell { text-align: center; }
.startbtns { display: flex; align-items: center; justify-content: center; gap: 10px; }
.or { color: #888; font-size: 1.05em; }
.bigbtn {
  font-family: Arial, sans-serif; font-weight: bold; font-size: 1.45em; color: #fff;
  width: 150px; height: 56px; cursor: pointer;
  border: 1px solid #1a6fc0; border-radius: 6px;
  background: linear-gradient(#6cbbf7 0%, #3a9bef 48%, #1f86e3 52%, #1b7ad2 100%);
  text-shadow: 0 -1px 0 rgba(0,0,0,.3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 1px 3px rgba(0,0,0,.25);
}
.bigbtn:hover { background: linear-gradient(#80c6fa 0%, #4aa6f2 48%, #2b90ea 52%, #2183dc 100%); }
.bigbtn:active { box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.bigbtn[disabled] { opacity: .45; cursor: default; }
.bigbtn.small { font-size: 1.1em; width: auto; height: 44px; padding: 0 22px; }
#footer { text-align: center; color: #888; font-size: .85em; margin-top: 20px; }
#footer a { color: #888; }

/* ---------- Popup 18+ ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: center; justify-content: center; }
.popup {
  background: #fff; border-radius: 10px; border: 1px solid #aaa; max-width: 520px; width: 92%;
  padding: 20px 24px; box-shadow: 0 6px 30px rgba(0,0,0,.35); text-align: left;
}
.gatecheck { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; line-height: 1.35; font-size: .98em; }
.gatecheck input { margin-top: 3px; transform: scale(1.25); }
.popup .bigbtn { display: block; margin: 8px auto 0; }

/* ---------- Tela de chat ---------- */
#chatpage {
  position: absolute; top: 56px; left: 0; right: 0; bottom: 0;
  display: flex; padding: 8px; gap: 8px; background: #fff;
}
#videowrapper { width: 32%; min-width: 220px; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }
.videobox {
  position: relative; flex: 1; background: #ccc; border: 1px solid #aaa; border-radius: 4px; overflow: hidden;
  background: linear-gradient(#e6e6e6, #c9c9c9);
}
.videobox video { width: 100%; height: 100%; object-fit: cover; display: block; background: transparent; }
.videostatus { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #666; font-size: .95em; text-align: center; padding: 10px; pointer-events: none; }
#chatmain { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#logwrapper {
  position: relative; flex: 1; border: 1px solid #ccc; border-radius: 8px 8px 0 0;
  background: #fff; overflow: hidden; box-shadow: inset 0 0 3px rgba(0,0,0,.06);
}
#logbox { position: absolute; inset: 0; overflow-y: auto; padding: 10px 12px; font-size: 1em; line-height: 1.35; }
.logitem { margin: 0 0 .45em; word-wrap: break-word; }
.statuslog { color: #000; font-weight: bold; margin: .3em 0 .8em; font-size: .98em; }
.statuslog.grey { color: #666; font-weight: normal; }
.youmsg .msgsource { color: #00f; font-weight: bold; }
.strangermsg .msgsource { color: #f00; font-weight: bold; }
.typing { color: #888; font-style: normal; }
.newchatactions { margin: 10px 0; }
.newchatactions button {
  font-size: .95em; padding: 5px 12px; margin-right: 8px; border: 1px solid #aaa; border-radius: 4px; cursor: pointer;
  background: linear-gradient(#fff, #e3e3e3);
}
.reportbtn {
  position: absolute; top: 8px; right: 10px; font-size: .8em; color: #b30000; background: #fff;
  border: 1px solid #e3b5b5; border-radius: 4px; padding: 3px 8px; cursor: pointer;
}
.reportbtn:hover { background: #fff2f2; }

#controlwrapper {
  border: 1px solid #ccc; border-top: 0; border-radius: 0 0 8px 8px; background: #f2f2f2; padding: 6px;
}
#controlwrapper table { width: 100%; border-collapse: collapse; height: 72px; }
#controlwrapper td { padding: 0 3px; }
.disconnectcell, .sendbthcell { width: 100px; }
.disconnectbtn, .sendbtn {
  width: 100%; height: 72px; font-family: Arial, sans-serif; font-size: 1.3em; font-weight: bold; cursor: pointer;
  color: #000; border: 1px solid #a7a7a7; border-radius: 4px;
  background: linear-gradient(#ffffff 0%, #f1f1f1 50%, #e1e1e1 51%, #f6f6f6 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0,0,0,.15);
}
.disconnectbtn:hover, .sendbtn:hover { background: linear-gradient(#fff 0%, #f7f7f7 50%, #ebebeb 51%, #fafafa 100%); }
.disconnectbtn:active, .sendbtn:active { box-shadow: inset 0 2px 4px rgba(0,0,0,.25); }
.disconnectbtn.really { color: #d40000; }
.disconnectbtn.new { color: #0060c0; }
.sendbtn[disabled] { color: #999; cursor: default; }
.btnkbshortcut { font-size: .55em; font-weight: normal; color: #888; margin-top: 2px; }
.chatmsg {
  width: 100%; height: 72px; resize: none; font-family: Arial, sans-serif; font-size: 1em; padding: 6px 8px;
  border: 1px solid #aaa; border-radius: 4px; box-shadow: inset 0 1px 3px rgba(0,0,0,.12); outline: none;
}
.chatmsg:focus { border-color: #6aaef0; }
.chatmsg[disabled] { background: #f7f7f7; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  #header { height: 56px; }
  .logo-text { font-size: 32px; }
  #tagline { display: none; }
  #onlinecount { top: 18px; font-size: .9em; right: 10px; }
  #startbox td { display: block; width: 100% !important; border: 0 !important; padding: 0; }
  #interestsbox input { width: 100%; }
  .bigbtn { width: 46%; }
  #chatpage { flex-direction: column; }
  #videowrapper { width: 100%; max-width: none; flex-direction: row; height: 34vh; }
  .disconnectcell, .sendbthcell { width: 70px; }
  .disconnectbtn, .sendbtn { font-size: 1em; }
}

/* câmera: espelhar a própria imagem como no clássico */
#localvideo { transform: scaleX(-1); }
.videobox { background: #ddd; }
.smallbtn { margin-top: 6px; padding: 4px 10px; border: 1px solid #999; border-radius: 4px; background: #fff; cursor: pointer; font: inherit; pointer-events: auto; }
.videostatus { pointer-events: auto; }

/* ---- áudio e controles ---- */
.startbtns { flex-wrap: wrap; }
.mediactrls { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; order: 1; }
#selfvideobox { order: 2; }
.ctrlbtn { flex: 1 1 auto; min-width: 70px; padding: 6px 8px; border: 1px solid #aaa; border-radius: 5px; background: linear-gradient(#fff, #e6e6e6); font: inherit; font-size: .9em; cursor: pointer; }
.ctrlbtn.off { background: #f3d0d0; border-color: #c66; color: #922; text-decoration: line-through; }
.audioavatar { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #345; font-weight: bold; background: linear-gradient(#eaf4ff, #cfe3fa); }
.audioavatar .mic { font-size: 2.4em; }
.vu { width: 60%; height: 8px; border-radius: 4px; background: #9cc6ef; transform-origin: left; transform: scaleX(0.03); transition: transform .08s linear; }
body.audiomode .audioavatar { display: flex; }
body.audiomode video { visibility: hidden; }
body.audiomode #cambtn { display: none; }
body.audiomode .videobox { height: 120px; }
.tapsound { pointer-events: auto; padding: 8px 14px; border-radius: 6px; border: 1px solid #2b90ea; background: #fff; color: #2183dc; font: inherit; font-weight: bold; cursor: pointer; }
@media (max-width: 700px) { body.audiomode #videowrapper { height: auto; } body.audiomode .videobox { height: 90px; } }
@media (max-width: 700px) {
  #videowrapper { flex-wrap: wrap; height: auto; }
  #videowrapper .videobox { flex: 1 1 45%; height: 26vh; }
  .mediactrls { flex: 1 1 100%; order: 3; }
}
/* barrinha de voz também na chamada de vídeo */
body.chatting:not(.audiomode) .audioavatar { display: flex; inset: auto 0 6px 0; background: none; pointer-events: none; }
body.chatting:not(.audiomode) .audioavatar .mic, body.chatting:not(.audiomode) .audioavatar span { display: none; }
body.chatting:not(.audiomode) .vu { width: 50%; background: #4cd964; box-shadow: 0 0 3px rgba(0,0,0,.4); }

/* ---------- Proteção / denúncia ---------- */
.videobox { position: relative; }
.protectbadge {
  position: absolute; left: 6px; bottom: 6px; z-index: 3;
  background: rgba(0,0,0,.45); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 10px;
  pointer-events: auto; cursor: help; opacity: .8;
}
.reccountdown {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  background: rgba(200,0,0,.85); color: #fff; font-size: 12px; font-weight: bold; padding: 3px 8px; border-radius: 10px;
}
.reportpopup { max-width: 420px; width: 92%; text-align: left; }
.reportpopup h3 { margin: 0 0 6px; color: #c33; }
.reportq { margin: 4px 0 6px; font-weight: bold; }
.reasonopt { display: block; padding: 4px 0; cursor: pointer; }
#reportdesc { width: 100%; min-height: 60px; margin-top: 8px; font: inherit; padding: 6px; border: 1px solid #bbb; border-radius: 4px; resize: vertical; }
.reportnote { font-size: .85em; color: #555; margin: 8px 0; }
.reportbtns { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.reportbtns .bigbtn { margin: 0; }
.reportactions .btnlink {
  display: inline-block; margin: 4px; padding: 6px 12px; border: 1px solid #999; border-radius: 4px;
  background: #fff; color: #0070c0; text-decoration: none; font-size: .95em;
}
.minorbox { background: #fff3f3; border: 1px solid #e3a0a0; border-radius: 6px; padding: 8px 10px; margin: 8px 0; line-height: 1.4; }
