/* Member-facing improvements: readable chat bubbles, league identity and
   self-service profile editing. */
.profile-visual > img[data-member-player-image] {
  left: 50%;
  bottom: -3px;
  width: auto;
  height: 95%;
  max-width: none;
  object-fit: contain;
  object-position: center bottom;
  transform: translate(calc(-50% + var(--crop-x, 0%)), var(--crop-y, 0%)) scale(var(--player-scale, 1));
  transform-origin: center bottom;
  filter: drop-shadow(0 15px 28px rgba(0,0,0,.55));
}

.message p {
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 3px 13px 13px 13px;
  background: #0d1b13;
  color: #edf5f0;
}

.message.is-own p {
  margin-left: auto;
  border-color: rgba(89,243,167,.2);
  border-radius: 13px 3px 13px 13px;
  background: #123522;
}

.mini-message > div > span {
  color: #d8e4dd;
}

.attendance-actions button.is-syncing,
.quick-response button.is-syncing {
  border-color: rgba(89,243,167,.42);
  background: rgba(25,199,119,.16);
  color: #c9f8df;
  cursor: wait;
  opacity: 1;
}

.attendance-actions button:disabled:not(.is-syncing),
.quick-response button:disabled:not(.is-syncing) {
  cursor: wait;
  opacity: .52;
}

.app-sidebar nav button > i[hidden],
.mobile-nav button > i[hidden],
.notification-button > i[hidden] {
  display: none !important;
}

.event-league-mark {
  overflow: hidden;
  padding: 5px;
}

.event-league-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.event-league-mark.is-pl {
  background: #102219;
}

.event-detail-visual img {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(68%, 170px);
  max-height: 72%;
  object-fit: contain;
  filter: drop-shadow(0 12px 25px rgba(0,0,0,.48));
  transform: translate(-50%, -50%);
}

.event-detail-visual img[hidden],
.event-detail-visual span[hidden] {
  display: none;
}

.detail-lineup {
  display: grid;
  gap: 10px;
  margin: 15px 0;
  padding: 13px;
  border: 1px solid rgba(89,243,167,.16);
  background: #09170f;
}

.detail-lineup header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-lineup header span {
  color: var(--green-hot);
  font-size: .43rem;
  font-weight: 800;
  letter-spacing: .11em;
}

.detail-lineup header strong {
  font-family: var(--display);
  font-size: 1.2rem;
}

.detail-lineup > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.detail-lineup article {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  background: #07100b;
}

.detail-lineup article b {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  background: #123522;
  color: var(--green-hot);
  font-size: .42rem;
}

.detail-lineup article span {
  overflow: hidden;
  color: #d8e3dc;
  font-size: .43rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-profile-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(820px, calc(100dvh - 28px));
  overflow: auto;
  padding: 0;
  border: 1px solid rgba(89,243,167,.24);
  background: #07110b;
  color: #eef5f1;
  box-shadow: 0 35px 100px rgba(0,0,0,.75);
}

.member-profile-dialog::backdrop {
  background: rgba(0,0,0,.76);
  backdrop-filter: blur(6px);
}

.member-profile-dialog form > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 85% 0,rgba(89,243,167,.12),transparent 42%),#09150e;
}

.member-profile-dialog header > div {
  display: grid;
  gap: 5px;
}

.member-profile-dialog header p {
  margin: 0;
  color: var(--green-hot);
  font-size: .42rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.member-profile-dialog header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.member-profile-dialog header span {
  max-width: 460px;
  color: #718078;
  font-size: .42rem;
  line-height: 1.6;
}

.member-profile-dialog header button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: #839188;
  font-size: 1.1rem;
}

.member-profile-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 22px 8px;
}

.member-profile-fields label {
  display: grid;
  gap: 7px;
}

.member-profile-fields label > span,
.member-profile-dialog legend {
  color: #718078;
  font-size: .4rem;
  font-weight: 800;
}

.member-profile-fields input,
.member-profile-fields select {
  width: 100%;
  height: 43px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  outline: 0;
  background: #050d08;
  color: #eef5f1;
  font: inherit;
  font-size: .55rem;
}

.member-profile-fields input:focus,
.member-profile-fields select:focus {
  border-color: var(--green-hot);
}

.member-profile-dialog fieldset {
  margin: 12px 22px 0;
  padding: 14px;
  border: 1px solid var(--line);
}

.member-profile-dialog legend {
  padding: 0 6px;
}

.member-position-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.member-position-options label {
  position: relative;
}

.member-position-options input {
  position: absolute;
  opacity: 0;
}

.member-position-options span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: #7e8c84;
  font-size: .45rem;
  font-weight: 800;
  cursor: pointer;
}

.member-position-options input:checked + span {
  border-color: rgba(89,243,167,.42);
  background: #123522;
  color: var(--green-hot);
}

.member-position-options input:disabled + span {
  opacity: .45;
  cursor: default;
}

.member-image-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 22px 0;
  color: #728078;
  font-size: .4rem;
}

.member-image-note i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green-hot);
}

.member-profile-dialog form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: #08120c;
}

.member-profile-dialog footer button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: #8d9a93;
  font-size: .43rem;
  font-weight: 800;
}

.member-profile-dialog footer button.is-primary {
  border-color: var(--green);
  background: var(--green);
  color: #031009;
}

@media (max-width: 820px) {
  .mobile-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .message p {
    font-size: .9rem !important;
    line-height: 1.55;
  }

  .event-league-mark {
    width: 42px;
    height: 42px;
  }

  .detail-lineup header span,
  .detail-lineup article b,
  .detail-lineup article span {
    font-size: .74rem !important;
  }

  .member-profile-dialog form > header {
    padding: 18px 17px;
  }

  .member-profile-dialog header p,
  .member-profile-dialog header span,
  .member-profile-fields label > span,
  .member-profile-dialog legend,
  .member-position-options span,
  .member-image-note,
  .member-profile-dialog footer button {
    font-size: .78rem !important;
  }

  .member-profile-fields {
    grid-template-columns: 1fr;
    padding: 18px 17px 6px;
  }

  .member-profile-dialog fieldset,
  .member-image-note {
    margin-right: 17px;
    margin-left: 17px;
  }

  .member-position-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .member-position-options span {
    min-height: 44px;
  }

  .member-profile-dialog form > footer {
    position: sticky;
    bottom: 0;
    padding: 13px 17px calc(13px + env(safe-area-inset-bottom));
  }
}

.schedule-card {
  grid-column: 1 / -1;
}

@media (max-width: 430px) {
  .detail-lineup > div {
    grid-template-columns: 1fr;
  }

  .member-profile-dialog footer button {
    flex: 1;
  }
}
