* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-a: #18263c;
    --bg-b: #2f4668;
    --bg-c: #0f1726;
    --card: #fff7e8;
    --card-soft: #fffdf6;
    --ink: #132238;
    --white: #fffdf7;
    --blue: #5f7fae;
    --blue-dark: #24395a;
    --green: #6faa85;
    --orange: #cf8a4a;
    --gold: #efd69a;
    --shadow: rgba(4, 10, 20, .38);
}
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at 18% 12%, rgba(215, 17, 31, 0.34), transparent 28rem),
        radial-gradient(circle at 82% 88%, rgba(150, 0, 16, 0.30), transparent 30rem),
        linear-gradient(135deg, #000000 0%, #090103 35%, #2a0008 68%, #000000 100%);
    color: var(--white);
    overscroll-behavior: none;
    overflow: hidden;
}

body {
    height: 100dvh;
}

[hidden] {
    display: none !important;
}


body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.035), transparent 42%, rgba(255,255,255,.025));
}

.game-shell {
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 2.2dvh, 22px);
    perspective: 1100px;
    overflow: hidden;
}

.screen {
    display: none;
    width: min(1120px, 100%);
    height: calc(100dvh - (clamp(10px, 2.2dvh, 22px) * 2));
    max-height: calc(100dvh - (clamp(10px, 2.2dvh, 22px) * 2));
    overflow: hidden;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: screenIn .55s ease both;
}

.intro-card-3d,
.game-card-3d {
    position: relative;
    padding: clamp(16px, 2.8dvh, 38px);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    transform-style: preserve-3d;
    backdrop-filter: none;
}

.intro-card-3d::after,
.game-card-3d::after {
    content: none;
}

.brand-orb,
.trophy-3d {
    width: clamp(90px, 16dvh, 140px);
    height: clamp(90px, 16dvh, 140px);
    margin: 0 auto 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #ffffff, #b7c5df 28%, #536c96 62%, #25344f 100%);
    box-shadow: 0 22px 45px rgba(0,0,0,.35), inset -10px -14px 28px rgba(15, 27, 45, .45), inset 9px 10px 20px rgba(255,255,255,.48);
    animation: floatSoft 3.5s ease-in-out infinite;
}

.trophy-3d {
    display: grid;
    place-items: center;
    font-size: 80px;
    font-weight: 900;
    color: #244631;
    background: radial-gradient(circle at 35% 28%, #ffffff, #d7f1df 28%, #79b98d 65%, #3f7252 100%);
}

h1, h2 {
    text-align: center;
    margin: 0 0 22px;
    letter-spacing: .2px;
}

h1 {
    font-size: clamp(34px, min(7vw, 7dvh), 72px);
    line-height: 1.02;
}

.question-title {
    font-size: clamp(30px, min(6vw, 6dvh), 68px);
    line-height: 1.08;
    min-height: clamp(58px, 12dvh, 92px);
    display: grid;
    place-items: center;
    margin: clamp(10px, 2dvh, 20px) 0 clamp(14px, 2.5dvh, 28px);
    text-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.intro-text,
.notice,
.final-score {
    text-align: center;
    font-size: clamp(22px, 3vw, 34px);
    line-height: 1.35;
    max-width: 860px;
    margin: 0 auto 26px;
}

.notice {
    font-size: clamp(16px, 2vw, 22px);
    opacity: .86;
    margin-top: 22px;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 800;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: clamp(12px, min(2.4vw, 2.4dvh), 28px);
    perspective: 1200px;
    flex: 1 1 auto;
    min-height: 0;
}

.option-card {
    position: relative;
    min-height: 0;
    height: 100%;
    border: none;
    border-radius: 32px;
    background: linear-gradient(145deg, var(--card-soft), var(--card));
    box-shadow: 0 22px 0 #d7cfbe, 0 34px 56px rgba(4, 11, 22, .38), inset 0 2px 0 rgba(255,255,255,.9);
    cursor: pointer;
    transform-style: preserve-3d;
    transform: rotateX(7deg) translateZ(0);
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
    overflow: hidden;
    touch-action: manipulation;
}

.option-card::before {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 24px;
    border: 5px solid rgba(79, 111, 159, .42);
    pointer-events: none;
}

.option-card:hover,
.option-card:focus-visible {
    transform: rotateX(0deg) translateY(-9px) scale(1.025);
    box-shadow: 0 18px 0 #d7cfbe, 0 38px 70px rgba(4, 11, 22, .45), inset 0 2px 0 rgba(255,255,255,.9);
    outline: none;
}

.card-glow {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.85), transparent 28%);
    transform: translateZ(35px);
    pointer-events: none;
}

