/* ============================================================
   DASHBOARD BENTO  —  loaded ONLY by dashboard.html
   (loaded after auth.css; overrides dashboard rules only)
   Palette: bg #0B0E14 · purple #a68af9 · blue #3ABEFF
            text #E5E7EB · muted #9CA3AF
   ============================================================ */

:root {
  --dash-surface: rgba(255, 255, 255, 0.025);
  --dash-surface-2: rgba(255, 255, 255, 0.045);
  --dash-border: rgba(255, 255, 255, 0.07);
  --dash-border-hi: rgba(58, 190, 255, 0.22);
  --dash-purple: #a68af9;
  --dash-blue: #3ABEFF;
  --dash-gold: #FBBF24;
  --dash-green: #34D399;
  --dash-teal: #2DD4BF;
  --dash-orange: #fb923c;
  --dash-text: #E5E7EB;
  --dash-text-hi: #F4F6FB;
  --dash-muted: #9CA3AF;
  --dash-dim: #6B7280;
  --dash-radius: 16px;
  --dash-radius-sm: 10px;
  --dash-gap: 18px;
  --dash-grad: linear-gradient(135deg, #a68af9, #3ABEFF);
  --dash-grad-btn: linear-gradient(90deg, #a68af9, #3ABEFF);
  --dash-shadow-1: 0 4px 20px rgba(0, 0, 0, 0.28);
  --dash-shadow-hi: 0 8px 28px rgba(58, 190, 255, 0.10);
}

/* ================= SECTION SHELL ================= */
.dashboard-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 124px 24px 80px;
}

.dash-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--dash-gap);
  align-items: stretch;
}

.bento-hero      { grid-column: span 8; }
.bento-spin      { grid-column: span 4; }
.bento-span-4    { grid-column: span 4; }
.bento-span-6    { grid-column: span 6; }
.bento-span-12   { grid-column: span 12; }

/* ================= SHARED CARD SURFACE ================= */
.dashboard-card,
.dash-hero,
.dash-spin-card,
.dash-referral-inner,
.dash-continue,
.streak-alert-inner {
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
}

.dashboard-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  border-color: var(--dash-border-hi);
  transform: translateY(-2px);
  box-shadow: var(--dash-shadow-hi);
}

/* Card header — icon chip + title (replaces heavy bottom border) */
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: none;
}

.card-header i {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(58, 190, 255, 0.08);
  color: var(--dash-blue);
  flex-shrink: 0;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dash-text-hi);
  letter-spacing: 0.01em;
  margin: 0;
}

.card-header .card-badge-count {
  color: var(--dash-muted) !important;
  font-size: 11px;
  margin-left: auto;
  font-weight: 500;
}

/* ================= HERO (span 8) ================= */
.dash-hero {
  margin: 0;
  padding: 28px 30px;
  gap: 22px;
  align-items: center;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(166, 138, 249, 0.07), transparent 55%),
    radial-gradient(ellipse at 85% 80%, rgba(58, 190, 255, 0.06), transparent 55%),
    var(--dash-surface);
  overflow: hidden;
}

.dash-hero::before {
  background-image: radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
}

.dash-avatar {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  font-size: 26px;
  color: #0B0E14;
  box-shadow:
    0 0 0 3px rgba(11, 14, 20, 1),
    0 0 0 5px rgba(58, 190, 255, 0.35),
    0 6px 24px rgba(166, 138, 249, 0.25);
}

.dash-hero-meta h1 {
  font-family: var(--text-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--dash-text-hi);
  margin-bottom: 3px;
  line-height: 1.25;
}

.dash-hero-nick {
  font-size: 13px;
  color: var(--dash-blue);
  font-weight: 500;
  margin-bottom: 2px;
}

.dash-hero-email {
  font-size: 12.5px;
  color: var(--dash-muted);
}

.dash-hero-points {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: rgba(58, 190, 255, 0.06);
  border: 1px solid rgba(58, 190, 255, 0.14);
  border-radius: 14px;
  flex-shrink: 0;
}

