/* --- Color Palette & Fonts --- */
:root {
    --bg-color: #1a101f;
    --primary-purple: #4e2a84;
    --secondary-purple: #3b1e63;
    --accent-color: #d1b3ff;
    --text-color: #e9e4f0;
    --border-color: #6a4a9c;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    overflow: hidden; /* Hide scrollbars during intro */
}

/* --- Bomb Intro Animation --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeOutOverlay 1s ease-in 3.5s forwards;
}

.bomb {
    position: relative;
    width: 100px;
    height: 100px;
}

.bomb-body {
    width: 100%;
    height: 100%;
    background-color: #333;
    border-radius: 50%;
    border: 5px solid #222;
}

.fuse {
    position: absolute;
    width: 5px;
    height: 40px;
    background-color: #a88f78;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.fuse::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: 15px;
    height: 15px;
    background-color: orange;
    border-radius: 50%;
    box-shadow: 0 0 15px 5px yellow;
    animation: burnFuse 2.5s linear forwards;
}

/* Keyframe Animations */
@keyframes burnFuse {
    0% { top: -5px; }
    100% { top: 30px; height: 0; }
}

@keyframes fadeOutOverlay {
    0% { opacity: 1; }
    50% { background-color: #fff; } /* Explosion Flash */
    100% { opacity: 0; pointer-events: none; }
}

/* --- Main Content Styling --- */
#main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    opacity: 0;
    animation: fadeInContent 1s ease-in 4s forwards;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 4rem;
    color: var(--accent-color);
    margin: 0;
}

/* Image Wrapper for positioning the countdown */
.image-wrapper {
    position: relative; /* Needed for absolute positioning of countdown */
    width: 450px; /* Match image width */
    height: 600px; /* Match image height */
    margin: 2rem auto; /* Center the wrapper */
    display: block; /* Ensure it takes up space */
}

/* Main Image Styling */
.main-image {
    display: block;
    width: 100%; /* Fill wrapper */
    height: 100%; /* Fill wrapper */
    object-fit: contain;
    object-position: center;
    border-radius: 10px;
    border: 3px solid var(--border-color);
    box-shadow: 0 0 20px var(--primary-purple);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, box-shadow 0.3s ease-in-out, filter 0.5s ease-in-out;
    filter: brightness(100%) saturate(100%);
    cursor: url(round-bomb-burning-wick-flat-600nw-2565159925-removebg-preview_2_20x20.png) 16 16, help;
}

.main-image:hover {
    box-shadow: 0 0 30px var(--accent-color);
    transform: scale(1.02);
}

/* CSS for the "Bomb Effect" transition (fade-out part) */
.main-image.fade-out {
    opacity: 0;
    transform: scale(0.8);
    filter: brightness(200%) saturate(200%); /* Flash effect */
}

/* Countdown Overlay Styling */
#countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Semi-transparent dark background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10; /* Above the image */
    opacity: 0; /* Hidden by default */
    pointer-events: none; /* Allow clicks to pass through when hidden */
    transition: opacity 0.3s ease-in-out;
}

#countdown-overlay.active {
    opacity: 1;
    pointer-events: auto; /* Enable pointer events when active */
}

#countdown-text {
    font-size: 8em; /* Large text for countdown */
    font-weight: bold;
    color: var(--accent-color); /* Bright color */
    text-shadow: 0 0 15px var(--primary-purple);
    opacity: 0; /* Hidden by default, animated in */
}

/* Countdown Number Animation (3, 2, 1) */
@keyframes countdownNumber {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1.5); }
}

.countdown-number-anim {
    animation: countdownNumber 1s ease-out forwards; /* SLOWED DOWN from 0.9s to 1s */
}

/* Bomb Text Animation */
@keyframes bombText {
    0% { opacity: 0; transform: scale(0.5); filter: brightness(100%); }
    25% { opacity: 1; transform: scale(1.5); filter: brightness(200%); }
    50% { opacity: 1; transform: scale(1.4); filter: brightness(150%); }
    75% { opacity: 1; transform: scale(1.5); filter: brightness(200%); }
    100% { opacity: 0; transform: scale(2); filter: brightness(100%); }
}

.bomb-text-anim {
    animation: bombText 1.2s ease-out forwards; /* SLOWED DOWN from 1s to 1.2s */
}


section {
    margin-bottom: 2.5rem;
}

h2 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Appearance Table */
.appearance-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--secondary-purple);
}

.appearance-table th, .appearance-table td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

.appearance-table th {
    background-color: var(--primary-purple);
    color: var(--accent-color);
}

/* Abilities Frame */
.frame {
    background-color: var(--secondary-purple);
    border: 2px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
}

/* Trivia List */
#trivia ul {
    list-style-type: '💣'; /* Bomb emoji as bullet point */
    padding-left: 2rem;
}

#trivia li {
    padding-left: 1rem;
    margin-bottom: 0.8rem;
}

/* New: Appearances Section Styling */
#appearances .frame ul {
    list-style-type: disc; /* Default disc for nested lists */
    padding-left: 1.5rem;
}

#appearances .frame ul ul { /* For the nested list of notable chapters */
    list-style-type: circle;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

#appearances .frame h3 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.5rem;
}

/* Final animation to reveal content and scrollbar */
@keyframes fadeInContent {
    to {
        opacity: 1;
        /* Add this to a separate animation if needed, but this is simpler */
        animation: allowScroll 0.1s 0.1s forwards;
    }
}

@keyframes allowScroll {
    to {
        overflow: auto;
    }
}

/* Apply the scroll animation to the body after the intro */
body {
    animation: allowScroll 0.1s 4s forwards;
}