
/* =============================================
   YID PLUS — style.css  (Light Mode)
   ============================================= */

/* ---------- RESET & TOKENS ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* Brand accent — deep gold works on white */
  --gold:    #B8860B;
  --gold-l:  #DAA520;
  --gold-d:  #8B6914;

  /* Backgrounds */
  --bg:      #FFFFFF;
  --bg2:     #F5F5F5;
  --bg3:     #EBEBEB;
  --bg4:     #E0E0E0;

  /* Borders */
  --border:  rgba(0, 0, 0, 0.12);
  --border2: rgba(0, 0, 0, 0.25);

  /* Text */
  --text:    #000000;
  --muted:   #555555;
  --muted2:  #888888;

  /* Status colors */
  --red:     #D32F2F;
  --green:   #2E7D32;
  --blue:    #1565C0;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: Georgia, serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* Night mode OFF in light theme */
body.night {
  --bg:   #FFFFFF;
  --bg2:  #F5F5F5;
  --bg3:  #EBEBEB;
  --text: #000000;
}

/* ---------- SCREEN SYSTEM ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.32,.72,0,1);
  pointer-events: none;
  overflow: hidden;
}
.screen.active { transform: translateX(0);   pointer-events: all; }
.screen.prev   { transform: translateX(-30%); }

.scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.scroll-area::-webkit-scrollbar       { width: 4px; }
.scroll-area::-webkit-scrollbar-track { background: transparent; }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ---------- TOPBAR ---------- */
.topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--gold-d);
}

.topbar-icons { display: flex; gap: .5rem; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  color: var(--text);
}
.icon-btn:hover  { background: var(--bg4); }
.icon-btn:active { transform: scale(.9); }

.badge {
  position: absolute; top: -2px; right: -2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--red);
  font-size: .55rem; color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #fff;
}