.dash-hero-pts-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  background: var(--dash-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.dash-hero-pts-label {
  font-size: 11px;
  color: var(--dash-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dash-hero-edit {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--dash-surface-2);
  border: 1px solid var(--dash-border);
  color: var(--dash-muted);
}

.dash-hero-edit:hover {
  background: rgba(58, 190, 255, 0.10);
  border-color: var(--dash-border-hi);
  color: var(--dash-text-hi);
}

/* ================= DAILY SPIN TILE (span 4) ================= */
.dash-spin-card {
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(166, 138, 249, 0.10), transparent 65%),
    var(--dash-surface);
  border: 1px solid rgba(166, 138, 249, 0.16);
  border-radius: var(--dash-radius);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.dash-spin-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(166, 138, 249, 0.14);
  border-color: rgba(166, 138, 249, 0.30);
}

.dash-spin-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(166, 138, 249, 0.10), transparent 70%);
  pointer-events: none;
}

.dash-spin-body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 24px;
  flex: 1;
}

.dash-spin-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: var(--dash-grad);
  box-shadow: 0 4px 18px rgba(166, 138, 249, 0.30);
}

.dash-spin-icon-wrap i {
  color: #fff;
}

.dash-spin-info {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.dash-spin-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--dash-text-hi);
}

.dash-spin-sub {
  font-size: 12px;
  color: var(--dash-muted);
  margin-top: 3px;
}

.dash-spin-btn {
  width: 100%;
  margin-top: auto;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--dash-grad-btn);
  color: #fff;
}

.dash-spin-btn:hover {
  filter: brightness(1.15);
  transform: scale(1.02);
}

.dash-spin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

/* ================= INVENTORY CHIPS ================= */
.dash-inv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-inv-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.dash-inv-chip--freeze {
  color: var(--dash-teal);
  background: rgba(45, 212, 191, 0.08);
  border: 1px solid rgba(45, 212, 191, 0.22);
}

.dash-inv-chip--shard {
  color: var(--dash-purple);
  background: rgba(166, 138, 249, 0.08);
  border: 1px solid rgba(166, 138, 249, 0.22);
}

/* ================= WEEKLY RANK CARD ================= */
.dash-rank {
  margin: 0;
}

.dash-rank-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background:
    linear-gradient(135deg, rgba(58, 190, 255, 0.06) 0%, rgba(166, 138, 249, 0.03) 100%);
  border: 1px solid rgba(58, 190, 255, 0.12);
  border-radius: var(--dash-radius);
  animation: dash-rank-in 0.5s ease-out;
}

@keyframes dash-rank-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

.dash-rank-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--dash-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow:
    0 0 0 3px rgba(58, 190, 255, 0.15),
    0 0 20px rgba(58, 190, 255, 0.1);
}

.dash-rank-body {
  flex: 1;
  min-width: 0;
}

.dash-rank-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
  gap: 12px;
}

.dash-rank-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dash-dim);
  font-weight: 600;
}

.dash-rank-label i {
  color: var(--dash-blue);
  margin-right: 6px;
}

.dash-rank-pos {
  font-family: var(--heading-font, inherit);
  font-size: 1rem;
  font-weight: 700;
  color: var(--dash-blue);
}

.dash-rank-detail {
  font-size: 0.78rem;
  color: var(--dash-muted);
  margin-bottom: 8px;
}

.dash-rank-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-rank-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.dash-rank-bar-fill {
  height: 100%;
  background: var(--dash-grad-btn);
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.dash-rank-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--dash-blue);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s ease;
}

.dash-rank-link:hover {
  color: var(--dash-purple);
}

.dash-rank-link i {
  font-size: 9px;
}

/* ================= STATS ROW (span 12 → 4 tiles) ================= */
.dash-stats {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--dash-gap);
  margin-bottom: 0;
}

.stat-card {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  background: var(--dash-surface);
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  backdrop-filter: none;
}

.stat-card:hover {
  border-color: var(--dash-border-hi);
  box-shadow: var(--dash-shadow-hi);
  transform: translateY(-2px);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-size: 16px;
}

.stat-body {
  flex: none;
  width: 100%;
  min-width: 0;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dash-text-hi);
  line-height: 1.1;
}

.stat-label {
  font-size: 10px;
  color: var(--dash-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Level tile — flatten injected .lvl-stat to match sibling .stat-card layout:
   [icon] → gap 14 → [number → 4px → label], same padding/size as the rest */
#stat-card-level .stat-body,
#stat-card-level #stat-level,
#stat-card-level .lvl-stat {
  display: contents;
}

#stat-card-level .lvl-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

#stat-card-level .lvl-stat-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: none;
  width: 100%;
  min-width: 0;
}

