/* quiplash.css: TV and host view styles. The phone client uses join.css. */

.ql-root { position: absolute; inset: 0; }

.ql-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: calc(env(safe-area-inset-top) + 3vh) 5vw calc(env(safe-area-inset-bottom) + 3vh);
  text-align: center;
}

.ql-enter { animation: qlViewIn 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes qlViewIn {
  from { opacity: 0; transform: scale(0.992); }
  to { opacity: 1; transform: scale(1); }
}

.ql-title {
  font-family: var(--disp);
  font-size: 2.25rem;
  margin: 0;
  line-height: 1.02;
}

.ql-huge { font-size: 3.25rem; }

.ql-sub {
  color: var(--ink-dim);
  font-size: 1rem;
  margin: 0;
  font-weight: 700;
}

.ql-big-sub {
  font-family: var(--disp);
  color: var(--accent4);
  text-transform: uppercase;
}

.ql-prompt {
  font-family: var(--disp);
  font-size: 1.45rem;
  max-width: 900px;
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}

.ql-loading,
.ql-needs-server {
  width: 100%;
  max-width: none;
  gap: 0.8rem;
}

.ql-needs-server > p { max-width: 640px; }

.ql-needs-server code {
  display: inline-block;
  background: var(--paper);
  color: var(--accent);
  padding: 0.52em 0.9em;
  border-radius: 6px;
  font-size: 1rem;
  border: 2px solid var(--outline);
  box-shadow: 3px 3px 0 var(--outline);
}

/* LOBBY */
.ql-lobby {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 5rem);
  flex-wrap: wrap;
}

.ql-lobby-left,
.ql-lobby-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 420px;
}

.ql-qr {
  background: oklch(98% 0.004 103);
  padding: 12px;
  border-radius: 6px;
  border: 2px solid var(--outline);
  box-shadow: var(--shadow-hard);
  line-height: 0;
  transform: rotate(0.4deg);
}

.ql-announcer-tease {
  margin: -0.35rem 0 0;
  max-width: 30rem;
  color: var(--accent4);
  font-family: var(--disp);
  font-size: 0.98rem;
  text-transform: uppercase;
  transform: rotate(-0.8deg);
}

.ql-lobby-right h2 {
  font-family: var(--disp);
  margin: 0;
  color: var(--accent4);
}

.ql-start-btn { min-width: 260px; }

/* ROSTER / PROGRESS */
.ql-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 360px;
}

.ql-roster li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--disp);
  font-size: 1.05rem;
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 8px;
  padding: 0.52em 0.8em;
  box-shadow: 3px 3px 0 oklch(18% 0.012 248 / 0.18);
}

.ql-roster-empty {
  color: var(--ink-dim);
  font-family: var(--body);
  justify-content: center;
}

.ql-dot {
  width: 24px;
  height: 24px;
  border-radius: 0;
  background: url("../../../assets/memes/raf,360x360,075,t,fafafa_ca443f4786.jpg?v=20260707a") center / contain no-repeat;
  border: 0;
  filter: grayscale(0.04) contrast(1.2);
  mix-blend-mode: multiply;
  flex: none;
}

.ql-dot.off {
  background-image: url("../../../assets/memes/dumb-smart.png?v=20260707a");
  opacity: 0.55;
}
.ql-progress-list { max-width: 480px; }
.ql-name { flex: 1; text-align: left; }
.ql-progress { color: var(--accent4); }

/* SHOW FLOW */
.ql-stage-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.3rem 0.74rem;
  border: 2px solid var(--outline);
  border-radius: 999px 7px 999px 9px;
  background:
    repeating-linear-gradient(-10deg, transparent 0 8px, oklch(14% 0.008 248 / 0.08) 8px 9px),
    var(--paper);
  box-shadow: 3px 3px 0 var(--outline);
  color: var(--accent4);
  font-family: var(--disp);
  font-size: 0.78rem;
  text-transform: uppercase;
  transform: rotate(-1deg);
}

.ql-announcer-line {
  width: min(92vw, 860px);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.9rem;
  border: 3px solid var(--outline);
  border-radius: 5px 10px 4px 8px;
  background:
    repeating-linear-gradient(2deg, transparent 0 10px, oklch(14% 0.008 248 / 0.055) 10px 11px),
    var(--paper);
  box-shadow: 5px 6px 0 var(--accent4), 10px 11px 0 oklch(15% 0.008 248 / 0.1);
  text-align: left;
  transform: rotate(0.45deg);
}

.ql-announcer-face {
  width: 2.2rem;
  height: 2.2rem;
  background: url("../../../assets/memes/dumb-smart.png?v=20260707a") center / contain no-repeat;
  filter: grayscale(0.05) contrast(1.2);
  mix-blend-mode: multiply;
}

