@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Space+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #d4c5a0;
    font-family: 'Cinzel', serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.candles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.candle {
    position: absolute;
    width: 4px;
    height: 60px;
    background: linear-gradient(to bottom, #1a1a1a 0%, #2a2a2a 100%);
    animation: flicker 2s infinite;
}

.candle:nth-child(1) { left: 10%; top: 20%; }
.candle:nth-child(2) { right: 10%; top: 20%; }
.candle:nth-child(3) { left: 50%; bottom: 10%; transform: translateX(-50%); }

.candle::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 15px;
    height: 20px;
    background: radial-gradient(ellipse at center, #ff6b35 0%, transparent 70%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: flame 1.5s infinite;
}

@keyframes flame {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.8; }
    50% { transform: translateX(-50%) scale(1.1, 0.9); opacity: 1; }
}

@keyframes flicker {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.95; }
}

.instructions {
    margin-bottom: 30px;
    padding: 20px;
    border: 2px solid #8a7a60;
    background: rgba(26, 20, 16, 0.8);
    border-radius: 10px;
    text-align: center;
}

.instructions p {
    font-size: 1.5em;
    line-height: 1.5;
    font-weight: normal;
    text-shadow: 0 0 10px rgba(212, 197, 160, 0.3);
    color: #d4c5a0;
}

.container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 90%;
    text-align: center;
}

.game-index {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid #d4c5a0;
    border-radius: 10px;
}

.index-item {
    text-align: center;
}

.index-label {
    display: block;
    font-size: 0.9em;
    color: #8a7a60;
    margin-bottom: 5px;
    letter-spacing: 2px;
}

.index-value {
    display: block;
    font-size: 1.5em;
    color: #d4c5a0;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(212, 197, 160, 0.3);
}

.team-scores {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(42, 24, 16, 0.8);
    border: 3px solid #d4c5a0;
    border-radius: 15px;
}

.team {
    text-align: center;
    flex: 1;
}

.team h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    letter-spacing: 3px;
    color: #d4c5a0;
}

.score {
    font-size: 4em;
    font-weight: bold;
    color: #ff6b35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.vs {
    font-size: 2.5em;
    font-weight: bold;
    color: #d4c5a0;
    padding: 0 30px;
    text-shadow: 0 0 10px rgba(212, 197, 160, 0.5);
}

.team-indicator {
    margin-top: 15px;
    height: 20px;
    font-size: 1.2em;
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
}

.team-indicator.active::before {
    content: '▼ YOUR TURN ▼';
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.gallery-section {
    margin-bottom: 50px;
}

.gallery-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(212, 197, 160, 0.5);
    letter-spacing: 5px;
}

.character-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.character-card {
    background: rgba(42, 24, 16, 0.8);
    border: 2px solid #d4c5a0;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 197, 160, 0.3);
    border-color: #ff6b35;
}

.character-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
    filter: grayscale(30%);
    transition: filter 0.3s ease;
}

.character-card:hover img {
    filter: grayscale(0%);
}

.character-card p {
    font-size: 0.9em;
    margin: 0;
    color: #d4c5a0;
}

.ouija-board {
    background: linear-gradient(135deg, #2a1810 0%, #1a1410 100%);
    border: 3px solid #d4c5a0;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.8);
}

.ouija-board h1 {
    font-size: 3em;
    letter-spacing: 10px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(212, 197, 160, 0.5);
}

.letters {
    font-size: 1.2em;
    letter-spacing: 8px;
    margin: 20px 0;
    word-spacing: 5px;
}

.answers {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    font-size: 1.5em;
}

.planchette {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #d4c5a0 0%, #8a7a60 100%);
    border-radius: 50% 50% 0 0;
    margin: 0 auto 30px;
    position: relative;
    box-shadow: 0 5px 20px rgba(212, 197, 160, 0.3);
    transition: transform 0.5s ease;
}

.planchette::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #1a1410;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #8a7a60;
}