#stat-card-level .lvl-stat-num {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--dash-text-hi);
}

#stat-card-level .lvl-stat-name {
  font-size: 10px;
  color: var(--dash-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
  line-height: 1.2;
  opacity: 1;
}

/* Duplicate "Level" caption — lvl-stat-name already sits under the number */
#stat-card-level .stat-label {
  display: none !important;
}

/* ================= STREAK ALERT (span 12) ================= */
.streak-alert {
  grid-column: span 12;
  margin: 0;
}

.streak-alert-inner {
  padding: 14px 44px 14px 18px;
  gap: 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.07) 0%, rgba(245, 158, 11, 0.025) 100%);
  border-color: rgba(251, 191, 36, 0.18);
  border-radius: var(--dash-radius);
}

.streak-alert-title {
  color: var(--dash-gold);
}

.streak-alert-sub {
  color: rgba(251, 191, 36, 0.7);
}

/* ================= REFERRAL (span 12, single horizontal row) ================= */
.dash-referral {
  grid-column: span 12;
  display: flex;
  margin: 0;
  min-width: 0;
}

.dash-referral-inner {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 20px;
  background:
    linear-gradient(135deg, rgba(58, 190, 255, 0.045) 0%, rgba(162, 138, 249, 0.025) 100%);
  border-color: rgba(58, 190, 255, 0.10);
}

.dash-referral-top {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  width: 100%;
}

.dash-referral-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(58, 190, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--dash-blue);
  flex-shrink: 0;
}

.dash-referral-info {
  flex: 0 1 auto;
  min-width: 0;
}

.dash-referral-title {
  color: var(--dash-text-hi);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.dash-referral-sub {
  color: var(--dash-muted);
  font-size: 11px;
  margin-top: 1px;
  white-space: nowrap;
}

.dash-referral-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--dash-muted);
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--dash-border);
}

.dash-referral-meta-item b {
  color: var(--dash-text-hi);
  font-weight: 700;
}

.dash-referral-meta-sep {
  color: var(--dash-dim);
}

.dash-referral-link-row {
  flex: 1;
  min-width: 120px;
}

.dash-referral-link-wrap {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  border: 1px solid var(--dash-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.dash-referral-link-wrap input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--dash-blue);
  font-size: 12px;
  font-weight: 500;
  outline: none;
}

.dash-referral-link-wrap button {
  padding: 8px 14px;
  border: none;
  border-left: 1px solid var(--dash-border);
  background: rgba(58, 190, 255, 0.06);
  color: var(--dash-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}

.dash-referral-link-wrap button:hover {
  background: rgba(58, 190, 255, 0.12);
}

#referral-share-btn {
  background: linear-gradient(135deg, rgba(166, 138, 249, 0.15), rgba(58, 190, 255, 0.15));
  color: var(--dash-purple);
  padding-left: 12px;
  padding-right: 12px;
}

#referral-share-btn:hover {
  background: linear-gradient(135deg, rgba(166, 138, 249, 0.25), rgba(58, 190, 255, 0.25));
}

/* ================= CONTINUE LEARNING (span 12) ================= */
.dash-continue {
  grid-column: span 12;
  display: flex;
  margin: 0;
  min-width: 0;
  padding: 18px 22px;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(58, 190, 255, 0.05) 0%, rgba(166, 138, 249, 0.03) 100%);
  border-color: rgba(58, 190, 255, 0.12);
  border-radius: var(--dash-radius);
  backdrop-filter: none;
}

.dash-continue-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  color: var(--dash-blue);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-continue-ring {
  background: transparent;
}

.course-ring-svg {
  position: absolute;
  inset: 0;
}

.course-ring-track {
  stroke: rgba(255, 255, 255, 0.06);
}

