* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe UI", sans-serif;
  background: linear-gradient(#2b2d4a 0%, #4a3d6b 100%);
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.stage { width: min(100vw, 1040px); padding: 8px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
}
.topbar h1 {
  color: #ffd76a; font-size: 28px;
  text-shadow: 0 2px 0 #00000055;
}
.home, .round-btn, .game-menu {
  font-size: 24px; text-decoration: none; background: #fffdf4;
  border: 3px solid #ff9d5c; border-radius: 50%;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.round-btn { min-width: 78px; border-radius: 16px; font-size: 16px; }
.game-menu { min-width: 88px; border-radius: 16px; font-size: 16px; }
.round-btn:active, .home:active, .game-menu:active { transform: scale(0.94); }
.canvas-wrap { position: relative; width: 100%; }
canvas {
  width: 100%; height: auto; display: block;
  border-radius: 20px; box-shadow: 0 8px 24px #00000066;
  touch-action: none; cursor: crosshair;
}

.join-overlay {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center;
  background: #1a1630cc; border-radius: 20px;
}
.join-card {
  background: #fffdf4; border: 4px solid #ff9d5c; border-radius: 22px;
  padding: 26px 34px; text-align: center; width: min(90%, 380px);
}
.join-card h2 { color: #4a3d6b; margin-bottom: 14px; font-size: 24px; }
.join-card input {
  width: 100%; font-size: 34px; text-align: center; letter-spacing: 8px;
  font-family: inherit; text-transform: uppercase;
  border: 3px solid #b9a8d8; border-radius: 14px; padding: 8px 4px;
  color: #4a3d6b; outline: none;
}
.join-card input:focus { border-color: #ff9d5c; }
.join-row { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.join-card button {
  font-family: inherit; font-size: 20px; font-weight: bold;
  padding: 10px 26px; border-radius: 14px; border: 3px solid #c96a2e;
  background: #ff9d5c; color: #3a2410; cursor: pointer;
}
.join-card button:last-child { background: #e8e2f4; border-color: #b9a8d8; color: #4a3d6b; }
.join-card button:active { transform: scale(0.96); }
.join-card p { margin-top: 12px; color: #7a6bb0; font-size: 15px; min-height: 20px; }
.join-overlay[hidden] { display: none; }
