/* Reset & General */
html,
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #1a001a;
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    scroll-behavior: smooth;
    height: 100%;
}

body.no-scroll {
    overflow: hidden;
}

/* Start Screen */
#start-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom, #1a001a, #000), url('../noise.gif') repeat;
    background-blend-mode: overlay;
    background-size: cover;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease;
}

.start-overlay {
    text-align: center;
    padding: 40px;
    animation: fadeIn 1s ease forwards;
    width: 90%;
    max-width: 800px;
}

#start-screen h1 {
    color: crimson;
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px crimson;
    line-height: 1.5;
}

#start-button {
    background: transparent;
    border: 1px solid crimson;
    border-radius: 5px;
    color: #fff;
    font-size: 1.1rem;
    padding: 12px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#start-button:hover {
    background: crimson;
    color: #000;
    box-shadow: 0 0 25px crimson;
    transform: scale(1.05);
}

/* Video Intro */
#intro-video-container {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

#intro-video-container.active {
    opacity: 1;
    pointer-events: auto;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#skip-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 950;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#skip-button:hover {
    background: crimson;
    border-color: crimson;
    transform: scale(1.05);
}

/* Phrases Screen */
#phrase-screen {
    position: fixed;
    inset: 0;
    background: #1a001a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 850;
    opacity: 0;
    pointer-events: none;
    transition: opacity 2s ease;
}

#phrase-screen.active {
    opacity: 1;
    pointer-events: auto;
}

.phrase {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin: 20px;
    color: crimson;
    opacity: 0;
    text-align: center;
    font-family: 'Cinzel', serif;
    /* Assuming Cinzel is available or falls back */
    text-shadow: 0 0 15px rgba(220, 20, 60, 0.6);
}

.phrase.visible {
    animation: fadeInPhrase 2s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInPhrase {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Main Content */
#main-content {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

#main-content.visible {
    display: flex;
    animation: fadeInPage 2s ease forwards;
}

@keyframes fadeInPage {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Hero Section */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background: url('../intro-image.png') no-repeat center center;
    background-size: cover;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Align logo to bottom area */
    align-items: center;
    padding-bottom: 5vh;
}

#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(26, 0, 26, 0.8) 80%, #1a001a 100%);
    z-index: 1;
}

#logo {
    position: relative;
    z-index: 2;
    max-width: 400px;
    width: 80%;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px rgba(220, 20, 60, 0.3));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

/* Navigation */
#main-nav {
    position: sticky;
    top: 0;
    width: 100%;
    background: rgba(10, 0, 10, 0.95);
    z-index: 100;
    border-bottom: 1px solid rgba(220, 20, 60, 0.4);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

#main-nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 2rem;
}

#main-nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#main-nav a:hover,
#main-nav a.active {
    color: crimson;
    text-shadow: 0 0 10px crimson;
    border-bottom-color: crimson;
}

/* Content Sections */
.content-section {
    display: none;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: 60vh;
}

.content-section.active {
    display: block;
    animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section h2 {
    color: crimson;
    font-size: 3rem;
    text-align: center;
    border-bottom: 1px solid rgba(220, 20, 60, 0.5);
    padding-bottom: 1rem;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: 'Cinzel', serif;
}

.content-section p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ddd;
    text-align: justify;
}

/* Character Grid & Transformation */
.character-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.char-card {
    position: relative;
    width: 300px;
    height: 450px;
    /* Fixed height for stability */
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: radial-gradient(circle at center, rgba(60, 20, 60, 0.4), rgba(10, 0, 10, 0.9));
    border: 1px solid rgba(220, 20, 60, 0.2);
}

.char-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.char-card img {
    width: 100%;
    height: 100%;
    /* Full card height */
    object-fit: contain;
    object-position: center bottom;
    transition: transform 0.5s ease;
}

.char-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* padding handles spacing */
    padding: 1.5rem;
    padding-top: 4rem;
    /* More space for gradient */
    text-align: center;
    box-sizing: border-box;
    /* Maintain width */
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
}

.char-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: #fff;
}

.char-info p {
    margin: 0;
    text-align: center;
    /* Override default justify */
}

/* Subsection Title */
.subsection-title {
    width: 100%;
    text-align: center;
    color: #999;
    font-size: 1.5rem;
    margin: 2rem 0;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Main Grid centering - Removed obsolete */
/* .character-grid.main-grid { margin-bottom: 4rem; } */

/* Card Video */
.card-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    /* Soft edges for video to blend */
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
    mask-image: radial-gradient(circle at center, black 40%, transparent 95%);
}

