/**
 * Bexiga Mines - Estilos do Jogo
 * Tema Cassino Premium com Efeitos Neon
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../assets/images/8.png') no-repeat center center fixed; /* Adicionado 'fixed' para melhor rolagem */
    background-size: cover;

    color: #ffffff;
    min-height: 100vh;
    /* Removido overflow-x: hidden para evitar problemas de layout em alguns navegadores, se necessário, pode ser adicionado ao game-container */
}

.game-container {
    max-width: 1100px; /* Diminuído de 1600px para 1200px */
    margin: 0 auto;
    padding: 5px;
    /* Garante que o contêiner principal ocupe a altura total para centralização vertical */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centraliza o conteúdo horizontalmente dentro do contêiner */
}

/* ============================================
   HEADER - NOVO DESIGN RESPONSIVO
   ============================================ */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 20px;
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.95) 0%, rgba(42, 82, 152, 0.85) 100%);
    border-radius: 12px;
    border: 2px solid #e1833d;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(225, 131, 61, 0.2);
    margin-bottom: 20px;
    width: 100%;
    max-width: 1012px;
    position: relative;
    z-index: 100;
}

/* Header Left - Saldo */
.header-left {
    display: flex;
    align-items: center;
}

.balance-display {
    
    padding: 12px 16px;
    
    
    
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.3s ease;
}

.balance-display:hover {
    
}

