html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #0b1030;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#app canvas {
    image-rendering: pixelated;
}

/* The name field on the title screen: a real text input laid over the canvas,
   because a canvas cannot open a phone's keyboard. */
.name-field {
    position: fixed;
    box-sizing: border-box;
    margin: 0;
    padding: 0 4px;
    border: 2px solid #5d6ea8;
    border-radius: 0;
    background-color: #0a0d24;
    color: #ffffff;
    font-family: monospace;
    text-align: center;
    outline: none;
    -webkit-user-select: text;
    user-select: text;
    touch-action: manipulation;
}

.name-field:focus {
    border-color: #ffd24a;
}

.name-field::placeholder {
    color: #5d6ea8;
}

/* ?perf: the performance readout, bottom centre, clear of the touch buttons. */
.perf {
    position: fixed;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    padding: 2px 6px;
    background-color: rgba(10, 13, 36, 0.75);
    color: #9ff0a8;
    font: 10px/1.3 monospace;
    white-space: pre;
    pointer-events: none;
    z-index: 10;
}

/* Phones held upright are asked to turn sideways. */
#rotate {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    background-color: #0b1030;
    color: #ffd24a;
    font: bold 18px/1.3 monospace;
    text-transform: uppercase;
    text-align: center;
}

#rotate-phone {
    width: 36px;
    height: 64px;
    border: 4px solid #ffd24a;
    border-radius: 6px;
    animation: rotate-phone 2s ease-in-out infinite;
}

@keyframes rotate-phone {
    0%, 30% { transform: rotate(0deg); }
    60%, 100% { transform: rotate(-90deg); }
}

@media (orientation: portrait) and (pointer: coarse) {
    #rotate {
        display: flex;
    }
}

/* The touch buttons in the strips beside the game (src/touchpad.ts). */
.touch-side {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.touch-pad {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.12);
    touch-action: none;
}

.touch-pad svg {
    width: 100%;
    height: 100%;
    fill: rgba(255, 255, 255, 0.7);
}

.touch-pad.down {
    border-color: rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.35);
}
