* {
    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;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Header Section */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

.game-title {
    font-size: 3.5em;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

.game-subtitle {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 20px;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.game-container {
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    padding: 25px;
    position: relative;
    border: 3px solid #fff;
    max-width: 900px;
    width: 100%;
}

.score-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.score-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.score-item:hover {
    transform: translateY(-2px);
}

.score-label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#current-score, #last-score, #best-score {
    display: block;
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

#current-score {
    color: #27ae60;
}

#best-score {
    color: #e74c3c;
}

#gameCanvas {
    border: 3px solid #34495e;
    border-radius: 15px;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 70%, #90EE90 100%);
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
    display: block;
}

.game-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.start-screen, .game-over {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 40px 50px;
    border-radius: 25px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 3px solid rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
    backdrop-filter: blur(10px);
}

.start-screen h1, .game-over h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 2.8em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 700;
}

.start-screen p, .game-over p {
    color: #34495e;
    font-size: 1.3em;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.instructions {
    font-size: 1.1em !important;
    color: #7f8c8d !important;
    font-weight: 500 !important;
    margin-bottom: 8px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.instructions::before {
    content: "🎮";
    font-size: 1.2em;
}

.hidden {
    display: none !important;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    }
}

/* Control Hints - New Layout */
.control-hints {
    margin-top: 30px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    width: 100%;
}

.control-hint {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.control-hint::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.control-hint:hover::before {
    left: 100%;
}

.control-hint:hover {
    transform: translateX(10px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.control-hint:nth-child(1) { border-left: 4px solid #4CAF50; }
.control-hint:nth-child(2) { border-left: 4px solid #2196F3; }
.control-hint:nth-child(3) { border-left: 4px solid #FF9800; }
.control-hint:nth-child(4) { border-left: 4px solid #E91E63; }

.control-hint .icon {
    font-size: 3em;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.control-hint:hover .icon {
    transform: rotate(10deg) scale(1.1);
}

.control-hint .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-hint .title {
    font-weight: bold;
    font-size: 1.4em;
    margin: 0;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.control-hint .desc {
    font-size: 1.1em;
    opacity: 0.9;
    line-height: 1.4;
    margin: 0;
}

.control-hint .extra-info {
    font-size: 0.9em;
    opacity: 0.7;
    font-style: italic;
    margin-top: 5px;
}

/* Scoring Guide */
.scoring-guide {
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    color: white;
    max-width: 900px;
    width: 100%;
}

.scoring-guide h2 {
    text-align: center;
    font-size: 2em;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

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

.scoring-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.scoring-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.scoring-item.special {
    border-color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3); }
    to { box-shadow: 0 6px 12px rgba(255, 215, 0, 0.6); }
}

.scoring-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.scoring-details h3 {
    margin: 0 0 5px 0;
    font-size: 1.2em;
    color: white;
}

.points {
    font-size: 1.1em;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 5px;
}

.scoring-item.special .points {
    color: #FFD700;
}

.scoring-details .desc {
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.3;
}

.scoring-tips {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border-left: 4px solid #FFD700;
}

.scoring-tips h3 {
    margin: 0 0 20px 0;
    font-size: 1.4em;
    color: #FFD700;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.tip {
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 0.95em;
    line-height: 1.4;
    border-left: 3px solid #4CAF50;
}

.tip strong {
    color: #FFD700;
}

/* Footer */
.game-footer {
    margin-top: 30px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9em;
}

/* Responsive design */
@media (max-width: 900px) {
    body {
        padding: 10px;
    }
    
    .game-title {
        font-size: 2.5em;
    }
    
    .game-container {
        padding: 20px;
    }
    
    #gameCanvas {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    
    .score-board {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 15px;
    }
    
    .start-screen h1, .game-over h2 {
        font-size: 2.2em;
    }
    
    .start-screen, .game-over {
        padding: 25px 30px;
    }
    
    .control-hints {
        gap: 15px;
        margin-top: 20px;
    }
    
    .control-hint {
        padding: 20px 25px;
        gap: 15px;
    }
    
    .control-hint .icon {
        width: 60px;
        height: 60px;
        font-size: 2.2em;
    }
    
    .control-hint .title {
        font-size: 1.2em;
    }
    
    .control-hint .desc {
        font-size: 1em;
    }
    
    .scoring-guide {
        margin-top: 30px;
        padding: 20px;
    }
    
    .scoring-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2em;
    }
    
    .start-screen h1, .game-over h2 {
        font-size: 1.8em;
    }
    
    .instructions {
        font-size: 1em !important;
    }
    
    .scoring-guide h2 {
        font-size: 1.6em;
    }
    
    .scoring-item {
        padding: 15px;
        gap: 12px;
    }
    
    .scoring-icon {
        font-size: 2em;
    }
    
    .scoring-tips {
        padding: 20px;
    }
    
    .control-hint {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 12px;
    }
    
    .control-hint .icon {
        width: 50px;
        height: 50px;
        font-size: 2em;
        margin: 0 auto;
    }
    
    .control-hint .title {
        font-size: 1.1em;
    }
    
    .control-hint .desc {
        font-size: 0.95em;
    }
    
    .control-hint .extra-info {
        font-size: 0.85em;
    }
    
    .control-hint:hover {
        transform: translateY(-3px);
    }
}
