/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 28%),
                radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.1), transparent 25%),
                #eef2f7;
    color: #111827;
    line-height: 1.7;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    padding: 1.2rem 0;
}

.header-left {
    flex: 1;
    min-width: 0;
}

header h1 {
    font-size: clamp(1.75rem, 2.5vw, 2.5rem);
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.8rem;
    line-height: 1.05;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

nav a {
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    background: rgba(148, 163, 184, 0.08);
}

nav a:hover,
nav a.active {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
}

.wallet .btn {
    min-width: 140px;
}

/* Main content */
main {
    padding: 3rem 0 2rem;
}

.filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 2.5rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.02em;
}

.btn-primary {
    background: linear-gradient(135deg, #4338ca, #2563eb);
    color: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
}

.btn-secondary {
    background: #ffffff;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover,
.btn-primary:hover {
    transform: translateY(-1px);
}

.btn-primary.active,
.page-btn.active {
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.22);
}

/* Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.75rem;
}

/* Cards */
.card {
    background: #ffffff;
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 2rem;
    right: 2rem;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4338ca, #38bdf8);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.12);
}

.card h2 {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: #0f172a;
}

.card p {
    color: #475569;
    margin-bottom: 1.4rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #f1f5f9;
    color: #334155;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.tag-mainnet { background: #dbeafe; color: #1d4ed8; }
.tag-testnet { background: #dcfce7; color: #166534; }
.tag-l1 { background: #fee2e2; color: #991b1b; }
.tag-l2 { background: #fef3c7; color: #92400e; }
.tag-Expected { background: #fef3c7; color: #92400e; }
.tag-Free { background: #ecfccb; color: #4d7c0f; }
.tag-Ended { background: #fde8e8; color: #991b1b; }

.card-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 999;
}

.modal {
    width: min(640px, 100%);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #0f172a;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #475569;
}

.modal-body {
    padding: 1.5rem;
    color: #334155;
}

.wallet-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.wallet-option {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    background: #f8fafc;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.wallet-option:hover {
    background: #eff6ff;
    transform: translateY(-1px);
    border-color: #93c5fd;
}

.wallet-option .wallet-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
}

.wallet-option .wallet-name {
    font-weight: 700;
    color: #0f172a;
}

.wallet-option .wallet-description {
    font-size: 0.92rem;
    color: #64748b;
}

.wallet-option .wallet-action {
    color: #2563eb;
    font-weight: 700;
}

.modal-body ol {
    margin: 1rem 0;
    padding-left: 1.2rem;
}

.modal-body li {
    margin-bottom: 0.85rem;
}

.guide-intro {
    font-weight: 700;
    margin-bottom: 1rem;
}

.guide-note {
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.95rem;
}

.status {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-left: 1rem;
}

.status-active { background: #d1fae5; color: #166534; }
.status-expected { background: #fef3c7; color: #92400e; }
.status-airdrop { background: #d9f99d; color: #365314; }
.status-ended { background: #fee2e2; color: #991b1b; }

/* Footer */
footer {
    background: transparent;
    padding: 2rem 0 2.5rem;
    text-align: center;
    color: #64748b;
    margin-top: 3rem;
}

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

.page-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.page-btn:hover {
    background: #eef2ff;
    transform: translateY(-1px);
}

.page-btn.active {
    background: #4338ca;
    color: #ffffff;
    border-color: transparent;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 14px;
    }

    body {
        font-size: 15px;
        line-height: 1.75;
    }

    main {
        padding: 1.25rem 0 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.15rem;
        border-radius: 16px;
    }

    .card::before {
        left: 1.1rem;
        right: 1.1rem;
    }

    .card h2 {
        font-size: 1.14rem;
        line-height: 1.35;
        margin-bottom: 0.55rem;
    }

    .card p {
        font-size: 0.98rem;
        line-height: 1.65;
        margin-bottom: 0.9rem;
    }

    .tag {
        font-size: 0.78rem;
        padding: 0.32rem 0.68rem;
    }

    .status {
        margin-left: 0;
        margin-top: 0.25rem;
        font-size: 0.74rem;
    }

    .card-buttons {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .card-buttons .btn {
        width: 100%;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 0.95rem 0;
    }

    header h1 {
        font-size: 1.55rem;
        margin-bottom: 0.65rem;
        line-height: 1.2;
    }

    .wallet {
        margin-top: 0.4rem;
        width: 100%;
    }

    .wallet .btn {
        width: 100%;
    }

    nav {
        justify-content: center;
        gap: 0.5rem;
    }

    nav a {
        font-size: 0.92rem;
        padding: 0.5rem 0.78rem;
    }

    .filters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
        margin-top: 0.8rem;
        margin-bottom: 1.3rem;
    }

    .filters .btn {
        width: 100%;
        min-height: 42px;
        padding: 0.62rem 0.55rem;
        font-size: 0.9rem;
    }

    .pagination {
        margin-top: 1.2rem;
        gap: 0.45rem;
    }

    .page-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 0.55rem 0.75rem;
    }

    footer {
        margin-top: 1.8rem;
        padding: 1.5rem 0 2rem;
        font-size: 0.9rem;
        line-height: 1.6;
    }

    #guideOverlay .modal,
    #walletSelectOverlay .modal {
        width: min(94vw, 560px) !important;
    }

    #guideOverlay .modal-header,
    #walletSelectOverlay .modal-header {
        padding: 14px 16px !important;
    }

    #guideOverlay .modal-header h3,
    #walletSelectOverlay .modal-header h3 {
        font-size: 17px !important;
    }

    #guideOverlay .modal-body,
    #walletSelectOverlay .modal-body {
        font-size: 15px !important;
        line-height: 1.72 !important;
        padding: 14px 16px !important;
    }
}

@media (max-width: 420px) {
    .container {
        padding: 0 12px;
    }

    header h1 {
        font-size: 1.4rem;
    }

    nav a {
        font-size: 0.88rem;
        padding: 0.46rem 0.68rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .filters .btn {
        min-height: 44px;
    }

    .card h2 {
        font-size: 1.08rem;
    }

    .card p {
        font-size: 0.95rem;
    }

    #guideOverlay .modal-header h3,
    #walletSelectOverlay .modal-header h3 {
        font-size: 16px !important;
    }
}
