/* Teacher studio and projector. Projector first: big, high contrast, readable from the back row. */

/* Top bar ------------------------------------------------------------------ */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(22, 12, 34, 0.82);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand strong { font-size: 1.15rem; letter-spacing: -0.01em; }
.brand.big strong { font-size: 1.5rem; }
.brand.big .logo { width: 40px; height: 40px; }
.crumb { color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.bar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { font-size: 0.9rem; }

/* Pages ---------------------------------------------------------------------- */
.page { max-width: 1080px; margin: 0 auto; padding: clamp(20px, 4vw, 44px) clamp(16px, 3vw, 36px) 120px; }
.page-head { display: grid; gap: 10px; margin-bottom: 26px; }
.page-head h1, .review h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); letter-spacing: -0.04em; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 62ch; }
.stack { display: grid; gap: 14px; }
.panel { background: rgba(36, 20, 51, 0.72); border: 1px solid var(--line); border-radius: 22px; padding: 22px; display: grid; gap: 14px; align-content: start; }
.panel h2 { font-size: 1.35rem; }

.sticky-actions {
  position: sticky;
  bottom: 0;
  margin: 26px calc(-1 * clamp(16px, 3vw, 36px)) 0;
  padding: 14px clamp(16px, 3vw, 36px);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(22, 12, 34, 0), rgba(22, 12, 34, 0.94) 30%);
}
.sticky-actions .muted { margin-right: auto; }

/* Sign-up and login ----------------------------------------------------------------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 460px) minmax(260px, 420px);
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 6vw, 80px);
  padding: 32px 20px;
}
.auth-card { background: rgba(36, 20, 51, 0.86); border: 1px solid var(--line); border-radius: 26px; padding: clamp(22px, 4vw, 36px); display: grid; gap: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
.auth-card h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.auth-points li { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.auth-points svg { width: 40px; height: 40px; }
.auth-points strong { display: block; margin-bottom: 4px; font-size: 1.05rem; }
.password { display: flex; gap: 8px; align-items: center; }
.password input { flex: 1; }
.form-error { color: #ffb3be; font-weight: 700; min-height: 1.2em; }

/* Your quizzes ------------------------------------------------------------------------ */
.rejoin { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-radius: 18px; background: rgba(240, 193, 77, 0.12); border: 1px solid rgba(240, 193, 77, 0.45); margin-bottom: 22px; flex-wrap: wrap; }
.drop {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 24px;
  align-items: center;
  padding: 26px;
  border-radius: 24px;
  border: 2px dashed rgba(240, 193, 77, 0.45);
  background: rgba(240, 193, 77, 0.06);
  margin-bottom: 30px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.drop.over { background: rgba(240, 193, 77, 0.16); border-color: var(--gold); }
.drop.busy { opacity: 0.85; }
.drop.busy .drop-actions { pointer-events: none; opacity: 0.5; }
.drop h2 { font-size: 1.5rem; margin-bottom: 6px; }
.drop p { color: var(--muted); max-width: 60ch; }
.drop-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.drop-status { grid-column: 1 / -1; font-size: 0.95rem; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--gold); outline-offset: 3px; }

