/* ==================== ESTILOS GENERALES ==================== */
.cod-ruleta-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
}

.cod-ruleta-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #0ea5e9, #3b82f6, #8b5cf6, #ef4444);
    z-index: 1;
}

.ruleta-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.ruleta-title {
    font-size: 2.8em;
    margin: 0 0 25px 0;
    background: linear-gradient(45deg, #0ea5e9, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(14, 165, 233, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

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

.points-balance, .spins-info {
    background: rgba(255, 255, 255, 0.08);
    padding: 18px 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 250px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.points-balance:hover, .spins-info:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

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

.points-label, .spins-label {
    font-size: 1.1em;
    color: #94a3b8;
}

.points-value, .spins-value {
    font-size: 1.8em;
    font-weight: bold;
    color: #fbbf24;
    text-shadow: 0 2px 5px rgba(251, 191, 36, 0.3);
}

.ruleta-game-area {
    margin: 40px 0;
}

.ruleta-controls {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 20px;
    margin-top: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.cost-info {
    margin-bottom: 25px;
    font-size: 1.2em;
}

.cost-info strong {
    color: #0ea5e9;
    font-size: 1.3em;
    text-shadow: 0 2px 5px rgba(14, 165, 233, 0.3);
}

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

#total-spent {
    color: #fbbf24;
    font-weight: bold;
}

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

.spin-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.spin-button:hover::before {
    left: 100%;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(239, 68, 68, 0.5);
}

.spin-button:active:not(:disabled) {
    transform: translateY(-2px);
}

.spin-button:disabled {
    background: #64748b;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

.spin-button i {
    font-size: 1.2em;
}

.cost-badge {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9em;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.spin-message {
    margin-top: 25px;
    min-height: 30px;
    font-weight: bold;
    font-size: 1.1em;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.spin-message.success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

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

.ruleta-results {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 30px;
    margin-top: 40px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.ruleta-results h3 {
    color: #0ea5e9;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5em;
}

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

.result-item {
    background: rgba(30, 41, 59, 0.7);
    padding: 20px;
    border-radius: 15px;
    border-left: 5px solid #0ea5e9;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item:hover {
    background: rgba(30, 41, 59, 0.9);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.result-item.win {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.result-icon {
    font-size: 24px;
    color: #0ea5e9;
}

.result-info {
    flex: 1;
}

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

.result-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #94a3b8;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-style: italic;
    grid-column: 1 / -1;
}

/* ==================== SELECTOR DE TIPO ==================== */
.ruleta-type-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.type-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 15px 30px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 1.1em;
}

.type-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-2px);
}

.type-btn.active {
    background: linear-gradient(45deg, #0ea5e9, #3b82f6);
    color: white;
    border-color: transparent;
    box-shadow: 0 5px 15px rgba(14, 165, 233, 0.3);
}

.type-btn i {
    font-size: 1.2em;
}

/* ==================== RULETA CIRCULAR ==================== */
.ruleta-circular .ruleta-wheel-wrapper {
    position: relative;
    width: 550px;
    height: 550px;
    margin: 0 auto;
}

.circular-wheel {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 50%;
    background: #0f172a;
    border: 10px solid #1e293b;
    box-shadow: 
        inset 0 0 60px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(14, 165, 233, 0.2);
    transition: transform 4s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.circular-item {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: bottom right;
    left: 0;
    top: 0;
}

.circular-item:nth-child(odd) .item-inner {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
}

.circular-item:nth-child(even) .item-inner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
}

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

.circular-item:hover .item-inner {
    background: rgba(59, 130, 246, 0.3);
    transform: scale(1.08);
    border-color: rgba(59, 130, 246, 0.5);
}

.item-icon {
    font-size: 28px;
    color: #fbbf24;
    margin-bottom: 12px;
    text-shadow: 0 2px 5px rgba(251, 191, 36, 0.3);
}

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

.item-value {
    font-size: 14px;
    color: #0ea5e9;
    font-weight: bold;
    text-shadow: 0 2px 3px rgba(14, 165, 233, 0.3);
}

.ruleta-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    border-radius: 50%;
    border: 8px solid #1e293b;
    box-shadow: 0 0 30px rgba(14, 165, 233, 0.5);
    z-index: 2;
}

.ruleta-pointer {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    background: #ef4444;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    z-index: 10;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.7));
}

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

.wheel-shadow {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, 
                rgba(0,0,0,0) 0%,
                rgba(0,0,0,0.1) 40%,
                rgba(0,0,0,0.3) 70%,
                rgba(0,0,0,0.5) 100%);
    z-index: -1;
}

/* ==================== RULETA CUADRADA ==================== */
.ruleta-cuadrada .ruleta-wheel-wrapper {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 0 auto;
}

.square-wheel {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 20px;
    border: 3px solid #0ea5e9;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    padding: 15px;
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(14, 165, 233, 0.2);
    position: relative;
    overflow: hidden;
}

.square-item {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.9));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

/* Posicionamiento específico para cada casilla */
.square-item[data-index="0"] { grid-area: 1 / 1; }
.square-item[data-index="1"] { grid-area: 1 / 2; }
.square-item[data-index="2"] { grid-area: 1 / 3; }
.square-item[data-index="3"] { grid-area: 2 / 3; }
.square-item[data-index="4"] { grid-area: 2 / 1; }
.square-item[data-index="5"] { grid-area: 3 / 1; }
.square-item[data-index="6"] { grid-area: 3 / 2; }
.square-item[data-index="7"] { grid-area: 3 / 3; }
.square-item[data-index="8"] { grid-area: 2 / 2; } /* Centro especial */

/* Items adicionales para los laterales */
.square-item[data-index="9"] {
    position: absolute;
    top: 50%;
    left: -120px;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
}

.square-item[data-index="10"] {
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
}

.square-item[data-index="11"] {
    position: absolute;
    top: 50%;
    right: -120px;
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
}

.square-item-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 2;
    position: relative;
}

.square-item .item-icon {
    font-size: 24px;
    color: #fbbf24;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.square-item .item-name {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.square-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
                rgba(14, 165, 233, 0) 0%,
                rgba(14, 165, 233, 0.1) 50%,
                rgba(14, 165, 233, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
}

.square-item.active .square-highlight {
    opacity: 1;
    animation: highlightPulse 1.5s infinite;
}

.square-item.active {
    border-color: #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
    z-index: 10;
}

.square-item.active .item-icon {
    color: #fff;
    transform: scale(1.2);
}

.square-item.active .item-name {
    color: #0ea5e9;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.5);
}

.square-center {
    grid-area: 2 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    border-radius: 50%;
    border: 5px solid #1e293b;
    box-shadow: 
        inset 0 0 30px rgba(255, 255, 255, 0.2),
        0 0 30px rgba(14, 165, 233, 0.5);
    animation: centerPulse 3s infinite;
    position: relative;
    z-index: 5;
}

.center-logo {
    font-size: 40px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.square-pointer {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    transition: all 0.5s ease;
}

.pointer-arrow {
    font-size: 40px;
    color: #ef4444;
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.7);
    filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.5));
}

.pointer-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, 
                rgba(239, 68, 68, 0.4) 0%,
                rgba(239, 68, 68, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    animation: pointerGlow 2s infinite;
}

.square-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 49%, rgba(14, 165, 233, 0.1) 50%, transparent 51%),
        linear-gradient(0deg, transparent 49%, rgba(14, 165, 233, 0.1) 50%, transparent 51%);
    pointer-events: none;
    border-radius: 20px;
}

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

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

