:root {
  --cld-blue: #3448c5;
  --ink: #0c163b;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  display: flex;
  flex-direction: column;
}

header {
  padding: 2.5vh 4vw;
}

.logo {
  height: 6vh;
}

main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4vw;
  padding: 0 4vw 4vh;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 2rem;
}

.qr {
  border: 0.5rem solid var(--cld-blue);
}

.qr img {
  width: min(60vh, 80%);
  aspect-ratio: 1;
}

.hint {
  margin: 3vh 0 0;
  font-size: 3vh;
  font-weight: 600;
  color: var(--cld-blue);
}

.url {
  margin: 1vh 0 0;
  font-size: 2vh;
  opacity: 0.6;
}

.timer {
  background: var(--cld-blue);
  color: #fff;
}

.label {
  margin: 0;
  font-size: 4vh;
  font-weight: 500;
  opacity: 0.85;
}

.digits {
  margin: 2vh 0 0;
  font-size: 22vh;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.digits.ready {
  font-size: 14vh;
}

.quiz {
  grid-column: 1 / -1;
  background: var(--cld-blue);
  color: #fff;
  padding: 4vh 4vw;
}

.quiz .question {
  margin: 2vh 0 0;
  font-size: 8vh;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

/* Phone screen */

.phone header {
  padding: 4vh 6vw 2vh;
}

.phone .logo {
  height: 2.5rem;
}

.phone main {
  display: block;
  padding: 0 6vw 6vh;
}

.join {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 28rem;
  margin: 0 auto;
}

.join h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  color: var(--cld-blue);
}

.join label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 1rem;
  font-weight: 600;
}

.join input,
.join select {
  padding: 0.9rem 1rem;
  font-size: 1.1rem;
  border: 2px solid #c9cfe8;
  border-radius: 0.75rem;
  color: var(--ink);
  background: #fff;
}

.join input:focus,
.join select:focus {
  outline: none;
  border-color: var(--cld-blue);
}

.join button {
  margin-top: 0.5rem;
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: var(--cld-blue);
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
}

.waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.phone .quiz {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 28rem;
  min-height: 60vh;
  margin: 0 auto;
  padding: 0;
  background: none;
  color: var(--ink);
}

.phone .quiz .question {
  margin: 0;
  font-size: 1.75rem;
  color: var(--cld-blue);
}

.options {
  display: grid;
  gap: 1rem;
}

.options button {
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: var(--cld-blue);
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
}

.q-timer {
  margin: auto 0 0;
  font-size: 3rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.waiting .message,
.quiz .message {
  text-align: center;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--cld-blue);
}

.waiting .count {
  margin: 2rem 0 0;
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.waiting .count-label {
  margin: 0.5rem 0 0;
  font-size: 1rem;
  opacity: 0.6;
}

/* Admin */

.admin {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 28rem;
  margin: 0 auto;
}

.admin button {
  width: 100%;
  padding: 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  background: var(--cld-blue);
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
}

.admin button:disabled {
  background: #c9cfe8;
  cursor: default;
}
