/* =========================================================
   ARMADOR DE JUGADAS POR WHATSAPP · V1.6.1 · FIX RESPONSIVE ALCANCE/IMPORTE
   Integrado visualmente con "Próximo cierre de apuestas"
   ========================================================= */

.jw-section {
    --jw-green: #43b02a;
    --jw-green-light: #76ef42;
    --jw-green-bright: #8ef05e;
    --jw-red: #da291c;
    --jw-orange: #ef9700;
    --jw-white: #ffffff;
    --jw-text: #d6ddd7;
    --jw-muted: #909b94;
    --jw-line: rgba(255, 255, 255, .14);
    --jw-line-strong: rgba(255, 255, 255, .22);
    --jw-panel: #101916;
    --jw-panel-soft: #17211d;

    position: relative;
    width: 100%;
    max-width: none;
    margin: 34px 0 42px;
    padding: 0;
    overflow: hidden;
    color: var(--jw-white);
    border: 1px solid rgba(106, 240, 58, .48);
    border-radius: 18px;
    background:
        radial-gradient(circle at 24% 15%, rgba(78, 218, 35, .10), transparent 29%),
        linear-gradient(145deg, #050a07, #0a1410 58%, #030705);
    box-shadow:
        0 20px 48px rgba(0, 0, 0, .30),
        0 0 0 1px rgba(104, 238, 55, .035) inset,
        0 0 24px rgba(79, 213, 36, .10);
    font-family: "Futura PT", "Futura", "Century Gothic", Arial, sans-serif;
    font-weight: 400;
}

.jw-section::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(110deg, transparent 34%, rgba(132, 255, 88, .035) 50%, transparent 66%);
    transform: translateX(-115%);
    animation: jwSectionSweep 8s ease-in-out infinite;
}

.jw-section *,
.jw-section *::before,
.jw-section *::after {
    box-sizing: border-box;
}

.jw-header,
.jw-form {
    position: relative;
    z-index: 1;
}

.jw-header {
    padding: clamp(22px, 3vw, 34px) clamp(20px, 3vw, 36px) 19px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, .11);
}

.jw-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    color: var(--jw-green-bright);
    text-transform: uppercase;
    font-size: .73rem;
    font-weight: 900;
    letter-spacing: .14em;
}

.jw-kicker::before,
.jw-kicker::after {
    content: "";
    width: 38px;
    height: 1px;
    background: var(--jw-green-light);
    box-shadow: 0 0 8px rgba(104, 239, 52, .70);
}

.jw-header h2 {
    margin: 9px 0 5px;
    color: #fff;
    text-transform: uppercase;
    font-size: clamp(1.9rem, 3.6vw, 3rem);
    line-height: 1;
    letter-spacing: .015em;
    font-weight: 800;
}

.jw-header p {
    max-width: 700px;
    margin: 0 auto;
    color: #aeb8b1;
    font-size: .84rem;
    line-height: 1.5;
}

.jw-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.jw-draw-panel {
    display: grid;
    grid-template-columns: minmax(250px, 390px) minmax(0, 1fr);
    align-items: end;
    gap: 18px;
    padding: 18px clamp(20px, 3vw, 36px) 12px;
}

.jw-draw-select {
    display: block;
}

.jw-draw-select > span {
    display: block;
    margin-bottom: 8px;
    color: #e8ece9;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .70rem;
    font-weight: 800;
}

.jw-draw-select select,
.jw-field input,
.jw-field select {
    width: 100%;
    color: #fff;
    background: #101916;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 8px;
    outline: none;
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.jw-draw-select select {
    height: 48px;
    padding: 0 40px 0 15px;
    color-scheme: dark;
}

.jw-draw-select select:focus,
.jw-field input:focus,
.jw-field select:focus {
    border-color: var(--jw-green);
    box-shadow: 0 0 0 4px rgba(67, 176, 42, .10);
}

.jw-draw-select option,
.jw-field select option {
    color: #fff;
    background: #101916;
}

.jw-draw-status {
    min-height: 1.2em;
    margin: 0 0 14px;
    color: #98a49c;
    text-align: right;
    font-size: .76rem;
    line-height: 1.4;
}

.jw-table-wrap {
    min-height: 0;
    padding: 4px clamp(20px, 3vw, 36px) 8px;
    overflow: visible;
}

.jw-grid {
    display: grid;
    grid-template-columns: 152px 54px minmax(140px, 1.25fr) minmax(92px, .7fr) minmax(125px, .9fr);
    gap: 11px;
    align-items: center;
}

.jw-grid--head {
    min-height: 43px;
    padding: 0;
    color: #cfd5d1;
    border-top: 1px solid rgba(255, 255, 255, .10);
    border-bottom: 1px solid rgba(255, 255, 255, .13);
    text-align: center;
    text-transform: uppercase;
    font-size: .67rem;
    font-weight: 900;
    letter-spacing: .075em;
}

.jw-row {
    position: relative;
    min-height: 51px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .075);
}

