* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

canvas {
    display: block;
    background-color: #000;
    touch-action: none;
}

#loadingScreen, #menuScreen, #guideScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#loadingScreen.hidden, #menuScreen.hidden, #guideScreen.hidden {
    display: none;
}

.loading-text, .menu-title {
    color: white;
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.menu-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    margin-bottom: 40px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 250px;
}

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

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

#guideScreen {
    background: rgba(0, 0, 0, 0.95);
}

.guide-content {
    max-width: 600px;
    width: 90%;
    padding: 20px;
}

.guide-step {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.guide-step h2 {
    color: #667eea;
    font-size: 32px;
    margin: 0 0 20px 0;
}

.guide-step p {
    color: #333;
    font-size: 18px;
    line-height: 1.6;
    margin: 10px 0;
}

.guide-visual {
    margin: 30px 0;
    font-size: 20px;
}

kbd {
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    display: inline-block;
    margin: 5px;
}

.guide-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s;
}

.guide-btn:hover {
    transform: translateY(-2px);
}

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

.progress-bar-container {
    width: 300px;
    height: 30px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 15px;
}

.loading-info {
    color: white;
    font-size: 16px;
    margin-top: 10px;
    text-align: center;
}

.error-message {
    color: #ff6b6b;
    font-size: 14px;
    margin-top: 10px;
    max-width: 400px;
    text-align: center;
}

#installButton {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 999;
    display: none;
    transition: transform 0.2s;
}

#installButton:hover {
    transform: translateY(-2px);
}

#installButton.show {
    display: block;
}

/* Hint Overlay for Mobile */
#hintOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15%;
    z-index: 500;
    pointer-events: none;
    animation: fadeOut 1.5s forwards;
}

#hintOverlay.hidden {
    display: none;
}

.hint-bubble {
    background: rgba(102, 126, 234, 0.95);
    color: white;
    padding: 20px 30px;
    border-radius: 20px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    text-align: center;
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .loading-text, .menu-title {
        font-size: 36px;
    }
    
    .menu-subtitle {
        font-size: 16px;
    }
    
    .menu-btn {
        min-width: 200px;
        font-size: 18px;
    }
    
    .guide-step {
        padding: 30px 20px;
    }
    
    .guide-step h2 {
        font-size: 24px;
    }
    
    .guide-step p {
        font-size: 16px;
    }
    
    .hint-bubble {
        font-size: 18px;
        padding: 15px 25px;
    }
}