.archive-container {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

.archive-header {
    text-align: center;
    margin-bottom: 3rem;
}

.archive-header h1 {
    font-family: 'Permanent Marker', cursive;
    font-size: 2.5rem;
    color: var(--ink-color);
    margin-bottom: 0.5rem;
}

.archive-header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.archive-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-family: 'Kalam', cursive;
    color: var(--text-light);
}

.filter-group select {
    padding: 0.5rem 1rem;
    border: 2px dashed var(--ink-color);
    border-radius: 8px;
    background: var(--paper-color);
    font-family: 'Comic Neue', cursive;
    cursor: pointer;
}

.search-box {
    position: relative;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: 2px dashed var(--ink-color);
    border-radius: 8px;
    background: var(--paper-color);
    font-family: 'Comic Neue', cursive;
    width: 200px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.archive-card {
    background: var(--paper-color);
    border: 3px dashed var(--ink-color);
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
    transition: transform 0.3s;
    cursor: pointer;
}

.archive-card:hover {
    transform: translateY(-5px) rotate(-1deg);
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.1);
}

.archive-date {
    font-family: 'Permanent Marker', cursive;
    color: var(--gold-accent);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.archive-capsule {
    background: white;
    border: 2px solid var(--ink-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.meme-thumbnail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meme-thumb {
    aspect-ratio: 1;
    background: var(--paper-color);
    border: 1px dashed var(--text-light);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
}

.meme-thumb.gold::before {
    content: '🥇';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
}

.meme-thumb.silver::before {
    content: '🥈';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
}

.meme-thumb.bronze::before {
    content: '🥉';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2rem;
}

.archive-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-top: 1px dashed var(--text-light);
    margin-top: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Kalam', cursive;
    color: var(--text-light);
}

.view-capsule-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--gold-accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Permanent Marker', cursive;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.view-capsule-btn:hover {
    background: #FF9800;
    transform: scale(1.05);
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px dashed var(--gold-accent);
    border-radius: 50%;
    animation: spin 2s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: var(--paper-color);
    border: 2px dashed var(--ink-color);
    border-radius: 8px;
    font-family: 'Kalam', cursive;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: var(--gold-accent);
    color: white;
}

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

#pageInfo {
    font-family: 'Kalam', cursive;
    color: var(--text-light);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--paper-color);
    border: 3px dashed var(--ink-color);
    border-radius: 15px;
    padding: 2rem;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    width: 90%;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.close-modal:hover {
    color: var(--ink-color);
}

.capsule-detail {
    padding: 1rem;
}

.capsule-detail h2 {
    font-family: 'Permanent Marker', cursive;
    color: var(--ink-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.meme-detail {
    background: white;
    border: 2px solid var(--ink-color);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.meme-rank {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.meme-detail h3 {
    font-family: 'Kalam', cursive;
    color: var(--ink-color);
    margin-bottom: 0.5rem;
}

.meme-image-placeholder {
    width: 100%;
    height: 200px;
    background: var(--paper-color);
    border: 2px dashed var(--text-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.meme-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-family: 'Comic Neue', cursive;
}

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

    .archive-filters {
        flex-direction: column;
        align-items: center;
    }

    .search-box input {
        width: 100%;
    }
}