* {
    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: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.game-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.game-header h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tagline {
    font-size: 1.3rem;
    opacity: 0.9;
}

.game-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.info-card h2 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.6;
}

.info-card li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

.info-card strong {
    color: #764ba2;
}

.game-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.score-item .label {
    font-size: 0.9rem;
    opacity: 0.9;
}

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

#gameCanvas {
    display: block;
    margin: 0 auto;
    border: 3px solid #667eea;
    border-radius: 8px;
    background: #f0f0f0;
}

.touch-controls {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.direction-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.horizontal-controls {
    display: flex;
    gap: 80px;
}

.direction-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

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

.direction-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.direction-btn.up,
.direction-btn.down {
    width: 80px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.game-btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #e0e0e0;
    color: #333;
}

.game-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

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

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

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

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

.modal-content h2 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.final-score, .high-score-text {
    font-size: 1.3rem;
    margin: 15px 0;
    color: #333;
}

.final-score span, .high-score-text span {
    color: #764ba2;
    font-weight: bold;
    font-size: 1.5rem;
}

.footer {
    text-align: center;
    color: white;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2.5rem;
    }

    .tagline {
        font-size: 1rem;
    }

    #gameCanvas {
        max-width: 100%;
        height: auto;
    }

    .controls {
        flex-direction: column;
    }

    .game-btn {
        width: 100%;
    }

    .score-board {
        flex-direction: column;
        gap: 10px;
    }
}
