/* Staff page (/staff/): a name card per staff account, grouped by server
   group, and the three-step "may I apply?" dialog. */

.staff-page {
  --sf-card: #222222;
  --sf-line: rgba(255, 255, 255, 0.085);
  --sf-line-strong: rgba(255, 255, 255, 0.15);
  --sf-chip: rgba(255, 255, 255, 0.075);
  --sf-good: #bff982;
  --sf-bad: #ffa294;
}

.staff-page .page-inner {
  width: min(100%, var(--container));
  max-width: var(--container);
}

.sf-sections {
  display: grid;
  gap: 40px;
}

/* ── Group head ── */

.sf-community-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.sf-group-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #2c2c2c;
  object-fit: cover;
}

.sf-icon-initial {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 900;
}

.sf-community-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.sf-community-count {
  margin: 2px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.sf-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Name cards ── */

.sf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sf-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--sf-line);
  border-radius: 14px;
  background: var(--sf-card);
}

.sf-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.sf-face {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: #2c2c2c;
  image-rendering: pixelated;
  object-fit: cover;
}

.sf-face-initial {
  color: var(--text-secondary);
  font-size: 1.2rem;
  font-weight: 900;
  image-rendering: auto;
}

.sf-card-id {
  min-width: 0;
}

.sf-card-name {
  margin: 0;
  overflow: hidden;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.sf-role {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--sf-chip);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.sf-ids {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--sf-line);
}

.sf-id {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.sf-id dt {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sf-id dd {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
}

.sf-id-value {
  display: flex;
  flex: 1;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sf-id-name {
  flex: none;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.86rem;
  font-weight: 800;
  text-overflow: ellipsis;
}

.sf-id-handle {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-overflow: ellipsis;
}

.sf-id-missing {
  color: var(--text-muted);
  font-weight: 700;
}

.sf-copy {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.sf-copy:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.sf-copy.is-copied {
  color: var(--accent);
}

.sf-copy svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── "May I apply?" ── */

.sf-apply {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  margin-top: 44px;
  padding: 24px 26px;
  border: 1px solid var(--sf-line);
  border-radius: 14px;
  background: var(--sf-card);
}

.sf-apply[hidden] {
  display: none;
}

.sf-apply h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.sf-apply p {
  max-width: 640px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--sf-line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, opacity 0.15s;
}

.sf-btn:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.05);
}

.sf-btn-primary {
  border-color: transparent;
  background: var(--accent-bright);
  color: var(--accent-ink);
}

.sf-btn-primary:hover {
  border-color: transparent;
  background: #d6ffa6;
}

.sf-btn:disabled {
  opacity: 0.45;
  cursor: progress;
}

/* A busy button keeps its color; the spinner says it is working. */
.sf-btn.is-busy:disabled {
  opacity: 1;
}

.sf-btn:focus-visible,
.sf-copy:focus-visible,
.sf-check-close:focus-visible,
.sf-group:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sf-apply-button {
  min-height: 44px;
  padding: 0 22px;
  font-size: 0.9rem;
}

/* The dialog. */
.sf-check {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  color: var(--text);
}

.sf-check[open] {
  animation: sf-check-in 180ms ease-out both;
}

.sf-check::backdrop {
  background: rgba(24, 24, 24, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.sf-check-panel {
  display: grid;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--sf-line-strong);
  border-radius: 14px;
  background: #252525;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8);
}

.sf-check-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sf-check-steps {
  display: flex;
  gap: 6px;
}

.sf-check-steps i {
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s;
}

.sf-check-steps i.is-on {
  background: var(--accent-bright);
}

.sf-check-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--sf-line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sf-check-close:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.05);
}

.sf-check-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.sf-check-step {
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sf-check-body {
  position: relative;
  margin-top: 6px;
  transition: height 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sf-check-body.is-sliding {
  overflow: hidden;
}

.sf-pane {
  display: grid;
  gap: 16px;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.sf-pane.is-leaving {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.sf-pane.from-right,
.sf-pane.to-right {
  transform: translateX(100%);
  opacity: 0;
}

.sf-pane.from-left,
.sf-pane.to-left {
  transform: translateX(-100%);
  opacity: 0;
}

.sf-check-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.sf-check-intro {
  margin: -6px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.sf-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sf-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--sf-line-strong);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sf-group:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.04);
}

.sf-group.is-selected {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.05);
}

.sf-group .sf-group-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 0.9rem;
}

.sf-group-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sf-form {
  display: grid;
}

.sf-label {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.sf-input {
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1px solid var(--sf-line-strong);
  border-radius: 14px;
  background: #212121;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 700;
}

.sf-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(191, 249, 130, 0.14);
}

.sf-error {
  margin: 10px 0 0;
  color: var(--sf-bad);
  font-size: 0.82rem;
  font-weight: 700;
}

.sf-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.sf-form .sf-actions {
  margin-top: 18px;
}

.sf-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.sf-verdict-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-weight: 900;
}