.balance-label {
    font-size: 0.85em;
    opacity: 0.75;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.balance-value {
    font-size: 1.6em;
    font-weight: 700;
    background: linear-gradient(135deg, #4ade80 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Header Right - Menu */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Menu Toggle Button (Hamburger) */
.menu-toggle {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, rgba(225, 131, 61, 0.2) 0%, rgba(74, 144, 226, 0.2) 100%);
    border: 2px solid rgba(225, 131, 61, 0.6);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 101;
}

.menu-toggle:hover {
    background: linear-gradient(135deg, rgba(225, 131, 61, 0.3) 0%, rgba(74, 144, 226, 0.3) 100%);
    border-color: rgba(225, 131, 61, 0.8);
    box-shadow: 0 4px 15px rgba(225, 131, 61, 0.3);
}

.menu-toggle span {
    width: 24px;
    height: 2.5px;
    background: linear-gradient(90deg, #e1833d 0%, #ffed4e 100%);
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Menu Dropdown */
.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 20px;
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.98) 0%, rgba(42, 82, 152, 0.95) 100%);
    border: 2px solid rgba(225, 131, 61, 0.5);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(225, 131, 61, 0.2);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.menu-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95em;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(225, 131, 61, 0.15);
    border-left-color: rgba(225, 131, 61, 0.8);
    color: #ffed4e;
    padding-left: 24px;
}

.menu-item.menu-logout {
    color: rgba(239, 68, 68, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 4px;
    padding-top: 12px;
}

.menu-item.menu-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-left-color: rgba(239, 68, 68, 0.8);
    color: #ff6b6b;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Logo (se houver) */
.logo h1 {
    font-size: 2.5em;
    background: linear-gradient(45deg, #e1833d, #ffed4e, #e1833d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8)); }
}

/* ============================================
   GAME CONTENT LAYOUT
   ============================================ */
.game-content {
    display: flex; /* Usar flexbox para centralizar o bloco de conteúdo */
    justify-content: center; /* Centraliza o bloco de conteúdo horizontalmente */
    gap: 20px;
    align-items: flex-start; /* Alinha os itens ao topo */
    width: 100%;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* ============================================
   CONTROL PANEL
   ============================================ */
.control-panel {
    background: rgba(26, 31, 58, 0.8);
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e1833d;
    width: 300px; /* Mantém a largura fixa do painel de controle */
    flex-shrink: 0;
}

.control-panel h3 {
    color: #e1833d;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.bet-section {
    margin-bottom: 25px;
}

.bet-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.bet-input-group input {
    flex: 1;
    padding: 10px;
    width: 130px;
    font-size: 1.3em;
    text-align: center;
    background: rgba(15, 20, 25, 0.8);
    border: 2px solid #e1833d;
    border-radius: 8px;
    color: #fff;
}

.btn-bet-control {
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    background: linear-gradient(135deg, #e1833d, #357abd);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-bet-control:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.5);
}

.quick-bets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.quick-bets button {
    padding: 10px;
    background: rgba(74, 144, 226, 0.2);
    border: 2px solid #e1833d;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.quick-bets button:hover {
    background: #e1833d;
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
}

.multiplier-section {
    margin-bottom: 25px;
    text-align: center;
}

.multiplier-display {
    font-size: 3em;
    font-weight: bold;
    background: linear-gradient(45deg, #e1833d, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 15px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.potential-win {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: rgba(74, 222, 128, 0.1);
    border: 2px solid #4ade80;
    border-radius: 8px;
    margin-top: 10px;
}

.potential-win span:last-child {
    color: #4ade80;
    font-weight: bold;
    font-size: 1.2em;
}

.action-buttons {
    margin-bottom: 25px;
}

.btn-start, .btn-cashout {
    width: 100%;
    padding: 20px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

.btn-start {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.btn-start:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
}

.btn-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-cashout {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
}

.btn-cashout:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px rgba(251, 191, 36, 0.6);
}

.stats-section {
    background: rgba(15, 20, 25, 0.5);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(74, 144, 226, 0.2);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item span:last-child {
    color: #4ade80;
    font-weight: bold;
}

/* ============================================
   GAME BOARD
   ============================================ */
.game-board {
    background-image: url('../assets/images/game_background.png');
    background-repeat: no-repeat;

    /* A imagem de fundo será ajustada para cobrir a área do game-board */
    background-size: cover;
    background-position: center;

    width: 692px;                         /* largura do recorte */
    height: auto;                        /* altura do recorte */

    border-radius: 15px;
    padding: 10px 10px 5px 10px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;

    flex-grow: 0;
    flex-shrink: 0;
}


    .balloons-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 0px;
        margin-top: 30px;
        /* Adicionado para centralizar o grid dentro do game-board */
        justify-content: center;
        align-content: center;
        /* Garante que o container ocupe a largura total do game-board */
        width: 100%;
    }

.balloon {
    width: 150px; /* Reduzido para diminuir a altura */
    height: 180px; /* Reduzido para diminuir a altura */
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

.balloon-reveal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%; /* Ajuste o tamanho conforme necessário */
    opacity: 0; /* Inicialmente invisível */
    transition: opacity 0.5s ease-in-out;
    z-index: 0; /* Fica atrás do balão */
}

.balloon.safe .balloon-reveal {
    background-image: url('../assets/images/diamond.png');
}

.balloon.bomb .balloon-reveal {
    background-image: url('../assets/images/bomb.png');
}

.balloon:hover:not(.clicked):not(.disabled) {
    transform: translateY(-10px) scale(1.05);
}

.balloon.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.balloon-inner {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    position: relative;
    /* Removido: border-radius e box-shadow da ilustração */
    
}

.balloon-1 .balloon-inner {
    background-image: url('../assets/images/balloon_1.png');
}

.balloon-2 .balloon-inner {
    background-image: url('../assets/images/balloon_2.png');
}

.balloon-3 .balloon-inner {
    background-image: url('../assets/images/balloon_3.png');
}

.balloon-4 .balloon-inner {
    background-image: url('../assets/images/balloon_4.png');
}

.balloon-5 .balloon-inner {
    background-image: url('../assets/images/balloon_5.png');
}

.balloon-6 .balloon-inner {
    background-image: url('../assets/images/balloon_6.png');
}

.balloon-7 .balloon-inner {
    background-image: url('../assets/images/balloon_7.png');
}

.balloon-8 .balloon-inner {
    background-image: url('../assets/images/balloon_8.png');
}

.balloon-9 .balloon-inner {
    background-image: url('../assets/images/balloon_9.png');
}

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

.balloon-shine {
    /* Removido: Brilho CSS, pois a imagem real já tem seu próprio brilho */
    display: none;
}

.balloon-string {
    /* Removido: Barbante CSS, pois a imagem real já tem seu próprio barbante */
    display: none;
}

.balloon.clicked .balloon-inner {
    animation: pop 0.5s forwards;
}

.balloon.clicked .balloon-reveal {
    opacity: 1; /* Revela o conteúdo ao clicar */
}

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

.balloon.bomb .balloon-reveal {
    opacity: 1; /* Garante que a bomba apareça */
}

.balloon.bomb .balloon-inner {
    /* Mantido o fundo escuro para a bomba, mas removido o gradiente para ser mais simples */
    background: #000000;
    background-size: contain; /* Adicionado para manter a consistência */
    animation: explode 0.6s forwards;
}

.balloon.bomb .balloon-reveal {
    opacity: 1; /* Garante que a bomba apareça */
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; }
}

.game-message {
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-message.success {
    background: rgba(74, 222, 128, 0.2);
    border: 2px solid #4ade80;
    color: #4ade80;
}

.game-message.error {
    background: rgba(239, 68, 68, 0.2);
    border: 2px solid #ef4444;
    color: #ef4444;
}

.game-message.info {
    background: rgba(59, 130, 246, 0.2);
    border: 2px solid #3b82f6;
    color: #3b82f6;
}

/* ============================================
   HISTORY PANEL
   ============================================ */
.history-panel {
    /* Este painel foi removido do HTML, mas mantemos a classe para evitar erros */
    display: none;
}

.history-panel h3 {
    color: #e1833d;
    margin-bottom: 20px;
    font-size: 1.2em;
}

.history-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    background: rgba(15, 20, 25, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #e1833d;
}

.history-item.win {
    border-left-color: #4ade80;
}

.history-item.loss {
    border-left-color: #ef4444;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-weight: bold;
}

.history-item-details {
    font-size: 0.9em;
    opacity: 0.8;
}

.no-history {
    text-align: center;
    opacity: 0.5;
    padding: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Mobile - até 768px */
@media (max-width: 768px) {
    .game-header {
        padding: 12px 15px;
        margin-bottom: 15px;
    }

    .header-left {
        flex: 1;
    }

    .balance-display {
        padding: 10px 8px;
        width: 100%;
    }

    .balance-value {
        font-size: 1.4em;
    }

    .balance-label {
        font-size: 0.75em;
    }

    .menu-dropdown {
        right: 15px;
        min-width: 200px;
    }

    .menu-item {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .game-content {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .game-board {
        background-image: url('../assets/images/game-board-mobile.png');
        background-repeat: no-repeat;
        background-size: 110%; /* Aumenta mais o fundo */
        background-position: center;
        width: 100%;
        max-width: 500px;
        aspect-ratio: 692 / 768;
        padding: 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    
    .balloons-container {
        gap: 20px;
        grid-template-columns: repeat(3, 1fr);
        display: grid; /* Garante que o grid seja usado */
        justify-items: center; /* Centraliza o conteúdo dentro de cada célula do grid */
        align-items: center; /* Centraliza verticalmente o conteúdo dentro de cada célula do grid */
    }
    
    .balloon {
        /* Tamanho responsivo para o balão */
        /* Tamanho responsivo para o balão */
        width: 100%; /* Ocupa a largura da célula do grid */
        height: 120px; /* Altura ajustada para manter a proporção e caber na tela */
        max-width: 110px; /* Limita o tamanho máximo para não ficar muito grande */
        max-height: 130px; /* Limita o tamanho máximo para não ficar muito grande */
    }
    
    .control-panel {
        width: 100%;
        max-width: 500px;
        order: 2;
    }
}

/* Tablet - 769px até 1200px */
@media (max-width: 1200px) and (min-width: 769px) {
    .game-header {
        padding: 12px 15px;
    }

    .balance-display {
        padding: 10px 18px;
    }

    .game-content {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .game-board {
        width: 100%;
        max-width: 600px;
        height: auto;
        aspect-ratio: 692 / 768;
    }
    
    .balloons-container {
        gap: 20px;
    }
    
    .balloon {
        width: 120px;
        height: 150px;
    }
    
    .control-panel {
        width: 100%;
        max-width: 600px;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 20, 25, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #e1833d;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #357abd;
}
