:root {
    --book-bg: #2e0d0d;
    --parchment: #f2e8c9;
    --gold: #d4af37;
    --shadow: rgba(0, 0, 0, 0.8);
    
    /* 기본 사이즈 (PC 기준) */
    --book-w: 350px;
    --book-h: 550px;
    --shift-x: 175px;
}

/* 모바일 환경 최적화 */
@media (max-width: 600px) {
    :root {
        --book-w: 90vw;
        --book-h: 70vh;
        --shift-x: 0px;
    }
    .parchment-text { font-size: 1.2rem !important; }
    #final-answer { font-size: 2rem !important; }
    .info-section { padding: 30px 20px !important; }
    .container { padding: 20px; width: 95%; }
    label { font-size: 1rem; }
    input[type="text"], input[type="email"], textarea { padding: 10px; font-size: 0.9rem; }
    button { padding: 10px 15px; font-size: 1rem; }
}

body, html {
    margin: 0; padding: 0; width: 100%; min-height: 100%;
    background-color: #050505;
    overflow-x: hidden; /* 가로 스크롤 방지 */
    font-family: 'Crimson Pro', serif;
    color: #f2e8c9;
}

.magic-background {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, #1a0f2e 0%, #000 100%);
    z-index: -1;
}

/* 첫 화면: 책이 있는 공간 (100vh 유지) */
.scene {
    perspective: 2000px;
    width: 100%; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    position: relative;
}

.book {
    width: var(--book-w);
    height: var(--book-h);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 30px 60px var(--shadow);
}

.book.open {
    transform: translateX(var(--shift-x));
}

.cover, .page-right {
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    border-radius: 5px 15px 15px 5px;
    transform-origin: left;
    transition: transform 2.5s ease-in-out;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.cover {
    z-index: 10;
    background: linear-gradient(135deg, #4a0e0e 0%, #2e0d0d 100%);
    border: 3px solid var(--gold);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    cursor: pointer;
}

.cover-title {
    font-family: 'Uncial Antiqua', cursive;
    color: var(--gold);
    font-size: 1.8rem; text-align: center;
    padding: 20px; text-shadow: 2px 2px 4px black;
}

.cover-inside {
    position: absolute; width: 100%; height: 100%;
    background: linear-gradient(to right, #e0d5b8, var(--parchment));
    transform: rotateY(180deg);
    padding: 30px; box-sizing: border-box;
    border-radius: 15px 5px 5px 15px;
    display: flex; align-items: center; justify-content: center;
    border-right: 2px solid rgba(0,0,0,0.1);
    backface-visibility: hidden;
}

.page-right {
    z-index: 1;
    background: linear-gradient(to left, #e0d5b8, var(--parchment));
    padding: 40px; box-sizing: border-box;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    box-shadow: inset 10px 0 30px rgba(0,0,0,0.2);
}

.parchment-text {
    font-size: 1.4rem; line-height: 1.6; color: #3d2b1f; text-align: center;
    font-style: italic; font-weight: 700; word-break: keep-all;
}

.next-btn {
    position: absolute; bottom: 25px; right: 25px;
    background: none; border: none; font-family: 'Cinzel', serif;
    color: #3d2b1f; font-size: 1rem; cursor: pointer; display: none;
    font-weight: bold;
}

#final-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 100; display: none; justify-content: center; align-items: center;
    flex-direction: column; background: radial-gradient(circle, #1a0f2e 0%, #000 100%);
    padding: 30px; box-sizing: border-box;
}

#final-answer {
    font-family: 'Uncial Antiqua', cursive;
    font-size: 2.5rem; color: var(--gold);
    text-align: center; text-shadow: 0 0 20px var(--gold);
    line-height: 1.4; word-break: keep-all;
}

.retry-btn {
    margin-top: 50px; padding: 12px 30px;
    background: transparent; border: 1px solid var(--gold);
    color: var(--gold); font-family: 'Cinzel', serif; cursor: pointer;
    font-size: 1rem;
}

@keyframes magicFlash {
    0% { background: white; opacity: 0; }
    50% { opacity: 1; }
    100% { background: transparent; opacity: 0; }
}
.flash { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 200; pointer-events: none; }

/* SEO 및 AdSense를 위한 콘텐츠 섹션 */
.info-section {
    position: relative;
    background: rgba(10, 5, 10, 0.95);
    color: #dcdcdc;
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    border-top: 1px solid var(--gold);
}

.info-section h1, .info-section h2 {
    font-family: 'Uncial Antiqua', cursive;
    color: var(--gold);
    margin-bottom: 20px;
}

.info-section p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

footer {
    background: #000;
    padding: 40px 20px;
    text-align: center;
    border-top: 1px solid #333;
    font-family: 'Crimson Pro', serif;
}

footer a {
    color: var(--gold);
    text-decoration: none;
    margin: 0 15px;
    font-size: 0.9rem;
}

footer a:hover { text-decoration: underline; }
footer .copyright { margin-top: 20px; color: #666; font-size: 0.8rem; }

/* contact.html styles */
.container {
    background-color: var(--book-bg);
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 20px var(--shadow);
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-sizing: border-box;
}

h1 {
    font-family: 'Uncial Antiqua', cursive;
    color: var(--gold);
    font-size: 2rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px black;
}

form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-size: 1.1rem;
    color: var(--parchment);
    text-align: left;
    margin-bottom: 5px;
    display: block;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gold);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--parchment);
    border-radius: 5px;
    box-sizing: border-box;
    font-family: 'Crimson Pro', serif;
    font-size: 1rem;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

button {
    background-color: var(--gold);
    color: var(--book-bg);
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #e0c266; /* Slightly lighter gold */
    transform: translateY(-2px);
}

/* privacy.html styles */
.privacy-container {
    max-width: 800px;
    background: rgba(46, 13, 13, 0.9);
    padding: 40px;
    border: 1px solid #d4af37;
    border-radius: 10px;
}
.privacy-container h1 { color: #d4af37; border-bottom: 1px solid #d4af37; padding-bottom: 10px; }
.privacy-container h2 { color: #d4af37; margin-top: 30px; }
.privacy-container a { color: #d4af37; text-decoration: none; }
.privacy-container a:hover { text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 20px; }