.course-ring-progress {
  stroke: var(--dash-blue);
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.course-ring-pct {
  position: relative;
  z-index: 1;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--dash-blue);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.course-ring-pct.dim {
  color: var(--dash-muted);
}

.course-progress-text {
  color: var(--dash-dim);
}

.dash-continue-label {
  color: var(--dash-muted);
}

.dash-continue-title {
  color: var(--dash-text-hi);
}

.dash-continue-sub {
  color: var(--dash-muted);
}

.dash-continue-btn {
  border-radius: 10px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(58, 190, 255, 0.25);
}

/* Flatten auth.css card chrome — visibility driven by JS + tabs */

/* ================= LISTS ================= */
.conferences-list,
.awards-list {
  gap: 10px;
}

.conf-item {
  background: var(--dash-surface-2);
  border-color: var(--dash-border);
  border-radius: 12px;
}

.conf-item:hover {
  border-color: var(--dash-border-hi);
  background: rgba(58, 190, 255, 0.03);
}

.conf-name {
  color: var(--dash-text-hi);
  font-size: 14px;
}

.conf-date,
.conf-meta,
.conf-meta i {
  color: var(--dash-muted);
}

.conf-meta {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}

.award-item {
  background: var(--dash-surface-2);
  border-color: var(--dash-border);
  border-radius: 12px;
}

.award-item:hover {
  border-color: rgba(162, 138, 249, 0.20);
  background: rgba(162, 138, 249, 0.035);
}

.award-info h4 {
  color: var(--dash-text-hi);
}

.award-sub {
  color: var(--dash-muted);
}

.award-cert {
  color: var(--dash-muted);
}

/* ================= BADGES ================= */
.dash-badges-wrap {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--dash-border);
}

.dash-badges-header {
  color: var(--dash-muted);
}

/* ================= GEM HISTORY (chart | history tabs) ================= */
#gem-history-card .card-header {
  margin-bottom: 18px;
}

#gem-history-card .gem-tabs {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

#gem-history-card .gem-tab {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  border: 1px solid transparent !important;
  outline: none;
  background: transparent !important;
  color: #9CA3AF !important;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
  line-height: 1;
  padding: 8px 16px !important;
  border-radius: 9px !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

#gem-history-card .gem-tab:hover {
  color: #F4F6FB !important;
  background: rgba(58, 190, 255, 0.1) !important;
  border-color: rgba(58, 190, 255, 0.2) !important;
}

#gem-history-card .gem-tab.active,
#gem-history-card .gem-tab.active:hover {
  color: #0B0E14 !important;
  background: linear-gradient(90deg, #a68af9, #3ABEFF) !important;
  border-color: transparent !important;
}

#gem-history-card .gem-tab:focus-visible {
  outline: 2px solid #3ABEFF;
  outline-offset: 2px;
}

#gem-history-card .gem-chart-panel .dash-chart-section {
  grid-column: auto;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
}

#gem-history-card .gem-chart-panel .dash-chart-header {
  display: none;
}

#gem-history-card .gem-chart-panel .dash-chart-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  min-height: 220px;
}

#gem-history-card .gem-chart-panel .dash-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.gem-chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 180px;
  color: var(--dash-muted);
  text-align: center;
  border: 1px dashed var(--dash-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 24px;
}

.gem-chart-empty i {
  font-size: 28px;
  color: var(--dash-blue);
  opacity: 0.7;
}

.gem-chart-empty p {
  margin: 0;
  font-size: 13px;
  max-width: 280px;
}

.history-entry:hover {
  background: rgba(255, 255, 255, 0.03);
}

.history-icon {
  background: var(--dash-surface-2);
  border-color: var(--dash-border);
  color: var(--dash-muted);
}

.history-label {
  color: var(--dash-text);
}

.history-date {
  color: var(--dash-muted);
}

.history-empty {
  color: var(--dash-muted);
}

/* ================= EMPTY STATES ================= */
.empty-state {
  padding: 36px 16px;
  color: var(--dash-muted);
  font-size: 13px;
}

.empty-state i {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 14px;
  background: rgba(58, 190, 255, 0.06);
  border: 1px solid rgba(58, 190, 255, 0.12);
  color: rgba(58, 190, 255, 0.55);
}

.empty-state span {
  margin-bottom: 14px;
}

.empty-state-btn {
  border-radius: 10px;
  font-weight: 700;
}

/* ================= CTA TILES (stack + Debix, equal halves) ================= */
.cta-card {
  min-height: 100%;
}

