/* 1v1 (versus.js). The window reuses the filter modal's shell; the match screens live in the centre card,
   with the versus bar in place of the card's tier tabs. */

/* ---------- the 1v1 window ---------- */
.versus-modal .filter-group {
  margin-top: 22px;
}
.vs-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #34382e;
  border-radius: 12px;
  outline: none;
  background: #171b12;
  color: #d7ddd7;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vs-input::placeholder {
  color: #737a72;
}
.vs-input:focus {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.06);
}
/* your name: an empty field plays under the random name in its placeholder (tagged "Random"); the dice rolls another */
.vs-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
}
.vs-name-field {
  position: relative;
  min-width: 0;
}
.vs-name-input {
  padding-right: 76px;
}
.vs-name-tag {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1;
  text-transform: uppercase;
  transform: translateY(-50%);
  pointer-events: none;
}
.vs-dice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid #34382e;
  border-radius: 12px;
  background: #171b12;
  color: #a4aba3;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease-out);
}
.vs-dice:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--accent);
}
.vs-dice:active {
  transform: scale(0.94) rotate(-12deg);
}
.vs-dice svg {
  width: 19px;
  height: 19px;
}
.vs-name-note {
  margin: 8px 0 0;
  color: #8f968c;
  font-size: 11px;
  line-height: 1.5;
}
.vs-name-note strong {
  color: #c8cec8;
  font-weight: 700;
}
.vs-code-input {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-weight: 750;
  letter-spacing: 5px;
  text-transform: uppercase;
}
.vs-join {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 8px;
}
.versus-modal .vs-join .filter-done,
.versus-modal .vs-wide {
  height: 42px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.vs-wide {
  width: 100%;
}
.vs-hint {
  margin: 0 0 10px;
  color: #8f968c;
  font-size: 11.5px;
  line-height: 1.55;
}
.vs-center {
  margin-top: 22px;
  text-align: center;
}
.vs-fine {
  margin: 18px 0 0;
  color: #747b73;
  font-size: 10.5px;
  line-height: 1.55;
}
.vs-error {
  margin: 16px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(237, 92, 98, 0.08);
  color: #e57c78;
  font-size: 11.5px;
  line-height: 1.5;
}
.vs-error:empty {
  display: none;
}
.vs-code {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 4px;
  padding: 18px 16px;
  border: 1.5px dashed #34382e;
  border-radius: 18px;
  background: #11150d;
}
.vs-code-text {
  color: #fff;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 8px;
  user-select: all;
}
.vs-copy {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.vs-copy:hover {
  background: rgba(var(--accent-rgb), 0.2);
}
.vs-waiting {
  margin: 22px 0 0;
  color: #a4aba3;
  font-size: 12px;
  text-align: center;
}
.vs-connected {
  margin: 22px 0 6px;
  color: #c8cec8;
  font-size: 13px;
}
.vs-connected strong {
  color: #fff;
}
.versus-modal .filter-options button:disabled {
  cursor: default;
}
.versus-modal .filter-options button:disabled:not(.selected) {
  opacity: 0.5;
}
.versus-modal .filter-options button:disabled:hover {
  transform: none;
}
.vs-stage-options button {
  min-width: 46px;
}
.vs-settings-hint {
  margin-top: 16px;
}
.versus-modal .filter-footer {
  margin-top: 22px;
}
.vs-span {
  grid-column: 1 / -1;
}

/* waiting dots (window and card) */
.vs-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 4px;
}
.vs-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.25;
  animation: vsDot 1.2s ease-in-out infinite;
}
.vs-dots i:nth-child(2) {
  animation-delay: 0.16s;
}
.vs-dots i:nth-child(3) {
  animation-delay: 0.32s;
}
@keyframes vsDot {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-4px); }
}

