* { box-sizing: border-box; }

body {
    margin: 0;
    height: 100vh;
    background: #060913;
    color: #f8fafc;
    font-family: system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#fireworks-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.wrapper {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 440px;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.back-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.15s;
}
.back-link:hover { color: #f8fafc; }

.audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #334155;
}

.mute-btn {
    background: transparent;
    border: none;
    color: #f8fafc;
    font-size: 1rem;
    padding: 0;
    cursor: pointer;
}

.vol-slider {
    width: 75px;
    accent-color: #eab308;
    cursor: pointer;
}

.studio-card {
    width: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.app-title {
    margin: 0 0 14px 0;
    font-size: 1.05rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
}

.genre-bar {
    display: flex;
    gap: 6px;
    background: #020617;
    padding: 5px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    margin-bottom: 20px;
}

.genre-btn {
    flex: 1;
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 8px 6px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.genre-btn:hover { color: #f8fafc; }
.genre-btn.active {
    background: #1e293b;
    color: #38bdf8;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.bpm-display {
    font-size: 4rem;
    font-weight: 900;
    color: #38bdf8;
    line-height: 1;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}
.bpm-display small {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 700;
}

.vu-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    height: 90px;
    margin: 22px 0;
    padding: 12px;
    background: #020617;
    border-radius: 12px;
    border: 1px solid #1e293b;
}

.vu-bar {
    flex: 1;
    height: 8%;
    background: #22c55e;
    border-radius: 4px;
    transition: height 0.05s ease-out, background-color 0.1s;
}

.controls {
    display: flex;
    gap: 12px;
}

.controls button {
    flex: 1;
    padding: 14px;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.08s;
}
.controls button:active { transform: scale(0.95); }

.tap-btn {
    background: #eab308;
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.35);
}

.play-btn {
    background: #334155;
    color: #f8fafc;
}
.play-btn.active {
    background: #ef4444;
    color: #ffffff;
}

.hint {
    margin: 16px 0 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.tempo-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.4);
    transition: all 0.2s ease;
}

.tempo-badge.preset {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.beat-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.beat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid #334155;
    transition: transform 0.08s ease-out, background-color 0.08s, box-shadow 0.08s;
}

.beat-dot.active {
    background: #38bdf8;
    border-color: #7dd3fc;
    transform: scale(1.3);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
}

.beat-dot.active.downbeat {
    background: #eab308;
    border-color: #fde047;
    box-shadow: 0 0 14px rgba(234, 179, 8, 0.9);
}

.rhythm-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #cbd5e1;
}
.rhythm-stats span {
    background: #020617;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid #1e293b;
}
.rhythm-stats strong {
    color: #4ade80;
}
