/* Pong Relay — Lobby / Connect UI styles */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

h1 {
  font-size: clamp(2rem, 8vw, 3.5rem);
  margin: 0 0 1.5rem;
  text-align: center;
}

.lobby-controls {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
}

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

#code-input {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.75rem;
  border: 2px solid #334155;
  border-radius: 0.5rem;
  background: #1e293b;
  color: inherit;
}

#code-input:focus {
  outline: none;
  border-color: #3b82f6;
}

.btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #334155;
  color: #f8fafc;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #475569;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: #3b82f6;
}

.btn.primary:hover {
  background: #2563eb;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  text-align: center;
  min-height: 1.5em;
  margin: 0;
  color: #94a3b8;
}

.code-display {
  font-size: clamp(2.5rem, 12vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  background: #1e293b;
  border: 2px dashed #475569;
  border-radius: 0.75rem;
  padding: 1rem;
}

#game-container {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 0.5rem;
  overflow: hidden;
  margin: 0 auto;
}

#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-controls {
  display: flex;
  justify-content: center;
  padding: 1rem;
  gap: 1rem;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  z-index: 100;
  padding: 1rem;
}

.overlay p {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1.25rem;
  text-align: center;
  max-width: 90%;
}

[hidden] {
  display: none !important;
}
