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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 70px;
    /* Space for fixed header */
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 800px;
    width: 95%;
    /* Better space on mobile */
    margin: 20px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

/* Game Info */
.game-info {
    margin-bottom: 20px;
}

.score-container {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    flex-wrap: wrap;
}

.score-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.score-item .label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.score-item .value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
}

/* Message */
.message {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    display: none;
}

.message.info {
    background: #e3f2fd;
    color: #1976d2;
    border: 2px solid #1976d2;
}

.message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.message.error {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #c62828;
}

/* Game Area */
.game-area {
    position: relative;
    min-height: 350px;
    margin: 30px 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Marble */
.marble {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c92a2a);
    box-shadow:
        0 0 10px rgba(255, 107, 107, 0.5),
        inset -2px -2px 4px rgba(0, 0, 0, 0.3),
        inset 2px 2px 4px rgba(255, 255, 255, 0.5);
    z-index: 10;
    display: none;
    will-change: transform, left, top;
    pointer-events: none;
}

/* Cups Container */
.cups-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    width: 100%;
    height: 200px;
}

/* Cup */
.cup {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    will-change: transform;
    z-index: 20;
}

.marble.docked {
    top: auto !important;
    left: 50% !important;
    bottom: 5px !important;
    transform: translateX(-50%) !important;
    z-index: 1;
}

.cup.clickable:hover {
    transform: translateY(-10px) scale(1.05);
}

.cup-body {
    width: 120px;
    height: 150px;
    background: linear-gradient(to bottom, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    border-radius: 0 0 15px 15px;
    position: relative;
    z-index: 2;
    /* Higher than marble */
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.3),
        inset 0 -5px 10px rgba(0, 0, 0, 0.2);
    border: 3px solid #daa520;
    transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.cup-body::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -5px;
    right: -5px;
    height: 30px;
    background: linear-gradient(to bottom, #ffd700, #ffed4e);
    border-radius: 15px 15px 0 0;
    border: 3px solid #daa520;
    border-bottom: none;
}

.cup-body::after {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 30%;
    height: 40%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 50%;
}

/* Cup states */
.cup.lifted .cup-body {
    transform: translateY(-30px);
    transition: transform 0.3s ease;
}

.cup.correct .cup-body {
    background: linear-gradient(to bottom, #4caf50 0%, #66bb6a 50%, #4caf50 100%);
    border-color: #2e7d32;
    animation: pulse 0.5s ease-in-out;
}

.cup.correct .cup-body::before {
    background: linear-gradient(to bottom, #4caf50, #66bb6a);
    border-color: #2e7d32;
}

.cup.wrong .cup-body {
    background: linear-gradient(to bottom, #f44336 0%, #ef5350 50%, #f44336 100%);
    border-color: #c62828;
    animation: shake 0.5s ease-in-out;
}

.cup.wrong .cup-body::before {
    background: linear-gradient(to bottom, #f44336, #ef5350);
    border-color: #c62828;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* Instructions */
.instructions {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.instructions h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.instructions ul {
    list-style-position: inside;
    color: #555;
}

.instructions li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .cups-container {
        gap: 15px;
    }

    .cup-body {
        width: 90px;
        height: 120px;
    }

    .score-item {
        min-width: 100px;
        padding: 10px 15px;
    }

    .score-item .value {
        font-size: 1.5rem;
    }

    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
}
/* 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;
    }
}
