/* Team Saint — roster page.
   Tokens, page chrome (header, hero, footer), pills and base styles are shared: see site.css,
   which must be loaded before this file. */

html:has(dialog[open]) { overflow: hidden; }

/* ---------- Staff bar ---------- */

.staff-bar { padding: 0 var(--gutter); }

.staff-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  max-width: 1320px;
  margin: 0 auto 28px;
  padding: 12px 16px 12px 20px;
  border: 1px solid rgba(155, 136, 255, .32);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(155, 136, 255, .1), rgba(97, 186, 255, .04));
}

.staff-id { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; font: 500 9px var(--mono); letter-spacing: .22em; color: #d8d4e6; text-transform: uppercase; }
.staff-id span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Toolbar ---------- */

.toolbar {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 3, 3, .78);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.toolbar-inner { display: flex; align-items: center; gap: 20px; max-width: 1320px; margin: 0 auto; padding: 12px 0; }

.search { position: relative; flex: 0 1 300px; min-width: 0; display: block; }

.search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 40px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: var(--glass);
  color: var(--fg);
  font: 500 12px var(--sans);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--accent); background: rgba(225, 223, 230, .12); box-shadow: 0 0 0 3px rgba(216, 198, 232, .14); }

.chips {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  padding: 2px 28px 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 500 9.5px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}

.chip:hover { color: var(--fg); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #0b0710; }
.chip span { margin-left: 7px; opacity: .55; }

/* ---------- Roster ---------- */

.roster {
  max-width: 1320px;
  margin: 0 auto;
  padding: 44px var(--gutter) 0;
  display: grid;
  gap: clamp(48px, 7vw, 88px);
  scroll-margin-top: calc(var(--nav-h) + 72px);
}

.roster:has(.division:not([hidden])) { padding-bottom: 96px; }

.division-head {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.division-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 64px;
  height: 1px;
  background: linear-gradient(90deg, var(--signal), var(--blue));
  box-shadow: 0 0 10px rgba(115, 144, 255, .5);
}

.division-index { font: 500 10px var(--mono); letter-spacing: .2em; color: var(--signal); }
.division-title { margin: 0; font: 400 clamp(20px, 2.4vw, 28px) / 1.1 var(--serif); letter-spacing: .2em; text-transform: uppercase; }
.division-count { margin-left: auto; font: 500 9px var(--mono); letter-spacing: .22em; color: var(--dim); text-transform: uppercase; white-space: nowrap; }

.division-head .mini-btn { align-self: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: clamp(12px, 1.6vw, 20px); }

.division-empty {
  margin: 0;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--dim);
  font: 500 10px var(--mono);
  letter-spacing: .16em;
  text-align: center;
  text-transform: uppercase;
}

/* ---------- Player card ---------- */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
  animation: appear .6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 198, 232, .5);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 34px rgba(143, 125, 255, .14);
}

.card-media { position: relative; aspect-ratio: 1; overflow: hidden; background: #0c0a12; }
.card-media::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, rgba(3, 3, 3, .85)); pointer-events: none; }
.card-img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card:hover .card-img { transform: scale(1.045); }

/* The default is the transparent Team Saint emblem, so it is centred on a soft glow rather than cropped to fill the card. */
.card-default .card-media { background: radial-gradient(70% 62% at 50% 44%, rgba(155, 136, 255, .24), transparent 72%), #0c0a12; }
.card-default .card-img { object-fit: contain; padding: 15% 17% 21%; }

.tag-lead {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(216, 198, 232, .55);
  border-radius: 999px;
  background: rgba(10, 8, 16, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--accent);
  font: 500 8.5px var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
}

.flag {
  position: absolute;
  z-index: 2;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 6px;
  background: rgba(10, 8, 16, .6);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}

.flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flag-code { font: 500 9px var(--mono); letter-spacing: .08em; color: var(--fg); }

.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.card-name { margin: 0; font: 700 17px / 1.2 var(--sans); letter-spacing: -.01em; overflow-wrap: anywhere; }
.card-role { margin: 0; font: 500 9.5px var(--mono); letter-spacing: .2em; color: var(--accent); text-transform: uppercase; }

.card-bio {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.socials { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding: 14px 0 0; list-style: none; }

.social {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}

.social i {
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.social:hover { background: var(--accent); border-color: var(--accent); color: #0b0710; transform: translateY(-2px); }

.social[data-network="tiktok"] i { --icon: url("/images/icons/tiktok.svg"); }
.social[data-network="x"] i { --icon: url("/images/icons/x.svg"); }
.social[data-network="youtube"] i { --icon: url("/images/icons/youtube.svg"); }
.social[data-network="instagram"] i { --icon: url("/images/icons/instagram.svg"); }
.social[data-network="gunslol"] i { --icon: url("/images/icons/gunslol.svg"); }
.social[data-network="behance"] i { --icon: url("/images/icons/behance.svg"); }

.card-tools { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }

.mini-btn {
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--fg);
  font: 500 9px var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.mini-btn:hover { background: var(--glass-strong); border-color: rgba(255, 255, 255, .55); }
.mini-danger { color: var(--danger); border-color: rgba(255, 138, 152, .35); }
.mini-danger:hover { background: rgba(255, 138, 152, .12); border-color: rgba(255, 138, 152, .75); }

/* ---------- Loading / empty / error ---------- */

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 20px; }

.skeleton-card {
  aspect-ratio: 3 / 4.1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, rgba(255, 255, 255, .025) 30%, rgba(255, 255, 255, .07) 46%, rgba(255, 255, 255, .025) 62%) 0 0 / 220% 100%;
  animation: shimmer 1.6s linear infinite;
}

.notice {
  max-width: 560px;
  margin: 0 auto 96px;
  padding: 32px 28px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--muted);
  text-align: center;
}

.notice p { margin: 0 0 14px; }
.notice p:last-child { margin-bottom: 0; }
.notice-title { color: var(--fg); font: 400 18px var(--serif) !important; letter-spacing: .14em; text-transform: uppercase; }
.notice-error { border-color: rgba(255, 138, 152, .45); }

/* ---------- Dialogs ---------- */

.dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #0a090d;
  color: var(--fg);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7), 0 0 60px rgba(143, 125, 255, .12);
}

