* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #87CEEB 0%, #FFB6C1 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 20px;
    position: relative;
    /* Prevent overscroll on mobile browsers */
    overscroll-behavior: none;
}

/* Simple floating particles */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Cat Kill Counter */
.cat-kill-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Victory Popup */
.victory-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.victory-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
}

.victory-content h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #FF6B6B;
}

.victory-content p {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.victory-content button {
    background: #FF6B6B;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.victory-content button:hover {
    background: #FF5252;
    transform: scale(1.05);
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: simpleFloat 8s ease-in-out infinite;
}

.particle:nth-child(1) { width: 8px; height: 8px; left: 20%; top: 20%; animation-delay: 0s; }
.particle:nth-child(2) { width: 12px; height: 12px; left: 80%; top: 30%; animation-delay: 2s; }
.particle:nth-child(3) { width: 6px; height: 6px; left: 60%; top: 70%; animation-delay: 4s; }

@keyframes simpleFloat {
    0%, 100% { transform: translateY(0px); opacity: 0.6; }
    50% { transform: translateY(-20px); opacity: 1; }
}

.welcome-container {
    text-align: center;
    background: white;
    padding: 40px 30px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    max-width: 360px;
    width: 100%;
    z-index: 10;
    position: relative;
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.birthday-title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    }
    to {
        text-shadow: 2px 2px 8px rgba(255, 107, 157, 0.3);
    }
}

.cat-speech-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.cat-image {
    max-width: 200px;
    max-height: 200px;
    width: 100%;
    height: auto;
    margin-bottom: 30px;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-12px);
    }
    60% {
        transform: translateY(-6px);
    }
}

.cat-excited {
    animation: bounceExcited 1.5s ease-in-out infinite;
}

@keyframes bounceExcited {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) scale(1);
    }
    40% {
        transform: translateY(-15px) scale(1.05);
    }
    60% {
        transform: translateY(-8px) scale(1.02);
    }
}

@keyframes bubbleAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.speech-bubble {
    position: relative;
    background: white;
    border: 3px solid #333;
    border-radius: 20px;
    padding: 20px;
    max-width: 280px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: bubbleAppear 0.8s ease-out 0.5s both;
    cursor: pointer;
    user-select: none;
}

.speech-bubble:hover {
    background: #f8f8f8;
}

.speech-bubble:active {
    transform: scale(0.98);
    background: #f0f0f0;
}

.skip-hint {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.7rem;
    color: #666;
    opacity: 0.7;
}

.typewriter-text {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.4;
    font-weight: 500;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    min-height: 80px;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background-color: #333;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.start-button {
    background: linear-gradient(135deg, #FF6B9D, #4ECDC4);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.3);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

.start-button:active {
    transform: translateY(0);
}

/* Skip All Dialogues Button */
.skip-all-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.4);
    padding: 6px 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
    opacity: 0.6;
}

.skip-all-button:hover {
    background: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.6);
    opacity: 0.8;
}

.skip-all-button:active {
    transform: scale(0.95);
}

/* Hidden game container for later */
.game-container {
    display: none;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Crosshair */
.crosshair {
    position: fixed;
    top: 50vh;      /* Usa viewport height reale per centrare anche su mobile */
    left: 50vw;     /* Usa viewport width reale */
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    z-index: 1000;
    pointer-events: none;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
}

.crosshair::before {
    width: 2px;
    height: 20px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.crosshair::after {
    width: 20px;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .welcome-container {
        padding: 32px 24px;
        max-width: 100%;
    }
    
    .birthday-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }
    
    .cat-speech-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .speech-bubble {
        max-width: 280px;
        padding: 18px;
        min-width: 200px;
    }
    
    .typewriter-text {
        font-size: 1.1rem;
        min-height: 80px;
    }
    
    .cat-image {
        max-width: 200px;
        max-height: 200px;
    }
    
    .start-button {
        padding: 16px 32px;
        font-size: 1rem;
    }
    
    .skip-hint {
        font-size: 0.7rem;
    }
    
    /* Skip button mobile styles */
    .skip-all-button {
        top: 8px;
        right: 12px;
        padding: 5px 8px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .birthday-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }
    
    .cat-image {
        max-width: 180px;
        max-height: 180px;
    }
    
    .speech-bubble {
        max-width: 260px;
        padding: 16px;
    }
    
    .typewriter-text {
        font-size: 1rem;
    }
}

/* Virtual Joystick Styles for Mobile */
#virtualJoystick {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.6) !important;
}

#virtualJoystick .joystick-knob {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Improved mobile game controls */
@media (max-width: 768px) {
    /* Make sure game fills screen properly on mobile */
    .game-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    #gameCanvas {
        width: 100vw !important;
        height: 100vh !important;
    }
    
    /* Enhanced virtual joystick for mobile */
    #virtualJoystick {
        width: 100px !important;
        height: 100px !important;
        bottom: 20px !important;
        left: 20px !important;
        background: rgba(255, 255, 255, 0.4) !important;
        border: 2px solid rgba(255, 255, 255, 0.7) !important;
    }
}

/* Animation for mobile music resume indicator */
@keyframes pulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1); 
        opacity: 1;
    }
    50% { 
        transform: translateX(-50%) scale(1.05); 
        opacity: 0.8;
    }
} 