/* ══ RESET ══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ══ VARIABLES ══ */
:root {
  --bg:       #0b0808;
  --bg2:      #120c0c;
  --bg3:      #1c1010;
  --bg4:      #221414;
  --border:   #2e1c1c;
  --border2:  #422828;
  --acc:      #8b0000;
  --acc2:     #b30000;
  --acc3:     #d42020;
  --gold:     #c9a84c;
  --text:     #f0e4e4;
  --text2:    #c8b0b0;
  --text3:    #907878;
  --dom:      #cc2222;
  --sub:      #2255cc;
  --swi:      #8822cc;
  --cur:      #888888;
  --van:      #aa8855;
  --green:    #44cc66;
}

html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; font-size: 14px; line-height: 1.5; }

a { color: var(--acc3); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select { font-family: inherit; }
.hidden { display: none !important; }
.red { color: var(--acc3); }

/* ══ SCROLLBAR ══ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--acc); }

/* ══════════════════════════════════════
   AGE GATE
══════════════════════════════════════ */
#age-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: radial-gradient(ellipse at center, #160808 0%, #080404 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.age-box {
  max-width: 500px; width: 100%;
  text-align: center;
  padding: 52px 44px;
  background: #0f0707;
  border: 1px solid var(--border2);
  border-radius: 10px;
  box-shadow: 0 0 80px rgba(139,0,0,.35), 0 0 20px rgba(0,0,0,.8);
}

.age-icon { font-size: 52px; margin-bottom: 14px; }

.age-box h1 {
  font-size: 32px; font-weight: 800; letter-spacing: 2px;
  margin-bottom: 6px;
}

.age-tagline {
  font-size: 11px; letter-spacing: 3px; color: var(--text3);
  text-transform: uppercase; margin-bottom: 20px;
}

.age-divider {
  width: 60px; height: 1px; background: var(--border2);
  margin: 0 auto 24px;
}

.age-box h2 {
  font-size: 14px; font-weight: 600; color: var(--text2);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px;
}

.age-box p { color: var(--text2); margin-bottom: 14px; line-height: 1.7; }
.age-box p strong { color: var(--text); }

.age-legal {
  font-size: 11px; color: var(--text3); margin-bottom: 32px !important;
}

.age-btns { display: flex; flex-direction: column; gap: 12px; }

.btn-enter {
  padding: 15px 32px;
  background: linear-gradient(135deg, var(--acc2), var(--acc3));
  color: #fff; border-radius: 6px;
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
  transition: opacity .2s;
  box-shadow: 0 4px 20px rgba(179,0,0,.4);
}
.btn-enter:hover { opacity: .85; }

.btn-leave {
  display: block; padding: 13px 32px;
  border: 1px solid var(--border2); color: var(--text3);
  border-radius: 6px; font-size: 13px;
  transition: color .2s, border-color .2s;
}
.btn-leave:hover { color: var(--text2); border-color: var(--text3); text-decoration: none; }

/* ══════════════════════════════════════
   SCREENS
══════════════════════════════════════ */
.screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 20px; overflow-y: auto;
}

/* ══ AUTH CARD ══ */
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 36px 32px;
}

.auth-logo {
  font-size: 22px; font-weight: 700;
  text-align: center; margin-bottom: 4px; letter-spacing: 1px;
}

.auth-sub {
  text-align: center; color: var(--text3);
  font-size: 11px; letter-spacing: 2.5px;
  text-transform: uppercase; margin-bottom: 24px;
}

.auth-tabs {
  display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px;
}

.atab {
  flex: 1; padding: 10px; font-size: 14px; font-weight: 500;
  color: var(--text2); border-bottom: 2px solid transparent;
  transition: all .2s;
}
.atab:hover { color: var(--text); }
.atab.active { color: var(--acc3); border-bottom-color: var(--acc3); }

/* ══ FORM ══ */
.fg { margin-bottom: 15px; }

.fg label {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--text2); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .5px;
}

.fhint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text3); }

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

.fg input, .fg select {
  width: 100%; padding: 10px 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 5px; color: var(--text); font-size: 14px;
  outline: none; transition: border-color .2s;
}
.fg input:focus, .fg select:focus { border-color: var(--acc2); }
.fg select option { background: var(--bg3); }

