/* Contenuti delle finestre */
.win-body h3 {
  margin: 0 0 8px;
  color: var(--ink-hi);
  font: 700 15px/1.3 var(--ui);
  letter-spacing: -.01em;
}
.win-body p { margin: 0 0 12px; }
.win-body a { color: var(--v300); }
.win-body .lead { font-size: 15px; color: var(--win-muted); }
.muted { color: var(--win-muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  overflow: hidden;
  color: var(--win-text);
  font: 13px var(--ui);
  text-decoration: none;
  background: var(--fill-2);
  border: 1px solid var(--win-line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
.btn > * { position: relative; }
.win-body a.btn { color: var(--win-text); }
.btn:hover { background: var(--fill-3); border-color: var(--glass-edge); transform: translateY(-1px); }
.btn:active { transform: scale(0.97); filter: brightness(0.95); }
.chip:active, .tab:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--v400); outline-offset: 2px; }
.btn-primary,
.win-body a.btn-primary {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--v600), #9d5cf5);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5); }
.btn-danger {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #dc2626, #f87171);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45); }
.btn-sm { padding: 5px 13px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* Gruppo con etichetta */
.group {
  margin: 0 0 14px;
  padding: 12px 15px 14px;
  background: var(--fill-1);
  border: 1px solid var(--win-line);
  border-radius: var(--radius-md);
}
.group > legend, .group > .legend {
  padding: 0 6px;
  color: var(--v300);
  font: 700 12.5px var(--ui);
}
.group ul { margin: 4px 0 0; padding-left: 18px; }
.group li + li { margin-top: 4px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}
.stat {
  padding: 12px 14px;
  background: var(--fill-1);
  border: 1px solid var(--win-line);
  border-radius: var(--radius-md);
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
@media (hover: hover) { .stat:hover { border-color: var(--glass-edge); transform: translateY(-2px); } }
.stat b {
  display: block;
  color: var(--ink-hi);
  font: 500 26px/1.15 var(--mono);
  font-variant-numeric: tabular-nums;
  background: var(--stat-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat span { color: var(--win-muted); font-size: 12.5px; }
.stat b.na { color: var(--win-muted); background: none; -webkit-text-fill-color: var(--win-muted); }

.status {
  min-height: 1.4em;
  margin: 0 0 10px;
  color: var(--bad);
  font-size: 12.5px;
}
.status:empty { display: none; }

/* Schede (ordina classifica) */
.tabs { display: flex; gap: 4px; margin: 0 0 12px; padding: 4px; background: var(--fill-1); border: 1px solid var(--win-line); border-radius: 999px; width: fit-content; }
.tab {
  padding: 6px 16px;
  color: var(--win-muted);
  font: 13px var(--ui);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.tab[aria-pressed="true"] { color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--v600), #9d5cf5); }
.tab:hover { color: var(--win-text); }
.tab:focus-visible { outline: 2px solid var(--v400); outline-offset: -3px; }
.board-wrap { background: var(--fill-1); border: 1px solid var(--win-line); border-radius: var(--radius-md); overflow: hidden; }

.board { width: 100%; border-collapse: collapse; font-size: 13px; }
.board th {
  padding: 8px 10px;
  color: var(--v300);
  font-weight: 700;
  text-align: left;
  background: var(--fill-1);
  border-bottom: 1px solid var(--win-line);
}
.board td { padding: 8px 10px; border-bottom: 1px solid var(--win-line); vertical-align: middle; }
.board tr:hover td { background: var(--fill-1); }
.board .pos { width: 34px; color: var(--win-muted); font-family: var(--mono); }
.board .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.board .who { display: flex; align-items: center; gap: 9px; min-width: 0; }
.board .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--v800);
}
.avatar-fallback {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--v600), #9d5cf5);
  border-radius: 50%;
}
.board-empty { padding: 20px; color: var(--win-muted); text-align: center; }

/* Accordion (details/summary) */
details.item {
  margin: 0 0 6px;
  background: var(--fill-1);
  border: 1px solid var(--win-line);
  border-radius: var(--radius-md);
  transition: border-color .16s var(--ease);
}
details.item summary {
  position: relative;
  padding: 10px 12px 10px 32px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
details.item summary::-webkit-details-marker { display: none; }
details.item summary::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--v300);
  border-bottom: 2px solid var(--v300);
  transform: translateY(-70%) rotate(-45deg);
  transition: transform .16s var(--ease);
}
details.item[open] summary::before { transform: translateY(-70%) rotate(45deg); }
details.item summary:hover { background: var(--fill-1); }
details.item summary:focus-visible { outline: 2px solid var(--v400); outline-offset: -3px; }
details.item .inner { padding: 2px 14px 12px 32px; }
details.item .inner p:last-child { margin-bottom: 0; }
details.item ul { margin: 6px 0 0; padding-left: 18px; }

ol.rules { margin: 0; padding-left: 22px; }
ol.rules li { margin: 0 0 9px; padding-left: 4px; }
ol.rules b { color: var(--v300); }

code, kbd {
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--fill-3);
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  details.item summary::before { transition: none; }
}
@media (max-width: 719px) {
  .board th:nth-child(3), .board td:nth-child(3) { display: none; }
  .stat b { font-size: 22px; }
}
