:root {
    --sepia-dark: #3e2723;
    --sepia-medium: #704214;
    --sepia-page: #f4e8d8;
    --sepia-text: #2c1810;
    --shadow: rgba(0, 0, 0, 0.2);
}

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

body {
    font-family: 'Special Elite', monospace;
    background: var(--sepia-page);
    min-height: 100vh;
    color: var(--sepia-text);
    overflow-x: hidden;
}

/* Death Overlay */
.death-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 3s ease-in-out;
}

.death-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Main Story Container */
.story-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 8rem 2rem;
    min-height: 100vh;
}

/* Story Text - Typewriter Effect */
.story-text {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--sepia-text);
    margin-bottom: 3rem;
}

.story-text p {
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: typeIn 0.6s ease-out forwards;
}

.story-text p.loading {
    text-align: center;
    font-style: italic;
    opacity: 0.5;
    animation: pulse 2s infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Story Images */
.story-image-container {
    margin: 2rem 0;
    text-align: center;
}

.story-image {
    max-width: 100%;
    height: auto;
    border: 2px solid var(--sepia-medium);
    box-shadow: 0 4px 12px var(--shadow);
    filter: sepia(80%) contrast(1.1) brightness(0.9);
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Choices */
.choices-container {
    margin: 3rem 0;
}

.choice-btn {
    display: block;
    width: 100%;
    padding: 1.2rem;
    margin-bottom: 1rem;
    background: transparent;
    border: 2px solid var(--sepia-medium);
    color: var(--sepia-text);
    font-family: 'Special Elite', monospace;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.choice-btn:hover {
    background: var(--sepia-medium);
    color: var(--sepia-page);
    transform: translateX(10px);
}

.choice-probability {
    font-size: 0.85rem;
    color: var(--sepia-medium);
    font-style: italic;
    margin-top: 0.5rem;
}

/* Slot Machine / Dice */
.slot-machine {
    text-align: center;
    padding: 3rem 2rem;
    margin: 3rem 0;
    border: 2px solid var(--sepia-medium);
    background: rgba(244, 232, 216, 0.5);
}

.slot-machine.hidden {
    display: none;
}

.slot-title {
    font-size: 1.3rem;
    color: var(--sepia-dark);
    margin-bottom: 2rem;
}

.dice-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.die {
    width: 70px;
    height: 70px;
    background: var(--sepia-page);
    border: 2px solid var(--sepia-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 3px 8px var(--shadow);
}

.die.rolling {
    animation: rollDice 0.1s infinite;
}

@keyframes rollDice {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
}

.slot-probability {
    font-size: 1rem;
    color: var(--sepia-medium);
    margin: 1rem 0;
}

.roll-button {
    padding: 1rem 2.5rem;
    background: var(--sepia-medium);
    color: var(--sepia-page);
    border: 2px solid var(--sepia-dark);
    font-family: 'Special Elite', monospace;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.roll-button:hover {
    background: var(--sepia-dark);
}

.roll-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Page Indicator */
.page-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-size: 0.9rem;
    color: var(--sepia-medium);
    opacity: 0.7;
}

/* Controls */
.controls {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    color: var(--sepia-medium);
    border: 1px solid var(--sepia-medium);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.control-btn:hover {
    background: var(--sepia-medium);
    color: var(--sepia-page);
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .story-container {
        padding: 2rem 1.5rem 6rem 1.5rem;
    }

    .story-text {
        font-size: 1rem;
        line-height: 1.7;
    }

    .dice-container {
        gap: 1rem;
    }

    .die {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .controls {
        bottom: 1rem;
        left: 1rem;
    }

    .page-indicator {
        bottom: 1rem;
        right: 1rem;
    }
}
