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

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.info-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
}

.info-item span {
    color: #ffeb3b;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#gameCanvas {
    background: #1a1a2e;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    cursor: crosshair;
    display: block;
    max-width: 100%;
    height: auto;
}

.controls {
    display: flex;
    gap: 15px;
}

.btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

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

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

.instructions {
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
}

.instructions h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.instructions p {
    margin: 8px 0;
    font-size: 1rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 500px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
    font-size: 2rem;
}

.modal-content p {
    margin: 15px 0;
    font-size: 1.2rem;
}

.stage-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.stage-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: white;
    padding: 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.stage-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

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

.stage-btn.cleared {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    border-color: #00f2fe;
}

.stage-btn.current {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    border-color: #fee140;
}

footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    .game-info {
        gap: 15px;
    }

    .info-item {
        font-size: 0.9rem;
        padding: 8px 15px;
    }

    .stage-list {
        grid-template-columns: repeat(3, 1fr);
    }
}
