body { 
    margin: 0; 
    overflow: hidden; 
    background: #f0f0f0; 
    font-family: 'Segoe UI', sans-serif;
    touch-action: none; 
}
#gameUI {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 150px;
    box-sizing: border-box;
}
.top-bar, .bottom-bar {
    padding: 10px;
    background: #333;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}
canvas {
    flex-grow: 1;
    background: white;
    cursor: crosshair;
    touch-action: none;
}
button {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    background: #2196F3;
    color: white;
    font-weight: bold;
    cursor: pointer;
}
button:active {
    transform: scale(0.95);
}
#resetBtn { background: #FF9800; }
#clearBtn { background: #F44336; }

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 20;
}

.big-start-btn {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 20px 40px;
    font-size: 2rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.big-start-btn:hover {
    background-color: #45a049;
}

.big-start-btn:active {
    transform: translateX(-50%) scale(0.95) !important;
}

.hidden { display: none !important; }
h1 { font-size: 2.5rem; text-shadow: 0 0 10px cyan; }
#nextBtn {
    font-size: 1.5rem;
    padding: 15px 30px;
    background: #4CAF50;
    margin-top: 20px;
}
/* Modal de Instrucciones */
.cup-modal, .draw-modal, .math-modal, .orbit-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.cup-modal.hidden, .draw-modal.hidden, .math-modal.hidden, .orbit-modal.hidden {
    display: none;
}

.cup-modal-content, .draw-modal-content, .math-modal-content, .orbit-modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    animation: slideIn 0.4s ease;
}

.cup-modal-content h2, .draw-modal-content h1, .math-modal-content h1, .orbit-modal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.instructions-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
}

.instructions-section h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #FFD700;
}

.instructions-grid {
    display: grid;
    gap: 15px;
    text-align: left;
}

.instruction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.instruction-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.instruction-icon {
    font-size: 1.8rem;
    min-width: 40px;
    text-align: center;
}

.start-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1e3c72;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.6);
}

.start-btn:active {
    transform: translateY(-1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@media (max-width: 768px) {
    .cup-modal-content, .draw-modal-content, .math-modal-content, .orbit-modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }

    .cup-modal-content h2, .draw-modal-content h1, .math-modal-content h1, .orbit-modal-content h1 {
        font-size: 2rem;
    }

    .instruction-icon {
        font-size: 1.5rem;
        min-width: 35px;
    }

    .instruction-item {
        font-size: 0.9rem;
    }
}
