:root {
  --bg: #000;
  --panel: #0c0c0c;
  --her: #262626;
  --me1: #7a2cf2;
  --me2: #3b6cf6;
  --text: #f5f5f5;
  --muted: #a8a8a8;
  --line: #1f1f1f;
  --green: #2ecc71;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.app { height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); }

/* zaglavlje */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  padding-top: max(12px, env(safe-area-inset-top)); background: var(--bg); }
.avatar { position: relative; width: 40px; height: 40px; flex: none; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 18%; }
.avatar .dot { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg); }
.top.off .dot, .card.off .dot { display: none; }
.avatar.big { width: 96px; height: 96px; margin: 0 auto; }
.avatar.big .dot { width: 18px; height: 18px; border-width: 3px; right: 4px; bottom: 4px; border-color: var(--panel); }
.name { font-weight: 600; font-size: 16px; }
.status { font-size: 12px; color: var(--muted); }

/* poruke */
.chat { flex: 1; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 3px;
  -webkit-overflow-scrolling: touch; }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0 12px; }
.row { display: flex; align-items: flex-end; gap: 8px; max-width: 100%; }
.row.me { justify-content: flex-end; }
.row.gap { margin-top: 8px; }
.row .mini { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; flex: none; visibility: hidden; }
.row.last .mini { visibility: visible; }
.msg { max-width: 76%; padding: 9px 13px; border-radius: 20px; font-size: 15px; line-height: 1.35;
  overflow-wrap: anywhere; white-space: pre-wrap; animation: pop .18s ease-out; }
.her .msg { background: var(--her); }
.me .msg { background: linear-gradient(135deg, var(--me1), var(--me2)); color: #fff; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* nestajuća slika */
.once { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 9px; border-radius: 22px;
  background: var(--her); border: 1px solid #333; color: var(--text); font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; animation: pop .2s ease-out; }
.once .ico { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--me1), var(--me2)); color: #fff; flex: none; }
.once .ico svg { width: 15px; height: 15px; }
.once.secret .ico { background: linear-gradient(135deg, #ff3d71, #ff8a3d); }
.once.viewed { background: transparent; color: var(--muted); font-weight: 400; cursor: default; }
.once.viewed .ico { background: transparent; color: var(--muted); }
.once.viewed .ico svg { width: 22px; height: 22px; }

/* Fanvue kartica */
.link { max-width: 76%; background: var(--her); border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--text);
  display: block; animation: pop .2s ease-out; }
.link .lt { padding: 11px 14px 4px; font-weight: 600; font-size: 15px; }
.link .ls { padding: 0 14px 11px; font-size: 13px; color: var(--muted); }
.link .lb { display: block; text-align: center; padding: 11px; font-weight: 600; font-size: 15px;
  background: linear-gradient(135deg, var(--me1), var(--me2)); color: #fff; }

/* Viđeno i piše... */
.seen { align-self: flex-end; font-size: 11px; color: var(--muted); margin: 2px 4px 0; }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--her); border-radius: 20px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #8e8e8e; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* unos */
.bar { display: flex; gap: 8px; padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.bar input { flex: 1; min-width: 0; background: #121212; border: 1px solid #262626; color: var(--text); border-radius: 22px;
  padding: 11px 16px; font-size: 16px; outline: none; }
.bar input:focus { border-color: #3a3a3a; }
.bar button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: #4f7cff; cursor: pointer; flex: none; }
.note { text-align: center; font-size: 10.5px; color: #6b6b6b; padding: 0 0 6px; }

/* ulaz 18+ */
.gate { position: fixed; inset: 0; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.gate.hide { display: none; }
.card { width: 100%; max-width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 28px 20px 20px; text-align: center; }
.gname { font-size: 20px; font-weight: 700; margin-top: 12px; }
.gsub { font-size: 13px; color: var(--muted); margin: 2px 0 22px; }
.cta { width: 100%; border: 0; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 600; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--me1), var(--me2)); }
.gfine { font-size: 11.5px; color: #7a7a7a; margin-top: 14px; line-height: 1.5; }

/* prikaz slike preko cijelog ekrana */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.96); display: none; flex-direction: column; align-items: center;
  justify-content: center; z-index: 20; overflow: hidden; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox img.blur { filter: brightness(.92); }
.lbbar { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px; height: 3px; border-radius: 3px;
  background: rgba(255,255,255,.25); overflow: hidden; z-index: 1; }
.lbbar i { display: block; height: 100%; width: 100%; background: #fff; }
.lbcta { position: absolute; left: 16px; right: 16px; bottom: max(28px, env(safe-area-inset-bottom)); width: auto;
  text-align: center; text-decoration: none; display: block; }
.lbcta[hidden], .lbbar[hidden] { display: none; }
/* cekanje na prihvacanje zahtjeva */
.gwait { display: flex; align-items: center; justify-content: center; gap: 10px; color: #cfcfcf; font-size: 15px; padding: 14px 0 4px; }
.spin { width: 16px; height: 16px; border: 2px solid #555; border-top-color: #8b5cf6; border-radius: 50%; animation: vrti .8s linear infinite; }
@keyframes vrti { to { transform: rotate(360deg); } }
.gwait .ok { color: #22c55e; font-weight: 700; }
