:root {
  color-scheme: dark;
  --bg: #08080a;
  --card: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f7f7f8;
  --muted: #a1a1aa;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.065), transparent 31rem),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.account-page {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 112px;
}

.account-card {
  display: grid;
  gap: 18px;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.profile-header-card {
  display: grid;
  gap: 20px;
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.045));
}

.account-header-top {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.account-avatar {
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.08));
  font-size: 28px;
  font-weight: 900;
  overflow: hidden;
}

.account-header-info {
  display: grid;
  gap: 4px;
}

.account-header-info h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  font-weight: 800;
}

.account-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-email {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.account-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.meta-row {
  display: grid;
  gap: 10px;
  padding: 16px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.03);
  align-content: start;
}

.meta-row span {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-row strong {
  color: #f4f5f7;
  font-size: 17px;
  font-weight: 800;
}

.meta-row.is-link {
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.meta-row.is-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
}

.fav-header-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.header-team-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative; /* 삭제 버튼 위치 제어 */
  padding-right: 8px;
}

.header-team-item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  margin-top: -1px;
}

.header-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 69, 58, 0.4);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  position: absolute;
  top: -6px;
  right: -6px;
  padding: 0;
  transition: background 0.2s;
}
.header-remove-btn:hover {
  background: rgba(255, 69, 58, 0.8);
}

.header-add-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s;
}
.header-add-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.header-remove-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  transition: background 0.2s;
}
.header-remove-btn:hover {
  background: rgba(255, 69, 58, 0.6);
}

.meta-row .loading-mini {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.account-favorites {
  margin-bottom: 32px;
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 4px 16px;
}

.favorites-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--muted);
}

.favorites-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.favorite-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  text-align: center;
}

.favorite-logo {
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  object-fit: contain;
}

.favorite-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.favorite-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.favorite-item.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.favorite-item.is-empty:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.4);
}

.favorite-add-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  font-size: 24px;
  color: var(--muted);
}

.favorite-error {
  grid-column: 1 / -1;
  padding: 20px;
  text-align: center;
  color: #ffb6b6;
  font-size: 14px;
}

.account-actions button {
  min-height: 48px;
  border: 1px solid rgba(255, 69, 58, 0.26);
  border-radius: 16px;
  background: rgba(255, 69, 58, 0.11);
  color: #ffb6b6;
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 700px) {
  .account-page {
    width: 100%;
    padding: 14px 12px 112px;
  }

  .account-card {
    border-radius: 20px;
    padding: 18px;
  }

  .profile-header-card {
    padding: 20px;
  }

  .account-header-top {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
  }

  .account-avatar {
    width: 74px;
    height: 74px;
    font-size: 22px;
  }

  .account-meta-grid {
    grid-template-columns: 1fr 1fr;
    max-width: none;
    gap: 10px;
  }
}
