/* Global Styles */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Lato', sans-serif;
    color: #FFF;
    /* Light text primarily for this theme */
}

/* Main Body Background - Centering */
body {
    margin: 0;
    padding: 0;
    font-family: 'Lato', sans-serif;
    background: url('background.jpg') no-repeat center center fixed;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
    image-rendering: -webkit-optimize-contrast;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    /* For absolute nav */
}

/* --- NAVIGATION (Top Left) --- */
nav {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 0;
    z-index: 100;
    /* Above everything */
    display: flex;
    align-items: center;
}

.logo {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2em;
    font-weight: bold;
    color: #d4af37;
    /* Gold */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

/* --- GLASS CONTAINER (The Frame) --- */
.glass-container {
    width: 800px;
    /* Bigger Frame */
    height: 600px;
    background: rgba(255, 255, 255, 0.15);
    /* More visible glass */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.8);
    /* Stronger Gold Border */
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(212, 175, 55, 0.4),
        /* Outer Glow */
        inset 0 0 20px rgba(255, 255, 255, 0.2);
    /* Inner Gloss */
    position: relative;
    overflow: visible;
    /* Allow 3D elements/UI to pop out if needed */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- 3D CANVAS & UI --- */
#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 20px;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

/* --- UI Elements --- */
#openBtn {
    position: absolute;
    bottom: 15%;
    /* Position at bottom */
    padding: 15px 40px;
    font-size: 20px;
    letter-spacing: 2px;
    z-index: 20;
}

/* Success Overlay */
#success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Dark overlay */
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #d4af37;
    font-family: 'Cinzel Decorative', serif;
}

/* Removed duplicate nav styles */

.success-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
}

.success-content p {
    font-size: 1.5rem;
    color: #f0e6d2;
    margin-bottom: 15px;
}

/* Animations */
.animate-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

.delay-1 {
    animation-delay: 1s;
}

.delay-2 {
    animation-delay: 2.5s;
}

.delay-3 {
    animation-delay: 4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.interactive {
    pointer-events: auto;
    /* Buttons/Inputs must be clickable */
}

.hidden {
    display: none !important;
}

/* Modal Styling */
.modal {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    color: #5D2E2E;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 2px solid #d4af37;
}

#passInput {
    padding: 10px;
    font-size: 16px;
    margin-bottom: 15px;
    width: 200px;
    border: 1px solid #d4af37;
    border-radius: 5px;
    background: #fffdf0;
    text-align: center;
}

/* Note Styling (The Scroll) */
#note {
    position: absolute;
    /* Parchment texture background via CSS */
    background-color: #f4e4bc;
    background-image: url("https://www.transparenttextures.com/patterns/aged-paper.png");
    width: 300px;
    padding: 40px 30px;
    text-align: center;
    color: #4a3b2a;
    font-family: 'Georgia', serif;
    /* Elegant font */

    /* The Scroll Shape */
    border-radius: 2px;
    box-shadow:
        0 0 5px rgba(0, 0, 0, 0.2),
        inset 0 0 50px rgba(160, 100, 50, 0.2);
    /* Inner shadow for aged look */

    border: 4px double #8b5a2b;
    /* Fancy double border */

    /* Animation States */
    opacity: 0;
    transform: translateY(50px) scale(0.8) rotateX(20deg);
    transition: all 1.2s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 20;
}

#note h2 {
    margin-top: 0;
    font-size: 24px;
    font-style: italic;
    border-bottom: 1px solid #8b5a2b;
    padding-bottom: 10px;
    font-family: 'Cinzel Decorative', serif;
    /* Keep brand font for header */
    color: #5D2E2E;
}

#note.visible {
    opacity: 1;
    transform: translateY(-120px) scale(1) rotateX(0deg);
    /* Float up */
}

/* Top and bottom rolls (Scroll effect) */
#note::before,
#note::after {
    content: '';
    position: absolute;
    left: -10px;
    width: calc(100% + 20px);
    height: 20px;
    background: linear-gradient(to bottom, #e6cfa3, #bfa06d);
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

#note::before {
    top: -10px;
}

#note::after {
    bottom: -10px;
}

/* Use the gold-pulse-btn style strictly */
button#mainBtn,
#openBtn,
.gold-pulse-btn {
    background: linear-gradient(90deg, #daa520 0%, #fcf6ba 50%, #daa520 100%);
    background-size: 200% auto;
    color: #3e2222;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
    animation: goldShine 3s infinite linear;
    width: auto;
    height: auto;
    z-index: 1002;
    display: block;
    pointer-events: auto;
}

button#mainBtn:hover,
#openBtn:hover,
.gold-pulse-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.8);
}

