:root {
    --primary-color: #6f42c1; /* Bootstrap's purple */
    --secondary-color: #fd7e14; /* Bootstrap's orange */
    --accent-color: #20c997; /* Bootstrap's teal */
    --background-light: #e9ecef; /* Light gray */
    --background-dark: #343a40; /* Dark gray */
    --text-light: #f8f9fa;
    --text-dark: #212529;
}

body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    margin: 0;
    color: var(--text-dark);
}

.card {
    background-color: var(--text-light);
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-height: 80vh; /* Make card take up most of the viewport height */
    display: flex;
    flex-direction: column;
}

h1 {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.subtitle {
    color: var(--text-light) !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
}

.alert-info {
    background-color: rgba(var(--accent-color), 0.1);
    color: var(--text-dark);
    border-color: var(--accent-color);
}

#game-container {
    min-height: 80vh; /* Make card take up most of the viewport height */
    display: flex;
    flex-direction: column;
}

#story-area-container {
    position: relative;
    flex: 1; /* Take up remaining space in the flex container */
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

#story-area {
    background-color: var(--background-light);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    padding: 15px;
    white-space: pre-wrap;
    line-height: 1.8;
    font-size: 1.1rem;
    width: 100%;
    flex: 1; /* Take up available space in its container */
    min-height: 400px;
    resize: vertical; /* Allow user to resize if needed */
    margin-bottom: 1rem; /* Add space for the buttons below */
}

/* Make the buttons and input area not take flex space */
.story-controls {
    flex-shrink: 0;
}

/* Hide button text on mobile, keep only icons */
@media (max-width: 768px) {
    #submit-btn-text {
        display: none;
    }
    
    #submit-btn {
        /* Make button smaller on mobile to only show the icon */
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

#user-input {
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

#user-input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(var(--secondary-color), 0.25);
}

#submit-btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: bold;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#submit-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

#loading-overlay {
    background-color: rgba(var(--background-dark), 0.8);
}

#status {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.btn-tall {
    min-height: 80px;
    padding-left: 70px !important;
    padding-right: 70px !important;
}