:root {
    --bg: #05060f;
    --bg-soft: #0c0e1c;
    --card: #12152b;
    --card-2: #171a33;
    --border: #23264a;
    --text: #eef0ff;
    --muted: #9aa0c7;
    --primary: #8b5cf6;
    --primary-2: #c026d3;
    --accent: #22d3ee;
    --danger: #f43f5e;
    --success: #34d399;
    --gold: #fbbf24;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #c026d3 100%);
    --shadow: 0 18px 50px rgba(124, 58, 237, .25);
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(1200px 600px at 80% -10%, #1a1040 0%, transparent 60%),
                radial-gradient(900px 500px at 0% 110%, #2a0a3a 0%, transparent 55%),
                var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Yıldız arka plan */
.stars {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent),
        radial-gradient(1px 1px at 60% 70%, #c9c9ff 50%, transparent),
        radial-gradient(1px 1px at 80% 20%, #fff 50%, transparent),
        radial-gradient(1px 1px at 40% 80%, #d8b4fe 50%, transparent),
        radial-gradient(1px 1px at 90% 60%, #fff 50%, transparent),
        radial-gradient(1px 1px at 10% 90%, #a5b4fc 50%, transparent);
    opacity: .5;
}

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 22px; }

/* ---------------- Navbar ---------------- */
.nav {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px);
    background: rgba(8, 9, 22, .72);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; gap: 26px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; }
.brand .logo {
    width: 34px; height: 34px; border-radius: 11px; background: var(--grad);
    display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow);
}
.nav-links { display: flex; gap: 22px; margin-left: 14px; }
.nav-links a { color: var(--muted); font-weight: 600; padding: 6px 2px; border-bottom: 2px solid transparent; transition: .2s; }
.nav-links a:hover, .nav-links a.active { color: #fff; border-color: var(--primary); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--card); border: 1px solid var(--border);
    padding: 7px 13px; border-radius: 999px; font-weight: 700; font-size: 14px;
}
.pill.gold { color: var(--gold); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.pill-ava { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: inline-block; flex-shrink: 0; }
.pill-ava img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; cursor: pointer; font-weight: 700; font-size: 15px;
    padding: 11px 20px; border-radius: 12px; color: #fff;
    background: var(--card-2); border: 1px solid var(--border); transition: .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--grad); border: none; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border: none; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 17px; border-radius: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- Cards ---------------- */
.card {
    background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border); border-radius: var(--radius); padding: 22px;
}
.grid { display: grid; gap: 18px; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .cols-3, .cols-2 { grid-template-columns: 1fr; } }

/* ---------------- Forms ---------------- */
.auth-wrap { max-width: 440px; margin: 60px auto; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 7px; font-weight: 600; }
.input, select, textarea {
    width: 100%; background: var(--bg-soft); border: 1px solid var(--border);
    color: var(--text); padding: 12px 14px; border-radius: 11px; font-size: 15px; font-family: inherit;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,.2); }
textarea { resize: vertical; min-height: 90px; }

.alert { padding: 12px 15px; border-radius: 11px; margin-bottom: 16px; font-weight: 600; font-size: 14px; }
.alert-error { background: rgba(244,63,94,.12); color: #fda4af; border: 1px solid rgba(244,63,94,.3); }
.alert-ok { background: rgba(52,211,153,.12); color: #6ee7b7; border: 1px solid rgba(52,211,153,.3); }
.alert-info { background: rgba(34,211,238,.1); color: #67e8f9; border: 1px solid rgba(34,211,238,.3); }

.title-grad {
    background: var(--grad); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; font-weight: 900;
}

/* ---------------- Match / Home ---------------- */
.hero { text-align: center; padding: 40px 0 20px; }
.match-stage {
    position: relative; width: 100%; max-width: 560px; margin: 24px auto;
    display: flex; justify-content: center; gap: 0;
}
.match-card {
    width: 240px; height: 300px; border-radius: 20px; overflow: hidden;
    border: 3px solid rgba(244,63,94,.6); background: var(--card);
    box-shadow: var(--shadow);
}
.match-card:first-child { transform: rotate(-5deg) translateX(20px); z-index: 2; }
.match-card:last-child { transform: rotate(5deg) translateX(-20px); }
.match-card img, .match-ph { width: 100%; height: 100%; object-fit: cover; }
.match-ph { display: grid; place-items: center; font-size: 60px; background: var(--grad); }
.online-count { color: var(--muted); font-weight: 700; margin: 18px 0; }
.online-count .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--success); margin-right: 6px; box-shadow: 0 0 8px var(--success); }

/* Gender filter chips */
.chips { display: flex; gap: 10px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.chip {
    padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--card); color: var(--muted); font-weight: 700; cursor: pointer; font-size: 14px; transition: .15s;
}
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }

/* ---------------- Call screen ---------------- */
.call-stage {
    position: relative; width: 100%; max-width: 1100px; margin: 0 auto;
    aspect-ratio: 16 / 9; height: auto; min-height: 0;
    border-radius: 20px; overflow: hidden; background: #06070f; border: 1px solid var(--border);
}
/* Arka plan: karşı görüntünün bulanık/koyu kopyası (boş alanları profesyonelce doldurur) */
#remoteBg {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    filter: blur(34px) brightness(.45) saturate(1.1); transform: scale(1.15); z-index: 0;
}
/* Asıl karşı görüntü: TÜM kare kırpılmadan görünür (contain) */
#remoteVideo {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    background: transparent; z-index: 1;
}
#localVideo {
    position: absolute; bottom: 18px; right: 18px; width: 200px; height: 140px;
    object-fit: cover; border-radius: 14px; border: 2px solid var(--primary); background: #000; z-index: 3;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
    transform: scaleX(-1); /* Kendi kameranı ayna gibi göster */
}
#remoteVideo, #localVideo { cursor: pointer; }

