/* Echo Pier account auth modal + avatar */

*,
*::before,
*::after {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.account-avatar {
  --avatar-size: 2.25rem;
  position: relative;
  width: var(--avatar-size);
  height: var(--avatar-size);
  border: 1px solid rgba(36, 61, 56, 0.14);
  border-radius: 50%;
  padding: 0;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85), transparent 55%),
    linear-gradient(145deg, #d7e8e3, #b7cfc8);
  color: #2f4f4a;
  cursor: pointer;
  flex-shrink: 0;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.account-avatar:hover,
.account-avatar:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 79, 74, 0.35);
  box-shadow: 0 8px 18px rgba(47, 79, 74, 0.12);
  outline: none;
}

.account-avatar-glyph {
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
}

.account-avatar-seal {
  width: 1.4rem;
  height: 1.4rem;
  opacity: 0.92;
  display: block;
  pointer-events: none;
  overflow: visible;
}

.account-avatar.is-logged .account-avatar-seal {
  display: none;
}

.site-header .header-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.points-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 5;
}

.points-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  border: 1px solid rgba(36, 61, 56, 0.14);
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.3rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(215, 232, 227, 0.55));
  color: #2f4f4a;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.points-wrap:hover .points-badge,
.points-wrap.is-open .points-badge,
.points-badge:hover,
.points-badge:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 79, 74, 0.35);
  box-shadow: 0 8px 18px rgba(47, 79, 74, 0.1);
  outline: none;
}

.points-badge-label {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(47, 79, 74, 0.62);
}

.points-badge-value {
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #243d38;
}

.game-header .points-badge {
  padding: 0.24rem 0.62rem 0.26rem;
}

.game-header .points-badge-value {
  font-size: 0.9rem;
}

.game-header .account-avatar {
  --avatar-size: 2.15rem;
}

.game-header {
  z-index: 25;
  overflow: visible;
}

.header-actions,
.header-tools {
  overflow: visible;
}

.points-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(36, 52, 48, 0.38);
  backdrop-filter: blur(6px);
}

.points-modal {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(22rem, calc(100vw - 2rem));
  max-height: min(90svh, 36rem);
  overflow: auto;
  padding: 1.45rem 1.4rem 1.25rem;
  border: 1px solid rgba(36, 61, 56, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(223, 236, 231, 0.88)),
    #f4f8f6;
  box-shadow: 0 24px 60px rgba(36, 52, 48, 0.22);
  color: #243d38;
}

.points-backdrop[hidden],
.points-modal[hidden] {
  display: none !important;
}

.points-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.points-modal-head h2 {
  margin: 0;
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.points-modal-head p {
  margin: 0.35rem 0 0;
  color: rgba(47, 79, 74, 0.72);
  font-size: 0.86rem;
  line-height: 1.55;
  font-weight: 300;
}

.points-modal-body {
  display: grid;
  gap: 0.85rem;
}

.points-modal-balance-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(36, 61, 56, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
}

.points-modal-balance-label {
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: rgba(47, 79, 74, 0.65);
}

.points-modal-balance-value {
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #243d38;
}

.points-modal-hint {
  margin: 0;
  text-align: center;
  color: rgba(47, 79, 74, 0.55);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.points-modal-checkin {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  background: linear-gradient(145deg, #3f6a62, #2f4f4a);
  color: #f4f8f6;
  font: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.points-modal-checkin:hover:not(:disabled),
.points-modal-checkin:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(47, 79, 74, 0.22);
  outline: none;
}

.points-modal-checkin:disabled {
  opacity: 0.55;
  cursor: default;
}

.points-modal-detail {
  display: block;
  text-align: center;
  margin-top: 0.15rem;
  color: rgba(47, 79, 74, 0.72);
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.points-modal-detail:hover,
.points-modal-detail:focus-visible {
  color: #243d38;
  text-decoration: underline;
  outline: none;
}

.auth-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.65rem;
}

.auth-points-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.28rem;
  border: 1px solid rgba(36, 61, 56, 0.14);
  border-radius: 999px;
  padding: 0.22rem 0.65rem 0.24rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(215, 232, 227, 0.6));
  color: rgba(47, 79, 74, 0.72);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.auth-points-tag strong {
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 0.92rem;
  font-weight: 600;
  color: #243d38;
  letter-spacing: 0.02em;
}

.auth-points-tag:hover,
.auth-points-tag:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 79, 74, 0.35);
  box-shadow: 0 6px 14px rgba(47, 79, 74, 0.1);
  outline: none;
}

.auth-points-tag[hidden] {
  display: none !important;
}

