/* Global dark theme */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #05060a;
    color: #f3f4f6;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

header {
    border-bottom: 1px solid #111827;
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-weight: 700;
    letter-spacing: 0.05em;
    font-size: 1.1rem;
}

.logo span {
    color: #facc15;
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.nav-links a {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid transparent;
    color: #e5e7eb;
}

.nav-links a:hover {
    border-color: #1f2937;
    background: #020617;
}

main {
    flex: 1;
}

footer {
    border-top: 1px solid #111827;
    background: #020617;
    color: #6b7280;
    font-size: 0.8rem;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

/* Filter bar */
.filter-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(3, 7, 18, 0.96);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid #111827;
}

.filter-toggle-row {
    display: none;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-block: 0.25rem;
}

.filter-toggle-btn {
    width: 100%;
    justify-content: space-between;
    background: #020617;
    border-color: #111827;
    color: #e5e7eb;
}

.chevron {
    display: inline-block;
    transition: transform 0.18s ease;
}

.filter-bar[data-collapsed="false"] .chevron {
    transform: rotate(180deg);
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 120px;
}

.filter-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.filter-input,
.filter-select {
    background: #020617;
    border-radius: 999px;
    border: 1px solid #111827;
    color: #e5e7eb;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
}

.filter-input:focus,
.filter-select:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 999px;
    border: 1px solid transparent;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    background: #1d4ed8;
    color: #e5e7eb;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:hover {
    background: #2563eb;
    box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border-color: #1f2937;
    color: #9ca3af;
}

.btn-secondary:hover {
    background: #020617;
}

.btn-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid #111827;
    background: #020617;
    color: #9ca3af;
    gap: 0.25rem;
}

.tag-pill {
    background: #111827;
    color: #e5e7eb;
}

/* Layout grid */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem;
}

.section-heading h1 {
    margin: 0;
    font-size: 1.4rem;
}

.section-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin: 0.75rem 0 2.25rem;
}

.base-card {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 55%),
                radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.18), transparent 50%),
                #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    position: relative;
}

.base-thumb {
    position: relative;
    overflow: hidden;
}

.base-thumb img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.base-card:hover .base-thumb img {
    transform: scale(1.03);
}

.base-badge {
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.base-body {
    padding: 0.85rem 0.95rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.base-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #9ca3af;
}

.base-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.base-description {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
    max-height: 3.4em;
    overflow: hidden;
}

.base-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
}

.likes-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    color: #f9fafb;
}

.likes-pill span {
    color: #fbbf24;
}

.copy-btn {
    font-size: 0.78rem;
    padding-inline: 0.75rem;
}

.empty-state {
    padding: 3rem 1rem 4rem;
    text-align: center;
    color: #6b7280;
    border-radius: 1rem;
    border: 1px dashed #1f2937;
    background: radial-gradient(circle at top, rgba(37, 99, 235, 0.08), transparent 55%),
                #020617;
}

/* Detail page */
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
    gap: 1.5rem;
    margin: 1.5rem 0 2.5rem;
}

.detail-image-card,
.detail-meta-card {
    background: #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    padding: 1rem;
}

.detail-image-card {
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.25), transparent 55%),
                #020617;
}

.detail-meta-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.detail-meta-top h1 {
    font-size: 1.2rem;
    margin: 0;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.detail-description {
    font-size: 0.9rem;
    color: #d1d5db;
    line-height: 1.5;
    margin-bottom: 0.9rem;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.meta-label {
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-size: 0.7rem;
}

.meta-value {
    color: #e5e7eb;
}

.link-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-row input {
    flex: 1;
    background: #020617;
    border-radius: 999px;
    border: 1px solid #111827;
    color: #9ca3af;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.75rem;
}

.likes-count-large {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

/* Army cards */
.army-section {
    margin-top: 0.5rem;
}

.army-card {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.3), transparent 55%),
                #020617;
    border-radius: 1rem;
    border: 1px solid #111827;
    padding: 0.85rem 0.95rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 100%;
    overflow: hidden;
}

.army-thumb {
    display: block;
    margin: -0.85rem -0.95rem 0.4rem -0.95rem;
    overflow: hidden;
}

.army-thumb img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.army-card:hover .army-thumb img {
    transform: scale(1.03);
}

.army-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.army-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.army-meta {
    font-size: 0.75rem;
    color: #9ca3af;
}

.army-composition {
    font-size: 0.8rem;
    color: #e5e7eb;
    line-height: 1.45;
    white-space: pre-wrap;
}

.army-description {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
}

.army-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.section-divider {
    margin: 0.25rem 0 1.25rem;
    border-bottom: 1px solid #111827;
}

/* Upload form */
.form-card {
    margin: 1.75rem 0 2.75rem;
    background: #020617;
    border-radius: 1.1rem;
    border: 1px solid #111827;
    padding: 1.25rem 1.5rem 1.75rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #9ca3af;
}

.form-control,
.form-select,
.form-textarea {
    background: #020617;
    border-radius: 0.75rem;
    border: 1px solid #111827;
    color: #e5e7eb;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
}

.form-control:focus,
.form-select:focus,
.form-textarea:focus {
    outline: 2px solid #2563eb;
    outline-offset: 1px;
}

.form-textarea {
    resize: vertical;
    min-height: 90px;
}

.form-help {
    font-size: 0.75rem;
    color: #6b7280;
}

.form-actions {
    margin-top: 1.25rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.error-message,
.success-message {
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.error-message {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.6);
    color: #fecaca;
}

.success-message {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.7);
    color: #bbf7d0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    border: 1px solid #1f2937;
    background: #020617;
}

.badge-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
}

.badge-dot-online {
    background: #22c55e;
}

.pill-muted {
    color: #9ca3af;
}

/* Utility */
.mt-sm {
    margin-top: 0.5rem;
}

.mt-md {
    margin-top: 1rem;
}

.text-muted {
    color: #6b7280;
}

.text-right {
    text-align: right;
}

/* Responsive */
@media (max-width: 900px) {
    .detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-toggle-row {
        display: flex;
    }

    /* Collapsible behavior only on mobile */
    .filter-bar[data-collapsed="true"] .filter-form {
        display: none;
    }

    .filter-actions {
        align-items: stretch;
    }

    .filter-actions .btn,
    .filter-actions .btn-secondary {
        width: 100%;
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    footer .container {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .container {
        padding-inline: 1rem;
    }

    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .base-thumb img {
        height: 190px;
    }
}