.ql-announcer-kicker {
  font-family: var(--disp);
  color: var(--accent);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.ql-announcer-copy {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ql-host-hint {
  margin: -0.55rem 0 0;
  color: var(--ink-dim);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.ql-rules {
  justify-content: center;
  gap: clamp(0.75rem, 2vh, 1.25rem);
}

.ql-rules-grid {
  width: min(94vw, 1080px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.2rem);
  align-items: stretch;
}

.ql-rule-card {
  position: relative;
  min-height: 12rem;
  padding: 1.15rem 1rem 1rem;
  border: 4px solid var(--outline);
  border-radius: 4px 10px 5px 8px;
  background:
    repeating-linear-gradient(-8deg, transparent 0 11px, oklch(14% 0.008 248 / 0.06) 11px 12px),
    var(--panel);
  box-shadow: 7px 8px 0 var(--accent4), 13px 14px 0 oklch(15% 0.008 248 / 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  text-align: left;
  transform: rotate(-0.9deg);
}

.ql-rule-card:nth-child(even) {
  transform: rotate(0.8deg) translateY(0.25rem);
}

.ql-rule-num {
  position: absolute;
  top: -0.95rem;
  left: 0.8rem;
  width: 2.45rem;
  height: 2.45rem;
  display: grid;
  place-items: center;
  border: 3px solid var(--outline);
  border-radius: 50%;
  background: var(--accent3);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--outline);
  font-family: var(--disp);
  font-size: 1.15rem;
}

.ql-rule-card h2 {
  margin: 0;
  font-family: var(--disp);
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  text-transform: uppercase;
}

.ql-rule-card p {
  margin: 0;
  color: var(--ink-dim);
  font-weight: 800;
  line-height: 1.28;
}

/* VOTING */
.ql-answers-blind {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1000px;
}

.ql-matchup-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: clamp(1rem, 3vw, 2.5rem);
  width: min(94vw, 1220px);
  max-width: none;
}

.ql-answers-grid { max-width: 1100px; }

.ql-answer-card {
  flex: 1 1 320px;
  max-width: 460px;
  min-height: 3.2em;
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 8px;
  padding: 1em 1.2em;
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.3;
  box-shadow: 5px 5px 0 var(--accent4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ql-matchup-cards .ql-answer-card {
  flex: initial;
  max-width: none;
  min-height: 12rem;
  padding: 1.3em 1.15em;
  border-width: 4px;
  border-radius: 4px 10px 5px 8px;
  box-shadow: 8px 9px 0 var(--accent4), 15px 16px 0 oklch(15% 0.008 248 / 0.13);
  font-family: var(--disp);
  font-size: 1.45rem;
  line-height: 1.12;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  transform-origin: center bottom;
  animation: qlCardPop 0.54s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}

.ql-matchup-cards .ql-card-a {
  transform: rotate(-1.7deg);
}

.ql-matchup-cards .ql-card-b {
  animation-delay: 0.14s;
  transform: rotate(1.4deg);
}

@keyframes qlCardPop {
  from {
    opacity: 0;
    transform: translateY(42px) scale(0.72) rotate(var(--pop-rot, 0deg));
  }
  64% {
    opacity: 1;
    transform: translateY(-5px) scale(1.025) rotate(var(--pop-rot, 0deg));
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--pop-rot, 0deg));
  }
}

.ql-matchup-cards .ql-card-a { --pop-rot: -1.7deg; }
.ql-matchup-cards .ql-card-b { --pop-rot: 1.4deg; }

.ql-answers-revealed {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1100px;
  width: 100%;
}

.ql-answers-revealed.ql-matchup-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  width: min(94vw, 1220px);
  max-width: none;
}

.ql-vote-bar {
  flex: 1 1 340px;
  max-width: 480px;
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 8px;
  padding: 1em 1.2em;
  box-shadow: 5px 5px 0 var(--outline);
}

.ql-matchup-results .ql-vote-bar {
  flex: initial;
  max-width: none;
  min-height: 13rem;
  border-width: 4px;
  border-radius: 4px 10px 5px 8px;
  padding: 1.15em 1.25em;
  box-shadow: 8px 9px 0 var(--outline), 15px 16px 0 oklch(15% 0.008 248 / 0.13);
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform-origin: center bottom;
  animation: qlCardPop 0.54s cubic-bezier(0.16, 1, 0.3, 1) both;
  will-change: transform, opacity;
}

.ql-vote-bar.ql-won {
  box-shadow: 5px 5px 0 var(--accent3), 0 0 0 2px var(--outline);
}

.ql-matchup-results .ql-vote-bar.ql-won {
  box-shadow: 8px 9px 0 var(--accent3), 0 0 0 4px var(--outline), 15px 16px 0 oklch(15% 0.008 248 / 0.13);
}

.ql-vote-author {
  font-family: var(--disp);
  color: var(--accent);
  margin: 0 0 0.3em;
}

.ql-vote-text {
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0 0 0.6em;
}

.ql-matchup-results .ql-vote-author {
  font-size: 1.15rem;
}

.ql-matchup-results .ql-vote-text {
  font-family: var(--disp);
  font-size: 1.32rem;
  line-height: 1.12;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.ql-bar-track {
  height: 14px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
  border: 2px solid var(--outline);
}

.ql-bar-fill {
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--accent3) 0 12px, var(--accent4) 12px 24px);
  transition: width 0.45s ease;
}

.ql-vote-count {
  margin: 0.4em 0 0;
  font-family: var(--disp);
  font-size: 0.88rem;
  color: var(--ink-dim);
}