.image-stage {
    position: absolute;
    inset: 26px;
    display: grid;
    place-items: center;
    transform: translateZ(45px);
}

.image-stage img {
    width: min(78%, 240px);
    height: min(78%, 240px);
    object-fit: contain;
    filter: drop-shadow(0 16px 18px rgba(20, 25, 33, .22));
    user-select: none;
}

.card-enter {
    animation: cardIn .62s cubic-bezier(.2, .9, .25, 1.2) both;
}

.card-correct {
    animation: correctPulse .85s ease both;
    box-shadow: 0 22px 0 #9ecaaa, 0 34px 56px rgba(4, 11, 22, .38), 0 0 0 8px rgba(95,159,122,.42) inset;
}

.card-wrong {
    animation: wrongShake .52s ease both;
    box-shadow: 0 22px 0 #deb37e, 0 34px 56px rgba(4, 11, 22, .38), 0 0 0 8px rgba(212,138,69,.45) inset;
}

.action-row {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: clamp(12px, 2.2dvh, 26px);
}

button {
    font-family: inherit;
}

.big-touch,
.ghost-btn {
    min-height: clamp(58px, 8dvh, 76px);
    min-width: 190px;
    padding: 18px 30px;
    border-radius: 24px;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 900;
    border: none;
    cursor: pointer;
    touch-action: manipulation;
}

.primary-btn {
    color: var(--white);
    background: linear-gradient(145deg, #6684b2, #385276);
    box-shadow: 0 13px 0 #24364e, 0 24px 38px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25);
}

.secondary-btn,
.ghost-btn {
    color: var(--ink);
    background: linear-gradient(145deg, #fffaf0, #ded8ca);
    box-shadow: 0 10px 0 #b8b0a1, 0 18px 30px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.8);
}

.ghost-btn {
    min-width: 120px;
    min-height: 62px;
    font-size: clamp(18px, 2.4vw, 26px);
}


.intro-card-3d.screen.active,
#endScreen.screen.active {
    justify-content: center;
    align-items: center;
}

#gameScreen.screen.active {
    justify-content: flex-start;
}

.game-card-3d {
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

.result-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(12, 20, 34, .54);
    backdrop-filter: blur(5px);
}

.result-modal.modal-hide {
    animation: fadeOut .25s ease both;
}

