/* Student phone screens (also used inside the editor's phone preview). */

.topbar-play {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--ground);
}

.play {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 4px var(--gutter) calc(112px + env(safe-area-inset-bottom));
  outline: none;
}

.conn {
  position: fixed;
  top: 64px;
  left: 50%;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--pomegranate);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--lift);
  transform: translateX(-50%);
}

.conn .icon {
  width: 16px;
  height: 16px;
}

/* ----- joining ----- */

.join {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding-top: 28px;
  text-align: center;
}

.join-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.join-session {
  color: var(--ink-soft);
  font-weight: 500;
}

.join-form-play {
  display: grid;
  gap: 14px;
  width: min(100%, 380px);
  margin-top: 6px;
}

.join-form-play .input {
  min-height: 56px;
  text-align: center;
  font-size: 1.1875rem;
  font-weight: 600;
}

.join-code-small {
  font: 600 0.9375rem/1 var(--font-display);
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* ----- slide screens ----- */

.sv {
  display: grid;
  gap: 16px;
  padding-top: 6px;
}

.sv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
}

.sv-count {
  font: 600 0.875rem/1 var(--font-display);
  color: var(--ink-faint);
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 6px 12px 6px 9px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  font: 700 1rem/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.timer-pill .icon {
  width: 18px;
  height: 18px;
  color: var(--tile);
}

.timer-pill.low {
  border-color: var(--pomegranate);
  background: var(--pomegranate);
  color: #fff;
}

.timer-pill.low .icon {
  color: #fff;
}

.timer-pill.done {
  padding: 7px 12px;
  font: 600 0.875rem/1 var(--font-ui);
  color: var(--ink-soft);
}

.sv-title {
  font-size: clamp(1.375rem, 5.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.012em;
}

.sv-body {
  color: var(--ink-soft);
  font-size: 1.0625rem;
}

.sv-hint {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
}

.sv-form {
  display: grid;
  gap: 14px;
}

.sv-input {
  font-size: 1.125rem;
}

.sv-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: -6px;
  color: var(--ink-faint);
  font-size: 0.875rem;
}

.sv-counter {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.sv-error {
  color: var(--pomegranate);
  font-weight: 600;
}

.sv-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.sv-note .icon {
  margin-top: 1px;
}

.look-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--ink-faint);
  font-weight: 500;
}

/* ----- answer buttons ----- */

.choices {
  display: grid;
  gap: 12px;
}

.choice {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 14px 14px 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--c, var(--opt-1));
  color: #fff;
  font: 600 1.125rem/1.3 var(--font-ui);
  text-align: start;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--edge, var(--opt-1-edge));
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, transform 0.08s, box-shadow 0.08s;
}

.choice:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--edge);
}

.choice .shape {
  width: 26px;
  height: 26px;
  flex: none;
}

.choice-text {
  flex: 1;
  min-width: 0;
}

.choice-tick {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
}

.choice-tick .icon {
  width: 18px;
  height: 18px;
  opacity: 0;
}

.choice.is-picked {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.choice.is-picked .choice-tick {
  border-color: #fff;
  background: #fff;
  color: var(--c);
}

.choice.is-picked .choice-tick .icon {
  opacity: 1;
}

.choices.has-pick .choice:not(.is-picked) {
  opacity: 0.5;
}

.tf-choices {
  grid-template-columns: 1fr 1fr;
}

.tf-choices .choice {
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 156px;
  padding: 18px 10px;
  text-align: center;
  font-size: 1.25rem;
}

.tf-choices .choice .shape {
  width: 44px;
  height: 44px;
}

.tf-choices .choice-tick {
  display: none;
}

/* ----- sticky send bar ----- */

.sv-actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 12px var(--gutter) max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--ground);
}

.sv-actions .btn {
  display: flex;
  max-width: 528px;
  margin: 0 auto;
}

/* ----- typed entries ----- */

.entries {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entry-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--tile-wash);
  font-weight: 600;
  white-space: pre-line;
}

.entry-chip .icon {
  width: 16px;
  height: 16px;
  color: var(--tile);
}

.entry-chip.is-pending {
  border: 1.5px dashed var(--line-strong);
  background: var(--paper);
}

/* ----- scales ----- */

.scale-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.scale-statement {
  font-weight: 600;
}

.scale-buttons {
  display: grid;
  grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr));
  gap: 6px;
}

