:root {
    --primary-color: #3e5336; /* Military Olive */
    --primary-dark: #24331e;
    --primary-light: #59754f;
    --accent-gold: #ffd700; /* Gold */
    --accent-red: #ff3333;
    --bg-dark: #121212;
    --text-light: #f0f0f0;
    --font-pixel: 'Press Start 2P', monospace;
    --font-sans: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-sans);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(var(--primary-dark) 1px, transparent 0),
        radial-gradient(var(--primary-dark) 1px, transparent 0);
    background-size: 24px 24px;
    background-position: 0 0, 12px 12px;
}

#game-container {
    position: relative;
    width: 540px;
    height: 960px;
    background: #000;
    border: 6px solid #4a4a4a;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(62, 83, 54, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

/* Overlays style */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 25, 17, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    text-align: center;
    max-width: 480px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Titles and subtitle styles */
.game-title {
    font-family: var(--font-pixel);
    font-size: 1.8rem;
    color: var(--accent-gold);
    text-shadow: 3px 3px 0px var(--primary-dark), 0 0 10px rgba(255, 215, 0, 0.4);
    margin-bottom: 10px;
    letter-spacing: 1px;
    animation: titlePulse 2s infinite alternate;
}

.game-subtitle {
    font-size: 0.85rem;
    color: #a4bba0;
    font-style: italic;
    margin-bottom: 20px;
    max-width: 340px;
    line-height: 1.4;
}

/* Preview Avatar */
.character-preview-container {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: 4px solid var(--accent-gold);
    padding: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    overflow: hidden;
}

#preview-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
    image-rendering: auto;
}

.medal-shine-effect {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.4) 50%,
        rgba(255,255,255,0) 60%,
        rgba(255,255,255,0) 100%
    );
    transform: rotate(30deg);
    animation: shine 4s infinite;
}

/* Buttons */
.pixel-btn {
    font-family: var(--font-pixel);
    font-size: 1.0rem;
    background-color: var(--primary-color);
    color: white;
    border: 4px solid var(--text-light);
    border-color: #7d9e71 #24331e #24331e #7d9e71;
    padding: 12px 24px;
    cursor: pointer;
    text-shadow: 2px 2px 0px #000;
    box-shadow: 0 5px 0px rgba(0,0,0,0.5);
    transition: all 0.1s ease;
    margin-bottom: 20px;
}

.pixel-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 0px rgba(0,0,0,0.5);
}

.pixel-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0px rgba(0,0,0,0.5);
    border-color: #24331e #7d9e71 #7d9e71 #24331e;
}

/* Control guide */
.controls-guide {
    background-color: rgba(0, 0, 0, 0.4);
    padding: 15px 25px;
    border-radius: 8px;
    border: 2px solid var(--primary-color);
    font-size: 0.9rem;
    color: #ccc;
}

.controls-guide h3 {
    font-family: var(--font-pixel);
    font-size: 0.8rem;
    color: var(--accent-gold);
    margin-bottom: 8px;
}

.controls-guide p {
    margin: 5px 0;
}

.key {
    background-color: #333;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #555;
    border-bottom: 3px solid #222;
    font-family: monospace;
    font-weight: bold;
}

/* Victory styling */
.victory-title {
    font-family: var(--font-pixel);
    font-size: 2.2rem;
    margin-bottom: 12px;
    text-shadow: 4px 4px 0px #000;
}

.text-rainbow {
    background: linear-gradient(
        to right,
        #ff3333,
        #ffaa00,
        #ffd700,
        #33cc33,
        #3399ff,
        #8833ff,
        #ff3333
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowText 3s linear infinite;
}

.victory-subtitle {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 20px;
}

.stats-box {
    background-color: rgba(0, 0, 0, 0.6);
    border: 3px solid var(--accent-gold);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    min-width: 280px;
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    line-height: 2;
    text-align: left;
}

.stat-val {
    color: var(--accent-gold);
    font-weight: bold;
}

/* Audio control panel */
#audio-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background-color: rgba(0, 0, 0, 0.75);
    border: 2px solid var(--primary-color);
    padding: 8px 10px 8px 8px;
    border-radius: 16px;
    z-index: 20;
    transition: all 0.2s ease;
}

#audio-panel:hover {
    border-color: var(--accent-gold);
}

.audio-control-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text-light);
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
    transform: scale(1.05);
}

/* Custom styled volume slider */
.audio-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 6px;
    background: var(--primary-dark);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

.audio-slider::-webkit-slider-thumb:hover {
    background: #fff;
}

.audio-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid var(--primary-color);
    cursor: pointer;
    transition: background 0.15s ease;
}

.audio-slider::-moz-range-thumb:hover {
    background: #fff;
}

.hidden {
    display: none;
}

/* Animations */
@keyframes titlePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.03); }
}

@keyframes shine {
    0% { left: -150%; }
    30% { left: 150%; }
    100% { left: 150%; }
}

@keyframes rainbowText {
    100% { background-position: 200% center; }
}

/* Language Selector styling */
#language-selector {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 15;
}

.lang-btn {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: #a4bba0;
    background-color: rgba(0, 0, 0, 0.4);
    border: 2px solid var(--primary-color);
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

.lang-btn.active {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--accent-gold);
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.5);
}

