:root {
  --bg0: #080f1f;
  --bg1: #121a33;
  --card: rgba(11, 18, 36, 0.96);
  --border: rgba(140, 171, 240, 0.28);
  --text: #ecf0ff;
  --muted: #a8b2d6;
  --accent: #85f0b3;
  --accent2: #527dd6;
  --danger: #ff8f8f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background-image:
    radial-gradient(130% 115% at 50% -14%, rgb(82, 125, 214) 0%, rgb(36, 63, 121) 36%, rgb(15, 29, 59) 68%, rgb(8, 15, 31) 100%),
    linear-gradient(120deg, rgb(33, 59, 110) 0%, rgb(19, 36, 74) 40%, rgb(13, 25, 52) 72%, rgb(20, 34, 66) 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* --- Portal nav bar --- */
.portal-nav {
  position: sticky;
  top: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  height: 48px;
  background: linear-gradient(90deg, #0b1226 0%, #142244 100%);
  border-bottom: 1px solid rgba(140, 171, 240, 0.18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: #ecf0ff;
  box-shadow: 0 2px 12px rgba(2, 7, 20, 0.5);
}
.portal-nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ecf0ff;
  flex-shrink: 0;
}
.portal-nav__logo { height: 28px; width: auto; }
.portal-nav__sep {
  width: 1px;
  height: 24px;
  background: rgba(140, 171, 240, 0.22);
  flex-shrink: 0;
}
.portal-nav__links { display: flex; align-items: center; gap: 4px; }
.portal-nav__link {
  padding: 6px 14px;
  border-radius: 6px;
  text-decoration: none;
  color: #a8b2d6;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s;
}
.portal-nav__link:hover {
  background: rgba(82, 125, 214, 0.18);
  color: #ecf0ff;
}
.portal-nav__link--active {
  background: rgba(82, 125, 214, 0.25);
  color: #ecf0ff;
}
.portal-nav__spacer { flex: 1; }
.portal-nav__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #a8b2d6;
  flex-shrink: 0;
  position: relative;
}
.portal-nav__user-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.portal-nav__tier {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(140, 171, 240, 0.12);
  color: #8fa3c6;
  flex-shrink: 0;
}
.portal-nav__tier--paid {
  background: rgba(52, 211, 153, 0.15);
  color: #6fd492;
}
.portal-nav__gear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #a8b2d6;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.portal-nav__gear:hover,
.portal-nav__gear[aria-expanded="true"] {
  background: rgba(82, 125, 214, 0.18);
  color: #ecf0ff;
}
.portal-nav__menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #152238;
  border: 1px solid rgba(140, 171, 240, 0.22);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(2, 7, 20, 0.55);
  padding: 6px 0;
  z-index: 100000;
}
.portal-nav__menu--open {
  display: block;
}
.portal-nav__menu-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  border: none;
  background: none;
  color: #c8d0e8;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
  line-height: 1.4;
}
.portal-nav__menu-item:hover {
  background: rgba(82, 125, 214, 0.15);
  color: #ecf0ff;
}
.portal-nav__menu-sep {
  height: 1px;
  background: rgba(140, 171, 240, 0.12);
  margin: 4px 0;
}
.portal-nav__action {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid rgba(140, 171, 240, 0.22);
  background: transparent;
  color: #a8b2d6;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.portal-nav__action:hover {
  background: rgba(82, 125, 214, 0.18);
  color: #ecf0ff;
}
@media (max-width: 600px) {
  .portal-nav { padding: 0 12px; gap: 8px; }
  .portal-nav__link { padding: 6px 10px; font-size: 12px; }
  .portal-nav__user-label { max-width: 120px; }
}

.shell { max-width: 1320px; margin: 0 auto; padding: 24px; }

.main { display: flex; flex-direction: column; gap: 24px; }

.landing-section { max-width: 1200px; margin: 8px auto 0; width: 100%; }

.landing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 42px 48px;
  box-shadow: 0 14px 34px rgba(2, 7, 20, 0.48);
  text-align: center;
}

.landing-title {
  margin: 0 0 24px;
  font-size: 2.35rem;
  letter-spacing: 0.01em;
}

