/* What participants see on their phones. Large targets, little to load. */

.play-page {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  /* Small grey text and the edges of buttons are darker here than in the
     presenter workspace: phones are read in sunlight and at arm's length. */
  --ink-faint: #666a93;
  --edge: #888cae;
  /* Pulling down must not reload the page and wipe a half-finished answer. */
  overscroll-behavior-y: contain;
}

.play-page button,
.play-page .pad,
.play-page .pinpad {
  /* No pause before a tap registers, and no zooming on a quick double tap. */
  touch-action: manipulation;
}

.play {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--ink);
  color: #fff;
  font-size: 0.92rem;
}

.play-top .wordmark {
  color: #fff;
  font-size: 0.95rem;
}

.play-top .ring-track {
  stroke: rgba(255, 255, 255, 0.25);
}

.play-top .ring-value {
  stroke: var(--marigold);
}

.play-who {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  max-width: 64%;
  font-weight: 550;
}

.play-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-who b {
  flex: none;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 650;
}

.play-main {
  flex: 1;
  padding: 22px 18px 28px;
}

.play-foot {
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  color: var(--ink-faint);
  font-size: 0.85rem;
  text-align: center;
}

/* Laid over the top bar, so that nothing below moves when it comes and goes. */
.play-offline {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  padding: 14px 18px;
  background: var(--seal);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.play-title {
  margin-bottom: 18px;
  font-size: 1.5rem;
  line-height: 1.18;
}

.play-title.is-long {
  font-size: 1.2rem;
}

.play-sub {
  margin: -8px 0 16px;
  color: var(--ink-soft);
}

/* front page: enter the code */

.welcome {
  padding-top: 9vh;
}

.welcome p.lead {
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.welcome h1 {
  margin: 0 0 6px -2px;
  font-size: 3.4rem;
  font-stretch: 118%;
  font-weight: 750;
  letter-spacing: 0.02em;
  line-height: 1;
}

.welcome form {
  margin-top: 30px;
}

.code-input {
  display: block;
  width: 100%;
  height: 76px;
  padding: 0 12px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-l);
  background: var(--surface);
  font-size: 2.5rem;
  font-stretch: 118%;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
}

.code-input::placeholder {
  color: var(--line);
}

.code-input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: var(--focus);
}

.welcome .btn {
  margin-top: 14px;
}

.form-error {
  min-height: 1.5em;
  margin-top: 10px;
  color: var(--seal);
  font-weight: 600;
}

.presenter-link {
  display: block;
  margin-top: 12vh;
  color: var(--ink-faint);
  font-size: 0.9rem;
  text-align: center;
}

/* choice chips for the joining questions */

.chips {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -4px 12px;
}

.chip {
  position: relative;
  margin: 4px;
}

.chip input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
}

.chip span {
  display: block;
  padding: 10px 16px;
  border: 1.5px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  font-weight: 550;
}

.chip input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.chip input:focus-visible + span {
  box-shadow: var(--focus);
}

/* answer options */

.options {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 2px solid var(--edge);
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 550;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.option-mark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 12px;
  border-radius: 50%;
  background: var(--indigo-wash);
  color: var(--ink);
  font-weight: 700;
}

.option.is-picked {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.option.is-picked .option-mark {
  background: var(--marigold);
  color: var(--ink);
}

.option:disabled {
  cursor: default;
}

.option.is-right {
  border-color: var(--leaf);
  background: var(--leaf-wash);
  color: var(--ink);
}

.option.is-right .option-mark {
  background: var(--leaf);
  color: #fff;
}

.option.is-dim {
  opacity: 0.55;
}

/* scales */

.rate {
  margin-bottom: 20px;
}

.rate p {
  margin-bottom: 8px;
  font-weight: 600;
  line-height: 1.25;
}

.rate-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
}

/* Scales of 8 to 10: two rows, so each number stays large enough to tap. */
.rate-row.is-wide {
  grid-auto-flow: row;
  grid-template-columns: repeat(5, 1fr);
}

