#team-view {
  min-height: 100vh;
  padding: 0;
  color: #edf3e7;
  background:
    radial-gradient(circle at 12% 4%, #2f684c66 0, transparent 31%),
    radial-gradient(circle at 88% 7%, #92713b35 0, transparent 27%),
    linear-gradient(145deg, #07130e 0%, #0d2018 48%, #08150f 100%);
}

.team-shell {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 38px clamp(22px, 3vw, 58px) 70px;
}

#team-view .screen-back {
  margin-bottom: 28px;
  border-color: #bca66b66;
  background: #14281f;
  box-shadow: 0 8px 24px #0005;
}

#team-view .screen-back:hover { background: #27553e; }

.team-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.team-heading .eyebrow { color: #d7bb70; }

.team-heading h2 {
  margin: 0 0 10px;
  color: #fff9e8;
  font-size: clamp(2rem, 3.4vw, 3.35rem);
  line-height: 1;
}

.team-heading .section-copy {
  max-width: 760px;
  margin: 0;
  color: #afbeb5;
  font-size: 1rem;
}

.team-count-panel {
  min-width: 170px;
  padding: 17px 21px;
  border: 1px solid #d1b76566;
  border-radius: 17px;
  background: linear-gradient(145deg, #1c3529, #101f18);
  box-shadow: 0 14px 30px #0005;
  text-align: right;
}

.team-count-panel strong,
.team-count-panel span { display: block; }
.team-count-panel strong { color: #efd17c; font-family: Georgia, serif; font-size: 1.7rem; }
.team-count-panel span { color: #aebbb2; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.team-overview {
  display: grid;
  grid-template-columns: minmax(310px, 1.35fr) repeat(4, minmax(125px, .55fr));
  gap: 12px;
  margin-bottom: 36px;
}

.team-leader-summary,
.team-overview-stat {
  border: 1px solid #bba66555;
  border-radius: 19px;
  background: linear-gradient(145deg, #172b22e8, #0d1c16e8);
  box-shadow: 0 12px 30px #0004;
}

.team-leader-summary {
  display: grid;
  grid-template-columns: 98px 1fr;
  gap: 15px;
  align-items: center;
  min-height: 124px;
  padding: 12px 18px 12px 12px;
}

.team-leader-art {
  width: 98px;
  height: 98px;
  border-radius: 17px;
  background: radial-gradient(circle, #d2b95b26, #07110d00 68%);
}

.team-leader-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 8px #0008); }
.team-leader-copy span { color: #d2b96e; font-size: .63rem; font-weight: 1000; letter-spacing: .14em; }
.team-leader-copy strong { display: block; margin: 4px 0; color: #fff7de; font-family: Georgia, serif; font-size: 1.4rem; }
.team-leader-copy small { color: #a9b8ae; }

.team-overview-stat {
  display: flex;
  min-height: 124px;
  flex-direction: column;
  justify-content: center;
  padding: 17px;
}

.team-overview-stat span { color: #9fafa5; font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.team-overview-stat strong { margin: 4px 0; color: #fff7df; font-family: Georgia, serif; font-size: 1.65rem; }
.team-overview-stat small { color: #7f9587; font-size: .72rem; }
.team-overview-stat.good strong { color: #77d18b; }
.team-overview-stat.warn strong { color: #e7a55c; }

.team-section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin: 0 2px 14px;
}

.team-section-title span,
.team-analysis-heading span { color: #c8ad63; font-size: .63rem; font-weight: 1000; letter-spacing: .15em; }
.team-section-title h3 { margin: 3px 0 0; color: #f7f1df; font-family: Georgia, serif; font-size: 1.35rem; }
.team-section-title small { color: #899c90; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(235px, 1fr));
  gap: 14px;
}

.team-member-card,
.team-empty-slot {
  position: relative;
  min-width: 0;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid #8c826455;
  border-radius: 22px;
  background: linear-gradient(170deg, #fbf7e9 0%, #eee6d3 100%);
  box-shadow: 0 18px 40px #0005;
  color: #17271f;
}

.team-member-card.leader {
  border-color: #e1c35e;
  box-shadow: 0 18px 42px #0006, 0 0 0 2px #d9b94b28, 0 0 30px #d3ad3c20;
}

.team-member-card.ko { filter: saturate(.65); }

.team-card-top {
  position: absolute;
  z-index: 3;
  inset: 13px 13px auto;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 8px;
}

.team-slot-badge,
.team-role-badge,
.team-mutation-badge {
  border-radius: 20px;
  padding: 6px 9px;
  font-size: .63rem;
  font-weight: 1000;
  letter-spacing: .04em;
}

.team-slot-badge { background: #10251ddd; color: #fff7dd; box-shadow: 0 4px 12px #0005; }
.team-member-card.leader .team-slot-badge { background: #b28c2b; }
.team-role-badge { border: 1px solid #d8c898; background: #fff9e8d9; color: #566159; }
.team-mutation-badge { position: absolute; z-index: 3; top: 50px; right: 13px; background: #664b86e8; color: white; }
.team-mutation-badge.negative { background: #9d493f; }
.team-mutation-badge.positive { background: #337650; }

.team-card-art {
  height: 205px;
  padding: 27px 14px 2px;
  background:
    radial-gradient(circle at 50% 70%, #d8c67b4a 0, transparent 48%),
    linear-gradient(180deg, #fffdf8, #f3eddd);
}

.team-card-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 15px 10px #251a1266); }
.team-member-card.ko .team-card-art img { filter: grayscale(.8) opacity(.62) drop-shadow(0 10px 8px #0005); }

.team-card-body { padding: 14px 16px 16px; }
.team-card-body h3 { margin: 0; font-family: Georgia, serif; font-size: 1.42rem; }
.team-card-meta { margin: 4px 0 11px; color: #68756d; font-size: .78rem; font-weight: 750; }

.team-vitals { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 11px; }
.team-vital { padding: 8px 9px; border-radius: 10px; background: #e4ddca; }
.team-vital span,
.team-vital strong { display: block; }
.team-vital span { color: #776f61; font-size: .6rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.team-vital strong { margin-top: 2px; font-size: .84rem; }

.team-progress { margin: 8px 0; }
.team-progress-line { display: flex; justify-content: space-between; margin-bottom: 4px; color: #5f695f; font-size: .66rem; font-weight: 850; }
.team-progress-track { height: 7px; overflow: hidden; border-radius: 10px; background: #d6cfbf; }
.team-progress-track b { display: block; height: 100%; border-radius: inherit; background: #4f9c5e; }
.team-progress-track b.low { background: #b94a43; }
.team-progress-track.xp b { background: #835fc0; }

.team-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 12px 0; }
.team-stat { padding: 7px 2px; border: 1px solid #d8cfb9; border-radius: 9px; background: #fffaf0; text-align: center; }
.team-stat span,
.team-stat strong { display: block; }
.team-stat span { color: #7b7467; font-size: .56rem; font-weight: 900; }
.team-stat strong { font-size: .78rem; }

.team-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.team-action {
  min-width: 0;
  border: 0;
  border-radius: 10px;
  padding: 9px 7px;
  background: #ded6c2;
  color: #425249;
  font-size: .7rem;
  font-weight: 900;
  cursor: pointer;
}
.team-action:hover { background: #cfc4aa; }
.team-action.primary { background: #236542; color: white; }
.team-action.primary:hover { background: #174d31; }
.team-action.evolution {
  grid-column: 1 / -1;
  border: 1px solid #d7b94e;
  background: linear-gradient(135deg, #77561b, #b48928);
  color: #fff8dc;
  box-shadow: 0 5px 14px #87691f35;
}
.team-action.evolution:hover { background: linear-gradient(135deg, #684a16, #9e7922); }
.team-action:disabled { opacity: .42; cursor: not-allowed; }

.team-order-actions { display: flex; gap: 5px; grid-column: 1 / -1; }
.team-order-actions .team-action { flex: 1; padding: 7px; }

.team-empty-slot {
  display: grid;
  place-items: center;
  border: 2px dashed #958b6a66;
  background: #14251dc4;
  color: #92a399;
  box-shadow: none;
}

.team-empty-content { padding: 24px; text-align: center; }
.team-empty-number { display: block; color: #d0b86d55; font-family: Georgia, serif; font-size: 4.5rem; line-height: 1; }
.team-empty-content strong { display: block; margin: 10px 0 5px; color: #c8d2cb; }
.team-empty-content p { margin: 0 0 16px; font-size: .78rem; }

.team-analysis { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-top: 22px; }
.team-analysis-card { padding: 20px; border: 1px solid #9d8d6255; border-radius: 19px; background: #0e2018d9; box-shadow: 0 12px 30px #0004; }
.team-analysis-heading strong { display: block; margin-top: 3px; color: #f4ecd9; font-family: Georgia, serif; font-size: 1.15rem; }
.team-coverage { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.team-coverage-item { padding: 8px 11px; border: 1px solid #ffffff12; border-radius: 20px; background: #ffffff09; color: #75877c; font-size: .75rem; font-weight: 850; }
.team-coverage-item.covered { border-color: #65a97955; background: #2b6d4938; color: #bfe3c8; }
.team-readiness { margin-top: 15px; }
.team-readiness-row { display: flex; justify-content: space-between; gap: 15px; margin: 8px 0; color: #a7b5ac; font-size: .8rem; }
.team-readiness-row strong { color: #f3ead5; }
.team-readiness-bar { height: 10px; overflow: hidden; border-radius: 10px; background: #ffffff14; }
.team-readiness-bar b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #398050, #79c789); }

@media (max-width: 1450px) {
  .team-grid { grid-template-columns: repeat(3, minmax(250px, 1fr)); }
  .team-overview { grid-template-columns: 1.4fr repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .team-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
  .team-overview { grid-template-columns: repeat(2, 1fr); }
  .team-leader-summary { grid-column: 1 / -1; }
  .team-analysis { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .team-shell { padding: 20px 14px 45px; }
  .team-heading { align-items: start; flex-direction: column; }
  .team-count-panel { width: 100%; text-align: left; }
  .team-overview { grid-template-columns: 1fr 1fr; }
  .team-leader-summary { grid-template-columns: 82px 1fr; }
  .team-leader-art { width: 82px; height: 82px; }
  .team-grid { grid-template-columns: 1fr; }
  .team-member-card,
  .team-empty-slot { min-height: 500px; }
  .team-section-title { align-items: start; flex-direction: column; }
}
