:root {
    --bg-color: #0d0d12;
    --panel-bg: rgba(25, 25, 35, 0.4);
    --panel-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15), transparent 25%);
}

.app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
}

@media (min-width: 481px) {
    .app-container {
        height: auto;
        min-height: 800px;
        border-radius: 32px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        background: rgba(13, 13, 18, 0.8);
        border: 1px solid var(--panel-border);
        backdrop-filter: blur(20px);
    }
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a8a5f6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    margin-bottom: 2.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.offline {
    background-color: var(--danger);
    box-shadow: 0 0 10px var(--danger-glow);
}

.dot.online {
    background-color: var(--success);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.power-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(145deg, #2a2a35, #1d1d25);
    box-shadow: 
        10px 10px 20px rgba(0,0,0,0.4),
        -10px -10px 20px rgba(255,255,255,0.03);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 10;
}

.power-btn svg {
    width: 48px;
    height: 48px;
    transition: all 0.3s ease;
}

.power-btn:hover {
    transform: scale(1.05);
}

.power-btn:active {
    transform: scale(0.95);
    box-shadow: 
        inset 10px 10px 20px rgba(0,0,0,0.4),
        inset -10px -10px 20px rgba(255,255,255,0.03);
}

.power-btn.active {
    background: linear-gradient(145deg, var(--danger), #b91c1c);
    box-shadow: 0 0 30px var(--danger-glow);
    color: white;
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 20px var(--danger-glow); }
    50% { box-shadow: 0 0 40px var(--danger-glow); }
    100% { box-shadow: 0 0 20px var(--danger-glow); }
}

.visualizer-container {
    width: 100%;
    height: 60px;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas#visualizer {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.controls-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: auto;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.custom-select {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    font-size: 0.95rem;
    appearance: none;
    outline: none;
    transition: border-color 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
}

.custom-select:focus {
    border-color: var(--primary);
}

.note {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.toggles-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
}

.toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.toggle input {
    display: none;
}

.slider {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(20px);
    background-color: white;
}

.label-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.install-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border: none;
    border-radius: 999px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.install-btn:active {
    transform: translateY(1px);
}

.install-btn svg {
    width: 16px;
    height: 16px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.toggle.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* --- Zona Infantil --- */
:root {
    --kids-primary: #ec4899;
    --kids-primary-glow: rgba(236, 72, 153, 0.4);
    --kids-accent: #a855f7;
}

body {
    overflow-y: auto !important;
}

/* Adjust app container for scrolling two panels */
.app-container {
    height: auto;
    min-height: 100vh;
    padding-bottom: 3rem;
}

.kids-panel {
    margin-top: 1.5rem;
    background: rgba(35, 20, 35, 0.35);
    border: 1px solid rgba(236, 72, 153, 0.15);
    box-shadow: 0 8px 32px 0 rgba(236, 72, 153, 0.08);
}

.kids-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f472b6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    letter-spacing: -0.5px;
}

.kids-header p {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.kids-effects {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.kids-select {
    border-color: rgba(236, 72, 153, 0.2);
}

.kids-select:focus {
    border-color: var(--kids-primary);
}

.kids-toggles {
    background: rgba(236, 72, 153, 0.05);
    padding: 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(236, 72, 153, 0.1);
    display: flex;
    justify-content: center;
}

.kids-slider {
    background-color: rgba(255, 255, 255, 0.1);
}

.kids-slider:before {
    background-color: var(--text-muted);
}

input:checked + .kids-slider {
    background-color: var(--kids-primary);
}

input:checked + .kids-slider:before {
    background-color: white;
}

.voice-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    width: 100%;
    margin-bottom: 0.5rem;
}

.voice-btn {
    padding: 0.8rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.voice-btn span {
    font-size: 1.6rem;
    transition: transform 0.2s ease;
}

.voice-btn:hover {
    background: rgba(236, 72, 153, 0.06);
    border-color: rgba(236, 72, 153, 0.25);
    transform: translateY(-2px);
}

.voice-btn:hover span {
    transform: scale(1.15);
}

.voice-btn.active {
    background: rgba(236, 72, 153, 0.15);
    border-color: var(--kids-primary);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.25);
    color: white;
    transform: scale(1.03);
}

.kids-beat-section {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.beat-btn {
    width: 100%;
    padding: 0.9rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--kids-primary), var(--kids-accent));
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px var(--kids-primary-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.beat-btn.active {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.beat-btn:hover {
    transform: scale(1.02);
}

.beat-btn:active {
    transform: scale(0.98);
}
