/* Title Screen Styles */
.title-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0f1f 50%, #2a1030 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 19000;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.title-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    text-align: center;
}

.title-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    animation: titleFadeIn 2s ease-in-out;
    z-index: 1;
}

.title-logo {
    position: relative;
    z-index: 15;
    max-width: 80%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transform: translateY(100px) scale(0.8);
    animation: logoAppear 3s ease-out forwards;
    filter: drop-shadow(0 0 30px rgba(200, 120, 160, 0.25));
}

.title-prompt {
    color: var(--text-purple-warm-light);
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(200, 120, 160, 0.6);
    animation:
        promptAppear 0.8s ease-out 3.5s forwards,
        promptPulse 2s ease-in-out 4.3s infinite;
    letter-spacing: 2px;
    margin-top: 30px;
    position: relative;
    z-index: 10;
    opacity: 0;
}

/* Art Deco Footer */
.title-footer-deco {
    --deco-color: #3a2a28;
    --deco-diamond: #5a4a45;

    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    opacity: 0;
    animation: footerFadeIn 1s ease-out 4s forwards;
}

.title-footer-deco .footer-bottom-line {
    width: 2px;
    height: 20px;
    background: var(--deco-color);
    margin-top: 8px;
}

.title-footer-deco .footer-bottom-diamond {
    width: 8px;
    height: 8px;
    background: var(--deco-diamond);
    transform: rotate(45deg);
    margin-top: 4px;
}

.title-footer-deco .footer-diamond-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-footer-deco .footer-line {
    width: 60px;
    height: 2px;
    background: var(--deco-color);
}

.title-footer-deco .footer-diamond-small {
    width: 10px;
    height: 10px;
    border: 2px solid var(--deco-diamond);
    transform: rotate(45deg);
    background: rgba(10, 6, 8, 0.8);
}

.title-footer-deco .footer-diamond-center {
    width: 16px;
    height: 16px;
    border: 2px solid var(--deco-color);
    transform: rotate(45deg);
    background: rgba(10, 6, 8, 0.8);
    box-shadow: inset 0 0 4px rgba(90, 74, 69, 0.5);
}

@keyframes footerFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* Animations */
@keyframes titleFadeIn {
    0% {
        opacity: 0;
        transform: translate3d(0, -50px, 0) scale3d(0.9, 0.9, 1);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
    }
}

@keyframes logoAppear {
    0% {
        opacity: 0;
        transform: translate3d(0, 100px, 0) scale3d(0.8, 0.8, 1) rotateY(-15deg);
    }
    50% {
        opacity: 1;
        transform: translate3d(0, -10px, 0) scale3d(1.05, 1.05, 1) rotateY(5deg);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale3d(1, 1, 1) rotateY(0deg);
    }
}

@keyframes promptAppear {
    0% {
        opacity: 0;
        transform: translate3d(0, 20px, 0) scale3d(0.9, 0.9, 1);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
    }
}

@keyframes promptPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale3d(1, 1, 1);
    }
    50% {
        opacity: 1;
        transform: scale3d(1.05, 1.05, 1);
    }
}

.gamepad-button {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border: 2px solid #2d6b2f;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    line-height: 28px;
    text-align: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
    vertical-align: middle;
    margin: 0 4px;
}

/* Hide title by default */
.title-overlay:not(.active) {
    display: none;
}

.title-overlay.active {
    display: flex;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .title-logo {
        max-width: 75%;
        max-height: 50%;
    }
    
    .title-prompt {
        font-size: 20px;
        margin-top: 20px;
    }
}

@media (max-height: 600px) {
    .title-logo {
        max-width: 70%;
        max-height: 45%;
    }
    
    .title-prompt {
        font-size: 18px;
        margin-top: 15px;
    }
}
