/* ========================================================================= */
/* RULETA DE DESCUENTOS TASVEN */
/* ========================================================================= */

.ruleta-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

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

.ruleta-modal {
    background: #fff;
    width: 90%;
    max-width: 480px;
    border-radius: 20px;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.ruleta-close {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 24px;
    color: #fff;
    background: #333;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    line-height: 1;
    font-weight: bold;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 2px solid #fff;
    transition: transform 0.2s, background 0.2s;
}

.ruleta-close:hover {
    background: #000;
    color: #fff;
    transform: scale(1.1);
}

.ruleta-header {
    margin-bottom: 25px;
}

.ruleta-header h3 {
    font-size: 28px;
    font-weight: 800;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ruleta-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.ruleta-timer {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: bold;
    margin-top: 10px;
    font-size: 14px;
}

/* Contenedor principal de la ruleta */
.ruleta-wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    margin: 0 auto;
}

/* El pin indicador apuntando hacia abajo desde arriba */
.ruleta-pin {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 35px solid #d32f2f;
    z-index: 10;
    filter: drop-shadow(0 4px 4px rgba(0,0,0,0.3));
}

.ruleta-pin::after {
    content: '';
    position: absolute;
    top: -35px;
    left: -20px;
    width: 40px;
    height: 40px;
    background: #e53935;
    border: 3px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
}

/* La rueda que va a girar */
.ruleta-wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    background: conic-gradient(
        #a5d6a7 0deg 60deg,
        #b3b3ff 60deg 120deg,
        #ffe082 120deg 180deg,
        #69f0ae 180deg 240deg,
        #90caf9 240deg 300deg,
        #ffcc80 300deg 360deg
    );
    position: relative;
    overflow: hidden;
    /* La transición se aplica mediante JS */
}

/* Los textos de cada gajo */
.ruleta-slice {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 40px;
    margin-top: -20px;
    transform-origin: left center;
    color: #111;
    display: flex;
    align-items: center;
    padding-left: 55px; /* Empuja el texto hacia el borde exterior */
    text-shadow: 1px 1px 0px rgba(255,255,255,0.5);
}

.ruleta-slice .text-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.ruleta-slice .pct {
    font-size: 24px;
    font-weight: 900;
}

.ruleta-slice .desc {
    font-size: 11px;
    font-weight: 800;
}

.slice-1 { transform: rotate(-60deg); }
.slice-2 { transform: rotate(0deg); }
.slice-3 { transform: rotate(60deg); }
.slice-4 { transform: rotate(120deg); }
.slice-5 { transform: rotate(180deg); }
.slice-6 { transform: rotate(240deg); }

/* Circulo central del botón */
.ruleta-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
    background: #151515;
    border: 5px solid #fff;
    border-radius: 50%;
    z-index: 5;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Botonera de abajo */
.ruleta-footer {
    margin-top: 30px;
}

.ruleta-btn {
    background: #d32f2f;
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 5px 15px rgba(211, 47, 47, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ruleta-btn:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

.ruleta-btn:disabled {
    background: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.ruleta-footer-link {
    display: block;
    margin-top: 15px;
    color: #777;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* ------------------------------------- */
/* MODAL DE RESULTADO / CUPÓN */
/* ------------------------------------- */
.ruleta-result {
    display: none;
}

.ruleta-modal.show-result .ruleta-spin-view {
    display: none;
}

.ruleta-modal.show-result .ruleta-result {
    display: block;
}

.result-congrats {
    background: #b3b3ff;
    padding: 30px 20px 20px;
    border-radius: 15px 15px 0 0;
    margin: -30px -20px 20px;
    color: #111;
    position: relative;
    overflow: hidden;
}

.result-congrats::after, .result-congrats::before {
    content: '';
    position: absolute;
    bottom: -15px;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
}
.result-congrats::before { left: -15px; }
.result-congrats::after { right: -15px; }

.result-congrats h4 {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 5px;
    color: #151515;
}

.result-congrats h2 {
    font-size: 32px;
    font-weight: 800;
    color: #1a237e;
    margin-top: 10px;
}

.result-coupon-box {
    background: #f4f6f8;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-code {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #2c3e50;
    user-select: all;
}

.btn-copy {
    background: #00e676;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: #00c853;
}

.result-details {
    text-align: left;
    font-size: 14px;
    color: #555;
    background: #fafafa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.result-details p {
    margin: 8px 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.result-details p:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.result-details strong {
    color: #333;
}

.result-expire-timer {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: bold;
}

.ruleta-disclaimer {
    font-size: 11px;
    color: #999;
    text-align: left;
    line-height: 1.4;
    margin-top: 15px;
}
