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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.navbar {
    background-color: #000000;
    height: 60px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

header {
    padding: 20px;
}

.logo {
    height: 40px;
    object-fit: contain;
}

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

h1 {
    font-family: 'Times New Roman', Times, serif;
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 50px;
    min-height: 60px;
    color: #333;
    border: 2px solid #000000;
    padding: 15px 30px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
}

.score-display {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.game-area {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.game-wrapper {
    position: relative;
    display: inline-block;
}

.mobile-controls {
    display: none;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}

.control-row {
    display: flex;
    gap: 5px;
}

.control-btn {
    width: 50px;
    height: 50px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.control-btn:active {
    background-color: #555;
}

#gameCanvas {
    border: 2px solid #333;
    background-color: #f5f5f5;
    max-width: 100%;
    height: auto;
    display: block;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(128, 128, 128, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.game-overlay.hidden {
    display: none;
}

#playBtn {
    padding: 20px 40px;
    font-size: 1.5rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 600;
}

#playBtn:hover {
    background-color: #555;
}

#restartBtn {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1rem;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#restartBtn:hover {
    background-color: #555;
}

.code-display {
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

.code-display pre {
    background-color: #1e1e1e;
    color: #00ff00;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-wrap: break-word;
    white-space: pre-wrap;
    min-height: 60px;
}

@keyframes glitch {
    0% { filter: invert(0); }
    50% { filter: invert(1); transform: skewX(5deg); }
    100% { filter: invert(0); }
}

.glitch {
    animation: glitch 0.5s;
}

.author-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.author-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.message {
    font-size: 1.5rem;
    font-weight: 300;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
}

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

    .logo {
        height: 30px;
    }

    .mobile-controls {
        display: flex;
    }

    .game-area {
        gap: 15px;
    }

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

    .code-display {
        max-width: 350px;
    }

    .code-display pre {
        font-size: 0.8rem;
    }

    .author-photo {
        width: 80px;
        height: 80px;
    }

    .message {
        font-size: 1.2rem;
    }
}

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

    #gameCanvas {
        max-width: 300px;
    }

    .code-display {
        max-width: 300px;
    }

    .score-display {
        font-size: 1.2rem;
    }
}