/* Base styles */
body {
    margin: 0;
    font-family: 'Courier New', monospace;
    background: linear-gradient(180deg, #1c2526 0%, #0d1112 100%);
    color: #d9d9d9;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
}

#game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#story {
    padding: 20px;
    background: #2e3839;
    border: 3px solid #4a5556;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 111, 0, 0.3), inset 0 0 5px rgba(0, 0, 0, 0.8);
    text-align: center;
    line-height: 1.5;
    position: relative;
    width: 100%; /* Matches the buttons' full width within game-container */
    box-sizing: border-box; /* Ensures padding/border don't expand beyond set width */
}

#story::before, #story::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff6f00;
    border-radius: 50%;
}

#story::before {
    top: -5px;
    left: -5px;
}

#story::after {
    bottom: -5px;
    right: -5px;
}

#choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Common button styles */
button {
    padding: 12px;
    font-size: 16px;
    background: #3c4647;
    color: #d9d9d9;
    border: 2px solid #ff6f00;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

button:hover {
    background: #ff6f00;
    color: #1c2526;
    transform: translateY(-1px);
}

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

#attributes {
    width: 100%;
    background: #252d2e;
    padding: 15px;
    border: 2px dashed #4a5556;
    border-radius: 0;
    text-align: left;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.7);
}

#attributes h3 {
    margin: 0 0 10px 0;
    color: #ff6f00;
    font-size: 16px;
    text-transform: uppercase;
    text-align: center;
}

#attributes ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

#attributes li {
    margin: 0;
    font-size: 13px;
    padding: 5px;
    background: #1c2526;
    border: 1px solid #3c4647;
}

#restart {
    margin-top: 0;
    width: 100%;
    text-align: center;
}

#save-button {
    padding: 12px 20px;
    font-size: 16px;
    background: repeating-linear-gradient(45deg, #ff6f00, #ff6f00 10px, #3c4647 10px, #3c4647 20px);
    color: #d9d9d9;
    border: 2px solid #ff6f00;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#save-button:hover {
    background: #ff6f00;
    color: #1c2526;
    transform: translateY(2px);
    box-shadow: 0 0 10px rgba(255, 111, 0, 0.6);
}

/* Classes for stat changes */
.stat-gain {
    color: #00cc00; /* Green for positive gains */
    text-shadow: 0 0 2px rgba(0, 204, 0, 0.5);
}

.stat-loss {
    color: #ff3333; /* Red for losses */
    text-shadow: 0 0 2px rgba(255, 51, 51, 0.5);
}

/* Start screen styles */
#start-screen {
    text-align: center;
    margin-top: 50px;
}

#start-screen button {
    padding: 12px 20px;
    font-size: 18px;
    margin: 10px;
    background: #3c4647;
    color: #d9d9d9;
    border: 2px solid #ff6f00;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#start-screen button:hover {
    background: #ff6f00;
    color: #1c2526;
}

#start-screen button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Combine menu styles */
#save-menu, #load-menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2e3839;
    padding: 20px;
    border: 2px solid #4a5556;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    text-align: center;
}

#save-menu h3, #load-menu h3 {
    color: #ff6f00;
    margin-bottom: 15px;
}

#save-menu button, #load-menu button {
    display: block;
    width: 100%;
    margin: 10px 0;
    padding: 12px;
    font-size: 16px;
    background: #3c4647;
    color: #d9d9d9;
    border: 2px solid #ff6f00;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#save-menu button:hover, #load-menu button:hover {
    background: #ff6f00;
    color: #1c2526;
}

#save-menu button:disabled, #load-menu button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.character-name {
    display: block;
    text-align: center;
    font-weight: bold;
    color: #ff6f00;
    font-size: 1.2em;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.character-dialogue {
    display: block;
    text-align: center;
    line-height: 1.5;
}

.character-portrait {
    display: block;
    margin: 0 auto 15px auto;
    max-width: 200px;
    max-height: 200px;
    border: 2px solid #ff6f00;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 111, 0, 0.3);
}

/* Add media query for desktop layout */
@media (min-width: 1024px) {
    #game-container {
        flex-direction: row;
        align-items: flex-start;
    }

    .game-main-content {
        flex: 1;
        margin-right: 20px;
    }

    #attributes {
        width: 300px;
        position: sticky;
        top: 20px;
    }
}

/* Add new class for main content wrapper */
.game-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.dialogue-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 10px;
}

.dialogue-left {
    flex: 0 0 auto;
    width: 200px;
    align-self: flex-start;
}

.character-portrait {
    width: 200px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 5px;
}

.character-name {
    text-align: left;
    margin: 0;
    padding: 5px 0;
}

.character-dialogue {
    flex: 1;
    padding-left: 20px;
    display: flex;
    align-items: center;
    min-height: 200px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .dialogue-container {
        height: auto;
        flex-direction: column;
    }
    
    .dialogue-left {
        width: 100%;
    }
    
    .character-dialogue {
        padding: 15px 0;
        text-align: center;
    }
}