@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;700&display=swap');

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: -webkit-fill-available;
    background-color: #050505;
    color: #fff;
    overflow: hidden;
    font-family: 'Teko', sans-serif;
}

.arcade-cabinet {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100dvh;
    background: linear-gradient(135deg, #111 0%, #222 100%);
    border: 8px solid #333;
    box-sizing: border-box;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 0 20px rgba(255, 0, 0, 0.2);
    position: relative;
}

/* Top marquee / Sign */
.marquee {
    min-height: 10vh;
    height: auto;
    background: #000;
    border-bottom: 4px solid #f00;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5vh 4%;
    box-sizing: border-box;
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.3), 0 5px 15px rgba(255,0,0,0.4);
    position: relative;
    overflow: visible;
    width: 100%;
}

.marquee::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(255,0,0,0.1) 10px, rgba(255,0,0,0.1) 20px);
}

.marquee-prefix {
    position: absolute;
    left: 4%;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Teko', sans-serif;
    font-size: clamp(1rem, 2vw, 1.8rem);
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 2px;
    white-space: nowrap;
    text-shadow:
        0 0 4px  rgba(0, 230, 255, 0.7),
        0 0 10px rgba(0, 230, 255, 0.7),
        0 0 18px rgba(0, 230, 255, 0.9);
    z-index: 1;
}

.marquee-text {
    font-family: 'Teko', sans-serif;
    color: #fff;
    text-shadow:
        0 0 5px  rgba(0, 230, 255, 0.85),
        0 0 12px rgba(0, 230, 255, 0.85),
        0 0 22px rgba(0, 230, 255, 1);
    font-size: clamp(1.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 1;
}

.btn-inicio {
    background-color: #cc0000;
    color: white;
    border-radius: 0.5rem;
    border: 2px solid #800000;
    box-shadow: 0 0 15px rgba(255,0,0,0.6);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.1s;
    padding: 0.2rem 1.5rem;
    font-family: 'Teko', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    position: absolute;
    right: 4%;
    top: 50%;
    transform: translateY(-50%);
}

.btn-inicio:hover {
    background-color: #ff1a1a;
}

.btn-inicio:active {
    transform: translateY(-50%) scale(0.95);
}

/* Main Screen / Glass */
.screen-glass {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 80%);
    position: relative;
    overflow: hidden;
    border-bottom: 6px solid #444;
}

/* Screen Reflection */
.screen-glass::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 50%, transparent 50%, transparent 100%);
    transform: rotate(30deg);
    pointer-events: none;
}

.logo-container {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 20px rgba(255, 200, 0, 0.4));
    transition: all 0.3s ease;
    box-sizing: border-box;
    padding: 1rem;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}
.logo-container.blurred {
    opacity: 0.2;
    transform: scale(0.8);
    filter: blur(5px);
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Slot Machine Payline Layout ─────────────── */
:root {
    --pbox: 34px;
    --pgap: 3px;
    --punit: calc(var(--pbox) + var(--pgap));
}

.screen-layout {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
}

.payline-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--pgap);
    flex-shrink: 0;
    padding: 0 4px;
    z-index: 6;
}

