* { box-sizing: border-box; }
:root {
  --bg: #fef3c7;
  --bg2: #fde68a;
  --ink: #2a1a07;
  --primary: #2563eb;
  --green: #16a34a;
  --red: #ef4444;
  --soft: #ffffff;
  --line: #d6d3d1;
}
html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "SF Pro Display", system-ui, "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg2));
  color: var(--ink);
}
body { display: flex; flex-direction: column; min-height: 100vh; }

header {
  text-align: center;
  padding: clamp(1rem, 3vh, 2.5rem) 1rem 0.5rem;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 .5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.lead {
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  margin: 0 0 1rem;
  opacity: .85;
}
.lead b { color: var(--primary); }

.meta { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.pill {
  padding: .4rem 1rem;
  border-radius: 999px;
  color: white;
  font-weight: 700;
  font-size: clamp(.85rem, 1.2vw, 1.05rem);
  background: var(--primary);
}
.pill-theme { background: var(--green); }
.pill-phase { background: #6b7280; }
.pill-phase.studio { background: var(--green); }
.pill-phase.show-and-test { background: #f97316; }
.pill-phase.pause { background: var(--red); }
.pill-phase.plenum { background: #6366f1; }

.grid {
  flex: 1;
  display: grid;
  gap: clamp(1rem, 2vw, 2rem);
  padding: clamp(.5rem, 2vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  align-content: start;
}

.card {
  background: var(--soft);
  border-radius: 24px;
  padding: clamp(1rem, 2vw, 1.5rem);
  box-shadow: 0 8px 32px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 4px solid transparent;
  transition: border-color .2s;
}
.card.active { border-color: var(--green); }
.card.locked { border-color: var(--red); opacity: .6; }

.card .group-id {
  font-weight: 800;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--primary);
  letter-spacing: .05em;
}
.card .studio-name {
  font-weight: 800;
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  margin: .25rem 0 1rem;
  line-height: 1.1;
  word-wrap: break-word;
}

.qr {
  width: 100%;
  max-width: clamp(180px, 22vw, 320px);
  aspect-ratio: 1 / 1;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: .5rem;
}
.qr svg { width: 100%; height: 100%; }

.url {
  margin-top: 1rem;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: clamp(.75rem, 1vw, .95rem);
  background: #f1f5f9;
  padding: .35rem .6rem;
  border-radius: 8px;
  word-break: break-all;
}

.stats {
  margin-top: .8rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: clamp(.8rem, 1.1vw, 1rem);
  opacity: .75;
}

footer {
  text-align: center;
  padding: .5rem;
  font-size: .85rem;
  opacity: .5;
}
.muted { color: #555; }
