/* HentaiAPK User Profile — dark theme (#1d222d / #1bbc9b) */
.hapk-profile-box {
  background: #1d222d;
  border: 1px solid rgba(27, 188, 155, 0.2);
  border-radius: 14px;
  padding: 1.25rem;
  color: #d5d9e0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Guest auth prompt */
.hapk-profile-auth {
  max-width: 420px;
  margin: 0 auto;
}

.hapk-profile-auth-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.hapk-profile-auth-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #1bbc9b;
  box-shadow: 0 0 0 4px rgba(27, 188, 155, 0.15);
  display: block;
}

.hapk-profile-auth h1 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  color: #fff;
  font-weight: 700;
}

.hapk-profile-auth-sub {
  color: #9aa3b2;
  margin: 0 0 1.35rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.hapk-profile-auth-btns {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 280px;
  margin: 0 auto;
  background: transparent !important;
  padding: 0;
  border: none;
  box-shadow: none !important;
}

.hapk-profile-box .hapk-profile-auth-btns button.hapk-profile-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.92rem;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.hapk-profile-box .hapk-profile-auth-btns button.hapk-profile-btn-primary {
  background: #1bbc9b !important;
  border-color: #1bbc9b !important;
}

.hapk-profile-box .hapk-profile-auth-btns button.hapk-profile-btn-primary:hover {
  background: #17a589 !important;
  border-color: #17a589 !important;
}

.hapk-profile-box .hapk-profile-auth-btns button.hapk-profile-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(27, 188, 155, 0.4) !important;
}

/* Shared buttons */
.hapk-profile-btn,
.hapk-profile-auth-btns button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #fff !important;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  line-height: 1.3;
}

.hapk-profile-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(27, 188, 155, 0.4);
  color: #fff;
}

.hapk-profile-btn-primary {
  background: #1bbc9b;
  border-color: #1bbc9b;
}

.hapk-profile-btn-primary:hover {
  background: #17a589;
  border-color: #17a589;
  color: #fff !important;
}

.hapk-profile-auth-btns .hapk-profile-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.92rem;
}

/* Dashboard — fill the profile box (no sidebar gutter) */
.hapk-profile-dash {
  max-width: none;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

/* Hero card */
.hapk-profile-hero-card {
  position: relative;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  overflow: hidden;
  background: #252b38;
  border: 1px solid rgba(27, 188, 155, 0.18);
}

.hapk-profile-banner {
  height: 100px;
  background: linear-gradient(135deg, #1a3d35 0%, #1d222d 40%, #1bbc9b 180%);
  opacity: 0.9;
}

.hapk-profile-hero-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  padding: 0 1.25rem 1.25rem;
  margin-top: -48px;
}

.hapk-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.hapk-profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #252b38;
  box-shadow: 0 0 0 3px #1bbc9b, 0 8px 24px rgba(0, 0, 0, 0.4);
  background: #1d222d;
}

.hapk-profile-google-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #252b38;
  line-height: 1;
}

.hapk-profile-waifu-showcase {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  background: rgba(27, 188, 155, 0.08);
  border: 1px solid rgba(27, 188, 155, 0.25);
  border-radius: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.hapk-profile-waifu-img {
  width: 56px;
  height: 72px;
  object-fit: contain;
  border-radius: 6px;
  background: #1d222d;
}

.hapk-profile-waifu-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.hapk-profile-waifu-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1bbc9b;
}

.hapk-profile-waifu-info strong {
  color: #fff;
  font-size: 0.9rem;
}

.hapk-profile-waifu-badge {
  font-size: 0.72rem;
  color: #ffd700;
}

.hapk-profile-hero-info {
  flex: 1;
  min-width: 160px;
  padding-top: 52px;
}

.hapk-profile-hero-info h2 {
  margin: 0 0 0.15rem;
  font-size: 1.4rem;
  color: #fff;
  font-weight: 700;
}

.hapk-profile-handle {
  margin: 0 0 0.2rem;
  font-size: 0.88rem;
  color: #1bbc9b;
  font-weight: 600;
}

.hapk-profile-meta {
  font-size: 0.82rem;
  color: #9aa3b2;
  margin: 0;
}

.hapk-profile-meta a {
  color: #1bbc9b;
  text-decoration: none;
}

.hapk-profile-meta a:hover {
  text-decoration: underline;
}

.hapk-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
  padding-top: 52px;
}

/* Stat row */
.hapk-profile-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hapk-profile-stat-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1.1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.hapk-profile-stat-card:last-child {
  border-right: none;
}

.hapk-profile-stat-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.hapk-profile-stat-card strong {
  display: block;
  font-size: 1.25rem;
  color: #fff;
  line-height: 1.2;
}

.hapk-profile-stat-card span {
  font-size: 0.72rem;
  color: #9aa3b2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hapk-profile-stat-streak strong {
  color: #1bbc9b;
}

