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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#game-ui {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    color: white;
    font-family: 'Arial', sans-serif;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: all;
    z-index: 1001;
}

.hidden {
    display: none !important;
}

/* Title Screen */
#title-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#title-screen h1 {
    font-size: 48px;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
    text-align: center;
}

#title-screen h2 {
    font-size: 2rem;
    color: #ff6b35;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

#title-screen p {
    font-size: 18px;
    color: #ffffff;
    text-align: center;
    margin-bottom: 40px;
    max-width: 600px;
    line-height: 1.6;
}

.title-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 200px;
}

.btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

@keyframes glow {
    from { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 215, 0, 0.5); }
    to { text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.8); }
}

button {
    background: linear-gradient(145deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    /* Temporary debugging - make buttons more visible */
    border: 2px solid #ffffff;
    position: relative;
    z-index: 1003;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    background: linear-gradient(145deg, #ff7a4a, #ffa726);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Instructions Screen */
#instructions-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

#instructions-screen h2 {
    color: #ffd700;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.instructions-content {
    background: rgba(0, 0, 0, 0.8);
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ffd700;
    max-width: 800px;
    max-height: 70vh;
    overflow-y: auto;
    margin-bottom: 20px;
}

.instructions-content h3 {
    color: #ffd700;
    font-size: 20px;
    margin-bottom: 15px;
    margin-top: 25px;
}

.instructions-content p {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.instructions-content ul {
    color: #ffffff;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-left: 20px;
}

.instructions-content li {
    margin-bottom: 8px;
}

/* Game Screen */
#game-screen {
    background: transparent;
    pointer-events: none;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

#willpower-bar {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #333;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.bar-container {
    width: 200px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #666;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ffd700);
    transition: width 0.3s ease;
    width: 100%;
}

#willpower-text {
    font-weight: bold;
    color: #ffd700;
    min-width: 60px;
}

#phase-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #ff6b35;
}

#phase-text {
    font-weight: bold;
    color: #ff6b35;
    font-size: 1.1rem;
}

#timer {
    color: #ffffff;
    font-size: 0.9rem;
}

#score {
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #4caf50;
    color: #4caf50;
    font-weight: bold;
}

/* Ability Bar */
#ability-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;
    pointer-events: all;
}

/* Hide ability bar on title screen */
#title-screen ~ #ability-bar,
#instructions-screen ~ #ability-bar {
    display: none;
}

/* Show ability bar only during game */
#game-screen:not(.hidden) ~ #ability-bar {
    display: flex;
}

.ability-btn {
    background: linear-gradient(135deg, #666, #555);
    color: white;
    border: 2px solid #95a5a6;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.ability-btn:hover {
    background: linear-gradient(135deg, #555, #666);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.ability-btn.cooldown {
    opacity: 0.7;
    cursor: not-allowed;
}

.cooldown-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    transition: height 0.1s linear;
    pointer-events: none;
    z-index: 1;
}

.ability-btn.cooldown .cooldown-fill {
    animation: cooldownFill 0.1s linear;
}

@keyframes cooldownFill {
    from { height: 0%; }
    to { height: 100%; }
}

.ability-btn.available {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
    animation: pulse 2s infinite;
}

.ability-btn.disabled {
    background: linear-gradient(135deg, #666, #555);
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

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

/* Game Over and Success Screens */
#game-over-screen,
#success-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.game-over-content,
.success-content {
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2001;
}

#game-over-title {
    font-size: 3rem;
    color: #e74c3c;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#game-over-message {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-align: center;
    max-width: 500px;
}

#final-score {
    font-size: 1.5rem;
    color: #f39c12;
    margin-bottom: 2rem;
    font-weight: bold;
}

/* Phaser Game Container */
#phaser-game {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    #title-screen h1 {
        font-size: 2.5rem;
    }
    
    #title-screen h2 {
        font-size: 1.5rem;
    }
    
    #hud {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    #ability-bar {
        bottom: 10px;
        gap: 5px;
    }
    
    .ability-btn {
        width: 60px;
        height: 60px;
        font-size: 0.7rem;
    }
    
    .bar-container {
        width: 150px;
    }
}

/* Critical Willpower Warning */
.willpower-critical {
    animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Ability Cooldown Animation */
.cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

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

#cast-bar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    z-index: 1000;
}

.cast-bar-bg {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff0000;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    height: 40px;
}