/* ---------- the versus bar (in place of the card's tier tabs) ---------- */
.vs-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #272b23;
  border-radius: 14px;
  background: rgba(20, 24, 15, 0.92);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.vs-player {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.vs-player.rival {
  text-align: right;
}
.vs-name {
  overflow: hidden;
  color: #c8cec8;
  font-size: 11.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-player.active .vs-name {
  color: var(--accent);
}
.vs-player.me.active .vs-name::before,
.vs-player.rival.active .vs-name::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 6px 1px 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.6);
  vertical-align: middle;
}
.vs-player.rival.active .vs-name::after {
  margin: 0 0 1px 6px;
}
.vs-total {
  overflow: hidden;
  color: #7d857b;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-status {
  overflow: hidden;
  color: #a4aba3;
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-mid {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}
.vs-round {
  color: #72786f;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.vs-turn {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}
/* on the result card the bar floats at the top of the card */
.game-content.result-state > .vs-bar {
  position: absolute;
  top: 24px;
  right: 0;
  left: 0;
  z-index: 3;
}

/* ---------- match screens in the card ---------- */
.game-content.match-panel {
  padding-top: clamp(24px, 9vh, 120px);
}
.vs-panel {
  margin-top: 22px;
  text-align: center;
  animation: roundIn 0.42s var(--ease-out) both;
}
.vs-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.vs-panel h1 {
  margin: 8px 0 4px;
  color: #f4f5f2;
  font-size: 23px;
  letter-spacing: -0.5px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.vs-sub {
  margin: 0;
  color: #8f968c;
  font-size: 11.5px;
  line-height: 1.5;
}
.vs-notice {
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 209, 25, 0.08);
  color: var(--medium);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* pick: one tap on a category deals a random song from it */
.vs-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}
.vs-chip {
  --c: #e3e9e0;
  --c-rgb: 227, 233, 224;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(var(--c-rgb), 0.22);
  border-radius: 999px;
  background: rgba(var(--c-rgb), 0.1);
  color: var(--c);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.2s var(--ease-out), box-shadow 0.18s ease;
}
.vs-chip small {
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: 0.62;
}
.vs-chip:hover:not(:disabled),
.vs-chip:focus-visible {
  background: var(--c);
  color: var(--ink);
  box-shadow: 0 0 14px rgba(var(--c-rgb), 0.22);
  transform: translateY(-1px);
}
.vs-chip:active:not(:disabled) {
  transform: scale(0.96);
}
.vs-chip:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}
.vs-chip.easy { --c: var(--easy); --c-rgb: 34, 216, 117; }
.vs-chip.medium { --c: var(--medium); --c-rgb: 255, 209, 25; }
.vs-chip.hard { --c: var(--hard); --c-rgb: 225, 124, 33; }
.vs-chip.expert { --c: var(--expert); --c-rgb: 215, 72, 66; }
.vs-chip.impossible { --c: var(--impossible); --c-rgb: 154, 77, 224; }
.vs-chip.nightcore { --c: var(--nightcore); --c-rgb: 255, 102, 170; }
.vs-chip.mine { --c: var(--accent); --c-rgb: var(--accent-rgb); }

/* the category being guessed, in the versus bar */
.vs-turn.easy { color: var(--easy); }
.vs-turn.medium { color: var(--medium); }
.vs-turn.hard { color: var(--hard); }
.vs-turn.expert { color: var(--expert); }
.vs-turn.impossible { color: var(--impossible); }
.vs-turn.nightcore { color: var(--nightcore); }

.vs-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.vs-actions .result-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* loading: one line, nothing more */
.vs-loading-line {
  margin: 0;
  color: #a4aba3;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

/* the note under a match result card (in place of Retry / Next song): your result, then the round summary
   and the next pick */
.vs-result-note {
  display: grid;
  justify-items: center;
  gap: 5px;
  width: 100%;
  margin-top: 17px;
  /* sooner than solo's Retry / Next song (0.79 s + 0.46 s): the next pick's chips are in here, and rounds go fast */
  animation: resultCopyIn 0.3s 0.35s var(--ease-out) both;
}
.vs-result-note > strong {
  color: #dfe4df;
  font-size: 12.5px;
}
.vs-next,
.vs-next-line {
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.6px;
}
.vs-next-line {
  margin: 14px 0 0;
}
.vs-summary {
  display: grid;
  justify-items: center;
  gap: 3px;
  width: 100%;
}
.vs-headline {
  color: #f4f5f2;
  font-size: 15px;
  font-weight: 850;
}
.vs-summary .vs-scores {
  width: 100%;
  margin-top: 7px;
  gap: 5px;
}
.vs-summary .vs-score {
  padding: 7px 12px;
}
.vs-summary .vs-sub {
  margin-top: 4px;
  font-size: 10px;
}
.vs-next-pick {
  width: 100%;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.vs-next-pick .vs-chips {
  margin-top: 10px;
}
.vs-waiting-pick {
  margin: 8px 0 0;
  color: #a4aba3;
  font-size: 12px;
  font-weight: 650;
}

/* round summary + final */
.vs-scores {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  text-align: left;
}
.vs-score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 4px 14px;
  padding: 10px 13px;
  border: 1px solid #272b23;
  border-radius: 13px;
  background: #12160e;
}
.vs-score.win {
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.08);
}
.vs-score-name {
  overflow: hidden;
  color: #e3e8e2;
  font-size: 12.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-score-name small {
  color: #747b73;
  font-size: 10px;
  font-weight: 650;
}
.vs-score-name em {
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 8.5px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  vertical-align: 1px;
}
.vs-score-num {
  color: #dfe4df;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  text-align: right;
  white-space: nowrap;
}
.vs-score-num small {
  display: block;
  color: #6f766c;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.vs-mark {
  margin-right: 6px;
  font-weight: 900;
}
.vs-mark.ok {
  color: var(--accent);
}
.vs-mark.miss {
  color: #e57c78;
}
.vs-rounds {
  display: grid;
  gap: 2px;
  max-height: 34vh;
  margin-top: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #30352c transparent;
}
.vs-round-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 66px 66px;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 8px;
  color: #8f968c;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}
.vs-round-row:nth-child(even):not(.head) {
  background: rgba(255, 255, 255, 0.025);
}
.vs-round-row.head span {
  overflow: hidden;
  color: #72786f;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.vs-round-row.head .vs-rr-song {
  text-align: left;
}
.vs-rr-n {
  color: #6f766c;
  font-weight: 750;
}
.vs-rr-song {
  display: grid;
  min-width: 0;
}
.vs-rr-song strong,
.vs-rr-song small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-rr-song strong {
  color: #dfe4df;
  font-size: 11px;
}
.vs-rr-song small {
  color: #6f766c;
  font-size: 9px;
}
.vs-rr-res {
  display: grid;
  text-align: right;
  white-space: nowrap;
}
.vs-rr-res small {
  color: #6f766c;
  font-size: 9px;
  font-weight: 600;
}
.vs-rr-res.won {
  color: var(--accent);
  font-weight: 750;
}
.vs-rr-res .vs-mark {
  margin-right: 0;
}

/* toast ("Your rival left") */
.vs-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border: 1px solid #30352c;
  border-radius: 999px;
  background: #14180f;
  color: #e3e8e2;
  font: 650 12px/1.4 Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  animation: vsToastIn 0.32s var(--ease-out) both;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.vs-toast.out {
  opacity: 0;
  transform: translate(-50%, -8px);
}
@keyframes vsToastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- large desktop ---------- */
@media (min-width: 1600px) and (min-height: 850px) {
  .vs-bar {
    min-height: 56px;
    padding: 8px 16px;
    border-radius: 17px;
  }
  .vs-name {
    font-size: 14px;
  }
  .vs-total,
  .vs-status {
    font-size: 12px;
  }
  .vs-round {
    font-size: 10px;
  }
  .vs-turn {
    font-size: 13px;
  }
  .vs-panel h1 {
    font-size: 30px;
  }
  .vs-kicker {
    font-size: 11.5px;
  }
  .vs-sub,
  .vs-notice,
  .vs-loading-line,
  .vs-waiting-pick {
    font-size: 14px;
  }
  .vs-chip {
    height: 38px;
    padding: 0 16px;
    font-size: 13.5px;
  }
  .vs-chip small {
    font-size: 11.5px;
  }
  .vs-result-note > strong,
  .vs-headline {
    font-size: 17px;
  }
  .vs-next,
  .vs-next-line {
    font-size: 12px;
  }
  .vs-score-name,
  .vs-score-num {
    font-size: 15px;
  }
  .vs-round-row {
    grid-template-columns: 22px minmax(0, 1fr) 84px 84px;
    font-size: 12.5px;
  }
  .vs-rr-song strong {
    font-size: 13px;
  }
  .vs-rr-song small,
  .vs-rr-res small {
    font-size: 11px;
  }
}

/* ---------- short desktop windows ---------- */
@media (min-width: 761px) and (max-height: 820px) {
  .game-content.match-panel {
    padding-top: clamp(16px, 5vh, 60px);
  }
  .vs-panel {
    margin-top: 16px;
  }
}

/* ---------- mobile: the card scrolls when a match screen is taller than it ---------- */
@media (max-width: 760px) {
  .app-shell.in-match .game-card {
    flex: 1 1 0;
    justify-content: flex-start;
    min-height: 0;
    padding-bottom: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }
  .app-shell.in-match .game-card::-webkit-scrollbar {
    display: none;
  }
  .app-shell.in-match .game-content {
    margin: auto 0; /* centred when it fits, scrollable from the top when it doesn't */
    padding-top: 14px;
  }
  .app-shell.in-match .game-content.result-state {
    padding-top: 0;
  }
  .game-content.result-state > .vs-bar {
    position: static;
    width: 100%;
    margin-bottom: 14px;
  }
  .vs-panel {
    margin-top: 16px;
  }
  .vs-chip {
    height: 36px;
  }
}
@media (max-width: 430px) {
  .vs-bar {
    padding: 6px 10px;
  }
  .vs-code-text {
    font-size: 28px;
    letter-spacing: 6px;
  }
  .vs-join {
    grid-template-columns: minmax(0, 1fr) 92px;
  }
}