.scale-btn {
  appearance: none;
  min-height: 50px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  font: 700 1.0625rem/1 var(--font-display);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.steps-10 {
  gap: 4px;
}

.steps-10 .scale-btn {
  min-height: 44px;
  border-radius: 8px;
  font-size: 0.875rem;
}

.scale-btn[aria-pressed='true'] {
  border-color: var(--tile-deep);
  background: var(--tile);
  color: var(--tile-ink);
  box-shadow: 0 3px 0 var(--tile-edge);
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.scale-labels span:last-child {
  text-align: end;
}

/* ----- status screens ----- */

.status {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 36px 6px 8px;
  text-align: center;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1.5px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--tile);
}

.status-icon .icon {
  width: 34px;
  height: 34px;
}

.status-icon.is-tile {
  border: 0;
  background: linear-gradient(155deg, var(--tile-bright) 0%, var(--tile) 58%, var(--tile-deep) 100%);
  color: #fff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.22), 0 4px 0 var(--tile-edge);
}

.status-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.3;
}

.status-name {
  color: var(--tile);
  font-size: 1.125rem;
  font-weight: 700;
}

.status-text {
  max-width: 34ch;
  color: var(--ink-soft);
}

.status.is-queued .status-icon {
  color: var(--pomegranate);
}

.status .btn {
  margin-top: 8px;
}

.status-score {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  font-weight: 600;
}

.echo {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

.echo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--c);
  color: #fff;
  font-weight: 600;
  text-align: start;
}

.echo-item .shape {
  width: 22px;
  height: 22px;
  flex: none;
}

.echo-text {
  font-size: 1.125rem;
  font-weight: 700;
  white-space: pre-line;
}

.echo-scale {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  text-align: start;
}

.echo-scale strong {
  font-family: var(--font-display);
}

/* ----- result after the reveal ----- */

.result {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px 18px 22px;
  border-radius: 20px;
  color: #fff;
  text-align: center;
  animation: result-in 0.35s ease-out;
}

.result.is-correct {
  background: var(--leaf);
}

.result.is-wrong {
  background: var(--pomegranate);
}

.result.is-none {
  background: var(--slate);
}

.result-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.result-icon .icon {
  width: 44px;
  height: 44px;
}

.result-icon .icon path {
  stroke-width: 2.6;
}

.result-title {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.result-points {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--saffron);
  color: #16233f;
  font: 800 1.25rem/1 var(--font-display);
}

.result-answer,
.result-mine {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.result-label {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.92;
}

.result .echo {
  max-width: none;
}

.result .echo-item {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.result .echo-text {
  color: #fff;
}

.result-expl {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  text-align: start;
}

.result-score {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-weight: 600;
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ----- questions from the class ----- */

.qa-form {
  display: grid;
  gap: 10px;
}

.qa-form .textarea {
  min-height: 70px;
}

.qa-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qa-form-row .btn {
  margin-left: auto;
}

.qa-list {
  display: grid;
  gap: 10px;
}

.qa-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.qa-item.is-mine {
  border-color: var(--tile);
}

.qa-item.is-answered {
  opacity: 0.62;
}

.qa-body {
  flex: 1;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.qa-text {
  font-weight: 500;
}

.qa-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.qa-meta:empty {
  display: none;
}

.qa-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--tile-wash);
  color: var(--tile-deep);
  font-size: 0.75rem;
  font-weight: 700;
}

.qa-badge .icon {
  width: 14px;
  height: 14px;
}

.qa-name {
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.qa-vote {
  appearance: none;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 58px;
  padding: 8px 6px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
}

.qa-vote[aria-pressed='true'] {
  border-color: var(--tile-deep);
  background: var(--tile);
  color: var(--tile-ink);
}

.qa-vote[disabled] {
  cursor: default;
  opacity: 0.5;
}

.qa-count {
  font: 700 0.9375rem/1 var(--font-display);
}

.qa-empty {
  padding: 20px 0;
  color: var(--ink-faint);
  text-align: center;
}

/* ----- leaderboard ----- */

.lb {
  display: grid;
  gap: 16px;
}

.lb-me {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.lb-me-rank {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 16px;
  background: linear-gradient(155deg, var(--tile-bright) 0%, var(--tile) 58%, var(--tile-deep) 100%);
  color: #fff;
  font: 800 1.75rem/1 var(--font-display);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.22), 0 4px 0 var(--tile-edge);
}

.lb-me-line {
  font-size: 1.125rem;
  font-weight: 700;
}

.lb-me-score {
  color: var(--ink-soft);
}

.lb-list {
  display: grid;
  gap: 6px;
}

.lb-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--paper);
}

.lb-row.is-me {
  outline: 2px solid var(--tile);
}

.lb-rank {
  color: var(--ink-faint);
  font: 700 1rem/1 var(--font-display);
  text-align: center;
}

.lb-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  font: 700 1rem/1 var(--font-display);
}
