/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a3a2a 0%, #2d5a2d 100%);
    color: #f0e6d2;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#game-canvas {
    display: block;
    margin: 0 auto;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 20px;
    color: #f0e6d2;
    text-shadow: 0 0 5px rgba(0,0,0,0.7);
}

#player-stats {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.6);
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #8b4513;
}

.stat-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

.stat-bar label {
    min-width: 60px;
}

.bar-fill {
    flex: 1;
    height: 20px;
    background: #333;
    border: 1px solid #555;
    border-radius: 3px;
    overflow: hidden;
    margin-left: 10px;
    position: relative;
}

.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(to right, #ff4757, #ff6b6b);
    transition: width 0.3s ease;
}

#action-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

#action-buttons button {
    background: rgba(139, 69, 19, 0.7);
    color: #f0e6d2;
    border: 2px solid #8b4513;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#action-buttons button:hover {
    background: rgba(160, 82, 45, 0.8);
    transform: scale(1.05);
}

#action-buttons button:active {
    transform: scale(0.95);
}

#message-log {
    position: absolute;
    bottom: 20px;
    right: 20px;
    max-width: 300px;
    max-height: 150px;
    overflow-y: auto;
    background: rgba(0,0,0,0.7);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #8b4513;
    font-size: 12px;
    line-height: 1.4;
}

#message-log.message {
    animation: fadeIn 0.3s ease;
}

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

/* Character Select Menu */
.menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.85);
    padding: 30px;
    border-radius: 12px;
    border: 3px solid #8b4513;
    text-align: center;
    width: 90%;
    max-width: 500px;
    color: #f0e6d2;
}

.menu h2 {
    margin-bottom: 25px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.class-options {
    display: flex;
    justify-content: space-around;
    margin: 25px 0;
    flex-wrap: wrap;
    gap: 15px;
}

.class-option {
    background: rgba(101, 67, 33, 0.6);
    border: 2px solid #8b4513;
    border-radius: 8px;
    padding: 15px;
    width: 22%;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.3s;
}

.class-option:hover {
    background: rgba(139, 69, 19, 0.7);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.class-option.selected {
    background: #8b4513;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255,215,0,0.5);
}

.class-option h3 {
    color: #ffd700;
    margin-bottom: 10px;
}

.class-option p {
    font-size: 14px;
    line-height: 1.4;
}

.customize-section {
    margin-top: 25px;
    text-align: left;
}

.customize-section h3 {
    margin-bottom: 15px;
    color: #ffd700;
}

#customization-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.customize-option {
    background: rgba(101, 67, 33, 0.6);
    border: 2px solid #8b4513;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}

.customize-option:hover {
    background: rgba(139, 69, 19, 0.7);
}

.customize-option.selected {
    background: #8b4513;
    border-color: #ffd700;
}

#start-game-btn {
    background: #8b4513;
    color: #f0e6d2;
    border: 2px solid #ffd700;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#start-game-btn:hover {
    background: #a0522d;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255,215,0,0.4);
}

#start-game-btn:active {
    transform: scale(0.95);
}

/* Kwento Popup */
#kwento-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 25px;
    border-radius: 12px;
    border: 3px solid #8b4513;
    width: 90%;
    max-width: 400px;
    text-align: center;
    z-index: 1000;
}

#kwento-popup .kwento-content h3 {
    color: #ffd700;
    margin-bottom: 15px;
}

#kwento-popup .kwento-content p {
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: left;
}

#kwento-popup .kwento-content button {
    background: #8b4513;
    color: #f0e6d2;
    border: 2px solid #ffd700;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

#kwento-popup .kwento-content button:hover {
    background: #a0522d;
}

/* Responsive adjustments will be in responsive.css */
.hidden {
    display: none !important;
}

/* Loading screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #f0e6d2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-size: 18px;
}

#loading-screen .progress-bar {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background: #333;
    border: 2px solid #8b4513;
    margin-top: 20px;
    overflow: hidden;
    border-radius: 3px;
}

#loading-screen .progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(to right, #ff4757, #ff6b6b);
    width: 0%;
    transition: width 0.3s ease;
}