/* PickleHub — Royal Cobalt appearance (2 variants) */

/* ── Royal Cobalt (default) — sport classic blue + championship gold ── */
:root,
[data-theme="royal-cobalt"] {
  --pg: #2563EB;
  --pgl: #EFF6FF;
  --pgd: #1D4ED8;
  --py: #FBBF24;
  --pn: #1E3A8A;
  --pnl: #DBEAFE;
  --ps: #1E293B;
  --psu: #F8FAFC;
  --body-bg: #e2e8f0;
  --success-bg: #DCFCE7;
  --success-fg: #15803D;
  --success-bd: #86EFAC;
  --info-bg: #DBEAFE;
  --info-fg: #1E40AF;
  --info-bd: #93C5FD;
  --overlay: rgba(30, 58, 138, 0.28);
  --shadow-tint: rgba(30, 58, 138, 0.12);
}

/* ── Royal Cobalt · Soft gradient — same tokens, ambient gradients on desktop ── */
[data-theme="royal-cobalt-gradient"] {
  --pg: #2563EB;
  --pgl: #EFF6FF;
  --pgd: #1D4ED8;
  --py: #FBBF24;
  --pn: #1E3A8A;
  --pnl: #DBEAFE;
  --ps: #1E293B;
  --psu: #F8FAFC;
  --body-bg: #c7d7f5;
  --success-bg: #DCFCE7;
  --success-fg: #15803D;
  --success-bd: #86EFAC;
  --info-bg: #DBEAFE;
  --info-fg: #1E40AF;
  --info-bd: #93C5FD;
  --overlay: rgba(30, 58, 138, 0.28);
  --shadow-tint: rgba(30, 58, 138, 0.14);
}

@media (min-width: 1024px) {
  html[data-theme="royal-cobalt-gradient"] body {
    background:
      radial-gradient(ellipse 130% 90% at 50% -15%, rgba(59, 130, 246, 0.55) 0%, transparent 52%),
      radial-gradient(ellipse 80% 70% at 0% 60%, rgba(99, 102, 241, 0.4) 0%, transparent 48%),
      radial-gradient(ellipse 80% 70% at 100% 85%, rgba(37, 99, 235, 0.45) 0%, transparent 50%),
      linear-gradient(160deg, #bfdbfe 0%, #c7d2fe 38%, #dbeafe 68%, #e2e8f0 100%);
  }

  html[data-theme="royal-cobalt-gradient"] .shell {
    background:
      linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(239, 246, 255, 0.94) 45%, rgba(224, 231, 255, 0.92) 100%);
  }

  html[data-theme="royal-cobalt-gradient"] .main {
    background:
      radial-gradient(ellipse 130% 95% at 100% -5%, rgba(96, 165, 250, 0.72) 0%, rgba(147, 197, 253, 0.35) 32%, transparent 62%),
      radial-gradient(ellipse 115% 90% at -5% 105%, rgba(129, 140, 248, 0.65) 0%, rgba(165, 180, 252, 0.3) 38%, transparent 58%),
      radial-gradient(ellipse 55% 45% at 42% 18%, rgba(251, 191, 36, 0.14) 0%, transparent 70%),
      linear-gradient(180deg, #ffffff 0%, #e8f0ff 140px, #dde7ff 320px, #eef2ff 100%);
  }

  html[data-theme="royal-cobalt-gradient"] .topbar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  html[data-theme="royal-cobalt-gradient"] .view {
    background: transparent;
  }
}

/* ── Theme picker UI ── */
.theme-picker-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1335;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.theme-picker-backdrop.open { display: block; }

.theme-picker {
  display: none;
  position: fixed;
  z-index: 1336;
  width: 300px;
  max-height: min(78vh, 640px);
  overflow: hidden;
  flex-direction: column;
  background: white;
  border-radius: var(--pr);
  border: 0.5px solid var(--pb);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  padding: 12px 12px 10px;
  font-family: 'Outfit', sans-serif;
}
.theme-picker.open { display: flex; }

.theme-picker.theme-picker--popover::before {
  content: '';
  position: absolute;
  top: -5px;
  right: var(--theme-picker-caret-right, 14px);
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid rgba(30, 58, 138, 0.08);
  border-top: 1px solid rgba(30, 58, 138, 0.08);
  transform: rotate(45deg);
  box-shadow: -2px -2px 6px rgba(30, 58, 138, 0.06);
}
.theme-picker.theme-picker--popover.theme-picker--above::before {
  top: auto;
  bottom: -5px;
  border-left: none;
  border-top: none;
  border-right: 1px solid rgba(30, 58, 138, 0.08);
  border-bottom: 1px solid rgba(30, 58, 138, 0.08);
  transform: rotate(225deg);
  box-shadow: 2px 2px 6px rgba(30, 58, 138, 0.06);
}

.theme-picker-hd-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.theme-picker-hd-row .theme-picker-sub { margin-bottom: 0; }
.theme-picker-hd-row .modal-close { margin: -2px -6px 0 0; }
.theme-picker-hd {
  font-size: 11px;
  font-weight: 600;
  color: var(--pn);
  margin-bottom: 2px;
}
.theme-picker-sub {
  font-size: 9px;
  color: #90A4AE;
  margin-bottom: 10px;
}

.theme-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-right: 2px;
  margin-right: -2px;
}
.theme-picker-grid::-webkit-scrollbar { width: 5px; }
.theme-picker-grid::-webkit-scrollbar-thumb {
  background: #CFD8DC;
  border-radius: 4px;
}

.theme-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0.5px solid var(--pb);
  border-radius: var(--prs);
  background: white;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.theme-opt:hover {
  border-color: var(--pg);
  background: var(--psu);
}
.theme-opt.on {
  border-color: var(--pg);
  background: var(--pgl);
  box-shadow: 0 0 0 1px var(--pg);
}

.theme-swatches {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.theme-swatches span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.theme-opt-text { flex: 1; min-width: 0; }
.theme-opt-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ps);
  display: block;
}
.theme-opt-tag {
  font-size: 9px;
  color: #90A4AE;
  display: block;
  margin-top: 1px;
}

.theme-opt-check {
  color: var(--pg);
  font-size: 14px;
  opacity: 0;
}
.theme-opt.on .theme-opt-check { opacity: 1; }

.sb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.sb-icon-btn {
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.sb-icon-btn:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
}
