/* Premium purchase modal.
   One surface for every route into buying: the top-bar button, the upgrade CTA,
   and any locked Premium control the operator clicks. */
.rh-prem-overlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 7, 14, .78);
  backdrop-filter: blur(4px);
}
.rh-prem-overlay.is-open { display: flex; }

.rh-prem-dialog {
  position: relative;
  width: min(880px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid rgba(240, 185, 74, .34);
  border-radius: 18px;
  background: linear-gradient(180deg, #0d1e33, #070f1b);
  box-shadow: 0 40px 110px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #dbeaf6;
}

.rh-prem-head {
  position: relative;
  padding: 26px 28px 20px;
  border-bottom: 1px solid rgba(124, 176, 232, .16);
  background:
    radial-gradient(circle at 88% 0%, rgba(245, 184, 74, .17), transparent 46%),
    linear-gradient(180deg, rgba(24, 43, 68, .8), transparent);
}
.rh-prem-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border: 1px solid rgba(240, 185, 74, .4);
  border-radius: 999px;
  color: #f0c069;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.rh-prem-head h2 {
  margin: 12px 0 6px;
  color: #f6fbff;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.rh-prem-head p { margin: 0; max-width: 62ch; color: #9fb8cc; font-size: 13.5px; line-height: 1.6; }

.rh-prem-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(124, 176, 232, .24);
  border-radius: 9px;
  background: rgba(4, 13, 24, .6);
  color: #a9c1d3;
  font-size: 17px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.rh-prem-close:hover { border-color: rgba(248, 113, 113, .55); background: rgba(60, 12, 12, .5); color: #fca5a5; }

/* The "you clicked something locked" line */
.rh-prem-reason {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 28px 0;
  padding: 12px 14px;
  border: 1px solid rgba(240, 185, 74, .32);
  border-left: 3px solid rgba(240, 185, 74, .75);
  border-radius: 0 10px 10px 0;
  background: rgba(240, 185, 74, .09);
  color: #f2ddb6;
  font-size: 13px;
  line-height: 1.55;
}
.rh-prem-reason i { color: #f0c069; font-size: 15px; }
.rh-prem-reason strong { color: #ffe3a3; }

.rh-prem-body { padding: 20px 28px 24px; }

.rh-prem-perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 9px;
  margin-bottom: 22px;
}
.rh-prem-perks article {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 78px;
  padding: 11px 12px;
  border: 1px solid rgba(124, 176, 232, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .022);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.rh-prem-perks article:hover { border-color: rgba(240, 185, 74, .42); background: rgba(240, 185, 74, .055); transform: translateY(-1px); }
.rh-prem-perks article > i { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 27px; border: 1px solid rgba(240, 185, 74, .28); border-radius: 8px; background: rgba(240, 185, 74, .08); color: #f0c069; font-size: 13px; }
.rh-prem-perks article > span { min-width: 0; }
.rh-prem-perks strong,
.rh-prem-perks small { display: block; }
.rh-prem-perks strong { color: #e9f5fd; font-size: 12px; font-weight: 800; line-height: 1.3; }
.rh-prem-perks small { margin-top: 3px; color: #8fa8bd; font-size: 10.5px; line-height: 1.45; }

.rh-prem-section-label {
  display: block;
  margin: 0 0 11px;
  color: #93a9bd;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.rh-prem-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
}
.rh-prem-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 16px 15px 15px;
  border: 1px solid rgba(124, 176, 232, .2);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  text-decoration: none;
  color: inherit;
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.rh-prem-plan:hover {
  border-color: rgba(240, 185, 74, .55);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .34);
  text-decoration: none;
}
.rh-prem-plan.is-best {
  border-color: rgba(240, 185, 74, .55);
  background: linear-gradient(180deg, rgba(245, 184, 74, .13), rgba(255, 255, 255, .015));
}
.rh-prem-badge {
  position: absolute;
  top: -9px;
  left: 13px;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd37b, #f5b84f);
  color: #10141c;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.rh-prem-plan-name { color: #a9c1d3; font-size: 12px; font-weight: 750; }
.rh-prem-plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  color: #f8fcff;
  font-size: 24px;
  font-weight: 880;
  letter-spacing: -.03em;
}
.rh-prem-plan-price small { color: #8fa8bd; font-size: 12px; font-weight: 700; letter-spacing: 0; }
.rh-prem-plan-note { margin-top: 2px; color: #6ee7b7; font-size: 11px; font-weight: 750; }
.rh-prem-plan-cta {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(240, 185, 74, .14);
  border: 1px solid rgba(240, 185, 74, .34);
  color: #ffd991;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}
.rh-prem-plan.is-best .rh-prem-plan-cta {
  background: linear-gradient(135deg, #ffd37b, #f5b84f);
  border-color: rgba(255, 211, 123, .7);
  color: #10141c;
}

.rh-prem-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(124, 176, 232, .16);
  color: #7f96aa;
  font-size: 11.5px;
}
.rh-prem-foot a { color: #8fd8ec; }
.rh-prem-pay {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid rgba(124, 176, 232, .24);
  border-radius: 999px;
  color: #b9cddd;
  font-size: 11px;
  font-weight: 700;
}

/* Top-bar buy button, next to the server switcher */
.rh-prem-topbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(240, 185, 74, .5);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 211, 123, .95), rgba(245, 184, 74, .92));
  color: #10141c;
  font-size: 12.5px;
  font-weight: 880;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(245, 158, 11, .2);
  transition: filter .15s ease, transform .15s ease;
}
.rh-prem-topbtn:hover { filter: brightness(1.06); transform: translateY(-1px); text-decoration: none; color: #10141c; }
.rh-prem-topbtn i { font-size: 14px; }
/* Already Premium: quieter, it only extends */
.rh-prem-topbtn.is-active {
  background: rgba(6, 30, 26, .6);
  border-color: rgba(52, 211, 153, .45);
  color: #a7f3d0;
  box-shadow: none;
}
.rh-prem-topbtn.is-active:hover { color: #d1fae5; }
/* Lifetime: a status badge, not a control — there is nothing left to buy. */
.rh-prem-topbtn.is-owned {
  background: rgba(6, 30, 26, .55);
  border-color: rgba(52, 211, 153, .4);
  color: #a7f3d0;
  box-shadow: none;
  cursor: default;
}
.rh-prem-topbtn.is-owned:hover { filter: none; transform: none; }

/* Locked controls become visibly clickable rather than just dead */
.settings-form .locked-field { cursor: pointer; }
.settings-form .locked-field:hover { border-color: rgba(240, 185, 74, .45); }

@media (max-width: 760px) {
  .rh-prem-dialog { width: 100%; }
  .rh-prem-head { padding: 22px 18px 16px; }
  .rh-prem-head h2 { font-size: 21px; }
  .rh-prem-body { padding: 16px 18px 20px; }
  .rh-prem-reason { margin: 14px 18px 0; }
  .rh-prem-plans { grid-template-columns: 1fr 1fr; }
  /* Icon-only on phones, but still a real touch target rather than a 24px sliver. */
  .rh-prem-topbtn {
    min-width: 42px;
    min-height: 40px;
    padding: 0 10px;
    justify-content: center;
    font-size: 11.5px;
  }
  .rh-prem-topbtn .rh-prem-topbtn-text { display: none; }
  .rh-prem-topbtn i { font-size: 16px; }
}
