html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #0f1216;
  color: #f2e9d8;
  font-family: "Helvetica Neue", "PingFang SC", "Microsoft Yahei", sans-serif;
  overflow: hidden;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

#ui {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  z-index: 10;
}

.titleRow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title {
  font-size: 18px;
  letter-spacing: 1px;
}

.tips {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.7;
}

#roomInfo {
  position: fixed;
  left: 16px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

#room,
#invite {
  font-size: 12px;
  opacity: 0.8;
  max-width: 520px;
  word-break: break-all;
}

#status {
  font-size: 13px;
  color: #ffd86b;
}

.debugInfo {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.4;
  white-space: pre-wrap;
  max-width: 520px;
  word-break: break-all;
}

#controls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  z-index: 12;
}

#readyBtn,
#newRoomBtn {
  padding: 6px 10px;
  font-size: 12px;
  background: #2a3a4a;
  color: #f2e9d8;
  border: 1px solid #3e5568;
  border-radius: 4px;
  cursor: pointer;
}

#readyBtn[disabled],
#newRoomBtn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

#aboutBtn {
  padding: 4px 8px;
  font-size: 11px;
  background: #1f2a36;
  color: #f2e9d8;
  border: 1px solid #3e5568;
  border-radius: 4px;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modalContent {
  width: min(720px, 90vw);
  max-height: 80vh;
  background: #111820;
  border: 1px solid #3e5568;
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  color: #f2e9d8;
}

.modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.modalTitle {
  font-size: 16px;
  letter-spacing: 0.5px;
}

#aboutClose {
  background: transparent;
  border: none;
  color: #f2e9d8;
  font-size: 20px;
  cursor: pointer;
}

.modalBody {
  font-size: 13px;
  line-height: 1.6;
}
