:root {
    --primary: #D9246A;
    --primary-dark: #B01D58;
    --secondary: #4C6FFF;
    --game-color: #22D1EE;
    --accent-alt: #7B5CFF;
    --bg-dark: #080C18;
    --bg-medium: #0D1224;
    --bg-light: #131A32;
    --card-bg: #111830;
    --surface: #162040;
    --border: #1E2A4A;
    --text-primary: #F0F0FA;
    --text-secondary: #8896B8;
    --text-muted: #4E5A78;
    --error: #FF4565;
    --like: #D9246A;
    --dislike: #FF4565;
    --match: #7B5CFF;
    --gold: #F5A623;
    --gold-dark: #C8880D;
    --gold-light: #FFD700;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg-dark); color: var(--text-primary); height: 100%; overflow: hidden; }
#app { height: 100%; }
.app-container { display: flex; flex-direction: column; height: 100vh; width: 100%; }
.main-content { flex: 1; overflow-y: auto; }

/* Tab bar */
.tab-bar { display: flex; background: var(--bg-medium); border-top: 1px solid var(--border); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); flex-shrink: 0; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: var(--text-muted); font-size: 11px; padding: 5px; transition: color 0.2s; }
.tab-item:hover { color: var(--text-secondary); }
.tab-item.active { color: var(--primary); }
.tab-item.tab-premium.active { color: var(--gold); }
.tab-icon { font-size: 22px; }
.tab-label { font-weight: 600; }

/* Buttons */
.btn { border: none; border-radius: 12px; padding: 14px 28px; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform 0.15s, opacity 0.15s; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-small { padding: 8px 16px; font-size: 12px; border-radius: 8px; }

/* Inputs */
.input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; color: var(--text-primary); font-size: 15px; outline: none; transition: border-color 0.2s; }
.input:focus { border-color: var(--primary); }
.input::placeholder { color: var(--text-muted); }

/* Search */
.search-bar { display: flex; gap: 8px; padding: 0 20px; margin-bottom: 12px; }
.search-bar .input { flex: 1; padding: 10px 14px; font-size: 14px; }
.search-bar .btn { padding: 10px 16px; font-size: 13px; }

/* Category filters */
.cat-filters { display: flex; gap: 8px; padding: 0 20px; margin-bottom: 12px; }
.cat-btn { padding: 8px 18px; border-radius: 20px; font-size: 13px; font-weight: 700; cursor: pointer; border: none; white-space: nowrap; transition: all 0.2s; background: var(--surface); color: var(--text-muted); }
.cat-btn.active-movie { background: var(--primary); color: white; }
.cat-btn.active-series { background: var(--secondary); color: white; }
.cat-btn.active-game { background: var(--game-color); color: black; }