.ferr {
  color: #ff7777; font-size: 12px; margin-bottom: 12px;
  padding: 8px 12px; background: rgba(255,0,0,.08);
  border-radius: 4px; border-left: 3px solid #cc2222;
}

.btn-primary {
  width: 100%; padding: 12px;
  background: linear-gradient(135deg, var(--acc2), var(--acc3));
  color: #fff; border-radius: 5px;
  font-size: 14px; font-weight: 700; letter-spacing: .3px;
  transition: opacity .2s;
  box-shadow: 0 3px 12px rgba(179,0,0,.3);
}
.btn-primary:hover { opacity: .85; }

.btn-sm { width: auto; padding: 9px 20px; }

.terms {
  font-size: 11px; color: var(--text3);
  text-align: center; margin-top: 12px;
}
.terms a { color: var(--text2); }

/* ══════════════════════════════════════
   MAIN APP
══════════════════════════════════════ */
#app {
  position: fixed; inset: 0; display: flex;
  flex-direction: column; background: var(--bg); overflow: hidden;
}

/* legacy aliases kept for safety */
.tb-logo { font-size: 16px; font-weight: 800; }

/* Search input inside main-nav (members page) */
.mem-search-nav {
  flex: 1; max-width: 320px; margin: 0 8px;
}
.mem-search-nav input {
  width: 100%; padding: 7px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 20px; color: var(--text); font-size: 13px;
  outline: none; font-family: inherit; transition: border-color .2s;
}
.mem-search-nav input:focus { border-color: var(--acc2); }
.mem-search-nav input::placeholder { color: var(--text3); }

.online-pill {
  font-size: 11px; padding: 4px 10px;
  background: rgba(139,0,0,.18); border: 1px solid var(--acc);
  border-radius: 12px; color: var(--acc3); white-space: nowrap;
}

.me-info { display: flex; align-items: center; gap: 7px; }

.me-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--acc2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}

.me-name { font-size: 13px; font-weight: 600; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text3); transition: all .15s;
}
.icon-btn:hover { color: var(--text); background: var(--bg3); }

/* ══════════════════════════════════════
   MAIN NAV — shared across all pages
══════════════════════════════════════ */
.main-nav {
  height: 52px; flex-shrink: 0;
  background: var(--bg2); border-bottom: 2px solid var(--border2);
  display: flex; align-items: center;
  padding: 0 16px; gap: 6px;
  position: sticky; top: 0; z-index: 200;
}

.nav-logo {
  font-size: 16px; font-weight: 800; letter-spacing: .5px;
  text-decoration: none; color: var(--text);
  white-space: nowrap; margin-right: 10px; flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo:hover { text-decoration: none; opacity: .85; }
.nav-logo-img { width: 34px; height: 34px; flex-shrink: 0; }

.nav-links { display: flex; gap: 2px; flex-shrink: 0; }

.nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 6px;
  color: var(--text2); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all .15s; white-space: nowrap;
  position: relative;
}
.nav-link:hover { color: var(--text); background: var(--bg3); text-decoration: none; }
.nav-link.active { color: #fff; background: rgba(212,32,32,.18); }
.nav-link.active::after {
  content: ''; position: absolute;
  bottom: 0; left: 10px; right: 10px; height: 2px;
  background: var(--acc3); border-radius: 2px 2px 0 0;
}

.nav-announce {
  flex: 1; font-size: 12px; color: var(--acc3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 0 8px;
}

.nav-spacer { flex: 1; }

.nav-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-user {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: background .15s;
}
.nav-user:hover { background: var(--bg3); }

.nav-av {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
}

.nav-username { font-size: 13px; font-weight: 600; color: var(--text); }

.plabel-btn {
  float: right; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 3px; color: var(--text2); font-size: 14px;
  cursor: pointer; transition: all .15s;
}
.plabel-btn:hover { background: var(--acc2); border-color: var(--acc2); color: #fff; }

.verified-tick-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  background: #3aaa3a; color: #fff; font-size: 8px; font-weight: 800;
  flex-shrink: 0; margin-left: 2px;
}

/* ══ WORKSPACE ══ */
.workspace {
  flex: 1; display: grid;
  grid-template-columns: 215px 1fr 195px;
  min-height: 0; overflow: hidden;
}

/* ══ PANELS ══ */
.panel-left {
  background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; overflow-x: hidden;
}

.panel-right {
  background: var(--bg2); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 14px 0 8px;
}

.psec { padding: 14px 0 4px; }

.plabel {
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--text3); padding: 0 12px; margin-bottom: 4px;
  text-transform: uppercase;
}

/* ══ NAV LIST (channels + DMs) ══ */
.nav-list { list-style: none; }

.nav-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; cursor: pointer;
  border-radius: 4px; margin: 1px 6px;
  color: var(--text2); transition: background .12s, color .12s;
  white-space: nowrap; overflow: hidden;
  position: relative;
}
.nav-list li:hover { background: var(--bg3); color: var(--text); }
.nav-list li.active { background: rgba(139,0,0,.22); color: var(--text); }

