/* Homepage invite-friend entry and dialog. */

.invite-fab {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 76px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 16px 0 7px;
  border: 1px solid #e2a900;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe36b, #febe00);
  box-shadow: inset 0 1px 0 #fff6c7, 0 6px 18px rgb(146 105 0 / 28%);
  color: #6b4300;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.invite-fab:hover {
  background: linear-gradient(180deg, #ffe88a, #ffc91a);
  box-shadow: inset 0 1px 0 #fffbe0, 0 9px 24px rgb(146 105 0 / 34%);
  transform: translateY(-2px);
}

.invite-fab:active {
  transform: translateY(0);
}

.invite-fab.is-dragging,
.invite-fab.is-dragging:hover,
.invite-fab.is-dragging:active {
  cursor: grabbing;
  transform: none;
  transition: box-shadow .16s ease;
}

.invite-fab-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff8dc;
  box-shadow: inset 0 0 0 1px #ffec9c;
  color: #b00000;
}

.invite-fab-icon .icon {
  width: 19px;
  height: 19px;
}

.invite-fab-badge {
  position: absolute;
  top: -7px;
  right: -3px;
  padding: 1px 7px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #cc0000;
  box-shadow: 0 2px 6px rgb(129 0 0 / 24%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .2px;
  animation: invite-badge-pulse 2.8s ease-out infinite;
}

@keyframes invite-badge-pulse {
  0%, 100% { box-shadow: 0 2px 6px rgb(129 0 0 / 24%), 0 0 0 0 rgb(204 0 0 / 34%); }
  50% { box-shadow: 0 2px 6px rgb(129 0 0 / 24%), 0 0 0 5px rgb(204 0 0 / 0%); }
}

/* Dialog */
.invite-modal {
  position: fixed;
  z-index: 95;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .18s ease, visibility .18s ease;
}

.invite-modal.open {
  visibility: visible;
  opacity: 1;
}

.invite-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(28 26 22 / 52%);
  backdrop-filter: blur(3px);
}

.invite-dialog {
  position: relative;
  width: min(470px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 24px 24px 16px;
  border-top: 4px solid #febe00;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 64px rgb(0 0 0 / 26%);
  transform: translateY(16px) scale(.97);
  transition: transform .24s cubic-bezier(.2, .9, .3, 1.1);
}

.invite-modal.open .invite-dialog {
  transform: none;
}

.invite-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #999;
}

.invite-close:hover {
  background: #f3f1eb;
  color: #444;
}

.invite-close .icon {
  width: 18px;
  height: 18px;
}

.invite-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 34px;
}

.invite-emblem {
  display: grid;
  flex: none;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(150deg, #fff4b8, #febe00);
  box-shadow: inset 0 1px 0 #fffbe0;
  color: #a00000;
  transform: rotate(-4deg);
}

.invite-emblem .icon {
  width: 27px;
  height: 27px;
  transform: rotate(4deg);
}

.invite-head h2 {
  margin: 0;
  color: #2a2114;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
}

.invite-head p {
  margin: 4px 0 0;
  color: #8b7b62;
  font-size: 12px;
  line-height: 1.6;
}

.invite-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 16px;
  padding: 12px 8px;
  border: 1px solid #f1e2b3;
  border-radius: 12px;
  background: #fffaf0;
}

.invite-rules span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #8b7b62;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.invite-rules strong {
  color: #cc0000;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
}

.invite-flash {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #f0d68a;
  border-radius: 8px;
  background: #fff8e2;
  color: #7a5a00;
  font-size: 12px;
  line-height: 1.6;
}

.invite-guest {
  padding: 18px 14px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fcfcfa;
  text-align: center;
}

.invite-guest > p:first-child {
  margin: 0 0 14px;
  color: #666;
  font-size: 13px;
}

.invite-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 8px;
  background: #cc0000;
  box-shadow: 0 4px 12px rgb(204 0 0 / 22%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}

.invite-primary:hover {
  background: #a80000;
  transform: translateY(-1px);
}

.invite-primary .icon {
  width: 18px;
  height: 18px;
}

