:root {
    --bg: #0e0c10;
    --bg2: #16131a;
    --bg3: #1e1a24;
    --bg4: #26212e;
    --border: #2e2838;
    --border2: #3d3649;
    --text: #f0ecf7;
    --text2: #b8afc8;
    --text3: #7a6f8a;
    --accent: #d946a8;
    --accent2: #f472d0;
    --accent-dim: #8b2d6e;
    --teal: #0fbf8c;
    --teal-dim: #0a7a5a;
    --amber: #f5a623;
    --danger: #ef4444;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}
img, video { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; min-width: 0; }

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 1000;
    background: var(--teal);
    color: #000;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius);
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); outline: 3px solid #fff; outline-offset: 2px; }
#page-content:focus { outline: none; }

:focus-visible {
    outline: 3px solid var(--teal);
    outline-offset: 3px;
}

/* Typography */
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { color: var(--text2); }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 1rem;
}
.nav-logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; min-width: 0; }
.nav-links a {
    color: var(--text2);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent2); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent2); text-decoration: none; color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border2);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); text-decoration: none; }
.btn-teal { background: var(--teal); color: #000; }
.btn-teal:hover { background: #13d99f; text-decoration: none; color: #000; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Cards */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}
.card-sm { padding: 1rem; border-radius: var(--radius); }

/* Forms */
.form-group { margin-bottom: 1.2rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text2);
    margin-bottom: 0.4rem;
    font-weight: 500;
}
.form-control {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 0.65rem 0.9rem;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(15,191,140,0.18);
}
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

/* Grid */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
@media(max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 4rem;
    background: radial-gradient(ellipse at top, #2a1040 0%, var(--bg) 60%);
}
.hero h1 { font-size: 3rem; margin-bottom: 1rem; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 1.15rem; max-width: 550px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Score ring */
.score-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid var(--accent);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    background: var(--bg3);
}
.score-ring .score-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent2);
    line-height: 1;
}
.score-ring .score-label {
    font-size: 0.75rem;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Score bars */
.score-bars { display: flex; flex-direction: column; gap: 0.8rem; }
.score-bar-row { display: flex; align-items: center; gap: 0.8rem; }
.score-bar-label { font-size: 0.82rem; color: var(--text2); width: 110px; flex-shrink: 0; }
.score-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg4);
    border-radius: 99px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent);
    transition: width 0.8s ease;
}
.score-bar-val { font-size: 0.82rem; color: var(--text2); width: 28px; text-align: right; }

/* Upload zone */
.upload-zone {
    border: 2px dashed var(--border2);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(217,70,168,0.05);
}
.upload-zone input[type=file] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.upload-icon { font-size: 2.5rem; margin-bottom: 0.8rem; }
.upload-zone h3 { color: var(--text); margin-bottom: 0.4rem; }

/* Listing cards */
.listing-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--text);
}
.listing-card:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
}
.listing-card-img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-body { padding: 0.9rem; }
.listing-card-title { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.3rem; }
.listing-card-meta { display: flex; justify-content: space-between; align-items: center; }
.listing-card-price { font-weight: 700; color: var(--teal); font-size: 1rem; }
.listing-card-score {
    font-size: 0.75rem;
    background: rgba(217,70,168,0.15);
    color: var(--accent2);
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}
.listing-type-badge {
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--bg4);
    color: var(--text3);
    display: inline-block;
    margin-top: 0.3rem;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-adult { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-sfw { background: rgba(15,191,140,0.15); color: var(--teal); }
.badge-featured { background: rgba(245,166,35,0.15); color: var(--amber); }

/* Alert */
.alert { padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #f87171; }
.alert-success { background: rgba(15,191,140,0.12); border: 1px solid rgba(15,191,140,0.3); color: var(--teal); }
.alert-info { background: rgba(217,70,168,0.1); border: 1px solid rgba(217,70,168,0.25); color: var(--accent2); }

/* Empty, loading, and error states */
.state-panel,
.empty-state,
.loading-state,
.error-state {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg2);
    padding: 2rem;
    text-align: center;
}
.state-panel h2,
.empty-state h2,
.loading-state h2,
.error-state h2 { margin-bottom: 0.4rem; }
.state-panel p,
.empty-state p,
.loading-state p,
.error-state p { max-width: 560px; margin-left: auto; margin-right: auto; }
.state-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--bg4);
    color: var(--text2);
    font-weight: 800;
}
.empty-state .state-icon { color: var(--accent2); }
.loading-state .state-icon { color: var(--teal); }
.error-state {
    border-color: rgba(239,68,68,0.35);
    background: rgba(239,68,68,0.08);
}
.error-state .state-icon {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}
.form-pending {
    opacity: 0.72;
    pointer-events: none;
}
.form-pending [type="submit"],
.form-pending button:not([type="button"]) {
    cursor: wait;
}
.inline-status {
    color: var(--text3);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; gap: 0; }
.tab {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    color: var(--text3);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab.active { color: var(--accent2); border-bottom-color: var(--accent); }
.tab:hover { color: var(--text2); }

/* Stats row */
.stats-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.stat-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    flex: 1;
    min-width: 120px;
}
.stat-box .stat-val { font-size: 1.6rem; font-weight: 700; color: var(--text); }
.stat-box .stat-lbl { font-size: 0.8rem; color: var(--text3); }

/* Content gate overlay */
.gate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gate-box {
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
}
.gate-box h2 { margin-bottom: 0.8rem; }
.gate-box p { margin-bottom: 1.5rem; }
.gate-actions { display: flex; gap: 1rem; justify-content: center; }

/* Filter bar */
.filter-bar {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 1.5rem;
}
.filter-bar select, .filter-bar input {
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}

/* Profile */
.avatar-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

/* Divider */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Section */
.section { padding: 3rem 0; }
.section-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }

/* Price display */
.price-big { font-size: 2rem; font-weight: 800; color: var(--teal); }

/* Spinner */
.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Messages */
.msg-bubble {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    max-width: 75%;
    font-size: 0.9rem;
}
.msg-out { background: var(--accent-dim); margin-left: auto; }
.msg-in { background: var(--bg3); }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; justify-content: center; margin-top: 2rem; }
.page-btn {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.15s;
    background: var(--bg2);
}
.page-btn.active, .page-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Footer */
footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    text-align: center;
    padding: 2rem;
    color: var(--text3);
    font-size: 0.85rem;
    margin-top: 4rem;
}

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text3); font-size: 0.85rem; }
.text-accent { color: var(--accent2); }
.text-teal { color: var(--teal); }
.text-danger { color: var(--danger); }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }
.w-full { width: 100%; }

table {
    width: 100%;
    border-collapse: collapse;
}

@media(max-width: 900px) {
    nav {
        height: auto;
        min-height: 60px;
        align-items: flex-start;
        padding: 0.75rem 1rem;
        flex-direction: column;
    }
    .nav-links {
        width: 100%;
        gap: 0.75rem;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        scrollbar-width: thin;
    }
    .nav-links a { white-space: nowrap; }
    .container { padding: 0 1rem; }
    .section-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .tabs, .filter-bar, .stats-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: thin;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media(max-width: 520px) {
    h1 { font-size: 1.65rem; }
    h2 { font-size: 1.2rem; }
    .hero { padding: 3rem 1rem 2.5rem; }
    .hero h1 { font-size: 2.15rem; }
    .card { padding: 1rem; }
    .btn { min-height: 42px; }
    .gate-actions, .hero-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
