/* Profile panel — slides in from the right over the trending feed. */
.profile-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  background: #07070d;
  transform: translateX(100%);
  transition: transform 340ms cubic-bezier(.2,.8,.3,1);
  pointer-events: none;
  visibility: hidden;
}
.profile-panel.open {
  transform: translateX(0);
  pointer-events: auto;
  visibility: visible;
}

.pf-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: calc(env(safe-area-inset-top) + 56px) 20px calc(env(safe-area-inset-bottom) + 88px);
}

.pf-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 20px;
}

.pf-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  background: radial-gradient(circle at 28% 30%, #6ce7ff 0%, #6378ff 45%, #ff45c8 100%);
  box-shadow:
    0 4px 20px rgba(99, 120, 255, 0.45),
    0 0 32px rgba(255, 69, 200, 0.25);
  margin-bottom: 14px;
}

.pf-nickname {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.pf-nick-edit {
  margin-top: 10px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms cubic-bezier(.2,.8,.3,1), background 120ms ease, border-color 120ms ease;
}
.pf-nick-edit:active { transform: scale(0.97); background: rgba(108,231,255,0.12); border-color: rgba(108,231,255,0.35); }

.pf-nick-form {
  width: min(360px, 100%);
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.pf-nick-input {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  outline: none;
}
.pf-nick-input:focus { border-color: rgba(108,231,255,0.55); box-shadow: 0 0 0 3px rgba(108,231,255,0.12); }
.pf-nick-input:disabled { opacity: 0.6; }

.pf-nick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pf-nick-save,
.pf-nick-cancel {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms cubic-bezier(.2,.8,.3,1), opacity 120ms ease, background 120ms ease;
}
.pf-nick-save { color: #071018; background: rgba(108,231,255,0.9); }
.pf-nick-cancel { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.10); }
.pf-nick-save:active,
.pf-nick-cancel:active { transform: scale(0.98); }
.pf-nick-save:disabled,
.pf-nick-cancel:disabled { opacity: 0.55; cursor: default; }

.pf-nick-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255,255,255,0.42);
}

.pf-level {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.pf-level b {
  color: #6ce7ff;
  font-variant-numeric: tabular-nums;
}

.pf-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.pf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.pf-stat-val {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.pf-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}

.pf-section-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.pf-id-card {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.pf-id-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.pf-id-value {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: rgba(255,255,255,0.72);
}
.pf-copy-btn {
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 100ms cubic-bezier(.2,.8,.3,1),
    background 120ms ease,
    border-color 120ms ease,
    opacity 100ms ease;
}
.pf-copy-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.pf-copy-btn:not(:disabled):active,
.pf-copy-btn.bb-pressed {
  transform: scale(0.94);
  background: rgba(108,231,255,0.18);
  border-color: rgba(108,231,255,0.45);
}
.pf-copy-btn.copied {
  background: rgba(108,231,255,0.22);
  border-color: rgba(108,231,255,0.5);
  color: #6ce7ff;
}
.pf-id-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  line-height: 1.4;
}

.pf-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.pf-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}
.pf-link:active {
  background: rgba(108,231,255,0.1);
  border-color: rgba(108,231,255,0.35);
  color: #fff;
}
.pf-link-icon {
  font-size: 18px;
  line-height: 1;
}

/* Remove Ads / IAP section. Hidden when no native IAP bridge is available. */
.pf-iap-section {
  margin-bottom: 20px;
}
.pf-iap-card {
  padding: 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pf-iap-hero {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pf-iap-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}
.pf-iap-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}
.pf-iap-buy {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #6378ff 0%, #ff45c8 100%);
  box-shadow: 0 4px 16px rgba(99, 120, 255, 0.35);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 100ms cubic-bezier(.2,.8,.3,1), opacity 120ms ease;
}
.pf-iap-buy:not(:disabled):active { transform: scale(0.97); }
.pf-iap-buy:disabled { opacity: 0.5; cursor: default; }
.pf-iap-restore {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: rgba(108,231,255,0.85);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 0;
}
.pf-iap-restore:disabled { opacity: 0.5; cursor: default; }
.pf-iap-restore:not(:disabled):active { color: #6ce7ff; }

body.profile-open #feed {
  pointer-events: none;
}
