/* Ruleta de Descuentos Premium */
.ruleta-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.ruleta-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ruleta-modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ruleta-overlay.active .ruleta-modal {
    transform: translateY(0) scale(1);
}

.ruleta-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    color: #64748b;
    font-size: 1.2rem;
    line-height: 1;
}

.ruleta-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ruleta-left {
    flex: 1;
    background: #f8fafc;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    /* overflow: hidden; Removed to allow pointer to show */
}

.ruleta-wheel-container {
    position: relative;
    width: min(300px, calc(100vw - 120px));
    height: min(300px, calc(100vw - 120px));
}

.ruleta-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); /* very soft flat shadow */
    transition: transform 5s cubic-bezier(0.15, 0.9, 0.25, 1);
    transform: rotate(0deg);
    background: conic-gradient(
        from 0deg,
        var(--color-primary, #e3182d) 0deg 45deg,
        #0f172a 45deg 90deg,
        var(--color-primary, #e3182d) 90deg 135deg,
        #0f172a 135deg 180deg,
        var(--color-primary, #e3182d) 180deg 225deg,
        #0f172a 225deg 270deg,
        var(--color-primary, #e3182d) 270deg 315deg,
        #0f172a 315deg 360deg
    );
    position: relative;
    overflow: hidden;
    transition: transform 5s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.ruleta-wheel .segment {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 60px;
    margin-top: -30px;
    clip-path: none;
    transform-origin: 0 50%;
    display: block; /* Removed flex */
    box-sizing: border-box;
}
.ruleta-wheel .segment span {
    position: absolute;
    right: 15%; /* Fix text purely to the right */
    top: 50%;
    transform: translateY(-50%) !important;
    text-align: right;
    display: block;
    line-height: 1.2;
    white-space: normal;
    font-size: clamp(0.75rem, 3vw, 1.2rem);
    font-weight: bold;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ruleta-wheel .segment.white-text {
    color: #ffffff;
}

/* Selector arrow - Flat & Visible */
.ruleta-pointer {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid var(--color-primary, #e3182d);
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* Center dot */
.ruleta-center-dot {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
    border: 2px solid #e2e8f0;
}

/* SLOT MACHINE LEVER UI */
.slot-machine-container {
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: center;
}

.lever-container {
    position: relative;
    width: 80px;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
    touch-action: none; /* Prevent scrolling when dragging lever */
}

.lever-slot {
    width: 20px;
    height: 100%;
    background: #1e293b;
    border-radius: 10px;
    box-shadow: inset 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
}

.lever-stick {
    position: absolute;
    top: 0; /* Default position */
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 100px;
    background: linear-gradient(90deg, #94a3b8, #e2e8f0, #94a3b8);
    border-radius: 6px;
    transition: transform 0.1s;
    z-index: 2;
}

.lever-knob {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 65px;
    height: 65px;
    background: radial-gradient(circle at 30% 30%, #fbcfe8, #f43f5e); /* Pig Pink */
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(244, 63, 94, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.lever-instructions {
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 15px;
}

.force-bar-container {
    position: absolute;
    left: -20px;
    top: 0;
    height: 100%;
    width: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.force-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--color-primary, #e3182d);
    transition: height 0.1s, background-color 0.1s;
}

.ruleta-right {
    flex: 1;
    padding: 40px;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ruleta-right h2 {
    font-size: 1.8rem;
    color: #0f172a;
    margin-bottom: 10px;
    font-family: var(--font-serif, serif);
}

.ruleta-right p {
    color: #64748b;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.ruleta-form .form-group {
    margin-bottom: 15px;
}

.ruleta-form label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
}

.ruleta-form input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.ruleta-form input:focus {
    outline: none;
    border-color: var(--color-primary, #e3182d);
}

.ruleta-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-primary, #e3182d);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.2s;
}

.ruleta-btn:hover {
    opacity: 0.9;
}

.ruleta-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Bono Visual */
.bono-visual {
    display: none;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.bono-ticket {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 30px;
    color: #fff;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
}

.bono-ticket::before, .bono-ticket::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.bono-ticket::before { left: -15px; }
.bono-ticket::after { right: -15px; }

.bono-header {
    border-bottom: 2px dashed rgba(255,255,255,0.2);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.bono-title {
    font-size: 2.5rem;
    font-weight: 900;
    color: #f59e0b; /* Gold */
    margin: 10px 0 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.bono-details {
    text-align: left;
    margin-bottom: 20px;
}

.bono-details p {
    color: #cbd5e1;
    margin: 5px 0;
    font-size: 0.9rem;
}

.bono-details strong {
    color: #fff;
    font-size: 1.05rem;
}

.bono-barcode {
    background: #fff;
    padding: 10px;
    border-radius: 6px;
    margin-top: 20px;
}

.bono-barcode-lines {
    height: 40px;
    background: repeating-linear-gradient(
        90deg,
        #000,
        #000 2px,
        #fff 2px,
        #fff 4px,
        #000 4px,
        #000 8px,
        #fff 8px,
        #fff 10px
    );
    margin-bottom: 5px;
}

.bono-barcode-text {
    color: #000;
    font-family: monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

.bono-instruction {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .ruleta-modal {
        flex-direction: column;
        max-height: 90vh;
        overflow-y: auto;
    }
    .ruleta-left {
        padding: 30px 20px;
    }
    .ruleta-right {
        padding: 30px 20px;
    }
    .ruleta-wheel-container {
        width: 220px;
        height: 220px;
    }
}