/* ---------- BOTTOM NAV ---------- */
.bottom-nav {
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: .6rem 0 max(.6rem, env(safe-area-inset-bottom));
  flex-shrink: 0;
  box-shadow: 0 -1px 4px rgba(0,0,0,.06);
}
.nav-item {
  display: flex; flex-direction: column;
  align-items: center; gap: .2rem;
  cursor: pointer;
  padding: .3rem .75rem;
  flex: 1;
  border: none; background: none;
  font-family: inherit;
  transition: all .15s;
}
.nav-icon  { font-size: 1.2rem; }
.nav-label { font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-item.active .nav-label  { color: var(--gold-d); font-weight: 700; }
.nav-item.active .nav-icon   { filter: none; }

/* ---------- FORM FIELDS ---------- */
.field {
  width: 100%;
  padding: .72rem 1rem;
  background: #FFFFFF;
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  outline: none;
  transition: border .2s, box-shadow .2s;
  margin-bottom: .85rem;
  display: block;
}
.field:focus {
  border-color: var(--gold-d);
  box-shadow: 0 0 0 3px rgba(139,105,20,.12);
}
.field::placeholder { color: var(--muted2); }

/* ---------- PRIMARY BUTTON ---------- */
.btn-primary {
  width: 100%;
  padding: .82rem;
  background: #000000;
  color: #FFFFFF;
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px;
  transition: all .2s;
}
.btn-primary:hover:not(:disabled) { background: #222; }
.btn-primary:active:not(:disabled) { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- LOADING DOTS ---------- */
.loading-dots { display: none; gap: 4px; align-items: center; }
.loading-dots span {
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: ldot .9s infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes ldot {
  0%,80%,100% { transform: scale(.6); opacity: .5; }
  40%          { transform: scale(1);  opacity: 1;  }
}

/* ---------- TOGGLE SWITCH ---------- */
.toggle-sw {
  width: 42px; height: 24px;
  border-radius: 12px;
  background: var(--bg4);
  border: 1px solid var(--border2);
  position: relative;
  cursor: pointer;
  transition: background .25s;
  flex-shrink: 0;
}
.toggle-sw.on { background: #000; border-color: #000; }
.toggle-sw::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #999;
  top: 2px; left: 2px;
  transition: all .22s;
}
.toggle-sw.on::after { left: 20px; background: #fff; }

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.4);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-sheet {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
  width: 100%; max-width: 500px;
  animation: slideUp .3s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-title { font-size: .95rem; font-weight: 700; margin-bottom: 1.25rem; text-align: center; color: var(--text); }
.modal-cancel {
  width: 100%; padding: .65rem;
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--muted);
  font-size: .82rem;
  cursor: pointer; font-family: inherit;
  margin-top: .5rem;
}
.modal-cancel:hover { background: var(--bg3); }

/* ---------- SECTION HEADER ---------- */
.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem .75rem .5rem;
}
.section-hdr h2 { font-size: .88rem; letter-spacing: .04em; color: var(--text); }
.see-all { font-size: .73rem; color: var(--gold-d); cursor: pointer; border: none; background: none; font-family: inherit; font-weight: 600; }

/* ---------- H-SCROLL ---------- */
.h-scroll { display: flex; gap: .75rem; overflow-x: auto; scrollbar-width: none; }
.h-scroll::-webkit-scrollbar { display: none; }

/* ---------- TOAST ---------- */
#app-toast {
  position: fixed;
  bottom: 5.5rem; left: 50%;
  transform: translateX(-50%);
  background: #111;
  border-radius: 10px;
  padding: .6rem 1.25rem;
  font-size: .8rem; color: #fff;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
#app-toast.show { opacity: 1; }

/* ---------- ANIMATIONS ---------- */
@keyframes fadeIn  { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes pulse   { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes floatUp { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes hburst  { 0% { opacity:1; transform: translate(-50%,-50%) scale(.5); } 40% { opacity:1; transform: translate(-50%,-50%) scale(1.4); } 100% { opacity:0; transform: translate(-50%,-60%) scale(1.6); } }
@keyframes pbanim  { 0%,100% { height: 4px; } 50% { height: 14px; } }
@keyframes tdot    { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-5px); } }
@keyframes barRun  { from { width: 0; } to { width: 100%; } }
@keyframes lpulse  { 0%,100% { opacity:1; transform: scale(1); } 50% { opacity:.5; transform: scale(.8); } }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--gold-d);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ---------- FEED STATES ---------- */
.feed-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3rem 1rem; gap: .75rem;
  color: var(--muted); text-align: center;
}
.feed-retry {
  padding: .5rem 1.25rem;
  background: #000; color: #fff;
  border: none; border-radius: 8px;
  font-size: .8rem; cursor: pointer;
  font-family: inherit; margin-top: .25rem;
}

/* =============================================
   AUTH SCREEN
   ============================================= */
#screen-auth { justify-content: center; align-items: center; padding: 1.5rem; overflow-y: auto; }

.auth-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem 1.75rem;
  width: 100%; max-width: 400px;
  animation: fadeIn .7s ease;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.auth-tabs { display: flex; background: var(--bg3); border-radius: 10px; padding: 3px; margin-bottom: 1.75rem; }
.auth-tab  {
  flex: 1; padding: .5rem; text-align: center; font-size: .82rem;
  border-radius: 8px; cursor: pointer; color: var(--muted);
  border: none; background: transparent; font-family: inherit; transition: all .25s;
}
.auth-tab.active { background: #fff; color: #000; border: 1px solid var(--border); font-weight: 700; }

.auth-msg { padding: .65rem 1rem; border-radius: 8px; font-size: .82rem; margin-bottom: 1rem; display: none; align-items: center; gap: .5rem; }
.auth-msg.err { background: #FFF0F0; border: 1px solid var(--red);   color: var(--red);   display: flex; }
.auth-msg.ok  { background: #F0FFF4; border: 1px solid var(--green); color: var(--green); display: flex; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* =============================================
   HOME SCREEN
   ============================================= */
.status-item { display: flex; flex-direction: column; align-items: center; gap: .4rem; cursor: pointer; flex-shrink: 0; }
.status-ring { width: 60px; height: 60px; border-radius: 50%; padding: 2.5px; background: conic-gradient(var(--gold-l), var(--gold-d), var(--gold-l)); }
.status-ring.viewed { background: conic-gradient(#ccc, #aaa, #ccc); }
.status-ring.mine   { background: conic-gradient(var(--blue), #42A5F5, var(--blue)); }
.status-inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; position: relative;
}
.status-plus {
  position: absolute; bottom: 0; right: 0;
  width: 18px; height: 18px;
  background: #000; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; color: #fff; font-weight: 900;
  border: 1.5px solid #fff;
}
.status-name { font-size: .62rem; color: var(--muted); max-width: 62px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ads */
.ad-frame { width: 100%; aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); position: relative; cursor: pointer; background: var(--bg3); }
.ad-slide  { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem; padding: 1.5rem; opacity: 0; transition: opacity .6s ease; }
.ad-slide.active { opacity: 1; }
.ad-badge  { font-size: .65rem; letter-spacing: .15em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 20px; background: rgba(0,0,0,.08); color: #333; border: 1px solid rgba(0,0,0,.15); }
#ad-prog   { position: absolute; bottom: 0; left: 0; height: 2px; background: #000; }
.ad-dot    { width: 6px; height: 6px; border-radius: 50%; background: #ccc; transition: all .3s; }
.ad-dot.active { background: #000; width: 16px; border-radius: 3px; }

/* Short previews */
.short-prev {
  flex-shrink: 0; width: 110px; height: 185px;
  border-radius: 12px; background: var(--bg3);
  border: 1px solid var(--border); overflow: hidden; position: relative; cursor: pointer;
}

/* Channel previews */
.ch-prev-card {
  flex-shrink: 0; width: 130px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: .9rem .75rem; text-align: center; cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.ch-prev-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }

.follow-pill {
  margin-top: .5rem; width: 100%; padding: .3rem;
  background: #f0f0f0; border: 1px solid #ddd;
  border-radius: 6px; color: #333; font-size: .7rem;
  cursor: pointer; font-family: inherit; transition: all .2s;
}
.follow-pill.following { background: #000; border-color: #000; color: #fff; }

/* Feed posts */
.feed-post { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin-bottom: .75rem; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.post-thumb { height: 160px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 4rem; cursor: pointer; position: relative; }
.post-play  { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.post-action { display: flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); cursor: pointer; border: none; background: none; font-family: inherit; transition: color .2s; }
.post-action:hover { color: var(--text); }
.post-action.liked { color: var(--red); }

/* Status viewer */
.sv-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.85); display: none; flex-direction: column; }
.sv-overlay.open { display: flex; }
.sv-header { position: absolute; top: 0; left: 0; right: 0; z-index: 10; padding: 1rem 1rem 0; }
.sv-bars   { display: flex; gap: 3px; margin-bottom: .75rem; }
.sv-bar    { flex: 1; height: 2.5px; background: rgba(255,255,255,.3); border-radius: 2px; overflow: hidden; }
.sv-bar-fill { height: 100%; background: #fff; width: 0; }
.sv-bar-fill.done    { width: 100%; }
.sv-bar-fill.running { animation: barRun 5s linear forwards; }
.sv-ctrl   { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2); border: none; color: #fff; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sv-slide  { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; padding: 5rem 1.5rem; text-align: center; transition: opacity .15s; }

/* =============================================
   SHORTS SCREEN
   ============================================= */
#screen-shorts { background: #111; }
.swipe-cont { height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.swipe-cont::-webkit-scrollbar { display: none; }
.short-slide { height: 100vh; width: 100%; position: relative; scroll-snap-align: start; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #111; }
.slide-bg    { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 8rem; filter: blur(30px); opacity: .3; transform: scale(1.2); pointer-events: none; }
.slide-center { font-size: 6rem; z-index: 1; animation: floatUp 3s ease-in-out infinite; pointer-events: none; }
.slide-grad  { position: absolute; bottom: 0; left: 0; right: 0; height: 65%; background: linear-gradient(to top, rgba(0,0,0,.92), rgba(0,0,0,.4) 60%, transparent); pointer-events: none; z-index: 2; }
.slide-info  { position: absolute; bottom: 90px; left: 0; right: 80px; padding: 0 1rem; z-index: 3; }
.slide-actions { position: absolute; bottom: 90px; right: .75rem; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 1.2rem; }
.s-action    { display: flex; flex-direction: column; align-items: center; gap: .2rem; cursor: pointer; }
.s-icon      { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.15); backdrop-filter: blur(6px); border: .5px solid rgba(255,255,255,.3); display: flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.s-action.liked .s-icon { background: rgba(211,47,47,.3); border-color: #ef5350; }
.s-count     { font-size: .68rem; color: rgba(255,255,255,.85); }
.pdot        { width: 3px; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); transition: all .3s; }
.pdot.active { height: 16px; background: #fff; }
.heart-burst { position: absolute; font-size: 4rem; pointer-events: none; z-index: 10; animation: hburst .8s ease forwards; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.cmt-drawer  { position: fixed; bottom: 0; left: 0; right: 0; z-index: 80; height: 65vh; background: #fff; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; transform: translateY(100%); transition: transform .35s cubic-bezier(.32,.72,0,1); display: flex; flex-direction: column; box-shadow: 0 -4px 24px rgba(0,0,0,.1); }
.cmt-drawer.open { transform: translateY(0); }
.drawer-handle { width: 36px; height: 3px; background: #ddd; border-radius: 2px; margin: .75rem auto 0; }
.cmt-input-el { flex: 1; padding: .55rem 1rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; color: #000; font-size: .85rem; font-family: inherit; outline: none; }
.cmt-send-el  { width: 36px; height: 36px; border-radius: 50%; background: #000; border: none; color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }

/* =============================================
   CHAT SCREENS
   ============================================= */
.chat-search-wrap { padding: .6rem 1rem; background: var(--bg2); flex-shrink: 0; position: relative; }
.chat-search-input { width: 100%; padding: .55rem 1rem .55rem 2.4rem; background: #fff; border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: .85rem; font-family: inherit; outline: none; }
.chat-search-input:focus { border-color: #000; }

.chat-tabs-row { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; background: #fff; }
.ctab { flex: 1; padding: .65rem; text-align: center; font-size: .78rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: all .2s; }
.ctab.active { color: #000; border-bottom-color: #000; font-weight: 700; }

.chat-item { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; background: #fff; transition: background .15s; }
.chat-item:hover  { background: var(--bg2); }
.chat-item:active { background: var(--bg3); }
.chat-item.unread { background: #F8F8FF; }

.chat-av { width: 48px; height: 48px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; position: relative; border: 1px solid var(--border); }
.chat-av.group { border-radius: 14px; }
.online-dot  { position: absolute; bottom: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid #fff; }
.unread-badge { min-width: 18px; height: 18px; border-radius: 9px; background: #000; color: #fff; font-size: .62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; flex-shrink: 0; }

/* Chat room */
.room-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: .6rem 1rem; display: flex; align-items: center; gap: .6rem; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.join-banner-room { background: #FFFBE6; border-top: 1px solid #FFE082; padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.join-group-btn   { padding: .4rem 1rem; background: #000; border: none; border-radius: 8px; color: #fff; font-size: .8rem; font-weight: 700; cursor: pointer; font-family: inherit; }

.reply-bar { background: #F5F5FF; border-left: 3px solid #000; padding: .4rem .75rem; display: flex; align-items: center; justify-content: space-between; font-size: .75rem; color: var(--muted); flex-shrink: 0; }
.reply-bar button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1rem; }

.chat-msgs { flex: 1; overflow-y: auto; padding: .75rem; background: var(--bg2); scrollbar-width: thin; }
.chat-msgs::-webkit-scrollbar { width: 4px; }
.chat-msgs::-webkit-scrollbar-thumb { background: #ccc; border-radius: 2px; }

.msg-wrap    { display: flex; margin-bottom: .4rem; align-items: flex-end; gap: .4rem; }
.msg-wrap.me { flex-direction: row-reverse; }
.msg-mini-av { width: 24px; height: 24px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0; border: 1px solid var(--border); }

.bubble      { max-width: 72%; padding: .55rem .85rem; border-radius: 16px; font-size: .85rem; line-height: 1.5; word-break: break-word; }
.bubble.me   { background: #000; color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { background: #fff; color: #000; border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.bubble.sticker { background: transparent !important; border: none !important; font-size: 3.5rem; padding: .25rem !important; }

.bubble-nick { font-size: .65rem; color: var(--gold-d); margin-bottom: .25rem; font-weight: 700; }
.reply-quote { background: rgba(0,0,0,.05); border-left: 2px solid #000; border-radius: 6px; padding: .3rem .5rem; margin-bottom: .4rem; font-size: .72rem; color: var(--muted); }
.reply-quote strong { color: #000; display: block; font-size: .68rem; }
.bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: .3rem; margin-top: .2rem; }
.bubble-time { font-size: .6rem; color: var(--muted2); }
.read-ticks  { font-size: .65rem; color: var(--blue); }

.voice-msg   { display: flex; align-items: center; gap: .6rem; min-width: 160px; }
.play-voice  { width: 30px; height: 30px; border-radius: 50%; background: #000; border: none; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.voice-bars  { display: flex; align-items: center; gap: 2px; flex: 1; }
.voice-dur   { font-size: .68rem; color: var(--muted); flex-shrink: 0; }

.typing-bar  { display: flex; align-items: center; gap: .4rem; padding: .4rem .75rem; flex-shrink: 0; background: var(--bg2); }
.typing-dots span { width: 6px; height: 6px; border-radius: 50%; background: #999; animation: tdot 1.2s infinite; display: inline-block; margin: 0 1px; }
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }

.sticker-tray { background: #fff; border-top: 1px solid var(--border); padding: .75rem; display: none; flex-wrap: wrap; gap: .4rem; max-height: 140px; overflow-y: auto; flex-shrink: 0; }
.sticker-tray.open { display: flex; }

.chat-input-bar { background: #fff; border-top: 1px solid var(--border); padding: .6rem .75rem max(.6rem, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: .5rem; flex-shrink: 0; }
.chat-input-bar.locked { opacity: .4; pointer-events: none; }
.chat-textarea  { flex: 1; padding: .6rem .85rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; color: var(--text); font-size: .88rem; font-family: inherit; outline: none; resize: none; max-height: 100px; line-height: 1.4; }
.chat-textarea:focus { border-color: #000; }
.chat-send      { width: 38px; height: 38px; border-radius: 50%; background: #000; border: none; color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.voice-btn      { width: 38px; height: 38px; border-radius: 50%; background: #FFF0F0; border: 1px solid #FFCDD2; display: flex; align-items: center; justify-content: center; font-size: 1rem; cursor: pointer; flex-shrink: 0; }
.voice-btn.rec  { background: var(--red); border-color: var(--red); color: #fff; animation: pulse .8s infinite; }

.attach-wrap    { position: relative; flex-shrink: 0; }
.attach-sheet   { position: absolute; bottom: 100%; left: 0; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 1rem; display: none; grid-template-columns: repeat(4,1fr); gap: .75rem; min-width: 240px; z-index: 10; margin-bottom: .25rem; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.attach-sheet.open { display: grid; }
.attach-opt     { display: flex; flex-direction: column; align-items: center; gap: .35rem; cursor: pointer; }
.attach-icon    { width: 48px; height: 48px; border-radius: 14px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; transition: background .15s; }
.attach-opt:hover .attach-icon { background: var(--bg4); }
.attach-lbl     { font-size: .65rem; color: var(--muted); }

.ctx-menu  { position: fixed; z-index: 200; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .4rem 0; min-width: 160px; box-shadow: 0 8px 32px rgba(0,0,0,.12); display: none; }
.ctx-menu.open { display: block; }
.ctx-item  { padding: .6rem 1rem; font-size: .82rem; cursor: pointer; display: flex; align-items: center; gap: .6rem; color: var(--text); }
.ctx-item:hover { background: var(--bg3); }
.ctx-item.danger { color: var(--red); }

/* =============================================
   MUSIC SCREEN
   ============================================= */
.music-tabs-row { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; background: #fff; }
.mtab { flex: 1; padding: .65rem .3rem; text-align: center; font-size: .72rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: all .2s; }
.mtab.active { color: #000; border-bottom-color: #000; font-weight: 700; }

.track-item { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; background: #fff; transition: background .15s; }
.track-item:hover { background: var(--bg2); }
.track-thumb { width: 46px; height: 46px; border-radius: 8px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; border: 1px solid var(--border); position: relative; overflow: hidden; }
.track-thumb-bg    { position: absolute; inset: 0; opacity: .15; display: flex; align-items: center; justify-content: center; font-size: 4rem; filter: blur(6px); }
.track-thumb-emoji { position: relative; z-index: 1; }
.pbar { width: 3px; background: #000; border-radius: 2px; animation: pbanim .8s ease-in-out infinite; }
.pbar:nth-child(2) { animation-delay: .2s; }
.pbar:nth-child(3) { animation-delay: .4s; }

.mini-player { position: fixed; bottom: 56px; left: 0; right: 0; z-index: 70; background: #fff; border-top: 1px solid var(--border); display: none; align-items: center; gap: .75rem; padding: .6rem 1rem; cursor: pointer; box-shadow: 0 -2px 12px rgba(0,0,0,.08); }
.mini-player.show { display: flex; }
#mini-prog { position: absolute; top: 0; left: 0; height: 2px; background: #000; }
.mini-thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; border: 1px solid var(--border); }
.mini-play  { width: 32px; height: 32px; border-radius: 50%; background: #000; border: none; font-size: .95rem; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; }

.artwork { width: 100%; aspect-ratio: 1; border-radius: 20px; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 7rem; border: 1px solid var(--border); position: relative; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.artwork-bg    { position: absolute; inset: 0; opacity: .12; display: flex; align-items: center; justify-content: center; font-size: 20rem; filter: blur(30px); }
.artwork-emoji { position: relative; z-index: 1; }
.artwork.playing .artwork-emoji { animation: pulse 2s ease-in-out infinite; }

.prog-bar  { width: 100%; height: 4px; background: var(--bg4); border-radius: 2px; cursor: pointer; position: relative; margin-bottom: .4rem; }
.prog-fill { height: 100%; background: #000; border-radius: 2px; width: 0; pointer-events: none; }
.prog-dot  { position: absolute; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: #000; left: 0; margin-left: -6px; pointer-events: none; }
.play-big  { width: 60px; height: 60px; border-radius: 50%; background: #000; border: none; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.2); }
.ctrl-btn  { width: 42px; height: 42px; border-radius: 50%; background: transparent; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); transition: color .2s; }
.ctrl-btn:hover { color: #000; }
.ctrl-btn.on { color: #000; }
.mode-btn  { flex: 1; padding: .45rem; text-align: center; font-size: .76rem; border-radius: 8px; cursor: pointer; color: var(--muted); border: none; background: transparent; font-family: inherit; transition: all .22s; }
.mode-btn.active { background: #000; color: #fff; border: none; }

/* =============================================
   SETTINGS SCREEN
   ============================================= */
.settings-profile-hdr { display: flex; flex-direction: column; align-items: center; padding: 1.5rem 1rem 1rem; background: var(--bg2); border-bottom: 1px solid var(--border); }
.settings-av { width: 80px; height: 80px; border-radius: 50%; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; border: 2px solid #000; position: relative; }
.avatar-edit-btn { position: absolute; bottom: 0; right: 0; width: 26px; height: 26px; border-radius: 50%; background: #000; display: flex; align-items: center; justify-content: center; font-size: .75rem; color: #fff; border: 2px solid #fff; cursor: pointer; }
.settings-sec  { font-size: .65rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); padding: 1rem 1rem .4rem; }
.settings-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin: 0 .75rem; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.settings-row  { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.settings-row:last-child { border: none; }
.settings-row:hover { background: var(--bg2); }
.settings-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.logout-row { margin: .75rem .75rem 1rem; padding: .85rem; background: #FFF5F5; border: 1px solid #FFCDD2; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer; color: var(--red); font-weight: 600; }

/* =============================================
   CHANNEL SCREEN
   ============================================= */
.channel-cover { width: 100%; height: 200px; position: relative; overflow: hidden; flex-shrink: 0; background: var(--bg3); }
.ch-cover-over { position: absolute; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: linear-gradient(to bottom, rgba(0,0,0,.4), transparent); }
.ch-cover-emoji { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 6rem; }
.ch-av-big { width: 80px; height: 80px; border-radius: 50%; background: var(--bg3); border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin-bottom: .75rem; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.ch-stats-row { display: flex; gap: 1.5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
.ch-follow-btn { flex: 1; padding: .6rem; border-radius: 10px; font-size: .85rem; font-weight: 700; cursor: pointer; font-family: inherit; border: none; background: #000; color: #fff; transition: all .2s; }
.ch-follow-btn:hover { background: #222; }
.ch-follow-btn.following { background: #fff; color: #000; border: 1px solid #000; }
.chtab { flex: 1; padding: .7rem; text-align: center; font-size: .78rem; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: all .2s; }
.chtab.active { color: #000; border-bottom-color: #000; font-weight: 700; }
.ch-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; padding: 2px; }
.grid-short { aspect-ratio: 9/16; background: var(--bg3); display: flex; align-items: center; justify-content: center; font-size: 2rem; cursor: pointer; position: relative; overflow: hidden; }

/* =============================================
   ADMIN GATE + PANEL
   ============================================= */
#admin-gate { min-height: 100vh; background: var(--bg2); display: none; align-items: center; justify-content: center; padding: 1.5rem; position: fixed; inset: 0; z-index: 300; }
#admin-gate.open { display: flex; }
.gate-card { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 2rem 1.75rem; animation: fadeIn .6s ease; box-shadow: 0 8px 32px rgba(0,0,0,.1); }
.pin-wrap  { display: flex; gap: .6rem; justify-content: center; margin-bottom: 1.25rem; }
.pin-digit { width: 52px; height: 60px; background: var(--bg3); border: 1px solid var(--border2); border-radius: 10px; text-align: center; font-size: 1.5rem; font-family: inherit; color: var(--text); outline: none; transition: border .2s; }
.pin-digit:focus { border-color: #000; box-shadow: 0 0 0 3px rgba(0,0,0,.1); }
.gate-msg  { padding: .6rem .9rem; border-radius: 8px; font-size: .8rem; margin-bottom: .9rem; display: none; align-items: center; gap: .5rem; }
.gate-msg.err { background: #FFF0F0; border: 1px solid var(--red);   color: var(--red);   display: flex; }
.gate-msg.ok  { background: #F0FFF4; border: 1px solid var(--green); color: var(--green); display: flex; }

.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: .75rem 1rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.admin-role-badge { background: #f0f0f0; border: 1px solid #ddd; border-radius: 20px; padding: .15rem .6rem; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: #333; font-weight: 600; }
.admin-logout-btn { padding: .35rem .75rem; background: #FFF0F0; border: 1px solid #FFCDD2; border-radius: 8px; color: var(--red); font-size: .75rem; cursor: pointer; font-family: inherit; }
.admin-nav-row { display: flex; overflow-x: auto; border-bottom: 1px solid var(--border); background: #fff; scrollbar-width: none; flex-shrink: 0; }
.admin-nav-row::-webkit-scrollbar { display: none; }
.anav { padding: .7rem 1rem; font-size: .72rem; white-space: nowrap; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; transition: all .2s; }
.anav.active { color: #000; border-bottom-color: #000; font-weight: 700; }
.admin-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; margin-bottom: 1rem; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.admin-card-title { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: #333; font-weight: 700; margin-bottom: 1rem; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; text-align: center; }
.stat-num  { font-size: 1.6rem; font-weight: 700; color: #000; }
.stat-lbl  { font-size: .65rem; color: var(--muted); margin-top: .2rem; letter-spacing: .08em; }
.live-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: lpulse 1.2s infinite; display: inline-block; }
.act-btn   { padding: .3rem .6rem; border-radius: 6px; font-size: .65rem; cursor: pointer; border: 1px solid; font-family: inherit; transition: all .18s; }
.act-verify  { background: #F5F5F5; border-color: #ccc;         color: #333; }
.act-block   { background: #FFF0F0; border-color: #FFCDD2;      color: var(--red); }
.act-promote { background: #E8F0FE; border-color: #BBDEFB;      color: var(--blue); }
.bc-textarea { width: 100%; padding: .75rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: inherit; font-size: .88rem; resize: none; outline: none; margin-bottom: .75rem; }
.bc-textarea:focus { border-color: #000; }
.bc-send-btn { width: 100%; padding: .75rem; background: #000; color: #fff; font-size: .85rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; border: none; border-radius: 10px; cursor: pointer; font-family: inherit; }
.admin-search { width: 100%; padding: .55rem .85rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .82rem; font-family: inherit; outline: none; margin-bottom: .75rem; }
.admin-search:focus { border-color: #000; }

.status-bg-sw { width: 28px; height: 28px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; flex-shrink: 0; transition: transform .15s; }
.status-bg-sw.active { border-color: #000; transform: scale(1.1); }

/* =============================================
   THEME PICKER — user-customizable colors
   ============================================= */
.theme-picker-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin: 0 .75rem 1rem; padding: 1.25rem; box-shadow: 0 1px 6px rgba(0,0,0,.04); }
.theme-picker-title { font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; color: #333; font-weight: 700; margin-bottom: 1rem; }
.theme-swatch-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.theme-swatch { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: transform .15s, border-color .15s; flex-shrink: 0; }
.theme-swatch:hover { transform: scale(1.1); }
.theme-swatch.active { border-color: #000; transform: scale(1.12); }
.theme-custom-row { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.theme-custom-row label { font-size: .8rem; color: var(--muted); flex: 1; }
.theme-custom-row input[type="color"] { width: 44px; height: 32px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; background: none; padding: 2px; }
.theme-reset-btn { margin-top: .85rem; width: 100%; padding: .55rem; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: .8rem; cursor: pointer; font-family: inherit; }
