/* ========================================
   OmGly — App CSS
   Mobile-first, Dark Theme
   ======================================== */

:root {
    --bg:          #0a0a0a;
    --bg2:         #111111;
    --bg3:         #1c1c1c;
    --card:        #1e1e1e;
    --card2:       #252525;
    --border:      #2a2a2a;
    --orange:      #f07030;
    --orange-dark: #c85a20;
    --orange-light:#ff8f50;
    --gold:        #f5a623;
    --red:         #e53935;
    --red-dark:    #c62828;
    --green:       #43a047;
    --purple:      #6c3fc5;
    --text:        #ffffff;
    --text2:       #cccccc;
    --text3:       #888888;
    --text4:       #555555;
    --radius:      14px;
    --radius-sm:   8px;
    --radius-lg:   24px;
    --shadow:      0 4px 24px rgba(0,0,0,0.5);
    --nav-h:       72px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { text-decoration: none; }
input, textarea { font-family: inherit; }

/* ===== ONBOARDING PAGE ===== */
.onboarding-page {
    background: #ffffff;
    color: #222;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}
.onboarding-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
}
.onboarding-logo {
    text-align: center;
    margin-bottom: 8px;
}
.logo-img { height: 60px; }

/* Username row */
.username-section { text-align: center; margin-bottom: 32px; }
.label-small { font-size: 13px; color: var(--orange); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.username-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.username-display { font-size: 1.7rem; font-weight: 800; color: var(--orange); }
.dice-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}
.dice-btn:active { transform: scale(0.88) rotate(-15deg); }

/* Gender */
.gender-section { margin-bottom: 32px; }
.gender-title { text-align: center; font-size: 1.25rem; font-weight: 700; color: var(--orange); margin-bottom: 20px; }
.gender-options { display: flex; justify-content: center; gap: 32px; }
.gender-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.15s;
    background: none;
}
.gender-avatar {
    width: 90px; height: 90px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    display: flex; align-items: center; justify-content: center;
    transition: box-shadow 0.15s;
}
.gender-btn.active .gender-avatar { box-shadow: 0 0 0 3px var(--orange); }
.gender-label { font-size: 0.9rem; color: #888; font-weight: 500; }
.gender-btn.active .gender-label { color: var(--orange); font-weight: 700; }

/* Terms */
.terms-section { margin-bottom: 24px; }
.terms-label {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.85rem; color: #555; cursor: pointer;
    margin-bottom: 10px;
}
.terms-checkbox { display: none; }
.terms-custom-check {
    width: 22px; height: 22px; min-width: 22px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    margin-top: 1px;
}
.terms-checkbox:checked + .terms-custom-check {
    background: var(--red);
    border-color: var(--red);
}
.terms-checkbox:checked + .terms-custom-check::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: 700;
}
.terms-links { display: flex; gap: 8px; align-items: center; padding-left: 32px; }
.terms-link { color: var(--orange); font-size: 0.82rem; text-decoration: underline; }
.terms-sep { color: #aaa; }

/* Login button */
.btn-login {
    width: 100%;
    background: var(--orange);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    padding: 16px;
    border-radius: 50px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.15s;
    box-shadow: 0 4px 16px rgba(240,112,48,0.4);
}
.btn-login:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }
.btn-login:not(:disabled):active { transform: scale(0.97); }
.login-hint { text-align: center; color: #aaa; font-size: 0.8rem; margin-top: 10px; }

/* Loading overlay */
.loading-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 16px; z-index: 9999; color: white;
}