/* Content grid — responsive */
.content-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 20px 20px; }
.content-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform 0.15s, border-color 0.2s; position: relative; }
.content-card:hover { transform: translateY(-2px); border-color: var(--text-muted); }
.content-card.liked { border-color: var(--primary); border-width: 2px; }
.content-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.cc-info { padding: 10px; }
.cc-title { font-size: 13px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.type-badge { padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; color: white; }
.rating-badge { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.like-icon { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.like-icon.on { background: var(--primary); color: white; }
.like-icon.off { background: rgba(0,0,0,0.5); color: var(--text-muted); }

/* People card — desktop centered */
.people-card { margin: 20px auto; max-width: 500px; border-radius: 25px; overflow: hidden; background: var(--card-bg); border: 1px solid var(--border); position: relative; }
.people-avatar { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 80px; color: var(--text-muted); }
.people-info { padding: 20px; }
.people-name { font-size: 24px; font-weight: 800; }
.people-bio { font-size: 14px; color: var(--text-secondary); margin-top: 6px; }
.compat-badge { position: absolute; top: 15px; right: 15px; background: rgba(0,0,0,0.6); border-radius: 15px; padding: 8px 14px; display: flex; align-items: center; gap: 6px; }
.compat-value { font-size: 18px; font-weight: 800; color: var(--primary); }
.compat-label { font-size: 11px; color: var(--text-secondary); }

/* Action btns */
.action-buttons { display: flex; justify-content: center; gap: 20px; padding: 15px 30px 20px; }
.action-btn { width: 65px; height: 65px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; border: none; transition: transform 0.15s; }
.action-btn:active { transform: scale(0.9); }
.action-btn.nope { background: var(--surface); border: 2px solid var(--dislike); color: var(--dislike); }
.action-btn.like { background: var(--primary); color: white; }
.action-btn.super { background: var(--match); color: white; width: 75px; height: 75px; font-size: 32px; }

/* Match list */
.match-list { max-width: 800px; margin: 0 auto; }
.match-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.2s; }
.match-item:hover { background: var(--surface); }
.match-avatar { width: 56px; height: 56px; border-radius: 18px; border: 2px solid var(--match); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--text-muted); flex-shrink: 0; overflow: hidden; }
.match-avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-info { flex: 1; min-width: 0; }
.match-name { font-size: 16px; font-weight: 700; }
.match-bio { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-date { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.match-actions { display: flex; gap: 8px; flex-shrink: 0; }
.match-action-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: all 0.2s; }
.match-action-btn:hover { border-color: var(--text-muted); transform: scale(1.05); }
.match-action-chat { border-color: var(--secondary); }
.match-action-chat:hover { background: var(--secondary); }

/* Chat — centered on desktop */
.chat-container { display: flex; flex-direction: column; height: 100vh; max-width: 800px; margin: 0 auto; width: 100%; }
.chat-header { background: var(--bg-medium); padding: 12px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.chat-back { font-size: 22px; cursor: pointer; color: var(--text-secondary); background: none; border: none; }
.chat-messages { flex: 1; overflow-y: auto; padding: 15px 20px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 70%; padding: 10px 15px; border-radius: 18px; font-size: 14px; line-height: 1.4; word-wrap: break-word; }
.msg-sent { align-self: flex-end; background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.msg-received { align-self: flex-start; background: var(--surface); color: var(--text-primary); border-bottom-left-radius: 4px; }
.chat-input-bar { display: flex; gap: 8px; padding: 12px 20px; background: var(--bg-medium); border-top: 1px solid var(--border); }
.chat-input-bar .input { flex: 1; padding: 10px 14px; border-radius: 20px; }
.chat-input-bar .btn { border-radius: 20px; padding: 10px 18px; }

/* Login — centered */
.login-page { height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; }
.logo { margin-bottom: 40px; text-align: center; }
.logo-vl { font-size: 48px; font-weight: 900; }
.logo-v { color: var(--secondary); }
.logo-l { color: var(--primary); }
.logo-tagline { color: var(--text-secondary); font-size: 14px; margin-top: 6px; max-width: 340px; line-height: 1.5; }
.login-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.error-msg { background: rgba(255,69,101,0.15); border: 1px solid var(--error); border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--error); }
.link-btn { background: none; border: none; color: var(--secondary); font-size: 14px; cursor: pointer; text-align: center; margin-top: 10px; }
.link-btn:hover { text-decoration: underline; }

/* Profile */
.profile-page { max-width: 600px; margin: 0 auto; }
.profile-header { text-align: center; padding: 30px 20px; }
.profile-avatar { width: 120px; height: 120px; border-radius: 30px; border: 3px solid var(--primary); background: var(--surface); display: flex; align-items: center; justify-content: center; font-size: 40px; color: var(--text-muted); margin: 0 auto; overflow: hidden; cursor: pointer; position: relative; transition: border-color 0.2s; }
.profile-avatar:hover { border-color: var(--secondary); }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; font-size: 14px; color: white; font-weight: 600; }
.profile-avatar:hover .avatar-overlay { opacity: 1; }
.profile-username { font-size: 24px; font-weight: 800; margin-top: 12px; }
.profile-email { font-size: 13px; color: var(--text-secondary); }
.stats-row { display: flex; gap: 15px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.stat-item { background: var(--surface); border-radius: 14px; padding: 14px 20px; text-align: center; min-width: 90px; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Page header */
.page-header { background: var(--bg-medium); padding: 15px 20px; }
.page-title { font-size: 22px; font-weight: 800; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

/* Empty / loading */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 30px; text-align: center; gap: 15px; }
.empty-icon { font-size: 50px; opacity: 0.4; }
.empty-title { font-size: 20px; font-weight: 700; }
.empty-text { font-size: 14px; color: var(--text-secondary); }
.loading { display: flex; align-items: center; justify-content: center; padding: 40px; color: var(--text-secondary); gap: 10px; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Match notification */
.match-popup { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
.match-popup-inner { background: var(--match); border-radius: 25px; padding: 40px; text-align: center; color: white; }
.match-popup-title { font-size: 32px; font-weight: 900; }
.match-popup-sub { font-size: 16px; margin-top: 8px; opacity: 0.8; }

/* Desktop responsive */
@media (min-width: 768px) {
    .content-grid { grid-template-columns: repeat(3, 1fr); }
    .tab-item { font-size: 12px; }
    .tab-icon { font-size: 24px; }
}
@media (min-width: 1024px) {
    .content-grid { grid-template-columns: repeat(4, 1fr); padding: 0 30px 30px; }
    .cat-filters { padding: 0 30px; }
    .search-bar { padding: 0 30px; }
    .page-header { padding: 20px 30px; }
}
@media (min-width: 1400px) {
    .content-grid { grid-template-columns: repeat(5, 1fr); padding: 0 40px 40px; gap: 16px; }
    .cat-filters { padding: 0 40px; }
    .search-bar { padding: 0 40px; }
    .page-header { padding: 20px 40px; }
}

/* Match badge en tab bar */
.match-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-medium);
    animation: badge-pop 0.3s ease-out;
}
@keyframes badge-pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Toast notificacion de nuevo match */
.match-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-alt), var(--primary));
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 200;
    box-shadow: 0 8px 32px rgba(217, 36, 106, 0.4), 0 0 60px rgba(123, 92, 255, 0.2);
    animation: toast-slide-in 0.4s ease-out;
    max-width: 420px;
    width: calc(100% - 40px);
    backdrop-filter: blur(20px);
}
.match-toast.fade-out {
    animation: toast-slide-out 0.4s ease-in forwards;
}
@keyframes toast-slide-in {
    0% { transform: translateX(-50%) translateY(-100px); opacity: 0; }
    100% { transform: translateX(-50%) translateY(0); opacity: 1; }
}
@keyframes toast-slide-out {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-100px); opacity: 0; }
}
.match-toast-icon {
    font-size: 32px;
    flex-shrink: 0;
    animation: toast-pulse 1.5s ease-in-out infinite;
}
@keyframes toast-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
.match-toast-content {
    flex: 1;
    min-width: 0;
}
.match-toast-title {
    font-size: 16px;
    font-weight: 800;
    color: white;
}
.match-toast-text {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin-top: 2px;
}
.match-toast-text strong {
    color: white;
    font-weight: 700;
}
.match-toast-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.2s;
}
.match-toast-close:hover {
    background: rgba(255,255,255,0.35);
}