.cast-bar-fill {
    background: linear-gradient(90deg, #ff0000, #ff6b35);
    height: 20px;
    border-radius: 5px;
    width: 0%;
    transition: width 0.1s ease;
}

.cast-bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 14px;
}

.game-over-content h2 {
    color: #ff0000;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#game-over-reason {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.5;
}

#restart-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#restart-btn:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
} 

.ability-btn[data-ability="break-free"] {
    background: linear-gradient(135deg, #ff0000, #cc0000);
    border-color: #ff3333;
}

.ability-btn[data-ability="break-free"]:hover {
    background: linear-gradient(135deg, #cc0000, #ff0000);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4);
}

.ability-btn[data-ability="break-free"].available {
    background: linear-gradient(135deg, #ff4444, #ff0000);
    box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
    animation: pulse-red 2s infinite;
}

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

.success-content h2 {
    color: #4CAF50;
    font-size: 36px;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#success-message {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 20px;
    line-height: 1.5;
}

#success-score {
    color: #4CAF50;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
} 

#game-info {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    color: white;
    font-family: 'Arial', sans-serif;
    text-align: right;
}

#game-info span {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#amber-shaper-stacks {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 7px; /* Reduced from 15px */
    border-radius: 4px; /* Reduced from 8px */
    border: 1px solid #ffd700; /* Reduced from 2px */
    color: white;
    text-align: center;
    z-index: 100;
    overflow: hidden;
}

.stacks-container {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #ffd700; /* Reduced from 2px */
    border-radius: 5px; /* Reduced from 10px */
    padding: 7px; /* Reduced from 15px */
    text-align: center;
    min-width: 100px; /* Reduced from 200px */
}

.stacks-container h3 {
    margin: 0 0 5px 0; /* Reduced from 10px */
    color: #ffd700;
    font-size: 8px; /* Reduced from 16px */
}

#stacks-counter {
    font-size: 12px; /* Reduced from 24px */
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 2px; /* Reduced from 5px */
}

#stacks-timer {
    font-size: 7px; /* Reduced from 14px */
    color: #ccc;
    margin-top: 2px; /* Reduced from 5px */
}

/* Swipe animation overlay */
.stacks-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    animation: swipeAnimation 15s linear infinite;
    pointer-events: none;
}

@keyframes swipeAnimation {
    0% { left: -100%; }
    100% { left: 100%; }
}

.stacks-reset-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 20px 40px;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
    z-index: 2000;
    animation: stacksReset 3s ease-in-out;
}

@keyframes stacksReset {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
} 

#title-screen button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    margin: 10px;
}

#title-screen button:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

#instructions-screen button {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    margin: 10px;
}

#instructions-screen button:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
} 

#boss-hp-bar {
    position: absolute;
    top: 20px;
    left: calc(50% + 150px); /* Position to the right of the stacks */
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 2px solid #ff0000;
    color: white;
    font-size: 12px;
    z-index: 100;
}

.boss-hp-container h3 {
    margin: 0 0 5px 0;
    color: #ff0000;
    font-size: 14px;
}

.boss-hp-bar {
    width: 150px;
    height: 20px;
    background: #333;
    border: 1px solid #666;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 5px;
}

.boss-hp-fill {
    height: 100%;
    background: linear-gradient(to right, #ff0000, #ff6666);
    width: 100%;
    transition: width 0.3s ease;
}

.boss-hp-text {
    font-size: 11px;
    color: #fff;
} 

/* Game Result Area on Title Screen */
.game-result-area {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #ff6b35;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    animation: fadeIn 0.5s ease-in;
}

.result-message {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
}

.result-message.failure {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid #ff4444;
}

.result-message.success {
    color: #44ff44;
    background: rgba(68, 255, 68, 0.1);
    border: 1px solid #44ff44;
}

.final-score-display {
    font-size: 1.1em;
    color: #ffd700;
    font-weight: bold;
}

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

/* GitHub Button - Subtle styling */
#github-btn {
    background: linear-gradient(145deg, #666666, #555555) !important;
    color: #cccccc !important;
    border: 1px solid #444444 !important;
    text-decoration: none;
    display: inline-block;
    opacity: 0.7;
    transition: all 0.3s ease;
    
    /* Position in bottom right corner */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    
    /* Curved edges */
    border-radius: 25px;
    
    /* Smaller, more subtle size */
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
    
    /* Remove default button styling */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: none;
}

#github-btn:hover {
    background: linear-gradient(145deg, #777777, #666666) !important;
    color: #dddddd !important;
    transform: translateY(-1px);
    opacity: 0.9;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

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