:root {
  --bg: #0f1020;
  --surface: #1a1c34;
  --card: #23264a;
  --primary: #6c5ce7;
  --primary-2: #a29bfe;
  --accent: #00d2a8;
  --text: #eef0ff;
  --muted: #9aa0c7;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #2a2d57, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  backdrop-filter: blur(8px);
}

.brand { font-weight: 800; font-size: 18px; letter-spacing: 0.3px; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 18px 60px;
}

.card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.screen { animation: fade 0.25s ease; }
.screen.card { max-width: 420px; margin: 6vh auto 0; }

h1 { margin: 0 0 6px; font-size: 24px; }
h2 { margin: 0 0 12px; font-size: 18px; }
.section-title { margin: 26px 6px 14px; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--error); font-size: 13px; min-height: 18px; margin: 8px 0 0; }

label {
  display: block;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #12132a;
  color: var(--text);
  font-size: 16px;
}
input:focus { outline: 2px solid var(--primary); border-color: transparent; }

button { cursor: pointer; font-size: 15px; border-radius: 10px; }
button:disabled { opacity: 0.6; cursor: default; }

.primary {
  margin-top: 18px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.primary:hover { filter: brightness(1.07); }

.link {
  background: none;
  border: none;
  color: var(--primary-2);
  padding: 6px 0;
  text-decoration: underline;
}

.inline { display: flex; gap: 10px; }
.inline input { margin-top: 0; }
.inline .primary { margin-top: 0; width: auto; padding: 12px 22px; }
.join-row .inline { margin-top: 6px; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.game { text-align: center; }
.game-icon { font-size: 44px; }
.game h3 { margin: 8px 0 6px; }
.game .players { color: var(--accent); font-size: 12px; font-weight: 600; margin: 10px 0 0; }

.hidden { display: none !important; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
