.match-invites[hidden] {
  display: none;
}

.match-invites {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  width: min(410px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-card) 96%, transparent);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .28);
  backdrop-filter: blur(14px);
}

.match-invites__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.match-invites__head strong {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--violet);
  color: #fff;
  font-size: 12px;
}

.match-invites__list {
  display: grid;
  gap: 10px;
}

.match-invite {
  position: relative;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 42px 12px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  background: var(--bg-base);
}

.match-invite__dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.match-invite__dismiss:hover {
  color: var(--text-primary);
  border-color: var(--border-mid);
}

.match-invite__avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--violet);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
}

.match-invite__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.match-invite__body {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.match-invite__body--full {
  grid-column: 1 / -1;
}

.match-invite__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.match-invite__title strong {
  color: var(--text-primary);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-invite__timer {
  min-width: 34px;
  height: 26px;
  margin-right: 2px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(245, 158, 11, .24);
  border-radius: 999px;
  background: rgba(245, 158, 11, .1);
  color: #FCD34D;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.match-invite__meta {
  display: grid;
  gap: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.match-invite__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.match-invite__action {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--violet);
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.match-invite__action:disabled {
  cursor: wait;
  opacity: .7;
}

.match-invite__action.is-checking {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.match-invite__spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, .34);
  border-top-color: #fff;
  border-radius: 999px;
  animation: matchInviteSpin .75s linear infinite;
}

.match-invite__dots::after {
  content: '...';
  display: inline-block;
  width: 16px;
  text-align: left;
  animation: matchInviteDots 1.15s ease-in-out infinite;
}

.match-invite__action--reject {
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-secondary);
}

@keyframes matchInviteSpin {
  to { transform: rotate(360deg); }
}

@keyframes matchInviteDots {
  0%, 18% { opacity: .2; }
  45% { opacity: .6; }
  78%, 100% { opacity: 1; }
}

.match-invite__notice {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.match-invite-topic-picker {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: var(--bg-card);
}

.match-invite-topic-picker__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 900;
}

.match-invite-topic-picker input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  outline: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
}

.match-invite-topic-selected,
.match-invite-topic-options {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.match-invite-topic-selected span {
  color: var(--text-muted);
  font-size: 12px;
}

.match-invite-topic-selected button,
.match-invite-topic-options button {
  min-height: 29px;
  padding: 0 9px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.match-invite-topic-selected button {
  border: 1px solid rgba(34, 197, 94, .28);
  background: rgba(34, 197, 94, .1);
  color: #86EFAC;
}

.match-invite-topic-selected button.is-own-topic {
  border-color: rgba(96, 165, 250, .34);
  background: rgba(96, 165, 250, .12);
  color: #93C5FD;
}

.match-invite-topic-options button {
  border: 1px solid var(--border-subtle);
  background: var(--bg-base);
  color: var(--text-secondary);
}

.match-invite-topic-options button:disabled {
  cursor: not-allowed;
  opacity: .46;
}

.match-invite__notice--error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-primary);
}

.match-invite__notice a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--violet);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .match-invites {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}
