.student-variables-widget {
  --student-quant: #1f7a8c;
  --student-disc: #0284c7;
  --student-ord: #6f5cc2;
  --student-bin: #2f7d32;
  --student-nom: #8a5a00;
  --student-surv: #c44536;
}

.student-variable-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0;
}

.student-variable-card {
  position: relative;
  display: grid;
  grid-template-rows: 9.9rem 3.1rem 4.4rem auto;
  min-width: 0;
  overflow: hidden;
  padding: 0.9rem;
  background: var(--lca-widget-panel);
  border: 1px solid var(--lca-widget-line);
  border-radius: 8px;
  cursor: pointer;
}

.student-variable-card h5 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1.02rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.student-variable-card p {
  margin: 0;
  color: var(--lca-widget-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.student-variable-type {
  display: inline-block;
  color: var(--student-color, var(--lca-widget-accent));
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0;
}

.student-variable-value {
  display: block;
  align-self: center;
  min-height: 0;
  margin: 0;
  color: var(--lca-widget-ink);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.student-variable-summary {
  align-self: start;
  line-height: 1.3;
}

.student-variable-card button {
  align-self: end;
  width: 100%;
  min-height: 2.35rem;
  margin-top: 0.6rem;
  border: 1px solid var(--student-color, var(--lca-widget-accent));
  border-radius: 6px;
  background: color-mix(in srgb, var(--student-color, var(--lca-widget-accent)) 10%, white);
  color: var(--lca-widget-ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.student-variable-card button:hover,
.student-variable-card button:focus-visible {
  background: color-mix(in srgb, var(--student-color, var(--lca-widget-accent)) 18%, white);
  outline: 2px solid transparent;
}

.student-variable-card[data-student-variable="age"] {
  --student-color: var(--student-quant);
}

.student-variable-card[data-student-variable="coffee"] {
  --student-color: var(--student-disc);
}

.student-variable-card[data-student-variable="confidence"] {
  --student-color: var(--student-ord);
}

.student-variable-card[data-student-variable="lca"] {
  --student-color: var(--student-bin);
}

.student-variable-card[data-student-variable="specialty"] {
  --student-color: var(--student-nom);
}

.student-variable-card[data-student-variable="internship"] {
  --student-color: var(--student-surv);
}

.student-variable-card.is-drawing {
  border-color: color-mix(in srgb, var(--student-color, var(--lca-widget-accent)) 65%, var(--lca-widget-line));
}

.student-variable-card.is-drawing .student-variable-value {
  animation: student-variable-pop 260ms ease-out;
}

.student-variable-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.student-variable-confetti span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0.45rem;
  height: 0.75rem;
  border-radius: 2px;
  background: var(--particle-color);
  opacity: 0;
  transform: translate(0, 0) rotate(0deg);
  animation: student-variable-confetti 620ms ease-out forwards;
}

.student-variable-message {
  margin: 0.75rem 0 0;
  padding: 0.75rem;
  background: #eef6f7;
  border: 1px solid #bddde4;
  border-radius: 8px;
  color: var(--lca-widget-ink);
  line-height: 1.45;
}

@keyframes student-variable-pop {
  0% {
    transform: scale(0.96);
  }

  60% {
    transform: scale(1.04);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes student-variable-confetti {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(0deg);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-variable-card.is-drawing .student-variable-value,
  .student-variable-confetti span {
    animation: none;
  }

  .student-variable-confetti span {
    display: none;
  }
}

@media (max-width: 1050px) {
  .student-variable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-variable-card {
    grid-template-rows: 8.8rem 3.1rem 3.8rem auto;
  }
}

@media (max-width: 650px) {
  .student-variable-grid {
    grid-template-columns: 1fr;
  }

  .student-variable-card {
    grid-template-rows: auto;
  }

  .student-variable-value {
    margin: 0.75rem 0 0.35rem;
  }
}