.rate-row button {
  min-height: 50px;
  padding: 0;
  color: var(--ink);
  border: 2px solid var(--edge);
  border-radius: var(--radius-m);
  background: var(--surface);
  font-size: 1.1rem;
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.rate-row button.is-picked {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.rate-ends {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

/* once a number is chosen on a fully named scale: what that number means */
.rate-ends.is-chosen {
  justify-content: flex-start;
  color: var(--ink);
  font-weight: 600;
}

/* what each number means, shown once above the questions */
.rate-key {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 14px;
  margin: 0 0 18px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  list-style: none;
  font-size: 0.88rem;
  line-height: 1.3;
}

.rate-key li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.rate-key strong {
  flex: none;
  min-width: 1.1em;
  font-weight: 700;
  text-align: right;
}

/* text entry */

.entry {
  margin-bottom: 12px;
}

.entry .input,
.entry .textarea {
  min-height: 56px;
  border-width: 2px;
  font-size: 1.1rem;
}

.entry-count {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 0.82rem;
  text-align: right;
}

.sent {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.sent li {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--indigo-wash);
  font-weight: 550;
}

.sent.is-long li {
  display: block;
  border-radius: var(--radius-m);
}

/* confirmation and waiting panels */

.panel {
  padding: 26px 20px;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1.5px solid var(--line);
}

.panel h2 {
  margin-bottom: 6px;
  font-size: 1.35rem;
}

.panel p {
  color: var(--ink-soft);
}

.panel .ring {
  margin-bottom: 14px;
}

.panel-good {
  border-color: var(--leaf);
  background: var(--leaf-wash);
}

.panel-bad {
  border-color: var(--seal);
  background: var(--seal-wash);
}

.panel-good p,
.panel-bad p {
  color: var(--ink);
}

.points {
  display: block;
  margin: 10px 0 2px;
  font-size: 2.6rem;
  font-stretch: 115%;
  font-weight: 750;
  line-height: 1;
}

.breathing {
  animation: breathe 2.4s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}

/* quiz timer bar */

.timerow {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.timeleft {
  flex: none;
  min-width: 3.2em;
  padding-left: 10px;
  font-weight: 700;
  text-align: right;
}

.timebar {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--ink);
  overflow: hidden;
}

.timebar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--marigold);
}

/* Q&A */

.ask-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.ask-list li {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-top: 1.5px solid var(--line);
}

.ask-list p {
  flex: 1;
  margin-right: 12px;
  line-height: 1.3;
}

.ask-list .is-answered p {
  color: var(--ink-faint);
}

.ask-list small {
  display: block;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 0.8rem;
}

.upvote {
  flex: none;
  min-width: 62px;
  min-height: 46px;
  padding: 0 8px;
  color: var(--ink);
  border: 2px solid var(--edge);
  border-radius: var(--radius-m);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.upvote.is-picked {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.upvote:disabled {
  border-color: transparent;
  background: transparent;
  color: var(--ink-faint);
  cursor: default;
}

/* leaderboard on the phone */

.standing {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.standing li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-top: 1.5px solid var(--line);
  font-weight: 550;
}

.standing li span:first-child b {
  display: inline-block;
  width: 1.8em;
  color: var(--ink-faint);
}

.play-main .prose {
  font-size: 1.05rem;
}

.play-main .prose ul {
  margin: 0 0 12px;
  padding-left: 1.2em;
}

.play-main .prose p,
.play-main .prose li {
  margin-bottom: 8px;
}

/* ---- surveys, grids, pictures, tests ------------------------------------- */

.form-gap {
  margin-top: 16px;
}

.rate small,
.pick-hint {
  display: block;
  margin: -4px 0 8px;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.rate.is-missing > p:first-child {
  color: var(--seal);
}

.rate .textarea {
  border-width: 2px;
}

.picks {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -4px;
}

.pick {
  min-height: 46px;
  margin: 4px;
  padding: 8px 16px;
  border: 2px solid var(--edge);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pick.is-picked {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.survey-foot {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  margin: 0 -18px;
  padding: 10px 18px calc(4px + env(safe-area-inset-bottom));
  border-top: 1.5px solid var(--line);
  background: var(--paper);
}

/* While something is being typed, the bar stays at the end of the form. */
.survey-foot.is-loose {
  position: static;
}

.survey-progress {
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

.survey-foot .form-error {
  min-height: 0;
  margin: 8px 0 4px;
  text-align: center;
}

/* a person's own survey scores */

.own {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.own li {
  padding: 12px 0 14px;
  border-top: 1.5px solid var(--line);
}

.own-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-weight: 600;
}

.own-head b {
  font-size: 1.5rem;
  font-stretch: 112%;
  font-weight: 700;
}

.own-track {
  position: relative;
  height: 3px;
  margin: 12px 9px 10px;
  border-radius: 2px;
  background: var(--ink);
}

.own-track i {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--indigo);
}

.own-track i.is-before {
  border-color: var(--ink);
  background: var(--paper);
}

.own small {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.own-note {
  margin: 4px 0 0;
  font-size: 0.88rem;
}

/* matrix */

.grid-item {
  margin-bottom: 22px;
  padding: 14px 14px 2px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
}

.grid-item h2 {
  margin-bottom: 12px;
  font-size: 1.15rem;
}

.grid-item .rate {
  margin-bottom: 14px;
}

.grid-item .rate p {
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

/* X/Y grid and picture: tap to place */

.pad-wrap {
  margin-bottom: 16px;
}

.pad {
  position: relative;
  width: 100%;
  padding-top: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.pad.is-live,
.pinpad.is-live {
  cursor: crosshair;
}

.pad-h,
.pad-v {
  position: absolute;
  background: var(--line);
}

.pad-h {
  top: 50%;
  right: 0;
  left: 0;
  height: 1.5px;
}

.pad-v {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.5px;
}

.pad-edge,
.pad-quad {
  position: absolute;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.15;
  pointer-events: none;
}

.pad-top { top: 6px; left: 50%; padding: 0 4px; background: var(--surface); transform: translateX(-50%); }
.pad-bottom { bottom: 6px; left: 50%; padding: 0 4px; background: var(--surface); transform: translateX(-50%); }
.pad-left { top: 50%; left: 6px; padding: 2px 0; background: var(--surface); transform: translateY(-50%); }
.pad-right { top: 50%; right: 6px; padding: 2px 0; background: var(--surface); transform: translateY(-50%); }

.pad-quad {
  max-width: 40%;
  color: var(--ink-faint);
  font-weight: 500;
}

.pad-tl { top: 26px; left: 10px; }
.pad-tr { top: 26px; right: 10px; text-align: right; }
.pad-bl { bottom: 26px; left: 10px; }
.pad-br { right: 10px; bottom: 26px; text-align: right; }

.pad-dots {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

.pad-dot {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 0 -15px -15px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink);
  background: var(--marigold);
}

/* A numbered item: the number is dark on white, inside a ring of the item's
   colour, so it reads whatever the colour is. */
.pad-dot[class*='tone-'],
.pad-chip i {
  border: 5px solid var(--tone);
  background: #fff;
}

.pad-dot b {
  color: var(--ink);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 700;
}

.tone-1 { --tone: var(--group-1); }
.tone-2 { --tone: var(--group-2); }
.tone-3 { --tone: var(--group-3); }
.tone-4 { --tone: var(--group-4); }
.tone-5 { --tone: var(--group-5); }
.tone-6 { --tone: var(--group-6); }
.tone-7 { --tone: var(--group-7); }
.tone-8 { --tone: var(--group-8); }

.pad-axes {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.pad-axes strong {
  color: var(--ink);
  font-weight: 650;
}

.pad-chips {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.pad-chip {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px 6px 8px;
  border: 2px solid var(--edge);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pad-chip i {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
  color: var(--ink);
  font-size: 0.85rem;
  font-style: normal;
  font-weight: 700;
}

.pad-chip.is-active {
  border-color: var(--ink);
  background: var(--indigo-wash);
}

.pad-chip.is-placed span::after {
  content: '  ✓';
  color: var(--leaf);
  font-weight: 700;
  white-space: pre;
}

.pinpad {
  position: relative;
  margin-bottom: 16px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.pinpad img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  -webkit-touch-callout: none;
  user-select: none;
}

.pin-mark {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  color: #fff;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink);
  background: var(--marigold);
}

.pin-mark.is-sent {
  background: var(--leaf);
}

/* concordance */

.case {
  margin-bottom: 18px;
  padding: 14px 16px 6px;
  border-left: 4px solid var(--indigo);
  border-radius: var(--radius-s);
  background: var(--surface);
}

.judge {
  margin-bottom: 18px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
}

.judge p {
  margin-bottom: 8px;
  font-weight: 600;
  line-height: 1.25;
}

.judge p small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 500;
}

.judge .judge-ask {
  margin: 12px 0 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
}

.judge-result {
  margin: 10px 0 0;
  padding: 10px 0 0;
  border-top: 1.5px solid var(--line);
  list-style: none;
}

.judge-result li {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  color: var(--ink-soft);
}

.judge-result b {
  color: var(--ink);
}

.judge.is-done {
  margin: 14px 0 0;
}

/* answers revealed */

.answer-list li.is-right span:last-child {
  color: var(--leaf);
  font-weight: 700;
}

.answer-list li.is-wrong span:last-child {
  color: var(--seal);
  font-weight: 650;
  white-space: nowrap;
}

.answer-list li span:first-child {
  padding-right: 12px;
}

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

.options.two-up .option {
  justify-content: center;
  min-height: 84px;
  font-size: 1.3rem;
  font-weight: 650;
  text-align: center;
}

.pair-field .select {
  border-width: 2px;
  min-height: 50px;
}

.ask-more {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.ask-list small[hidden] {
  display: none;
}

/* ---- SATORI-REACTIONS-1: the row of reactions at the bottom of the phone ---- */
.react-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1.5px solid var(--line); background: rgba(255, 255, 255, 0.96); }
.react-bar[hidden], body.is-typing .react-bar { display: none; }
body.has-react .play { padding-bottom: 80px; }
body.has-react.is-typing .play { padding-bottom: 0; }
.react-btn { flex: 0 0 auto; width: 52px; height: 52px; padding: 0; border: 1.5px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 1.6rem; line-height: 1; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.react-btn:hover { border-color: #EC8A03; }
.react-btn:active { transform: scale(0.92); }
.react-btn:focus-visible { outline: 3px solid #EC8A03; outline-offset: 2px; }
.react-btn.is-sent { animation: react-pop 0.45s ease-out; }
@keyframes react-pop { 0% { transform: scale(1); } 40% { transform: scale(1.25); border-color: #EC8A03; } 100% { transform: scale(1); } }
@media (max-width: 340px) { .react-bar { gap: 6px; } .react-btn { width: 46px; height: 46px; font-size: 1.4rem; } }

/* SATORI-POINTS-START: sharing points on the phone */
.points-left { margin: 0.4em 0 0.8em; font-weight: 700; color: #ec8a03; }
.points-left.is-done { color: #1a9e5a; }
.points-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.points-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1.5px solid rgba(20, 22, 74, 0.15); border-radius: 12px; }
.points-name { display: flex; gap: 8px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.points-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.points-step { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid #14164a; background: #fff; color: #14164a; font-size: 22px; line-height: 1; cursor: pointer; }
.points-step:active { background: #ec8a03; border-color: #ec8a03; color: #fff; }
.points-input { width: 4.2em; height: 40px; text-align: center; font-size: 18px; font-weight: 700; border: 1.5px solid rgba(20, 22, 74, 0.25); border-radius: 8px; }
/* SATORI-POINTS-END */

/* SATORI-EXIT-TICKET: the takeaway as sent */
.exit-mine { margin: 10px 0 0; padding: 10px 14px; border-left: 4px solid #ec8a03; border-radius: 8px; background: rgba(236, 138, 3, 0.08); white-space: pre-wrap; text-align: left; font-style: normal; }
