/* Spelling-bank summary card. Big total on the left, one stacked bar
   on the right showing how that total breaks down into Mastered /
   Reviewing / Learning, with a three-column key beneath. Each key is
   a clickable drill-in to the words at that level. */

.mastery-breakdown {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 2.25rem;
  align-items: center;
  padding: 1.4rem 1.5rem;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-card);
}

@media (max-width: 720px) {
  .mastery-breakdown {
    grid-template-columns: 1fr;
    row-gap: 1.2rem;
  }
}

.mastery-breakdown-headline {
  min-width: 8rem;
  padding-right: 0.25rem;
}

.mastery-breakdown-total {
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #0B2653;
  line-height: 1;
}

.mastery-breakdown-caption {
  font-size: 0.76rem;
  font-weight: 600;
  color: #64748B;
  margin-top: 0.5rem;
  max-width: 12rem;
  line-height: 1.35;
}

.mastery-breakdown-chart {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.85rem;
}

.mastery-breakdown-bar {
  display: flex;
  height: 0.75rem;
  border-radius: 999px;
  overflow: hidden;
  background: #F1F5F9;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.mastery-breakdown-bar-segment {
  height: 100%;
  transform-origin: left center;
  animation: mastery-bar-in 700ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
  transition: filter 150ms ease;
}
.mastery-breakdown-bar-segment:hover { filter: saturate(1.15) brightness(1.04); }

.mastery-breakdown-bar-segment.is-emerald { background: #10B981; }
.mastery-breakdown-bar-segment.is-brand   { background: var(--color-brand-500); }
.mastery-breakdown-bar-segment.is-amber   { background: #F59E0B; }

@keyframes mastery-bar-in {
  0%   { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

.mastery-breakdown-keys {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 720px) {
  .mastery-breakdown-keys { grid-template-columns: 1fr; }
}

.mastery-breakdown-key {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease;
  min-width: 0;
}

a.mastery-breakdown-key { cursor: pointer; }
a.mastery-breakdown-key:hover {
  background: #F8FAFC;
  border-color: rgba(15, 23, 42, 0.08);
}
a.mastery-breakdown-key.is-emerald:hover { border-color: rgba(16, 185, 129, 0.35); }
a.mastery-breakdown-key.is-brand:hover   { border-color: color-mix(in srgb, var(--color-brand-500) 35%, transparent); }
a.mastery-breakdown-key.is-amber:hover   { border-color: rgba(245, 158, 11, 0.35); }

.mastery-breakdown-key-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.mastery-breakdown-key.is-emerald .mastery-breakdown-key-dot { background: #10B981; }
.mastery-breakdown-key.is-brand   .mastery-breakdown-key-dot { background: var(--color-brand-500); }
.mastery-breakdown-key.is-amber   .mastery-breakdown-key-dot { background: #F59E0B; }

.mastery-breakdown-key-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mastery-breakdown-key-count {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0F172A;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.mastery-breakdown-key.is-empty { opacity: 0.5; }
.mastery-breakdown-key.is-empty .mastery-breakdown-key-count { color: #94A3B8; }

.mastery-breakdown-empty {
  grid-column: 2;
  font-size: 0.85rem;
  color: #64748B;
  max-width: 44rem;
  line-height: 1.45;
}

@media (max-width: 720px) { .mastery-breakdown-empty { grid-column: 1; } }
