/* Colours and layout follow chainguard.dev: light page, white panels with
   thin borders and square corners, purple accent, monospace uppercase labels. */
:root {
  --page: #fbfbff;
  --inset: #f8f6fe;
  --border: #e7e8e8;
  --ink: #0d161c;
  --muted: #7a7e81;
  --blurple: #6226fb;
  --blue: #3443f4;
  --fuchsia: #eb02e0;
  --lime: #04bd13;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--page);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.logo { width: 125px; height: 20px; }

main {
  max-width: 640px;
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  padding: 32px 16px;
  border-inline: 1px solid var(--border);
}
.host main { max-width: 1280px; padding: 40px 48px; }

h1, h2 { margin: 0.4em 0; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
p { line-height: 1.5; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 0; }

.label {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--blurple);
}

.primary {
  padding: 14px 28px;
  font-family: var(--mono);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--blurple);
}
.primary:hover { background: var(--ink); }

.panel {
  padding: 32px 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
}

.join { margin-top: 8vh; }
.join input {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 14px;
  font-size: 1.2rem;
  text-align: center;
  color: var(--ink);
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 0;
}
.join input:focus { outline: 2px solid var(--blurple); outline-offset: -1px; }
.join .primary { width: 100%; margin-top: 8px; }
.host .join { max-width: 480px; margin-inline: auto; }
.error { min-height: 1.5em; color: var(--fuchsia); font-weight: 600; }

.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.timer {
  min-width: 3em;
  padding: 6px 14px;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: var(--ink);
}

.answers { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
@media (min-width: 600px) { .answers { grid-template-columns: 1fr 1fr; } }

.answer {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 16px 18px;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: left;
  color: #fff;
}
.answer:disabled { opacity: 0.4; }
.shape { font-size: 1.4rem; }

/* Blurple and blue sit on opposite corners of the 2x2 grid. */
.c0 { background: var(--blurple); }
.c1 { background: var(--fuchsia); }
.c2 { color: var(--ink); background: var(--lime); }
.c3 { background: var(--blue); }

.message { margin-top: 12vh; }

.result { margin-top: 12vh; border-top: 6px solid var(--fuchsia); }
.result.right { border-top-color: var(--lime); }
.result h2 { font-size: 2rem; }
.points { margin: 0; font-family: var(--mono); font-size: 2.6rem; font-weight: 700; color: var(--blurple); }

.board {
  margin: 24px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  counter-reset: rank;
}
.board li {
  display: flex;
  gap: 16px;
  padding: 14px 18px;
  font-weight: 600;
  border-top: 1px solid var(--border);
  counter-increment: rank;
}
.board li:first-child { border-top: 0; }
.board li::before { content: counter(rank, decimal-leading-zero); font-family: var(--mono); color: var(--muted); }
.board li span:first-child { flex: 1; }
.board li span:last-child { font-family: var(--mono); }

/* Host screen, sized for a projector. */
.host h1 { font-size: 2.8rem; }
.host .final h1, .host .standings h1 { text-align: center; }
.host .bar { font-size: 1.1rem; }
.host .timer { font-size: 2.2rem; }
.host .answers { grid-template-columns: 1fr 1fr; gap: 16px; }
.host .answer { min-height: 120px; padding: 24px; font-size: 1.6rem; }
.answer.dim { opacity: 0.25; }
.answer.correct { outline: 4px solid var(--ink); outline-offset: 4px; }
.count { margin-left: auto; font-family: var(--mono); font-size: 2.2rem; font-weight: 700; }

.lobby { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lobby .panel { padding: 40px 24px; }
.lobby .players { grid-column: 1 / -1; }
.url { margin-top: 16px; font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; }
.code {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 6rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--blurple);
}
.names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}
.names li {
  padding: 8px 14px;
  font-weight: 600;
  background: var(--inset);
  border: 1px solid var(--border);
}

.next { display: block; margin: 32px auto 0; }

.note {
  margin-top: 24px;
  padding: 20px 24px;
  font-size: 1.3rem;
  background: var(--inset);
  border-left: 4px solid var(--blurple);
}
.note p { margin: 12px 0 0; }

.host .board { max-width: 800px; font-size: 1.6rem; }
.final .board li:nth-child(1) { font-size: 2.2rem; color: #fff; background: var(--blurple); }
.final .board li:nth-child(1)::before { color: #fff; }
.final .board li:nth-child(2) { font-size: 1.9rem; background: var(--inset); }
.final .board li:nth-child(3) { font-size: 1.7rem; background: var(--inset); }