/* Tabs */
.hapk-profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hapk-profile-tab {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #9aa3b2;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.hapk-profile-tab:hover {
  color: #fff;
}

.hapk-profile-tab.is-active {
  background: #1bbc9b;
  color: #fff;
}

.hapk-profile-panel {
  display: none;
}

.hapk-profile-panel.is-active {
  display: block;
}

.hapk-profile-panel h3 {
  margin: 0 0 0.85rem;
  color: #1bbc9b;
  font-size: 1rem;
  font-weight: 700;
}

.hapk-profile-panel[data-panel="harem"] {
  padding-top: 0.25rem;
}

/* Overview */
.hapk-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.hapk-overview-stat {
  padding: 1rem;
  border-radius: 10px;
  background: #252b38;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  transition: border-color 0.15s;
}

.hapk-overview-stat:hover {
  border-color: rgba(27, 188, 155, 0.3);
}

.hapk-overview-stat strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.2rem;
  color: #fff;
}

.hapk-overview-stat span {
  font-size: 0.78rem;
  color: #9aa3b2;
}

/* Rewards embed */
.hapk-rewards-embed-wrap .hapk-rewards-shell {
  padding: 0;
  width: 100%;
}

.hapk-rewards-embed-wrap .hapk-rewards-header-top h1 {
  font-size: 1.1rem;
  color: #fff !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}

.hapk-rewards-embed-wrap .hapk-rewards-home {
  display: none;
}

/* Wallpapers */
.hapk-wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.hapk-wallpaper-card {
  border-radius: 10px;
  overflow: hidden;
  background: #252b38;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s, transform 0.15s;
}

.hapk-wallpaper-card:hover {
  border-color: rgba(27, 188, 155, 0.35);
  transform: translateY(-2px);
}

.hapk-wallpaper-thumb {
  height: 100px;
  background-size: cover;
  background-position: center;
}

.hapk-wallpaper-card-body {
  padding: 0.65rem;
}

.hapk-wallpaper-card-body p {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: #d5d9e0;
}

.hapk-wallpaper-card-body a {
  font-size: 0.8rem;
  color: #1bbc9b;
  text-decoration: none;
  font-weight: 600;
}

.hapk-wallpaper-card-body a:hover {
  text-decoration: underline;
}

/* VN progress */
.hapk-vn-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

.hapk-vn-stat {
  padding: 0.85rem;
  border-radius: 10px;
  background: #252b38;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.hapk-vn-stat strong {
  display: block;
  font-size: 1.2rem;
  color: #fff;
}

.hapk-vn-stat span {
  font-size: 0.76rem;
  color: #9aa3b2;
}

.hapk-vn-latest {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #9aa3b2;
}

/* Settings */
.hapk-settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 400px;
}

.hapk-settings-form label {
  font-size: 0.84rem;
  color: #b8c0cc;
  font-weight: 600;
}

.hapk-settings-form input[type="text"] {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #151a24;
  color: #fff;
  font-size: 0.95rem;
  margin-top: 0.3rem;
}

.hapk-settings-form input:focus {
  outline: none;
  border-color: #1bbc9b;
}

.hapk-settings-readonly {
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.9rem;
  color: #9aa3b2;
  margin-top: 0.3rem;
}

.hapk-settings-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 400 !important;
  color: #9aa3b2 !important;
}

.hapk-settings-save {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 8px;
  background: #1bbc9b;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
  transition: background 0.15s;
}

.hapk-settings-save:hover {
  background: #17a589;
}

.hapk-profile-empty {
  color: #9aa3b2;
  font-size: 0.9rem;
  padding: 1rem 0;
}

/* Toast */
.hapk-profile-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  padding: 0.75rem 1.25rem;
  border-radius: 10px;
  background: #252b38;
  border: 1px solid rgba(27, 188, 155, 0.4);
  color: #fff;
  font-size: 0.9rem;
  z-index: 99999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  transition: opacity 0.25s, transform 0.25s;
}

.hapk-profile-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Earn coins */
.hapk-earn-rules {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.hapk-earn-rule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #252b38;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hapk-earn-rule-info strong {
  display: block;
  margin-bottom: 0.15rem;
  color: #fff;
}

.hapk-earn-rule-info span {
  font-size: 0.82rem;
  color: #9aa3b2;
}

.hapk-earn-rule-progress {
  text-align: right;
  font-size: 0.85rem;
  white-space: nowrap;
  color: #9aa3b2;
}

.hapk-earn-rule-progress em {
  display: block;
  font-style: normal;
  color: #1bbc9b;
  font-weight: 700;
}

