@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Camada 1: Cenário Espacial Limpo (Espaço, Marte, Terra) */
.title-screen__scene {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image: url('../assets/references/no-signal-scene-original.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
}

/* Resolução 2x para Telas de Alta Densidade / Retina */
@media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
    .title-screen__scene {
        background-image: url('../assets/references/no-signal-scene-master-2x.jpeg');
    }
}

/* Variante Mobile da Scene Limpa (Telas Estreitas Portrait <= 600px) */
@media (max-width: 600px) and (orientation: portrait) {
    .title-screen__scene {
        background-image: url('../assets/references/no-signal-scene-mobile.jpg');
        background-position: center center;
    }
}

/* Camada 2: Overlay com Animação Discreta de Estrelas (Starfield Overlay) */
.starfield-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.25;
    background-image: 
        radial-gradient(1px 1px at 15% 20%, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 35% 12%, #f8c070, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 25% 45%, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 10% 75%, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 42% 85%, #f8c070, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 30% 90%, #ffffff, rgba(0,0,0,0));
    animation: starTwinkle 4s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
    0% { opacity: 0.15; }
    50% { opacity: 0.4; }
    100% { opacity: 0.25; }
}

/* Camada 3 e 4: Painel Fixo da Marca e Menu Principal (Sempre ancorados e proporcionais) */
.title-screen__nav-panel {
    position: absolute;
    top: 50%;
    left: clamp(24px, 4.5vw, 60px);
    transform: translateY(-50%);
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    z-index: 10;
    pointer-events: auto;
}

/* Camada 3: Logotipo Independente com Transparência Alpha */
.title-screen__brand {
    width: 100%;
    z-index: 5;
    pointer-events: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.title-screen__logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 190px;
    display: block;
    object-fit: contain;
    object-position: center bottom;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    filter: drop-shadow(0 0 16px rgba(227, 154, 62, 0.45));
}

/* Camada 4: Conteúdo Interativo (Menu Principal) */
.title-screen__content {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* Área do Menu Principal (Alinhada perfeitamente com a barra da logo) */
.title-screen__menu {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Botões HTML Reais em Pixel Art Placa Sci-Fi
   Agora transparentes (fundo vazio, sem preenchimento retangular) como os
   botões da tela da caverna — mantém a identidade laranja existente:
   borda e texto usam a mesma cor (#A6511F), realçando em --mars-light
   no hover/seleção. */
.menu-btn {
    position: relative;
    width: 100%;
    height: 44px;
    background: transparent;
    border: 2px solid #A6511F;
    outline: none;
    color: #A6511F;
    font-family: var(--font-pixel);
    font-size: 13px;
    letter-spacing: 1px;
    text-align: left;
    padding-left: 16px;
    cursor: pointer;
    text-shadow: 2px 2px 0px #1a0507;
    transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.1s ease, transform 0.05s ease;
    clip-path: polygon(
        0px 0px, 
        calc(100% - 8px) 0px, 
        100% 8px, 
        100% 100%, 
        0px 100%
    );
}

/* Detalhe de linha de brilho no topo do botão */
.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 8px;
    height: 2px;
    background: #c95c2e;
    pointer-events: none;
}

/* Estado de Hover, Focus e Selecionado.
   O destaque vem de :hover (só enquanto o mouse está em cima) ou da classe
   .is-selected gerenciada por JS (navegação por teclado / foco) — sem
   :focus-visible para o destaque não "grudar" após interação com o mouse. */
.menu-btn:hover,
.menu-btn.is-selected {
    background: transparent;
    color: var(--mars-light);
    border-color: var(--mars-light);
    text-shadow: 2px 2px 0px #1a0507, 0 0 4px rgba(237, 135, 51, 0.6);
    box-shadow: 0 0 10px rgba(216, 90, 34, 0.4);
}

.menu-btn:hover::before,
.menu-btn.is-selected::before {
    background: #ed8733;
}

/* Estado de Clique (Active) */
.menu-btn:active {
    transform: translateY(2px);
    background: transparent;
    box-shadow: 0px 1px 0px #150507;
}

/* Foco Visível Personalizado Pixel-Art */
.menu-btn:focus-visible {
    outline: 2px dashed var(--mars-light);
    outline-offset: 3px;
}

/* Rodapé com Versão / Status no Canto Inferior Esquerdo */
.title-screen__footer {
    position: absolute;
    bottom: 12px;
    left: 4.1%;
    font-size: 8px;
    color: rgba(243, 193, 125, 0.5);
    letter-spacing: 0.5px;
    font-family: var(--font-pixel);
    pointer-events: none;
}

/* Toast de Feedback Temporário */
.title-toast {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(35, 10, 13, 0.95);
    border: 2px solid var(--mars-orange);
    color: var(--text-cream);
    padding: 10px 20px;
    font-size: 10px;
    font-family: var(--font-pixel);
    box-shadow: 0 0 15px rgba(216, 90, 34, 0.4);
    z-index: 100;
    animation: toastFadeIn 0.3s ease, toastFadeOut 0.3s ease 2.7s forwards;
    pointer-events: none;
}

@keyframes toastFadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

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

/* Adaptativo para Telas de Celular (Responsividade Mobile <= 600px em portrait) */
@media (max-width: 600px) and (orientation: portrait) {
    .title-screen__nav-panel {
        top: 45%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 290px;
        align-items: center;
        gap: 14px;
    }

    .title-screen__logo {
        object-position: center;
    }

    .menu-btn {
        height: 42px;
        font-size: 11px;
        text-align: center;
        padding-left: 0;
    }

    .title-screen__footer {
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 7px;
        white-space: nowrap;
    }
}
