/* Quiplash — наследует sf-* от ../spyfall/style.css. Здесь только ql-*
 * Яркий, казуально-игровой стиль: градиенты, glow, анимации, конфетти. */

:root {
  --ql-purple: oklch(38% 0.18 290);
  --ql-purple-deep: oklch(22% 0.14 290);
  --ql-yellow: oklch(86% 0.20 95);
  --ql-yellow-warm: oklch(78% 0.22 65);
  --ql-pink: oklch(70% 0.22 350);
  --ql-cyan: oklch(78% 0.16 200);
  --ql-mint: oklch(78% 0.16 160);
}

/* ─── Анимации ─── */
@keyframes ql-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ql-pop-in {
  0% { opacity: 0; transform: scale(0.8) rotate(-3deg); }
  60% { transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes ql-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@keyframes ql-glow {
  0%, 100% { box-shadow: 0 0 12px var(--ql-yellow), 0 8px 24px oklch(85% 0.20 95 / 0.4); }
  50% { box-shadow: 0 0 28px var(--ql-yellow), 0 12px 36px oklch(85% 0.20 95 / 0.6); }
}
@keyframes ql-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@keyframes ql-confetti-fall {
  0% { transform: translateY(-100vh) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes ql-bg-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ─── Round bar ─── */
.ql-round-bar {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
  letter-spacing: 0.05em;
  animation: ql-fade-in .35s ease-out;
}
.ql-round-bar strong {
  color: var(--ql-yellow);
  font-size: 18px;
}

/* ─── TV-style status bar ─── */
.ql-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--ql-purple), var(--ql-purple-deep) 80%);
  background-size: 200% 200%;
  animation: ql-bg-shift 6s ease-in-out infinite, ql-fade-in .4s ease-out;
  color: white;
  padding: 14px 20px;
  border-radius: 16px;
  margin-bottom: 18px;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 8px 28px oklch(22% 0.14 290 / 0.4), inset 0 1px 0 oklch(100% 0 0 / 0.1);
  border: 1px solid oklch(50% 0.18 290 / 0.3);
}
.ql-status-bar-label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 2px 6px oklch(22% 0.14 290 / 0.6);
}
.ql-timer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ql-yellow);
  text-shadow: 0 0 8px var(--ql-yellow);
  min-width: 50px;
}
.ql-timer.urgent {
  color: oklch(78% 0.24 25);
  text-shadow: 0 0 12px oklch(78% 0.24 25);
  animation: ql-pulse .5s ease-in-out infinite;
}
.ql-timer-bar {
  flex: 1;
  min-width: 100px;
  height: 8px;
  background: oklch(15% 0.06 290);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px oklch(0% 0 0 / 0.4);
}
.ql-timer-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ql-yellow), var(--ql-yellow-warm));
  transition: width 0.3s linear;
  border-radius: 999px;
  box-shadow: 0 0 12px var(--ql-yellow);
}
.ql-timer-bar-fill.urgent {
  background: linear-gradient(90deg, oklch(75% 0.22 25), oklch(60% 0.26 25));
  box-shadow: 0 0 14px oklch(75% 0.22 25);
}

/* Avatar chips */
.ql-progress-avatars {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  animation: ql-fade-in .4s ease-out;
}
.ql-avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all .25s cubic-bezier(.22,.8,.36,1);
  position: relative;
}
.ql-avatar-chip.done {
  border-color: oklch(60% 0.18 145);
  background: linear-gradient(135deg, oklch(95% 0.10 145), oklch(88% 0.16 145));
  color: oklch(25% 0.12 145);
  transform: scale(1.05);
  box-shadow: 0 4px 12px oklch(60% 0.18 145 / 0.3);
}
html[data-theme="dark"] .ql-avatar-chip.done {
  background: linear-gradient(135deg, oklch(32% 0.14 145), oklch(25% 0.10 145));
  color: white;
}
.ql-avatar-chip img,
.ql-avatar-chip .ql-avatar-fallback {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--bg);
  object-fit: cover;
}
.ql-avatar-chip.done img,
.ql-avatar-chip.done .ql-avatar-fallback {
  border-color: oklch(60% 0.18 145);
}
.ql-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ql-purple), var(--ql-pink));
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
}
.ql-avatar-chip-count {
  font-size: 11px;
  font-family: var(--font-mono);
  opacity: 0.75;
  margin-left: 2px;
}