.ch-em { font-size: 14px; flex-shrink: 0; }
.ch-nm { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.nav-list li.active .ch-nm { color: var(--acc3); }

.dm-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}
.dm-dot.off { background: var(--text3); }

.dm-badge {
  margin-left: auto; background: var(--acc2);
  color: #fff; font-size: 9px; font-weight: 800;
  padding: 1px 5px; border-radius: 10px; flex-shrink: 0;
}

/* ══ CHAT MAIN ══ */
.chat-main {
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
}

.chat-header {
  height: 46px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px; gap: 12px;
  flex-shrink: 0;
}

.chat-ch-name { font-size: 15px; font-weight: 800; color: var(--text); }

.chat-ch-desc {
  font-size: 12px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.msgs-wrap {
  flex: 1; overflow-y: auto; padding: 16px 16px 8px;
  display: flex; flex-direction: column;
}

.msgs { display: flex; flex-direction: column; gap: 2px; margin-top: auto; }

/* ══ MESSAGE ══ */
.msg {
  display: flex; gap: 10px; padding: 4px 8px;
  border-radius: 4px; transition: background .1s;
}
.msg:hover { background: var(--bg2); }

.msg-av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; margin-top: 2px;
  cursor: pointer; transition: opacity .15s;
}
.msg-av:hover { opacity: .8; }

.msg-body { flex: 1; min-width: 0; }

.msg-hdr {
  display: flex; align-items: baseline; gap: 7px; margin-bottom: 2px;
  flex-wrap: wrap;
}

.msg-user {
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity .15s;
}
.msg-user:hover { opacity: .75; text-decoration: underline; }

.msg-time { font-size: 11px; color: var(--text3); }

.msg-txt {
  font-size: 14px; color: var(--text); line-height: 1.55;
  word-break: break-word; white-space: pre-wrap;
}

.msg.cons .msg-av { visibility: hidden; }
.msg.cons .msg-hdr { display: none; }
.msg.cons { padding-top: 1px; }

/* ══ TYPING ══ */
.typing-bar {
  height: 18px; padding: 0 16px; flex-shrink: 0;
  font-size: 11px; color: var(--text2); font-style: italic;
}

/* ══ COMPOSER ══ */
.composer {
  padding: 10px 14px 14px; display: flex; gap: 8px; flex-shrink: 0;
}

#msg-in {
  flex: 1; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 5px; color: var(--text); font-size: 14px;
  outline: none; transition: border-color .2s;
}
#msg-in:focus { border-color: var(--acc2); }
#msg-in::placeholder { color: var(--text3); }

.send-btn {
  width: 40px; height: 40px; border-radius: 5px;
  background: linear-gradient(135deg, var(--acc2), var(--acc3));
  color: #fff; font-size: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s;
  box-shadow: 0 2px 8px rgba(179,0,0,.3);
}
.send-btn:hover { opacity: .85; }

/* ══ ONLINE LIST ══ */
.online-list { list-style: none; display: flex; flex-direction: column; }

.online-list li {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; cursor: pointer;
  border-radius: 4px; margin: 1px 6px;
  transition: background .12s;
}
.online-list li:hover { background: var(--bg3); }

