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

body {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: #fff;
  color: #0a0a0a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.panel {
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  padding: 1.5rem;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

h1 {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.size-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

label {
  font-size: 0.75rem;
  color: #737373;
}

input[type="number"] {
  width: 4rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  color: #0a0a0a;
  font-family: inherit;
  font-size: 0.875rem;
}

input[type="number"]:focus {
  outline: none;
  border-color: #0a0a0a;
}

.times {
  color: #737373;
  margin-top: 1.25rem;
}

.btn {
  border: none;
  border-radius: 0.25rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
  background: #0a0a0a;
  color: #fafafa;
}

.btn:hover { opacity: 0.9; }

.btn:disabled { opacity: 0.5; cursor: wait; }

.btn-secondary {
  background: #f5f5f5;
  color: #0a0a0a;
}

.btn-secondary:hover { background: #e5e5e5; }

.url-box {
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  word-break: break-all;
  user-select: all;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
}

.btn-row .btn { flex: 1; }

.back-btn {
  background: none;
  border: none;
  color: #737373;
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.back-btn:hover { color: #0a0a0a; }

.status-text {
  font-size: 0.75rem;
  color: #737373;
  min-height: 1rem;
}

.hidden { display: none; }

/* ── Room / game page ─────────────────────────────────────── */

.room-page,
.room-page body {
  display: block;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

html:has(.room-page) {
  height: 100%;
  overflow: hidden;
}

.room-page {
  background: #fff;
}

.room-page #glcanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.room-overlay {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.room-chip {
  width: min(100%, 720px);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  pointer-events: auto;
}

#room-id {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: #737373;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-link {
  font-size: 0.75rem;
  color: #0a0a0a;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover { opacity: 0.6; }

.secondary-action-small {
  appearance: none;
  border: 1px solid #e5e5e5;
  border-radius: 0.25rem;
  padding: 0.25rem 0.75rem;
  font-family: inherit;
  font-size: 0.75rem;
  background: #f5f5f5;
  color: #0a0a0a;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.secondary-action-small:hover { background: #e5e5e5; }
