/* Points and levels (wave 7, P16): the Profil level card, the Statistik
   "Punktestand" and the task form's "Punkte" control. Loaded after
   components.css so it can build on its tokens and pieces.

   Every size is the design handoff's (README Part 2, "Where points appear",
   and the prototype's Profil and Statistik screens). Content cards, so none
   of this is glass: solid --card, as every other card.

   Round 7.3 W7 owns this file. */

/* The filled star beside every status-point count. Its size and colour are
 * set by the slot it sits in. */
.points-star {
  display: block;
  flex: none;
  width: 1em;
  height: 1em;
}

/* The small print under the "Punkte" control and under the board. */
.points-hint {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--muted-foreground);
}

/* ---- Task form: "Punkte" ---------------------------------------------
 * The segmented control's look over three radios. The fieldset and legend
 * are for the screen reader's "Punkte, group"; visually they are the same
 * label-and-track the repeat block draws. */
.points-seg-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.points-seg-field > legend {
  padding: 0;
}

.points-seg__item {
  cursor: pointer;
}

/* The prototype's segment label is 12/600, a notch heavier than the
 * repeat block's 12.5/500: it is a number the eye compares. */
.points-seg__item > span {
  font-size: 12px;
  font-weight: 600;
}

.points-seg__item:has(:checked) {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-xs);
}

/* Locked (not the creator, not an admin): the chosen value still reads at
 * full contrast, the others give no sign of being tappable. No opacity —
 * fading the segment would take its text under 4.5:1. */
.points-seg-field:disabled .points-seg__item {
  cursor: default;
}

/* The radio itself is hidden, so its label carries the keyboard focus. */
.points-seg__item:has(:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* ---- Profil: level card ----------------------------------------------- */
.level-card {
  margin-top: 14px;
}

.level-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.level-card__badge {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  font-family: 'Geist Mono', ui-monospace, monospace;
}

.level-card__title {
  flex: 1;
  min-width: 0;
}

.level-card__eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.level-card__name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Up to two lines and never an ellipsis: a long next name ("Großmeister der
 * Wohnung") wraps instead of losing its end. */
.level-card__next {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted-foreground);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.level-card__numbers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.level-card__number {
  min-width: 0;
}

.level-card__big {
  margin-top: 4px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.1;
  font-family: 'Geist Mono', ui-monospace, monospace;
}

.level-card__big--star {
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-card__big--star > .points-star {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.level-card__progress-label {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted-foreground);
}

.level-card__bar {
  display: block;
  height: 8px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--muted);
  overflow: hidden;
}

.level-card__fill {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  transition: width 0.5s var(--ease);
}

.level-card__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.sp-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px 0 6px;
  border-radius: 99px;
  border: 1px solid transparent;
  background: var(--muted);
  color: var(--foreground);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.sp-chip > .points-star {
  width: 12px;
  height: 12px;
}

.sp-chip[data-expires] {
  border-color: var(--destructive);
  background: color-mix(in oklab, var(--destructive) 12%, transparent);
  color: var(--destructive);
}

.level-card__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.5;
}

.level-card__note > .icon {
  flex: none;
  margin-top: 1px;
}

.level-card__note[data-warn] {
  background: color-mix(in oklab, var(--destructive) 10%, transparent);
  color: var(--foreground);
}

.level-card__ladder-title {
  margin: 16px 0 6px;
}

.level-ladder {
  margin: 0;
  padding: 0;
  list-style: none;
}

.level-ladder__rung {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 30px;
}

/* A rung not reached yet is told apart by colour, not by opacity: fading the
 * whole row took the minimum and the name under 4.5:1 (axe, light and dark). */
.level-ladder__rung[data-future] .level-ladder__name {
  color: var(--muted-foreground);
  font-weight: 400;
}

.level-ladder__no {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 7px;
  background: var(--muted);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
}

.level-ladder__rung[data-future] .level-ladder__no {
  background: transparent;
}

.level-ladder__rung[data-current] .level-ladder__no {
  background: var(--primary);
  color: var(--primary-foreground);
}

.level-ladder__name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}

.level-ladder__rung[data-current] .level-ladder__name {
  font-weight: 700;
}

.level-ladder__min {
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  color: var(--muted-foreground);
  font-family: 'Geist Mono', ui-monospace, monospace;
}

.level-ladder__min > .points-star {
  width: 11px;
  height: 11px;
}

/* ---- Statistik: "Punktestand" ----------------------------------------- */
.board {
  margin: 0;
  padding: 4px 14px;
  list-style: none;
}

.board__row {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 56px;
}

.board__row + .board__row {
  border-top: 1px solid var(--border);
}

.board__rank {
  width: 18px;
  flex: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-foreground);
  font-family: 'Geist Mono', ui-monospace, monospace;
}

.board__avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 99px;
  background: var(--muted);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.board__avatar[data-leader] {
  background: var(--primary);
  color: var(--primary-foreground);
}

.board__who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.board__name {
  font-size: 14px;
  font-weight: 600;
}

.board__note {
  font-size: 11px;
  color: var(--muted-foreground);
}

.board__note[data-idle] {
  color: var(--destructive);
}

.board__sp {
  width: 52px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Geist Mono', ui-monospace, monospace;
}

.board__sp > .points-star {
  width: 13px;
  height: 13px;
  color: var(--primary);
}

.board__hp {
  width: 56px;
  flex: none;
  text-align: right;
  font-size: 12px;
  color: var(--muted-foreground);
  font-family: 'Geist Mono', ui-monospace, monospace;
  white-space: nowrap;
}