.dialog-small { width: min(440px, calc(100vw - 28px)); }

.dialog::backdrop { background: rgba(3, 3, 3, .74); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog[open] { animation: dialog-in .26s var(--ease); }

.dialog-panel { display: flex; flex-direction: column; max-height: calc(100dvh - 28px); }

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 { margin: 10px 0 0; font: 400 22px / 1.15 var(--serif); letter-spacing: .14em; text-transform: uppercase; }

.icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.icon-btn:hover { background: var(--glass-strong); border-color: rgba(255, 255, 255, .55); }
.icon-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.dialog-body { flex: 1; min-height: 0; padding: 22px 26px; overflow-y: auto; overscroll-behavior: contain; }
.dialog-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.dialog-copy strong { color: var(--fg); }

.dialog-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 26px 20px;
  border-top: 1px solid var(--line);
}

.dialog-foot #member-delete { margin-right: auto; }

.dialog-error { flex: 1 1 100%; order: -1; margin: 0 0 4px; color: var(--danger); font: 500 11.5px / 1.5 var(--sans); }

/* ---------- Forms ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }

.field-label { font: 500 9px var(--mono); letter-spacing: .22em; color: var(--muted); text-transform: uppercase; }
.field-label em { margin-left: 6px; color: var(--dim); font-style: normal; letter-spacing: .12em; }
.field-hint { min-height: 16px; color: var(--dim); font-size: 11.5px; }
.field-hint[data-tone="warn"] { color: var(--danger); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--fg);
  font: 500 13px var(--sans);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.field textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.field input::placeholder, .field textarea::placeholder { color: rgba(167, 166, 167, .55); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(216, 198, 232, .14);
}

.field select {
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a7a6a7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.country-field { position: relative; display: block; }
.country-field input { padding-right: 52px; text-transform: uppercase; }

.country-field img {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 28px;
  height: 21px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 4px;
  object-fit: cover;
}

.socials-fields { margin: 22px 0 0; padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); }
.socials-fields legend { padding: 0 12px 0 0; float: left; width: 100%; margin-bottom: 14px; }
.socials-fields .form-grid { clear: both; }

.switch { display: flex; align-items: center; gap: 12px; align-self: end; min-height: 42px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  transition: background .2s, border-color .2s;
}

.switch-track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform .25s var(--ease), background .2s;
}

.switch input:checked + .switch-track { background: rgba(216, 198, 232, .22); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch-text { font: 500 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: min(92vw, 480px);
  padding: 13px 22px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(18, 16, 24, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  font: 500 10px / 1.5 var(--mono);
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  transform: translateX(-50%);
  animation: toast-in .3s var(--ease);
}

.toast[data-tone="success"] { border-color: rgba(139, 233, 181, .5); color: var(--success); }
.toast[data-tone="error"] { border-color: rgba(255, 138, 152, .6); color: var(--danger); }

/* ---------- Motion ---------- */

@keyframes shimmer { to { background-position: -220% 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .toolbar { position: static; }
  .toolbar-inner { flex-direction: column; align-items: stretch; gap: 10px; }
  .search { flex: 0 0 auto; }
  .chips { padding-right: 0; -webkit-mask-image: none; mask-image: none; }

  .roster { scroll-margin-top: 16px; }
}

@media (max-width: 560px) {
  .staff-inner { border-radius: 22px; padding: 14px 16px; }
  .staff-actions { width: 100%; }
  .staff-actions .pill { flex: 1 1 auto; }

  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 12px; gap: 4px; }
  .card-name { font-size: 14.5px; }
  .card-role { font-size: 8.5px; letter-spacing: .14em; }
  .card-bio { font-size: 11.5px; -webkit-line-clamp: 3; }
  .social { width: 30px; height: 30px; }
  .tag-lead { left: 8px; top: 8px; padding: 5px 8px; font-size: 7.5px; }
  .flag { right: 8px; top: 8px; width: 30px; height: 22px; }

  .division-head { gap: 12px; }
  .division-title { letter-spacing: .14em; }

  .form-grid { grid-template-columns: 1fr; }
  .dialog-head, .dialog-body, .dialog-foot { padding-left: 18px; padding-right: 18px; }
  .dialog-foot .pill { flex: 1 1 auto; }
  .dialog-foot #member-delete { margin-right: 0; }
  .toast { bottom: 18px; }
}

@media (max-width: 360px) {
  .cards { grid-template-columns: 1fr; }
}
