/* Undercover (uc-). Tokens only, so light and dark mode both work. */

.uc {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.uc-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
.uc-intro {
  min-height: 0;
  padding-block: 8px 0;
}
.uc-intro .round-no {
  font-size: clamp(56px, 10vw, 120px);
}

/* word card */
.uc-word {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px 20px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--shadow);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--ease);
}
.uc-word > .ic {
  width: 32px;
  height: 32px;
}
.uc-word > div {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.uc-word:active {
  transform: scale(0.99);
}
.uc-word-label,
.uc-word span {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.uc-word-text {
  font-family: var(--meme);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.uc-word.shown {
  background: var(--accent);
  color: var(--accent-ink);
}
.uc-word.shown .uc-word-label {
  color: inherit;
  opacity: 0.75;
}
.uc-word.compact {
  padding: 12px 16px;
  box-shadow: 4px 4px 0 var(--shadow);
}
.uc-word.compact .uc-word-text {
  font-size: clamp(22px, 3.5vw, 30px);
}
.uc-white {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  cursor: default;
}
.uc-white span {
  color: inherit;
  opacity: 0.75;
}
.uc-white strong {
  font-size: 20px;
}
.uc-watch {
  cursor: default;
  box-shadow: none;
  border-style: dashed;
}
.uc-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* speaking order */
.uc-order {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.uc-seat {
  display: grid;
  grid-template-columns: auto minmax(0, 120px) 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: var(--bw) solid transparent;
  border-radius: 14px;
  transition: background-color 0.2s;
}
.uc-seat.now {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow);
}
.uc-seat-name {
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-bubble {
  justify-self: start;
  display: inline-block;
  max-width: 100%;
  padding: 6px 12px;
  border: var(--bw) solid var(--line);
  border-radius: 4px 14px 14px 14px;
  background: var(--surface);
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
  animation: pop-in 0.3s var(--ease) both;
}
.uc-bubble.wait {
  border-style: dashed;
  border-color: var(--ink-2);
  color: var(--ink-2);
  background: transparent;
  animation: none;
}
.uc-bubble.none {
  border-style: dashed;
  color: var(--ink-2);
  font-style: italic;
  font-weight: 600;
}
.uc-bubble.typing {
  display: inline-flex;
  gap: 4px;
  padding: 10px 12px;
  background: var(--accent);
}
.uc-bubble.typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ink);
  animation: uc-dot 1s ease-in-out infinite;
}
.uc-bubble.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.uc-bubble.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes uc-dot {
  50% {
    transform: translateY(-4px);
    opacity: 0.5;
  }
}
.uc-seat.is-out {
  opacity: 0.5;
}

/* clue and guess input */
.uc-input {
  display: grid;
  gap: 8px;
  animation: pop-in 0.3s var(--ease) both;
}
.uc-input-row {
  display: flex;
  gap: 10px;
}
.uc-input-row .input {
  flex: 1;
  min-width: 0;
  font-size: 19px;
}

/* earlier rounds and eliminated players */
.uc-earlier summary {
  cursor: pointer;
  font-weight: 800;
}
.uc-earlier-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.uc-earlier-row {
  display: grid;
  grid-template-columns: auto minmax(0, 110px) 1fr;
  align-items: center;
  gap: 10px;
}
.uc-earlier-name {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-earlier-clues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.uc-earlier-clues .uc-bubble {
  font-size: 14px;
  padding: 3px 10px;
  animation: none;
}
.uc-out {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.uc-out .label {
  color: var(--ink-2);
}
.uc-out .chip {
  padding-left: 3px;
}
.uc-out .av {
  border-width: 1.5px;
  font-size: 12px;
}

/* vote */
.uc-vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.uc-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  padding: 16px 12px 14px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow);
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s var(--ease), box-shadow 0.14s var(--ease), background-color 0.14s;
}
.uc-card:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shadow);
}
.uc-card:disabled {
  cursor: default;
}
.uc-card.self {
  opacity: 0.6;
}
.uc-card.on {
  background: var(--danger);
  color: var(--danger-ink);
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}
.uc-card strong {
  font-size: 16px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-card-top {
  position: relative;
}
.uc-voted {
  position: absolute;
  right: -8px;
  bottom: -4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: var(--bw) solid var(--line);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
}
.uc-voted .ic {
  width: 12px;
  height: 12px;
}
.uc-card-clues {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}
.uc-card-clues .uc-bubble {
  font-size: 13px;
  padding: 3px 9px;
  border-radius: 99px;
  animation: none;
  color: var(--ink);
}
.uc-myvote {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* reveal */
.uc-reveal {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 20px;
  text-align: center;
  animation: pop-in 0.45s var(--ease) both;
}
.uc-reveal .av {
  animation: slam 0.6s var(--ease) both;
}
.uc-reveal-name {
  font-size: 20px;
  font-weight: 800;
}
.uc-reveal-role {
  font-family: var(--meme);
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1;
  text-transform: uppercase;
  animation: slam 0.6s 0.35s var(--ease) both;
}
.uc-reveal.civ {
  background: var(--accent);
  color: var(--accent-ink);
}
.uc-reveal.inf {
  background: var(--danger);
  color: var(--danger-ink);
}
.uc-reveal.civ .muted,
.uc-reveal.inf .muted {
  color: inherit;
  opacity: 0.8;
}
.uc-reveal-role.ok {
  color: inherit;
}
.uc-tally {
  display: grid;
  gap: 6px;
}
.uc-tally-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: var(--bw) solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.uc-tally-name {
  font-weight: 750;
}
.uc-tally-by {
  font-size: 13px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* end of game */
.uc-words {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.uc-words-item {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: var(--bw) solid var(--line);
  border-radius: var(--r-panel);
  box-shadow: 4px 4px 0 var(--shadow);
}
.uc-words-item span {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.8;
}
.uc-words-item strong {
  font-family: var(--meme);
  font-weight: 400;
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
}
.uc-words-item.civ {
  background: var(--accent);
  color: var(--accent-ink);
}
.uc-words-item.inf {
  background: var(--danger);
  color: var(--danger-ink);
}
.uc-table {
  display: grid;
  padding: 8px;
}
.uc-table-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
}
.uc-table-row + .uc-table-row {
  border-top: 2px solid var(--paper-2);
}
.uc-table-row.me {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}
.uc-table-name,
.uc-table-word {
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.uc-table-out {
  font-size: 13px;
  color: var(--ink-2);
}
.uc-table-pts {
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.uc-table-pts.pos {
  color: #2f8a1f;
}
:root[data-theme="dark"] .uc-table-pts.pos {
  color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .uc-table-pts.pos {
    color: var(--accent);
  }
}

/* final summary */
.uc-hist {
  display: grid;
  gap: 8px;
}
.uc-hist-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

@media (max-width: 760px) {
  .uc-seat {
    grid-template-columns: auto minmax(0, 90px) 1fr;
    gap: 10px;
  }
  .uc-vote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .uc-words {
    grid-template-columns: 1fr;
  }
  .uc-table-row {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
  }
  .uc-table-word,
  .uc-table-out {
    display: none;
  }
  .uc-input-row {
    flex-direction: column;
  }
}
