/**
 * 2D RPG Game Styles
 */

#rpg-game-container {
    position: relative;
    margin: 20px auto;
    background: #000;
    border: 3px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    overflow: hidden;
}

#rpg-game-canvas {
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#rpg-game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Debug info */
#rpg-debug-info {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    line-height: 1.4;
    pointer-events: none;
}

/* Wellness Bar */
#rpg-wellness-bar {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 250px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 6px;
    border: 2px solid #fff;
    pointer-events: none;
}

.stat-label {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-bar-container {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.stat-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    transition: width 0.5s ease;
}

.wellness-fill {
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.stat-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: bold;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Counters Container */
#rpg-counters-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    pointer-events: none;
}

/* Key Counter */
#rpg-key-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.key-icon {
    font-size: 24px;
}

.key-amount {
    color: #ffd700;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Collectibles Counter */
#rpg-collectibles-counter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.collectibles-icon {
    font-size: 24px;
}

.collectibles-amount {
    color: #ffd700;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Dialog Box */
#rpg-dialog-box {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.9);
    border: 3px solid #fff;
    border-radius: 8px;
    padding: 20px;
    color: #fff;
    font-family: Arial, sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.8);
    z-index: 100;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.dialog-content {
    position: relative;
}

.dialog-avatar {
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 32px;
    background: rgba(255,255,255,0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.dialog-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.dialog-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    min-height: 50px;
}

.dialog-prompt {
    text-align: right;
    font-size: 12px;
    color: #aaa;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
    #rpg-game-container {
        margin: 10px;
    }
    
    #rpg-wellness-bar {
        width: 180px;
    }
}

/* Loading state */
.rpg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: #fff;
    font-size: 18px;
}

/* Game controls help */
.rpg-controls-help {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

.rpg-controls-help h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.rpg-controls-help p {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.rpg-controls-help kbd {
    display: inline-block;
    padding: 3px 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}