/* Kendi kameraya tıklayınca: kendi görüntün büyür, karşı taraf küçülür */
.call-stage.swapped #localVideo {
    position: absolute; inset: 0; width: 100%; height: 100%;
    bottom: auto; right: auto; border-radius: 0; border: none; object-fit: contain; z-index: 1;
    box-shadow: none;
}
.call-stage.swapped #remoteVideo {
    position: absolute; inset: auto; bottom: 18px; right: 18px; width: 200px; height: 140px;
    object-fit: cover; border-radius: 14px; border: 2px solid var(--primary); z-index: 3;
    box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.call-status {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 4;
    background: rgba(0,0,0,.55); padding: 8px 18px; border-radius: 999px; font-weight: 700; backdrop-filter: blur(6px);
}
.call-controls {
    position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 5;
    display: flex; gap: 14px;
}
.ctrl {
    width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
    display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,.14); color: #fff; backdrop-filter: blur(6px); transition: .15s;
}
.ctrl:hover { background: rgba(255,255,255,.25); }
.ctrl.off { background: var(--danger); }
.ctrl.hangup { background: var(--danger); width: 64px; }

/* ---------------- User cards ---------------- */
.user-card { text-align: center; }
.avatar {
    width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px;
    background: var(--grad); display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff;
    border: 3px solid var(--border); position: relative;
}
.avatar .status-dot {
    position: absolute; bottom: 4px; right: 6px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--muted); border: 3px solid var(--card);
}
.avatar .status-dot.on { background: var(--success); box-shadow: 0 0 8px var(--success); }
.user-card h3 { font-size: 17px; margin-bottom: 2px; }
.user-card .meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }

