* {
    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;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 900px;
    width: 100%;
}

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

.header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
    color: #27ae60;
    font-size: 1.1em;
    font-weight: 600;
}

.game-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
}

.info-item {
    text-align: center;
}

.label {
    display: block;
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 800px;
    height: 500px;
    margin: 0 auto;
    border: 3px solid #34495e;
    border-radius: 10px;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
    cursor: none;
}

.controls-hint {
    text-align: center;
    margin-top: 15px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.game-over, .start-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 10;
    min-width: 400px;
}

.start-screen {
    max-width: 500px;
}

.instructions {
    text-align: left;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.instructions p {
    margin: 10px 0;
    color: #2c3e50;
}

.instructions ul {
    margin: 10px 0 10px 30px;
    color: #2c3e50;
}

.instructions li {
    margin: 5px 0;
}

.hidden {
    display: none;
}

.game-over h2, .start-screen h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2em;
}

.game-over p {
    color: #7f8c8d;
    font-size: 1.2em;
    margin: 10px 0;
}

.final-score {
    font-size: 1.5em !important;
    color: #27ae60 !important;
    font-weight: bold;
    margin: 20px 0 !important;
}

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

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

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

.btn-large {
    padding: 20px 60px;
    font-size: 1.3em;
}

.btn-small {
    padding: 8px 20px;
    font-size: 0.9em;
    margin-top: 10px;
}

.name-input-container {
    margin: 20px 0;
    text-align: center;
}

.name-input-container label {
    display: block;
    font-size: 1.1em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.name-input-container input {
    padding: 12px 20px;
    font-size: 1.1em;
    border: 2px solid #667eea;
    border-radius: 25px;
    width: 80%;
    max-width: 300px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.name-input-container input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.high-scores {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.high-scores h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.3em;
}

#highScoresList {
    text-align: left;
}

.score-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 5px 0;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: transform 0.2s;
}

.score-entry:hover {
    transform: translateX(5px);
}

.score-entry.top-score {
    border-left-color: #f39c12;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.score-rank {
    font-weight: bold;
    color: #7f8c8d;
    min-width: 30px;
}

.score-name {
    flex: 1;
    color: #2c3e50;
    font-weight: 600;
    margin: 0 15px;
}

.score-points {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1em;
}

.no-scores {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
    font-style: italic;
}

/* Touch Controls */
.touch-controls {
    display: none; /* Hidden by default, shown on touch devices */
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.control-btn {
    width: 70px;
    height: 70px;
    font-size: 2em;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 5px rgba(46, 204, 113, 0.4);
}

.control-btn:hover {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }

    .header h1 {
        font-size: 1.8em;
    }

    #gameCanvas {
        height: 400px;
    }

    .game-over, .start-screen {
        min-width: 300px;
        padding: 30px 20px;
    }
}
