/* ========== GAMES PAGE ========== */

/* Carrossel de Temas */
.character-carousel {
    position: relative;
    background: #f0f7ff;
    padding: 20px 0;
    overflow: hidden;
    top: 90px;
}

.carousel-wrapper {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #4a90d9 transparent;
}

.carousel-wrapper::-webkit-scrollbar {
    height: 6px;
}

.carousel-wrapper::-webkit-scrollbar-thumb {
    background: #4a90d9;
    border-radius: 3px;
}

.carousel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 80px;
    transition: transform 0.2s;
}

.carousel-item:hover {
    transform: translateY(-3px);
}

.carousel-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4a90d9;
    background: white;
}

.carousel-item span {
    font-size: 0.75rem;
    color: #333;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Grid de Jogos */
.games-section {
    padding: 40px 0;
}

.games-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: #333;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* Card de Jogo */
.game-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.game-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8e8e8;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover .game-thumb img {
    transform: scale(1.05);
}

.game-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #4a90d9;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff6b6b;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.game-info {
    padding: 12px;
}

.game-info h3 {
    font-size: 0.9rem;
    margin: 0 0 6px;
    color: #333;
    line-height: 1.3;
}

.game-tag {
    display: inline-block;
    background: #f0f7ff;
    color: #4a90d9;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Categorias */
.categories-section {
    padding: 40px 0;
    background: #f0f7ff;
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 16px 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.category-all .category-icon span {
    font-size: 1.8rem;
    color: white;
    font-weight: 300;
}

/* Responsivo */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .carousel-item {
        min-width: 65px;
    }

    .carousel-item img {
        width: 48px;
        height: 48px;
    }

    .games-section h2,
    .categories-section h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* ========== GAMES PAGE ========== */

/* Carrossel de Temas */
.character-carousel {
    position: relative;
    background: #f0f7ff;
    padding: 20px 0;
    overflow: hidden;
}

.carousel-wrapper {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #4a90d9 transparent;
}

.carousel-wrapper::-webkit-scrollbar {
    height: 6px;
}
.carousel-wrapper::-webkit-scrollbar-thumb {
    background: #4a90d9;
    border-radius: 3px;
}

.carousel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 80px;
    transition: transform 0.2s;
}

.carousel-item:hover {
    transform: translateY(-3px);
}

.carousel-emoji {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: white;
    border: 3px solid #4a90d9;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.carousel-item span:last-child {
    font-size: 0.75rem;
    color: #333;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

/* Grid de Jogos */
.games-section {
    padding: 40px 0;
}

.games-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: #333;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.game-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.game-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8e8e8;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.game-card:hover .game-thumb img {
    transform: scale(1.05);
}

.game-rank {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #4a90d9;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.game-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff6b6b;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.game-info {
    padding: 12px;
}

.game-info h3 {
    font-size: 0.9rem;
    margin: 0 0 6px;
    color: #333;
    line-height: 1.3;
}

.game-tag {
    display: inline-block;
    background: #f0f7ff;
    color: #4a90d9;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Categorias */
.categories-section {
    padding: 40px 0;
    background: #f0f7ff;
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5rem;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 16px 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.category-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.category-all .category-icon span {
    font-size: 1.8rem;
    color: white;
    font-weight: 300;
}

/* Responsivo */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .carousel-item {
        min-width: 65px;
    }
    .carousel-emoji {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    .games-section h2,
    .categories-section h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.85rem;
    color: #666;
}

.breadcrumb a {
    color: #4a90d9;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    margin: 0 5px;
    color: #999;
}

/* Header da Categoria */
.category-header {
    padding: 30px 0;
    background: #f0f7ff;
}

.category-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.category-header-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    flex-shrink: 0;
}

.category-header-text h1 {
    margin: 0 0 5px;
    font-size: 1.8rem;
    color: #333;
}

.category-header-text p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* Carrossel de chips */
.theme-carousel {
    padding: 20px 0;
    background: white;
}

.carousel-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4a90d9 transparent;
}

.carousel-track::-webkit-scrollbar {
    height: 5px;
}
.carousel-track::-webkit-scrollbar-thumb {
    background: #4a90d9;
    border-radius: 10px;
}

.carousel-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
    scroll-snap-align: start;
    flex-shrink: 0;
}

.carousel-chip:hover {
    border-color: #4a90d9;
    transform: translateY(-2px);
}

.carousel-chip.active {
    background: #4a90d9;
    border-color: #4a90d9;
}

.carousel-chip.active .chip-label {
    color: white;
}

.chip-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.chip-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

/* Estado vazio */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* Breadcrumb sem cor de fundo */
.breadcrumb {
    background: none !important;
}

    .game-wrapper {
		position:relative;
        max-width: 700px;
        margin: 30px auto;
		top:70px;
        text-align: center;
    }

    .game-wrapper h1 {
        font-size: 1.8rem;
        color: #333;
        margin-bottom: 5px;
    }

    .game-wrapper p {
        color: #666;
        margin-bottom: 20px;
    }


    /* Modal */
    .modal-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 2000;
        justify-content: center;
        align-items: center;
    }

    .modal-overlay.show {
        display: flex;
    }

    .modal-box {
        background: white;
        border-radius: 20px;
        padding: 40px;
        text-align: center;
        max-width: 400px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        animation: pop 0.3s ease;
    }

    .modal-box .emoji-big {
        font-size: 4rem;
        display: block;
        margin-bottom: 10px;
    }

    .modal-box h2 {
        color: #2ed573;
        margin: 10px 0;
    }

    .modal-box p {
        color: #666;
        margin-bottom: 20px;
    }

    .modal-box button {
        padding: 10px 30px;
        border: none;
        border-radius: 50px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        margin: 5px;
        transition: transform 0.2s;
    }

    .modal-box button:hover {
        transform: scale(1.05);
    }

    @keyframes popIn {
        0% { transform: scale(0.5); opacity: 0; }
        100% { transform: scale(1); opacity: 1; }
    }

