/* MyScape — auth, profiles, friends, calls (Apple light theme) */

/* ---------- avatars & status ---------- */
.avatar { position: relative; }
.user-avatar { padding: 0; width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent; cursor: pointer; }
.user-avatar svg { display: block; }
.status-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-2); vertical-align: middle; margin-right: 6px;
}
.status-dot.online { background: #34c759; box-shadow: 0 0 4px rgba(52,199,89,.7); }
.status-dot.away { background: #ff9500; }
.status-dot.busy { background: #ff3b30; }
.avatar-wrap .status-dot {
  position: absolute; bottom: 0; right: 0; width: 10px; height: 10px;
  border: 2px solid #1d1d1f; margin: 0;
}
.dd-sep { height: 1px; background: rgba(0,0,0,.08); margin: 6px 0; }
.dd-status .status-dot { margin-right: 8px; }

/* ---------- auth page ---------- */
.auth-page { display: flex; align-items: center; justify-content: center; padding: 60px 20px; }
.auth-panel {
  width: 100%; max-width: 380px; background: #fff; border-radius: 18px;
  padding: 32px; box-shadow: 0 10px 40px rgba(0,0,0,.12);
}
.auth-logo { text-align: center; margin-bottom: 10px; }
.auth-logo .logo-text { display: block; margin-top: 8px; color: var(--text); font-size: 22px; letter-spacing: 5px; font-weight: 800; }
.auth-tabs { display: flex; gap: 6px; margin: 16px 0; border-bottom: 1px solid rgba(0,0,0,.08); }
.auth-tab {
  flex: 1; background: none; border: none; color: var(--text-2); font-size: 14px;
  padding: 10px 8px; cursor: pointer; font-family: inherit;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--accent); font-weight: 600; border-bottom: 2px solid var(--accent); margin-bottom: -1px; }
.form-input {
  display: block; width: 100%; background: var(--search); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text); font-size: 14px; padding: 11px 14px;
  margin-bottom: 10px; outline: none; font-family: inherit;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,113,227,.15); }
.form-input::placeholder { color: var(--text-3); }
textarea.form-input { resize: vertical; min-height: 70px; }
.auth-error { color: var(--negative); font-size: 13px; min-height: 18px; margin-top: 8px; text-align: center; }
.auth-note { color: var(--text-3); font-size: 11px; text-align: center; margin: 14px 0 0; line-height: 1.5; }

/* OAuth sign-in (Google / GitHub) */
.auth-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 12px; color: var(--text-3);
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
}
.auth-divider::before,
.auth-divider::after {
  content: ""; flex: 1; height: 1px; background: rgba(0,0,0,.10);
}
.oauth-row { display: flex; gap: 8px; }
.oauth-btn {
  flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.oauth-btn:hover { background: var(--search); border-color: rgba(0,0,0,.18); }
.oauth-btn:active { transform: translateY(1px); }
.oauth-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.oauth-btn.is-disabled { opacity: .45; pointer-events: none; }
.auth-hint { color: var(--text-2); font-size: 12px; margin: 4px 0 14px; line-height: 1.6; }

/* ---------- profile ---------- */
.profile-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px 50px; }
.profile-card {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: flex;
  gap: 26px; align-items: flex-start; flex-wrap: wrap;
}
.profile-avatar svg { width: 110px; height: 110px; display: block; }
.profile-main { flex: 1; min-width: 260px; }
.profile-name { color: var(--text); font-size: 24px; font-weight: 700; margin: 0; }
.profile-username { color: var(--text-2); font-size: 13px; margin: 3px 0 8px; }
.profile-status { color: var(--text); font-size: 13px; margin-bottom: 10px; }
.profile-bio { color: #4d4d52; font-size: 14px; line-height: 1.6; margin: 0 0 10px; max-width: 560px; }
.profile-meta { color: var(--text-2); font-size: 12px; line-height: 1.9; }
.profile-meta b { color: var(--text); font-weight: 400; }
.profile-level { margin: 10px 0 4px; }
.level-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); }
.exp-bar { flex: 1; height: 7px; background: var(--bar); border-radius: 4px; overflow: hidden; }
.exp-fill { height: 100%; background: #0071e3; }
.level-badge {
  display: inline-block; background: #0071e3; color: #fff; font-size: 12px;
  font-weight: 700; padding: 3px 10px; border-radius: 10px; margin-right: 8px;
}
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.profile-side { flex: 0 0 220px; }
.stat-tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 10px; }
.stat-tile .stat-num { color: var(--accent); font-size: 26px; font-weight: 700; }
.stat-tile .stat-label { color: var(--text-2); font-size: 11px; margin-top: 4px; }
.edit-form { margin-top: 14px; max-width: 460px; }
.edit-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.edit-row label { width: 100px; color: var(--text-2); font-size: 12px; flex: 0 0 auto; }
.edit-row input[type=range] { flex: 1; min-width: 120px; }
.hue-preview svg { width: 40px; height: 40px; }