.payline-box {
    width: var(--pbox);
    height: var(--pbox);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Teko', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}

/* Colores posicionales (orden casino: 4,2,6,8,10,1,9,7,5,3) */
.payline-box:nth-child(1)  { background: #c62828; } /* 4  — rojo      */
.payline-box:nth-child(2)  { background: #00838f; } /* 2  — cian      */
.payline-box:nth-child(3)  { background: #e65100; } /* 6  — ámbar     */
.payline-box:nth-child(4)  { background: #2e7d32; } /* 8  — verde     */
.payline-box:nth-child(5)  { background: #6a1b9a; } /* 10 — morado    */
.payline-box:nth-child(6)  { background: #1565c0; } /* 1  — azul      */
.payline-box:nth-child(7)  { background: #004d57; } /* 9  — cian base (ganador) */
.payline-box:nth-child(8)  { background: #b71c1c; } /* 7  — rojo      */
.payline-box:nth-child(9)  { background: #d17000; } /* 5  — ámbar     */
.payline-box:nth-child(10) { background: #1b5e20; } /* 3  — verde     */

/* Cuadrado ganador nº 9 — brillo cian neón */
.payline-box.winner {
    border-color: rgba(0, 230, 255, 0.85);
    box-shadow:
        0 0 0 1px rgba(0, 230, 255, 0.4),
        0 0 10px 3px rgba(0, 230, 255, 0.65),
        0 0 22px 5px rgba(0, 230, 255, 0.25);
    animation: winnerPulse 2.4s ease-in-out infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        box-shadow:
            0 0 0 1px rgba(0, 230, 255, 0.4),
            0 0 10px 3px rgba(0, 230, 255, 0.65),
            0 0 22px 5px rgba(0, 230, 255, 0.25);
    }
    50% {
        box-shadow:
            0 0 0 1px rgba(0, 230, 255, 0.75),
            0 0 16px 5px rgba(0, 230, 255, 0.95),
            0 0 34px 8px rgba(0, 230, 255, 0.45);
    }
}

/* Línea ganadora cian que cruza horizontalmente la pantalla */
.winning-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    /* top = 50% + desplazamiento del centro del cuadrado 9 (índice 6) */
    top: calc(50% + 1 * var(--punit) + var(--pbox) / 2 + var(--pgap) / 2);
    background: linear-gradient(
        to right,
        transparent 0%,
        rgba(0, 230, 255, 0.45) 4%,
        rgba(0, 230, 255, 0.80) 18%,
        rgba(0, 230, 255, 0.80) 82%,
        rgba(0, 230, 255, 0.45) 96%,
        transparent 100%
    );
    box-shadow: 0 0 6px 2px rgba(0, 230, 255, 0.4);
    z-index: 5;
    pointer-events: none;
    animation: linePulse 2.4s ease-in-out infinite;
}

@keyframes linePulse {
    0%, 100% { opacity: 0.65; }
    50%       { opacity: 1; }
}

/* Control Panel / Button Deck */
.control-panel-wrapper {
    background: linear-gradient(to bottom, #444, #222);
    border-top: ridge 10px #666;
    padding: 1.5rem 1rem;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.control-panel {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    justify-content: center;
    justify-items: center;
    align-items: center;
    gap: 1vw;
    width: 100%;
    max-width: 100%;
    padding: 0 1vw;
    box-sizing: border-box;
    margin: 0 auto;
    perspective: 1000px;
}

/* Button Socket (The rim) */
.button-socket {
    position: relative;
    width: clamp(60px, 11vw, 130px);
    height: clamp(60px, 11vw, 130px);
    border-radius: 18px;
    background: conic-gradient(#555, #999, #555, #999, #555);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8), 0 5px 15px rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .control-panel {
        grid-template-columns: repeat(4, 1fr);
        gap: 2vw;
        padding: 0 2vw;
    }
    .button-socket {
        width: clamp(70px, 18vw, 150px);
        height: clamp(70px, 18vw, 150px);
    }
    :root {
        --pbox: 28px;
        --pgap: 2px;
        --punit: calc(var(--pbox) + var(--pgap));
    }
    .payline-box {
        font-size: 0.95rem;
    }
}

@media (max-width: 600px) {
    .winning-line {
        z-index: 5;
    }
    :root {
        --pbox: 20px;
        --pgap: 2px;
        --punit: calc(var(--pbox) + var(--pgap));
    }
    .screen-layout {
        width: 100%;
    }
    .payline-col {
        flex: 0 0 auto;
        padding: 0 2px;
    }
    .payline-box {
        font-size: 0.65rem;
    }
    .logo-container {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.5rem;
    }
    .control-panel-wrapper {
        padding: 1rem 0.5rem;
    }
    .control-panel {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    .button-socket {
        width: clamp(55px, 22vw, 85px) !important;
        height: clamp(55px, 22vw, 85px) !important;
        border-radius: 12px !important;
    }
    .arcade-button {
        font-size: 0.8rem !important;
        border-radius: 10px !important;
    }
    .arcade-button svg {
        width: clamp(26px, 7vw, 36px) !important;
        height: clamp(26px, 7vw, 36px) !important;
        margin-bottom: 1px;
    }
    .close-hint {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 350px) {
    :root {
        --pbox: 16px;
        --pgap: 1px;
        --punit: calc(var(--pbox) + var(--pgap));
    }
    .payline-col {
        flex: 0 0 auto;
        padding: 0 1px;
    }
    .payline-box {
        font-size: 0.5rem;
        border-radius: 2px;
    }
    .logo-container {
        flex: 1 1 auto;
        min-width: 0;
        padding: 0.25rem;
    }
    .button-socket {
        width: clamp(45px, 20vw, 65px) !important;
        height: clamp(45px, 20vw, 65px) !important;
    }
    .arcade-button {
        font-size: 0.65rem !important;
    }
    .arcade-button svg {
        width: clamp(18px, 5.5vw, 26px) !important;
        height: clamp(18px, 5.5vw, 26px) !important;
    }
}

/* Marquee responsive: apilamiento vertical en móvil */
@media (max-width: 768px) {
    .marquee {
        height: auto;
        min-height: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.6rem;
        padding: 0.7rem 4%;
    }
    .marquee-prefix {
        position: static;
        transform: none;
        font-size: clamp(1rem, 4vw, 1.4rem);
    }
    .marquee-text {
        white-space: normal;
        text-align: center;
        line-height: 1.1;
    }
    .btn-inicio {
        position: static;
        transform: none;
    }
    .btn-inicio:active {
        transform: scale(0.95);
    }
    /* Compactación del panel de botones para móvil vertical */
    .control-panel-wrapper {
        padding: 0.4rem 0.4rem;
        border-top-width: 4px;
    }
    .control-panel {
        grid-template-columns: repeat(4, 1fr);
        gap: 1vw;
    }
    .button-socket {
        width: clamp(50px, 13vw, 82px);
        height: clamp(50px, 13vw, 82px);
        border-radius: 12px;
    }
    .arcade-button {
        font-size: 0.8rem;
        border-radius: 10px;
    }
    .arcade-button svg {
        width: clamp(24px, 5vw, 38px);
        height: clamp(24px, 5vw, 38px);
    }
}

/* ── Landscape mobile (portrait rotated) ────────────────────
   Activated when: height ≤ 500px AND device is landscape.
   Covers iPhone SE / 11 / 12 / Pro Max in horizontal mode.
   Allows Y-scroll as safety valve; targets 1-row button grid. */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Unlock Y-axis so content never collides.
       height: auto is critical — without it, body stays fixed at
       100% viewport and overflow-y: auto has nothing to scroll. */
    body, html {
        height: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }

    /* Cabinet becomes a minimum-height column instead of locked viewport */
    .arcade-cabinet {
        height: auto;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    /* Marquee: keep horizontal layout, shrink to minimum strip */
    .marquee {
        min-height: 0;
        padding: 0.25rem 4%;
    }
    .marquee-text {
        font-size: clamp(1.1rem, 4vw, 2rem);
    }
    .marquee-prefix {
        font-size: clamp(0.65rem, 1.5vw, 0.95rem);
    }
    .btn-inicio {
        font-size: clamp(0.75rem, 2vw, 1.1rem);
        padding: 0.1rem 0.7rem;
    }

    /* Screen-glass: protected zone — flex must never crush this.
       flex-shrink: 0 is the hard guard; min-height is the floor. */
    .screen-glass {
        min-height: 250px;
        flex-shrink: 0;
    }

    /* Payline boxes: minimal footprint */
    :root {
        --pbox: 16px;
        --pgap: 2px;
        --punit: calc(var(--pbox) + var(--pgap));
    }
    .payline-box {
        font-size: 0.5rem;
    }

    /* Control panel: collapse to a single row of 8 using full landscape width */
    .control-panel-wrapper {
        padding: 0.25rem 0.4rem;
        border-top-width: 3px;
    }
    .control-panel {
        grid-template-columns: repeat(8, 1fr);
        gap: 0.6vw;
        padding: 0 0.5vw;
    }
    .button-socket {
        width: clamp(42px, 8.5vw, 66px) !important;
        height: clamp(42px, 8.5vw, 66px) !important;
        border-radius: 10px !important;
    }
    .arcade-button {
        font-size: 0.6rem !important;
        border-radius: 8px !important;
    }
    .arcade-button svg {
        width: clamp(16px, 3.2vw, 26px) !important;
        height: clamp(16px, 3.2vw, 26px) !important;
    }

    /* Legal footer: minimal strip */
    .legal-footer {
        padding: 3px 10px;
        padding-bottom: calc(3px + env(safe-area-inset-bottom, 0px));
        font-size: 0.6rem;
    }
}

/* Arcade Buttons */
.arcade-button {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 14px;
    border: none;
    outline: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    font-family: 'Teko', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    transition: all 0.08s ease-out;
    transform-style: preserve-3d;
    box-shadow:
        0 6px 0 #111,
        0 8px 10px rgba(0,0,0,0.5);
    -webkit-tap-highlight-color: transparent;
    /* Make button stick out above the socket */
    transform: translateY(-4px) scale(0.88);
}

/* Dome cap */
.arcade-button span {
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1;
    margin-top: 2px;
}

.arcade-button svg {
    width: clamp(40px, 5vw, 62px);
    height: clamp(40px, 5vw, 62px);
    flex-shrink: 0;
    color: #ffffff;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5));
    margin-bottom: 0;
}

/* Individual Button Colors */
.btn-red {
    background: radial-gradient(circle at 30% 30%, #ff4d4d, #cc0000 60%, #800000);
}
.btn-red:active {
    transform: translateY(2px) scale(0.88);
    box-shadow: 0 0px 0 #111, 0 1px 5px rgba(0,0,0,0.5);
    background: radial-gradient(circle at 30% 30%, #ff6666, #e60000 60%, #990000);
}

.btn-blue {
    background: radial-gradient(circle at 30% 30%, #4da6ff, #005ce6 60%, #003380);
}
.btn-blue:active {
    transform: translateY(2px) scale(0.88);
    box-shadow: 0 0px 0 #111, 0 1px 5px rgba(0,0,0,0.5);
    background: radial-gradient(circle at 30% 30%, #66b3ff, #0066ff 60%, #004099);
}

.btn-yellow {
    background: radial-gradient(circle at 30% 30%, #ffcc00, #b38f00 60%, #665200);
}
.btn-yellow span, .btn-yellow svg {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.btn-yellow:active {
    transform: translateY(2px) scale(0.88);
    box-shadow: 0 0px 0 #111, 0 1px 5px rgba(0,0,0,0.5);
    background: radial-gradient(circle at 30% 30%, #ffdb4d, #cca300 60%, #806600);
}

.btn-green {
    background: radial-gradient(circle at 30% 30%, #4dff4d, #00b300 60%, #006600);
}
.btn-green span, .btn-green svg {
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.btn-green:active {
    transform: translateY(2px) scale(0.88);
    box-shadow: 0 0px 0 #111, 0 1px 5px rgba(0,0,0,0.5);
    background: radial-gradient(circle at 30% 30%, #66ff66, #00cc00 60%, #008000);
}

/* Glare effect on buttons */
.arcade-button::after {
    content: '';
    position: absolute;
    top: 5%; left: 10%;
    width: 80%; height: 35%;
    background: linear-gradient(rgba(255,255,255,0.7), rgba(255,255,255,0));
    border-radius: 10px 10px 0 0;
    pointer-events: none;
}

/* Content Display Area (Reels) */
.big-reel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 0;
    box-shadow: inset 0 0 40px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 20;
    display: none;
    opacity: 0;
}

.reel-motion-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.premium-spin {
    animation: premiumSpin 1.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes premiumSpin {
    0% {
        transform: translateY(0);
        filter: blur(10px);
    }
    15% {
        filter: blur(12px);
    }
    100% {
        transform: translateY(-350vh);
        filter: blur(0px);
    }
}

.ghost-symbol {
    height: 50vh;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 700;
    color: #ececec;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.content-card {
    flex-shrink: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 3rem 5% 2rem;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    text-align: center;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 20%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
}
.content-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 20%;
    background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
}

.content-card h2 {
    font-family: 'Teko', sans-serif;
    color: #111;
    margin-bottom: 20px;
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-top: 0;
}

.content-card p, .content-card ul {
    font-family: 'Teko', sans-serif;
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 5px;
    margin-top: 0;
    color: #333;
    line-height: 1.2;
}

.content-card ul {
    padding: 0;
    list-style: none;
    width: 100%;
}

.content-card li {
    text-align: left;
    margin-bottom: 5px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

.close-hint {
    margin-top: auto !important;
    padding-top: 1.5rem;
    font-family: 'Teko', sans-serif !important;
    font-size: 1.2rem !important;
    color: #888 !important;
    margin-bottom: 0 !important;
    letter-spacing: 1px;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.urgencias-text {
    color: #cc0000;
    font-weight: bold;
}

/* Legal footer — placa de aviso obligatorio */
.legal-footer {
    width: 100%;
    flex-shrink: 0;
    background-color: #111111;
    border-top: 2px solid #333;
    color: #666666;
    text-align: center;
    padding: 6px 10px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    font-family: Arial, sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    box-sizing: border-box;
    user-select: none;
}

/* Scrollbar estilo arcade */
.content-card::-webkit-scrollbar {
    width: 12px;
}
.content-card::-webkit-scrollbar-track {
    background: #111;
    border-left: 2px solid #000;
}
.content-card::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff2222 0%, #cc0000 40%, #800000 100%);
    border-radius: 2px;
    border: 2px solid #0a0a0a;
    box-shadow: inset 0 1px 0 rgba(255,100,100,0.4);
}
.content-card::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #ff4444 0%, #ff1a1a 50%, #aa0000 100%);
}
.content-card::-webkit-scrollbar-button {
    display: none;
    height: 0;
}