.landing-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: var(--text);
}

.landing-point {
  width: min(980px, 100%);
  border: 1px solid rgba(140, 171, 240, 0.2);
  border-radius: 14px;
  background: rgba(11, 20, 39, 0.7);
  padding: 18px 20px;
}

.landing-point__title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
  color: #f4f7ff;
}

.landing-point__text {
  margin: 8px 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.landing-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.auth-section { max-width: 520px; margin: 0 auto; width: 100%; }

.auth-card--wide { max-width: 100%; }

.plan-fieldset { border: none; margin: 0 0 14px; padding: 0; }
.plan-fieldset .label { margin-top: 0; }

.plan-tier, .paid-options .plan-fieldset, .league-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-radio, .plan-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text);
  cursor: pointer;
}

.league-picks {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 30, 0.5);
}

.league-picks[hidden],
#billing-interval[hidden],
#btn-logout[hidden],
#header-user[hidden],
.plan-radio[hidden],
.plan-check[hidden],
#label-paid-all-annual-wrap[hidden] {
  display: none !important;
}

.plan-fieldset--nested {
  margin: 4px 0 8px 24px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 30, 0.5);
}

.plan-quote {
  min-height: 1.2em;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(133, 240, 179, 0.35);
  background: rgba(133, 240, 179, 0.08);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.plan-quote:empty {
  display: none;
}

.subscription-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.subscription-banner--pending { border-color: #ffd480; }
.subscription-banner--active { border-color: rgba(133, 240, 179, 0.45); }
.subscription-banner__sync { margin-top: 10px; }

.auth-card, .app-card, .admin-detail {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 12px 28px rgba(2, 7, 20, 0.45);
}

.auth-card h2, .dashboard h2, .admin h2 { margin: 0 0 8px; font-size: 1.2rem; }

.muted { color: var(--muted); font-size: 0.95rem; margin: 0 0 14px; }

.label { display: block; font-size: 0.82rem; color: var(--muted); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 14, 30, 0.9);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 10px;
}

.row { display: flex; gap: 8px; margin-top: 8px; }

.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #1f2f5a;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { background: #2a3f77; }
.btn--primary { background: linear-gradient(135deg, #3d6b4a, #2a5a3d); border-color: rgba(133, 240, 179, 0.4); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.link { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; text-decoration: underline; }
.switch { margin-top: 16px; color: var(--muted); font-size: 0.92rem; }

.status { min-height: 1.2em; color: var(--accent); font-size: 0.92rem; margin-top: 12px; }
.status--error { color: var(--danger); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.app-card--locked { opacity: 0.55; }
.app-card h3 { margin: 0 0 6px; }
.app-card {
  display: flex;
  flex-direction: column;
}
.app-card p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.25;
  min-height: 2.5em;
}

.app-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.feature-list { list-style: none; padding: 0; margin: 0 0 14px; font-size: 0.85rem; }
.feature-list li { color: var(--muted); margin: 4px 0; }
.feature-list li.ok { color: var(--accent); }
.feature-list li.muted-item { opacity: 0.8; font-style: italic; }
.feature-list--inactive li { color: #95a1c5; }

.feature-group {
  margin-bottom: 10px;
}

.feature-group--active {
  min-height: 106px;
}

.feature-group__title {
  margin: 0 0 4px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c8d0e8;
}

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  margin-top: 12px;
}

.admin-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px;
  max-height: 480px;
  overflow: auto;
}

.admin-list ul { list-style: none; margin: 0; padding: 0; }
.admin-list li button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}
.admin-list li button:hover, .admin-list li button.active {
  background: rgba(82, 125, 214, 0.2);
}

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.perm-grid label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.perm-grid input { margin-top: 3px; }

@media (max-width: 720px) {
  .shell { padding: 16px; }
  .landing-card { padding: 24px 18px; }
  .landing-title { font-size: 1.7rem; margin-bottom: 18px; }
  .landing-point { padding: 14px 14px; }
  .landing-point__title { font-size: 1.45rem; }
  .landing-point__text { font-size: 0.95rem; }
  .landing-actions { flex-direction: column; }
  .admin-layout { grid-template-columns: 1fr; }
}
