@import url('theme.css');

/* Cursor definitions so size stays consistent on hover */
:root {
    /* Use the same-sized cursor asset for default and pointer states to avoid shrinking on hover */
    --cursor-default: url('assets/cursor.png') 32 32, auto;
    /* Use the same asset for hover to avoid the tiny click cursor issue */
    --cursor-pointer: url('assets/cursor.png') 32 32, pointer;
    /* Disabled / not-allowed state keeps the same size */
    --cursor-disabled: url('assets/cursor.png') 32 32, not-allowed;
    --glow-green: drop-shadow(0 0 8px rgba(0, 255, 120, 0.7)) drop-shadow(0 0 14px rgba(0, 255, 120, 0.5));
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-pixel);
    font-size: 12px;
    background-color: var(--retro-bg);
    color: var(--retro-text);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    image-rendering: pixelated;
    cursor: var(--cursor-default);
}

button,
a,
.upgrade-item,
.soda-can-button,
.tab-button,
.close-modal,
.minigame-trigger-btn,
.reset-button {
    cursor: var(--cursor-pointer);
}

/* Add a consistent neon green glow on hover to all interactive elements */
button:hover,
a:hover,
.upgrade-item:hover:not(.disabled),
.soda-can-button:hover,
.tab-button:hover,
.close-modal:hover,
.minigame-trigger-btn:hover,
.reset-button:hover {
    filter: var(--glow-green);
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    border-bottom: var(--border-width) solid var(--neon-pink);
    padding-bottom: var(--spacing-md);
    background: rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 24px;
    color: var(--neon-yellow);
    text-shadow: 4px 4px 0px #ff00ff;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: flicker 2s infinite;
}

@keyframes flicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        opacity: 1;
    }

    20%,
    24%,
    55% {
        opacity: 0.5;
    }
}

.stats-bar {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.stat-item {
    background: #000;
    border: var(--border-width) solid var(--neon-cyan);
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 180px;
    box-shadow: var(--shadow-hard);
}

.stat-label {
    font-size: 10px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: 16px;
    color: #fff;
    text-shadow: 2px 2px 0px #000;
}

.game-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

@media (max-width: 968px) {
    .game-area {
        grid-template-columns: 1fr;
    }
}

/* Click Section */
.click-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border: var(--border-width) solid var(--neon-green);
    padding: var(--spacing-xl);
    position: relative;
    box-shadow: var(--shadow-hard);
}

.can-container {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.soda-can-button {
    background: none;
    border: none;
    padding: 0;
    transition: transform 0.1s;
    position: relative;
    z-index: 2;
}

.soda-can-button:active {
    transform: scale(0.95);
}

.can-image {
    width: 200px;
    height: auto;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 10px var(--neon-green));
}

.click-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    font-size: 20px;
    font-weight: 700;
    color: var(--neon-yellow);
    text-shadow: 2px 2px 0px #000;
    opacity: 0;
    z-index: 10;
}

.click-indicator.active {
    animation: floatUp 0.5s steps(5);
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
}

.click-hint {
    font-size: 12px;
    color: var(--retro-text-dim);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Upgrades */
.upgrades-section {
    background: rgba(0, 0, 0, 0.3);
    border: var(--border-width) solid var(--neon-pink);
    padding: var(--spacing-lg);
    max-height: 600px;
    overflow-y: auto;
    color: var(--retro-text-dim);
    font-family: var(--font-pixel);
    font-size: 10px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.tab-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--retro-bg);
    border: var(--border-width) solid var(--neon-pink);
    padding: var(--spacing-sm);
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.tab-button {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    color: var(--retro-text-dim);
    border: 2px solid var(--neon-cyan);
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-pixel);
    font-size: 10px;
    text-transform: uppercase;
    transition: all 0.2s;
}

.tab-button:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.tab-button.active {
    background: var(--neon-cyan);
    color: var(--retro-bg);
    border-color: var(--neon-cyan);
    box-shadow: var(--shadow-hard);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.upgrades-section h2 {
    font-size: 18px;
    margin-bottom: var(--spacing-md);
    color: var(--neon-pink);
    border-bottom: 2px dashed var(--neon-pink);
    padding-bottom: var(--spacing-sm);
}

.upgrades-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.upgrade-item {
    background: #000;
    border: 2px solid var(--retro-text-dim);
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: all 0.1s;
    position: relative;
}

.upgrade-item:hover:not(.disabled) {
    border-color: var(--neon-green);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px var(--neon-green);
}

.upgrade-item:active:not(.disabled) {
    transform: translate(0, 0);
    box-shadow: none;
}

.upgrade-item.disabled {
    opacity: 0.5;
    cursor: var(--cursor-disabled);
    border-color: #333;
    filter: grayscale(100%);
}

.upgrade-icon {
    width: 48px;
    height: 48px;
    border: 2px solid #fff;
    background: #222;
    padding: 4px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

.upgrade-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upgrade-info {
    flex: 1;
}

.upgrade-name {
    font-size: 12px;
    color: var(--neon-yellow);
    margin-bottom: 4px;
}

.upgrade-description {
    font-size: 8px;
    color: var(--retro-text-dim);
    margin-bottom: 4px;
    line-height: 1.4;
}

.upgrade-stats {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    font-size: 10px;
}

.upgrade-cost {
    color: var(--neon-pink);
}

.upgrade-owned {
    color: var(--neon-cyan);
}

.upgrade-production {
    color: var(--neon-green);
}

.upgrade-total-pps {
    color: var(--neon-yellow);
    font-size: 9px;
}

.multiplier-upgrade {
    border: 2px solid var(--neon-yellow);
    background: #111;
}

.multiplier-upgrade:hover:not(.disabled) {
    border-color: var(--neon-yellow);
    box-shadow: 4px 4px 0px var(--neon-yellow);
}

.multiplier-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.click-power-upgrade {
    border: 2px solid var(--neon-cyan);
    background: #051010;
    margin-bottom: var(--spacing-md);
}

.click-power-upgrade:hover:not(.disabled) {
    border-color: var(--neon-cyan);
    box-shadow: 4px 4px 0px var(--neon-cyan);
}

.click-power-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-cyan);
}

