@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Inter:wght@400;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #111827;
    color: #e5e7eb;
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

main {
    width: 100%;
    max-width: 800px;
    text-align: center;
}

header h1 {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    color: #c81e1e;
    margin-bottom: 0.5rem;
    letter-spacing: 3px;
}

header p {
    font-size: 1.1rem;
    color: #9ca3af;
    margin-top: 0;
}

.search-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#location-input, #question-input {
    width: 60%;
    padding: 12px;
    font-size: 1rem;
    border-radius: 8px;
    border: 1px solid #4b5563;
    background-color: #1f2937;
    color: #e5e7eb;
}

#search-button, #ask-button {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background-color: #c81e1e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-button:hover, #ask-button:hover {
    background-color: #a01818;
}

/* --- Results --- */
#results-container {
    background-color: #1f2937;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    text-align: left;
    border: 1px solid #374151;
}

#story-output {
    font-size: 1.1rem;
    line-height: 1.7;
    white-space: pre-wrap; /* AI의 포맷팅 유지 */
}

#audio-player-container audio {
    width: 100%;
    margin-top: 1.5rem;
}

#image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 2rem;
}

#image-gallery img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #4b5563;
    transition: transform 0.2s ease;
}

#image-gallery img:hover {
    transform: scale(1.05);
}


/* --- Utility Classes --- */
.hidden {
    display: none !important;
}

/* --- Loading Game Container --- */
#loading-container {
    text-align: center;
    padding: 2rem;
    background-color: #1f2937;
    border-radius: 12px;
    margin-top: 2rem;
    border: 1px solid #374151;
}

#ghost-game-canvas {
    background-color: #111827;
    border-radius: 8px;
    cursor: none; /* 게임 위에서 커서 숨기기 */
    max-width: 100%;
}

/* --- Error Box --- */
#error-box {
    background-color: #450a0a;
    color: #fecaca;
    border: 1px solid #c81e1e;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 2rem;
}

/* --- Interactive Ghost Q&A Section --- */
#interactive-container {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #374151;
    text-align: center;
}

#interactive-container h2 {
    font-family: 'Creepster', cursive;
    font-size: 2.5rem;
    color: #c81e1e;
    margin-bottom: 0.5rem;
}

#ghost-answer-container {
    margin-top: 1.5rem;
    background-color: #111827;
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 50px;
    text-align: left;
}

#ghost-answer-output {
    font-size: 1rem;
    line-height: 1.6;
    white-space: pre-wrap;
    font-style: italic;
    color: #d1d5db;
}

#ghost-loading {
    text-align: center;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #c81e1e;
    width: 40px;
    height: 40