html, body { margin: 0; height: 100%; background: #1b1b22; overflow: hidden; }
canvas#game { display: none; width: 100vw; height: 100vh; image-rendering: pixelated; touch-action: none; }

/* Menu screens use the Cute Fantasy panel colors */
.screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
  background: radial-gradient(circle at 50% 30%, #3e8948 0%, #265c42 55%, #181425 100%);
  font: 15px/1.4 "Trebuchet MS", system-ui, sans-serif; color: #3f2832;
}
.screen[hidden] { display: none; }
#screen-auth { flex-direction: column; gap: 18px; }

/* Game title on the auth screen */
.logo { display: flex; flex-direction: column; align-items: center; text-align: center; line-height: 1; }
.logo span {
  font-family: "Pixelify Sans", "Trebuchet MS", sans-serif; font-weight: 700; text-transform: uppercase; letter-spacing: 3px;
  color: #fee761;
  text-shadow: 3px 0 #3f2832, -3px 0 #3f2832, 0 3px #3f2832, 0 -3px #3f2832,
               3px 3px #3f2832, -3px 3px #3f2832, 3px -3px #3f2832, -3px -3px #3f2832,
               0 7px 0 #181425;
}
.logo-small { font-size: clamp(18px, 5vw, 28px); color: #ead4aa !important; }
.logo-big { font-size: clamp(34px, 11vw, 64px); margin-top: 6px; }
.panel {
  width: 100%; max-width: 340px; box-sizing: border-box; padding: 22px 22px 24px;
  background: #e4a672; border: 3px solid #3f2832; border-radius: 8px;
  box-shadow: inset 3px 3px 0 #ead4aa, inset -3px -3px 0 #b86f50, 0 8px 0 rgba(0,0,0,.35);
}
.panel.wide { max-width: 460px; }
h1, h2 { margin: 0 0 16px; text-align: center; color: #3f2832; letter-spacing: 1px; text-transform: uppercase; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
.muted { text-align: center; margin: 0 0 14px; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 8px; font: inherit; font-weight: bold; cursor: pointer;
  background: #b86f50; color: #ead4aa; border: 2px solid #3f2832; border-radius: 6px;
}
.tab.active { background: #3f2832; color: #fee761; }

label { display: block; margin-bottom: 10px; font-weight: bold; font-size: 13px; text-transform: uppercase; }
label[hidden] { display: none; }
input {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 9px 10px;
  font: 15px system-ui, sans-serif; color: #181425; background: #ead4aa;
  border: 2px solid #3f2832; border-radius: 6px; outline: none;
}
input:focus { border-color: #0095e9; }

.btn {
  display: block; width: 100%; padding: 11px; margin-top: 6px; cursor: pointer;
  font: inherit; font-weight: bold; font-size: 16px; text-transform: uppercase;
  color: #3f2832; background: #fee761; border: 3px solid #3f2832; border-radius: 6px;
  box-shadow: inset 0 -3px 0 #feae34;
}
.btn:disabled { opacity: .5; cursor: default; }
.error { min-height: 18px; margin: 4px 0; color: #9e2835; font-size: 13px; font-weight: bold; }

.classes { display: flex; gap: 12px; }
.class-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px;
  font: inherit; color: #3f2832; cursor: pointer;
  background: #b86f50; border: 3px solid #3f2832; border-radius: 8px;
}
.class-card canvas { width: 96px; height: 96px; image-rendering: pixelated; background: #3e8948; border: 2px solid #3f2832; border-radius: 6px; }
.class-card strong { font-size: 16px; text-transform: uppercase; color: #ead4aa; }
.class-card span { font-size: 12px; color: #ead4aa; text-align: center; }
.class-card.selected { background: #3f2832; outline: 3px solid #fee761; }
.class-card.selected strong { color: #fee761; }

/* Pixel font for all menu text (inputs keep a regular font for readability) */
.tab, .btn, label, h2, .muted, .error, .class-card strong, .class-card span {
  font-family: "Pixelify Sans", "Trebuchet MS", sans-serif; letter-spacing: 1px;
}
.tab { font-size: 18px; font-weight: 600; }
.btn { font-size: 20px; font-weight: 700; text-transform: uppercase; }
label { font-size: 15px; font-weight: 600; text-transform: uppercase; }
h2 { font-size: 20px; font-weight: 700; }
.muted { font-size: 16px; }
.error { font-size: 14px; font-weight: 600; }
.class-card strong { font-size: 20px; font-weight: 700; text-transform: uppercase; }
.class-card span { font-size: 14px; line-height: 1.3; }

/* In-game chat input (opened with Enter or by clicking the chat box) */
#chat-form { position: fixed; z-index: 10; display: flex; gap: 4px; box-sizing: border-box; max-width: calc(100vw - 8px); }
#chat-form[hidden], #chat-form [hidden] { display: none; }
#chat-form input, #chat-form button {
  display: block; margin: 0; padding: 7px 8px; width: auto;
  font: 10px/1.2 "Press Start 2P", monospace; color: #ffffff;
  background: rgba(24, 20, 37, .88); border: 2px solid #3f2832; border-radius: 4px;
}
#chat-form input:focus { border-color: #fee761; }
#chat-form #chat-input { flex: 1; min-width: 140px; }
#chat-form #chat-to { flex: none; width: 72px; color: #f6a5e0; }
#chat-form #chat-channel { flex: none; cursor: pointer; color: #ffffff; }
#chat-form #chat-channel[data-ch="team"] { color: #63c74d; }
#chat-form #chat-channel[data-ch="world"] { color: #feae34; }
#chat-form #chat-channel[data-ch="private"] { color: #f6a5e0; }

/* "New version" notice, top center over the game */
#update-bar {
  position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; max-width: calc(100vw - 16px); box-sizing: border-box;
  font: 10px/1.4 "Press Start 2P", monospace; color: #ffffff;
  background: rgba(24, 20, 37, .92); border: 2px solid #fee761; border-radius: 6px;
}
#update-bar[hidden] { display: none; }
#update-bar button {
  font: inherit; color: #3f2832; background: #fee761; border: 2px solid #3f2832; border-radius: 4px; padding: 6px 8px; cursor: pointer;
}
