* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 2s ease-in-out, transform 2s ease-in-out;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
}

#start-screen {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 100;
    opacity: 0;
    animation: fadeInStart 2.5s ease-out forwards;
}

@keyframes fadeInStart {
    0% { opacity: 0; transform: scale(1.1); filter: blur(10px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0px); }
}

#start-screen .content {
    text-align: center;
    animation: pulse-glow 3s infinite alternate;
    will-change: transform, opacity;
    transform: translateZ(0); /* Forzar aceleración por hardware */
    padding: 0 20px; /* Margen para que no toque los bordes en móvil */
}

@keyframes pulse-glow {
    0% { text-shadow: 0 0 10px var(--glow-color); }
    100% { text-shadow: 0 0 30px var(--primary-color), 0 0 50px var(--primary-color); }
}

#start-screen h1 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    line-height: 1.2;
}

#start-screen p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

#start-btn {
    padding: 12px 40px;
    font-size: 1.2rem;
    font-family: inherit;
    font-weight: bold;
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--primary-color);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 0 15px var(--glow-color);
}

#start-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    box-shadow: 0 0 35px var(--primary-color);
    transform: scale(1.05);
}

/* Pantalla Principal */
#main-screen {
    z-index: 10;
    background-color: #000;
}

#cardContent {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
#cardContent img {
    max-width: 100%;
    max-height: 32vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: block;
    margin: 0 auto;
}
#cardContent p {
    font-size: 1.1rem;
    color: white;
    text-align: center;
    font-weight: bold;
    margin: 0;
    padding: 0 4px;
    line-height: 1.5;
    word-break: break-word;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

#canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Ventana Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: rgba(20, 0, 5, 0.85);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    padding: 24px 20px;
    width: 88%;
    max-width: 88%;
    max-height: 82vh;
    /* Scroll interno para que el contenido no se salga */
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    text-align: center;
    box-shadow: 0 0 50px var(--glow-color);
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Scrollbar invisible pero funcional */
    scrollbar-width: none;
}
.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.5);
}

#modal-body {
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 0 15px var(--primary-color);
    font-family: inherit;
}

#modal-body img {
    max-width: 100%;
    /* Imagen más pequeña para que quepa con la frase */
    max-height: 35vh;
    border-radius: 15px;
    box-shadow: 0 0 25px var(--glow-color);
    object-fit: contain;
    display: block;
    margin: 0 auto 16px;
}

/* Overlay para forzar modo horizontal en móviles */
#orientation-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 99999;
    color: white;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
}
#orientation-overlay .orientation-content {
    padding: 20px;
    font-family: 'Courier Prime', monospace;
}
#orientation-overlay svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    animation: rotatePhone 2.5s infinite ease-in-out;
}
@keyframes rotatePhone {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(-90deg); }
    60% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
}

@media screen and (max-width: 900px) and (orientation: portrait) {
    #orientation-overlay {
        display: flex;
    }
}