/* ===== APP DARK PAGES ===== */
.app-page {
    background: var(--bg);
    color: var(--text);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.dark-page { background: var(--bg); }

/* ===== SCREENS ===== */
.screen {
    display: none;
    position: absolute;
    inset: 0;
    bottom: var(--nav-h);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}
.screen.active { display: flex; flex-direction: column; }
#screenCall { bottom: 0; }

/* ===== TOP BAR ===== */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 48px 20px 0;
}
.online-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.coin-badge {
    background: var(--gold);
    border-radius: 50px;
    min-width: 54px; height: 32px;
    padding: 0 10px;
    display: flex; flex-direction: row;
    align-items: center; justify-content: center;
    gap: 4px;
    font-weight: 800;
    color: white;
    font-size: 0.85rem;
    box-shadow: 0 2px 12px rgba(245,166,35,0.5);
    transition: transform 0.12s;
}
.coin-badge:active { transform: scale(0.92); }
.coin-gem-img { flex-shrink: 0; }
.coin-icon { font-size: 1.1rem; line-height: 1; }

/* ===== DISCOVER MAIN (tap button) ===== */
.discover-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tap-btn {
    width: 260px; height: 260px;
    border-radius: 50%;
    background: transparent;
    position: relative;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
}
.tap-btn:active { transform: scale(0.96); }
.tap-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.tap-ring-1 { width: 260px; height: 260px; background: rgba(120,60,20,0.4); }
.tap-ring-2 { width: 200px; height: 200px; background: rgba(160,80,30,0.55); }
.tap-ring-3 { width: 140px; height: 140px; background: rgba(200,110,50,0.75); }
.tap-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-align: center;
    z-index: 1;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
@keyframes tap-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50%       { transform: translate(-50%, -50%) scale(1.06); opacity: 0.85; }
}
.tap-btn:not(:active) .tap-ring-1 { animation: tap-pulse 2.5s ease-in-out infinite; }
.tap-btn:not(:active) .tap-ring-2 { animation: tap-pulse 2.5s ease-in-out infinite 0.4s; }
.tap-btn:not(:active) .tap-ring-3 { animation: tap-pulse 2.5s ease-in-out infinite 0.8s; }

.discover-bottom {
    padding: 16px 20px calc(16px + var(--safe-bottom));
    display: flex; justify-content: center;
}
.filter-pill {
    display: flex; align-items: center; gap: 6px;
    color: var(--text3);
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    transition: all 0.15s;
}
.filter-pill:active { background: var(--bg3); }

/* ===== SEARCHING ===== */
#screenSearching {
    background: var(--orange);
    color: white;
}
.searching-header {
    display: flex; align-items: center; gap: 16px;
    padding: 48px 20px 0;
}
.close-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.searching-title { font-size: 1.6rem; font-weight: 800; }
.searching-body {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px 24px 40px;
    gap: 16px;
    text-align: center;
}
.searching-notice { font-size: 0.95rem; opacity: 0.9; max-width: 280px; line-height: 1.5; }
.searching-illustration svg { filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2)); }
.searching-status { font-size: 1rem; opacity: 0.9; }
.searching-filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.filter-tag {
    background: white;
    color: var(--orange);
    border-radius: 50px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex; align-items: center; gap: 6px;
}

/* ===== MATCH FOUND ===== */
#screenMatchFound {
    background: var(--bg);
    align-items: center;
    justify-content: center;
}
.match-found-container {
    display: flex; flex-direction: column;
    align-items: center; gap: 12px;
    padding: 40px 24px;
}
.match-avatar-wrap { margin-bottom: 8px; }
.match-avatar {
    width: 130px; height: 130px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    font-weight: 800;
    color: rgba(0,0,0,0.5);
    box-shadow: 0 6px 30px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.match-avatar img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}
.match-placeholder-img { width: 220px; margin-bottom: 8px; }
.match-username { font-size: 1.5rem; font-weight: 800; }
.match-country { display: flex; align-items: center; gap: 6px; color: var(--text3); font-size: 0.95rem; }
.match-score { font-size: 3rem; font-weight: 900; color: var(--orange); line-height: 1; margin: 8px 0; }

/* Image-based accept/skip buttons */
.match-actions-img {
    display: flex; align-items: center; justify-content: center;
    gap: 48px; margin-top: 20px;
}
.match-action-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: none; transition: transform 0.15s;
}
.match-action-btn:active { transform: scale(0.9); }
.match-action-btn span { font-size: 0.85rem; font-weight: 700; color: var(--text3); }
.match-action-skip img  { filter: grayscale(0.2); }
.match-action-accept img { filter: drop-shadow(0 4px 10px rgba(255,80,120,0.4)); }

