:root {
    --bg-dark: #090d16;
    --panel-bg: rgba(20, 26, 45, 0.65);
    --panel-border: rgba(255, 255, 255, 0.08);
    --accent: #4facfe;
    --accent-glow: rgba(79, 172, 254, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --font-header: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Remove mobile grey highlights */
}

body, html {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Background Decorative Glowing Blobs */
.glass-bg-decor {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.2;
}

.decor-1 {
    top: -5%;
    left: -5%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.decor-2 {
    bottom: -5%;
    right: -5%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, #00f2fe 0%, transparent 70%);
}

/* Containers */
.app-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Screens */
.screen {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* Setup Screen styling */
#screen-setup {
    max-width: 500px;
    margin: auto;
    justify-content: center;
    gap: 24px;
}

.user-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.header-icon {
    font-size: 2.8rem;
    background: linear-gradient(135deg, var(--accent), #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 10px var(--accent-glow));
}

.user-header h1 {
    font-family: var(--font-header);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.user-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Form Selection */
.setup-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-label i {
    color: var(--accent);
}

/* Selection Buttons */
.toggle-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.toggle-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 14px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.toggle-btn.active {
    background: var(--accent);
    color: #050505;
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Submit Actions */
.submit-section {
    margin-top: 10px;
    align-items: center;
}

.btn {
    border: none;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-join {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--accent), #00f2fe);
    color: #050505;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-join:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.5);
}

.btn-join:active {
    transform: translateY(0);
}

.btn-join:disabled {
    background: #1e293b;
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.error-msg {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 6px;
    transition: opacity 0.2s;
    text-align: center;
}

/* Stats Panel */
.stats-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.stats-panel h3 {
    font-family: var(--font-header);
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-panel h3 i {
    color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0,0,0,0.18);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.02);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-val {
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-val.connected { color: var(--success); }
.stat-val.disconnected { color: var(--danger); }
.stat-val.connecting { color: var(--warning); }

/* Mural Screen styling */
#screen-mural {
    padding: 0;
    background-color: #000; /* Fondo negro por defecto */
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.btn-exit {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s, transform 0.2s;
    outline: none;
}

.btn-exit:hover {
    color: rgba(255, 255, 255, 0.7);
    transform: scale(1.05);
}

.btn-exit:active {
    transform: scale(0.95);
}

/* Overlay overlay */
.mural-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none; /* Let clicks pass through */
    transition: opacity 0.5s ease;
    z-index: 5;
    width: 90%;
    max-width: 400px;
}

.mural-overlay.executing {
    opacity: 0.05; /* Fade out almost completely during choreography */
}

.pixel-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pixel-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pixel-info h2 {
    font-family: var(--font-header);
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.mural-status {
    font-size: 1.1rem;
    font-weight: 500;
    background: rgba(255,255,255,0.06);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Countdown Clock */
.countdown-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 20px var(--accent-glow);
    animation: countdownPulse 1s infinite alternate;
}

@keyframes countdownPulse {
    0% { transform: scale(0.98); box-shadow: 0 0 15px rgba(79, 172, 254, 0.2); }
    100% { transform: scale(1.03); box-shadow: 0 0 25px rgba(79, 172, 254, 0.5); }
}

.countdown-val {
    font-family: var(--font-header);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.countdown-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.6);
}

.wake-lock-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--success);
    font-weight: 600;
}