.auth-edit-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(36, 61, 56, 0.14);
  border-radius: 999px;
  padding: 0.22rem 0.7rem 0.24rem;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(215, 232, 227, 0.6));
  color: #2f4f4a;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  line-height: 1.2;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.auth-edit-tag:hover,
.auth-edit-tag:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(47, 79, 74, 0.35);
  box-shadow: 0 6px 14px rgba(47, 79, 74, 0.1);
  outline: none;
}

.auth-edit-tag[hidden] {
  display: none !important;
}

.auth-account-id {
  color: rgba(47, 79, 74, 0.7);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.auth-security-list {
  display: grid;
  gap: 0.7rem;
}

.auth-security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(36, 61, 56, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.auth-security-meta {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.auth-security-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(47, 79, 74, 0.58);
}

.auth-security-value {
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 0.98rem;
  font-weight: 600;
  color: #243d38;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-security-edit {
  flex-shrink: 0;
  border: 1px solid rgba(36, 61, 56, 0.16);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  background: transparent;
  color: #2f4f4a;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.auth-security-edit:hover,
.auth-security-edit:focus-visible {
  background: rgba(36, 61, 56, 0.06);
  outline: none;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(36, 52, 48, 0.38);
  backdrop-filter: blur(6px);
}

.auth-modal {
  position: fixed;
  z-index: 90;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(24.5rem, calc(100vw - 2rem));
  max-height: min(90svh, 40rem);
  overflow: auto;
  padding: 1.45rem 1.4rem 1.25rem;
  border: 1px solid rgba(36, 61, 56, 0.12);
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(223, 236, 231, 0.88)),
    #f4f8f6;
  box-shadow: 0 24px 60px rgba(36, 52, 48, 0.22);
  color: #243d38;
}

.auth-modal[hidden],
.auth-backdrop[hidden] {
  display: none !important;
}

.auth-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.auth-modal-head h2 {
  margin: 0;
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.auth-modal-head p {
  margin: 0.35rem 0 0;
  color: rgba(47, 79, 74, 0.72);
  font-size: 0.86rem;
  line-height: 1.55;
  font-weight: 300;
}

.auth-close {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(36, 61, 56, 0.06);
  color: #2f4f4a;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.auth-close:hover,
.auth-close:focus-visible {
  background: rgba(36, 61, 56, 0.12);
  outline: none;
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-form {
  display: grid;
  gap: 0.85rem;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
}

.auth-form label > span {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: rgba(47, 79, 74, 0.75);
}

.auth-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(36, 61, 56, 0.14);
  border-radius: 12px;
  padding: 0.72rem 0.85rem;
  background: rgba(255, 255, 255, 0.72);
  color: #243d38;
  font: inherit;
  font-size: 0.95rem;
}

.auth-form input:focus {
  outline: none;
  border-color: rgba(95, 143, 136, 0.65);
  box-shadow: 0 0 0 3px rgba(159, 191, 184, 0.35);
}

.auth-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  align-items: end;
}

.auth-code-row label {
  min-width: 0;
}

.auth-send-code {
  height: 2.7rem;
  padding: 0 0.95rem;
  border: 1px solid rgba(36, 61, 56, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  color: #2f4f4a;
  font: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
}

.auth-send-code:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-submit {
  margin-top: 0.25rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.78rem 1.2rem;
  background: #5f8f88;
  color: #f7fbf9;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-submit:hover,
.auth-submit:focus-visible {
  background: #4f7f78;
  outline: none;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.85rem 0 0.35rem;
  color: rgba(47, 79, 74, 0.45);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(95, 143, 136, 0.28);
}

.auth-siyins {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  border: 1px solid rgba(95, 143, 136, 0.55);
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  background: transparent;
  color: #2f4f4a;
  font: inherit;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-siyins-logo {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}

.auth-siyins:hover,
.auth-siyins:focus-visible {
  background: rgba(95, 143, 136, 0.12);
  border-color: #5f8f88;
  outline: none;
}

.auth-footer-links {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.auth-footer-links button {
  border: none;
  background: none;
  padding: 0;
  color: rgba(47, 79, 74, 0.78);
  font: inherit;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.auth-footer-links button:hover,
.auth-link:hover {
  color: #2f4f4a;
}

.auth-link {
  border: none;
  background: none;
  padding: 0;
  color: rgba(47, 79, 74, 0.78);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.auth-note {
  display: none;
}

.auth-toast {
  position: fixed;
  left: 50%;
  top: 1.25rem;
  bottom: auto;
  transform: translateX(-50%) translateY(-6px);
  z-index: 200;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(77, 115, 107, 0.28);
  color: #243d38;
  box-shadow: 0 14px 36px rgba(36, 52, 48, 0.18);
  backdrop-filter: blur(10px);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.auth-toast,
#toast,
#echo-auth-toast {
  z-index: 200;
}

.auth-account-card {
  display: grid;
  gap: 0.9rem;
  justify-items: center;
  text-align: center;
  padding: 0.4rem 0 0.2rem;
}

.auth-account-avatar {
  width: 4.2rem;
  height: 4.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  background: linear-gradient(145deg, #d7e8e3, #9fbfb8);
  color: #2f4f4a;
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.55rem;
  font-weight: 600;
  border: 1px solid rgba(36, 61, 56, 0.12);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-account-avatar:hover,
.auth-account-avatar:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(47, 79, 74, 0.14);
  outline: none;
}

.auth-account-glyph {
  line-height: 1;
}

.auth-account-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-account-name {
  border: none;
  background: transparent;
  padding: 0.15rem 0.4rem;
  margin: 0;
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
}

.auth-account-name:hover,
.auth-account-name:focus-visible {
  background: rgba(36, 61, 56, 0.06);
  outline: none;
}

.auth-account-name-input {
  width: min(14rem, 100%);
  box-sizing: border-box;
  border: 1px solid rgba(36, 61, 56, 0.18);
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.05rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.85);
  color: #243d38;
}

.auth-account-name-input:focus {
  outline: none;
  border-color: rgba(95, 143, 136, 0.65);
  box-shadow: 0 0 0 3px rgba(159, 191, 184, 0.35);
}

.auth-account-card strong {
  font-family: var(--font-display, "Noto Serif SC", serif);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
}

.auth-account-card span {
  color: rgba(47, 79, 74, 0.7);
  font-size: 0.9rem;
  word-break: break-all;
}

.auth-account-hint {
  margin: 0;
  color: rgba(47, 79, 74, 0.55);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.account-avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.account-avatar {
  position: relative;
}

.auth-logout {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid rgba(36, 61, 56, 0.16);
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  background: transparent;
  color: #2f4f4a;
  font: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.auth-logout:hover,
.auth-logout:focus-visible {
  background: rgba(36, 61, 56, 0.06);
  outline: none;
}

.auth-delete {
  width: 100%;
  margin-top: 0.55rem;
  border: 1px solid rgba(122, 48, 48, 0.28);
  border-radius: 999px;
  padding: 0.72rem 1.2rem;
  background: rgba(122, 48, 48, 0.06);
  color: #7a3030;
  font: inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.auth-delete:hover,
.auth-delete:focus-visible {
  background: rgba(122, 48, 48, 0.12);
  border-color: rgba(122, 48, 48, 0.42);
  outline: none;
}

.auth-delete-confirm {
  width: 100%;
  margin-top: 0.55rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid rgba(122, 48, 48, 0.22);
  border-radius: 14px;
  background: rgba(122, 48, 48, 0.05);
  text-align: left;
}

.auth-delete-warn {
  margin: 0 0 0.75rem;
  color: rgba(74, 42, 42, 0.88);
  font-size: 0.82rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
}

.auth-delete-password-wrap {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.auth-delete-password-wrap span {
  color: rgba(74, 42, 42, 0.7) !important;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.auth-delete-password-wrap input {
  width: 100%;
  border: 1px solid rgba(122, 48, 48, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: rgba(255, 255, 255, 0.72);
  color: #3a2a2a;
  font: inherit;
}

.auth-delete-password-wrap input:focus {
  outline: none;
  border-color: rgba(122, 48, 48, 0.45);
}

.auth-delete-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.auth-delete-cancel,
.auth-delete-confirm-btn {
  border-radius: 999px;
  padding: 0.65rem 0.9rem;
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.auth-delete-cancel {
  border: 1px solid rgba(36, 61, 56, 0.16);
  background: transparent;
  color: #2f4f4a;
}

.auth-delete-cancel:hover,
.auth-delete-cancel:focus-visible {
  background: rgba(36, 61, 56, 0.06);
  outline: none;
}

.auth-delete-confirm-btn {
  border: 1px solid rgba(122, 48, 48, 0.35);
  background: #7a3030;
  color: #f7efef;
}

.auth-delete-confirm-btn:hover,
.auth-delete-confirm-btn:focus-visible {
  background: #692929;
  outline: none;
}

.auth-delete-confirm-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

@media (max-width: 760px) {
  .site-header .header-tools {
    gap: 0.45rem;
  }

  .points-badge {
    padding: 0.24rem 0.55rem 0.26rem;
  }

  .points-badge-label {
    font-size: 0.62rem;
  }

  .points-badge-value {
    font-size: 0.88rem;
  }

  .account-avatar {
    --avatar-size: 2.35rem;
  }
}