/* Keep old classes for JS compatibility */
.match-actions { display: none; }
.btn-accept, .btn-skip { display: none; }

/* ===== VIDEO CALL ===== */
#screenCall { background: #000; }
.call-container { position: relative; width: 100%; height: 100%; }
.remote-video {
    width: 100%; height: 100%;
    object-fit: cover;
    background: #111;
}
.local-video {
    position: absolute;
    top: 12px; right: 12px;
    width: 100px; height: 140px;
    border-radius: 12px;
    object-fit: cover;
    background: #222;
    border: 2px solid rgba(255,255,255,0.2);
    box-shadow: var(--shadow);
    z-index: 10;
}
.call-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    justify-content: flex-end;
    padding: 0 0 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 40%);
    z-index: 20;
}
.call-partner-info { text-align: center; margin-bottom: 16px; }
.call-partner-name { color: white; font-size: 1.1rem; font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,0.8); }
.call-controls {
    display: flex; align-items: center; justify-content: center;
    gap: 24px;
}
.call-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
    border: 1px solid rgba(255,255,255,0.1);
}
.call-btn:active { transform: scale(0.9); }
.call-ctrl-img { filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.call-btn-end {
    background: transparent;
    width: 68px; height: 68px;
    border: none;
}
.call-btn.muted { background: rgba(229,57,53,0.7); }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 48px 20px 0;
}
.page-title { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.page-subtitle { padding: 8px 20px 0; color: var(--text3); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== HISTORY ===== */
.history-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.history-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    transition: background 0.12s;
}
.history-card:active { background: var(--card2); }
.history-avatar {
    width: 56px; height: 56px; min-width: 56px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; font-weight: 800;
    color: rgba(0,0,0,0.45);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.history-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.history-flag {
    position: absolute; bottom: -2px; right: -2px;
    font-size: 16px;
    background: var(--card);
    border-radius: 50%;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.history-info { flex: 1; min-width: 0; }
.history-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 6px; }
.history-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.history-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.history-btn-call { background: var(--orange); color: white; }
.history-btn-msg  { background: var(--card2); color: var(--text2); border: 1px solid var(--border); }
.history-btn .cost { display: flex; align-items: center; gap: 2px; color: var(--gold); font-size: 0.72rem; }
.history-select {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
}

/* ===== CHATS ===== */
.chats-list { padding: 8px 0; }
.chat-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 20px;
    transition: background 0.12s;
    cursor: pointer;
    position: relative;
}
.chat-item:active { background: var(--bg3); }
.chat-avatar-sm {
    width: 50px; height: 50px; min-width: 50px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 800;
    color: rgba(0,0,0,0.4);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.chat-avatar-sm img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-weight: 700; font-size: 0.92rem; margin-bottom: 3px; }
.chat-item-preview { color: var(--text3); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-item-time { color: var(--text4); font-size: 0.75rem; }
.chat-unread {
    background: var(--orange);
    color: white;
    border-radius: 50%;
    width: 20px; height: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

/* ===== CHAT ROOM ===== */
#screenChatRoom { bottom: 0; }
.chat-header {
    display: flex; align-items: center; gap: 12px;
    padding: 44px 16px 12px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.back-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.12s;
}
.back-btn:active { background: var(--bg3); }
.chat-header-info { display: flex; align-items: center; gap: 10px; }
.chat-header-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800;
    color: rgba(0,0,0,0.4);
}
.chat-header-name { font-weight: 700; font-size: 0.95rem; }
.chat-header-status { font-size: 0.75rem; color: var(--green); }
.chat-messages {
    flex: 1; overflow-y: auto;
    padding: 16px;
    display: flex; flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}
.msg-bubble {
    max-width: 72%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.45;
    word-break: break-word;
}
.msg-mine {
    background: var(--orange);
    color: white;
    border-radius: 18px 18px 4px 18px;
    align-self: flex-end;
}
.msg-theirs {
    background: var(--card);
    color: var(--text);
    border-radius: 18px 18px 18px 4px;
    align-self: flex-start;
    border: 1px solid var(--border);
}
.msg-time { font-size: 0.68rem; opacity: 0.6; margin-top: 3px; text-align: right; }
.chat-input-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px calc(10px + var(--safe-bottom));
    background: var(--bg2);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.chat-input {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}
.chat-input:focus { border-color: var(--orange); }
.chat-input::placeholder { color: var(--text4); }
.chat-send-btn {
    width: 44px; height: 44px;
    background: var(--orange);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    box-shadow: 0 2px 10px rgba(240,112,48,0.4);
}
.chat-send-btn:active { transform: scale(0.9); }

/* ===== STORE ===== */
#screenStore { background: var(--bg); }
.store-header {
    display: flex; align-items: center; gap: 12px;
    padding: 44px 16px 16px;
}
.store-title { font-size: 1.3rem; font-weight: 800; }
.store-body { flex: 1; overflow-y: auto; padding: 0 16px 24px; -webkit-overflow-scrolling: touch; }
.store-balance-card {
    background: linear-gradient(135deg, #f5a623, #e8900a);
    border-radius: var(--radius);
    padding: 24px 20px 20px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(245,166,35,0.4);
}
.store-balance-card::before {
    content: '';
    position: absolute; top: -30px; right: -30px;
    width: 100px; height: 100px;
    background: rgba(255,255,255,0.12);
    border-radius: 50%;
}
.store-gem-img { margin: 0 auto 8px; display: block; }
.coin-icon-lg { font-size: 1.8rem; display: block; margin-bottom: 4px; }
.store-bal-label { font-size: 0.85rem; color: rgba(255,255,255,0.85); font-weight: 600; }
.store-bal-amount { font-size: 2.8rem; font-weight: 900; color: white; text-shadow: 0 2px 8px rgba(0,0,0,.15); }
.store-section-title { font-size: 0.85rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; margin: 16px 0 10px; }
.store-rewarded-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--border);
    margin-bottom: 4px;
}
.rewarded-gem-img { flex-shrink: 0; }
.rewarded-icon {
    width: 42px; height: 42px;
    background: var(--bg3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: var(--text3);
    flex-shrink: 0;
}
.rewarded-info { flex: 1; }
.rewarded-info strong { font-size: 0.9rem; display: block; margin-bottom: 2px; }
.rewarded-sub { font-size: 0.78rem; color: var(--text3); display: flex; align-items: center; gap: 4px; }
.coin-icon-sm { color: var(--gold); font-size: 0.85rem; }
.btn-watch {
    background: var(--orange);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.15s;
}
.btn-watch:active { transform: scale(0.95); }
.store-packages-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.package-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px 14px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.15s;
    position: relative;
    cursor: pointer;
}
.package-card:active { transform: scale(0.97); border-color: var(--orange); }
.package-card.featured { border-color: var(--orange); }
.package-badge {
    position: absolute; top: -1px; left: 50%; transform: translateX(-50%);
    background: var(--red);
    color: white; font-size: 0.65rem; font-weight: 800;
    padding: 3px 10px;
    border-radius: 0 0 8px 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.package-icon { font-size: 2.2rem; display: block; margin: 8px 0 6px; }
.package-coins { font-size: 1.2rem; font-weight: 800; color: var(--text); margin-bottom: 2px; }
.package-label { font-size: 0.75rem; color: var(--text3); margin-bottom: 10px; }
.package-price {
    background: var(--orange);
    color: white; font-size: 0.85rem; font-weight: 700;
    padding: 7px 12px;
    border-radius: 20px;
    display: inline-block;
}
.store-adsense, .profile-adsense { margin-top: 20px; min-height: 50px; }

/* ===== PROFILE ===== */
#screenProfile { background: var(--bg); padding-bottom: 0; }
.profile-header {
    display: flex; flex-direction: column; align-items: center;
    padding: 48px 20px 24px;
    gap: 10px;
}
.profile-avatar-large {
    width: 90px; height: 90px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.2rem; font-weight: 800;
    color: rgba(0,0,0,0.4);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.profile-username { font-size: 1.4rem; font-weight: 800; }
.profile-country { color: var(--text3); font-size: 0.9rem; display: flex; align-items: center; gap: 5px; }
.profile-stats {
    display: flex;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 0 0 20px;
}
.stat-item { flex: 1; text-align: center; padding: 18px 10px; }
.stat-item + .stat-item { border-left: 1px solid var(--border); }
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--orange); }
.stat-label { font-size: 0.75rem; color: var(--text3); margin-top: 3px; }
.profile-actions { padding: 0 20px; display: flex; flex-direction: column; gap: 10px; }
.btn-outline {
    width: 100%; padding: 14px;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text); font-size: 0.95rem; font-weight: 600;
    transition: all 0.15s;
}
.btn-outline:active { background: var(--bg3); }
.btn-danger-outline {
    width: 100%; padding: 14px;
    border: 1px solid rgba(229,57,53,0.4);
    border-radius: 50px;
    color: var(--red); font-size: 0.95rem; font-weight: 600;
    transition: all 0.15s;
}
.btn-danger-outline:active { background: rgba(229,57,53,0.08); }
.profile-adsense { padding: 0 20px 20px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    padding-bottom: var(--safe-bottom);
    background: var(--bg2);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
}
.nav-btn {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    position: relative;
    border-radius: var(--radius-sm);
    margin: 6px 4px;
}
.nav-btn:active { background: var(--bg3); }
.nav-btn.active { background: rgba(240,112,48,0.10); }

