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

:root {
    --bg: #0f0f13;
    --surface: #1a1a24;
    --text: #e8e8ed;
    --text-muted: #8888a0;
    --accent: #6c5ce7;
    --accent-glow: rgba(108, 92, 231, 0.4);
    --accent-hover: #7c6ef7;
    --radius: 12px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

main {
    flex: 1;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ---- Hero / Home ---- */

.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

/* ---- Form ---- */

.name-form {
    max-width: 480px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 0 0 2px var(--surface), 0 4px 24px rgba(0,0,0,0.3);
}

.input-group input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    border: none;
    background: var(--surface);
    color: var(--text);
    outline: none;
    font-family: inherit;
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-group button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.input-group button:hover {
    background: var(--accent-hover);
}

.error {
    color: #e74c3c;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

/* ---- Popular names grid ---- */

.popular {
    margin-top: 3rem;
}

.popular h2 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 400;
}

.name-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.name-chip {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.9rem;
    transition: background 0.2s, box-shadow 0.2s;
}

.name-chip:hover {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ---- Detail page ---- */

.detail-hero {
    text-align: center;
    padding: 2rem 0;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text);
}

.detail-hero h1 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 2rem;
}

.detail-hero h1 strong {
    font-weight: 700;
    color: var(--accent-hover);
}

/* ---- Player ---- */

.player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.play-btn {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 0 24px var(--accent-glow);
}

.play-btn:hover {
    transform: scale(1.08);
    background: var(--accent-hover);
    box-shadow: 0 0 36px var(--accent-glow);
}

.play-btn:active {
    transform: scale(0.96);
}

/* ---- Visualizer ---- */

.visualizer {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.viz-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--surface);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.viz-dot.active {
    background: var(--accent);
    transform: scale(1.8);
    box-shadow: 0 0 16px var(--accent-glow);
}

/* ---- Download ---- */

.download-section,
.share-section {
    margin-bottom: 2rem;
}

.download-section h2,
.share-section h2 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.download-buttons,
.share-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.dl-btn,
.share-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.dl-btn:hover,
.share-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* ---- Footer ---- */

footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .detail-hero h1 {
        font-size: 1.4rem;
    }

    .play-btn {
        width: 80px;
        height: 80px;
    }

    .play-btn svg {
        width: 36px;
        height: 36px;
    }

    .input-group {
        flex-direction: column;
        border-radius: var(--radius);
    }

    .input-group input {
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .input-group button {
        border-radius: 0 0 var(--radius) var(--radius);
    }
}
