@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Poppins:wght@700;800&display=swap');

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

:root {
    --glass-bg: rgba(255, 255, 255, 0.32);
    --glass-border: rgba(255, 255, 255, 0.62);
    --glass-hover-bg: rgba(255, 255, 255, 0.48);
    --glass-hover-border: rgba(255, 255, 255, 0.85);
    --text-primary: #1e1b4b;
    --text-secondary: #3730a3;
    --text-muted: #6366f1;
    --text-desc: #374151;
}

/* ─── Base ───────────────────────────────────────────────────── */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    background: linear-gradient(135deg,
        #1e40af 0%,
        #0369a1 28%,
        #0891b2 58%,
        #0d9488 82%,
        #16a34a 100%
    );
    background-attachment: fixed;
}

/* ─── Animated Background ────────────────────────────────────── */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
}

.bg-blob-1 {
    width: 650px;
    height: 650px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.35) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    animation: blob-drift 22s infinite ease-in-out;
}

.bg-blob-2 {
    width: 550px;
    height: 550px;
    background: radial-gradient(circle at center, rgba(250, 204, 21, 0.45) 0%, transparent 70%);
    bottom: -180px;
    left: -120px;
    animation: blob-drift 28s infinite ease-in-out reverse;
}

.bg-blob-3 {
    width: 460px;
    height: 460px;
    background: radial-gradient(circle at center, rgba(52, 211, 153, 0.35) 0%, transparent 70%);
    top: 40%;
    left: 38%;
    animation: blob-drift 34s infinite ease-in-out 6s;
}

@keyframes blob-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%       { transform: translate(45px, -35px) scale(1.05); }
    50%       { transform: translate(-25px, 32px) scale(0.97); }
    75%       { transform: translate(28px, 22px) scale(1.03); }
}

/* ─── Layout ─────────────────────────────────────────────────── */
.page-wrap {
    position: relative;
    z-index: 1;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

/* ─── Header ─────────────────────────────────────────────────── */
.site-header {
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
    margin-bottom: 2rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.logo-icon {
    width: 54px;
    height: 54px;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255,255,255,0.3) inset;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
    fill: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.25));
}

.site-name {
    font-family: 'Poppins', sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.site-tagline {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 500px;
    margin: 0 auto 1.4rem;
    font-weight: 400;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

.header-stats {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.55rem 1.5rem;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.header-stats span {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
    display: inline-block;
    flex-shrink: 0;
}

.dot-pink {
    background: #fde68a;
    box-shadow: 0 0 8px rgba(253, 230, 138, 0.9);
}

/* ─── Search ─────────────────────────────────────────────────── */
.search-wrap {
    max-width: 540px;
    margin: 0 auto 2.75rem;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-60%);
    color: rgba(99, 102, 241, 0.6);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.9rem 1.25rem 0.9rem 3rem;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 14px;
    color: #1e1b4b;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: rgba(99, 102, 241, 0.5);
    font-weight: 400;
}

.search-input:focus {
    border-color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 8px 32px rgba(0, 0, 0, 0.15);
}

.search-count {
    text-align: center;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    margin-top: 0.6rem;
    letter-spacing: 0.02em;
}

/* ─── Grid ───────────────────────────────────────────────────── */
.token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.15rem;
}

/* ─── Card ───────────────────────────────────────────────────── */
.token-card {
    background: var(--glass-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1.5px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.6rem 1.5rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1), 0 1px 0 rgba(255,255,255,0.8) inset;
}

.token-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    pointer-events: none;
    border-radius: inherit;
}

.token-card:hover {
    transform: translateY(-5px);
    background: var(--glass-hover-bg);
    border-color: var(--glass-hover-border);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.6),
        0 1px 0 rgba(255,255,255,0.9) inset;
}

.card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.token-img-wrap {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.token-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.token-img-fallback {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-secondary);
}

.token-title {
    flex: 1;
    min-width: 0;
}

.token-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.62rem;
    border-radius: 100px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 0.28rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-width: 1px;
    border-style: solid;
}

.token-desc {
    font-size: 0.815rem;
    color: var(--text-desc);
    line-height: 1.65;
    flex: 1;
}

.card-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.7rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #4338ca;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.card-link:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

.card-link--cmc {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.3);
    color: #047857;
}

.card-link--cmc:hover {
    background: rgba(5, 150, 105, 0.2);
    border-color: rgba(5, 150, 105, 0.5);
}

/* ─── Badge Colors ───────────────────────────────────────────── */
.badge-0 { background: rgba(99, 102, 241, 0.15); border-color: rgba(99, 102, 241, 0.45); color: #4338ca; }
.badge-1 { background: rgba(219, 39, 119, 0.12); border-color: rgba(219, 39, 119, 0.4);  color: #be185d; }
.badge-2 { background: rgba(8, 145, 178, 0.12);  border-color: rgba(8, 145, 178, 0.4);   color: #0e7490; }
.badge-3 { background: rgba(202, 138, 4, 0.14);  border-color: rgba(202, 138, 4, 0.4);   color: #a16207; }
.badge-4 { background: rgba(5, 150, 105, 0.12);  border-color: rgba(5, 150, 105, 0.4);   color: #047857; }
.badge-5 { background: rgba(220, 38, 38, 0.12);  border-color: rgba(220, 38, 38, 0.4);   color: #b91c1c; }
.badge-6 { background: rgba(124, 58, 237, 0.14); border-color: rgba(124, 58, 237, 0.4);  color: #6d28d9; }
.badge-7 { background: rgba(234, 88, 12, 0.12);  border-color: rgba(234, 88, 12, 0.4);   color: #c2410c; }

/* ─── No Results ─────────────────────────────────────────────── */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* ─── Defunct Section ───────────────────────────────────────── */
.defunct-section {
    margin-top: 3.5rem;
}

.defunct-heading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 1.25rem;
}

.token-card--defunct {
    opacity: 0.5;
    filter: grayscale(0.6);
}

.token-card--defunct:hover {
    opacity: 0.7;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 2.5rem 1rem 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
    margin-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.02em;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 800px) {
    .site-name { font-size: 1.9rem; }
    .site-tagline { font-size: 0.95rem; }
    .header-stats { gap: 1rem; font-size: 0.7rem; }
    .token-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 500px) {
    .page-wrap { padding: 0 1rem 3.5rem; }
    .site-header { padding: 2.5rem 0.5rem 2rem; }
    .site-name { font-size: 1.65rem; }
    .site-logo { gap: 0.65rem; }
    .logo-icon { width: 46px; height: 46px; }
    .token-grid { grid-template-columns: 1fr; }
    .header-stats { flex-direction: column; gap: 0.5rem; }
}