/* --- INICIO: Shadow Vision --- */
.intro-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.slime-button {
    background: transparent;
    border: 2px solid #8a2be2;
    color: #8a2be2;
    padding: 10px 20px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

.slime-button:hover,
.slime-button.active {
    background: #8a2be2;
    color: white;
    box-shadow: 0 0 25px #8a2be2;
}

.slime-core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0%;
    height: 0%;
    background: radial-gradient(circle, #fff, #8a2be2);
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.5s ease;
}

.slime-button.active .slime-core {
    width: 200%;
    height: 200%;
    opacity: 0.2;
}

#text-container {
    position: relative;
    min-height: 200px;
    margin-top: 2rem;
    border-left: 3px solid #444;
    /* Default border */
    padding-left: 20px;
    transition: border-color 0.5s;
}

#text-container.mode-shadow {
    border-left-color: #8a2be2;
}

.text-layer {
    transition: opacity 0.5s, filter 0.5s;
}

.public-text {
    display: block;
    opacity: 1;
}

.shadow-text {
    display: none;
    color: #d8bfd8;
    /* Thistle/Pale Violet */
    text-shadow: 0 0 5px #8a2be2;
}

#text-container.mode-shadow .public-text {
    display: none;
}

#text-container.mode-shadow .shadow-text {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

#wisdom-container {
    margin-top: 4rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

#shadow-quote {
    font-size: 1.4rem;
    font-style: italic;
    color: #bbb;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: color 0.3s;
}

#shadow-quote.active {
    color: #8a2be2;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
    animation: fadeInPhrase 0.5s ease;
}

#quote-btn {
    background: #333;
    border: 1px solid #555;
    color: #ddd;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s;
}

#quote-btn:hover {
    background: #000;
    border-color: #8a2be2;
    color: #8a2be2;
}

/* Ensure content is above video */
/* Merged .char-info above */

/* Cid Specific (Mob Mode) */
#cid-card {
    border-color: #555;
    background: rgba(50, 50, 50, 0.2);
}

#cid-card h3 {
    color: #ccc;
    font-family: 'Segoe UI', sans-serif;
    /* Boring font */
}

/* Shadow Specific (Mastermind Mode) */
#shadow-card {
    display: none;
    /* Hidden by default */
    border-color: #8a2be2;
    /* Violet */
    background: #0a000a;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.4);
}

#shadow-card.revealed {
    display: block;
    animation: glitchReveal 0.5s ease forwards;
}

#shadow-card h3 {
    color: #be29ec;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 10px #be29ec;
}

#shadow-card p {
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Transformation Video Overlay */
#transformation-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    /* Above everything */
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
}

#transformation-overlay.active {
    display: flex;
}

#trans-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Glitch Animation */
@keyframes glitchReveal {
    0% {
        transform: translate(0);
        opacity: 0;
        filter: hue-rotate(0deg);
    }

    20% {
        transform: translate(-5px, 5px);
        opacity: 1;
        filter: hue-rotate(90deg);
    }

    40% {
        transform: translate(5px, -5px);
        filter: hue-rotate(-90deg);
    }

    60% {
        transform: translate(-5px, 0);
        filter: invert(1);
    }

    80% {
        transform: translate(5px, 0);
        filter: none;
    }

    100% {
        transform: translate(0);
        opacity: 1;
    }
}

/* --- SHADOW GARDEN SECTION --- */
#shadow-garden {
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    background: #050005;
    /* Deep dark violet */
    z-index: 1;
    z-index: 1;
    /* display: block; - Removed to allow toggling */
}

#slime-fog {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

.sg-content {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 1rem;
}

.sg-title {
    text-align: center;
    color: #8a2be2;
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}

.motto-container {
    text-align: center;
    margin-bottom: 4rem;
}

.motto-text {
    font-size: 1.5rem;
    color: #ddd;
    letter-spacing: 2px;
    font-style: italic;
    opacity: 0.8;
}

/* Timeline */
.chronicles-container {
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #8a2be2, transparent);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 0 2rem;
    margin-bottom: 3rem;
    box-sizing: border-box;
    opacity: 0.8;
    /* Default visible for now, JS can animate */
    transition: all 0.5s;
}

.timeline-item:hover {
    opacity: 1;
    text-shadow: 0 0 8px rgba(138, 43, 226, 0.3);
}

.timeline-item.left {
    left: 0;
    text-align: right;
    border-right: 2px solid transparent;
    /* Alignment helper */
}

.timeline-item.right {
    left: 50%;
    text-align: left;
    border-left: 2px solid transparent;
}

.timeline-dot {
    position: absolute;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px #8a2be2;
    z-index: 2;
}

.timeline-item.left .timeline-dot {
    right: -6px;
}

.timeline-item.right .timeline-dot {
    left: -6px;
}

