.main-content {
    padding-bottom: 0px;
}
.container { max-width: 600px; margin: 0 auto; padding: 20px; }
.lab-header { 
    background: white; 
    padding: 16px 15px; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    border-bottom: 2px solid var(--border); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    justify-content: space-between; 
}

.upload-section { background: white; border-radius: 20px; padding: 20px; text-align: center; border: 2px dashed var(--cyan); margin-bottom: 20px; cursor: pointer; }

.difficulty-section { margin-bottom: 30px; }
.difficulty-title { font-weight: 900; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; color: var(--text-light); margin-bottom: 15px; }

.grid-treinos { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.card-treino { background: white; border-radius: 15px; border: 2px solid var(--border); overflow: hidden; box-shadow: 0 4px 0 var(--border); transition: transform 0.1s; cursor: pointer; position: relative; }
.card-treino img { width: 100%; height: 120px; object-fit: cover; background: #f9f9f9; }
.card-treino span { display: block; padding: 10px; font-weight: 800; font-size: 0.85rem; text-align: center; }

/* Interface do Editor */
#playground-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #111; z-index: 20000; display: none; flex-direction: column; }

.editor-header { 
    padding: 15px; background: black; backdrop-filter: blur(10px); 
    display: flex; justify-content: space-between; align-items: center; 
    position: absolute; top: 0; width: 100%; z-index: 50; 
}

.editor-canvas { 
    flex-grow: 1; display: flex; align-items: center; justify-content: center; 
    position: relative; overflow: hidden; width: 100%; height: 100%;
}

#ar-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: none; }

/* Área do Desenho + Grade */
.image-container {
    position: relative;
    display: inline-block;
    z-index: 10;
    max-width: 95vw;
    max-height: 80vh;
    background-color: white;
    line-height: 0;
}

#editor-img { 
    max-width: 95vw; 
    max-height: 80vh; 
    width: auto;
    height: auto;
    object-fit: contain; 
    transition: opacity 0.3s;
    pointer-events: none;
}

/* Grade Melhorada: Inversão de cores para visibilidade total */
#editor-grid { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    pointer-events: none; 
    display: none; 
    z-index: 20;
    /* Mistura de cores para ser visível no branco e preto */
    mix-blend-mode: difference;
    background-image: 
        linear-gradient(to right, white 1px, transparent 1px),
        linear-gradient(to bottom, white 1px, transparent 1px);
    background-size: 50px 50px; /* Valor padrão inicial */
    opacity: 0.3;
}

/* Controles Inferiores */
.editor-footer {
    position: absolute; bottom: 0; width: 100%;
    padding: 20px; background: black;
    display: none; flex-direction: column; gap: 15px; z-index: 60;
}
.grid-controls { display: flex; align-items: center; gap: 15px; color: white; font-weight: 700; }
.grid-controls input { flex-grow: 1; accent-color: var(--cyan); }

.tool-btn { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.4); color: white; padding: 8px 12px; border-radius: 12px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 5px; font-size: 0.85rem; }
.tool-btn.active { background: var(--cyan); border-color: var(--cyan); }

/* Estilo para itens bloqueados */
.card-treino.locked img {
    filter: blur(4px) grayscale(1);
    opacity: 0.6;
}
.card-treino.locked::after {
    content: '\f023'; /* Ícone de cadeado do FontAwesome */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 5;
}

/* Selos de Passo a Passo, premium etc... */
.step-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: var(--cyan);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.3);
}
.unlock-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: #a855f7;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}
.premium-badge {
    position: absolute;
    top: 2px;
    left: 2px;
    background: linear-gradient(135deg,#FFD700,#FFA500);
    color: #000;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

/* Fundo escurecido e desfocado */
#instruction-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 30000;
    display: none; align-items: center; justify-content: center;
    padding: 20px; backdrop-filter: blur(5px);
    flex-flow: wrap;
    overflow-y: scroll;
}
/* Caixa branca com animação de "subida" */
.modal-content {
    background: white; border-radius: 25px; padding: 30px;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transform: translateY(50px); opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
/* Ativação da animação via JS */
#instruction-modal.show .modal-content { transform: translateY(0); opacity: 1; }

.modal-img { width: 130px; height: 130px; border-radius: 20px; object-fit: cover; margin-bottom: 15px; border: 4px solid var(--bg-app); }
.modal-text { color: var(--text); font-weight: 700; line-height: 1.4; margin-bottom: 25px; font-size: 0.9rem; }

.step-btn {
    width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,0.6); 
    border: 2px solid rgba(255,255,255,0.3); color: white; font-size: 1.2rem;
    cursor: pointer; backdrop-filter: blur(5px); transition: 0.2s;
}
.step-btn:active { transform: scale(0.9); background: var(--cyan); }

/* Canvas de Desenho - Fica exatamente sobre a imagem */
#drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 30;
    touch-action: none;
    display: none;
}

#brush-preview {
    position: fixed;
    border: 2px solid white;
    border-radius: 50%;
    pointer-events: none;
    display: none;
    z-index: 10000;
    mix-blend-mode: difference;
}

.draw-tools {
    display: none;
    gap: 10px;
    justify-content: center;
}

.tool-btn.mode-draw { background: #f0932b; }

#img-container {
    transform-origin: 0 0;
}

/* Container do Menu Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: #222;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    border-radius: 12px;
    z-index: 100;
    padding: 10px;
    border: 1px solid #444;
}

.dropdown-content.show {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dropdown-content .tool-btn {
    width: 100%;
    justify-content: flex-start;
    background: rgba(255,255,255,0.1);
}

/* Container rolável horizontalmente para telas pequenas */
.fundamento-filtros {
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding-bottom: 20px;
    scrollbar-width: none; /* Oculta a barra no Firefox */
}
.fundamento-filtros::-webkit-scrollbar { 
    display: none; /* Oculta a barra no Chrome/Safari */
}

/* Estilo padrão das pílulas de filtro */
.filtro-btn {
    border: 2px solid var(--border); 
    color: var(--text-light);
    padding: 8px 18px; 
    border-radius: 20px; 
    font-weight: 800; 
    font-size: 0.85rem;
    cursor: pointer; 
    white-space: nowrap; 
    transition: all 0.3s ease;
}

/* Estilo do filtro selecionado */
.filtro-btn.active {
    background: var(--cyan); 
    border-color: var(--cyan); 
    color: white;
}

@media (max-width: 768px) {
    .main-content {
        padding-bottom: 80px;
    }
}

/*REMOVER DEPOIS*/
@media (min-width: 768px) {
    .sidebar{
        width: auto!important;
    }
}