/* Styles for Liam Clicker V2 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f0f4f8;
    background-image: radial-gradient(#d0d8e0 1px, transparent 1px);
    background-size: 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    color: #2d3748;
    padding: 20px 10px;
    margin: 0;
}

.game-container {
    width: 100%;
    max-width: 800px;
    height: auto;
    position: relative;
    overflow: hidden;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 10px;
    margin-bottom: 20px;
}

.game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 400px;
    margin-bottom: 20px;
}

.game-title {
    text-align: center;
    font-size: 36px;
    margin-top: 15px;
    color: #4a5568;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.subtitle-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.currency-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 15px;
}

.game-play-area {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.side-stats-container {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    min-width: 160px;
    border: 1px solid #e2e8f0;
}

.side-stat {
    font-size: 18px;
    margin: 4px 0;
}

.stat {
    font-size: 22px;
    margin: 5px 0;
    color: #4a5568;
    font-weight: 500;
    transition: color 0.3s;
}

#currency-display {
    font-size: 26px;
    color: #3182ce;
    font-weight: 700;
}

.click-area {
    width: 250px;
    height: 250px;
    position: relative;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border-radius: 50%;
    background: transparent;
    z-index: 1;
}

.click-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.15s ease-in-out;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

.click-area:hover .click-image {
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3)) brightness(1.05);
    transform: translateY(-5px) rotate(2deg);
}

.click-area:active .click-image {
    transform: scale(0.85) rotate(-3deg);
    filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.2)) brightness(0.95);
    transition: all 0.1s ease-in-out;
}

/* Add a shake animation for when the image is clicked */
@keyframes shake {
    0% { transform: scale(0.85) rotate(-3deg); }
    25% { transform: scale(0.85) rotate(3deg); }
    50% { transform: scale(0.85) rotate(-3deg); }
    75% { transform: scale(0.85) rotate(3deg); }
    100% { transform: scale(0.85) rotate(-3deg); }
}

.click-area.clicked .click-image {
    animation: shake 0.3s ease-in-out;
}

/* Add a pulsing animation to the click area */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(49, 130, 206, 0.7); }
    50% { box-shadow: 0 0 0 20px rgba(49, 130, 206, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(49, 130, 206, 0); }
}

.click-area {
    position: relative;
}

.click-area::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: -1;
    animation: pulse-glow 2s infinite;
    top: 0;
    left: 0;
}

/* Add a flash effect when clicked */
@keyframes flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
    100% { filter: brightness(1); }
}

.click-area.clicked::before {
    animation: flash 0.3s ease-out;
}

.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.2));
}

.text-particle {
    position: absolute;
    pointer-events: none;
    font-weight: bold;
    color: #38a169;
    text-shadow: 0 0 3px rgba(56, 161, 105, 0.3);
    font-size: 18px;
}

.shop-panel {
    width: 100%;
    max-width: 800px;
    background-color: #f8fafc;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.shop-panel h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.upgrades-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Category styling */
.category-header {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 20px;
    padding: 8px;
    margin-top: 5px;
    border-radius: 6px;
    color: white;
}

.category-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 10px;
    margin-bottom: 10px;
}

/* Powers category (blue) */
.category-powers {
    background-color: #3182ce; /* Blue */
}

.category-powers-container {
    background-color: rgba(49, 130, 206, 0.1);
    border-radius: 6px;
    padding: 10px;
}

/* Stages category (green) */
.category-stages {
    background-color: #38a169; /* Green */
}

.category-stages-container {
    background-color: rgba(56, 161, 105, 0.1);
    border-radius: 6px;
    padding: 10px;
}

.upgrade-button {
    width: 30%;
    min-width: 100px;
    background-color: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    opacity: 0.6; /* Default state is greyed out */
}

/* Powers category button styling (blue) */
.upgrade-button.category-powers:not(.unavailable) {
    opacity: 1;
    background-color: #ebf8ff;
    border-color: #90cdf4;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.1);
}

.upgrade-button.category-powers:not(.unavailable):hover {
    background-color: #bee3f8;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(66, 153, 225, 0.2);
}

.upgrade-button.category-powers:not(.unavailable):active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(66, 153, 225, 0.1);
}

/* Stages category button styling (green) */
.upgrade-button.category-stages:not(.unavailable) {
    opacity: 1;
    background-color: #e6fffa;
    border-color: #9ae6b4;
    box-shadow: 0 2px 4px rgba(56, 161, 105, 0.1);
}

.upgrade-button.category-stages:not(.unavailable):hover {
    background-color: #c6f6d5;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(56, 161, 105, 0.2);
}

.upgrade-button.category-stages:not(.unavailable):active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(56, 161, 105, 0.1);
}

.upgrade-button.unavailable {
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Max level upgrade styling */
.upgrade-button.max-level {
    opacity: 1;
    background-color: #fed7d7;
    border-color: #fc8181;
    box-shadow: 0 2px 4px rgba(229, 62, 62, 0.1);
}

.upgrade-button.max-level .upgrade-name {
    color: #e53e3e;
}

.upgrade-button.max-level .upgrade-cost {
    color: #e53e3e;
}

.upgrade-button.max-level:hover {
    background-color: #feb2b2;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.2);
}

.upgrade-name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2d3748;
}