/* Override existing video styles */
#box-video,
.jewelry-box,
.artifact-container {
    display: none !important;
}

/* Modal specific tweaks */
.modal-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    z-index: 50;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: rgba(20, 10, 10, 0.95);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid #d4af37;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

/* Artifact Styles - Hide old */
.artifact-container {
    display: none;
}


/* Question Text */
.question-text {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2rem;
    color: #F2D087;
    margin-bottom: 2rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    text-align: center;
}

/* Reset Button */
.reset-link {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ddd;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 15px;
    transition: 0.3s;
}

.reset-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}

/* Button Fixes */
#open-box-btn {
    background: linear-gradient(90deg, #daa520 0%, #fcf6ba 50%, #daa520 100%);
    background-size: 200% auto;
    color: #3e2222;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 16px 48px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: 0.3s;
    margin-top: 20px;
    animation: goldShine 3s infinite linear;

    /* Ensure it is clickable */
    position: relative;
    z-index: 1000;
    /* Super high */
    pointer-events: auto;
}

#open-box-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(218, 165, 32, 0.8);
}

@keyframes goldShine {
    to {
        background-position: 200% center;
    }
}

/* Success Layout - Vertical Column */
.success-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 20px;
    height: 100%;
    width: 100%;
}

.success-column h1 {
    font-family: 'Cinzel Decorative', serif;
    font-size: 2.5rem;
    color: #F2D087;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.success-column p {
    font-family: 'Lato', sans-serif;
    font-size: 1.2rem;
    color: #FFF;
    margin: 0;
    max-width: 600px;
    line-height: 1.6;
}

.gold-btn {
    background: linear-gradient(0deg, #daa520, #fcf6ba);
    border: none;
    padding: 12px 30px;
    border-radius: 30px;
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
    color: #5D2E2E;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.animate-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-1 {
    animation-delay: 0.3s;
}

.delay-2 {
    animation-delay: 0.8s;
}

.delay-3 {
    animation-delay: 1.5s;
}

/* Hint Text - Removed visual "Tap to open", using pulse on lock instead */
.hint-text {
    display: none;
}

/* Password Overlay */
.overlay-glass {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 10, 10, 0.85);
    /* Darker contrast */
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #783434;
    text-align: center;
    z-index: 20;
    min-width: 300px;
}

.password-hint {
    color: #E6CBA3;
    font-family: 'Lato', sans-serif;
    margin-bottom: 15px;
    font-weight: 300;
}

#password-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #5D2E2E;
    padding: 10px;
    color: #FFF;
    border-radius: 4px;
    width: 60%;
    margin-bottom: 15px;
}

#password-submit {
    background: #BF953F;
    color: #2b1111;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    font-family: 'Cinzel Decorative', serif;
    font-weight: bold;
}

#password-error {
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Content Area */
.content-wrapper {
    margin-top: 20px;
    z-index: 5;
    position: absolute;
    bottom: 60px;
    /* Fixed position */
    width: 100%;
    display: flex;
    justify-content: center;
}

.buttons {
    display: flex;
    gap: 20px;
}

.primary-btn,
.secondary-btn {
    padding: 12px 35px;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    font-family: 'Cinzel Decorative', serif;
    transition: 0.3s;
    min-width: 100px;
}

.primary-btn {
    background: linear-gradient(to bottom, #fcf6ba 0%, #bf953f 100%);
    border: 1px solid #aa771c;
    color: #3a1c1c;
    box-shadow: 0 0 15px rgba(191, 149, 63, 0.4);
}

.primary-btn:hover {
    box-shadow: 0 0 25px rgba(191, 149, 63, 0.7);
    transform: scale(1.05);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #888;
    color: #ddd;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Success Screen */
.success-content {
    text-align: center;
    color: #fcf6ba;
}

.success-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    font-family: 'Cinzel Decorative', serif;
    text-shadow: 0 0 20px rgba(191, 149, 63, 0.4);
}

.success-content p {
    font-size: 1.2rem;
    color: #E6CBA3;
    font-weight: 300;
}

/* Utility */
.hidden {
    display: none !important;
}

.visible {
    display: flex !important;
    animation: fadeIn 1s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .glass-container {
        width: 95%;
        height: 80vh;
        padding: 20px;
    }

    .jewelry-box {
        width: 250px;
    }

    .top-nav {
        padding: 20px;
    }

    .nav-links {
        display: none;
        /* Hide links on mobile for simplicity */
    }
}