* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f5f0e1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ── Lobby ───────────────────────────────────────── */
#lobby {
  position: fixed;
  inset: 0;
  background: #f5f0e1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

#lobby.hidden {
  display: none;
}

.lobby-inner {
  text-align: center;
  padding: 2rem;
  max-width: 360px;
  width: 100%;
}

.lobby-icon {
  width: 160px;
  height: auto;
  margin-bottom: 0.8rem;
}

.lobby-inner h1 {
  font-family: 'Patrick Hand', cursive;
  font-size: 2.8rem;
  color: #666;
  margin-bottom: 2rem;
  letter-spacing: 0.1em;
}

.lobby-inner button {
  display: block;
  width: 100%;
  padding: 1rem;
  margin: 0.6rem 0;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.4rem;
  border: 2px solid #aaa;
  border-radius: 8px;
  background: transparent;
  color: #555;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.lobby-inner button:hover,
.lobby-inner button:active {
  border-color: #777;
  color: #333;
}

.lobby-divider {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.3rem;
  color: #888;
  margin: 1.4rem 0 0.8rem;
}

.lobby-status {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.2rem;
  color: #666;
  margin-top: 1rem;
  min-height: 1.6em;
}

.join-input {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.join-input input {
  flex: 1;
  padding: 0.8rem;
  font-family: 'Patrick Hand', cursive;
  font-size: 1.6rem;
  text-align: center;
  letter-spacing: 0.3em;
  border: 2px solid #aaa;
  border-radius: 8px;
  background: transparent;
  color: #444;
  outline: none;
  text-transform: uppercase;
}

.join-input input:focus {
  border-color: #777;
}

.join-input button {
  width: auto;
  padding: 0.8rem 1.4rem;
  margin: 0;
}

.host-display {
  margin-top: 1.2rem;
}

.code-label {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.1rem;
  color: #666;
}

.room-code {
  font-family: 'Patrick Hand', cursive;
  font-size: 3.2rem;
  letter-spacing: 0.4em;
  color: #444;
  margin: 0.4rem 0;
  cursor: pointer;
  padding: 0.4rem 1rem;
  border: 2px dashed #aaa;
  border-radius: 8px;
  display: inline-block;
  transition: border-color 0.2s;
}

.room-code:active {
  border-color: #666;
}

.code-hint {
  font-family: 'Patrick Hand', cursive;
  font-size: 1rem;
  color: #777;
}

/* ── Input Mode Toggle ─────────────────────────────── */
.input-mode-toggle {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.05rem;
  color: #999;
  margin-top: 0.2rem;
}

.mode-opt {
  cursor: pointer;
  transition: color 0.2s;
}

.mode-opt.active {
  color: #555;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mode-sep {
  margin: 0 0.3rem;
  color: #bbb;
}

.lobby-version {
  font-family: 'Patrick Hand', cursive;
  font-size: 1.1rem;
  color: #888;
  margin-top: 2rem;
}

.update-link {
  cursor: pointer;
  transition: color 0.2s;
}

.update-link:hover {
  color: #555;
}

.update-link.available {
  color: #555;
  text-decoration: underline;
  text-underline-offset: 2px;
}
