/* Base Styles */
:root {
    --sand-color: #E8D0AA;
    --sky-blue: #87CEEB;
    --western-red: #A52A2A;
    --gin-green: #2E8B57;
    --wood-brown: #8B4513;
    --text-color: #333;
    --light-text: #FFF;
    --border-color: #8B4513;
    --button-hover: #CD853F;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--sand-color);
    color: var(--text-color);
    background-image: url('images/western-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

h1, h2, h3 {
    font-family: 'Rye', cursive;
    color: var(--western-red);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

a {
    color: var(--western-red);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

a:hover {
    color: var(--button-hover);
    text-decoration: underline;
}

.hidden {
    display: none !important;
}

/* Game Container */
#game-container {
    max-width: 900px;
    width: 100%;
    min-height: 600px;
    background-color: rgba(255, 255, 255, 0.9);
    border: 8px solid var(--wood-brown);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

/* Screen Styles */
.screen {
    width: 100%;
    min-height: 600px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* Start Screen */
.title-container {
    text-align: center;
    margin-bottom: 30px;
}

.title-container h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--western-red);
}

.language-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.lang-btn {
    background-color: var(--sand-color);
    border: 2px solid var(--border-color);
    padding: 8px 15px;
    margin: 0 10px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    transition: all 0.3s;
}

.lang-btn.active {
    background-color: var(--western-red);
    color: white;
}

.credits {
    margin-top: 30px;
    text-align: center;
    font-style: italic;
}

/* Western Button */
.western-btn {
    background-color: var(--wood-brown);
    color: var(--light-text);
    border: none;
    border-radius: 5px;
    padding: 12px 25px;
    font-family: 'Rye', cursive;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    margin: 10px;
}

.western-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.western-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Character and Dialog */
.game-content {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
}

.character-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character.jolly-jumper {
    width: 200px;
    height: 200px;
    background-image: url('images/jolly-jumper.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s;
}

.character.jolly-jumper:hover {
    transform: scale(1.05);
}

.dialog-container {
    flex: 2;
    padding: 10px;
}

.dialog {
    background-color: white;
    border: 3px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.dialog:before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 10px;
    border-style: solid;
    border-color: transparent var(--border-color) transparent transparent;
}

.jolly-dialog {
    background-color: #FFF8DC;
}

/* Input Elements */
.input-container {
    width: 100%;
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.western-input, .western-textarea, .western-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    background-color: #FFF8DC;
    color: var(--text-color);
    margin-bottom: 15px;
}

.western-textarea {
    min-height: 120px;
    resize: vertical;
}

.western-select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--wood-brown);
}

/* Game Header */
.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: var(--wood-brown);
    color: var(--light-text);
    border-radius: 5px;
    margin-bottom: 20px;
}

.round-display, .gin-counter {
    font-family: 'Rye', cursive;
    font-size: 1.2rem;
}

/* Decision Buttons */
.decision-container, .question-container {
    width: 100%;
    text-align: center;
    margin-top: 20px;
}

.decision-buttons, .question-buttons {
    display: flex;
    justify-content: center;
    margin-top: 15px;
}

/* Gin Bottles */
.gin-reward-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
}

.gin-bottles {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gin-bottle {
    width: 50px;
    height: 80px;
    background-image: url('images/gin-bottle.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.3;
    transition: all 0.5s;
}

.gin-bottle.earned {
    opacity: 1;
    transform: translateY(-10px);
}

/* Final Screen */
.final-content {
    display: flex;
    width: 100%;
    margin: 20px 0;
}

.final-stats {
    width: 100%;
    margin: 20px 0;
}

.final-gin-counter {
    text-align: center;
    font-size: 1.5rem;
    font-family: 'Rye', cursive;
    color: var(--western-red);
    margin-bottom: 20px;
}

.feedback-container {
    background-color: #FFF8DC;
    border: 3px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
}

.feedback-container h3 {
    margin: 15px 0 10px;
}

.final-options {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Image Generation */
.final-image-container {
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    text-align: center;
}

#final-image {
    max-width: 100%;
    border: 5px solid var(--wood-brown);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.final-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-content {
        flex-direction: column;
    }
    
    .character-container {
        margin-bottom: 20px;
    }
    
    .dialog:before {
        left: 50%;
        top: -20px;
        transform: translateX(-50%);
        border-color: transparent transparent var(--border-color) transparent;
    }
    
    .decision-buttons, .question-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .western-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .title-container h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 15px;
    }
    
    .character.jolly-jumper {
        width: 150px;
        height: 150px;
    }
    
    .title-container h1 {
        font-size: 1.5rem;
    }
    
    .game-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}
