/* Estilos principales de la ruleta */
.cod-ruleta-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: 'Arial', sans-serif;
}

.ruleta-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #0ea5e9;
}

.ruleta-title {
    font-size: 2.5em;
    margin: 0 0 20px 0;
    background: linear-gradient(45deg, #0ea5e9, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.user-info {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.points-balance, .spins-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

.points-balance i, .spins-info i {
    font-size: 24px;
    color: #fbbf24;
}

.points-value, .spins-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #fbbf24;
}

/* Ruleta */
.ruleta-game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.ruleta-wheel-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto;
}

.ruleta-wheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    background: #0f172a;
    border: 8px solid #1e293b;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.8),
        0 0 30px rgba(14, 165, 233, 0.3);
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.wheel-item {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: bottom right;
    left: 0;
    top: 0;
    transform: rotate(calc(30deg * var(--i)));
}

.wheel-item:nth-child(odd) .item-inner {
    background: rgba(30, 41, 59, 0.9);
}

.wheel-item:nth-child(even) .item-inner {
    background: rgba(15, 23, 42, 0.9);
}

.item-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    transform: rotate(15deg);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.wheel-item:hover .item-inner {
    background: rgba(59, 130, 246, 0.3);
    transform: rotate(15deg) scale(1.05);
}

.item-icon {
    font-size: 24px;
    color: #fbbf24;
    margin-bottom: 10px;
}

.item-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-value {
    font-size: 12px;
    color: #0ea5e9;
    font-weight: bold;
}

.ruleta-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #ef4444;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    z-index: 10;
}

.ruleta-pointer::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 30px;
    background: #ef4444;
}

/* Controles */
.ruleta-controls {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    width: 100%;
    max-width: 500px;
}

.cost-info {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.cost-info strong {
    color: #0ea5e9;
    font-size: 1.2em;
}

.total-spent {
    margin-top: 10px;
    font-size: 1em;
    color: #94a3b8;
}

.spin-button {
    background: linear-gradient(45deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.4);
}

.spin-button:disabled {
    background: #64748b;
    cursor: not-allowed;
    opacity: 0.7;
}

.spin-button .cost-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

.spin-message {
    margin-top: 20px;
    min-height: 24px;
    font-weight: bold;
    color: #fbbf24;
}

/* Resultados */
.ruleta-results {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.ruleta-results h3 {
    color: #0ea5e9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.result-item {
    background: rgba(30, 41, 59, 0.7);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #0ea5e9;
}

.result-item.win {
    border-left-color: #10b981;
}

.result-item .result-prize {
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.result-item .result-date {
    font-size: 12px;
    color: #94a3b8;
}

/* Historial */
.recent-history {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
}

.recent-history h3 {
    color: #0ea5e9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recent-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-history-list li {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-history-list li:last-child {
    border-bottom: none;
}

.history-date {
    color: #94a3b8;
    font-size: 0.9em;
}

.history-prize {
    font-weight: bold;
    color: #fff;
}

.history-cost {
    color: #fbbf24;
    font-weight: bold;
}

/* Historial página */
.cod-ruleta-history {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    font-size: 40px;
    color: #0ea5e9;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.history-table th {
    background: #0ea5e9;
    color: white;
    padding: 15px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.history-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

.status-completed {
    background: #10b981;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 768px) {
    .ruleta-wheel-wrapper {
        width: 350px;
        height: 350px;
    }
    
    .wheel-item .item-name {
        font-size: 12px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .ruleta-title {
        font-size: 1.8em;
    }
    
    .spin-button {
        padding: 15px 30px;
        font-size: 1.1em;
    }
}

/* Animaciones */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinning {
    animation: spin 0.5s linear infinite;
}

@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.win-animation {
    animation: winPulse 0.5s ease 3;
}

/* Notificaciones */
.cod-ruleta-notice {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 20px;
    border-radius: 8px;
    color: #92400e;
    text-align: center;
}