/* Account page — pond glass aesthetic (landing.css / site.css) */

body.site-page--account > main {
  width: 100%;
}

.account-page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 20px 48px;
}

/* —— Page intro —— */

.account-page__intro {
  margin: 8px 0 24px;
  padding: clamp(22px, 4vw, 32px) clamp(18px, 3vw, 28px);
  border-radius: 20px;
  text-align: center;
  background: oklch(20% 0.022 260 / 88%);
  box-shadow:
    inset 0 0 0 1px oklch(100% 0 0 / 9%),
    0 20px 44px oklch(6% 0.02 260 / 38%);
}

.account-page__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: oklch(78% 0.1 82);
}

.account-page__title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.account-page__lead {
  margin: 0 auto;
  max-width: 32em;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

/* —— Layout —— */

.account-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-signed-out {
  text-align: center;
}

.account-signed-out__title {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.account-signed-out__body {
  margin-bottom: 20px;
}

.account-load-more {
  margin-top: 14px;
}

/* —— Profile preview —— */

.account-profile-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: oklch(100% 0 0 / 4%);
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 8%);
}

.account-profile-preview__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.account-profile-preview__handle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.account-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid oklch(72% 0.14 82 / 45%);
  box-shadow: 0 0 16px oklch(72% 0.16 82 / 22%);
}

/* —— Forms —— */

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-form--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: none;
}

.account-field--grow {
  flex: 1;
  min-width: 160px;
}

.account-field__label,
.account-field legend.account-field__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-field__hint {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* Text fields — same chrome as lobby .board-modal__select / game .mode-select */
.account-page .account-field__input {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: oklch(24% 0.02 260 / 80%);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  outline: none;
  cursor: text;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.account-page .account-field__input::placeholder {
  color: oklch(58% 0.03 260);
}

.account-page .account-field__input:hover:not(:disabled):not(:read-only) {
  background: oklch(32% 0.03 260 / 90%);
  border-color: oklch(58% 0.06 260 / 45%);
  color: oklch(96% 0.02 260);
}

.account-page .account-field__input:focus {
  border-color: oklch(58% 0.06 260 / 45%);
  background: oklch(28% 0.025 260 / 95%);
}

.account-page .account-field__input:focus-visible {
  outline: 2px solid oklch(68% 0.12 250);
  outline-offset: 2px;
}

.account-page .account-field__input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-page input.account-field__input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.account-page input.account-field__input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 14px;
  width: 14px;
  margin-left: 4px;
  background: oklch(72% 0.028 260);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  cursor: pointer;
}

.account-page .account-field__input:-webkit-autofill,
.account-page .account-field__input:-webkit-autofill:hover,
.account-page .account-field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px oklch(24% 0.02 260) inset;
  box-shadow: 0 0 0 1000px oklch(24% 0.02 260) inset;
  border-color: oklch(58% 0.06 260 / 45%);
  transition: background-color 99999s ease-out;
}

.account-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.account-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: oklch(72% 0.14 82);
}

/* —— Avatar picker —— */

.account-avatar-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 10px;
}

.account-avatar-option {
  border: 2px solid transparent;
  border-radius: 50%;
  padding: 2px;
  background: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease;
}

.account-avatar-option:hover {
  border-color: oklch(58% 0.06 260 / 55%);
  transform: translateY(-1px);
}

.account-avatar-option[aria-checked="true"] {
  border-color: oklch(72% 0.14 82);
  box-shadow: 0 0 14px oklch(72% 0.16 82 / 35%);
}

.account-avatar-option img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
}

/* —— Status —— */

.account-status {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  min-height: 1.2em;
  color: var(--muted);
}

.account-status--error {
  color: oklch(78% 0.12 25);
}

/* —— Stats —— */

.account-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  margin: 0;
}

.account-stats > div {
  padding: 14px 12px;
  border-radius: 14px;
  text-align: center;
  background: oklch(100% 0 0 / 4%);
  box-shadow: inset 0 0 0 1px oklch(100% 0 0 / 8%);
}

.account-stats dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-stats dd {
  margin: 6px 0 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: oklch(94% 0.04 82);
}

/* —— Lists —— */

.account-subtitle {
  margin: 18px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-subtitle:first-of-type {
  margin-top: 4px;
}

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

.account-list__empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 0;
}

.account-requests {
  display: flex;
  flex-direction: column;
  gap: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.account-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-line);
}

.account-list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.account-list-item:first-child {
  padding-top: 0;
}

.account-list-item__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-list-item__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--glass-line);
}

.account-list-item__text {
  min-width: 0;
}

.account-list-item__name {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.account-list-item__sub {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.account-list-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
  justify-content: flex-end;
}

.account-list-item__actions .landing-btn,
.account-list-item > .landing-btn {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
}

.account-requests .account-list-item {
  padding: 12px 0;
  color: var(--text);
}

.site-nav__link--account.is-active,
.site-nav__link--account[aria-current="page"] {
  border-color: oklch(72% 0.14 82);
  background: oklch(32% 0.08 82);
  color: oklch(94% 0.04 82);
}

/* —— Responsive —— */

@media (max-width: 520px) {
  .account-page {
    padding: 8px 14px 36px;
  }

  .account-form--inline {
    flex-direction: column;
    align-items: stretch;
  }

  .account-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .account-list-item__actions {
    justify-content: stretch;
  }

  .account-list-item__actions .landing-btn,
  .account-list-item > .landing-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-avatar-option:hover {
    transform: none;
  }
}
