:root {
    --bg: #0a0a0f;
    --bg-card: #131318;
    --bg-input: #0a0a0f;
    --border: #2a2a35;
    --text: #e8e8ef;
    --text-dim: #7a7a8a;
    --accent: #FF6B35;
    --accent-hover: #ff8255;
    --green: #00C896;
    --gold: #FFD700;
    --purple: #8B5CF6;
    --radius: 14px;
    --vibe-color: #FF6B35;
    --vibe-glow: rgba(255, 107, 53, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lang-switch {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.lang-switch:hover {
    border-color: var(--accent);
}

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); }

/* Hero */
.hero {
    text-align: center;
    padding: 30px 0 20px;
}

.hero-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-dim);
    margin-top: 6px;
}

/* Input */
.input-section {
    padding: 0 0 20px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.username-input {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.username-input:focus {
    border-color: var(--accent);
}

.generate-btn {
    background: var(--accent);
    color: #0a0a0f;
    border: none;
    border-radius: var(--radius);
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.generate-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hint {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 8px;
    text-align: center;
}

.error-msg {
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid #f85149;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 12px;
    font-size: 14px;
    color: #ffa198;
    text-align: center;
}

/* Vibe Card — Collectible Style */
.result-section {
    padding: 10px 0 30px;
    animation: cardReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.vibe-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 0 1px var(--vibe-glow), 0 8px 32px rgba(0,0,0,0.4);
}

.vibe-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--vibe-color, var(--accent));
}

.vibe-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at top right, var(--vibe-glow), transparent 60%);
    pointer-events: none;
}

/* Tier badge */
.tier-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    z-index: 1;
}
.tier-COMMON { background: #4a5568; color: #e2e8f0; }
.tier-RARE { background: #3182ce; color: #fff; }
.tier-EPIC { background: #805ad5; color: #fff; }
.tier-LEGENDARY { background: linear-gradient(135deg, #FFD700, #FF6B35); color: #000; }

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.card-avatar {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid var(--vibe-color, var(--accent));
    object-fit: cover;
}

.card-user-info {
    flex: 1;
    min-width: 0;
}

.card-username {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.card-name {
    font-size: 14px;
    color: var(--text-dim);
    margin-top: 2px;
}

.card-vibe-emoji {
    font-size: 40px;
    line-height: 1;
    filter: drop-shadow(0 2px 8px var(--vibe-glow));
}

.card-vibe-section {
    padding: 0 20px 12px;
    position: relative;
    z-index: 1;
}

.vibe-label-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.vibe-label {
    font-size: 24px;
    font-weight: 800;
    color: var(--vibe-color, var(--accent));
    letter-spacing: -0.5px;
}

.card-one-liner {
    padding: 0 20px 16px;
    font-size: 15px;
    color: var(--text);
    line-height: 1.5;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* Power bar */
.power-bar {
    margin: 0 20px 16px;
    position: relative;
    z-index: 1;
}
.power-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.power-value {
    color: var(--vibe-color, var(--accent));
    font-weight: 700;
}
.power-track {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}
.power-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--vibe-color, var(--accent)), var(--gold));
    border-radius: 3px;
    transition: width 0.8s ease;
}

.card-stats {
    display: flex;
    justify-content: space-around;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.stat-label {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-languages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 20px;
    position: relative;
    z-index: 1;
}

.lang-tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text);
}

.lang-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    font-size: 11px;
    color: var(--text-dim);
    position: relative;
    z-index: 1;
}

.card-brand {
    font-weight: 600;
    color: var(--accent);
}

/* Actions */
.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.action-btn:hover {
    border-color: var(--accent);
    background: var(--vibe-glow);
}

/* Social Share */
.social-share {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: center;
}

.social-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.social-share a:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

.share-weibo {
    font-size: 13px !important;
    font-weight: 700;
    width: auto !important;
    padding: 0 14px;
    border-radius: 20px !important;
}

/* Premium — Booster Pack */
.premium-section {
    padding: 20px 0 20px;
}

.premium-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--accent), var(--purple));
}

.premium-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.premium-badge {
    background: linear-gradient(135deg, var(--gold), var(--accent));
    color: #000;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.premium-card h3 {
    font-size: 18px;
    font-weight: 700;
}

.premium-desc {
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 20px;
}

.payment-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.wallet-info {
    margin-bottom: 12px;
}

.wallet-label {
    font-size: 12px;
    color: var(--text-dim);
    display: block;
    margin-bottom: 6px;
}

.wallet-address-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wallet-addr {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'SF Mono', Consolas, monospace;
    color: var(--text);
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    border-color: var(--accent);
}

.basescan-link {
    display: inline-block;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 12px;
}

.basescan-link:hover {
    text-decoration: underline;
}

.payment-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--green);
    text-align: center;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px 0 12px;
    font-size: 13px;
    color: var(--text-dim);
}

.footer-links {
    text-align: center;
    padding: 0 0 40px;
    font-size: 12px;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent);
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 600px) {
    .hero-title { font-size: 26px; }
    .input-row { flex-direction: column; }
    .generate-btn { width: 100%; }
    .card-stats { flex-direction: row; gap: 8px; }
    .stat-item { flex: 1; }
    .card-actions { flex-direction: column; }
    .action-btn { width: 100%; }
    .battle-arena { flex-direction: column; gap: 16px; }
    .battle-input-row { flex-direction: column; gap: 12px; }
    .battle-vs { transform: rotate(0deg); }
    .battle-result { min-width: auto; }
}

/* Battle page */
.battle-input-row {
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: center;
}
.battle-input-col {
    flex: 1;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.battle-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dim);
    text-align: center;
}
.battle-input {
    text-align: center;
}
.battle-vs {
    font-size: 28px;
    font-weight: 900;
    color: var(--vibe-color);
    letter-spacing: 2px;
    padding: 0 4px;
}
.battle-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
.battle-btn { min-width: 200px; }

.battle-arena {
    display: flex;
    gap: 24px;
    align-items: stretch;
    justify-content: center;
    margin: 24px 0;
}
.battle-card {
    flex: 1;
    max-width: 420px;
    transition: transform 0.3s, box-shadow 0.3s;
}
.battle-card.winner {
    transform: scale(1.03);
    box-shadow: 0 0 24px rgba(0, 200, 150, 0.3);
    border-radius: var(--radius);
}
.battle-result {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    padding: 20px 8px;
}
.verdict-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--green);
    text-align: center;
    line-height: 1.5;
    padding: 12px 16px;
    background: rgba(0, 200, 150, 0.1);
    border: 1px solid rgba(0, 200, 150, 0.3);
    border-radius: var(--radius);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.4s, transform 0.4s;
}
.verdict-shown .verdict-text {
    opacity: 1;
    transform: scale(1);
}
