/* Import Press Start 2P font */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

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

body {
    font-family: 'Press Start 2P', cursive;
    background-color: #f0f8f0;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: linear-gradient(to bottom, #f0f8f0, #d0e8d0);
}

.game-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-layout {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.scores-container {
    display: none; /* Hide by default for desktop */
    width: 100%;
}

.game-header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.game-header h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 32px;
    margin-bottom: 15px;
    color: #c41e3a; /* Apple red */
    font-weight: normal;
}

.game-header p {
    font-size: 18px;
    margin-bottom: 10px;
}

.score-container {
    font-size: 18px;
    margin-bottom: 10px;
}

.high-scores, .game-logs {
    width: 250px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.high-scores h3, .game-logs h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 17px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: normal;
}

.scores-list, .game-history {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.scores-list p, .game-history p {
    margin-bottom: 8px;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.game-area {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    background-color: #e0f0e0;
    border: 4px solid #333;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background-color: #e0f0e0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

.game-footer {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 12px;
    margin-top: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.coffee-btn, .contact-btn {
    color: #FFDD00;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.coffee-btn:hover, .contact-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.contact-btn {
    color: #4CAF50;
}

.game-over-screen, .start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
    z-index: 10;
}

.game-over-screen h2, .start-screen h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 32px;
    margin-bottom: 25px;
    font-weight: normal;
    line-height: 1.5em;
}

.game-over-screen p, .start-screen p {
    font-family: 'Press Start 2P', cursive;
    font-size: 14px;
    margin-bottom: 10px;
}

.btn {
    background-color: #c41e3a;
    color: white;
    border: none;
    padding: 12px 24px;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin: 20px 0;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #a01830;
}

.history-container {
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    margin-top: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 4px;
}

.history-container h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    margin-bottom: 10px;
}

.game-history {
    font-family: 'Lato', sans-serif;
    font-size: 12px;
    text-align: left;
    max-height: 400px;
    overflow-y: auto;
}

.game-history p {
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-controls {
    display: none;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    width: 100%;
    max-width: 300px;
    gap: 25px;
}

.horizontal-controls {
    display: flex;
    justify-content: center;
    width: 100%;
    gap: 30px;
}

.control-btn {
    width: 75px;
    height: 75px;
    background-color: rgba(196, 30, 58, 0.9);
    color: #FFFFFF;
    border: none;
    border-radius: 15px;
    font-family: 'Press Start 2P', cursive;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 6px 0 #801020, 0 8px 10px rgba(0, 0, 0, 0.3);
    padding: 0;
    line-height: 1;
    position: relative;
    overflow: hidden;
}

.control-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.control-btn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #801020, 0 2px 4px rgba(0, 0, 0, 0.3);
    background-color: #a01830;
}

.control-btn:hover {
    background-color: #d62040;
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }
    
    .scores-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-top: 20px;
    }
    
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: flex;
    }
    
    .high-scores, .game-logs {
        width: 100%;
        max-width: 600px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .scores-list, .game-history {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .game-header h1 {
        font-size: 26px;
    }
    
    .score-container {
        font-size: 16px;
    }
    
    .mobile-controls {
        display: flex;
        margin-bottom: 30px;
    }
    
    .game-over-screen h2, .start-screen h2 {
        font-size: 26px;
    }
    
    .game-over-screen p, .start-screen p {
        font-size: 12px;
    }
    
    .btn {
        font-size: 14px;
        padding: 8px 16px;
    }
    
    .game-footer {
        font-size: 10px;
        margin-top: 30px;
        padding: 12px;
        gap: 10px;
    }
    
    .footer-buttons {
        gap: 10px;
    }
    
    .high-scores h3, .game-logs h3 {
        font-family: 'Press Start 2P', cursive;
        font-size: 18px;
    }
    
    .scores-list, .game-history {
        font-family: 'Lato', sans-serif;
        font-size: 10px;
        max-height: 150px; /* Limit to approximately 5 rows */
    }
    
    .game-history p {
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 22px;
    }
    
    .score-container {
        font-size: 14px;
    }
    
    .control-btn {
        width: 65px;
        height: 65px;
        font-size: 24px;
        border-radius: 12px;
    }
    
    .control-btn:before {
        height: 8px;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
    }
    
    .horizontal-controls {
        gap: 25px;
    }
    
    .mobile-controls {
        gap: 20px;
        margin-top: 25px;
    }
    
    .game-footer {
        font-size: 9px;
        margin-top: 25px;
        padding: 10px;
        gap: 8px;
    }
    
    .footer-buttons {
        gap: 8px;
    }
    
    .high-scores, .game-logs {
        padding: 10px;
    }
    
    .high-scores h3, .game-logs h3 {
        font-family: 'Press Start 2P', cursive;
        font-size: 16px;
    }
    
    .scores-list, .game-history {
        font-family: 'Lato', sans-serif;
        font-size: 8px; /* Reduced by 4 pixels from 12px */
        max-height: 120px; /* Limit to approximately 5 rows */
    }
    
    .game-history p {
        margin-bottom: 3px;
    }
    
    /* Reorder elements for mobile */
    .game-container {
        display: flex;
        flex-direction: column;
    }
    
    .game-layout {
        order: 1;
    }
    
    .mobile-controls {
        order: 2;
    }
    
    .scores-container {
        order: 3;
        margin-top: 30px;
        gap: 20px;
    }
    
    .game-footer {
        order: 4;
        margin-top: 30px;
    }
} 