/* Forms, avatars, the home bar and the personal area. */

/* ---------------------------------------------------------------- forms */
.seg {
  display: flex;
  gap: var(--s1);
  padding: var(--s1);
  border-radius: 999px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid var(--line);
  margin: 0 auto var(--s5);
  width: fit-content;
  max-width: 100%;
}
.seg-btn {
  border: 0;
  border-radius: 999px;
  padding: var(--s2) var(--s5);
  min-height: var(--tap);
  background: transparent;
  color: #b9c9e6;
  font-family: var(--f);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.seg-btn.on { background: linear-gradient(180deg, #8ef7ff, #00c8e8); color: #04101f; }
.seg-btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }

.form { display: flex; flex-direction: column; gap: var(--s4); text-align: start; }
.field { display: flex; flex-direction: column; gap: var(--s1); }
.field-label { font-weight: 800; font-size: 14px; opacity: .9; }
.field-hint { font-size: 12px; opacity: .62; font-weight: 600; line-height: 1.5; }

.input {
  /* 16px minimum: anything smaller makes iOS Safari zoom the whole page on focus. */
  font-family: var(--f);
  font-size: 16px;
  font-weight: 700;
  color: #eaf2ff;
  background: rgba(0, 0, 0, .38);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: var(--s3) var(--s4);
  min-height: var(--tap);
  width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: rgba(234, 242, 255, .35); font-weight: 600; }
.input:focus { outline: none; border-color: rgba(0, 229, 255, .7); box-shadow: 0 0 0 3px rgba(0, 229, 255, .18); }
.input.pin { font-family: var(--fd); letter-spacing: .5em; text-align: center; direction: ltr; font-size: 22px; }
.input[aria-invalid='true'] { border-color: rgba(255, 77, 94, .8); }

/* -------------------------------------------------------------- avatars */
.avatar {
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 auto;
  background: #0b1430;
  border: 2px solid rgba(255, 255, 255, .22);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  display: grid;
  place-items: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-initials {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-weight: 900;
  color: #04101f;
  font-family: var(--f);
}
.avatar.frame-helmet { border-color: var(--neon); box-shadow: 0 0 0 3px rgba(0, 229, 255, .3), 0 6px 18px rgba(0, 0, 0, .5); }
.avatar.frame-crown { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 198, 61, .35), 0 6px 18px rgba(0, 0, 0, .5); }
.avatar.frame-flames { border-color: var(--hot); box-shadow: 0 0 0 3px rgba(255, 45, 120, .35), 0 6px 18px rgba(0, 0, 0, .5); }
.avatar.frame-crown::after,
.avatar.frame-helmet::after,
.avatar.frame-flames::after {
  position: absolute;
  top: -2px; inset-inline-end: -2px;
  font-size: .42em;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8));
}
.avatar.frame-crown::after { content: '👑'; }
.avatar.frame-helmet::after { content: '⛑️'; }
.avatar.frame-flames::after { content: '🔥'; }

/* ------------------------------------------------------------- home bar */
.home-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.who {
  display: flex; align-items: center; gap: var(--s2);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: var(--s1) var(--s4) var(--s1) var(--s1);
  min-height: var(--tap);
  cursor: pointer;
  color: inherit;
  font-family: var(--f);
  transition: background .2s;
}
.who .who-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.who b { font-size: 14px; font-weight: 900; }
.who small { font-size: 12px; opacity: .7; font-weight: 700; }
.who-coins {
  font-family: var(--fd); font-weight: 900; font-size: 15px; color: var(--gold);
  background: rgba(255, 198, 61, .14); border: 1px solid rgba(255, 198, 61, .4);
  border-radius: 999px; padding: var(--s2) var(--s4); min-height: var(--tap);
  display: flex; align-items: center; gap: var(--s1);
}