.sf-verdict.is-eligible {
  background: rgba(255, 255, 255, 0.05);
}

.sf-verdict.is-eligible .sf-verdict-mark {
  background: rgba(191, 249, 130, 0.18);
  color: var(--sf-good);
}

.sf-verdict.is-ineligible {
  background: rgba(255, 138, 122, 0.1);
}

.sf-verdict.is-ineligible .sf-verdict-mark {
  background: rgba(255, 138, 122, 0.18);
  color: var(--sf-bad);
}

.sf-verdict-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 900;
}

.sf-verdict-desc {
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.6;
}

.sf-player {
  white-space: nowrap;
}

.sf-player-face {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  border-radius: 4px;
  image-rendering: pixelated;
  vertical-align: -4px;
}

/* A group a sentence names: its icon (a picture, so smoothed) or its initial. */
.sf-group-inline { object-fit: cover; image-rendering: auto; }

.sf-inline-initial {
  display: inline-grid;
  place-items: center;
  background: #2c2c2c;
  color: var(--text-secondary);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
}

/* A Discord avatar is a photo: drawn smooth, not pixel for pixel. */
.sf-id-photo,
.sf-face-photo { image-rendering: auto; object-fit: cover; }

/* The Minecraft row's face, beside the player's name. */
.sf-id-mark {
  flex: none;
  align-self: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  image-rendering: pixelated;
}

.sf-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.sf-checks {
  display: grid;
  margin: -6px 0 0;
  padding: 0;
  list-style: none;
}

.sf-check-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--sf-line);
  font-size: 0.88rem;
}

.sf-check-row:last-child {
  border-bottom: 0;
}

.sf-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
}

.sf-check-row.is-met .sf-mark {
  background: rgba(191, 249, 130, 0.16);
  color: var(--sf-good);
}

.sf-check-row.is-unmet .sf-mark {
  background: rgba(255, 138, 122, 0.16);
  color: var(--sf-bad);
}

.sf-check-label {
  font-weight: 800;
}

.sf-check-values {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
}

.sf-task {
  grid-column: 2 / -1;
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-line;
}

.sf-task em {
  color: var(--text-muted);
  font-style: normal;
}

@keyframes sf-check-in {
  from { opacity: 0; transform: scale(0.975); }
}

@media (max-width: 1100px) {
  .sf-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

@media (max-width: 767px) {
  .sf-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .sf-apply {
    padding: 20px;
  }

  .sf-apply-button {
    width: 100%;
  }

  /* The dialog becomes a bottom sheet. */
  .sf-check {
    width: 100%;
    max-width: none;
    max-height: 92vh;
    margin: auto 0 0;
  }

  .sf-check[open] {
    animation: sf-sheet-in 0.24s ease-out both;
  }

  .sf-check-panel {
    max-height: 92vh;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
  }

  .sf-check-title {
    font-size: 1.22rem;
  }

  .sf-groups {
    grid-template-columns: 1fr;
  }

  .sf-check-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .sf-check-values {
    grid-column: 2;
    text-align: left;
  }

  .sf-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sf-actions .sf-btn-primary:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@keyframes sf-sheet-in {
  from { transform: translateY(32px); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sf-check[open],
  .sf-check-body,
  .sf-pane {
    transition: none;
    animation: none;
  }
}
