:root {
    --bg: #0a0a0a;
    --surface: rgba(20, 20, 24, 0.72);
    --surface-hover: rgba(30, 30, 36, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(220, 20, 60, 0.45);
    --accent: #dc143c;
    --accent-hover: #f01d47;
    --text: #f3f3f5;
    --muted: #9898a6;
    --radius: 16px;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
}

.bg-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 15%, rgba(220, 20, 60, 0.14), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(220, 20, 60, 0.09), transparent 45%);
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 20px;
}

.accent {
    color: var(--accent);
}

.muted {
    color: var(--muted);
    font-weight: 400;
}

.hidden {
    display: none !important;
}

/* Header */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(10, 10, 10, 0.75);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(220, 20, 60, 0.16);
    border: 1px solid var(--border-accent);
    color: var(--accent);
    display: grid;
    place-items: center;
}

.brand-text {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.topbar-hint {
    font-size: 13px;
    color: var(--muted);
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
}

/* Main */
.main-content {
    padding-top: 40px;
    padding-bottom: 72px;
}

.hero {
    text-align: center;
    margin-bottom: 32px;
}

.hero h1 {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--muted);
    font-size: 15px;
    max-width: 620px;
    margin: 0 auto;
}

/* Glass Card */
.glass-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.upload-card {
    padding: 28px;
}

/* Drop zone */
.drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 44px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(220, 20, 60, 0.06);
}

.drop-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.drop-title {
    font-family: 'Unbounded', sans-serif;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 6px;
}

.drop-sub {
    font-size: 13px;
    color: var(--muted);
}

/* Previews */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #111;
}

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

.preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 7px;
    background: rgba(10, 10, 10, 0.82);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s;
}

.preview-remove:hover {
    background: var(--accent);
}

/* Form fields */
.form-fields {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.field input,
.field textarea,
.share-input {
    width: 100%;
    background: rgba(10, 10, 12, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
}

.field textarea {
    resize: vertical;
}

/* Progress */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.15s linear;
}

.progress-text {
    font-family: 'Unbounded', sans-serif;
    font-size: 12px;
    min-width: 42px;
    text-align: right;
}

.error-box {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(220, 20, 60, 0.14);
    border: 1px solid var(--border-accent);
    color: #ff99ad;
    font-size: 13px;
}

.form-actions {
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.file-counter {
    font-size: 13px;
    color: var(--muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-sm {
    padding: 8px 13px;
    font-size: 12px;
    border-radius: 9px;
}

/* Album view */
.album-header {
    padding: 26px;
    margin-bottom: 24px;
}

.album-meta-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}

.badge {
    background: rgba(220, 20, 60, 0.16);
    border: 1px solid var(--border-accent);
    color: #ff6b89;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
}

.album-title {
    font-family: 'Unbounded', sans-serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 700;
    margin-bottom: 8px;
}

.album-desc {
    color: #cfd0da;
    font-size: 14px;
    margin-bottom: 20px;
}

.share-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.share-input {
    flex: 1;
    min-width: 220px;
    font-family: 'Montserrat', sans-serif;
    color: var(--muted);
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 20px;
}

.gallery-single {
    grid-template-columns: 1fr;
}

.photo-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.photo-wrap {
    background: #060608;
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 620px;
    overflow: hidden;
}

.photo-wrap img {
    width: 100%;
    height: auto;
    max-height: 620px;
    object-fit: contain;
    display: block;
}

.photo-footer {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
}

.photo-name {
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}

.photo-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(5, 5, 7, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox img {
    max-width: 95vw;
    max-height: 92vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(20, 20, 24, 0.85);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.lightbox-close:hover {
    background: var(--accent);
}

/* Empty 404 */
.empty-state {
    padding: 60px 24px;
    text-align: center;
}

.empty-state h1 {
    font-family: 'Unbounded', sans-serif;
    font-size: 56px;
    color: var(--accent);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 24px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(20, 20, 24, 0.95);
    border: 1px solid var(--border-accent);
    color: #fff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 200;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
    .topbar-hint {
        display: none;
    }
    .gallery {
        grid-template-columns: 1fr;
    }
    .upload-card,
    .album-header {
        padding: 18px;
    }
}