/* ─── Answer phase prompt cards ─── */
.ql-prompts {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ql-prompt-card {
  background: var(--surface);
  border: 2.5px solid var(--line-strong);
  border-radius: 18px;
  padding: 22px;
  animation: ql-pop-in .45s cubic-bezier(.22,.8,.36,1);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.ql-prompt-card:focus-within {
  border-color: var(--ql-yellow);
  box-shadow: 0 0 0 4px oklch(85% 0.20 95 / 0.2), 0 8px 24px oklch(85% 0.20 95 / 0.25);
  transform: translateY(-2px);
}
.ql-prompt-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
  color: var(--ink);
  line-height: 1.3;
}
.ql-prompt-card textarea {
  width: 100%;
  min-height: 80px;
  font-family: var(--font-sans);
  font-size: 17px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
  resize: none;
  margin-bottom: 12px;
  transition: border-color .15s;
}
.ql-prompt-card textarea:focus { border-color: var(--ql-yellow); }
.ql-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ql-status {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 18px;
}
.ql-status.done { color: oklch(50% 0.18 145); font-weight: 700; }
.ql-status.safety { color: oklch(60% 0.18 95); font-weight: 700; }

.ql-info {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-top: 16px;
}

/* "your prompt 1/2" над текущим инпутом */
.ql-prompt-progress {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ql-prompt-progress strong {
  color: var(--ql-yellow);
  font-size: 17px;
  margin-left: 4px;
}
.ql-prompt-progress-done {
  color: oklch(50% 0.18 145);
  font-weight: 700;
}
html[data-theme="dark"] .ql-prompt-progress-done { color: oklch(80% 0.20 145); }

/* Waiting-блок когда твои ответы сданы */
.ql-waiting-others {
  text-align: center;
  padding: 40px 20px;
  background: var(--surface);
  border: 2px dashed var(--line);
  border-radius: 18px;
  animation: ql-fade-in .3s ease-out;
}
.ql-waiting-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: ql-pulse 2s ease-in-out infinite;
}
.ql-waiting-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  text-transform: lowercase;
  margin-bottom: 6px;
}
.ql-waiting-names {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

/* Avatar chip — состояния waiting/author */
.ql-avatar-chip.waiting {
  border-color: var(--ql-yellow);
  background: oklch(96% 0.10 95 / 0.5);
  animation: ql-pulse 1.6s ease-in-out infinite;
}
html[data-theme="dark"] .ql-avatar-chip.waiting {
  background: oklch(35% 0.12 95 / 0.4);
  color: oklch(95% 0.10 95);
}
.ql-avatar-chip.author {
  opacity: 0.55;
  font-style: italic;
}

/* ─── Vote phase ─── */
.ql-vote-prompt {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 26px;
  padding: 22px 26px;
  background: linear-gradient(135deg, var(--ql-purple), var(--ql-pink));
  background-size: 200% 200%;
  animation: ql-bg-shift 8s ease-in-out infinite, ql-pop-in .5s cubic-bezier(.22,.8,.36,1);
  border-radius: 20px;
  color: white;
  text-shadow: 0 2px 8px oklch(22% 0.14 290 / 0.5);
  box-shadow: 0 12px 32px oklch(38% 0.18 290 / 0.3);
}

.ql-vote-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.ql-vote-answer-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.ql-kudos-btn {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 93, 162, 0.08);
  color: #FF5DA2;
  border: 1px solid rgba(255, 93, 162, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.ql-kudos-btn:hover:not(:disabled) {
  background: rgba(255, 93, 162, 0.18);
  transform: translateY(-1px);
}
.ql-kudos-btn.given {
  background: rgba(255, 93, 162, 0.25);
  cursor: default;
}
.ql-kudos-btn:disabled { opacity: 0.85; }
.ql-kudos-heart { font-size: 15px; line-height: 1; }
.ql-kudos-count { font-family: 'Space Mono', monospace; }
.ql-kudos-view {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #FF5DA2;
  font-size: 13px;
  font-weight: 600;
}
.ql-vote-answer {
  background: var(--surface);
  border: 2.5px solid var(--line-strong);
  border-radius: 16px;
  padding: 26px 18px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s cubic-bezier(.22,.8,.36,1);
  color: var(--ink);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: ql-pop-in .4s cubic-bezier(.22,.8,.36,1);
}
.ql-vote-answer::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, var(--ql-yellow), var(--ql-pink));
  opacity: 0;
  transition: opacity .2s;
  z-index: -1;
  border-radius: 16px;
}
.ql-vote-answer.clickable:hover {
  border-color: var(--ql-yellow);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px oklch(85% 0.20 95 / 0.4);
}
.ql-vote-answer.voted {
  border-color: var(--ql-yellow);
  background: linear-gradient(135deg, oklch(95% 0.12 95), oklch(85% 0.20 95));
  color: oklch(20% 0.08 95);
  animation: ql-glow 1.5s ease-in-out infinite;
}
html[data-theme="dark"] .ql-vote-answer.voted {
  background: linear-gradient(135deg, oklch(40% 0.14 95), oklch(32% 0.20 95));
  color: white;
}
.ql-vote-answer.disabled { opacity: 0.45; cursor: not-allowed; }

