/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #e8e8e8;
}

/* Game Container */
.game-container {
    background: rgba(0, 0, 0, 0.7);
    border: 3px solid #8b7355;
    border-radius: 15px;
    max-width: 700px;
    width: 100%;
    padding: 30px;
    box-shadow: 0 0 50px rgba(139, 115, 85, 0.3),
                inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #8b7355;
}

header h1 {
    font-size: 2rem;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

.subtitle {
    color: #aaa;
    font-style: italic;
    font-size: 1rem;
}

/* Inventory Bar */
.inventory-bar {
    background: rgba(139, 115, 85, 0.2);
    border: 1px solid #8b7355;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.inventory-label {
    color: #ffd700;
    font-weight: bold;
}

#inventory-items {
    color: #ccc;
    margin-left: 10px;
}

.item-added {
    color: #4ade80 !important;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Main Game Content */
.game-content {
    min-height: 350px;
}

#story-area {
    margin-bottom: 25px;
}

.room-name {
    font-size: 1.5rem;
    color: #ffd700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-name::before {
    content: '📍';
}

.room-description {
    line-height: 1.8;
    color: #ddd;
    font-size: 1.1rem;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #8b7355;
}

/* Choices Area */
#choices-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border: 2px solid #8b7355;
    border-radius: 8px;
    padding: 15px 20px;
    color: #e8e8e8;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.choice-btn:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    border-color: #ffd700;
    transform: translateX(10px);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.choice-btn:active {
    transform: translateX(5px);
}

.choice-number {
    background: #8b7355;
    color: #1a1a2e;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Message Area */
#message-area {
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid #4ade80;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    color: #4ade80;
    font-weight: bold;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

#message-area.warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

#message-area.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

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

/* Victory and Game Over States */
.victory .room-name {
    color: #4ade80;
    font-size: 2rem;
    justify-content: center;
}

.victory .room-name::before {
    content: '';
}

.game-over .room-name {
    color: #ef4444;
    font-size: 2rem;
    justify-content: center;
}

.game-over .room-name::before {
    content: '';
}

/* Footer */
footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #8b7355;
}

.hint {
    color: #888;
    font-style: italic;
    font-size: 0.9rem;
}

.restart-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    border-radius: 8px;
    padding: 15px 30px;
    color: #1a1a2e;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(74, 222, 128, 0.5);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    .game-container {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .room-name {
        font-size: 1.2rem;
    }
    
    .room-description {
        font-size: 1rem;
    }
    
    .choice-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* Typing Animation for Description */
.typing {
    overflow: hidden;
    animation: typing 1s steps(40, end);
}

@keyframes typing {
    from { max-height: 0; }
    to { max-height: 500px; }
}