.upgrades-section::-webkit-scrollbar {
    width: 12px;
    background: #000;
    border-left: 2px solid var(--neon-pink);
}

.upgrades-section::-webkit-scrollbar-thumb {
    background: var(--neon-pink);
    border: 2px solid #000;
}

.upgrades-section::-webkit-scrollbar-thumb:hover {
    background: #ff66ff;
}

/* Footer & Buttons */
footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: var(--border-width) solid var(--neon-cyan);
}

.reset-button {
    background: #ff0000;
    color: #fff;
    border: 4px solid #fff;
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 14px;
    font-family: var(--font-pixel);
    text-transform: uppercase;
    box-shadow: 4px 4px 0px #000;
    margin-bottom: var(--spacing-md);
    transition: all 0.1s;
}

.reset-button:hover {
    background: #ff3333;
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px #000;
}

.reset-button:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0px #000;
}

.retro-btn {
    background: var(--neon-cyan);
    color: #000;
    border: 4px solid #fff;
    padding: 15px 30px;
    font-family: var(--font-pixel);
    font-size: 16px;
    text-transform: uppercase;
    box-shadow: 4px 4px 0 #000;
    transition: all 0.1s;
}

.retro-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
    background: #fff;
}

.retro-btn:active {
    transform: translate(0, 0);
    box-shadow: 2px 2px 0 #000;
}

.retro-btn:disabled {
    background: #555;
    color: #888;
    cursor: var(--cursor-disabled);
    transform: none;
    box-shadow: none;
}

/* Notifications */
.game-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #000;
    border: 4px solid #fff;
    padding: var(--spacing-md);
    font-size: 12px;
    color: #fff;
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    transition: transform 0.3s steps(5), opacity 0.3s;
    pointer-events: none;
    text-transform: uppercase;
}

.game-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.notification-info {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.notification-warning {
    border-color: var(--neon-yellow);
    color: var(--neon-yellow);
}

.notification-success {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.save-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #000;
    border: 2px solid var(--neon-cyan);
    padding: var(--spacing-sm);
    font-size: 10px;
    color: var(--neon-cyan);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 999;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--retro-bg);
    border: 4px solid var(--neon-pink);
    padding: var(--spacing-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 0 20px var(--neon-pink), inset 0 0 20px rgba(255, 0, 255, 0.2);
    position: relative;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px dashed var(--neon-pink);
    padding-bottom: var(--spacing-sm);
}

.modal-header h2 {
    color: var(--neon-yellow);
    text-shadow: 2px 2px 0 #000;
    margin: 0;
    font-size: 18px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--retro-text-dim);
    font-size: 24px;
    font-family: var(--font-pixel);
}

.close-modal:hover {
    color: #fff;
}

/* Random Event */
.random-event-clickable {
    position: fixed;
    width: 64px;
    height: 64px;
    background-image: url('assets/golden-can.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    user-select: none;
    cursor: pointer;
    z-index: 10000;
    filter: drop-shadow(0 0 10px var(--neon-yellow));
    animation: floatAndPulse 2s infinite ease-in-out;
    transition: transform 0.1s;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.random-event-clickable:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px var(--neon-yellow));
}

.random-event-clickable:active {
    transform: scale(0.95);
}

@keyframes floatAndPulse {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

.random-event-clickable.fading-out {
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s, transform 0.5s;
}

.random-event-clickable.debuff {
    filter: drop-shadow(0 0 10px #ff0000) hue-rotate(150deg);
}

.random-event-clickable.debuff:hover {
    filter: drop-shadow(0 0 15px #ff0000) hue-rotate(150deg);
}

/* Status Effects & Cooldowns */
.status-effects-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    min-height: 50px;
}

.status-effect-item {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-cyan);
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 10px;
    box-shadow: 0 0 5px var(--neon-cyan);
    animation: fadeIn 0.3s ease;
}

.status-effect-item.debuff {
    border-color: #ff0000;
    box-shadow: 0 0 5px #ff0000;
}

.status-effect-item.cooldown {
    border-color: #ffd700;
    box-shadow: 0 0 5px #ffd700;
    opacity: 0.7;
}

.status-effect-icon {
    font-size: 16px;
}

.status-effect-timer {
    font-family: monospace;
    color: var(--neon-yellow);
}

.cooldown-timers-container {
    margin-top: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    width: 100%;
}

.cooldown-timer {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-cyan);
    padding: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-hard);
    animation: fadeIn 0.3s ease;
}

.cooldown-timer.buff {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
}

.cooldown-timer.debuff {
    border-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
}

.cooldown-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.cooldown-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cooldown-label {
    font-size: 10px;
    color: var(--neon-cyan);
    text-transform: uppercase;
}

.cooldown-timer.buff .cooldown-label {
    color: var(--neon-green);
}

.cooldown-timer.debuff .cooldown-label {
    color: #ff0000;
}

.cooldown-time {
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

/* Stats modal helper */
