:root {
    --bg-color: #030305;
    --text-color: #ffffff;
    --accent-color: #e0e0e0;
    --font-main: 'Montserrat', sans-serif;
}

* {
    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-main);
    overflow: hidden; /* Evita scroll durante o shake */
    position: relative;
}

/* --- CANVAS & EFEITOS DE FUNDO --- */
#spaceCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#flashOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#flashOverlay.flash {
    opacity: 1;
}

/* --- ANIMAÇÃO DE SHAKE --- */
.shake-effect {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* --- CONTAINER DA INTERFACE --- */
#uiContainer {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.state-panel {
    position: absolute;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease, visibility 1.5s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Esconde scrollbar nativo */
.state-panel::-webkit-scrollbar {
    width: 0px;
}

.state-panel.active {
    opacity: 1;
    visibility: visible;
}

/* Oculta de vez elementos para evitar interação indesejada */
.state-panel.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- ESTADO INICIAL --- */
.star-wars-intro {
    font-size: 2rem;
    color: #4bd5ee;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 40px;
    opacity: 0;
    animation: fadeInIntro 2s ease-in forwards;
    text-align: left;
}

@keyframes fadeInIntro {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.primary-btn {
    background: #FFC107;
    color: #0A0A0A;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 5px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border-radius: 4px;
    font-family: var(--font-main);
    box-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.primary-btn:hover {
    background: #FFE066;
    box-shadow: 0 0 25px rgba(255, 193, 7, 0.6);
    transform: scale(1.05);
}

/* --- ESTADO FINAL --- */
.main-logo {
    max-width: 90%;
    width: 600px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.3));
}

.save-the-date {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    width: 80%;
}

.save-the-date h3 {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 5px;
    color: #aaa;
    margin-bottom: 10px;
}

.save-the-date .date {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: #FFC107;
    text-shadow: 0 0 15px rgba(255, 193, 7, 0.4);
}

.countdown-container {
    margin-bottom: 30px;
}

.countdown-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    color: #aaa;
}

#countdown {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.time-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.03);
    padding: 15px;
    border-radius: 8px;
    min-width: 80px;
    border: 1px solid rgba(255,255,255,0.05);
}

.time-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    color: #FFC107;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.time-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #888;
}

.closing-phrase {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #ccc;
    font-style: italic;
    margin-top: 20px;
}

/* --- NAVEGAÇÃO & VIEWS --- */
.premium-nav {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    width: 100%;
    justify-content: center;
}

.nav-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    font-family: var(--font-main);
    transition: color 0.3s, text-shadow 0.3s;
    opacity: 0.5;
}

.nav-btn.active, .nav-btn:hover {
    color: #FFC107;
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.nav-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
    font-weight: 300;
    user-select: none;
}

.view {
    width: 100%;
    transition: opacity 0.5s ease;
    display: none;
    flex-direction: column;
    align-items: center;
}

.view.active {
    display: flex;
    animation: fadeInIntro 0.5s forwards;
}

/* --- HISTÓRIA (A SAGA) --- */
.history-title {
    font-size: 1.8rem;
    color: #fff;
    letter-spacing: 5px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.history-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    text-align: left;
}

.history-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.history-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 193, 7, 0.3);
}

.card-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Quando o usuário colocar a imagem, ela usará .card-banner img */
.card-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 25px;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.card-logo {
    width: 50px;
    height: 50px;
    background-color: #000;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: #444;
    flex-shrink: 0;
}

.card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.card-header h3 {
    color: #FFC107;
    font-size: 1.5rem;
    letter-spacing: 2px;
}

.card-lore {
    font-size: 0.95rem;
    color: #bbb;
    line-height: 1.6;
}

.card-lore h4 {
    color: #fff;
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.card-lore p {
    margin-bottom: 15px;
}

.read-more-btn {
    margin-top: 15px;
    background: transparent;
    border: 1px solid #FFC107;
    color: #FFC107;
    padding: 8px 15px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.read-more-btn:hover {
    background: #FFC107;
    color: #000;
}

/* --- MODAIS DE LEITURA --- */
.story-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(5px);
}

.story-modal.active {
    opacity: 1;
    visibility: visible;
}

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

.modal-content {
    background: #0d0d0d;
    border: 1px solid rgba(255,193,7,0.3);
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.story-modal.active .modal-content {
    transform: translateY(0);
}

.close-modal-btn {
    position: sticky;
    top: 15px;
    margin-left: auto;
    margin-right: 15px;
    margin-top: 15px;
    margin-bottom: -55px; /* Remove o espaço ocupado pelo botão para a imagem de fundo subir */
    background: #000;
    border: 1px solid #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s, color 0.3s;
    line-height: 1;
}

.close-modal-btn:hover {
    opacity: 1;
    color: #FFC107;
}

.modal-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-body {
    padding: 40px;
}

.modal-body .card-lore {
    font-size: 1.1rem; /* Texto maior para leitura no modal */
}

/* Esconde scrollbar nativo do modal */
.modal-content::-webkit-scrollbar {
    width: 5px;
}
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 193, 7, 0.5);
    border-radius: 5px;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .star-wars-intro {
        font-size: 1.4rem;
        text-align: center;
    }
    .main-logo {
        width: 100%;
        max-width: 350px;
    }
    .save-the-date .date {
        font-size: 1.5rem;
    }
    #countdown {
        gap: 10px;
    }
    .time-block {
        min-width: 60px;
        padding: 10px;
    }
    .time-value {
        font-size: 1.8rem;
    }
    .time-label {
        font-size: 0.7rem;
    }
    .history-grid {
        grid-template-columns: 1fr;
    }
    .premium-nav {
        flex-direction: row;
        gap: 15px;
        font-size: 0.9rem; /* Levemente menor para caber na tela do celular */
    }
}