.section-block { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin-top: 16px; }
.section-block h3 { color: var(--text); font-size: 15px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 14px; }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pg-item { background: var(--card-2); border-radius: 12px; overflow: hidden; text-decoration: none; display: block; }
.pg-item:hover { outline: 2px solid var(--accent); }
.pg-item img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.pg-info { padding: 8px 10px; }
.pg-title { color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-hours { color: var(--text-2); font-size: 10px; margin-top: 2px; }

.friend-mini {
  display: flex; align-items: center; gap: 10px; background: var(--card-2);
  border-radius: 12px; padding: 8px 12px; text-decoration: none; margin-bottom: 8px;
}
.friend-mini:hover { outline: 2px solid var(--accent); }
.friend-mini svg { width: 36px; height: 36px; }
.fm-name { color: var(--text); font-size: 13px; }
.fm-state { color: var(--text-2); font-size: 11px; margin-top: 2px; }

/* ---------- friends page ---------- */
.fr-wrap { max-width: 900px; margin: 0 auto; padding: 24px 20px 50px; }
.fr-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.fr-head h1 { color: var(--text); font-size: 24px; font-weight: 700; margin: 0; flex: 1; }
.fr-add { display: flex; gap: 8px; width: 100%; max-width: 420px; }
.fr-search { flex: 1; }
.fr-results { margin-bottom: 12px; }
.fr-section-title { color: var(--text); font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin: 20px 0 10px; }
.fr-row {
  display: flex; align-items: center; gap: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 8px;
}
.fr-row svg { width: 42px; height: 42px; flex: 0 0 auto; }
.fr-info { flex: 1; min-width: 0; }
.fr-name { color: var(--text); font-size: 14px; font-weight: 600; }
.fr-name a { color: inherit; text-decoration: none; }
.fr-name a:hover { color: var(--accent); }
.fr-state { color: var(--text-2); font-size: 12px; margin-top: 2px; }
.fr-actions { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; }
.fr-empty { color: var(--text-2); font-size: 13px; padding: 6px 2px; }

/* ---------- calls ---------- */
.call-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 600;
  display: flex; align-items: center; justify-content: center;
}
.call-card { text-align: center; background: #fff; border-radius: 20px; padding: 34px 44px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.call-avatar svg { width: 76px; height: 76px; }
.call-avatar.pulse { animation: ringpulse 1.2s ease-in-out infinite; }
@keyframes ringpulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.call-name { color: var(--text); font-size: 18px; margin: 16px 0 22px; }
.call-btns { display: flex; gap: 18px; justify-content: center; }
.call-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  transition: filter .15s;
}
.call-btn:hover { filter: brightness(1.1); }
.call-btn.accept { background: #34c759; color: #fff; }
.call-btn.end { background: #ff3b30; color: #fff; }
.call-btn.mute { background: var(--card-3); color: var(--text); width: 44px; height: 44px; font-size: 17px; }
.call-btn.mute.on { background: #ff3b30; color: #fff; }

.call-window {
  position: fixed; right: 20px; bottom: 20px; z-index: 550; width: 300px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2); padding: 16px;
}
.call-head { display: flex; gap: 12px; align-items: center; }
.call-head svg { width: 44px; height: 44px; }
.call-name { color: var(--text); font-size: 15px; font-weight: 600; margin: 0; }
.call-state { color: var(--text-2); font-size: 12px; margin-top: 3px; }
.call-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* ---------- misc ---------- */
.hue-range { accent-color: var(--accent); }
.inline-btn { background: none; border: none; color: var(--accent); font-size: 12px; cursor: pointer; padding: 0; font-family: inherit; text-decoration: underline; }
.inline-btn:hover { color: #0058b5; }
.inline-btn.danger { color: var(--negative); }

/* ---------- responsive: phones ---------- */
/* This file shipped with no breakpoints at all, so the auth panel, profile
   card, friend rows and profile grids all inherited their desktop metrics. */
@media (max-width: 720px) {
  .auth-page { padding: 28px 14px 44px; }
  .auth-panel {
    max-width: none;
    padding: 24px 20px;
    border-radius: 0;
  }
  .auth-logo svg { width: 44px; height: 44px; }
  .auth-logo .logo-text { font-size: 19px; letter-spacing: 4px; }
  .auth-tabs { margin: 14px 0 12px; }
  .auth-tab { font-size: 13px; padding: 9px 6px; }

  /* 16px stops iOS Safari from zooming the page when a field takes focus */
  .form-input { font-size: 16px; padding: 12px 13px; }
  .btn-green.block, .btn-dark.block { padding: 12px 14px; font-size: 13px; }

  /* stack the two providers so both keep a comfortable tap target */
  .oauth-row { flex-direction: column; gap: 8px; }
  .oauth-btn { padding: 12px; font-size: 14px; }
  .oauth-btn svg { width: 18px; height: 18px; }
  .auth-divider { margin: 16px 0 12px; }

  .profile-wrap, .fr-wrap { padding: 18px 14px 40px; }
  .profile-card {
    padding: 20px 16px;
    gap: 16px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .profile-avatar svg { width: 84px; height: 84px; }
  .profile-main { min-width: 0; width: 100%; }
  .profile-bio { max-width: none; }

  .fr-row { gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
  .fr-row > * { min-width: 0; }
  .fr-add { max-width: none; }
  .fr-add .form-input { font-size: 16px; }

  .section-block { padding: 16px 14px; }
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }

  .call-actions { flex-wrap: wrap; }
  .call-actions .btn-green,
  .call-actions .btn-dark { flex: 1 1 40%; }
}

@media (max-width: 420px) {
  .profile-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .auth-panel { padding: 20px 16px; }
}

/* call: speaker / output routing toggle */
.call-btn.speaker { background: var(--card-3); color: var(--text); width: 44px; height: 44px; font-size: 17px; }
.call-btn.speaker.on { background: var(--accent); color: #fff; }
.call-btn.mute.on { background: var(--negative); color: #fff; }
