/* ============================================
   CLOCKWORK WORDS v3.0 - STEAMPUNK THEME
   Brass/Gold/Wood Color Palette
   ============================================ */

:root {
    /* Steampunk Color Palette */
    --brass-primary: #b8941c;
    --brass-gold: #d4af37;
    --brass-dark: #8b6f2e;
    --brass-light: #ffd700;
    
    --bronze: #cd7f32;
    --copper: #b87333;
    --cog-grey: #4a4a4a;
    --pipe-dark: #2c2c2c;
    --wood-brown: #654321;
    
    /* Background Gradients */
    --bg-dark: #1a1a1a;
    --bg-panel: #2d2518;
    --bg-gradient: linear-gradient(135deg, #1a1a1a 0%, #2d2518 100%);
    
    /* UI Colors */
    --text-gold: #ffd700;
    --text-light: #f5f5dc;
    --text-dark: #3d321e;
    --success-green: #4a9c4a;
    --danger-red: #b85c5c;
    
    /* Spiral Colors */
    --spiral-track: linear-gradient(180deg, var(--brass-dark) 0%, var(--brass-primary) 50%, var(--brass-gold) 100%);
    --bubble-bg: rgba(255, 255, 255, 0.9);
    --bubble-border: var(--brass-primary);
}

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

body {
    font-family: 'Georgia', serif;
    background: #0f0f0f url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><pattern id="cog" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="20" stroke="%23333" stroke-width="2" fill="none"/><circle cx="25" cy="25" r="10" fill="%23444"/></pattern><rect width="100" height="100" fill="url(%23cog)"/></svg>');
    background-size: 200px;
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 100%;
    max-width: 1280px;
    height: 95vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================
   STEAMPUNK PANELS & UI COMPONENTS
   ============================================ */

.steampunk-panel {
    background: var(--bg-panel);
    border: 4px solid var(--brass-gold);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 
        0 0 20px rgba(212, 175, 55, 0.3),
        inset 0 0 30px rgba(184, 148, 28, 0.1);
    position: relative;
}

.steampunk-panel::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 2px solid var(--brass-dark);
    border-radius: 8px;
    pointer-events: none;
}

.steampunk-button {
    background: linear-gradient(145deg, var(--brass-gold), var(--brass-primary));
    color: var(--text-dark);
    border: 3px solid var(--brass-dark);
    border-radius: 8px;
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 5px 15px rgba(184, 115, 51, 0.4),
        inset 0 2px 5px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.steampunk-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg) translate(-100%, -100%);
    transition: transform 0.5s;
}

.steampunk-button:hover::before {
    transform: rotate(45deg) translate(100%, 100%);
}

.steampunk-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(184, 115, 51, 0.6),
        inset 0 2px 5px rgba(255, 255, 255, 0.4);
}

.steampunk-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(184, 115, 51, 0.3);
}

.steampunk-button.secondary {
    background: linear-gradient(145deg, var(--bronze), var(--copper));
    color: var(--text-light);
}

/* ============================================
   MAIN MENU SCREEN
   ============================================ */

.menu-screen {
    text-align: center;
    z-index: 10;
}

.title {
    font-size: 3em;
    color: var(--text-gold);
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 20px var(--brass-gold);
    margin-bottom: 10px;
    letter-spacing: 3px;
}

.subtitle {
    font-size: 1.8em;
    color: var(--text-light);
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.game-info {
    margin: 30px 0;
    text-align: left;
    padding-left: 20px;
}

.game-info p {
    font-size: 1.2em;
    color: var(--text-gold);
    margin-bottom: 15px;
}

.instructions {
    list-style: none;
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--text-light);
}

.instructions li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.instructions li::before {
    content: '⚙️ ';
    margin-right: 8px;
}

/* ============================================
   GAME SCREEN & CANVAS
   ============================================ */

.game-screen {
    position: relative;
    width: 100%;
    height: 100%;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.2),
        inset 0 0 60px rgba(0, 0, 0, 0.5);
}

/* ============================================
   HUD & PROGRESS BAR
   ============================================ */

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    gap: 30px;
    z-index: 100;
}

.hud-item {
    background: rgba(45, 37, 24, 0.9);
    border: 3px solid var(--brass-gold);
    border-radius: 10px;
    padding: 10px 20px;
    min-width: 100px;
}

.hud-label {
    display: block;
    font-size: 0.9em;
    color: var(--brass-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.hud-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: var(--text-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.progress-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 600px;
    background: rgba(45, 37, 24, 0.9);
    border: 3px solid var(--brass-gold);
    border-radius: 15px;
    padding: 8px;
}

.progress-bar {
    height: 25px;
    background: linear-gradient(90deg, 
        var(--danger-red) 0%, 
        var(--bronze) 33%, 
        var(--brass-gold) 66%, 
        var(--success-green) 100%);
    border-radius: 12px;
    transition: width 0.3s ease, background 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: 'ENEMY PROGRESS';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-dark);
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
    text-shadow: none;
}

/* ============================================
   MODALS & OVERLAYS
   ============================================ */

.modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-panel);
    border: 4px solid var(--brass-gold);
    border-radius: 12px;
    padding: 30px;
    z-index: 1000;
    max-width: 600px;
    width: 90%;
    box-shadow: 
        0 0 40px rgba(212, 175, 55, 0.4),
        inset 0 0 30px rgba(184, 148, 28, 0.1);
}

.modal.hidden {
    display: none;
}

.modal-content h2 {
    color: var(--text-gold);
    text-align: center;
    margin-bottom: 25px;
    font-size: 2em;
}

.game-mechanics h3 {
    color: var(--brass-gold);
    margin: 20px 0 10px 0;
    font-size: 1.3em;
}

.game-mechanics ul {
    list-style: none;
    padding-left: 20px;
    color: var(--text-light);
}

.game-mechanics li {
    margin: 8px 0;
    line-height: 1.6;
}

.steampunk-button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.steampunk-button-container button {
    flex: 1;
    max-width: 200px;
}

/* ============================================
   VISUAL EFFECTS
   ============================================ */

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--brass-gold); }
    50% { box-shadow: 0 0 40px var(--text-gold); }
}

.steam-steam::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: steam-rotate 3s linear infinite;
}

@keyframes steam-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .title { font-size: 2em; }
    .subtitle { font-size: 1.4em; }
    
    #hud {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .hud-item { min-width: auto; width: 200px; }
    .hud-value { font-size: 1.5em; }
    
    .progress-container {
        width: 90%;
        bottom: 20px;
    }
    
    .modal-content h2 { font-size: 1.5em; }
}

/* ============================================
   ANIMATIONS FOR HIT/MISS FEEDBACK
   ============================================ */

@keyframes hit-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.hit-feedback {
    animation: hit-pulse 0.3s ease;
}

@keyframes miss-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.miss-feedback {
    animation: miss-shake 0.3s ease;
}

@keyframes streak-boost {
    0% { color: var(--text-gold); }
    50% { color: #ff6b6b; text-shadow: 0 0 20px #ff6b6b; }
    100% { color: var(--text-gold); }
}

.streak-boost {
    animation: streak-boost 1s ease infinite;
}