.result-box {
    width: min(620px, 94vw);
    min-height: 310px;
    display: grid;
    place-items: center;
    text-align: center;
    gap: 12px;
    padding: 36px;
    border-radius: 36px;
    background: linear-gradient(145deg, #fffaf0, #efe6d6);
    color: var(--ink);
    box-shadow: 0 30px 0 #cfc4ae, 0 48px 90px rgba(0,0,0,.48), inset 0 2px 0 rgba(255,255,255,.9);
    border: 8px solid rgba(79, 111, 159, .25);
    transform-style: preserve-3d;
}

.result-box.zoom-pop {
    animation: zoomInOut 3s ease both;
}

.result-box.incorrecto {
    border-color: rgba(212,138,69,.55);
}

.result-box.correcto {
    border-color: rgba(95,159,122,.55);
}

.result-icon {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 74px;
    font-weight: 900;
    color: white;
    background: linear-gradient(145deg, var(--orange), #a45d2d);
    box-shadow: 0 12px 0 rgba(100, 61, 25, .35), 0 20px 35px rgba(0,0,0,.22);
}

.result-box.correcto .result-icon {
    background: linear-gradient(145deg, var(--green), #3d7954);
}

.result-box h3 {
    margin: 0;
    font-size: clamp(46px, 8vw, 82px);
    line-height: 1;
}

.result-box p {
    margin: 0;
    font-size: clamp(26px, 5vw, 44px);
    font-weight: 900;
    line-height: 1.2;
}

@keyframes screenIn {
    from { opacity: 0; transform: rotateX(8deg) translateY(25px) scale(.98); }
    to { opacity: 1; transform: rotateX(0) translateY(0) scale(1); }
}

@keyframes cardIn {
    from { opacity: 0; transform: rotateX(18deg) translateY(55px) scale(.92); }
    to { opacity: 1; transform: rotateX(7deg) translateY(0) scale(1); }
}

@keyframes floatSoft {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-10px) rotateX(8deg); }
}

@keyframes correctPulse {
    0% { transform: rotateX(7deg) scale(1); }
    50% { transform: rotateX(0deg) scale(1.08); }
    100% { transform: rotateX(7deg) scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: rotateX(7deg) translateX(0); }
    20% { transform: rotateX(7deg) translateX(-10px); }
    40% { transform: rotateX(7deg) translateX(10px); }
    60% { transform: rotateX(7deg) translateX(-6px); }
    80% { transform: rotateX(7deg) translateX(6px); }
}

@keyframes zoomInOut {
    0% { opacity: 0; transform: scale(.55) rotateX(12deg); }
    16% { opacity: 1; transform: scale(1.08) rotateX(0); }
    28% { transform: scale(1); }
    82% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(.84); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@media (max-width: 760px) {
    .game-shell {
        padding: 8px;
        align-items: stretch;
    }

    .intro-card-3d,
    .game-card-3d {
        height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 26px;
        padding: clamp(12px, 2.2dvh, 22px) 14px;
    }

    .options-grid {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: clamp(10px, 1.8dvh, 15px);
    }

    .option-card {
        min-height: 0;
        border-radius: 24px;
        box-shadow: 0 14px 0 #d7cfbe, 0 24px 36px rgba(4, 11, 22, .36), inset 0 2px 0 rgba(255,255,255,.9);
    }

    .image-stage {
        inset: 20px;
    }

    .top-bar {
        align-items: flex-start;
    }

    .question-title {
        min-height: 78px;
        margin-bottom: clamp(10px, 1.8dvh, 18px);
    }

    .big-touch {
        width: 100%;
    }
}


@media (max-height: 720px) {
    .brand-orb,
    .trophy-3d {
        margin-bottom: 12px;
    }

    .intro-text,
    .notice,
    .final-score {
        margin-bottom: 14px;
    }

    .option-card::before {
        inset: 10px;
        border-width: 4px;
    }

    .image-stage {
        inset: 16px;
    }
}

/* Ajuste v6: pantalla inicial mínima, conservando estilo 3D v4 */
.home-minimal {
    justify-content: center;
    gap: clamp(18px, 4dvh, 34px);
}
.home-message {
    width: min(92vw, 980px);
    padding: clamp(20px, 4vw, 42px);
    border-radius: 34px;
    background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(229,236,249,.95));
    box-shadow: inset 0 2px 0 rgba(255,255,255,.95), 0 22px 40px rgba(8, 20, 40, .24);
    transform: perspective(900px) rotateX(1.5deg);
}
.home-message h1, .home-message p {
    margin-left: auto;
    margin-right: auto;
}


/* Ajuste v7: inicio único, cambio de vista en la misma pantalla y paleta más estable */
.screen {
    min-height: calc(100dvh - (clamp(10px, 2.2dvh, 22px) * 2));
}

.home-minimal.screen.active {
    justify-content: center;
    align-items: center;
    gap: clamp(22px, 4dvh, 42px);
}

.home-message {
    width: min(94vw, 920px);
    color: var(--ink);
    border: 2px solid rgba(239, 214, 154, .55);
    background: linear-gradient(145deg, #fffdf6 0%, #eef3fb 54%, #e3edf8 100%);
    box-shadow: 0 24px 0 rgba(27, 43, 67, .18), 0 38px 75px rgba(4, 10, 20, .38), inset 0 2px 0 rgba(255,255,255,.95);
}

.home-message h1 {
    color: #1b3150;
    text-shadow: 0 3px 0 rgba(255,255,255,.85);
}

.home-message .intro-text {
    color: #243b5a;
    font-weight: 800;
}

.home-message .notice {
    color: #3c4f69;
    font-weight: 700;
    opacity: 1;
}

.start-3d {
    min-width: min(92vw, 430px);
    min-height: clamp(74px, 10dvh, 96px);
    font-size: clamp(28px, 4.2vw, 44px);
    border: 2px solid rgba(255,255,255,.28);
    background: linear-gradient(145deg, #6f91c2 0%, #385a87 55%, #274469 100%);
    box-shadow: 0 16px 0 #192c46, 0 30px 52px rgba(4,10,20,.44), inset 0 2px 0 rgba(255,255,255,.3);
    transform: perspective(900px) rotateX(6deg);
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.start-3d:active {
    transform: perspective(900px) rotateX(2deg) translateY(9px);
    box-shadow: 0 7px 0 #192c46, 0 18px 34px rgba(4,10,20,.36), inset 0 2px 0 rgba(255,255,255,.25);
}

#gameScreen.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.game-card-3d {
    background: linear-gradient(145deg, rgba(58, 79, 112, .84), rgba(24, 38, 60, .92));
}

.option-card {
    background: linear-gradient(145deg, #fffdf6 0%, #f6eddc 100%);
}

.option-card::before {
    border-color: rgba(95, 127, 174, .46);
}

.question-title {
    color: var(--white);
}

.top-bar {
    color: #f8f1df;
}

@media (max-width: 760px), (max-height: 720px) {
    .screen {
        height: calc(100dvh - 16px);
        min-height: calc(100dvh - 16px);
        max-height: calc(100dvh - 16px);
    }

    .home-message {
        padding: clamp(18px, 4dvh, 30px) clamp(14px, 5vw, 24px);
    }

    .home-message h1 {
        font-size: clamp(32px, 9vw, 52px);
    }

    .home-message .intro-text {
        font-size: clamp(22px, 6vw, 30px);
    }

    .home-message .notice {
        font-size: clamp(16px, 4.5vw, 22px);
    }

    .start-3d {
        width: min(92vw, 430px);
    }
}


/* Ajuste v9: home centrado y gameScreen a pantalla visible completa */
#homeScreen.active {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: clamp(22px, 4dvh, 44px);
}

#homeScreen .home-message {
    width: min(900px, 100%);
    margin-left: auto;
    margin-right: auto;
}

body.game-running .game-shell {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

#gameScreen.screen.active {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    padding: clamp(10px, 2dvh, 24px);
}

#gameScreen.game-card-3d::after {
    inset: clamp(8px, 1.5dvh, 18px);
    border-radius: clamp(18px, 3dvh, 28px);
}

#gameScreen .top-bar,
#gameScreen .question-title,
#gameScreen .options-grid,
#gameScreen .action-row {
    width: min(1180px, 100%);
    margin-left: auto;
    margin-right: auto;
}