.upgrade-cost {
    color: #718096;
    font-size: 14px;
}

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

.game-title {
    animation: pulse 3s infinite ease-in-out;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .game-main-content {
        flex-direction: column;
        gap: 10px;
    }
    
    .side-stats-container {
        position: static;
        width: 80%;
        align-items: center;
        margin: 0 auto 15px auto;
        transform: none;
        right: auto;
        top: auto;
    }
    
    .stat {
        text-align: center;
    }
}

@media (max-width: 600px) {
    .game-container {
        width: 100%;
        height: auto;
        padding: 5px;
        display: flex;
        flex-direction: column;
    }
    
    .game-content {
        min-height: 350px;
        margin-bottom: 10px;
    }
    
    .click-area {
        width: 180px;
        height: 180px;
        margin: 10px auto;
    }
    
    .currency-container {
        width: 95%;
        padding: 5px;
    }
    
    .side-stats-container {
        width: 90%;
        padding: 10px;
    }
    
    .upgrade-button {
        width: 45%;
        padding: 8px;
    }
    
    .game-title {
        font-size: 28px;
        margin-top: 10px;
    }
    
    .subtitle-container {
        flex-direction: column;
        gap: 5px;
    }
    
    .subtitle-container h2 {
        margin-left: 0 !important;
        font-size: 18px !important;
    }
    
    .shop-panel {
        padding: 10px;
    }
    
    .shop-panel h2 {
        margin-bottom: 10px;
        font-size: 20px;
    }
}

/* Helicopter styles */
.levi-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.levi {
    position: absolute;
    width: 90px;
    height: 90px;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: center;
}

.levi-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.levi:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.levi.clicked {
    animation: explode 0.5s forwards;
    pointer-events: none;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
    100% { transform: scale(2); opacity: 0; }
}

/* Stage display styling */
#stage-display {
    color: #805ad5; /* Purple */
    font-weight: 700;
    font-size: 24px;
    margin-top: 5px;
}

/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 12px;
}

.win-message {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    border: 2px solid #FFD700;
    max-width: 80%;
}

.win-message h2 {
    color: #FFD700;
    font-size: 28px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.win-message p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #4a5568;
}

#win-time {
    font-weight: bold;
    color: #3182ce;
}

#play-again-button {
    background-color: #3182ce;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#play-again-button:hover {
    background-color: #2c5282;
    transform: translateY(-2px);
}

#play-again-button:active {
    transform: translateY(0);
}

/* Name input on win screen */
.name-input-container {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.name-input-container label {
    margin-bottom: 8px;
    font-size: 16px;
    color: #4a5568;
}

#player-name {
    padding: 8px 12px;
    border: 2px solid #3182ce;
    border-radius: 5px;
    font-size: 16px;
    width: 100%;
    max-width: 250px;
    text-align: center;
    margin-bottom: 10px;
}

#player-name:focus {
    outline: none;
    border-color: #2c5282;
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.3);
}

#submit-score-button {
    background-color: #38a169;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

#submit-score-button:hover {
    background-color: #2f855a;
    transform: translateY(-2px);
}

#submit-score-button:active {
    transform: translateY(0);
}

/* Leaderboard */
.leaderboard-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.leaderboard-container h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #4a5568;
    font-size: 24px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.leaderboard-list {
    background-color: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.leaderboard-row {
    display: flex;
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row.header {
    background-color: #edf2f7;
    font-weight: bold;
    color: #4a5568;
}

.leaderboard-rank {
    flex: 0 0 15%;
    text-align: center;
}

.leaderboard-name {
    flex: 0 0 30%;
    text-align: center;
    font-weight: 500;
}

.leaderboard-time {
    flex: 0 0 25%;
    text-align: center;
}

.leaderboard-date {
    flex: 0 0 30%;
    text-align: center;
}

.leaderboard-empty {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-style: italic;
}

.latest-score {
    background-color: rgba(49, 130, 206, 0.1);
    font-weight: bold;
}

/* Timer Display */
#timer-display {
    color: #ed8936; /* Orange */
    font-weight: 700;
    font-size: 22px;
}

/* Media queries for responsive design */
@media (max-width: 600px) {
    .win-message {
        padding: 20px;
    }
    
    .win-message h2 {
        font-size: 22px;
    }
    
    .win-message p {
        font-size: 16px;
    }
    
    .leaderboard-container h2 {
        font-size: 20px;
    }
    
    .leaderboard-row {
        padding: 8px;
        font-size: 14px;
    }
    
    .leaderboard-rank {
        flex: 0 0 15%;
    }
    
    .leaderboard-name {
        flex: 0 0 30%;
        font-size: 12px;
    }
    
    .leaderboard-time {
        flex: 0 0 25%;
    }
    
    .leaderboard-date {
        flex: 0 0 30%;
        font-size: 12px;
    }
    
    .name-input-container label {
        font-size: 14px;
    }
    
    #player-name {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    #submit-score-button,
    #play-again-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}