:root {
  --bg: #0f1220;
  --card-bg: #1a1e30;
  --text: #f2f3f7;
  --muted: #9aa0b4;
  --red: #e5484d;
  --blue: #3b82f6;
  --green: #22c55e;
  --yellow: #eab308;
  --purple: #a855f7;
  --orange: #f97316;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #2a2f45;
  flex-wrap: wrap;
  gap: 12px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.6rem;
}

.player-count {
  font-size: 1rem;
  color: var(--muted);
}

.player-count strong {
  color: var(--text);
  font-size: 1.2rem;
}

button.reset-btn {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
}

button.reset-btn:hover { opacity: 0.9; }

.join-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.join-info #qrcode {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
}

.join-info .join-url {
  color: var(--muted);
  font-size: 1.1rem;
  word-break: break-all;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 0 24px 24px;
}

.team-column {
  background-image: linear-gradient(rgba(15, 18, 32, 0.72), rgba(15, 18, 32, 0.88)), var(--team-image);
  background-color: var(--card-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-radius: 12px;
  padding: 16px;
  border-top: 6px solid var(--team-color, #888);
  min-height: 200px;
}

.team-column h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-column .team-count {
  font-size: 0.9rem;
  color: var(--muted);
}

.team-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-column li {
  background: rgba(255,255,255,0.06);
  padding: 8px 10px;
  border-radius: 6px;
}

.team-column li small {
  color: var(--muted);
}

/* Join page */
.join-page {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.join-page input {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 1px solid #2a2f45;
  background: var(--card-bg);
  color: var(--text);
  margin-bottom: 16px;
}

.join-page select {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 1px solid #2a2f45;
  background: var(--card-bg);
  color: var(--text);
  margin-bottom: 16px;
}

.join-page button {
  width: 100%;
  padding: 14px;
  font-size: 1.1rem;
  border-radius: 8px;
  border: none;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}

.join-page button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.team-result {
  margin-top: 24px;
  padding: 24px;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 12px;
  background-image: linear-gradient(rgba(15, 18, 32, 0.62), rgba(15, 18, 32, 0.84)), var(--team-image);
  background-color: var(--card-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border-top: 6px solid var(--team-color, #888);
}

.team-result h2 {
  margin: 0;
  font-size: 1.8rem;
}

.error-msg {
  color: var(--red);
  min-height: 1.2em;
  margin-bottom: 8px;
}
