/* Main game styles */

/* Blokada zaznaczania i drag dla wszystkich elementów */
* {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

img, a, button, [draggable] {
    -webkit-user-drag: none;
    user-drag: none;
}

body {
    margin: 0;
    padding: 0;
    background: #0a0a0a;
    font-family: 'SFPixelate', 'Courier New', monospace;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    -webkit-touch-callout: none;
}

/* Hide cursor when gamepad is active */
.gamepad-active,
.gamepad-active * {
    cursor: none !important;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#worldCanvas,
#enemiesCanvas,
#gameCanvas {
    display: block;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
}

#worldCanvas {
    background: #1a0f1f;
    border: none;
}

#enemiesCanvas {
    background: transparent;
    border: none;
}

#gameCanvas {
    background: transparent;
    border: 2px solid #4a148c;
}

/* Responsive canvas scaling */
@media (max-aspect-ratio: 16/9) {
    /* Window is taller than 16:9 - scale by width */
    #worldCanvas,
    #enemiesCanvas,
    #gameCanvas {
        width: 100vw;
        height: calc(100vw * 9 / 16);
    }
}

@media (min-aspect-ratio: 16/9) {
    /* Window is wider than 16:9 - scale by height */
    #worldCanvas,
    #enemiesCanvas,
    #gameCanvas {
        width: calc(100vh * 16 / 9);
        height: 100vh;
    }
}

/* Handle very small screens */
@media (max-width: 800px), (max-height: 450px) {
    #gameCanvas {
        border: 1px solid #4a148c; /* Thinner border on small screens */
    }
    
}

/* Full screen mode support */
#gameContainer:fullscreen {
    background: #0a0a0a;
}

#gameContainer:-webkit-full-screen {
    background: #0a0a0a;
}

#gameContainer:-moz-full-screen {
    background: #0a0a0a;
}

/* Animations */
@keyframes synergyPulse {
    0% { transform: translate3d(-50%, -50%, 0) scale3d(0.5, 0.5, 1); opacity: 0; }
    20% { transform: translate3d(-50%, -50%, 0) scale3d(1.2, 1.2, 1); opacity: 1; }
    100% { transform: translate3d(-50%, -50%, 0) scale3d(1, 1, 1); opacity: 0; }
}

/* Damage numbers container */
#damageNumbers {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

/* Artifact benefits in level up menu */
.artifact-benefits {
    margin: 20px 0;
    padding: 15px;
    background: rgba(138, 43, 226, 0.1);
    border: 1px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    text-align: center;
}

.artifact-benefit {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: clamp(16px, 1.2vw, 20px);
}

.artifact-benefit:last-child {
    margin-bottom: 0;
}

.artifact-name {
    font-weight: bold;
    text-shadow: 0 0 10px currentColor;
    letter-spacing: 1px;
}

.artifact-effect {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: clamp(14px, 1.1vw, 18px);
}

/* Level up screen general styles */
#levelUpScreen h2 {
    font-family: 'SFPixelate', 'Courier New', monospace;
    font-size: 32px;
    color: #dda0dd;
    text-shadow: 0 0 20px rgba(221, 160, 221, 0.8);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
}
