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

[hidden] { display: none !important; }

html, body {
  height: 100%;
  background: #05060a;
  font-family: "Courier New", Consolas, monospace;
  color: #cfe9ff;
  overflow: hidden;
}

#wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#stage {
  position: relative;
  padding: 8px;
}

canvas {
  display: block;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border: 2px solid #1b2a3a;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 170, 255, 0.25),
              inset 0 0 70px rgba(0, 0, 0, 0.65);
  max-height: 94vh;
  max-width: 96vw;
  height: auto;
  width: auto;
  touch-action: none;
}

#hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -26px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: #5aa783;
  text-shadow: 0 0 6px rgba(90, 167, 131, 0.6);
}

/* ---------- 菜单 / 大厅覆盖层 ---------- */
#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 3, 10, 0.82);
  border-radius: 8px;
  z-index: 5;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 26px 22px;
  background: rgba(10, 16, 28, 0.92);
  border: 1px solid #1b2a3a;
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0, 170, 255, 0.25);
  max-width: 90%;
}

.logo {
  font-size: 42px;
  color: #ffd23f;
  text-shadow: 0 0 18px rgba(255, 210, 63, 0.6);
  letter-spacing: 4px;
}
.sub {
  font-size: 16px;
  color: #5fd0ff;
  letter-spacing: 6px;
  margin-top: -6px;
}
.panel h2 {
  font-size: 22px;
  color: #7fffd4;
  text-shadow: 0 0 12px rgba(127, 255, 212, 0.5);
}
.tip {
  font-size: 12px;
  color: #8fae9a;
  text-align: center;
  line-height: 1.6;
  opacity: 0.9;
}
.tip strong { color: #ffd23f; }

.btn {
  width: 200px;
  padding: 12px 0;
  font-size: 16px;
  font-family: inherit;
  color: #02030a;
  background: linear-gradient(180deg, #7fffd4, #3ad6a8);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 2px;
  box-shadow: 0 0 18px rgba(127, 255, 212, 0.35);
  transition: transform 0.08s;
}
.btn:active { transform: scale(0.96); }
.btn.ghost {
  background: transparent;
  color: #9fe;
  border: 1px solid #2a4a5a;
  box-shadow: none;
}

#roomInput {
  width: 200px;
  padding: 11px 12px;
  font-size: 16px;
  font-family: inherit;
  text-align: center;
  color: #cfe9ff;
  background: #02030a;
  border: 1px solid #2a4a5a;
  border-radius: 10px;
  outline: none;
}
#roomInput:focus { border-color: #5fd0ff; }

.msg {
  font-size: 13px;
  color: #ffd23f;
  min-height: 18px;
  text-align: center;
}