.jw-row:last-child {
    border-bottom: 0;
}

.jw-panel {
    display: grid;
    width: 42px;
    height: 40px;
    place-items: center;
    color: var(--jw-green-light);
    border: 1px solid rgba(116, 255, 65, .25);
    border-radius: 7px;
    background: rgba(67, 176, 42, .07);
    font-size: .78rem;
    font-weight: 900;
}

.jw-field {
    min-width: 0;
}

.jw-field input,
.jw-field select {
    height: 40px;
    min-width: 0;
    padding: 0 11px;
    font-size: .82rem;
    font-weight: 700;
}

.jw-field select {
    padding-right: 32px;
    cursor: pointer;
    color-scheme: dark;
}

.jw-field input::placeholder {
    color: #7f8a83;
}

.jw-field input:disabled,
.jw-field select:disabled,
.jw-redoblona:disabled {
    cursor: not-allowed;
    opacity: .34;
    filter: saturate(.4);
}

.jw-field input.jw-invalid,
.jw-field select.jw-invalid {
    border-color: #ff6257;
    box-shadow: 0 0 0 3px rgba(218, 41, 28, .14);
}

.jw-money {
    position: relative;
}

.jw-money > span {
    position: absolute;
    top: 50%;
    left: 11px;
    z-index: 1;
    color: var(--jw-green-light);
    font-weight: 900;
    transform: translateY(-50%);
}

.jw-money input {
    padding-left: 27px;
}

/* =========================================================
   BOTÓN REDOBLONA
   Gris: desactivado · Verde: activado
   ========================================================= */

.jw-redoblona {
    position: relative;
    width: 142px;
    height: 40px;
    margin-inline: auto;
    padding: 0 11px 0 45px;
    overflow: hidden;
    color: #d5dbd7;
    background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035));
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition:
        transform .18s ease,
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease,
        color .18s ease;
}

.jw-redoblona::before {
    content: "R";
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: 30px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 6px;
    background: #545e58;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
    font-size: .83rem;
    font-weight: 900;
}

.jw-redoblona span {
    display: block;
    overflow: hidden;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .60rem;
    font-weight: 900;
    letter-spacing: .035em;
}

.jw-redoblona:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(116, 255, 65, .48);
    background: rgba(67, 176, 42, .07);
}

.jw-redoblona[aria-pressed="true"] {
    color: #fff;
    background: linear-gradient(135deg, #43b02a, #2d8d1e);
    border-color: #74ef42;
    box-shadow:
        0 0 0 2px rgba(67, 176, 42, .10),
        0 8px 20px rgba(67, 176, 42, .20);
}

.jw-redoblona[aria-pressed="true"]::before {
    color: #173511;
    background: #a1f782;
    box-shadow: 0 0 12px rgba(126, 241, 75, .45);
}

.jw-field--redoblona.jw-control-hidden,
.jw-field--importe.jw-control-hidden {
    visibility: hidden;
    pointer-events: none;
}

.jw-row-error {
    display: none;
    grid-column: 3 / -1;
    margin: -1px 0 2px;
    color: #ff948c;
    font-size: .69rem;
    font-weight: 700;
}

.jw-row-error:not(:empty) {
    display: block;
}

.jw-lotteries {
    margin: 12px clamp(20px, 3vw, 36px) 0;
    padding: 14px 15px 15px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(255, 255, 255, .022);
}

.jw-lotteries legend {
    padding: 0 8px;
    color: var(--jw-green-light);
    text-transform: uppercase;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .10em;
}

.jw-lotteries-help {
    margin: 0 0 11px;
    color: #909b94;
    font-size: .72rem;
}

.jw-lottery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px 9px;
}

.jw-lottery-option {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #cbd3cd;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 7px;
    background: rgba(7, 16, 11, .55);
    font-size: .66rem;
    line-height: 1.15;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.jw-lottery-option:hover:not(.is-disabled) {
    color: #fff;
    border-color: rgba(116, 255, 65, .45);
    background: rgba(67, 176, 42, .07);
}

.jw-lottery-option input {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    margin: 0;
    accent-color: var(--jw-green);
}

.jw-lottery-option:has(input:checked) {
    color: #fff;
    border-color: rgba(116, 255, 65, .60);
    background: rgba(67, 176, 42, .11);
}

.jw-lottery-option.is-disabled {
    opacity: .34;
    cursor: not-allowed;
}

.jw-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 18px;
    padding: 16px clamp(20px, 3vw, 36px) clamp(20px, 3vw, 28px);
}

