/* General Styles */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: lightblue;
    overflow: hidden;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Navigation Bar */
.navbar {
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px 0;
    position: fixed;
    top: 0;
    z-index: 1000;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 18px;
    margin: 0 15px;
}

.nav-link:hover {
    text-decoration: underline;
}

/* Game Container */
.game-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    margin-top: 60px;
    height: calc(100vh - 60px);
    width: 100%;
}

/* Game Canvas */
canvas {
    border: 2px solid black;
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .navbar {
        padding: 5px 0;
    }

    .nav-link {
        font-size: 16px;
        margin: 0 10px;
    }

    canvas {
        border: none;
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        transform: scale(0.9); /* Slightly reduce the scale */
        transform-origin: center center;
    }

    .game-container {
        margin-top: 0;
        height: 100vh;
        width: 100vw;
        overflow: hidden;
        position: fixed;
        top: 0;
        left: 0;
    }

    /* Optimize rendering performance */
    * {
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }
}

/* Prevent text selection during gameplay */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Title Card */
.title-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 300px;
}

.title-card h1 {
    font-size: 48px;
    margin: 0;
}

.title-card p {
    font-size: 18px;
    margin: 10px 0;
}

.title-card button, .title-card a {
    display: block;
    margin: 10px auto;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background: #333;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
}

.title-card button:hover, .title-card a:hover {
    background: #555;
}
