:root {
    --bg-color: #1a1a1a;
    --text-primary: #f0e6d2; /* parchment text color */
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.5);
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at center, #2a2a2a 0%, #000 100%);
    font-family: 'Playfair Display', serif;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.book-cover {
    width: 90%;
    max-width: 650px;
    height: 85vh;
    max-height: 850px;
    border-radius: 12px 25px 25px 12px;
    box-shadow: 
        inset 5px 0 15px rgba(0,0,0,0.9),
        inset -2px 0 5px rgba(255,255,255,0.1),
        30px 30px 60px rgba(0,0,0,0.9),
        0 0 30px rgba(0,0,0,0.6);
    display: flex;
    position: relative;
    transform: perspective(1500px) rotateY(-8deg); /* Default slight angle */
    transform-origin: left center; /* Necessary for opening effect */
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
    z-index: 10;
    overflow: hidden;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('../img/book_cover_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.15); /* Zooms in to crop any white borders from generated image */
    border-radius: 12px 25px 25px 12px;
    z-index: -1;
}

.book-cover.opening {
    transform: perspective(1500px) rotateY(-80deg) scale(1.1) translateX(-20%);
    opacity: 0;
}

.book-spine {
    width: 7%;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(255,255,255,0.1) 0%, 
        rgba(0,0,0,0.6) 15%, 
        rgba(0,0,0,0.3) 85%, 
        rgba(255,255,255,0.05) 100%);
    border-radius: 12px 0 0 12px;
    border-right: 1px solid rgba(0,0,0,0.7);
    box-shadow: inset -2px 0 5px rgba(0,0,0,0.5);
}

.book-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10% 5%;
    text-align: center;
    position: relative;
}

.hero {
    margin-top: 2%;
    text-shadow: 2px 2px 4px #000;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: var(--gold);
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px var(--gold-glow), 2px 2px 5px rgba(0,0,0,0.9), 0px 5px 15px rgba(0,0,0,0.8);
}

.subtitle {
    font-size: 1.4rem;
    color: #e0d5c1;
    font-weight: 600;
    font-style: italic;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
}

.menu-actions {
    margin-bottom: 5%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 80%;
    max-width: 350px;
}

.cover-button {
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 16px 20px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

.cover-button.primary {
    background: rgba(212, 175, 55, 0.2); 
    border: 2px solid var(--gold);
    color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), inset 0 0 10px rgba(212, 175, 55, 0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.cover-button.primary:hover {
    background: var(--gold);
    color: #1a1a1a;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.8), inset 0 0 20px rgba(255, 255, 255, 0.5);
    transform: translateY(-3px) scale(1.05);
    text-shadow: none;
}

.cover-button.secondary {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #e0d5c1;
    font-size: 1rem;
    letter-spacing: 1px;
}

.cover-button.secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #fff;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255,255,255,0.4);
}

@media (max-width: 600px) {
    .book-cover {
        height: 90vh;
        width: 95%;
        max-width: 100%;
        transform: perspective(1000px) rotateY(-5deg);
    }
    .main-title {
        font-size: 2.5rem;
    }
    .subtitle {
        font-size: 1rem;
    }
    .cover-button {
        font-size: 1rem;
        padding: 12px 15px;
    }
}