.jw-total {
    display: flex;
    align-items: center;
    gap: 10px;
}

.jw-total span {
    color: #aeb8b1;
    text-transform: uppercase;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
}

.jw-total strong {
    min-width: 100px;
    min-height: 36px;
    padding: 7px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 1px solid rgba(116, 255, 65, .50);
    border-radius: 8px;
    background: rgba(67, 176, 42, .11);
    box-shadow: inset 0 0 14px rgba(79, 215, 34, .08);
    font-size: .92rem;
    font-weight: 900;
}

.jw-send {
    position: relative;
    z-index: 2;
    min-width: 300px;
    min-height: 72px;
    margin: 0;
    padding: 13px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #fff;
    border: 1px solid #91ff5c;
    border-radius: 13px;
    background: linear-gradient(145deg, #39bd20, #168e0f);
    box-shadow:
        0 12px 28px rgba(36, 190, 21, .24),
        inset 0 1px rgba(255, 255, 255, .16);
    font: inherit;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        transform .2s ease,
        filter .2s ease,
        box-shadow .2s ease;
}

.jw-send:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow:
        0 16px 34px rgba(61, 229, 38, .32),
        0 0 22px rgba(81, 236, 44, .18);
}

.jw-send:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 4px rgba(67, 176, 42, .16),
        0 16px 34px rgba(61, 229, 38, .32),
        0 0 22px rgba(81, 236, 44, .18);
}

.jw-send img {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    object-fit: contain;
}

