/* public/modules/sorteio/style.css */

/* =========================================
   ESTRUTURA GERAL
   ========================================= */
   body {
    overflow: hidden;
    user-select: none;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(circle at center, #000000 0%, #1a0b2e 100%);
    margin: 0;
    font-family: var(--font-main);
}

.hub-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    overflow: hidden;
    align-items: center;
}

.nav-back {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding-left: 20px;
    transition: 0.3s;
}

.app-header {
    z-index: 100;
}

/* =========================================
   MENU DASHBOARD & SETUP
   ========================================= */
.menu-content {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    gap: 40px;
    align-items: center;
    padding-bottom: 20px;
}

.menu-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    min-width: 300px;
}

.game-logo-large h1 {
    font-family: var(--font-gamer);
    font-size: 3.5rem;
    line-height: 0.9;
    margin: 0;
    background: linear-gradient(to right, #fff, var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 0, 200, 0.3);
}

.icon-float {
    font-size: 5rem;
    color: var(--neon-pink);
    margin-bottom: 10px;
    animation: floatIcon 3s ease-in-out infinite;
}

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

/* SELETOR DE MODO */
.mode-selector {
    display: flex;
    gap: 20px;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    width: 100%;
}

.mode-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mode-column h3 {
    color: var(--neon-pink);
    margin: 0 0 10px 0;
    font-family: var(--font-gamer);
    letter-spacing: 1px;
}

.mode-column p {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 15px;
}

.mode-divider {
    display: flex;
    align-items: center;
    color: #555;
    font-weight: bold;
    font-size: 0.8rem;
}

/* Botões Neon */
.btn-neon {
    background: linear-gradient(90deg, var(--neon-pink), #ff0055);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 0, 200, 0.4);
    transition: 0.4s;
    width: 100%;
    max-width: 200px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-neon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 0, 200, 0.6);
}

.btn-neon.disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Lista de Temas (Direita) */
.themes-wrapper {
    flex: 1.5;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding-right: 5px;

}

.themes-grid::-webkit-scrollbar { width: 6px; }
.themes-grid::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 10px; }

.theme-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 10px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.theme-card.selected {
    background: rgba(255, 0, 200, 0.15);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 0, 200, 0.2);
}

.theme-icon { font-size: 2rem; margin-bottom: 10px; }
.theme-name { font-weight: 600; font-size: 0.9rem; color: white; margin-bottom: 5px; }
.theme-count { font-size: 0.8rem; color: rgba(255, 255, 255, 0.5); }

/* =========================================
   GAMEPLAY AREA
   ========================================= */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.screen.active {
    display: flex;
    opacity: 1;
}

.game-layout {
    display: flex;
    width: 90%;
    max-width: 1000px;
    height: 85%;
    gap: 30px;
    align-items: center;
}

/* ÁREA DE SORTEIO (ESQUERDA) */
.draw-area {
    flex: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.draw-display-box {
    width: 100%;
    max-width: 500px;
    height: 300px;
    background: rgba(20, 20, 30, 0.8);
    border: 3px solid var(--neon-pink);
    border-radius: 30px;
    box-shadow: 0 0 50px rgba(255, 0, 200, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(10px);
}

.draw-display-box::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 5;
}

.draw-counter {
    position: absolute; top: 15px; right: 20px;
    font-family: var(--font-gamer); color: rgba(255, 255, 255, 0.3); font-size: 1.2rem;
    z-index: 10;
}

.draw-text {
    font-family: var(--font-gamer);
    font-size: 3.5rem; font-weight: bold;
    color: white; text-align: center;
    padding: 20px; line-height: 1.1;
    z-index: 10;
}

.btn-draw-large {
    margin-top: 40px;
    background: var(--neon-pink);
    color: white; border: none;
    width: 90px; height: 90px; border-radius: 50%;
    font-size: 2.5rem; cursor: pointer;
    box-shadow: 0 0 30px rgba(255, 0, 200, 0.5);
    transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.btn-draw-large:hover { transform: scale(1.1); box-shadow: 0 0 50px rgba(255, 0, 200, 0.8); }
.btn-draw-large:active { transform: scale(0.95); }
.btn-draw-large:disabled { background: #333; box-shadow: none; cursor: not-allowed; opacity: 0.5; }

/* ÁREA DE HISTÓRICO (DIREITA) */
.history-area {
    flex: 1; height: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px; padding: 20px;
    display: flex; flex-direction: column;
}

.history-title {
    font-family: var(--font-gamer);
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 15px; letter-spacing: 1px;
}

.history-list {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
}
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.history-item {
    background: rgba(0, 0, 0, 0.2); padding: 12px 15px; border-radius: 10px;
    display: flex; align-items: center; gap: 15px; color: white; font-size: 1rem;
    border-left: 3px solid var(--neon-pink);
    animation: slideIn 0.3s ease;
}

.history-number {
    color: var(--neon-pink);
    font-weight: 800; font-family: var(--font-gamer);
    font-size: 1.2rem; min-width: 35px; text-align: right;
}

@keyframes slideIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.rolling { animation: textBlur 0.1s infinite; color: var(--neon-blue); }
@keyframes textBlur { 0% { filter: blur(0px); opacity: 1; } 50% { filter: blur(2px); opacity: 0.8; } 100% { filter: blur(0px); opacity: 1; } }
.winner-pulse { animation: winPulse 0.5s; color: var(--neon-green) !important; text-shadow: 0 0 20px var(--neon-green); transform: scale(1.1); }
@keyframes winPulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1.1); } }

/* =========================================
   CORREÇÃO RESPONSIVIDADE (MOBILE FIX)
   ========================================= */
@media (max-width: 900px) {
    /* Permite rolagem no container principal */
    .screen {
        overflow-y: auto; 
        justify-content: flex-start; /* Começa do topo */
        height: auto; /* Altura flexível */
        min-height: 100%;
        padding-bottom: 50px;
    }

    .menu-content { 
        flex-direction: column; 
        gap: 15px; padding: 10px; 
        height: auto; /* Remove altura fixa */
        overflow-y: visible;
    }

    .menu-info { 
        align-items: center; text-align: center; padding: 10px 0; width: 100%; 
        flex: 0 0 auto; /* Ocupa apenas o espaço necessário */
    }

    /* Garante que os grupos (temas) tenham altura visível */
    .themes-wrapper { 
        width: 100%; 
        border-radius: 20px; 
        padding: 20px 10px; 
        flex: none; /* Não tenta encolher */
        height: 400px; /* Altura fixa garantida no mobile */
        margin-bottom: 20px;
    }

    .themes-grid { 
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); 
    }
    
    .game-layout { 
        flex-direction: column; 
        width: 100%; 
        height: auto; 
    }

    .draw-area { 
        width: 100%; flex: none; height: auto; padding: 20px 0; 
    }
    .draw-display-box { 
        height: 200px; width: 95%; 
    }
    .history-area { 
        width: 95%; 
        height: 300px; /* Altura fixa para o histórico no mobile */
        flex: none; 
        margin-bottom: 30px;
    }
    
    .mode-selector { flex-direction: column; gap: 10px; }
    .mode-divider { justify-content: center; padding: 5px; }
}