/* Left column: Skills Lab + Compete stacked, matches Debix height/width */
.cta-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: var(--dash-gap);
  min-width: 0;
  min-height: 0;
}

.cta-stack > .cta-card {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.cta-stack > .cta-card .join-conf-cta {
  flex: 1;
}

.cta-debix-card {
  min-width: 0;
}

.cta-debix-header {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  background: rgba(166, 138, 249, 0.12);
  border: 1.5px solid rgba(166, 138, 249, 0.35);
  padding: 3px;
  flex-shrink: 0;
}

.cta-debix {
  display: block;
  width: 88px;
  height: auto;
  object-fit: contain;
  margin: 0 0 10px;
  filter: drop-shadow(0 6px 16px rgba(166, 138, 249, 0.3));
}

@media (max-width: 640px) {
  .cta-debix {
    width: 72px;
  }
}

.cta-card .card-header {
  margin-bottom: 14px;
}

.cta-stack > .cta-card .card-header {
  margin-bottom: 10px;
}

.cta-stack > .cta-card .join-conf-cta {
  gap: 10px;
}

.cta-stack > .cta-card .join-conf-cta h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.cta-stack > .cta-card .join-conf-cta p {
  font-size: 12.5px;
}

.cta-card .join-conf-cta {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  flex: 1;
  text-align: left;
  transition: none;
}

.cta-card .join-conf-cta h4,
.cta-card .join-conf-cta p,
.cta-card .join-conf-cta #aiDebateLimit {
  text-align: left;
}

.cta-card .join-conf-cta:hover {
  border: none;
}

.cta-card .join-conf-cta h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dash-text-hi);
  margin-bottom: 6px;
}

.cta-card .join-conf-cta p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--dash-muted);
}

.cta-card .join-conf-cta .join-btn {
  margin-top: auto;
  width: 100%;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 700;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(166, 138, 249, 0.30);
}

/* ================= SPIN MODAL (page-local, moved from inline style) ================= */
#spin-modal {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#spin-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.spin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.spin-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #1F2937;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px 24px 28px;
  text-align: center;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

#spin-modal.open .spin-modal {
  transform: scale(1) translateY(0);
}

.spin-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.spin-modal-close:hover {
  color: #fff;
}

.streak-freeze-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid rgba(45, 212, 191, 0.3);
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(45, 212, 191, 0.08);
  color: #2DD4BF;
  white-space: nowrap;
}

.streak-freeze-btn:hover {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.5);
}

.streak-freeze-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.streak-freeze-btn i {
  margin-right: 4px;
}

.spin-header {
  margin-bottom: 24px;
}

.spin-header-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--dash-grad);
  box-shadow: 0 4px 20px rgba(166, 138, 249, 0.3);
}

.spin-header-icon i {
  color: #fff;
}

.spin-header-title {
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--dash-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.spin-header-sub {
  font-size: 0.75rem;
  color: var(--dash-muted);
  margin-top: 4px;
}

.spin-wheel-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto 20px;
}

.spin-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 32px;
  color: #FBBF24;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  line-height: 1;
}

.spin-wheel-rotator {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06), 0 8px 40px rgba(0, 0, 0, 0.4);
}