/* Image icon toggle: show off by default, on when active */
.nav-icon-on  { display: none; }
.nav-icon-off { display: block; }
.nav-btn.active .nav-icon-on  { display: block; }
.nav-btn.active .nav-icon-off { display: none; }

.nav-badge {
    position: absolute; top: 6px; right: calc(50% - 14px);
    background: var(--red);
    color: white; font-size: 0.65rem;
    border-radius: 50%; width: 16px; height: 16px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* ===== FILTER SHEET ===== */
.bottom-sheet-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    backdrop-filter: blur(2px);
}
.bottom-sheet {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--card);
    border-radius: 20px 20px 0 0;
    padding: 12px 20px calc(24px + var(--safe-bottom));
    z-index: 201;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.sheet-handle {
    width: 36px; height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}
.sheet-title { font-size: 1.1rem; font-weight: 800; text-align: center; margin-bottom: 20px; }
.sheet-group-label { font-size: 0.78rem; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.filter-gender-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.filter-opt-btn {
    background: var(--bg3);
    border: 2px solid var(--border);
    color: var(--text2);
    border-radius: var(--radius);
    padding: 14px 12px;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.9rem; font-weight: 600;
    transition: all 0.15s;
}
.filter-opt-btn.full-width { grid-column: 1 / -1; }
.filter-opt-btn.active { border-color: var(--orange); color: var(--text); background: rgba(240,112,48,0.08); }
.filter-opt-btn:active { background: var(--card2); }
.filter-cost { display: flex; align-items: center; gap: 3px; color: var(--gold); font-size: 0.8rem; }
.filter-free { background: var(--purple); color: white; font-size: 0.72rem; padding: 3px 8px; border-radius: 10px; font-weight: 700; }
.filter-region-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.btn-apply-filter {
    width: 100%; padding: 16px;
    background: var(--orange);
    color: white; font-size: 1rem; font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(240,112,48,0.4);
    transition: all 0.15s;
}
.btn-apply-filter:active { transform: scale(0.98); }

/* ===== PERMISSIONS MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 300;
    display: flex; align-items: flex-end; justify-content: center;
    padding: 0 0 40px;
}
.perm-modal {
    background: var(--card);
    border-radius: 20px;
    padding: 24px;
    width: calc(100% - 32px);
    max-width: 380px;
    animation: slideUp 0.25s ease;
}
.perm-title { font-size: 1.1rem; font-weight: 800; color: var(--orange); text-align: center; margin-bottom: 20px; }
.perm-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.perm-icon { font-size: 1.4rem; }
.perm-info { flex: 1; }
.perm-info strong { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.perm-info small { color: var(--text3); font-size: 0.78rem; }
.perm-status { font-size: 0.8rem; }
.btn-primary {
    width: 100%; padding: 14px;
    background: var(--orange);
    color: white; font-size: 0.95rem; font-weight: 700;
    border-radius: 50px;
    transition: all 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.mt-16 { margin-top: 16px; }

/* ===== SKELETONS / LOADING ===== */
.loading-items { display: flex; flex-direction: column; gap: 10px; padding: 0; }
.skeleton-item {
    height: 72px;
    background: var(--card);
    border-radius: var(--radius);
    animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
    0%, 100% { opacity: 0.5; }
    50%       { opacity: 1; }
}
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; color: var(--text2); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ===== SPINNER ===== */
.spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--card);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    z-index: 500;
    border: 1px solid var(--border);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.25s ease;
    pointer-events: none;
}
.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.toast-success { border-color: var(--green); color: var(--green); }
.toast.toast-error   { border-color: var(--red);   color: var(--red); }
.toast.toast-orange  { border-color: var(--orange); color: var(--orange); }

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.text-orange { color: var(--orange); }
.text-gold { color: var(--gold); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 0; }