#gameScreen .options-grid {
    flex: 1 1 auto;
    min-height: 0;
}

@media (max-width: 720px), (max-height: 720px) {
    #gameScreen.screen.active {
        padding: clamp(8px, 1.5dvh, 14px);
    }

    #gameScreen .question-title {
        min-height: auto;
        margin-top: clamp(6px, 1dvh, 10px);
        margin-bottom: clamp(8px, 1.4dvh, 14px);
    }

    #gameScreen .action-row {
        margin-top: clamp(8px, 1.4dvh, 14px);
    }
}


/* Ajuste v11: más espacio entre cartas, botón Salir pequeño y nombre visible en cada carta */
#gameScreen .options-grid {
    gap: clamp(22px, min(4vw, 4dvh), 46px);
    padding: clamp(6px, 1.2dvh, 16px);
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3dvh, 34px);
}

.image-stage {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    place-items: center;
    transform: translateZ(45px);
    padding-bottom: clamp(8px, 1.5dvh, 16px);
}

.image-stage img {
    width: min(82%, 260px);
    height: min(82%, 260px);
    max-height: 100%;
}

.card-label {
    position: relative;
    z-index: 2;
    width: min(92%, 340px);
    margin-top: clamp(4px, 1dvh, 12px);
    padding: clamp(8px, 1.3dvh, 14px) clamp(10px, 2vw, 18px);
    border-radius: 20px;
    color: #1b3150;
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(230,238,249,.94));
    box-shadow: 0 8px 0 rgba(191, 181, 163, .8), 0 12px 22px rgba(4, 11, 22, .18), inset 0 1px 0 rgba(255,255,255,.95);
    font-size: clamp(22px, min(3.6vw, 3.2dvh), 38px);
    line-height: 1.05;
    font-weight: 900;
    text-align: center;
    letter-spacing: .2px;
    transform: translateZ(50px);
}

