/* Global Styles */
body {
    background-color: #2a0845;
    background-image: url("./Figs/background.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-size: 16px;
    color: white;
    font-family: 'Bangers', cursive;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

#musicToggle {
    position: fixed;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: 2px solid white;
    border-radius: 5px;
    cursor: pointer;
    z-index: 1000;
}

.evil-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Title Styles */
.title-container {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

h1 {
    font-size: 3rem;
    color: #ff0000;
    text-shadow: 3px 3px 0 #000, 5px 5px 0 #ffcc00;
    margin-bottom: 0;
    letter-spacing: 2px;
}

h2 {
    font-size: 2rem;
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000;
    margin-top: 5px;
}

.evil-logo {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 80px;
    height: 80px;
    background-color: #ff0000;
    border-radius: 50%;
    border: 5px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    transform: rotate(-15deg);
}

.evil-logo::before {
    content: "DEI";
    color: #fff;
}

/* Counter Styles */
.counter-container {
    background-color: rgba(0, 0, 0, 0.7);
    border: 3px solid #ffcc00;
    border-radius: 15px;
    padding: 15px;
    margin: 20px auto;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
}

.counter-text {
    color: #ffcc00;
    font-size: 2rem;
    font-weight: bold;
    margin: 10px 0;
    text-shadow: 2px 2px 0 #000;
}

/* Perry the Platypus Button */
.perry-container {
    position: relative;
    text-align: center;
    margin: 30px auto;
    width: 500px;
    transition: transform 0.2s;
}

.perry-container:hover {
    transform: scale(1.05);
}

.image-perry {
    width: 300px;
    height: auto;
    cursor: pointer;
    border-radius: 50%;
    border: 5px solid #00a2ff;
    box-shadow: 0 0 30px rgba(0, 162, 255, 0.7);
    transition: all 0.3s;
}

.image-perry:active {
    transform: scale(0.95);
    box-shadow: 0 0 50px rgba(0, 162, 255, 1);
}

.perry-hat {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 80px;
    background-color: #4b0082;
    border-radius: 50% 50% 0 0;
    z-index: -1;
}

/* Scheme/Upgrade Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.scheme-container, .upgrade-container {
    position: relative;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    padding: 15px;
    transition: all 0.3s;
    cursor: pointer;
    overflow: hidden;
}

.scheme-container {
    border: 3px solid #ff0000;
}

.upgrade-container {
    border: 3px solid #00a2ff;
}

.scheme-container:hover, .upgrade-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.scheme-button, .upgrade-button {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 10px;
}

.scheme-text, .upgrade-text {
    color: white;
    font-size: 1.1rem;
    display: block;
    text-align: center;
    font-family: 'Arial', sans-serif;
}

.scheme-badge, .upgrade-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.scheme-badge {
    background-color: #ff0000;
    color: white;
}

.upgrade-badge {
    background-color: #00a2ff;
    color: white;
}

#jumpscare {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: black;
    z-index: 9999;
}

/* Bonus Buttons (Doofenshmirtz's Inventions) */
.image-bonus {
    position: fixed;
    width: 150px;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    cursor: pointer;
    border: 3px solid #ffcc00;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.8);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translate(-50%, -50%) translateY(0px); }
    50% { transform: translate(-50%, -50%) translateY(-20px); }
    100% { transform: translate(-50%, -50%) translateY(0px); }
}

/* Message Boxes */
.message, .achievement {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border-radius: 15px;
    z-index: 90;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.message {
    background-color: #ff0000;
    color: white;
    border: 3px solid #000;
}

.achievement {
    background-color: #ffcc00;
    color: #000;
    border: 3px solid #000;
    display: flex;
    align-items: center;
}

.achievement-icon {
    width: 50px;
    height: 50px;
    background-color: #ff0000;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.achievement-icon::before {
    content: "★";
    color: #ffcc00;
}

/* Footer */
.evil-footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    font-size: 1.5rem;
    color: #ffcc00;
    text-shadow: 2px 2px 0 #000;
    font-style: italic;
}

/* Unaffordable items */
.scheme-container.unaffordable, 
.upgrade-container.unaffordable {
    opacity: 0.6;
    filter: grayscale(70%);
    cursor: not-allowed;
    border-color: #666;
}

.scheme-container.unaffordable .scheme-badge,
.upgrade-container.unaffordable .upgrade-badge {
    background-color: #666;
}

.scheme-container.unaffordable:hover, 
.upgrade-container.unaffordable:hover {
    transform: none;
    box-shadow: none;
}

/* Highlight affordable items */
.scheme-container.affordable {
    border-color: #ffcc00;
    box-shadow: 0 0 15px rgba(255, 204, 0, 0.7);
}

.upgrade-container.affordable {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.7);
}

.scheme-container.affordable .scheme-badge {
    background-color: #ffcc00;
    color: #000;
}

.upgrade-container.affordable .upgrade-badge {
    background-color: #00ff88;
    color: #000;
}

/* Hidden class */
.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
    }
    
    .perry-container {
        width: 100%;
    }
    
    .image-perry {
        width: 250px;
    }
}