.ql-vote-info {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ─── Score / scoreboard ─── */
.ql-score h2 {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  text-transform: lowercase;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--ql-yellow), var(--ql-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 8px;
  animation: ql-pop-in .5s cubic-bezier(.22,.8,.36,1);
}
.ql-score-countdown {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}
.ql-score-countdown strong {
  color: var(--ql-yellow);
  font-size: 16px;
}

.ql-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.ql-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  gap: 12px;
  transition: all .25s cubic-bezier(.22,.8,.36,1);
  animation: ql-fade-in .4s ease-out backwards;
}
.ql-score-row:nth-child(2) { animation-delay: .05s; }
.ql-score-row:nth-child(3) { animation-delay: .1s; }
.ql-score-row:nth-child(4) { animation-delay: .15s; }
.ql-score-row:nth-child(5) { animation-delay: .2s; }
.ql-score-row:nth-child(6) { animation-delay: .25s; }
.ql-score-row:nth-child(7) { animation-delay: .3s; }
.ql-score-row:nth-child(8) { animation-delay: .35s; }
.ql-score-row.leader {
  border-color: var(--ql-yellow);
  background: linear-gradient(135deg, oklch(96% 0.10 95), oklch(90% 0.16 95));
  color: oklch(20% 0.08 95);
  transform: scale(1.02);
  box-shadow: 0 8px 24px oklch(85% 0.20 95 / 0.4);
}
html[data-theme="dark"] .ql-score-row.leader {
  background: linear-gradient(135deg, oklch(40% 0.14 95), oklch(32% 0.20 95));
  color: white;
}
.ql-score-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.ql-score-row-left img {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--line);
  object-fit: cover;
}
.ql-score-row.leader img { border-color: var(--ql-yellow); }
.ql-score-rank {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  opacity: 0.6;
  min-width: 24px;
}
.ql-score-row.leader .ql-score-rank { opacity: 1; color: oklch(35% 0.18 95); }
html[data-theme="dark"] .ql-score-row.leader .ql-score-rank { color: var(--ql-yellow); }
.ql-score-amount {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px;
}

.ql-matchup-recap {
  background: var(--surface);
  border-left: 4px solid var(--line);
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 13px;
  animation: ql-fade-in .4s ease-out;
}
.ql-matchup-recap.jinx { border-left-color: var(--ql-pink); animation: ql-shake .4s ease-out; }
.ql-matchup-recap-prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.ql-matchup-recap-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.ql-matchup-recap-row img {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line);
}
.ql-matchup-recap-name {
  font-weight: 600;
  font-family: var(--font-sans);
}
.ql-matchup-recap-answer {
  flex: 1;
  font-style: italic;
  color: var(--muted);
}
.ql-matchup-recap-points {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ql-yellow);
}

/* ─── Last Lash ─── */
.ql-ll-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.ql-ll-card {
  background: var(--surface);
  border: 2.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s cubic-bezier(.22,.8,.36,1);
  position: relative;
  animation: ql-pop-in .4s cubic-bezier(.22,.8,.36,1);
}
.ql-ll-card.clickable:hover {
  border-color: var(--ql-yellow);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px oklch(85% 0.20 95 / 0.3);
}
.ql-ll-card.disabled { opacity: 0.4; cursor: not-allowed; }
.ql-ll-card-mine {
  background: var(--bg-alt);
  border-style: dashed;
}
.ql-ll-vote-count {
  position: absolute;
  top: -10px;
  right: -10px;
  background: linear-gradient(135deg, var(--ql-yellow), var(--ql-yellow-warm));
  color: oklch(20% 0.08 95);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 12px oklch(85% 0.20 95 / 0.5);
  animation: ql-pop-in .25s cubic-bezier(.22,.8,.36,1);
}

/* ─── Finish ─── */
.ql-result-banner {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 44px;
  margin-bottom: 24px;
  padding: 40px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--ql-yellow), var(--ql-pink));
  background-size: 200% 200%;
  animation: ql-bg-shift 5s ease-in-out infinite, ql-pop-in .6s cubic-bezier(.22,.8,.36,1);
  color: white;
  text-transform: lowercase;
  text-shadow: 0 4px 20px oklch(22% 0.14 290 / 0.6);
  box-shadow: 0 16px 48px oklch(70% 0.22 350 / 0.4), inset 0 1px 0 oklch(100% 0 0 / 0.2);
  letter-spacing: -0.02em;
}

.ql-final-scoreboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.ql-host-only {
  text-align: center;
  margin-top: 16px;
}

/* ─── Confetti для финала ─── */
.ql-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
.ql-confetti-piece {
  position: absolute;
  width: 10px;
  height: 14px;
  top: -20px;
  animation: ql-confetti-fall linear forwards;
}

@media (max-width: 600px) {
  .ql-vote-pair { grid-template-columns: 1fr; }
  .ql-vote-prompt { font-size: 19px; padding: 16px; }
  .ql-result-banner { font-size: 30px; padding: 28px 16px; }
  .ql-ll-grid { grid-template-columns: 1fr; }
  .ql-prompt-text { font-size: 17px; }
}