#exitBtn.ghost-btn {
    min-width: 82px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: 16px;
    font-size: clamp(15px, 2vw, 20px);
    box-shadow: 0 6px 0 #b8b0a1, 0 10px 18px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.8);
}

@media (max-width: 760px) {
    #gameScreen .options-grid {
        gap: clamp(16px, 2.6dvh, 24px);
        padding: 4px;
    }

    .option-card {
        padding: clamp(12px, 2dvh, 20px);
    }

    .card-label {
        font-size: clamp(18px, 5vw, 28px);
        padding: 8px 10px;
        border-radius: 16px;
    }

    #exitBtn.ghost-btn {
        min-width: 70px;
        min-height: 40px;
        padding: 7px 12px;
        font-size: 15px;
    }
}

@media (max-height: 700px) {
    #gameScreen .options-grid {
        gap: clamp(12px, 2dvh, 22px);
    }

    .option-card {
        padding: clamp(10px, 1.6dvh, 18px);
    }

    .card-label {
        font-size: clamp(17px, 3dvh, 27px);
        padding: 7px 10px;
    }
}

/* Ajuste v12: texto plano y contenido totalmente centrado dentro de cada carta */
.option-card {
    text-align: center;
    gap: clamp(10px, 1.8dvh, 18px);
}

.option-card .image-stage {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 auto;
}

.option-card .image-stage img {
    display: block;
    margin: 0 auto;
}

.option-card .card-label {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(4px, .8dvh, 8px) clamp(6px, 1.2vw, 12px);
    color: #1b3150;
    background: transparent;
    border: 0;
    box-shadow: none;
    text-shadow: none;
    transform: none;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0;
}

.option-card::before {
    z-index: 1;
}

.option-card .card-glow,
.option-card .image-stage,
.option-card .card-label {
    position: relative;
    z-index: 2;
}


/* Ajuste v14: imagen plana sin borde, sin marco y sin efecto 3D propio */
.option-card .image-stage {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    filter: none !important;
}

.option-card .image-stage img {
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    border-radius: 0 !important;
    width: min(88%, 280px);
    height: min(88%, 280px);
    object-fit: contain;
}

/* Ajuste v15: imágenes un poco más grandes dentro de las cartas, manteniendo estilo flat */
.option-card .image-stage {
    flex: 1 1 auto;
    min-height: 0;
}

