* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f8fafc 100%);
    font-family: 'Georgia', serif;
    overflow: hidden;
}

.book-container {
    perspective: 2000px;
    width: 90vw;
    max-width: 1200px;
    position: relative;
    aspect-ratio: 2 / 1.414;
}

.book {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.book.open {
    transform: translate(-25%, -50%);
}

.book.closed-end {
    transform: translate(0%, -50%);
}

.page {
    position: absolute;
    left: 25%;
    width: 50%;
    height: 100%;
    background: white;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition: transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    aspect-ratio: 1 / 1.414;
}

.page:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

.page-content {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

.page-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-back {
    transform: rotateY(180deg);
}

.page.flipped {
    transform: rotateY(-180deg);
    box-shadow: -5px 10px 30px rgba(0,0,0,0.2);
}

.cover {
    background: linear-gradient(135deg, #2d3561 0%, #1a1f3a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: clamp(24px, 4vw, 32px);
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.back-cover {
    background: linear-gradient(135deg, #1a1f3a 0%, #2d3561 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: clamp(18px, 3vw, 24px);
}

.page-number {
    position: absolute;
    bottom: 3%;
    font-size: clamp(12px, 2vw, 14px);
    color: #666;
}

.page-number.left {
    left: 5%;
}

.page-number.right {
    right: 5%;
}

.placeholder-text {
    color: #999;
    font-size: clamp(14px, 2.5vw, 18px);
    text-align: center;
}

/* Áreas táctiles invisibles - DENTRO del libro */
.touch-area {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    z-index: 1000;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.touch-area:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.touch-left {
    left: -25%;
}

.touch-right {
    left: 25%;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .book-container {
        width: 95vw;
    }
    
    .cover div:last-child {
        font-size: clamp(14px, 3vw, 18px);
    }
}

@media (max-width: 480px) {
    .book-container {
        width: 98vw;
    }
}