/* Shared purpose / assignment card — glass surface from index.css tokens */
.purpose-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
  margin: 0.7rem auto 1rem;
  padding: 0.55rem 0.55rem 0.5rem;
  box-sizing: border-box;
  border-radius: 18px;
  z-index: 1;
}

.purpose-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(90deg, #ffb3b3, #ffd9b3, #ffff99, #b3ffb3, #b3b3ff, #d9b3ff, #ffb3b3);
  background-size: 220% 220%;
  animation: border-shimmer 6s ease-in-out infinite;
  z-index: -2;
  pointer-events: none;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.purpose-card-title {
  text-align: center;
  font-size: 1.05rem;
  margin: 0 0 0.38rem;
  color: #f4e8ff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.purpose-layout {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 0.38rem;
  justify-content: center;
  align-items: stretch;
}

.purpose-column {
  width: max-content;
  min-width: 7.4rem;
  padding: 0.4rem 0.5rem 0.38rem;
  border-radius: 12px;
  background: rgba(32, 20, 52, 0.42);
  border: 1px solid var(--glass-border);
  box-sizing: border-box;
}

.purpose-column-title {
  text-align: center;
  font-size: 0.72rem;
  margin: 0 0 0.28rem;
  text-transform: uppercase;
  color: #d8b8e8;
}

.purpose-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  margin-bottom: 0.22rem;
  color: #f3eaff;
  font-size: 0.7rem;
  white-space: nowrap;
}

.purpose-row span:first-child {
  line-height: 1.15;
}

.purpose-row:last-child {
  margin-bottom: 0;
}

.purpose-card .base-circle {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  line-height: 1;
}

.purpose-card .purpose-total {
  font-weight: 700;
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, rgba(34, 16, 56, 0.95), rgba(22, 10, 42, 0.95)) padding-box,
    conic-gradient(#ffd6e5, #ffe3c9, #fff1b8, #d9f7c5, #cfe8ff, #e5d4ff, #ffd6e5) border-box;
  box-shadow: inset 0 1px 0 rgba(216, 184, 232, 0.18), 0 0 10px rgba(217, 179, 255, 0.24);
}

@media (max-width: 768px) {
  .purpose-card {
    width: fit-content;
    max-width: 100%;
    margin: 0.2rem auto 0.4rem !important;
    padding: 0.32rem 0.28rem 0.28rem;
  }

  .purpose-card-title {
    font-size: 0.78rem;
    margin: 0 0 0.22rem !important;
  }

  .purpose-layout {
    grid-template-columns: repeat(4, max-content);
    gap: 0.2rem;
    justify-content: center;
  }

  .purpose-column {
    width: max-content;
    min-width: 0;
    max-width: none;
    padding: 0.22rem 0.12rem 0.2rem;
  }

  .purpose-column-title {
    font-size: 0.52rem;
    margin-bottom: 0.12rem;
    letter-spacing: 0.02em;
    line-height: 1.15;
  }

  .purpose-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.12rem;
    margin-bottom: 0.14rem;
    font-size: clamp(0.44rem, 2.35vw, 0.52rem);
    width: 100%;
    white-space: nowrap;
    text-align: left;
  }

  .purpose-row span:first-child {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.1;
    max-width: none;
  }

  .purpose-card .base-circle {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    font-size: 0.52rem;
  }
}

@media (max-width: 374px) {
  .purpose-row span:first-child[data-short] {
    font-size: 0;
    line-height: 0;
  }

  .purpose-row span:first-child[data-short]::before {
    content: attr(data-short);
    font-size: 0.46rem;
    line-height: 1.1;
  }
}
