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

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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(to bottom, #F6FB8E 0%, #FFB7FF 50%, #70A4DE 100%);
    color: #2a1f4e;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(42, 31, 78, 0.1);
    margin-bottom: 32px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #2a1f4e;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(42, 31, 78, 0.1);
    border-radius: 20px;
    font-size: 12px;
    color: #2a1f4e;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.network-badge .arbitrum-logo {
    width: 16px;
    height: 16px;
}

.account-badge {
    position: relative;
    padding: 6px 12px;
    background: rgba(217, 70, 239, 0.15);
    border: 1px solid rgba(217, 70, 239, 0.3);
    border-radius: 20px;
    font-size: 12px;
    font-family: monospace;
    cursor: pointer;
    color: #2a1f4e;
}

.account-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(42, 31, 78, 0.2);
    border-radius: 1rem;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    color: #2a1f4e;
    backdrop-filter: blur(8px);
}

.account-badge:hover .account-tooltip {
    opacity: 1;
    visibility: visible;
}

.connect-btn {
    padding: 8px 16px;
    background: #2a1f4e;
    border: none;
    border-radius: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.connect-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 31, 78, 0.3);
}

.connect-btn.connected {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(42, 31, 78, 0.2);
    color: #2a1f4e;
}

.hidden {
    display: none !important;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Status Card */
.status-card {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(42, 31, 78, 0.1);
    border-radius: 1rem;
    backdrop-filter: blur(8px);
}

.status-card.connected {
    display: none;
}

.status-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(217, 70, 239, 0.15);
    border-radius: 50%;
    color: #d946ef;
}

.status-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.status-card h2 {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 700;
}

.status-card p {
    color: rgba(42, 31, 78, 0.6);
    margin-bottom: 24px;
    line-height: 1.5;
}

.primary-btn {
    padding: 12px 32px;
    background: #2a1f4e;
    border: none;
    border-radius: 1rem;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(42, 31, 78, 0.4);
}

/* Character Section */
.character-section {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(42, 31, 78, 0.1);
    border-radius: 1rem;
    padding: 24px;
    backdrop-filter: blur(8px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.refresh-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(42, 31, 78, 0.15);
    border-radius: 1rem;
    color: rgba(42, 31, 78, 0.7);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    color: #2a1f4e;
}

.refresh-btn.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.character-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid transparent;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.character-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.character-card.selected {
    border-color: #d946ef;
    background: rgba(217, 70, 239, 0.15);
}

.character-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.character-card.locked:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.6);
}

.character-card img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 12px;
}

.character-card .name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.character-card .status {
    font-size: 11px;
    color: rgba(42, 31, 78, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.character-card.selected .status {
    color: #d946ef;
}

.character-card.locked .status {
    color: rgba(42, 31, 78, 0.4);
}

/* Marketplace Section */
.marketplace-section {
    margin-top: auto;
}

.marketplace-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(217, 70, 239, 0.2);
    border-radius: 1rem;
    backdrop-filter: blur(8px);
}

.marketplace-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
    font-weight: 700;
}

.marketplace-info p {
    font-size: 13px;
    color: rgba(42, 31, 78, 0.6);
}

.marketplace-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #2a1f4e;
    border: none;
    border-radius: 1rem;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.marketplace-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(42, 31, 78, 0.4);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    margin-top: 32px;
    border-top: 1px solid rgba(42, 31, 78, 0.1);
}

.footer p {
    font-size: 13px;
    color: rgba(42, 31, 78, 0.4);
}

/* Responsive */
@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .marketplace-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
