/* TechLab Fase 2 */
.techlab-phase2-bar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 992px) {
    .techlab-phase2-bar {
        grid-template-columns: minmax(240px, 280px) 1fr;
        align-items: start;
    }
}

.user-profile-panel {
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: var(--radius, 16px);
    overflow: hidden;
}

.profile-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 212, 255, 0.08);
    border: none;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
}

.profile-body {
    padding: 0 1rem 1rem;
}

.profile-body.is-collapsed {
    display: none;
}

.user-level-badge {
    background: var(--primary);
    color: var(--darker, #050508);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.techlab-arena-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .techlab-arena-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.lab-tutorial-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.btn-tutorial {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}

.btn-tutorial:hover {
    background: rgba(0, 212, 255, 0.12);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none;
}

.modal-content {
    max-width: 440px;
    width: 100%;
    padding: 1.75rem;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin: 1rem 0;
    text-align: left;
}

.lead-form input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.35);
    color: #fff;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
}

.privacy-note {
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-size: 0.8rem;
}

.gamification-notification {
    position: fixed;
    top: 5.5rem;
    right: 1rem;
    max-width: 320px;
    background: linear-gradient(135deg, #1a1a2e, #0a0a0f);
    border-left: 4px solid var(--primary);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    z-index: 9500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    animation: phase2SlideIn 0.35s ease;
}

.gamification-notification.level-up {
    border-left-color: #ffd700;
}

.gamification-notification.badge-unlock {
    border-left-color: #ff6b6b;
}

@keyframes phase2SlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.xp-bar {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.xp-fill {
    background: linear-gradient(90deg, var(--primary), var(--secondary, #6c63ff));
    height: 100%;
    transition: width 0.35s ease;
}

.stats-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.75));
}

.leaderboard-list {
    max-height: 280px;
    overflow-y: auto;
}

.leaderboard-entry {
    display: grid;
    grid-template-columns: 2rem 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.45rem 0.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.88rem;
}

.leaderboard-entry.top-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.15), transparent);
}

.leaderboard-entry.top-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.12), transparent);
}

.leaderboard-entry.top-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.12), transparent);
}

.leaderboard-entry.is-you {
    border-left: 3px solid var(--primary);
    padding-left: 0.5rem;
}

.challenge-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(108, 99, 255, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: var(--radius, 16px);
    padding: 1.25rem;
    height: 100%;
}

.challenge-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.challenge-reward,
.challenge-timer {
    font-size: 0.9rem;
    margin: 0.35rem 0;
}

#datacenterCanvas {
    width: 100%;
    height: 320px;
    display: block;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    background: #050508;
}

.datacenter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.metrics-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1;
}

.metric-card {
    background: rgba(0, 0, 0, 0.45);
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tutorial-card {
    max-width: 400px;
    width: 100%;
    padding: 1.5rem;
    text-align: center;
}

.tutorial-step {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
}

.tutorial-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .gamification-notification {
        left: 1rem;
        right: 1rem;
        max-width: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gamification-notification {
        animation: none;
    }

    .xp-fill {
        transition: none;
    }
}
