* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #14121c; color: #f2f0f7; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overscroll-behavior: none; }
#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 480px; margin: 0 auto; position: relative; }
a { color: inherit; }
button { font-family: inherit; }

.topbar { position: sticky; top: 0; z-index: 5; padding: 14px 16px calc(10px + env(safe-area-inset-top)); background: linear-gradient(180deg, #1b1826 0%, rgba(27,24,38,0.85) 100%); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: space-between; }
.topbar .logo { font-weight: 700; font-size: 17px; letter-spacing: .2px; }
.topbar .logo b { color: #ff5f96; }

.screen { flex: 1; padding: 12px 16px 90px; overflow-y: auto; }

/* Auth */
.auth-wrap { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; padding: 32px 24px; }
.auth-hero { text-align: center; margin-bottom: 28px; }
.auth-hero .emblem { font-size: 40px; margin-bottom: 10px; }
.auth-hero h1 { font-size: 22px; margin: 0 0 6px; }
.auth-hero p { color: #a49fb5; font-size: 14px; margin: 0; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 16px; border-radius: 14px; border: none; font-size: 15px; font-weight: 600; cursor: pointer; margin-bottom: 10px; transition: transform .1s ease; }
.btn:active { transform: scale(0.98); }
.btn-vk { background: #0077ff; color: #fff; }
.btn-tg { background: #29a9eb; color: #fff; }
.btn-primary { background: linear-gradient(135deg, #ff5f96, #ff8a5c); color: #fff; }
.btn-ghost { background: transparent; color: #cfc9dd; border: 1px solid #35304a; }
.btn-outline { background: transparent; color: #ff5f96; border: 1px solid #ff5f96; }

.divider { display: flex; align-items: center; gap: 10px; color: #776f8f; font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: #2a2637; }

.field { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid #33304a; background: #1e1b2a; color: #fff; font-size: 15px; margin-bottom: 10px; }
.field::placeholder { color: #71698a; }

.tabs-switch { display: flex; background: #1e1b2a; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.tabs-switch button { flex: 1; padding: 9px; border: none; background: transparent; color: #a49fb5; border-radius: 9px; font-weight: 600; font-size: 14px; }
.tabs-switch button.active { background: #ff5f96; color: #fff; }

.msg-error { background: #3a1c28; color: #ff9db8; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }
.msg-ok { background: #163a2a; color: #7fe3ac; padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 10px; }

#tg-widget-holder { display: flex; justify-content: center; margin-bottom: 10px; }

/* Feed */
.card-stack { position: relative; height: calc(100vh - 260px); min-height: 380px; }
.p-card { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: #201c2c; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.p-card .photo { width: 100%; height: 72%; object-fit: cover; background: #2a2638 center/cover; }
.p-card .photo.noimg { display: flex; align-items: center; justify-content: center; font-size: 46px; color: #4a4560; }
.p-card .info { padding: 14px 16px; }
.p-card .info h3 { margin: 0 0 4px; font-size: 19px; }
.p-card .info p { margin: 0; color: #b3adc4; font-size: 13px; }
.verified-badge { display: inline-block; margin-left: 6px; color: #5fc7ff; font-size: 13px; }

.swipe-actions { display: flex; justify-content: center; gap: 18px; margin-top: 16px; }
.swipe-actions button { width: 58px; height: 58px; border-radius: 50%; border: none; font-size: 24px; display: flex; align-items: center; justify-content: center; }
.act-pass { background: #241f30; color: #ff6b6b; }
.act-like { background: linear-gradient(135deg, #ff5f96, #ff8a5c); color: #fff; }
.empty-state { text-align: center; padding: 60px 20px; color: #8b84a0; }
.empty-state .emoji { font-size: 40px; margin-bottom: 10px; }

/* Matches / list */
.match-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #1e1b2a; margin-bottom: 8px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: #2a2638 center/cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #6a6280; }
.match-row .name { font-weight: 600; font-size: 15px; }
.match-row .sub { font-size: 12px; color: #a49fb5; }

/* Profile */
.profile-photos { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.profile-photos img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.add-photo { width: 84px; height: 84px; border-radius: 14px; border: 1.5px dashed #45405c; display: flex; align-items: center; justify-content: center; color: #776f8f; font-size: 26px; flex-shrink: 0; cursor: pointer; background: transparent; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #8b84a0; margin: 20px 0 8px; }
.link-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; border-radius: 12px; background: #1e1b2a; margin-bottom: 8px; }
.link-row .lbl { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.pill-on { background: #163a2a; color: #7fe3ac; }
.pill-off { background: #2a2638; color: #a49fb5; }

.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.shop-card { background: #1e1b2a; border-radius: 14px; padding: 14px; text-align: center; }
.shop-card .amt { font-size: 20px; font-weight: 700; margin: 6px 0; }
.shop-card .price { color: #a49fb5; font-size: 13px; margin-bottom: 10px; }

.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; max-width: 480px; margin: 0 auto; background: rgba(23,20,33,.92); backdrop-filter: blur(10px); display: flex; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid #2a2637; }
.bottom-nav button { flex: 1; background: none; border: none; color: #776f8f; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; padding: 6px 0; }
.bottom-nav button.active { color: #ff5f96; }
.bottom-nav .ic { font-size: 20px; }

.center-spin { display: flex; justify-content: center; padding: 40px; color: #776f8f; }
