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

html, body {
  width: 100%; height: 100%;
  background: #060a10;
  display: flex; align-items: center; justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  color: #e2e8f0;
}

/* ── Canvas ── */
#game {
  display: block;
  cursor: none;
  border-radius: 10px;
  box-shadow: 0 0 60px rgba(30, 80, 180, 0.15);
}

/* ── Overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 16, 0.88);
  backdrop-filter: blur(6px);
  z-index: 20;
}

/* ── Card ── */
.card {
  background: #111827;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  min-width: 320px;
  max-width: 420px;
  width: 90vw;
  box-shadow: 0 0 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04);
}

h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #63b3ed 0%, #9f7aea 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sub {
  font-size: 13px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: -10px;
}

/* ── Buttons ── */
.btn {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.25); }
.btn:active { background: rgba(255,255,255,0.06); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn.primary {
  background: linear-gradient(135deg, #2b6cb0, #553c9a);
  border-color: transparent;
  padding: 13px 36px;
  font-size: 16px;
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(99, 179, 237, 0.2);
}
.btn.primary:hover { filter: brightness(1.15); }

/* ── Divider ── */
.divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.2);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ── Join row ── */
.row { display: flex; gap: 8px; width: 100%; }

.code-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e2e8f0;
  outline: none;
  transition: border-color 0.15s;
}
.code-input:focus { border-color: rgba(99, 179, 237, 0.5); }
.code-input::placeholder { text-transform: none; letter-spacing: normal; color: rgba(255,255,255,0.2); }

/* ── Error ── */
.error {
  color: #fc8181;
  font-size: 13px;
  text-align: center;
}

/* ── Waiting card ── */
.invite-card { gap: 14px; }

.waiting-label {
  font-size: 17px;
  font-weight: 600;
  color: #f6e05e;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

.code-row {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
}
.code-row strong {
  color: #e2e8f0;
  font-family: 'SF Mono', monospace;
  font-size: 20px;
  letter-spacing: 0.15em;
}

.link-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.link-input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  outline: none;
  min-width: 0;
}

.hint {
  font-size: 12px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}