#spin-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(135deg, #374151, #1F2937);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.spin-btn:not(:disabled):hover {
  transform: translate(-50%, -50%) scale(1.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.spin-btn i {
  font-size: 14px;
  margin-right: 2px;
}

.spin-result {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spin-result-inner {
  padding: 14px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  width: 100%;
}

.spin-result-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.spin-result-icon i {
  color: var(--prize-color, #a68af9);
}

.spin-result-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dash-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.spin-result-prize {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2px;
}

/* ================= FOCUS / A11Y ================= */
.dashboard-section a:focus-visible,
.dashboard-section button:focus-visible,
.dashboard-section input:focus-visible {
  outline: 2px solid var(--dash-blue);
  outline-offset: 2px;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .dashboard-section {
    padding: 108px 16px 60px;
  }

  .dash-bento {
    gap: 14px;
  }

  .bento-hero,
  .bento-spin,
  .bento-span-4,
  .bento-span-6,
  .bento-span-12,
  .streak-alert,
  .dash-referral,
  .dash-continue {
    grid-column: span 12;
  }

  /* CTA row stays two equal halves on tablet */
  .cta-stack,
  .bento-span-6.cta-debix-card {
    grid-column: span 6;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .dash-hero {
    padding: 22px;
    gap: 16px;
    flex-wrap: wrap;
  }

  #gem-history-card .card-header {
    flex-wrap: wrap;
  }

  #gem-history-card .gem-tabs {
    margin-left: 0;
    width: 100%;
    justify-content: stretch;
  }

  #gem-history-card .gem-tab {
    flex: 1;
    text-align: center;
  }

  .dash-hero-edit {
    position: absolute;
    top: 18px;
    right: 18px;
  }

  .dash-hero-points {
    width: 100%;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
  }

  .dash-spin-body {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    padding: 18px;
  }

  .dash-spin-info {
    flex: 1;
    min-width: 0;
  }

  .dash-spin-btn {
    width: auto;
    margin-top: 0;
    padding: 10px 22px;
  }

  .join-conf-cta {
    flex-direction: column;
    text-align: center;
  }

  .edit-form-row {
    grid-template-columns: 1fr;
  }

  .profile-modal {
    padding: 24px 20px;
  }

  .profile-modal-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .profile-modal-actions .save-profile-btn,
  .profile-modal-actions .sign-out-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .dashboard-section {
    padding: 100px 14px 56px;
  }

  .dash-bento {
    gap: 12px;
  }

  .bento-hero,
  .bento-spin,
  .bento-span-4,
  .bento-span-6,
  .bento-span-12,
  .cta-stack,
  .bento-span-6.cta-debix-card,
  .streak-alert,
  .dash-referral,
  .dash-continue {
    grid-column: span 12;
  }

  .cta-stack {
    grid-template-rows: auto auto;
  }

  .dash-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px;
    gap: 12px;
  }

  .stat-icon,
  #stat-card-level .lvl-stat-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .stat-number,
  #stat-card-level .lvl-stat-num {
    font-size: 22px;
  }

  .dash-hero {
    padding: 18px 16px;
    gap: 12px;
  }

  .dash-avatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
    border-radius: 14px;
  }

  .dash-hero-meta h1 {
    font-size: 18px;
  }

  .dash-hero-pts-number {
    font-size: 22px;
  }

  .dash-hero-points {
    padding: 9px 14px;
  }

  .dashboard-card {
    padding: 18px 16px;
  }

  .dash-spin-body {
    padding: 16px;
    gap: 12px;
  }

  .dash-spin-btn {
    width: 100%;
  }

  .dash-rank-inner {
    flex-direction: column;
    text-align: center;
    padding: 14px 16px;
    gap: 10px;
  }

  .dash-rank-top {
    flex-direction: column;
    gap: 2px;
  }

  .dash-rank-bar-wrap {
    flex-direction: column;
  }

  .dash-rank-link {
    justify-content: center;
  }

  .streak-alert-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 40px 14px 14px;
  }

  .streak-alert-btn {
    width: 100%;
    justify-content: center;
  }

  .dash-continue {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
  }

  .dash-continue-btn {
    width: 100%;
    text-align: center;
  }

  .dash-referral-inner {
    padding: 14px;
    gap: 10px;
  }

  .dash-referral-top {
    flex-wrap: wrap;
    gap: 10px;
  }

  .dash-referral-info {
    flex: 1;
    min-width: 0;
  }

  .dash-referral-link-row {
    flex: 1 1 100%;
    min-width: 0;
    order: 3;
  }

  .dash-referral-meta {
    order: 2;
    margin-left: auto;
  }

  .dash-referral-link-wrap input {
    font-size: 11px;
  }

  .dash-referral-link-wrap button {
    padding: 8px 10px;
    font-size: 11px;
  }

  .conf-title-row {
    flex-wrap: wrap;
  }

  .history-entry {
    padding: 8px 10px;
    gap: 10px;
  }

  .history-icon {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .history-label {
    font-size: 12px;
  }

  .history-amount {
    font-size: 13px;
  }

  .spin-modal {
    max-width: 94vw;
    padding: 24px 16px 20px;
    border-radius: 16px;
  }

  .spin-wheel-wrap {
    width: 240px;
    height: 240px;
  }

  .spin-header-title {
    font-size: 1.05rem;
  }
}