.invite-guest-note {
  margin: 10px 0 0;
  color: #999;
  font-size: 12px;
}

.invite-guest-note a {
  color: #337ab7;
}

.invite-guest-note a:hover {
  text-decoration: underline;
}

.invite-code-box {
  padding: 14px 14px 12px;
  border: 1px dashed #e8b800;
  border-radius: 12px;
  background: linear-gradient(150deg, #fff9e6, #fff3c9);
  text-align: center;
}

.invite-code-label {
  display: block;
  color: #8b7b62;
  font-size: 11px;
}

.invite-code {
  display: block;
  margin: 4px 0 9px;
  color: #a00000;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 29px;
  font-weight: 800;
  letter-spacing: 4px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.invite-copy-button {
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid #d9c27a;
  border-radius: 999px;
  background: #fff;
  color: #7a5a00;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.invite-copy-button:hover {
  border-color: #cc0000;
  color: #cc0000;
}

.invite-share {
  margin-top: 13px;
}

.invite-share > label {
  display: block;
  margin-bottom: 5px;
  color: #8b7b62;
  font-size: 11px;
}

.invite-share-row {
  display: flex;
  gap: 7px;
}

.invite-share-row input {
  min-width: 0;
  flex: 1;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 7px;
  background: #fafafa;
  color: #666;
  font-size: 12px;
}

.invite-share-row .invite-copy-button {
  flex: none;
}

.invite-hint {
  margin: 9px 0 0;
  color: #9a8f80;
  font-size: 11px;
  line-height: 1.6;
}

.invite-progress {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f7f4;
}

.invite-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: #777;
  font-size: 12px;
}

.invite-progress-head span {
  white-space: nowrap;
}

.invite-progress-head strong {
  color: #cc0000;
  font-size: 14px;
}

.invite-progress-bar {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e4dc;
}

.invite-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #febe00, #cc0000);
  transition: width .4s ease;
}

.invite-people {
  margin-top: 14px;
}

.invite-people-title {
  display: block;
  margin-bottom: 2px;
  color: #8b7b62;
  font-size: 11px;
}

.invite-people-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.invite-people-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid #f1efe9;
  font-size: 12px;
}

.invite-people-list li:last-child {
  border-bottom: 0;
}

.invite-person-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: #7092b0;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.invite-person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invite-person-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #444;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-person-date {
  color: #aaa;
  font-size: 11px;
}

.invite-person-points {
  flex: none;
  color: #cc0000;
  font-weight: 700;
}

.invite-person-points.is-zero {
  color: #a7a29a;
  font-weight: 600;
}

.invite-limit {
  padding: 18px 14px;
  border: 1px solid #d8ead1;
  border-radius: 12px;
  background: #f4faf1;
  text-align: center;
}

.invite-limit-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #e3f2dc;
  color: #4d8a63;
}

.invite-limit-icon .icon {
  width: 23px;
  height: 23px;
}

.invite-limit strong {
  display: block;
  color: #356b47;
  font-size: 15px;
}

.invite-limit p {
  margin: 4px 0 0;
  color: #6f8a74;
  font-size: 12px;
}

.invite-footnote {
  margin: 16px 0 0;
  padding-top: 11px;
  border-top: 1px solid #f0eee8;
  color: #aaa196;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 680px) {
  .invite-fab {
    right: 13px;
    bottom: 60px;
    height: 42px;
    padding-right: 13px;
    font-size: 12px;
  }

  .invite-fab-icon {
    width: 29px;
    height: 29px;
  }

  .invite-fab-icon .icon {
    width: 17px;
    height: 17px;
  }

  .invite-dialog {
    padding: 20px 16px 13px;
  }

  .invite-head h2 {
    font-size: 19px;
  }

  .invite-rules strong {
    font-size: 19px;
  }

  .invite-code {
    font-size: 25px;
    letter-spacing: 3px;
  }

  .invite-person-date {
    display: none;
  }
}

@media (max-width: 380px) {
  .invite-fab-label {
    display: none;
  }

  .invite-fab {
    padding: 0 7px;
  }
}
