* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-main: #f4f7fb;
    --text-soft: #b9c5d6;
    --accent: #7c5cff;
    --accent-2: #00c2ff;
    --success: #1fbf75;
    --error: #ff5d73;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius-lg: 24px;
    --radius-md: 18px;
    --container: 1200px;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(124, 92, 255, 0.18), transparent 35%),
        radial-gradient(circle at bottom right, rgba(0, 194, 255, 0.15), transparent 30%),
        linear-gradient(135deg, #030712 0%, #08111f 50%, #0b1628 100%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.page {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
    padding: 48px 0 64px;
    position: relative;
    z-index: 2;
}

.bg-blur {
    position: fixed;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.bg-blur-1 { background: #7c5cff; top: -80px; left: -100px; }
.bg-blur-2 { background: #00c2ff; bottom: -100px; right: -80px; }

.hero {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 42px;
}

.compact-hero { margin-bottom: 24px; }

.badge {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(124, 92, 255, 0.15);
    border: 1px solid rgba(124, 92, 255, 0.35);
    color: #d7cbff;
    font-size: 0.92rem;
    margin-bottom: 18px;
    backdrop-filter: blur(12px);
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

.hero p { color: var(--text-soft); font-size: 1.05rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

.top-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 24px;
    margin-bottom: 36px;
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.login-card { max-width: 520px; margin: 0 auto; }
.card-header { margin-bottom: 22px; }
.card-header h2 { font-size: 1.6rem; margin-bottom: 8px; }
.card-header p { color: var(--text-soft); }

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.text-input {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: white;
    font-size: 1rem;
}

.file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    border: 1px dashed rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 16px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.file-label.dragover,
.file-label:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 92, 255, 0.65);
    box-shadow: 0 12px 30px rgba(124, 92, 255, 0.16);
}

.file-label span { font-weight: 600; }
.file-label input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}

.preview-item {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.btn-primary,
.btn-secondary,
.btn-danger-link,
.btn-danger {
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    padding: 16px 26px;
    box-shadow: 0 14px 28px rgba(85, 113, 255, 0.32);
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #eef5ff;
    padding: 16px 26px;
    border: 1px solid rgba(255,255,255,0.12);
}

.btn-danger-link,
.btn-danger {
    background: rgba(255, 93, 115, 0.16);
    color: #ffd5db;
    border: 1px solid rgba(255, 93, 115, 0.28);
    padding: 12px 16px;
}

.alert { border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; font-size: 0.96rem; line-height: 1.5; }
.alert-success { background: rgba(31, 191, 117, 0.12); color: #baf2d7; border: 1px solid rgba(31, 191, 117, 0.28); }
.alert-error { background: rgba(255, 93, 115, 0.12); color: #ffd2d8; border: 1px solid rgba(255, 93, 115, 0.28); }

.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-box {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 18px;
}

.stat-box strong {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.stat-box span { color: var(--text-soft); }

.gallery-section { margin-top: 10px; }
.section-title { margin-bottom: 18px; }
.section-title h2 { font-size: 1.8rem; margin-bottom: 8px; }
.section-title p { color: var(--text-soft); line-height: 1.7; }

.marquee-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 16px 0;
    mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
}

.marquee-track {
    display: flex;
    gap: 22px;
    width: max-content;
    animation: scrollLeft 35s linear infinite;
    will-change: transform;
}

.marquee-wrapper:hover .marquee-track { animation-play-state: paused; }

.image-card,
.grid-card {
    overflow: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow);
}

.image-card {
    width: 290px;
    height: 380px;
    flex: 0 0 auto;
    border-radius: 24px;
    transition: transform 0.35s ease, border-color 0.35s ease;
}

.image-card:hover,
.grid-card:hover {
    transform: translateY(-8px);
    border-color: rgba(124, 92, 255, 0.45);
}

.image-card img,
.grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease, filter 0.45s ease;
}

.image-card:hover img,
.grid-card:hover img {
    transform: scale(1.05);
    filter: saturate(1.08) contrast(1.02);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.grid-card {
    border-radius: 22px;
    min-height: 320px;
}

.grid-card img { height: 320px; }

.grid-card-footer {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(6,12,22,0.92);
}

.grid-card-footer span {
    font-size: 0.9rem;
    color: #edf3ff;
    word-break: break-word;
}

.empty-state {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    color: var(--text-soft);
    box-shadow: var(--shadow);
}

.empty-state h3 { color: var(--text-main); margin-bottom: 10px; font-size: 1.3rem; }

@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@media (max-width: 980px) {
    .top-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .image-card { width: 240px; height: 320px; }
    .marquee-track { gap: 18px; animation-duration: 28s; }
}

@media (max-width: 640px) {
    .page { width: min(100% - 20px, var(--container)); padding-top: 28px; }
    .glass-card { padding: 20px; }
    .image-card { width: 190px; height: 260px; border-radius: 20px; }
    .marquee-track { gap: 14px; animation-duration: 22s; }
    .stats { grid-template-columns: 1fr; }
    .hero p, .section-title p, .card-header p { font-size: 0.97rem; }
}