/* =============================================
   SISTEMA DE JOGOS - ROLETA PREMIADA
   ============================================= */

/* Container da Roleta */
.roulette-container {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0 auto;
}

@media (min-width: 450px) {
    .roulette-container {
        width: 400px;
        height: 400px;
    }
}

@media (min-width: 550px) {
    .roulette-container {
        width: 450px;
        height: 450px;
    }
}

.roulette-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.roulette-wheel.spinning {
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Segmentos da Roleta */
.roulette-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    left: 50%;
    top: 0;
    transform-origin: 0% 100%;
    overflow: visible;
}

.roulette-segment-text {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ponteiro */
.roulette-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #fff;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Botao Central */
.roulette-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

.roulette-center:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.roulette-center:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.roulette-center.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.roulette-center.disabled:hover {
    transform: translate(-50%, -50%);
}

/* Modal da Roleta */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.game-modal.active {
    opacity: 1;
    visibility: visible;
}

.game-modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 95%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.game-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.game-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.game-modal-title {
    color: #fff;
    font-size: 20px;
    margin-bottom: 20px;
}

/* Resultado */
.game-result {
    padding: 20px;
    margin-top: 20px;
    border-radius: 10px;
    display: none;
}

.game-result.show {
    display: block;
    animation: fadeIn 0.5s;
}

.game-result.winner {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

.game-result.loser {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.game-result-text {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
}

.game-result-prize {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    margin-top: 10px;
}

/* Card de Jogo na Lista */
.game-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.game-card.available {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    cursor: pointer;
}

.game-card.available:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.4);
}

.game-card.played {
    background: linear-gradient(135deg, #b2bec3 0%, #636e72 100%);
}

.game-card.played.winner {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

.game-card.played.loser {
    background: linear-gradient(135deg, #e17055 0%, #d63031 100%);
}

.game-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.game-card-info {
    flex: 1;
    margin-left: 15px;
    text-align: left;
}

.game-card-title {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
}

.game-card-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
}

.game-card-button {
    padding: 8px 20px;
    border-radius: 20px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.game-card-button.play {
    background: #fff;
    color: #00b894;
}

.game-card-button.played {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: default;
}

/* Secao de Regras da Roleta na Pagina do Produto */
.roulette-rules {
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.roulette-rules-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

.roulette-rules-title i {
    color: #e17055;
}

.roulette-tier {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    margin-bottom: 10px;
    color: #fff;
}

.roulette-tier-cotas {
    font-weight: bold;
}

.roulette-tier-giros {
    opacity: 0.9;
}

.roulette-tier-icon {
    font-size: 24px;
}

/* Secao de Premios Disponiveis */
.roulette-prizes {
    margin-top: 20px;
}

.roulette-prizes-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.roulette-prizes-count {
    background: #333;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.roulette-prize-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #4a5568;
    border-radius: 8px;
    margin-bottom: 8px;
    color: #fff;
}

.roulette-prize-name {
    font-weight: 500;
}

.roulette-prize-status {
    font-size: 13px;
    opacity: 0.8;
}

.roulette-prize-status.available {
    color: #00b894;
}

.roulette-prize-status.won {
    color: #ffeaa7;
}

/* Animacoes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.roulette-center.pulse {
    animation: pulse 1s infinite;
}

/* Responsivo */
@media (max-width: 380px) {
    .roulette-container {
        width: 300px;
        height: 300px;
    }

    .roulette-center {
        width: 60px;
        height: 60px;
        font-size: 12px;
    }

    .game-modal-content {
        padding: 15px;
    }
}

/* Admin - Configuracao da Roleta */
.roleta-config-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.roleta-config-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
}

.roleta-color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.roleta-color-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.roleta-color-input label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.roleta-color-input input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.roleta-premio-row {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.roleta-premio-row input[type="text"] {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
}

.roleta-premio-row input[type="number"] {
    width: 70px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fff;
}

.roleta-btn-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #8b5cf6;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.roleta-btn-add:hover {
    background: #7c3aed;
}

.roleta-btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ef4444;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.roleta-btn-remove:hover {
    background: #dc2626;
}

/* Tabela de Ganhadores no Admin */
.roleta-winners-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.roleta-winners-table th,
.roleta-winners-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roleta-winners-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.roleta-winners-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}
