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

body {
    background-color: #111111; /* Darker grey background for better contrast */
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Mobile Screen Layout Locking Rule */
body.mobile-mode {
    overflow: hidden;
    touch-action: none;
    position: fixed;
    width: 100%;
    height: 100%;
}

#game-container {
    position: relative;
    border: 3px solid #aaaaaa;
    box-shadow: 0 0 10px #aaaaaa, 0 0 20px #aaaaaa inset;
    background-color: #3a3a3a;
    display: flex;
    flex-direction: column;
    /* Smooth scaling adjustments */
    transform-origin: center center;
    flex-shrink: 0;
}

#fullscreen-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2000;
    background-color: #333333;
    color: #ffffff;
    border: 2px solid #aaaaaa;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: 0 0 5px #aaaaaa;
    transition: all 0.2s ease;
}

#fullscreen-btn:hover {
    background-color: #555555;
    box-shadow: 0 0 10px #ffffff;
}

canvas {
    display: block;
    background: radial-gradient(circle, #555555 0%, #3a3a3a 70%);
}

#ui-panel {
    display: flex;
    justify-content: space-around;
    padding: 8px; /* Tighter vertical padding */
    background-color: #000;
    border-bottom: 3px solid #999999;
    box-shadow: 0 0 10px #999999;
}

.ui-box {
    text-align: center;
}

.ui-box h2 {
    font-size: 0.9em; /* Tighter font sizes */
    color: #bbbbbb;
    text-shadow: 0 0 5px #bbbbbb;
}

.ui-box p {
    font-size: 1.3em;
    color: #ffffff;
    font-weight: bold;
    text-shadow: 0 0 5px #ffffff;
}

#game-over-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;
    text-align: center;
    z-index: 10;
}

#game-over-screen h1 {
    font-size: 3.5em;
    color: #eeeeee;
    text-shadow: 0 0 10px #eeeeee;
}

#game-over-screen p {
    font-size: 1.3em;
    margin-bottom: 20px;
}

#restart-button {
    padding: 12px 25px;
    font-size: 1.1em;
    font-family: 'Courier New', Courier, monospace;
    background-color: #cccccc;
    color: #000;
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 0 10px #cccccc;
    transition: all 0.2s ease;
}

#restart-button:hover {
    background-color: #aaaaaa;
    box-shadow: 0 0 20px #fff;
}

.hidden {
    display: none !important;
}