/* ---------------- Messages ---------------- */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; height: 70vh; }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; height: auto; } }
.thread-list { overflow-y: auto; }
.thread-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; cursor: pointer; transition: .15s; }
.thread-item:hover, .thread-item.active { background: var(--card-2); }
.thread-item .avatar { width: 46px; height: 46px; font-size: 18px; margin: 0; }
.thread-item .ti-name { font-weight: 700; font-size: 15px; }
.thread-item .ti-last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.chat-panel { display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 8px; }
.bubble { max-width: 70%; padding: 10px 14px; border-radius: 16px; font-size: 14px; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--grad); border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble .t { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input input { flex: 1; }

/* ---------------- Tokens ---------------- */
.token-pack { text-align: center; position: relative; transition: .18s; }
.token-pack:hover { transform: translateY(-4px); border-color: var(--primary); }
.token-pack .amt { font-size: 38px; font-weight: 900; }
.token-pack .price { color: var(--muted); margin: 6px 0 16px; }
.token-pack .badge-pop { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--gold); color: #1a1208; font-weight: 800; font-size: 12px; padding: 4px 12px; border-radius: 999px; }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 30px 0; color: var(--muted); font-size: 14px; }
.footer a { color: var(--muted); }
.footer a:hover { color: #fff; }

.section-title { font-size: 26px; font-weight: 800; margin: 8px 0 20px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }
.flex { display: flex; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.rules-list li { margin: 10px 0 10px 18px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); border: 1px solid var(--border); }
.token-promo {
    display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
    padding: 11px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
    background: linear-gradient(135deg, rgba(251,191,36,.15), rgba(192,38,211,.15));
    border: 1px solid var(--gold); color: var(--text); transition: .18s;
}
.token-promo:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(251,191,36,.18); }
.token-promo strong { color: var(--gold); }
.tag.kadin { color: #f9a8d4; }
.tag.erkek { color: #93c5fd; }

/* ---------------- Üç nokta menü (dropdown) ---------------- */
.menu { position: relative; display: inline-block; }
.menu-btn {
    width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
    background: var(--card-2); border: 1px solid var(--border); color: var(--text);
    font-size: 20px; line-height: 1; display: grid; place-items: center; transition: .15s;
}
.menu-btn:hover { background: var(--card); border-color: var(--primary); }
.menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 170px;
    background: var(--card); border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow); padding: 6px; display: none; text-align: left;
}
.menu.open .menu-list { display: block; }
.menu-list a, .menu-list button {
    display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
    padding: 9px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
    background: transparent; border: none; color: var(--text); cursor: pointer;
}
.menu-list a:hover, .menu-list button:hover { background: var(--card-2); }
.menu-list .danger { color: #fda4af; }

/* ---------------- Galeri ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.gallery-item { position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item form { position: absolute; top: 6px; right: 6px; margin: 0; }
.gallery-del {
    width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(244,63,94,.9); color: #fff; font-weight: 800; font-size: 13px; line-height: 1;
    display: grid; place-items: center;
}
.gallery-del:hover { background: var(--danger); }

/* ---------------- Modal ---------------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200; background: rgba(3,4,12,.78);
    backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px;
}
.modal {
    background: linear-gradient(180deg, var(--card) 0%, var(--bg-soft) 100%);
    border: 1px solid var(--border); border-radius: 20px; padding: 30px; max-width: 460px;
    width: 100%; text-align: center; box-shadow: var(--shadow);
}
.modal h2 { margin: 10px 0; }
.modal select { width: 100%; }

/* Görüşme içi sohbet */
.call-chat {
    position: absolute; right: 14px; bottom: 92px; z-index: 7;
    width: 300px; max-width: 70vw; display: none; flex-direction: column;
    background: rgba(10,12,26,.82); backdrop-filter: blur(8px);
    border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
    contain: layout paint;
    transform: translateZ(0);
}
.call-chat.open { display: flex; }
.call-chat-msgs { max-height: 240px; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.cc-msg { max-width: 80%; padding: 7px 11px; border-radius: 13px; font-size: 13px; word-wrap: break-word; }
.cc-msg.me { align-self: flex-end; background: var(--grad); }
.cc-msg.them { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); }
.call-chat-input { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--border); }
.call-chat-input input { flex: 1; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 9px 11px; border-radius: 10px; font-size: 16px; font-family: inherit; }
.call-chat-input input:focus { outline: none; border-color: var(--primary); }
.call-chat-input button { border: none; background: var(--grad); color: #fff; width: 40px; border-radius: 10px; cursor: pointer; font-size: 16px; }
@media (max-width: 720px) {
    .call-chat {
        right: 10px; left: 10px; width: auto; max-width: none;
        bottom: calc(82px + env(safe-area-inset-bottom));
        max-height: min(260px, calc(var(--call-stage-h, 78vh) - 150px));
    }
    .call-chat-msgs { max-height: 170px; }
    body.call-chat-open .call-stage { overflow: hidden; }
}

/* Güzelleştirme butonu aktif durumu */
.ctrl.on { background: var(--grad); color: #fff; box-shadow: 0 0 0 3px rgba(124,92,255,.25); }

/* AI yaş uyarı bandı */
.ai-banner {
    position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 6;
    background: rgba(244,63,94,.92); padding: 8px 16px; border-radius: 999px; font-weight: 700;
    font-size: 13px; display: none;
}

/* Admin panel */
.admin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 800px) { .admin-grid { grid-template-columns: repeat(2,1fr); } }
.stat-card { text-align: center; padding: 18px; }
.stat-card .n { font-size: 30px; font-weight: 900; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); }
table.tbl th { color: var(--muted); font-weight: 700; }
.badge-role { padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-role.admin { background: rgba(192,38,211,.2); color: #e879f9; }
.badge-role.moderator { background: rgba(34,211,238,.15); color: #67e8f9; }
.badge-banned { background: rgba(244,63,94,.18); color: #fda4af; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }

/* ============================================================
   📱 MOBİL / TELEFON GÖRÜNÜMÜ
   ============================================================ */
@media (max-width: 720px) {
    .wrap { padding: 0 14px; }

    /* Navbar: logo + menü + sağ taraf alt alta sığsın */
    .nav-inner { height: auto; min-height: 58px; flex-wrap: wrap; gap: 10px 14px; padding: 8px 0; }
    .brand { font-size: 19px; }
    .brand .logo { width: 30px; height: 30px; font-size: 16px; }
    .nav-links { gap: 14px; margin-left: 0; order: 3; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
    .nav-links a { font-size: 14px; white-space: nowrap; }
    .nav-right { gap: 8px; }
    .nav-right .pill { padding: 6px 10px; font-size: 13px; }
    .nav-right .btn { padding: 8px 12px; font-size: 14px; }

    /* Eşleşme ekranı */
    .hero { padding: 22px 0 12px; }
    .hero h1 { font-size: 25px !important; }
    .match-stage { gap: 0; margin: 16px auto; }
    .match-card { width: 44vw; height: 230px; max-width: 200px; }
    .match-card:first-child { transform: rotate(-4deg) translateX(10px); }
    .match-card:last-child { transform: rotate(4deg) translateX(-10px); }
    .match-ph { font-size: 46px; }
    .chips { gap: 8px; }
    .chip { padding: 9px 15px; font-size: 14px; }
    .btn-lg { width: 100%; padding: 15px 18px; font-size: 16px; }

    /* Görüntülü arama ekranı */
    .call-stage { aspect-ratio: auto; height: var(--call-stage-h, 78vh); min-height: 0; max-width: none; border-radius: 14px; }
    #localVideo { width: 110px; height: 150px; bottom: 96px; right: 12px; border-radius: 12px; }
    .call-stage.swapped #remoteVideo { width: 110px; height: 150px; bottom: 96px; right: 12px; border-radius: 12px; }
    .call-controls { gap: 8px; bottom: 16px; width: 100%; justify-content: center; flex-wrap: wrap; padding: 0 8px; }
    .ctrl { width: 46px; height: 46px; font-size: 18px; }
    .ctrl.hangup { width: 50px; }
    .call-status { font-size: 13px; padding: 6px 14px; }

    /* Modallar */
    .modal { padding: 22px 18px; border-radius: 16px; }
    .modal .flex { flex-wrap: wrap; }
    .modal .btn { width: 100%; }

    /* Sohbet / tablolar yatay kaydırma */
    .card { padding: 16px; }
    table.tbl { display: block; overflow-x: auto; white-space: nowrap; }
    .section-title { font-size: 21px; }
    .admin-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
    .nav-right .btn { padding: 7px 10px; }
    .match-card { height: 200px; }
    .call-controls { gap: 6px; }
    .ctrl { width: 42px; height: 42px; font-size: 17px; }
    .ctrl.hangup { width: 46px; }
}
