/* Phone client. Thumb-first: the answer pads fill the whole screen. */

body.play {
  height: 100dvh;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
}

.screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  text-align: center;
}

/* ----------------------------------------------------------------- join */

.brand {
  color: #fff;
  font-size: clamp(30px, 9vw, 48px);
  font-weight: 900;
  margin: 0 0 6px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

.join {
  width: min(400px, 100%);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.join input {
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  padding: 15px;
  border: 3px solid #e3e0ec;
  border-radius: 10px;
  outline: none;
  width: 100%;
}

.join input:focus {
  border-color: var(--a1);
}

.join button {
  font-size: 19px;
  padding: 15px;
}

.err {
  color: #d32f2f;
  font-weight: 700;
  margin: 0;
  min-height: 1.2em;
  font-size: 14px;
}

/* ---------------------------------------------------------------- lobby */

.you {
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  font-size: 22px;
  padding: 10px 26px;
  border-radius: 999px;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 5px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.big {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  line-height: 1.4;
}

.sub {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  margin: 0;
}

.mini-rules {
  margin-top: 10px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 14px;
  padding: 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-rules p {
  margin: 0;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mini-rules .shape {
  width: 0.8em;
  height: 0.8em;
}

.mini-rules .shape.check {
  color: #6ee06e;
}

.mini-rules .shape.cross {
  color: #ff8a80;
}

.mini-rules .sub {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.75;
}

/* Your own scorecard, shown on the podium. Ten cells, no scrolling. */
.scorecard {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  width: min(340px, 88vw);
}

.scorecard li {
  aspect-ratio: 1;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 900;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.scorecard .n {
  font-size: 10px;
  opacity: 0.75;
}

.scorecard .m {
  font-size: 20px;
  line-height: 1;
}

.scorecard li.ok {
  background: var(--c-green);
}

.scorecard li.no {
  background: var(--c-red);
}

/* Ran out of time, or joined after this one had already gone. */
.scorecard li.skip {
  background: rgba(255, 255, 255, 0.12);
  opacity: 0.75;
}

/* ----------------------------------------------------------------- quiz */

#quiz {
  padding: 0;
  gap: 0;
  position: relative;
}

.qbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex: 0 0 auto;
}

.pads {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 10px 10px;
  width: 100%;
  min-height: 0;
}

.pads.two-up {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

.pad {
  border-radius: 14px;
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22vw;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.22);
  transition: transform 0.1s ease, opacity 0.25s ease;
  position: relative;
}

.pad:active {
  transform: scale(0.96);
}

.pad .shape {
  font-size: 0.62em;
}

.pad-label {
  position: absolute;
  bottom: 6%;
  left: 0;
  right: 0;
  font-size: 6.5vw;
  font-weight: 900;
  letter-spacing: 0.02em;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pad.picked {
  box-shadow: inset 0 0 0 6px #fff, inset 0 -6px 0 rgba(0, 0, 0, 0.22);
}

.pad.faded {
  opacity: 0.3;
}

.pad-cover {
  position: absolute;
  inset: 0;
  background: rgba(35, 7, 77, 0.94);
  display: grid;
  place-items: center;
  color: #fff;
}

.cover-inner {
  text-align: center;
  padding: 24px;
}

.cover-icon {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 12px;
}

.cover-inner p {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

/* --------------------------------------------------------------- result */

#result {
  transition: background 0.3s;
}

#result.good {
  background: linear-gradient(160deg, #2fa02f, #1c6b1c);
}

#result.bad {
  background: linear-gradient(160deg, #e2453c, #8f1f19);
}

#result.meh {
  background: linear-gradient(160deg, #6b6382, #3b3550);
}

.verdict {
  color: #fff;
  font-size: clamp(32px, 11vw, 56px);
  font-weight: 900;
  animation: pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
}

.gain {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
}

.streak {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  min-height: 1.2em;
}

.rankbox {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 14px 28px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rankbox #rankText {
  font-size: 26px;
  font-weight: 900;
}

.rankbox .total {
  font-weight: 700;
  opacity: 0.8;
  font-size: 14px;
}

/* ---------------------------------------------------------------- logo */

.join-logo {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  width: min(78vw, 300px);
  height: auto;
  object-fit: contain;
  display: block;
  margin-bottom: 2px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Player screen: the AIO test range's own login backdrop, blurred.
   The image is pre-blurred at 720px (8 KB) rather than blurred in CSS — phones
   on venue wifi pay almost nothing for it, and low-end devices do no work.
   ───────────────────────────────────────────────────────────────────────────── */
body.play {
  background: #0b1b33;
  background-image: none;
}

body.play::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('assets/bg-blur.jpg') center / cover no-repeat;
  z-index: -2;
}

/* Darkened for legibility, deepening toward the bottom the way the platform's
   own login page does. */
body.play::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(6, 18, 38, 0.55) 0%,
    rgba(6, 18, 38, 0.72) 65%,
    rgba(6, 18, 38, 0.86) 100%
  );
  z-index: -1;
}

/* ---- partner logos on the join screen ---- */
.org-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(10px, 3.5vw, 20px);
  margin-bottom: 2px;
}

/* White knockout crest — no chip, it reads directly on the dark backdrop. */
.org-crest {
  height: clamp(66px, 19vw, 104px);
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}

/* The AIO and ADM+S marks are black by brand policy, so they get a light
   backing rather than being inverted. */
.org-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.org-chip img {
  height: clamp(30px, 8.5vw, 46px);
  width: auto;
  display: block;
}

/* The PIN field only appears when the quiz is enforcing a room code. */
#pin {
  text-align: center;
  letter-spacing: 0.06em;
}
