/* Detail Page Specific Styles */
body {
    background-color: #030303;
}

/* Hero Section */
.detail-hero {
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center 20%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 80%, #030303 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
}

/* Main Container */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-accent);
}

/* Glass Panels */
.glass-panel {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.story-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--color-accent);
}

.story-section p {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

/* Lore Section */
.lore-section {
    margin-bottom: 5rem;
}

.lore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.lore-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.lore-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

.lore-image {
    height: 250px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0a0a0a;
}

.lore-info {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-grow: 1;
    text-align: center;
}

.lore-info h3 {
    color: var(--color-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.lore-info p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Characters Grid */
.characters-section {
    margin-bottom: 5rem;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.char-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.char-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

.char-image {
    height: 400px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    background-color: #0a0a0a;
}

.char-image-contain {
    /* For images that might get cut off too much or have transparent bg */
    background-size: contain;
    background-position: center bottom;
}

.char-info {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-grow: 1;
    text-align: center;
}

.char-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.char-magic {
    display: block;
    color: var(--color-accent);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.char-info p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* CG Gallery */
.gallery-section {
    margin-bottom: 5rem;
}

.cg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.cg-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: zoom-in;
    aspect-ratio: 16/9;
}

.cg-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    filter: brightness(0.8);
}

.cg-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Support Section */
.donation-section .text-center {
    text-align: center;
}

.donation-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.donation-section p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 800px;
    margin: 0 auto 2.5rem;
}

.paypal-btn {
    background: #0070ba;
    color: white;
    border: none;
    display: inline-flex;
    gap: 10px;
}

.paypal-btn:hover {
    background: #003087;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 112, 186, 0.5);
}

.paypal-icon {
    width: 24px;
    height: 24px;
}

.thank-you-msg {
    margin-top: 2rem !important;
    font-size: 0.95rem !important;
    font-style: italic;
    color: var(--color-accent) !important;
}

/* Animations Overrides for detail page */
.slide-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.slide-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Download Section */
.game-download-section {
    margin-bottom: 3rem;
    margin-top: -3rem;
    /* Pull up slightly over the hero section */
    position: relative;
    z-index: 20;
}

.download-panel {
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(15, 15, 15, 0.8) 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 3rem;
}

.download-panel h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.download-btn {
    background: linear-gradient(45deg, #7e22ce, #a855f7);
    color: white;
    border: none;
    display: inline-flex;
    gap: 12px;
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px -5px rgba(126, 34, 206, 0.5);
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 30px -5px rgba(168, 85, 247, 0.6);
}

.download-icon {
    width: 24px;
    height: 24px;
}

.itch-embed-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    overflow-x: auto;
    border-radius: 12px;
}

.itch-embed-container iframe {
    max-width: 100%;
}

/* Mystery Characters */
.mystery-card {
    border-color: rgba(168, 85, 247, 0.2);
    position: relative;
}

.mystery-card::before {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 5;
}

.mystery-image {
    filter: brightness(0.4) contrast(1.2) sepia(0.5) hue-rotate(240deg);
    transition: filter 0.5s;
}

.mystery-card:hover .mystery-image {
    filter: brightness(0.7) contrast(1.1) sepia(0.3) hue-rotate(240deg);
}

.mystery-name {
    color: #a855f7 !important;
    letter-spacing: 2px;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.lightbox.active .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1001;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #a855f7;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-actions {
    margin-top: 20px;
}

.lightbox-actions .download-btn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem; /* slightly smaller titles */
    }

    .cg-grid {
        grid-template-columns: 1fr;
    }

    .glass-panel {
        padding: 2rem 1.5rem;
    }

    .game-download-section {
        margin-top: -2rem;
    }

    .download-panel {
        padding: 2rem 1rem;
    }

    .download-btn {
        font-size: 1rem;
        padding: 1rem 1.5rem;
        width: 100%; /* full width button on mobile */
        justify-content: center;
    }

    .detail-container {
        padding: 1rem;
    }

    /* Char Cards specifically need adjusting on very small screens */
    .char-image {
        height: 300px;
    }

    .lore-image {
        height: 200px;
    }
}