.jw-send > span {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.jw-send small {
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .07em;
    line-height: 1.2;
}

.jw-send strong {
    color: #fff;
    font-size: 1.18rem;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: 0;
}

.jw-form-message {
    grid-column: 1 / -1;
    min-height: 1em;
    margin: 0;
    color: #ff948c;
    font-size: .72rem;
    font-weight: 700;
}

.jw-mobile-label,
.jw-total--mobile,
.jw-total--desktop,
.jw-help {
    display: none;
}

@keyframes jwSectionSweep {
    0%, 22% { transform: translateX(-115%); }
    58%, 100% { transform: translateX(115%); }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 980px) {
    .jw-grid {
        grid-template-columns: 138px 48px minmax(125px, 1.15fr) 92px minmax(115px, .85fr);
        gap: 8px;
    }

    .jw-lottery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   CELULAR
   Sin scroll interno y sección compacta
   ========================================================= */

@media (max-width: 700px) {
    .jw-section {
        width: 100%;
        max-width: none;
        max-height: none;
        height: auto;
        margin: 25px 0 32px;
        overflow: hidden;
        border-radius: 15px;
    }

    .jw-header {
        padding: 13px 10px 10px;
    }

    .jw-kicker {
        gap: 7px;
        font-size: .59rem;
        letter-spacing: .11em;
    }

    .jw-kicker::before,
    .jw-kicker::after {
        width: 22px;
    }

    .jw-header h2 {
        margin: 6px 0 3px;
        font-size: 1.48rem;
    }

    .jw-header p {
        max-width: 330px;
        font-size: .64rem;
        line-height: 1.28;
    }

    .jw-draw-panel {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px 7px;
        padding: 7px 9px 3px;
    }

    .jw-draw-select > span {
        margin-bottom: 3px;
        font-size: .8rem;
    }

    .jw-draw-select select {
        height: 31px;
        padding: 0 27px 0 8px;
        border-radius: 6px;
        font-size: .8rem;
    }

    .jw-draw-status {
        max-width: 110px;
        margin: 0 0 5px;
        font-size: .51rem;
        line-height: 1.15;
    }

    .jw-table-wrap {
        padding: 3px 7px 1px;
        overflow: visible;
    }

    .jw-grid--head {
        display: none;
    }

    .jw-rows {
        display: grid;
        gap: 0;
    }

    .jw-grid.jw-row {
        /*
         * RESPONSIVE · distribución:
         * Redoblona | Panel | Número | Alcance | Importe
         *
         * La grilla es la única responsable de los anchos:
         * 68px | 22px | 75px | 66px | resto disponible.
         * Separación real entre columnas: 2px.
         */
        grid-template-columns: 68px 22px 75px 66px minmax(0, 1fr);
        column-gap: 2px;
        row-gap: 0;
        min-height: 37px;
        padding: 1px 0;
    }

    .jw-grid.jw-row > * {
        min-width: 0;
        max-width: 100%;
    }

    .jw-panel {
        width: 22px;
        height: 34px;
        border: 0;
        background: transparent;
        font-size: .64rem;
    }

    .jw-field input,
    .jw-field select {
        height: 34px;
        padding-inline: 6px;
        border-radius: 6px;
        font-size: 1.1rem;
    }

    /*
     * CAMPO NÚMERO
     * Ancho fijo solicitado para 1 a 4 cifras.
     */
    .jw-row > .jw-field:nth-of-type(2) {
        width: 75px;
    }

    .jw-row > .jw-field:nth-of-type(2) input {
        width: 75px;
        font-size: 1.1rem;
    }

    /*
     * CAMPO ALCANCE
     * El ancho lo controla exclusivamente la columna de la grilla.
     */
    .jw-row > .jw-field:nth-of-type(3) {
        width: 100%;
        min-width: 0;
    }

    .jw-row > .jw-field:nth-of-type(3) select {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding-left: 7px;
        padding-right: 18px;
        font-size: 1.1rem;
    }

    /*
     * CAMPO IMPORTE
     * Ocupa todo el espacio restante de la fila.
     * La separación respecto del select anterior es exactamente 2px.
     */
    .jw-field--importe {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    .jw-field--importe .jw-money {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .jw-field--importe input {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding-left: 21px;
        padding-right: 6px;
        font-size: 1.1rem;
    }

    .jw-field input::placeholder {
        font-size: .72rem;
    }

    .jw-money > span {
        left: 6px;
        font-size: 1.1rem;
    }

    .jw-redoblona {
        width: 66px;
        height: 34px;
        padding: 0 4px 0 29px;
        border-radius: 6px;
    }

    .jw-redoblona::before {
        top: 4px;
        bottom: 4px;
        left: 4px;
        width: 20px;
        border-radius: 4px;
        font-size: .8rem;
    }

    .jw-redoblona span {
        white-space: normal;
        text-align: center;
        font-size: .5rem;
        line-height: 1.03;
        letter-spacing: 0;
    }

    .jw-row-error {
        grid-column: 3 / -1;
        margin: 0 0 1px;
        font-size: .53rem;
        line-height: 1.08;
    }

    .jw-lotteries {
        margin: 3px 7px 3px;
        padding: 6px 7px 7px;
        border-radius: 7px;
        font-size: .8rem;
    }

    .jw-lotteries legend {
        padding: 0 4px;
        font-size: .8rem;
    }

    .jw-lotteries-help {
        display: none;
    }

    .jw-lottery-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 3px 4px;
    }

    .jw-lottery-option {
        min-height: 28px;
        padding: 3px 4px;
        gap: 4px;
        border-radius: 5px;
        font-size: .8rem;
        line-height: 1.08;
    }

    .jw-lottery-option input {
        width: 13px;
        height: 13px;
        flex-basis: 13px;
    }

    .jw-footer {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 4px 7px 7px;
    }

    .jw-total {
        justify-content: flex-end;
        gap: 6px;
    }

    .jw-total span {
        font-size: .8rem;
    }

    .jw-total strong {
        min-width: 76px;
        min-height: 27px;
        padding: 3px 7px;
        border-radius: 6px;
        font-size: .8rem;
    }

    .jw-send {
        width: 100%;
        min-width: 0;
        min-height: 62px;
        padding: 11px 14px;
        gap: 12px;
        border-radius: 13px;
    }

    .jw-send img {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .jw-send small {
        font-size: .61rem;
    }

    .jw-send strong {
        font-size: 1rem;
    }

    .jw-form-message {
        min-height: 0;
        font-size: .57rem;
        line-height: 1.1;
    }
}

@media (max-width: 410px) {
    .jw-send {
        padding-inline: 12px;
    }

    .jw-send img {
        width: 35px;
        height: 35px;
        flex-basis: 35px;
    }

    .jw-send strong {
        font-size: .96rem;
    }

    .jw-grid.jw-row {
        /*
         * Celulares angostos:
         * se reduce Redoblona/Panel; alcance queda en 66px
         * y el importe absorbe todo el espacio disponible.
         */
        grid-template-columns: 66px 18px 75px 66px minmax(0, 1fr);
        column-gap: 2px;
        row-gap: 0;
    }

    .jw-panel {
        width: 18px;
    }

    .jw-redoblona {
        width: 64px;
        padding-left: 28px;
    }

    .jw-redoblona::before {
        width: 19px;
    }

    .jw-lottery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px 4px;
    }

    .jw-lottery-option {
        min-height: 28px;
        font-size: .8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jw-section::before {
        animation: none;
    }
}