.ql-stamp {
  font-family: var(--disp);
  font-size: 2.4rem;
  color: var(--bad);
  transform: rotate(-3deg);
  text-shadow: 3px 3px 0 var(--outline);
}

.ql-result-lines p { margin: 0.15em 0; color: var(--ink-dim); }

.ql-drink-lines {
  display: flex;
  flex-direction: column;
  gap: 0.2em;
}

.ql-drink {
  margin: 0;
  color: var(--accent4);
  font-family: var(--disp);
  font-size: 1.05rem;
}

/* LEADERBOARD */
.ql-leaderboard {
  list-style: none;
  counter-reset: rank;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 460px;
}

.ql-leaderboard li {
  counter-increment: rank;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--disp);
  font-size: 1.2rem;
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 8px;
  padding: 0.55em 0.9em;
  margin-bottom: 0.45em;
  box-shadow: 3px 3px 0 oklch(18% 0.012 248 / 0.18);
}

.ql-leaderboard li::before {
  content: counter(rank) ".";
  color: var(--accent);
  min-width: 1.4em;
}

.ql-leaderboard .ql-score { margin-left: auto; color: var(--accent4); }
.ql-winner-name { font-family: var(--disp); font-size: 1.8rem; color: var(--accent4); }

/* misc */
.ql-host-chrome {
  position: absolute;
  left: calc(0.65rem + env(safe-area-inset-left));
  right: calc(0.65rem + env(safe-area-inset-right));
  bottom: calc(0.5rem + env(safe-area-inset-bottom));
  z-index: 4;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  pointer-events: none;
}

.ql-audio-toggle {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.35rem;
  padding: 0.22rem 0.65rem 0.22rem 0.32rem;
  border: 2px solid var(--outline);
  border-radius: 4px 9px 4px 8px;
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--outline);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--disp);
  font-size: 0.76rem;
  text-transform: uppercase;
  transform: rotate(0.7deg);
}

.ql-audio-toggle:disabled {
  opacity: 0.62;
  cursor: default;
}

.ql-audio-toggle:focus-visible {
  outline: 3px solid var(--accent3);
  outline-offset: 3px;
}

.ql-audio-icon {
  width: 1.65rem;
  height: 1.65rem;
  background: url("../../../assets/memes/dumb-wojak.png?v=20260707a") center / contain no-repeat;
  filter: grayscale(0.05) contrast(1.2);
  mix-blend-mode: multiply;
}

.ql-net-status {
  position: static;
  text-align: right;
  font-size: 0.75rem;
  color: var(--ink-dim);
  pointer-events: none;
}

@media (min-width: 760px) {
  .ql-title { font-size: 3.25rem; }
  .ql-huge { font-size: 5rem; }
  .ql-sub { font-size: 1.18rem; }
  .ql-prompt { font-size: 1.9rem; }
  .ql-announcer-line { font-size: 1.02rem; }
  .ql-rule-card h2 { font-size: 1.45rem; }
  .ql-answer-card,
  .ql-vote-text { font-size: 1.18rem; }
  .ql-matchup-cards .ql-answer-card { font-size: 2rem; min-height: 15.5rem; }
  .ql-matchup-results .ql-vote-text { font-size: 1.82rem; }
  .ql-matchup-results .ql-vote-author { font-size: 1.3rem; }
  .ql-matchup-results .ql-vote-bar { min-height: 16rem; }
  .ql-stamp { font-size: 3rem; }
  .ql-leaderboard li { font-size: 1.45rem; }
  .ql-winner-name { font-size: 2.2rem; }
}

@media (max-width: 760px) {
  .ql-lobby { flex-direction: column; }
  .ql-view { padding-bottom: calc(env(safe-area-inset-bottom) + 4.8rem); }
  .ql-rules-grid { grid-template-columns: 1fr; }
  .ql-rule-card { min-height: auto; padding: 1rem 0.9rem 0.85rem 4rem; }
  .ql-rule-num { top: 50%; left: 0.75rem; transform: translateY(-50%); }
  .ql-announcer-line {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem 0.55rem;
    padding: 0.55rem 0.7rem;
  }
  .ql-announcer-copy {
    grid-column: 1 / -1;
    font-size: 0.92rem;
  }
  .ql-host-chrome {
    align-items: center;
    gap: 0.55rem;
  }
  .ql-audio-toggle {
    max-width: 46vw;
    font-size: 0.68rem;
  }
  .ql-net-status {
    font-size: 0.68rem;
  }
  .ql-matchup-cards { gap: 0.75rem; width: 96vw; }
  .ql-matchup-cards .ql-answer-card {
    min-height: 9rem;
    padding: 0.9em 0.7em;
    font-size: 1rem;
  }
  .ql-matchup-results .ql-vote-bar {
    min-height: 10rem;
    padding: 0.85em;
  }
  .ql-matchup-results .ql-vote-text { font-size: 0.98rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ql-view { animation: none; }
  .ql-matchup-cards .ql-answer-card,
  .ql-matchup-results .ql-vote-bar {
    animation: none;
    will-change: auto;
  }
}