/* Barra de Ações do Jogo */
/* Barra de Ferramentas Única */
    .game-toolbar {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #ffffff;
        border: 1px solid #e0e0e0;
        padding: 8px 16px;
        border-radius: 50px; /* Deixa com visual de pílula/barra flutuante */
        margin: 0 auto 15px auto;
        max-width: fit-content;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        gap: 12px;
        flex-wrap: nowrap; /* Impede que quebre linha em telas normais */
        overflow-x: auto;  /* Permite rolagem suave caso a tela do celular seja muito pequena */
        width: 100%;
        box-sizing: border-box;
    }

    .toolbar-group {
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    /* Linha divisória discreta entre os grupos */
    .toolbar-divider {
        width: 1px;
        height: 24px;
        background-color: #ddd;
    }

    .tool-btn {
        background: #f8f9fa;
        border: 1px solid #e4e6eb;
        padding: 8px 14px;
        border-radius: 20px;
        font-size: 0.88rem;
        font-weight: 600;
        color: #4b4f56;
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        transition: all 0.2s ease;
        white-space: nowrap;
    }

    .tool-btn:hover {
        background: #e8f0fe;
        border-color: #4a90d9;
        color: #1a73e8;
        transform: translateY(-1px);
    }

    .tool-qr {
        background: #eaf5ff;
        border-color: #b8dcff;
        color: #1a73e8;
    }

    /* Ajuste responsivo para celulares muito pequenos */
    @media (max-width: 650px) {
        .game-toolbar {
            justify-content: flex-start; /* Alinha à esquerda permitindo scroll horizontal se necessário */
            border-radius: 10px;
          #  padding: 10px 12px;
        }
    }

    /* Controles */
    .game-controls {
		position: relative;
        margin-top: 20px;
        display: flex;
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
		margin-bottom:100px;
    }

    .game-controls button {
        padding: 10px 24px;
        border: none;
        border-radius: 50px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        transition: transform 0.2s;
    }

    .game-controls button:hover {
        transform: scale(1.05);
    }

    .btn-restart {
        background: #4a90d9;
        color: white;
    }

    .btn-next {
        background: #2ed573;
        color: white;
    }
    .btn-next:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .btn-sound { background: #ffd700; color: #333; }

    .game-status {
        margin-top: 15px;
        font-size: 1.1rem;
        color: #333;
        font-weight: 600;
    }

    .game-status .highlight {
        color: #4a90d9;
    }

    /* Feedback */
    .feedback {
        min-height: 40px;
        margin-bottom: 15px;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .feedback.correct {
        color: #2ed573;
    }

    .feedback.wrong {
        color: #ff6b6b;
    }



    /* Pontuação */
    .score-display {
        font-size: 1.2rem;
        color: #333;
        font-weight: 700;
        margin-bottom: 15px;
    }

    .score-display .highlight {
        color: #ffa502;
    }

    /* Barra de progresso */
    .progress-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding: 12px 20px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }

    .progress-info {
        font-size: 0.9rem;
        color: #666;
        font-weight: 600;
    }

    .progress-info .highlight {
        color: #4a90d9;
    }

    .progress-dots {
        display: flex;
        gap: 6px;
    }

    .progress-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #e0e0e0;
        transition: background 0.3s;
    }

    .progress-dot.done {
        background: #2ed573;
    }

    .progress-dot.current {
        background: #4a90d9;
    }


    .stats-bar { display: flex; justify-content: center; gap: 30px; margin-bottom: 20px; flex-wrap: wrap; }
    .stat-item { background: white; border: 2px solid #e0e0e0; border-radius: 12px; padding: 8px 20px; font-size: 0.9rem; color: #666; font-weight: 600; }
    .stat-item .highlight { color: #4a90d9; font-weight: 700; }

// Verifica login firebase
        #area-jogo { display: none; }
        #area-login {
            display: flex; flex-direction: column; align-items: center; gap: 20px;
            padding: 40px 20px; background-color: #2b2b36; border-radius: 12px;
            box-shadow: 0 8px 16px rgba(0,0,0,0.3);
        }
        .aviso-texto { font-size: 1.1rem; color: #8d99ae; }
        /* Botões */
        button {
            padding: 10px 20px; font-size: 1rem; font-weight: bold; color: #1e1e24;
            background-color: #fca311; border: none; border-radius: 8px; cursor: pointer;
            box-shadow: 0 4px 6px rgba(0,0,0,0.2); transition: background-color 0.2s;
        }
        button:hover { background-color: #e59500; }
        
        .btn-acao { width: 100%; max-width: 250px; margin-top: 20px; }
        .btn-sair { background-color: #ef476f; color: #fff; padding: 8px 16px; font-size: 0.9rem; }
        .btn-sair:hover { background-color: #d9385e; }
        .btn-ranking { background-color: #118ab2; color: #fff; margin-top: 15px; }
        .btn-ranking:hover { background-color: #0d6b8a; }
		.tituloLogin { color: #ffffff !important ;}

    /* Área do jogo */
    .game-area { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }

    .robi-area { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 20px; }
    .robi-emoji { font-size: 3rem; animation: float 2s ease-in-out infinite; }
    .robi-bubble { background: white; border: 3px solid #4a90d9; border-radius: 16px; padding: 10px 18px; font-size: 0.95rem; font-weight: 600; color: #333; max-width: 340px; position: relative; text-align: left; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
    .robi-bubble::before { content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%); border: 8px solid transparent; border-right-color: #4a90d9; border-left: 0; }
    @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }