/* card.css — team, match, news, stat cards; modal; toasts */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
}

/* Crest: initials in a seamed circle */
.crest {
  --crest: var(--ink);
  --size: 3rem;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: var(--crest);
  color: #fff;
  font-family: var(--font-display);
  font-size: calc(var(--size) * 0.34);
  font-weight: 800;
  letter-spacing: 0.02em;
  outline: 2px dashed rgb(255 255 255 / 0.55);
  outline-offset: calc(var(--size) * -0.1);
}

/* Team card */
.team-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-5);
  transition: border-color 0.15s;
}
.team-card:has(.team-card__link:hover) { border-color: var(--ink); }
.team-card__link { display: flex; flex-direction: column; gap: var(--s-4); text-decoration: none; color: inherit; }
.team-card__top { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.team-card__top > span:last-child { min-width: 0; }
.team-card__name { font-size: 1.3rem; }
.team-card__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: auto;
}
.team-card__facts dt { font-size: var(--text-xs); color: var(--ink-faint); }
.team-card__facts dd { font-weight: 700; }
.team-card__record {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.team-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.follow-btn.is-following { border-color: var(--pitch); color: var(--pitch); }
.follow-btn.is-following svg { fill: currentColor; }

/* Match card */
.match { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.match__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-1) var(--s-3);
  font-size: var(--text-xs);
  color: var(--ink-soft);
}
.match__row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); }
.match__name { min-width: 0; }
.match__team { font-weight: 700; text-decoration: none; }
.match__team:hover { text-decoration: underline; }
.match__home { margin-left: 0.4rem; font-size: var(--text-xs); color: var(--ink-faint); }
.match__score {
  min-width: 2ch;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.match__row--lost { color: var(--ink-faint); }
.match__row--lost .match__team { font-weight: 600; }

.match__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2) var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.match__venue { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--text-xs); color: var(--ink-soft); }
.match__venue svg { width: 1em; height: 1em; }
.match__box summary { cursor: pointer; font-size: var(--text-s); font-weight: 700; }
.match__box[open] summary { margin-bottom: var(--s-2); }
.match__recap { margin-top: var(--s-2); font-size: var(--text-s); color: var(--ink-soft); }
.match__note { font-size: var(--text-s); color: var(--amber); }

/* News */
.news { display: grid; gap: var(--s-6); }
@media (min-width: 48em) { .news { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.news__item { display: flex; flex-direction: column; gap: var(--s-2); padding-top: var(--s-3); border-top: 3px solid var(--ink); }
.news__tag { font-size: var(--text-xs); font-weight: 700; color: var(--stitch-deep); }
.news__item p { color: var(--ink-soft); }

/* Stats */
.stats { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.stat { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-m); }
.stat__value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: var(--s-2); font-size: var(--text-xs); color: var(--ink-soft); }

/* Team profile head + facts */
.team-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-5); }
.team-head .crest { --size: 5.5rem; }
.facts {
  display: grid;
  gap: var(--s-3) var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  margin-top: var(--s-5);
}
.facts dt { font-size: var(--text-xs); color: var(--ink-faint); }
.facts dd { font-weight: 700; }

/* Callouts */
.callout {
  padding: var(--s-4) var(--s-5);
  border-left: 4px solid var(--stitch);
  border-radius: 0 var(--r-s) var(--r-s) 0;
  background: var(--stitch-tint);
}
.callout--ok { border-left-color: var(--pitch); background: var(--pitch-tint); }

/* Modal (native <dialog>) */
.modal {
  width: min(100% - 1.5rem, 46rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--r-l);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}
.modal::backdrop { background: rgb(13 34 64 / 0.55); }
.modal { overflow-y: auto; background: var(--paper); }
.modal__head { padding: var(--s-5) var(--s-5) var(--s-3); }
.modal__head p { margin-top: var(--s-1); color: var(--ink-soft); }
.modal__body { display: grid; gap: var(--s-4); padding: var(--s-2) var(--s-5) var(--s-5); }
.modal__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5) var(--s-5);
  border-top: 1px solid var(--line);
}

/* Toasts */
.toasts {
  position: fixed;
  left: 50%;
  bottom: var(--s-5);
  z-index: 90;
  display: grid;
  gap: var(--s-2);
  width: min(100% - 2rem, 28rem);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  padding: 0.8rem 1rem;
  border-radius: var(--r-m);
  background: var(--surface-strong);
  color: var(--on-surface-strong);
  font-weight: 600;
  box-shadow: var(--shadow-pop);
}
.toast--error { background: var(--stitch-deep); }
.toast--ok { background: var(--pitch); }
