:root {
    --shelf-color: #4a332d;
    --bg-color: #2c1e1a;
    --book-width: 60px;
    --book-height: 200px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    font-family: 'Pretendard', sans-serif;
    color: white;
    overflow-x: hidden;
}

header {
    text-align: center;
    padding: 50px 0;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
}

/* 책장 스타일 */
.library-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.shelf {
    background-color: var(--shelf-color);
    height: 20px;
    width: 100%;
    margin-top: -5px;
    border-radius: 2px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 80px;
}

.books-row {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 10px;
    padding: 0 20px;
}

/* 책 스타일 */
.book {
    width: var(--book-width);
    height: var(--book-height);
    cursor: pointer;
    transition: transform 0.3s ease, margin 0.3s ease;
    position: relative;
    transform-origin: bottom;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 3px 5px 5px 3px;
    box-shadow: 3px 0 5px rgba(0, 0, 0, 0.3);
    writing-mode: vertical-rl;
    padding: 10px 0;
    font-weight: bold;
    font-size: 0.9rem;
    user-select: none;
}

.book:hover {
    transform: scale(1.1) translateY(-10px);
    z-index: 10;
}

/* 책마다 다른 색상 (샘플) */
.book-1 {
    background-color: #8b0000;
    height: 180px;
}

.book-2 {
    background-color: #2f4f4f;
    height: 210px;
}

.book-3 {
    background-color: #b8860b;
    height: 190px;
}

.book-4 {
    background-color: #483d8b;
    height: 205px;
}

.book-5 {
    background-color: #556b2f;
    height: 175px;
}

/* Iframe 오버레이 (화면 전환 효과) */
#viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    display: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#viewer-overlay.active {
    display: block;
    opacity: 1;
}

.viewer-header {
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: #1a1a1a;
}

.close-btn {
    background: #e74c3c;
    border: none;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}

iframe {
    width: 100%;
    height: calc(100% - 50px);
    border: none;
    background: white;
}

/* 로딩 애니메이션 */
.loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}