.hapk-earn-history {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.hapk-earn-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.hapk-earn-history-item time {
  font-size: 0.75rem;
  color: #6b7280;
  display: block;
}

.hapk-earn-history-coins {
  color: #1bbc9b;
  font-weight: 700;
}

@media (max-width: 640px) {
  .hapk-profile-hero-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: -40px;
  }

  .hapk-profile-hero-info,
  .hapk-profile-actions {
    padding-top: 0;
  }

  .hapk-profile-actions {
    margin-left: 0;
    justify-content: center;
    width: 100%;
  }

  .hapk-profile-stat-row {
    grid-template-columns: 1fr;
  }

  .hapk-profile-stat-card {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .hapk-profile-stat-card:last-child {
    border-bottom: none;
  }

  .hapk-profile-tabs {
    border-radius: 12px;
    justify-content: center;
  }

  .hapk-profile-waifu-showcase {
    margin-left: 0;
    width: 100%;
    margin-top: 0.5rem;
  }
}
.hapk-profile-avatar-edit { position: relative; display: block; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; line-height: 0; }
.hapk-profile-avatar-edit > span { position: absolute; bottom: 5px; left: 14px; right: 14px; padding: 6px 0; border-radius: 20px; background: #18212be8; color: #e5fff7; font-size: 10px; line-height: 1; }
.hapk-profile-avatar-edit:focus-visible { outline: 3px solid #b9f3e0; outline-offset: 7px; }
.hapk-profile-avatar.is-character-sprite, .hapk-header-avatar.is-character-sprite, .hapk-avatar-choice .is-character-sprite { object-position: 50% 0; }
.hapk-profile-level { width: 275px; max-width: 100%; margin-top: 12px; }
.hapk-profile-level > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.hapk-profile-level strong { display: inline-block; border-radius: 6px; color: #b0edda; background: #2d4b46; padding: 3px 8px; font-size: .78rem; white-space: nowrap; }
.hapk-profile-level [data-profile-xp] { color: #aebcce; font-size: .72rem; }
.hapk-profile-xp-bar { height: 5px; border-radius: 6px; overflow: hidden; background: #414855; }
.hapk-profile-xp-bar > span { display: block; height: 100%; background: #69c4aa; border-radius: inherit; }
.hapk-avatar-settings, .hapk-level-guide { padding: 18px; background: #20242e; border: 1px solid #39414e; border-radius: 14px; margin: 18px 0; }
.hapk-avatar-settings h4, .hapk-level-guide h4 { margin: 0 0 8px; color: #fff; }
.hapk-level-guide p { color: #b4c1d1; font-size: .86rem; line-height: 1.7; margin: 6px 0; }
.hapk-avatar-choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.hapk-avatar-choice { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100px; padding: 12px 6px; border: 1px solid #414754; border-radius: 12px; background: #292e39; color: #dce3ed; font-size: 12px; cursor: pointer; }
.hapk-avatar-choice[aria-pressed="true"] { border-color: #69c4aa; background: #29443f; box-shadow: inset 0 0 0 1px #69c4aa; }
.hapk-avatar-choice img, .hapk-avatar-restore { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: #20242e; }
.hapk-avatar-restore { display: grid; place-items: center; font-size: 30px; color: #a3dcca; }
.hapk-avatar-choice:focus-visible { outline: 2px solid #b9f3e0; outline-offset: 3px; }
.hapk-avatar-choice:disabled { opacity: .6; cursor: wait; }
.hapk-midnight-banner { display:flex; gap:18px; align-items:center; padding:22px; margin:18px 0 24px; max-width:100%; box-sizing:border-box; background:linear-gradient(110deg,#34273e,#222232); border:1px solid #b38caa55; border-radius:16px; color:#edd6e5!important; text-decoration:none!important; }
.hapk-midnight-banner > div { min-width:0; flex:1 1 auto; }
.hapk-midnight-banner-moon { flex:0 0 auto; color:#ddbf87; font:48px Georgia,serif; }
.hapk-midnight-banner small { color:#bf97b9; font-size:9px; letter-spacing:1.5px; }
.hapk-midnight-banner strong { display:block; font:27px Georgia,serif; margin:5px 0; }
.hapk-midnight-banner p { color:#b9a6c1; margin:0; font-size:12px; line-height:1.6; }
.hapk-midnight-banner-arrow { flex:0 0 auto; margin-left:auto; font-size:13px; white-space:nowrap; }
.hapk-midnight-badge { display:inline-block; margin-top:9px; padding:4px 9px; background:#463344; border:1px solid #cfac7a66; color:#e4c58c; border-radius:8px; font-size:11px; }
@media(max-width:620px) { .hapk-midnight-banner { padding:16px; gap:12px; flex-wrap:wrap; }.hapk-midnight-banner strong { font-size:24px; }.hapk-midnight-banner-moon { font-size:37px; }.hapk-midnight-banner-arrow { margin-left:49px; } }
