/* Import czcionek */
@import url('https://fonts.googleapis.com/css2?family=Joti+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rubik+Moonrocks&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    font-family: "Joti One", serif;
    font-weight: 400;
    font-style: normal;
    background: linear-gradient(135deg, #0a0a1a, #0f1020, #0a1a2e);
    overflow: hidden;
    height: 100dvh;
    position: relative;
    color: white;
}

/* Canvas gry */
#gameCanvas {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid #4CAF50;
    border-radius: 15px;
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
}

/* UI gry */
#gameUI {
    position: absolute;
    top: 15px;
    left: 20px;
    right: 20px;
    z-index: 100;
    color: #fff;
    font-weight: bold;
    font-size: 22px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ui-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.timer-display {
    min-width: 120px;
}

.ui-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.control-btn.muted {
    opacity: 0.5;
}

.control-btn.paused {
    background: rgba(255, 255, 0, 0.2);
}

/* Joystick */
#joystickContainer {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    z-index: 100;
}

#joystickBase {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.4);
}

#joystickKnob {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    transition: transform 0.1s ease;
}

/* Ekrany */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    text-align: center;
    padding: 20px;
}

#mainMenu {
    background: linear-gradient(135deg, #0a0a1a, #0f1020);
}

#instructionsScreen {
    background: linear-gradient(135deg, #0a0a1a, #0f1020);
}

#startScreen {
    background: linear-gradient(135deg, #0a0a1a, #0f1020);
}

#gameOverScreen {
    background: rgba(0, 0, 0, 0.9);
}

#pauseScreen {
    background: rgba(0, 0, 0, 0.8);
}

.mouse-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

.screen h1 {
    font-size: 42px;
    margin-bottom: 20px;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

.screen h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #FFD700;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

.screen p {
    font-size: 20px;
    margin-bottom: 20px;
    color: #fff;
}

/* Przyciski */
.game-btn {
    padding: 15px 30px;
    margin: 8px;
    font-size: 20px;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: "Joti One", serif;
    min-width: 180px;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.game-btn:active {
    transform: translateY(0);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

/* Instrukcje */
.instructions {
    margin: 20px 0;
    max-width: 320px;
    font-size: 18px;
    line-height: 1.5;
    color: #ccc;
}

.instructions-content {
    max-width: 400px;
    margin: 20px 0;
    text-align: left;
    line-height: 1.6;
}

.instructions-content p {
    margin-bottom: 15px;
    font-size: 16px;
}

.instructions-content strong {
    color: #FFD700;
}

/* Ukrywanie */
.hidden {
    display: none !important;
}

/* Animacje cząsteczek */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    border-radius: 50%;
    animation: float 6s infinite linear;
    pointer-events: none;
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10px) rotate(360deg);
        opacity: 0;
    }
}

.cheese-crumb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 150;
}

.time-bonus {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 150;
    background: #4ECDC4;
}

/* Media queries */
@media screen and (max-height: 700px) {
    #gameCanvas {
        width: 350px !important;
        height: 500px !important;
        top: 100px;
    }
    
    #joystickContainer {
        width: 160px;
        height: 160px;
        bottom: 20px;
    }
    
    #joystickKnob {
        width: 50px;
        height: 50px;
    }
    
    .game-btn {
        padding: 12px 25px;
        font-size: 18px;
        min-width: 160px;
    }
}

@media screen and (max-height: 600px) {
    .screen h1 {
        font-size: 32px;
    }
    
    .mouse-logo {
        width: 80px;
        height: 80px;
    }
    
    .instructions {
        font-size: 16px;
    }
    
    .footer {
        font-size: 1.2rem;
        padding: 1rem;
    }
}