.o-av {
  width: 27px; height: 27px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

.o-name {
  font-size: 12px; color: var(--text2); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}

.o-flag { font-size: 11px; flex-shrink: 0; }

/* ══ ROLE CHIP ══ */
.role-chip {
  font-size: 9px; font-weight: 800; padding: 2px 5px;
  border-radius: 10px; text-transform: uppercase;
  letter-spacing: .5px; flex-shrink: 0; white-space: nowrap;
}

.role-dominant   { background: rgba(204,34,34,.18);  color: var(--dom); border: 1px solid rgba(204,34,34,.35); }
.role-submissive { background: rgba(34,85,204,.18);  color: var(--sub); border: 1px solid rgba(34,85,204,.35); }
.role-switch     { background: rgba(136,34,204,.18); color: var(--swi); border: 1px solid rgba(136,34,204,.35); }
.role-curious    { background: rgba(136,136,136,.1); color: var(--cur); border: 1px solid rgba(136,136,136,.25); }
.role-vanilla    { background: rgba(170,136,85,.1);  color: var(--van); border: 1px solid rgba(170,136,85,.25); }

/* ══ MODAL ══ */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}

.modal-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 28px; max-width: 340px; width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.7);
}

.close-btn {
  position: absolute; top: 12px; right: 12px;
  width: 26px; height: 26px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text3); transition: all .15s;
}
.close-btn:hover { color: var(--text); background: var(--bg3); }

/* ══ PROFILE MODAL ══ */
.prof-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }

.prof-av {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
}

.prof-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 6px; }

.prof-meta { font-size: 11px; color: var(--text2); margin-top: 5px; }

.prof-bio {
  font-size: 13px; color: var(--text2); line-height: 1.6;
  margin-bottom: 16px; min-height: 18px;
}

/* ══ WALLET WIDGET ══ */
.wallet-widget {
  display: flex; align-items: center; cursor: pointer;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 20px; padding: 4px 12px; gap: 6px;
  transition: border-color .15s; position: relative;
  text-decoration: none;
}
.wallet-widget:hover { border-color: var(--acc3); text-decoration: none; }
.wallet-bal { font-size: 13px; font-weight: 700; color: var(--gold); }
.wallet-low { border-color: #b38600 !important; }
.wallet-low .wallet-bal { color: #ffaa00; }

/* ══ COMFORT BADGES ══ */
.comfort-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; letter-spacing: .3px;
}
.badge-gray   { background: rgba(200,176,176,.15); color: var(--text2); border: 1px solid var(--border2); }
.badge-teal   { background: rgba(93,202,165,.12);  color: #5dcaa5;      border: 1px solid rgba(93,202,165,.3); }
.badge-purple { background: rgba(136,34,204,.12);  color: #aa66ee;      border: 1px solid rgba(136,34,204,.3); }
.badge-coral  { background: rgba(212,80,32,.12);   color: #e8704a;      border: 1px solid rgba(212,80,32,.3); }

/* ══ COMFORT PICKER (register + profile) ══ */
.comfort-options { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.comfort-option {
  display: flex; flex-direction: column; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; transition: border-color .15s;
}
.comfort-option:has(input:checked) { border-color: var(--acc2); background: var(--bg3); }
.comfort-option input { display: none; }
.option-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.option-desc  { font-size: 11px; color: var(--text3); }

.privacy-note, .no-notify-note { font-size: 11px; color: var(--text3); margin-top: 6px; }
.private-tag  { font-size: 11px; color: var(--text3); margin-left: 6px; }
.step-label   { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }

.compat-signal {
  font-size: 11px; color: var(--text3); text-align: center;
  padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}

/* ══ COMFORT PROMPT BANNER ══ */
.comfort-prompt-banner {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--bg2); border: 1px solid var(--acc2); border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: var(--text2);
  display: flex; align-items: center; gap: 12px; z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,.4); max-width: 500px;
}
.comfort-prompt-cta { color: var(--acc3); font-weight: 600; white-space: nowrap; }
.comfort-prompt-close { color: var(--text3); font-size: 18px; line-height: 1; }
