html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #1a1c2c;
    overflow: hidden;
    /* Mobile : empêche le scroll, le "tirer pour rafraîchir" et la sélection de texte pendant qu'on gratte */
    overscroll-behavior: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#app {
    width: 100%;
    height: 100dvh;
}

#game-container {
    width: 100%;
    height: 100%;
}

/* Agrandit le jeu sans flou : garde l'effet pixel */
#game-container canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* ===================================================================
   ÉCRAN DE CONNEXION (src/online/authScreen.ts)
   =================================================================== */
.auth {
    box-sizing: border-box;
    max-width: 360px;
    height: 100%;
    margin: 0 auto;
    padding: 40px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    font-family: "Press Start 2P", monospace;
    color: #f4f4f4;
    /* Ici on veut pouvoir écrire, sélectionner et faire défiler (le reste du jeu l'interdit) */
    touch-action: pan-y;
    user-select: text;
    -webkit-user-select: text;
}

.auth [hidden] {
    display: none !important;
}

.auth-title {
    margin: 0 0 8px;
    text-align: center;
    font-size: 20px;
    color: #ffcd75;
    text-shadow: 3px 3px 0 #b13e53;
}

.auth button,
.auth input {
    font-family: inherit;
}

.auth-tabs {
    display: flex;
    gap: 8px;
}

.auth-tabs button {
    flex: 1;
    padding: 10px 0;
    font-size: 10px;
    color: #94b0c2;
    background: #333c57;
    border: 2px solid #1a1c2c;
    cursor: pointer;
}

.auth-tabs button.active {
    color: #1a1c2c;
    background: #ffcd75;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 8px;
    color: #94b0c2;
}

.auth-form input {
    padding: 10px;
    font-size: 12px;
    color: #f4f4f4;
    background: #333c57;
    border: 2px solid #566c86;
    outline: none;
}

.auth-form input:focus {
    border-color: #ffcd75;
}

.auth-submit {
    margin-top: 6px;
    padding: 14px 0;
    font-size: 12px;
    color: #f4f4f4;
    background: #38b764;
    border: 2px solid #1a1c2c;
    box-shadow: 0 4px 0 #1a1c2c;
    cursor: pointer;
}

.auth-submit:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #1a1c2c;
}

.auth-submit:disabled {
    opacity: 0.5;
}

.auth-link {
    align-self: center;
    font-size: 8px;
    color: #94b0c2;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}

.auth-message {
    margin: 0;
    font-size: 9px;
    line-height: 1.7;
    white-space: pre-line;
    text-align: center;
    color: #94b0c2;
}

.auth-message.ok {
    color: #a7f070;
}

.auth-message.error {
    color: #ef7d57;
}

/* ===================================================================
   FENÊTRE DE SAISIE (src/game/ui/textPrompt.ts)
   =================================================================== */
.prompt {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(26, 28, 44, 0.85);
    font-family: "Press Start 2P", monospace;
    touch-action: manipulation;
    user-select: text;
    -webkit-user-select: text;
}

.prompt-box {
    box-sizing: border-box;
    width: min(320px, 100%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    background: #333c57;
    border: 4px solid #1a1c2c;
    box-shadow: 0 6px 0 #1a1c2c;
}

.prompt-title {
    margin: 0;
    font-size: 10px;
    line-height: 1.6;
    color: #ffcd75;
}

.prompt-input {
    padding: 10px;
    font-family: inherit;
    font-size: 12px;
    color: #f4f4f4;
    background: #1a1c2c;
    border: 2px solid #566c86;
    outline: none;
}

.prompt-input:focus {
    border-color: #ffcd75;
}

.prompt-buttons {
    display: flex;
    gap: 10px;
}

.prompt-buttons button {
    flex: 1;
    padding: 12px 0;
    font-family: inherit;
    font-size: 10px;
    color: #f4f4f4;
    border: 2px solid #1a1c2c;
    box-shadow: 0 3px 0 #1a1c2c;
    cursor: pointer;
}

.prompt-cancel {
    background: #566c86;
}

.prompt-ok {
    background: #38b764;
}
