/* ======================================================
   TEAM PAGE
====================================================== */

.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 4px 2px;
  margin-bottom: 4px;
}

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

.team-card {
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s ease, background .15s ease, transform .10s ease;
}

.team-card:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.045);
  transform: translateY(-1px);
}

/* top: avatar + name/role */
.team-card-top {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* avatar wrapper holds the status dot */
.team-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  overflow: visible;
}

.team-card-deco {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  pointer-events: none;
  z-index: 2;
  object-fit: contain;
}

.team-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.14);
}

.team-avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.team-avatar--green  { background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.28);  color: rgba(34,197,94,0.75); }
.team-avatar--blue   { background: rgba(14,165,233,0.12); border-color: rgba(14,165,233,0.28); color: rgba(14,165,233,0.75); }
.team-avatar--cyan   { background: rgba(6,182,212,0.12);  border-color: rgba(6,182,212,0.28);  color: rgba(6,182,212,0.75); }
.team-avatar--yellow { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.28); color: rgba(245,158,11,0.75); }
.team-avatar--red    { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.28);  color: rgba(239,68,68,0.75); }
.team-avatar--purple { background: rgba(168,85,247,0.12); border-color: rgba(168,85,247,0.28); color: rgba(168,85,247,0.75); }

/* status dot - bottom-right of avatar */
.team-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #0B1220;
  background: rgba(255,255,255,0.12);
  transition: background .25s ease, box-shadow .25s ease;
}

.team-status-dot--online  { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,0.20); }
.team-status-dot--idle    { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,0.20); }
.team-status-dot--dnd     { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.20); }
.team-status-dot--offline { background: rgba(255,255,255,0.20); }
.team-status-dot--unknown { background: rgba(255,255,255,0.12); }

.team-info { min-width: 0; }

.team-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.team-card-clan {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(0,170,37,0.28);
  background: rgba(0,170,37,0.08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  color: rgba(180,255,200,0.78);
  text-transform: uppercase;
}

.team-name {
  font-size: 14px;
  font-weight: 800;
  color: rgba(233,238,248,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-role {
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(233,238,248,0.48);
}

.team-role--green  { color: rgba(34,197,94,0.85); }
.team-role--blue   { color: rgba(14,165,233,0.85); }
.team-role--cyan   { color: rgba(6,182,212,0.85); }
.team-role--yellow { color: rgba(245,158,11,0.85); }
.team-role--red    { color: rgba(239,68,68,0.85); }
.team-role--purple { color: rgba(168,85,247,0.85); }

/* description */
.team-desc {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
  color: rgba(233,238,248,0.55);
}

/* social links */
.team-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.team-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}

.team-link--discord {
  border: 1px solid rgba(99,102,241,0.28);
  background: rgba(99,102,241,0.08);
  color: rgba(180,182,255,0.80);
  cursor: default;
}

.team-link--github {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: rgba(233,238,248,0.60);
}

.team-link--github:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: rgba(233,238,248,0.90);
  text-decoration: none;
}

/* skeleton shimmer for name while bot loads */
.team-skeleton {
  display: inline-block;
  min-width: 80px;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.06) 25%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.06) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  color: transparent;
  user-select: none;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* bot loading indicator */
.team-bot-loading {
  margin-left: 6px;
  font-size: 11px;
  color: rgba(233,238,248,0.35);
  vertical-align: middle;
}

/* empty state */
.team-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 8px;
  color: rgba(233,238,248,0.35);
  font-size: 13px;
}

.team-empty i { font-size: 18px; opacity: 0.4; }