.option-card .image-stage img {
    width: min(96%, 340px) !important;
    height: min(96%, 340px) !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@media (max-width: 760px) {
    .option-card .image-stage img {
        width: min(98%, 300px) !important;
        height: min(98%, 300px) !important;
    }
}

@media (max-height: 700px) {
    .option-card .image-stage img {
        width: min(94%, 260px) !important;
        height: min(94%, 260px) !important;
    }
}


/* Ajuste v19: botón de créditos plano, flotante y pequeño */
.btn-credits {
    position: fixed;
    right: max(14px, env(safe-area-inset-right));
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 60;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid rgba(23, 37, 84, .20);
    border-radius: 999px;
    background: rgba(255, 248, 231, .92);
    color: #172554;
    font-size: clamp(.82rem, 2.1vw, .98rem);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0,0,0,.16);
    touch-action: manipulation;
    transform: none;
}

.btn-credits:active {
    transform: scale(.97);
    box-shadow: 0 5px 12px rgba(0,0,0,.18);
}

.credits-modal.hidden {
    display: none;
}

.credits-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(8, 20, 44, .72);
    backdrop-filter: blur(5px);
}

.credits-card {
    width: min(680px, 94vw);
    max-height: 86dvh;
    overflow: auto;
    padding: clamp(22px, 4vw, 38px);
    border-radius: 28px;
    background: #fff8e7;
    color: #172554;
    text-align: center;
    box-shadow: 0 22px 50px rgba(0,0,0,.35), inset 0 0 0 2px rgba(255,255,255,.55);
    animation: creditsZoom .28s ease-out;
}

.credits-card h2 {
    margin: 0 0 18px;
    font-size: clamp(2rem, 5vw, 3rem);
}

.credits-card p {
    font-size: clamp(1rem, 2.8vw, 1.35rem);
    line-height: 1.45;
}

.credits-note {
    font-weight: 800;
}

.btn-credits-close {
    margin-top: 18px;
    min-height: 54px;
    padding: 12px 30px;
    border: 0;
    border-radius: 18px;
    background: #1d4ed8;
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

@keyframes creditsZoom {
    from {
        opacity: 0;
        transform: scale(.88);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Ajuste v19: acciones finales y botón Salir hacia /games */
.end-actions {
    width: min(620px, 92vw);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(12px, 3vw, 22px);
    flex-wrap: wrap;
    margin-top: 20px;
}

.end-exit-btn {
    min-height: 52px;
    padding: 12px 26px;
    border: 0;
    border-radius: 18px;
    background: rgba(255, 248, 231, .94);
    color: #172554;
    font-size: clamp(1rem, 2.6vw, 1.2rem);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0,0,0,.20);
    touch-action: manipulation;
}

.end-exit-btn:active {
    transform: scale(.98);
}


/* Ajuste v21: fondo negro con rojo suave, secciones transparentes y acciones de inicio */
.home-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(14px, 2.6vw, 28px);
    flex-wrap: wrap;
}

.start-3d,
.home-btn-flat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.start-3d i,
.home-btn-flat i {
    font-size: .9em;
}

.home-btn-flat {
    min-width: min(82vw, 230px);
    min-height: clamp(62px, 8dvh, 78px);
    padding: 14px 26px;
    border: 0;
    border-radius: 22px;
    color: #fffdf7;
    background: rgba(255,255,255,.10);
    box-shadow: 0 14px 32px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.18);
    font-size: clamp(22px, 3.2vw, 34px);
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.home-btn-flat:active {
    transform: translateY(4px);
    background: rgba(255,255,255,.16);
    box-shadow: 0 8px 20px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.20);
}

.intro-card-3d,
.game-card-3d,
#endScreen {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.intro-card-3d::after,
.game-card-3d::after {
    content: none !important;
}

.btn-credits {
    border: 0 !important;
}

@media (max-width: 760px) {
    .home-actions {
        width: 100%;
        gap: 14px;
    }

    .start-3d {
        min-width: min(92vw, 430px);
    }

    .home-btn-flat {
        min-width: min(92vw, 430px);
        width: min(92vw, 430px);
    }
}