/* ===== SAFE AREA SUPPORT ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
    .screen { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
    #screenCall { bottom: 0; }
    #screenChatRoom { bottom: 0; }
}

/* ══════════════════════════════════════════════
   DESKTOP — App displayed inside a phone frame
   Key trick: transform:translateZ(0) on body
   makes all position:fixed children contained
   within the body element (the phone frame)
   instead of the full viewport.
══════════════════════════════════════════════ */
@media (min-width: 641px) {
    html {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100vh;
        overflow: hidden;
        background:
            radial-gradient(ellipse 55% 65% at 18% 50%, rgba(240,112,48,.10) 0%, transparent 60%),
            radial-gradient(ellipse 45% 55% at 82% 50%, rgba(240,112,48,.07) 0%, transparent 60%),
            #070707;
    }

    body.app-page {
        /* Phone frame size */
        width: 390px;
        height: min(860px, 92vh);
        flex-shrink: 0;

        /* Phone chrome */
        border-radius: 46px;
        box-shadow:
            0 0 0 1px rgba(255,255,255,.10),
            0 0 0 12px rgba(255,255,255,.03),
            0 50px 130px rgba(0,0,0,.9),
            inset 0 1px 0 rgba(255,255,255,.08);

        /* This is the key: all position:fixed children
           are now contained within the 390px body */
        transform: translateZ(0);
    }

    /* Notch */
    body.app-page::before {
        content: '';
        position: absolute;
        top: 0; left: 50%;
        transform: translateX(-50%);
        width: 115px; height: 32px;
        background: rgba(0,0,0,.92);
        border-radius: 0 0 22px 22px;
        z-index: 10000;
        pointer-events: none;
    }

    /* Home indicator bar */
    body.app-page::after {
        content: '';
        position: absolute;
        bottom: 8px; left: 50%;
        transform: translateX(-50%);
        width: 100px; height: 4px;
        background: rgba(255,255,255,.20);
        border-radius: 2px;
        z-index: 50; /* below nav (100) so nav content stays tappable */
        pointer-events: none;
    }

    /* Add a couple extra pixels of top padding to clear the notch
       on all screen headers (default is 48px, notch is 32px) */
    .top-bar,
    .page-header,
    .searching-header { padding-top: 50px; }

    /* Round bottom corners of nav to match phone frame */
    .bottom-nav { border-radius: 0 0 34px 34px; }

    /* Chat room and call screen start at top (no nav) — clear notch */
    #screenChatRoom .chat-header,
    .chat-header { padding-top: 50px; }
}