@keyframes winPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(16, 185, 129, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.win-animation {
    animation: winPulse 1s ease;
}

@keyframes highlightPulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

@keyframes centerPulse {
    0% { box-shadow: 
            inset 0 0 30px rgba(255, 255, 255, 0.2),
            0 0 30px rgba(14, 165, 233, 0.5); }
    50% { box-shadow: 
            inset 0 0 40px rgba(255, 255, 255, 0.3),
            0 0 50px rgba(14, 165, 233, 0.7); }
    100% { box-shadow: 
            inset 0 0 30px rgba(255, 255, 255, 0.2),
            0 0 30px rgba(14, 165, 233, 0.5); }
}

@keyframes pointerGlow {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
}

@keyframes squareMove {
    0% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(100%) translateY(0); }
    50% { transform: translateX(100%) translateY(100%); }
    75% { transform: translateX(0) translateY(100%); }
    100% { transform: translateX(0) translateY(0); }
}

/* ==================== LOGIN REQUERIDO ==================== */
.cod-ruleta-login-required {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.login-message {
    max-width: 400px;
    margin: 0 auto;
}

.login-message i {
    font-size: 80px;
    color: #0ea5e9;
    margin-bottom: 30px;
    opacity: 0.7;
}

.login-message h3 {
    font-size: 2em;
    margin-bottom: 20px;
    color: #fff;
}

.login-message p {
    color: #94a3b8;
    font-size: 1.2em;
    margin-bottom: 30px;
}

.login-button {
    display: inline-block;
    background: linear-gradient(45deg, #0ea5e9, #3b82f6);
    color: white;
    padding: 18px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2em;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    cursor: pointer;
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.4);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .cod-ruleta-container {
        padding: 15px;
        margin: 10px;
    }
    
    .ruleta-title {
        font-size: 1.8em;
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .points-balance, .spins-info {
        min-width: auto;
        width: 100%;
        max-width: 300px;
    }
    
    .ruleta-circular .ruleta-wheel-wrapper,
    .ruleta-cuadrada .ruleta-wheel-wrapper {
        width: 320px;
        height: 320px;
    }
    
    .circular-wheel {
        border-width: 5px;
    }
    
    .ruleta-center {
        width: 60px;
        height: 60px;
    }
    
    .item-name {
        font-size: 12px;
    }
    
    .item-icon {
        font-size: 20px;
    }
    
    .spin-button {
        padding: 20px 30px;
        font-size: 1.1em;
        flex-direction: column;
        gap: 10px;
    }
    
    .ruleta-type-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .type-btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .results-list {
        grid-template-columns: 1fr;
    }
    
    .square-item[data-index="9"],
    .square-item[data-index="10"],
    .square-item[data-index="11"] {
        display: none;
    }
    
    .square-wheel {
        width: 320px;
        height: 320px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .ruleta-title {
        font-size: 1.5em;
    }
    
    .ruleta-circular .ruleta-wheel-wrapper,
    .ruleta-cuadrada .ruleta-wheel-wrapper {
        width: 280px;
        height: 280px;
    }
    
    .spin-button {
        padding: 15px 25px;
        font-size: 1em;
    }
}