.quiz-list { display: grid; gap: 14px; }
.quiz-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: 20px; background: rgba(36, 20, 51, 0.78); border: 1px solid var(--line); flex-wrap: wrap; }
.quiz-card.builtin { border-color: rgba(240, 193, 77, 0.3); }
.quiz-card h2 { font-size: 1.3rem; margin-bottom: 4px; }
.quiz-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.danger-text { color: #ffb3be; }

/* Check the questions ------------------------------------------------------------------- */
.title-field input { font-size: 1.4rem; font-weight: 700; padding: 14px 16px; }
.review form { display: grid; gap: 18px; }
.warnings { display: grid; gap: 6px; padding: 14px 18px; border-radius: 14px; background: rgba(240, 193, 77, 0.12); border: 1px solid rgba(240, 193, 77, 0.4); }
.q-list { display: grid; gap: 16px; }
.q-card { display: grid; gap: 14px; padding: 18px 20px; border-radius: 20px; background: rgba(36, 20, 51, 0.8); border: 1px solid var(--line); scroll-margin: 100px; }
.q-card.unsure { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(240, 193, 77, 0.45); background: rgba(58, 36, 16, 0.55); }
.q-card.shake { animation: shake 0.45s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.q-card header { display: flex; align-items: center; gap: 12px; }
.q-card header strong { font-size: 1.05rem; }
.q-card header .btn { margin-left: auto; }
.tag { padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 800; }
.tag.check { background: var(--gold); color: var(--gold-ink); }
.tag.ok { background: var(--good-soft); color: #b7f3cf; }
.reason { color: #ffe2a3; font-size: 0.95rem; }
.q-card textarea { resize: vertical; min-height: 64px; font-size: 1.1rem; }
.answers { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.answers legend { font-weight: 700; margin-bottom: 8px; font-size: 0.95rem; }
.answer-row { display: grid; grid-template-columns: 28px 36px 1fr auto; gap: 10px; align-items: center; }
.answer-row input[type="radio"] { width: 24px; height: 24px; accent-color: var(--good); margin: 0; }
.answer-row:has(input[type="radio"]:checked) input.plain { border-color: var(--good); box-shadow: 0 0 0 2px rgba(61, 206, 122, 0.25); }
.swatch { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; padding: 7px; }
.swatch svg { width: 100%; height: 100%; }
.a0 { background: var(--a1); }
.a1 { background: var(--a2); }
.a2 { background: var(--a3); }
.a3 { background: var(--a4); }
.q-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.time { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); }
.time select { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(10, 5, 18, 0.55); }
.add-row { display: flex; justify-content: center; }

/* Pictures ----------------------------------------------------------------------------- */
.pic-list { display: grid; gap: 14px; }
.pic-card { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: center; padding: 14px; border-radius: 20px; background: rgba(36, 20, 51, 0.8); border: 1px solid var(--line); }
.pic-card.busy { opacity: 0.6; pointer-events: none; }
.pic-thumb { aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #120a1c; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.pic-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pic-body { display: grid; gap: 8px; }
.pic-body p { font-size: 1.05rem; }
.pic-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Team setup ----------------------------------------------------------------------------- */
.setup-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.team-list { display: grid; gap: 8px; }
.team-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; }
.team-dot { width: 12px; height: 12px; border-radius: 99px; background: var(--gold); }
.team-row input { font-size: 1.1rem; font-weight: 700; }
.range { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }

/* Lobby ----------------------------------------------------------------------------------- */
.lobby { display: grid; grid-template-columns: minmax(340px, 1.05fr) 1fr; gap: clamp(20px, 3vw, 44px); padding: clamp(18px, 3vw, 40px); align-items: start; max-width: 1500px; margin: 0 auto; }
.join-card { background: #fff; color: var(--ink); border-radius: 30px; padding: clamp(18px, 2.4vw, 30px); display: grid; justify-items: center; gap: 8px; text-align: center; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.join-card .kicker { color: #6a4bdc; font-size: 1rem; }
.qr { width: min(100%, 46vh, 440px); height: auto; aspect-ratio: 1; }
.join-url { font-size: clamp(1rem, 1.5vw, 1.35rem); color: #4b3d5c; }
.join-url strong { color: var(--ink); }
.code { font-family: var(--mono); font-weight: 800; font-size: clamp(3rem, 7vw, 6rem); letter-spacing: 0.08em; line-height: 1; color: var(--ink); }
.code span { display: inline-block; width: 0.35em; }
.join-card .btn.ghost { color: var(--ink); border-color: rgba(22, 12, 34, 0.25); }
.roster h2 { font-size: clamp(2rem, 3.4vw, 3rem); margin-bottom: 8px; }
.roster ul { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.roster li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; background: rgba(36, 20, 51, 0.8); border: 1px solid var(--line); font-size: clamp(1.1rem, 1.6vw, 1.45rem); font-weight: 800; }
.roster .dot { width: 14px; height: 14px; border-radius: 99px; background: #6d6480; }
.roster .status { font-size: 0.8em; color: var(--muted); font-weight: 700; }
.roster li.here { border-color: rgba(61, 206, 122, 0.6); background: rgba(61, 206, 122, 0.12); }
.roster li.here .dot { background: var(--good); box-shadow: 0 0 0 5px rgba(61, 206, 122, 0.2); }
.roster li.here .status { color: #b7f3cf; }
.roster li.away .dot { background: var(--gold); }
.keys { color: var(--muted); font-size: 0.95rem; }

/* Question and reveal ------------------------------------------------------------------- */
.stage { height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto 1fr; overflow: hidden; position: relative; }
.stage-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 12px clamp(14px, 2vw, 28px); border-bottom: 1px solid var(--line); }
.stage-bar .bar-actions { justify-content: flex-end; }
.progress { font-weight: 800; font-size: clamp(1rem, 1.5vw, 1.4rem); color: var(--muted); }
.clock { position: relative; width: clamp(64px, 7vw, 96px); height: clamp(64px, 7vw, 96px); }
.clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.clock circle { fill: none; stroke-width: 7; }
.clock .track { stroke: rgba(246, 241, 231, 0.16); }
.clock .ring { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.1s linear; }
.clock.hurry .ring { stroke: var(--bad); }
.clock.paused .ring { stroke: var(--muted); }
.clock strong { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(1.6rem, 2.6vw, 2.4rem); font-variant-numeric: tabular-nums; }
.answer-badge { padding: 10px 22px; border-radius: 999px; background: var(--good); color: #042412; font-weight: 900; font-size: clamp(1.1rem, 1.8vw, 1.6rem); }

.play {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 21vw);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "prompt prompt" "art side" "tiles tiles";
  gap: clamp(10px, 1.6vh, 20px) clamp(12px, 1.8vw, 28px);
  padding: clamp(10px, 2vh, 24px) clamp(14px, 2vw, 32px);
  min-height: 0;
}
.no-art .play { grid-template-areas: "prompt prompt" "side side" "tiles tiles"; grid-template-rows: auto auto 1fr; }
.prompt { grid-area: prompt; font-size: clamp(1.8rem, 4.1vw, 4.2rem); text-align: center; letter-spacing: -0.03em; line-height: 1.12; }
.prompt.medium { font-size: clamp(1.6rem, 3.3vw, 3.4rem); }
.prompt.long { font-size: clamp(1.4rem, 2.6vw, 2.7rem); }
/* The picture fills whatever room the row leaves, so it never pushes the answers off screen. */
.art { grid-area: art; position: relative; min-height: 0; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.side { grid-area: side; align-self: center; display: grid; gap: 12px; padding: 18px; border-radius: 20px; background: rgba(36, 20, 51, 0.8); border: 1px solid var(--line); }
.no-art .side { grid-template-columns: auto 1fr; align-items: center; justify-self: center; max-width: 900px; }
.no-art .side .keys { display: none; }
.answered { display: grid; justify-items: center; }
.answered strong { font-size: clamp(3rem, 6vw, 5.5rem); line-height: 1; }
.answered span { color: var(--muted); font-weight: 700; }
.side h2 { font-size: 1.4rem; }
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li { display: grid; grid-template-columns: 1.6em 1fr auto auto; gap: 8px; align-items: center; font-size: clamp(0.95rem, 1.3vw, 1.2rem); font-weight: 700; }
.board .rank { color: var(--muted); }
.board .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .delta { color: var(--good); font-size: 0.85em; }
.no-art.phase-reveal .side { grid-template-columns: 1fr; width: min(900px, 100%); }

.tiles { grid-area: tiles; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1.2vw, 16px); }
.no-art .tiles { align-content: center; }
.tile {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(10px, 1.4vw, 20px);
  min-height: clamp(64px, 11vh, 130px);
  padding: clamp(10px, 1.4vh, 18px) clamp(14px, 1.6vw, 24px);
  border-radius: 18px;
  color: #fff;
  font-weight: 800;
  font-size: clamp(1.2rem, 2.4vw, 2.4rem);
  line-height: 1.15;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18);
  transition: opacity 0.25s ease, transform 0.25s ease, filter 0.25s ease;
}
.tile.a2 { color: var(--gold-ink); }
.tile-shape { width: clamp(38px, 4.2vw, 64px); height: clamp(38px, 4.2vw, 64px); }
.tile-shape svg { width: 100%; height: 100%; }
.tile-text { overflow-wrap: anywhere; }
.tile-count { min-width: 1.8em; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); text-align: center; font-size: 0.8em; }
.tile.wrong { opacity: 0.32; filter: saturate(0.6); }
.tile.correct { transform: scale(1.02); box-shadow: 0 0 0 5px #fff, 0 16px 40px rgba(0, 0, 0, 0.4); }
.tile-tick { position: absolute; top: -14px; right: -10px; width: 40px; height: 40px; border-radius: 99px; background: #fff; color: #11803f; display: grid; place-items: center; font-size: 1.5rem; font-weight: 900; }
.paused-banner { position: absolute; inset: auto 0 45% 0; margin: auto; width: max-content; padding: 16px 40px; border-radius: 999px; background: rgba(22, 12, 34, 0.92); border: 2px solid var(--gold); color: var(--gold); font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 900; }

/* Podium ------------------------------------------------------------------------------------ */
.podium { max-width: 1100px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) 24px 60px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.podium h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); letter-spacing: -0.045em; }
.podium .kicker { font-size: 1.1rem; }
.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; width: min(100%, 900px); margin-top: 26px; }
.place { display: grid; gap: 6px; justify-items: center; padding: 20px 14px; border-radius: 22px 22px 8px 8px; background: rgba(36, 20, 51, 0.9); border: 1px solid var(--line); font-size: clamp(1rem, 1.8vw, 1.5rem); }
.place.empty { visibility: hidden; }
.place.first { min-height: 230px; background: linear-gradient(180deg, #f0c14d, #c8922a); color: var(--gold-ink); border: 0; }
.place.second { min-height: 180px; }
.place.third { min-height: 140px; }
.place .medal { width: 44px; height: 44px; border-radius: 99px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.2); font-weight: 900; }
.place em { font-style: normal; font-weight: 800; opacity: 0.85; }
.standings { list-style: none; padding: 0; margin: 20px 0 0; width: min(100%, 640px); display: grid; gap: 6px; }
.standings li { display: grid; grid-template-columns: 2.2em 1fr auto; gap: 12px; padding: 10px 16px; border-radius: 12px; background: rgba(36, 20, 51, 0.7); text-align: start; font-weight: 700; }

/* Smaller screens ------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .auth { grid-template-columns: minmax(0, 520px); }
  .auth-points { display: none; }
  .setup-grid, .lobby { grid-template-columns: 1fr; }
  .drop { grid-template-columns: 1fr; }
  .drop-actions { justify-content: flex-start; }
  .play { grid-template-columns: 1fr; grid-template-areas: "prompt" "art" "side" "tiles"; grid-template-rows: auto auto auto auto; }
  .art { aspect-ratio: 16 / 10; max-height: 46vh; }
  .stage { height: auto; min-height: 100vh; }
}
@media (max-width: 640px) {
  .pic-card { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .stage-bar { grid-template-columns: 1fr auto; }
  .stage-bar .bar-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .range { grid-template-columns: 1fr 1fr; }
  .crumb { display: none; }
}
@media (max-height: 640px) and (min-width: 981px) {
  .tile { min-height: 56px; font-size: clamp(1rem, 2vw, 1.8rem); }
  .prompt { font-size: clamp(1.4rem, 3.2vw, 3rem); }
}