.timeline-content h3 {
    color: #be29ec;
    margin-bottom: 0.5rem;
    font-family: 'Cinzel', serif;
}

.timeline-content p {
    color: #ccc;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Mobile Timeline Adjustment */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }

    .timeline-item {
        width: 100%;
        left: 0;
        padding-left: 50px;
        text-align: left;
    }

    .timeline-item.left {
        text-align: left;
    }

    .timeline-item.left .timeline-dot,
    .timeline-item.right .timeline-dot {
        left: 14px;
        /* Align with line at 20px */
        right: auto;
    }
}

footer {
    text-align: center;
    padding: 2rem;
    background: #0a000a;
    color: #666;
    margin-top: 4rem;
    border-top: 1px solid #333;
}

/* --- SECTION VISIBILITY (Tabs) --- */
.content-section {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.content-section.active {
    display: block;
    opacity: 1;
    animation: fadeInSection 0.5s ease forwards;
}

@keyframes fadeInSection {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Base styles for sections */
/* Removed previous .content-section rules if any were purely spacing */
/* Add Padding/Spacing to active section */
.content-section.active {
    padding-top: 80px;
    /* Space for fixed nav */
    padding-bottom: 4rem;
}

/* --- SECRET ARCHIVES (Curiosidades) --- */
.archive-title {
    text-align: center;
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 4px;
    margin-bottom: 3rem;
    border-bottom: 1px solid #444;
    display: inline-block;
    padding-bottom: 1rem;
    left: 50%;
    position: relative;
    transform: translateX(-50%);
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.secret-file {
    background: #111;
    border: 1px solid #333;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.secret-file:hover {
    border-color: #8a2be2;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.2);
}

.secret-file::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8a2be2, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.secret-file:hover::before {
    opacity: 1;
}

.file-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #666;
}

.file-stamp {
    color: #ff3333;
    border: 1px solid #ff3333;
    padding: 2px 6px;
    letter-spacing: 1px;
    transform: rotate(-2deg);
    font-weight: bold;
}

.file-body h3 {
    margin: 0 0 1rem 0;
    color: #ddd;
    font-size: 1.2rem;
}

.encrypted-data {
    font-family: 'Consolas', 'Monaco', monospace;
    color: #888;
    background: #000;
    padding: 1rem;
    border-left: 2px solid #555;
    font-size: 0.9rem;
    min-height: 80px;
}

.encrypted-data.decrypted {
    color: #0f0;
    /* Matrix Green or Violet? Let's go with Terminal Green for data */
    border-color: #0f0;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

.decrypt-btn {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid #8a2be2;
    color: #8a2be2;
    padding: 8px 16px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.decrypt-btn:hover {
    background: rgba(138, 43, 226, 0.1);
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

/* Mobile */
@media (max-width: 768px) {
    #main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .content-section {
        padding: 2rem 1rem;
    }

    .content-section h2 {
        font-size: 2rem;
    }

    .archive-title {
        font-size: 1.5rem;
    }
}

/* --- THE VOID (Hidden Layer) --- */
#void-rune {
    display: inline-block;
    color: #333;
    font-size: 1.5rem;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.5s;
    user-select: none;
}

#void-rune:hover {
    color: #8a2be2;
    text-shadow: 0 0 10px #8a2be2, 0 0 20px #fff;
    transform: scale(1.2);
}

#the-void {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    display: none;
    /* Hidden by default */
    opacity: 0;
    transition: opacity 1s ease;
}

#the-void.active {
    display: block;
    opacity: 1;
}

#atomic-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#void-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
    /* Let clicks pass to canvas */
}

#void-text {
    font-size: 8vw;
    font-family: 'Cinzel', serif;
    color: transparent;
    -webkit-text-stroke: 2px #fff;
    opacity: 0.1;
    transition: all 0.2s;
}

#void-text.atomic-burst {
    color: #fff;
    text-shadow: 0 0 50px #8a2be2, 0 0 100px #fff;
    opacity: 1;
    transform: scale(1.2);
    -webkit-text-stroke: 0;
}

#void-exit {
    margin-top: 5rem;
    background: transparent;
    border: 1px solid #444;
    color: #444;
    padding: 10px 20px;
    cursor: pointer;
    pointer-events: auto;
    /* Clickable */
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    opacity: 0;
    /* Hidden initially */
}

#the-void.active #void-exit {
    opacity: 0;
    animation: fadeInExit 3s ease forwards 2s;
    /* Delay exit button appearance */
}

@keyframes fadeInExit {
    to {
        opacity: 0.5;
    }
}

#void-exit:hover {
    border-color: #fff;
    color: #fff;
    opacity: 1 !important;
}