.team-empty code {
  font-family: monospace;
  font-size: 12px;
  color: rgba(233,238,248,0.50);
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

/* card hover hint */
.team-card {
  cursor: pointer;
}
.team-card:focus-visible {
  outline: 2px solid rgba(0,170,37,0.55);
  outline-offset: 2px;
}
.team-card-hint {
  margin-top: auto;
  padding-top: 6px;
  font-size: 11px;
  color: rgba(233,238,248,0.25);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .14s ease;
}
.team-card:hover .team-card-hint {
  color: rgba(233,238,248,0.50);
}

/* ======================================================
   TEAM PROFILE MODAL
====================================================== */

.tm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.tm-backdrop--visible {
  opacity: 1;
  pointer-events: all;
}

.tm-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  z-index: 901;
  width: min(360px, calc(100vw - 32px));
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.10);
  background: #0e1828;
  box-shadow: 0 24px 80px rgba(0,0,0,0.70);
  overflow: hidden;
  opacity: 0;
  transition: opacity .18s ease, transform .18s cubic-bezier(.16,1,.3,1);
}
.tm-modal--visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tm-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.30);
  color: rgba(233,238,248,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.tm-close:hover {
  background: rgba(255,255,255,0.10);
  color: rgba(233,238,248,0.90);
}

.tm-banner {
  height: 120px;
  width: 100%;
  background-size: cover;
  background-position: center;
}

.tm-body {
  padding: 0 18px 20px;
}

/* avatar overlaps banner */
.tm-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: -36px;
  margin-bottom: 10px;
  overflow: visible;
}
.tm-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid #0e1828;
  object-fit: cover;
  display: block;
}
.tm-decoration {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  pointer-events: none;
  z-index: 2;
  object-fit: contain;
}
.tm-status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid #0e1828;
  background: rgba(255,255,255,0.20);
  transition: background .2s, box-shadow .2s;
}

/* custom status - Discord-style inline display */
.tm-custom-status {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(233,238,248,0.72);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  max-width: 100%;
  overflow: hidden;
  margin-bottom: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tm-custom-status .tm-emoji {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
  flex-shrink: 0;
}

/* username + clan tag row */
.tm-username-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.tm-clan-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 900;
  background: rgba(0,170,37,0.10);
  border: 1px solid rgba(0,170,37,0.32);
  color: rgba(180,255,200,0.85);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.tm-name {
  font-size: 20px;
  font-weight: 900;
  color: rgba(233,238,248,0.96);
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.tm-username {
  font-size: 13px;
  font-weight: 600;
  color: rgba(233,238,248,0.45);
}

.tm-section-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(233,238,248,0.38);
  margin-bottom: 5px;
}

.tm-role-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,170,37,0.35);
  background: rgba(0,170,37,0.10);
  font-size: 12px;
  font-weight: 700;
  color: rgba(180,255,200,0.90);
  margin-bottom: 14px;
}

.tm-desc {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(233,238,248,0.62);
  margin-bottom: 14px;
}

.tm-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 2px 0 12px;
}

.tm-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tm-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tm-meta-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(233,238,248,0.38);
  white-space: nowrap;
}
.tm-meta-value {
  font-size: 12px;
  font-weight: 700;
  color: rgba(233,238,248,0.80);
}
.tm-meta-link {
  color: rgba(99,102,241,0.80);
  text-decoration: none;
}
.tm-meta-link:hover {
  color: rgba(99,102,241,1);
  text-decoration: underline;
}

/* copyable discord ID */
.tm-id {
  cursor: pointer;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-family: monospace;
  font-size: 11.5px;
  transition: background .12s, border-color .12s;
}
.tm-id:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}

/* fallback when emoji CDN fails */
.tm-emoji-fallback {
  font-size: 11px;
  font-family: monospace;
  background: rgba(255,255,255,0.07);
  color: rgba(233,238,248,0.55);
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: 1px;
}

/* inline custom Discord emoji inside activity */
.tm-emoji {
  width: 20px;
  height: 20px;
  vertical-align: -4px;
  display: inline;
  border-radius: 3px;
}

.team-name .tm-emoji {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

/* discord bio */
.tm-bio {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(233,238,248,0.62);
  white-space: pre-wrap;
  margin-bottom: 14px;
}

/* activity line */
.tm-activity {
  font-size: 12px;
  font-weight: 500;
  color: rgba(233,238,248,0.52);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