.planchette.moving {
    animation: moveSpooky 2s ease-in-out;
}

@keyframes moveSpooky {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-30px) rotate(-10deg); }
    75% { transform: translateX(30px) rotate(10deg); }
}

.dialogue-box {
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid #d4c5a0;
    padding: 25px;
    border-radius: 10px;
    margin: 20px 0;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialogue-box p {
    font-size: 1.1em;
    font-style: italic;
    line-height: 1.6;
}

.start-btn, .guess-btn {
    background: #2a1810;
    color: #d4c5a0;
    border: 2px solid #d4c5a0;
    padding: 15px 40px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin: 10px;
}

.start-btn:hover, .guess-btn:hover {
    background: #d4c5a0;
    color: #2a1810;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 197, 160, 0.3);
}

.game-area {
    margin-top: 30px;
    padding: 10px;
    background: rgba(10, 10, 10, 0.5);
    border-radius: 10px;
    border: 1px solid #d4c5a0;
}

.game-area::-webkit-scrollbar {
    width: 8px;
}

.game-area::-webkit-scrollbar-track {
    background: rgba(42, 24, 16, 0.3);
    border-radius: 10px;
}

.game-area::-webkit-scrollbar-thumb {
    background: #d4c5a0;
    border-radius: 10px;
}

.conversation-entry {
    margin-bottom: 20px;
}

.question-box {
    background: rgba(42, 24, 16, 0.6);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #d4c5a0;
}

.question-box p {
    font-size: 1.2em;
    color: #d4c5a0;
}

.spirit-response {
    background: rgba(10, 10, 10, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border: 2px solid #ff6b35;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.spirit-response p {
    font-size: 1.3em;
    color: #ff6b35;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
}

.guess-input {
    margin: 30px 0;
}

.guess-input input {
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid #d4c5a0;
    color: #d4c5a0;
    padding: 15px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    width: 300px;
    border-radius: 5px;
    margin-right: 10px;
}

.guess-input button {
    background: #2a1810;
    color: #d4c5a0;
    border: 2px solid #d4c5a0;
    padding: 15px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.guess-input button:hover {
    background: #d4c5a0;
    color: #2a1810;
}

.hidden {
    display: none !important;
}

.result {
    margin-top: 30px;
    padding: 30px;
    border-radius: 10px;
    font-size: 1.3em;
    animation: fadeIn 0.5s ease;
}

.result.correct {
    background: rgba(46, 125, 50, 0.3);
    border: 2px solid #4caf50;
    color: #4caf50;
}

.result.incorrect {
    background: rgba(198, 40, 40, 0.3);
    border: 2px solid #f44336;
    color: #f44336;
}

.team-guess-container {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin: 30px 0;
}

.team-guess {
    flex: 1;
    background: rgba(42, 24, 16, 0.6);
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #d4c5a0;
}

.team-1-guess {
    border-color: #4caf50;
}

.team-2-guess {
    border-color: #2196f3;
}

.team-guess h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    letter-spacing: 3px;
}

.team-guess input {
    background: rgba(10, 10, 10, 0.8);
    border: 2px solid #d4c5a0;
    color: #d4c5a0;
    padding: 15px;
    font-family: 'Cinzel', serif;
    font-size: 1.1em;
    width: 100%;
    border-radius: 5px;
    margin-bottom: 15px;
}

.team-guess button {
    width: 100%;
}

.team-guess.submitted {
    opacity: 0.6;
    pointer-events: none;
}

.team-guess.submitted::after {
    content: '✓ SUBMITTED';
    display: block;
    margin-top: 10px;
    font-size: 1.2em;
    color: #4caf50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.8);
}

@media (max-width: 768px) {
    .ouija-board h1 {
        font-size: 2em;
    }
    
    .letters {
        font-size: 0.9em;
        letter-spacing: 4px;
    }
    
    .guess-input input {
        width: 200px;
        margin-bottom: 10px;
    }
    
    .team-guess-container {
        flex-direction: column;
    }
}