/* --------------------------------------------------------- personal area */
.pf-head { display: flex; align-items: center; gap: var(--s4); text-align: start; margin-bottom: var(--s5); }
.pf-avatar-btn { position: relative; background: none; border: 0; padding: 0; cursor: pointer; flex: 0 0 auto; }
.pf-avatar-edit {
  position: absolute; bottom: -2px; inset-inline-end: -2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--neon); color: #04101f;
  display: grid; place-items: center; font-size: 14px;
  border: 2px solid #0b1430;
}
.pf-id { flex: 1; min-width: 0; }
.pf-name { margin: 0; font-size: clamp(20px, 4vmin, 28px); font-weight: 900; }
.pf-lv { display: flex; align-items: center; gap: var(--s2); margin: var(--s1) 0; flex-wrap: wrap; }
.pf-lv-badge {
  font-size: 12px; font-weight: 800; padding: 2px var(--s2); border-radius: 999px;
  background: rgba(0, 229, 255, .18); border: 1px solid rgba(0, 229, 255, .4);
}
.pf-coins { font-family: var(--fd); font-weight: 900; font-size: 14px; color: var(--gold); }
.pf-xp { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, .45); overflow: hidden; margin-top: var(--s1); }
.pf-xp i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #7c4dff, #00e5ff); transition: width .5s; }
.pf-xp-txt { display: block; font-size: 12px; opacity: .6; font-weight: 700; margin-top: var(--s1); }

.pf-sec {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  margin: var(--s6) 0 var(--s3); text-align: start;
}
.pf-sec h3 { margin: 0; font-size: clamp(15px, 2.6vmin, 19px); font-weight: 900; }
.pf-sec span { font-size: 12px; opacity: .68; font-weight: 700; }

.pf-track { margin-bottom: var(--s4); }
.pf-track-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; opacity: .85; margin-bottom: var(--s2); }
.pf-stars { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: var(--s2); }
.pf-star-cell {
  border-radius: 12px; padding: var(--s2) var(--s1);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.pf-star-cell b { font-family: var(--fd); font-size: 15px; color: #8ef7ff; }
.pf-star-cell i { font-style: normal; font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.pf-star-cell small { font-size: 12px; opacity: .6; font-family: var(--fd); }
.pf-star-cell.done { border-color: rgba(182, 255, 60, .45); background: rgba(182, 255, 60, .1); }
.pf-star-cell.locked { opacity: .4; }

.pf-ops { display: flex; flex-direction: column; gap: var(--s3); }
.pf-op-top { display: flex; justify-content: space-between; gap: var(--s2); font-size: 13px; font-weight: 700; margin-bottom: var(--s1); }
.pf-op-top span { opacity: .68; }
.pf-bar { height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.pf-bar i { display: block; height: 100%; border-radius: 99px; transition: width .6s; }
.pf-bar i.good { background: linear-gradient(90deg, #25e08a, #b6ff3c); }
.pf-bar i.mid { background: linear-gradient(90deg, #ffc63d, #ff9d3d); }
.pf-bar i.weak { background: linear-gradient(90deg, #ff2d78, #ff8b96); }

.pf-cal { display: grid; grid-template-columns: repeat(14, 1fr); gap: var(--s1); }
.pf-cal-day {
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 800; color: rgba(234, 242, 255, .35);
}
.pf-cal-day.on { background: linear-gradient(160deg, #b6ff3c, #25e08a); color: #062012; border-color: transparent; }
.pf-cal-day.today { outline: 2px solid var(--neon); outline-offset: 1px; }

.pf-trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--s3); }
.pf-trophy {
  border-radius: 14px; padding: var(--s3) var(--s2);
  background: rgba(255, 198, 61, .1); border: 1px solid rgba(255, 198, 61, .35);
  display: flex; flex-direction: column; align-items: center; gap: var(--s1); text-align: center;
}
.pf-trophy-ico { font-size: 28px; line-height: 1; }
.pf-trophy b { font-size: 13px; font-weight: 900; }
.pf-trophy small { font-size: 12px; opacity: .65; font-family: var(--fd); }

/* ------------------------------------------------------------- photo (C6) */
.photo-stage { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.photo-frame {
  width: min(260px, 70vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--neon);
  box-shadow: 0 0 0 6px rgba(0, 229, 255, .15), 0 12px 32px rgba(0, 0, 0, .55);
  background: #000;
}
.photo-video { width: 100%; height: 100%; object-fit: cover; display: block; transform: scaleX(-1); }
.btn.shutter { min-width: 160px; }

.frame-row { display: flex; flex-wrap: wrap; gap: var(--s2); justify-content: center; }
.frame-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 72px; min-height: var(--tap);
  padding: var(--s2);
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
  color: #dce9ff;
  font-family: var(--f);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.frame-btn.on { background: rgba(0, 229, 255, .22); border-color: rgba(0, 229, 255, .6); }
.frame-emoji { font-size: 22px; line-height: 1; }
.frame-btn small { font-size: 12px; font-weight: 700; }
