/* Top Ten (tt-): the players' own prompts, secret numbers, the prompt's scale, the captain's ladder and the reveal. */

.tt-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.tt-cap .ic {
  color: var(--ink);
}
.tt-lives {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  font-size: 20px;
  line-height: 1;
}
.tt-lives .gone {
  filter: grayscale(1);
  opacity: 0.25;
  transition: opacity 0.4s, filter 0.4s;
}

/* Writing the players' own prompts: the question, then both ends of the scale. */
.tt-write {
  display: grid;
  gap: 12px;
  justify-items: start;
}
.tt-write .field {
  width: 100%;
}
.tt-ends {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
@media (max-width: 560px) {
  .tt-ends {
    grid-template-columns: 1fr;
  }
}
.tt-own {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.tt-own-txt {
  display: grid;
  gap: 4px;
  flex: 1 1 220px;
  min-width: 0;
}
.tt-own-txt strong {
  font-size: 18px;
  overflow-wrap: anywhere;
}

/* The secret number next to the prompt; one column on phones. */
.tt-deal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.tt-deal > :only-child {
  grid-column: 1 / -1;
}
@media (max-width: 560px) {
  .tt-deal {
    grid-template-columns: 1fr;
  }
}

.tt-number {
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  justify-items: center;
  gap: 4px 8px;
  min-width: 150px;
  padding: 14px 18px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--shadow);
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.tt-number:active {
  transform: scale(0.98);
}
.tt-number-val {
  grid-column: 1 / -1;
  font-family: var(--meme);
  font-size: 72px;
  line-height: 1;
}
.tt-number-label {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-2);
  text-align: center;
}
.tt-number .ic {
  width: 18px;
  height: 18px;
  color: var(--ink-2);
}
.tt-number.shown {
  background: var(--accent);
  color: var(--accent-ink);
}
.tt-number.shown .tt-number-label,
.tt-number.shown .ic {
  color: inherit;
  opacity: 0.75;
}
.tt-number.compact {
  min-width: 110px;
  padding: 10px 14px;
  box-shadow: 4px 4px 0 var(--shadow);
}
.tt-number.compact .tt-number-val {
  font-size: 44px;
}
@media (max-width: 560px) {
  .tt-number {
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    align-items: center;
    text-align: left;
  }
  .tt-number-val,
  .tt-number.compact .tt-number-val {
    grid-column: auto;
    font-size: 44px;
  }
  .tt-number-label {
    text-align: left;
  }
}

/* The prompt with its scale from 1 (mild) to 10 (wild). */
.tt-prompt {
  display: grid;
  gap: 10px;
  padding: clamp(14px, 2.2vw, 22px);
  animation: fade-up 0.4s var(--ease) both;
}
.tt-prompt .muted {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tt-prompt strong {
  font-size: clamp(19px, 2.6vw, 25px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tt-prompt.compact strong {
  font-size: 17px;
}
.tt-scale {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(40px, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.tt-end {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
}
.tt-end.hi {
  flex-direction: row-reverse;
  text-align: right;
}
.tt-end b {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: var(--bw) solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-family: var(--meme);
  font-weight: 400;
  font-size: 16px;
}
.tt-end.hi b {
  background: var(--danger);
  color: var(--danger-ink);
}
.tt-bar {
  height: 10px;
  border: var(--bw) solid var(--line);
  border-radius: 99px;
  background: linear-gradient(90deg, var(--surface), var(--accent) 55%, var(--danger));
}
@media (max-width: 560px) {
  .tt-scale {
    grid-template-columns: 1fr 1fr;
  }
  .tt-bar {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Offline: whose turn it is. */
.tt-turn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  animation: pop-in 0.3s var(--ease) both;
}
.tt-turn p {
  margin: 0;
  font-weight: 750;
}
.tt-order-list {
  display: grid;
  gap: 6px;
}
.tt-say {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
}
.tt-say .nm {
  flex: 1;
  min-width: 0;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tt-say-st {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.tt-say-st .ic {
  width: 14px;
  height: 14px;
}
.tt-say.now {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 3px 3px 0 var(--shadow);
}
.tt-say.said {
  opacity: 0.7;
}
.tt-say.away {
  border-style: dashed;
  opacity: 0.6;
}

/* The captain's ladder: lowest at the top. */
.tt-ladder {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tt-ladder > li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.tt-pos {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-weight: 800;
  font-size: 14px;
}
.tt-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  color: inherit;
  animation: fade-up 0.3s var(--ease) both;
}
.tt-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}
.tt-answer {
  font-size: 17px;
  overflow-wrap: anywhere;
}
.tt-by {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.tt-main > .tt-by:only-child {
  font-size: 16px;
  color: var(--ink);
}
.tt-tools {
  flex: none;
  display: flex;
  gap: 2px;
}
.tt-up {
  transform: rotate(90deg);
}
.tt-down {
  transform: rotate(-90deg);
}
.tt-slot-box {
  display: block;
  padding: 14px 12px;
  border: var(--bw) dashed var(--ink-2);
  border-radius: var(--r-ctl);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
}
.tt-pool {
  display: grid;
  gap: 8px;
}
.tt-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.tt-card.pick {
  cursor: pointer;
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease);
}
.tt-card.pick:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--shadow);
}
.tt-card.pick:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* The reveal: numbers turn over one by one; a step down is a mistake. */
.tt-res {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-rule {
  margin: 0;
  flex: 1 1 220px;
  font-size: 14px;
  font-weight: 700;
}
.tt-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: var(--bw) solid var(--line);
  border-radius: 12px;
  background: var(--paper-2);
  font-family: var(--meme);
  font-size: 26px;
  line-height: 1;
}
.tt-num.open {
  background: var(--accent);
  color: var(--accent-ink);
  animation: pop-in 0.35s var(--ease) both;
}
.tt-card.miss {
  border-color: var(--danger);
  box-shadow: 4px 4px 0 var(--danger);
}
.tt-card.miss .tt-num {
  background: var(--danger);
  color: var(--danger-ink);
}
.tt-lose {
  font-size: 14px;
  font-weight: 800;
  color: var(--danger);
  animation: fade-up 0.3s var(--ease) both;
}
@media (prefers-reduced-motion: reduce) {
  .tt-num.open,
  .tt-lose,
  .tt-card,
  .tt-prompt {
    animation: none;
  }
}

/* Final screen: the team result, then every round as the captain ordered it. */
.tt-final {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  padding: clamp(16px, 2.6vw, 26px);
  animation: fade-up 0.4s var(--ease) both;
}
.tt-final.won {
  border-color: var(--line);
  box-shadow: 6px 6px 0 var(--accent);
}
.tt-final.lost {
  box-shadow: 6px 6px 0 var(--danger);
}
.tt-final-lives {
  display: grid;
  gap: 8px;
}
.tt-final-lives .tt-lives {
  font-size: clamp(24px, 3.4vw, 32px);
  gap: 4px;
}
.tt-final-lives > span {
  font-size: 15px;
  font-weight: 800;
}
.tt-final-stats {
  flex: 1 1 280px;
  max-width: 420px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.tt-stat {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  padding: 10px 6px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--paper-2);
  text-align: center;
}
.tt-stat strong {
  font-family: var(--meme);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}
.tt-stat span {
  font-size: 13px;
  font-weight: 750;
  color: var(--ink-2);
}
.tt-rounds {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 16px;
  align-items: start;
}
.tt-round-card {
  display: grid;
  gap: 12px;
  padding: clamp(14px, 2vw, 18px);
  animation: fade-up 0.4s var(--ease) both;
}
.tt-round-card.perfect {
  box-shadow: 5px 5px 0 var(--accent);
}
.tt-round-card.has-miss {
  box-shadow: 5px 5px 0 var(--danger);
}
.tt-round-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tt-round-no {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.tt-round-q {
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tt-round-card .tt-scale {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tt-round-card .tt-bar {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 8px;
}
.tt-round-card .tt-end {
  font-size: 13px;
}
.tt-round-card .tt-end b {
  width: 26px;
  height: 26px;
  font-size: 14px;
}
.tt-round-who {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.tt-round-who .ic {
  color: var(--ink);
}
.tt-round-rows {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tt-round-rows li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-ctl);
  background: var(--surface);
}
.tt-round-rows .tt-answer {
  font-size: 15px;
}
.tt-round-n {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: var(--bw) solid var(--line);
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--meme);
  font-size: 20px;
  line-height: 1;
}
.tt-round-rows li.miss {
  border-color: var(--danger);
}
.tt-round-rows li.miss .tt-round-n {
  background: var(--danger);
  color: var(--danger-ink);
}
.tt-round-rows .tt-lose {
  flex: none;
  animation: none;
}