/* Premium page */
.premium-page { max-width: 550px; margin: 0 auto; padding: 0 20px 30px; }

/* Hero */
.premium-hero { text-align: center; padding: 32px 0 24px; }
.premium-crown { font-size: 56px; margin-bottom: 10px; animation: crown-float 3s ease-in-out infinite; }
@keyframes crown-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.premium-hero-title { font-size: 30px; font-weight: 900; }
.premium-gold-text { background: linear-gradient(135deg, #C8880D, #F5A623, #FFD700); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.premium-hero-sub { color: var(--text-secondary); font-size: 14px; margin-top: 6px; }

/* Comparison table */
.premium-compare { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-bottom: 24px; }
.premium-compare-header { display: grid; grid-template-columns: 1fr 70px 70px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.premium-compare-col { font-size: 12px; font-weight: 700; text-align: center; }
.premium-compare-free { color: var(--text-muted); }
.premium-compare-pro { color: var(--gold); }
.premium-compare-row { display: grid; grid-template-columns: 1fr 70px 70px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: center; }
.premium-compare-row:last-child { border-bottom: none; }
.premium-compare-feature { font-size: 13px; font-weight: 600; }
.premium-compare-val { text-align: center; font-size: 14px; font-weight: 700; }
.free-val { color: var(--text-muted); }
.pro-val { color: var(--gold); }

/* Benefits list */
.premium-benefits { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.premium-benefit {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: border-color 0.2s, transform 0.15s;
}
.premium-benefit:hover { border-color: var(--gold); transform: translateX(4px); }
.premium-benefit-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.premium-benefit-info { flex: 1; }
.premium-benefit-title { font-weight: 700; font-size: 15px; }
.premium-benefit-desc { font-size: 12px; color: var(--text-secondary); margin-top: 3px; line-height: 1.4; }

/* CTA card */
.premium-cta {
    position: relative;
    background: linear-gradient(135deg, #1a1400 0%, #2a1e00 30%, #1a1400 100%);
    border: 1.5px solid var(--gold);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(245, 166, 35, 0.15), inset 0 1px 0 rgba(255, 215, 0, 0.1);
}
.premium-cta-badge {
    display: inline-block;
    background: linear-gradient(135deg, #C8880D, #F5A623, #FFD700);
    color: #1a1400;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}
.premium-cta-price { margin-bottom: 6px; }
.premium-cta-amount {
    font-size: 42px;
    font-weight: 900;
    background: linear-gradient(135deg, #F5A623, #FFD700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.premium-cta-period { font-size: 14px; color: var(--text-secondary); margin-left: 4px; }
.premium-cta-note { font-size: 12px; color: var(--text-muted); margin-bottom: 20px; }
.premium-cta-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    background: linear-gradient(135deg, #C8880D, #F5A623, #FFD700, #F5A623, #C8880D);
    background-size: 200% 200%;
    animation: gold-shimmer 4s ease infinite;
    color: #1a1400;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 20px rgba(245, 166, 35, 0.35);
}
.premium-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(245, 166, 35, 0.5); }
.premium-cta-btn:active { transform: scale(0.97); }
.premium-cta-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.premium-cta-secure { font-size: 11px; color: var(--text-muted); margin-top: 14px; }
@keyframes gold-shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Premium active state */
.premium-active { text-align: center; padding: 50px 20px; }
.premium-active-crown { font-size: 64px; margin-bottom: 16px; animation: crown-float 3s ease-in-out infinite; }
.premium-active-title { font-size: 28px; font-weight: 900; background: linear-gradient(135deg, #F5A623, #FFD700); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.premium-active-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 8px; }
.premium-active-perks { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.premium-active-perk { background: var(--surface); border: 1px solid var(--gold); border-radius: 12px; padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--gold); }

/* Public profile */
.pub-profile { max-width: 600px; margin: 0 auto; padding-bottom: 30px; }
.pub-header { text-align: center; padding: 20px 20px 24px; position: relative; }
.pub-back { position: absolute; top: 20px; left: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.pub-back:hover { border-color: var(--primary); color: var(--text-primary); }
.pub-avatar-wrap { width: 120px; height: 120px; border-radius: 30px; border: 3px solid var(--primary); margin: 0 auto 14px; overflow: hidden; background: var(--surface); }
.pub-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.pub-avatar-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 48px; color: var(--text-muted); }
.pub-name { font-size: 26px; font-weight: 900; }
.pub-age { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.pub-section { padding: 0 20px; margin-top: 24px; }
.pub-section-title { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.pub-bio { font-size: 14px; color: var(--text-secondary); line-height: 1.6; background: var(--surface); border-radius: 14px; padding: 14px 16px; border: 1px solid var(--border); }
.pub-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.pub-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 20px; text-align: center; min-width: 90px; flex: 1; border-left: 3px solid; }
.pub-stat-val { font-size: 24px; font-weight: 800; }
.pub-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.pub-content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pub-content-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pub-content-card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.pub-content-noimg { width: 100%; aspect-ratio: 2/3; display: flex; align-items: center; justify-content: center; font-size: 32px; background: var(--surface); color: var(--text-muted); }
.pub-content-title { padding: 6px 8px; font-size: 11px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (min-width: 768px) {
    .pub-content-grid { grid-template-columns: repeat(4, 1fr); }
}

#blazor-error-ui { display: none; position: fixed; bottom: 0; width: 100%; z-index: 1000; }
