html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
  color: white;
  font-family: Arial, sans-serif;
}
button,input,select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

#menu {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10;
  width: 360px; max-width: calc(100% - 40px); box-sizing: border-box; padding: 20px;
  background: #1c1c1c; border: 1px solid #444; border-radius: 8px; animation: menu-drop 600ms ease-out;
}
@keyframes menu-drop { from { top: -300px; opacity: 0; } to { top: 50%; opacity: 1; } }
#menu h1 { margin: 0; font-size: 22px; font-weight: normal; text-align: center; }
#version { margin-top: 5px; margin-bottom: 20px; color: #777; font-size: 12px; text-align: center; }
.option { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.option input[type="text"], .option select { width: 180px; }
input,select,button { padding: 8px 10px; box-sizing: border-box; border: 1px solid #555; border-radius: 4px; background: #292929; color: white; }
input:focus,select:focus,button:focus { outline: 1px solid white; }
input[type="color"] { width: 60px; height: 36px; padding: 3px; }
hr { margin: 18px 0; border: 0; border-top: 1px solid #444; }
#singleplayer,#create-room { display: block; width: 100%; margin-bottom: 8px; }
#join-section { display: flex; gap: 8px; }
#room-code { flex: 1; min-width: 0; text-transform: uppercase; }
#join-room { width: 80px; }
#menu-status { min-height: 16px; margin: 12px 0 0; color: #aaa; font-size: 13px; text-align: center; }

#game-ui {
  position: absolute; top: 12px; left: 12px; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: 7px 9px; background: #1c1c1c; border: 1px solid #444; border-radius: 4px; font-size: 13px;
}
#game-info { display: flex; flex-direction: column; gap: 3px; }
#coordinates,#mode-status { color: #888; font-family: monospace; font-size: 12px; }
#mode-status:empty { display: none; }
#game-buttons { display: flex; gap: 6px; }
#start-round,#leave-game { padding: 4px 7px; font-size: 12px; }

#chat {
  position: fixed; left: 12px; bottom: 12px; z-index: 15; width: 330px; max-width: calc(100vw - 24px);
  background: rgba(28,28,28,.92); border: 1px solid #444; border-radius: 6px; overflow: hidden;
}
#chat-log { height: 145px; overflow-y: auto; padding: 8px 10px; box-sizing: border-box; font-size: 13px; }
.chat-message { margin: 0 0 5px; overflow-wrap: anywhere; }
.chat-message b { margin-right: 5px; }
#chat-form { display: flex; border-top: 1px solid #444; }
#chat-input { flex: 1; min-width: 0; border: 0; border-radius: 0; background: #222; }
#chat-form button { border-width: 0 0 0 1px; border-radius: 0; }

#countdown { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 25; font-size: 80px; font-weight: bold; text-shadow: 0 3px 12px black; pointer-events: none; }
.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); }
.overlay-box { width: 240px; box-sizing: border-box; padding: 20px; background: #1c1c1c; border: 1px solid #555; border-radius: 8px; text-align: center; }
.overlay-box h2 { margin: 0 0 16px; font-size: 20px; font-weight: normal; }
.overlay-box p { margin: 0 0 12px; color: #999; font-size: 13px; }
.overlay-box button { display: block; width: 100%; margin-top: 8px; }
canvas { display: block; width: 100%; height: 100%; }
