/* ── Cast Page Header ──────────────────────────────────────────── */

.cnc-cast-header {
  background: #111;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.cnc-cast-header__strip {
  display: flex;
  align-items: center;
  background: #1a1a1a;
  padding: 4px 12px;
  gap: 6px;
  border-bottom: 3px solid #111;
}

.cnc-cast-header__strip--bottom {
  border-bottom: none;
  border-top: 3px solid #111;
}

.cnc-sprocket-h {
  display: block;
  width: 14px;
  height: 10px;
  background: #333;
  border-radius: 2px;
  flex-shrink: 0;
}

.cnc-strip-line {
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(to right, #333 0px, #333 20px, transparent 20px, transparent 28px);
}

.cnc-cast-header__main {
  padding: 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.cnc-cast-header__eyebrow {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #c8a415;
  font-family: monospace;
  margin: 0;
}

.cnc-cast-header__title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  text-align: center;
  letter-spacing: 0.02em;
}

.cnc-cast-header__title span {
  color: #c8a415;
}

.cnc-cast-header__sub {
  font-size: 12px;
  color: #777;
  margin: 0;
  text-align: center;
  font-family: monospace;
  letter-spacing: 0.08em;
}

.cnc-cast-header__divider {
  width: 50px;
  height: 2px;
  background: #c8a415;
  margin: 0.25rem auto 0;
  border-radius: 2px;
}

/* ── CnC Cast Page ─────────────────────────────────────────────── */

.cnc-cast-page {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 2rem;
  font-family: inherit;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.cnc-faction {
  margin-bottom: 3rem;
}

.cnc-faction-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #888;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 0.5rem;
  margin-bottom: 1.75rem;
}

.cnc-cast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1.75rem;
}

.cnc-cast-grid--cameos {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1.25rem;
}

/* ── Cast Card ─────────────────────────────────────────────────── */

.cnc-cast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.cnc-cast-card:hover {
  transform: translateY(-4px);
}

.cnc-cast-card:hover .cnc-film-frame {
  border-color: #c8a415;
}

.cnc-cast-card__name {
  margin: 8px 0 2px;
  font-weight: 600;
  font-size: 0.88rem;
  color: #222;
  text-align: center;
}

.cnc-cast-card--cameo .cnc-cast-card__name {
  font-size: 0.78rem;
}

.cnc-cast-card__species {
  margin: 0;
  font-size: 0.75rem;
  color: #888;
  text-align: center;
}

/* ── Film Frame ────────────────────────────────────────────────── */

.cnc-film-frame {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 3px;
  padding: 5px 0;
  width: 120px;
  transition: border-color 0.15s;
}

.cnc-film-frame--cameo {
  width: 90px;
}

.cnc-film-frame__sprockets {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  margin: 3px 0;
}

.cnc-sprocket {
  display: block;
  width: 11px;
  height: 8px;
  background: #3a3a3a;
  border-radius: 2px;
}

.cnc-film-frame--cameo .cnc-sprocket {
  width: 8px;
  height: 6px;
}

.cnc-film-frame__image {
  width: 100%;
  height: 140px;
  background: #2a2a2a;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cnc-film-frame--cameo .cnc-film-frame__image {
  height: 105px;
}

.cnc-film-frame__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.cnc-film-frame__placeholder {
  font-size: 2.5rem;
  color: #555;
  font-weight: 600;
}

.cnc-film-frame--cameo .cnc-film-frame__placeholder {
  font-size: 1.8rem;
}

.cnc-film-frame__number {
  font-size: 8px;
  color: #666;
  text-align: center;
  letter-spacing: 0.18em;
  font-family: monospace;
  padding: 3px 0 1px;
}

/* ── Character Profile ─────────────────────────────────────────── */

.cnc-profile {
  max-width: 900px;
  margin: 2rem auto;
  padding: 2rem 2rem;
  font-family: inherit;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.cnc-profile__header {
  display: flex;
  gap: 2rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.cnc-profile__photo-wrap {
  flex-shrink: 0;
}

.cnc-profile__film-frame {
  background: #1a1a1a;
  border: 3px solid #c8a415;
  border-radius: 4px;
  padding: 8px 0;
  width: 200px;
}

.cnc-profile__film-frame .cnc-film-frame__sprockets {
  padding: 0 8px;
  margin: 4px 0;
}

.cnc-profile__film-frame .cnc-sprocket {
  width: 14px;
  height: 10px;
}

.cnc-profile__film-frame .cnc-film-frame__image {
  height: 240px;
}

.cnc-profile__film-frame .cnc-film-frame__number {
  font-size: 10px;
  padding: 5px 0 2px;
}

.cnc-profile__meta {
  flex: 1;
  min-width: 240px;
}

.cnc-profile__name {
  font-size: 2rem;
  margin: 0 0 1rem;
  color: #111;
}

.cnc-profile__stats {
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  width: 100%;
}

.cnc-profile__stats th {
  text-align: left;
  color: #777;
  font-weight: 500;
  padding: 4px 12px 4px 0;
  white-space: nowrap;
  width: 150px;
}

.cnc-profile__stats td {
  color: #222;
  padding: 4px 0;
}

.cnc-profile__stats a {
  color: #c8a415;
  text-decoration: none;
}

.cnc-profile__stats a:hover {
  text-decoration: underline;
}

.cnc-profile__bio {
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #333;
}

.cnc-profile__facts h3,
.cnc-profile__gallery h3,
.cnc-profile__relationships h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: #222;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3rem;
}

.cnc-profile__facts ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.8;
  color: #444;
}

/* ── Gallery ───────────────────────────────────────────────────── */

.cnc-profile__gallery {
  margin-bottom: 2.5rem;
}

.cnc-profile__gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.cnc-profile__gallery-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 3px;
  border: 2px solid #333;
  background: #1a1a1a;
  transition: border-color 0.15s;
}

.cnc-profile__gallery-item:hover img {
  border-color: #c8a415;
}

/* ── Relationship Tree ─────────────────────────────────────────── */

.cnc-profile__relationships {
  margin-bottom: 2.5rem;
}

.cnc-rel-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cnc-rel-tree__center {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.cnc-rel-tree__relations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  padding-top: 0.25rem;
}

.cnc-rel-tree__relation {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cnc-rel-tree__connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 0.5rem;
}

.cnc-rel-tree__connector-line {
  width: 2px;
  height: 14px;
  background: #ccc;
  display: block;
}

.cnc-rel-tree__connector-badge {
  font-size: 0.68rem;
  font-weight: 600;
  background: #f5f0e0;
  color: #7a5f00;
  border: 1px solid #c8a415;
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
}

[data-type="partner"]   .cnc-rel-tree__connector-badge { background: #fce4ec; color: #880e4f; border-color: #e91e8c; }
[data-type="sibling"]   .cnc-rel-tree__connector-badge { background: #e3f2fd; color: #0d47a1; border-color: #2196f3; }
[data-type="parent"]    .cnc-rel-tree__connector-badge { background: #e8f5e9; color: #1b5e20; border-color: #4caf50; }
[data-type="child"]     .cnc-rel-tree__connector-badge { background: #e8f5e9; color: #1b5e20; border-color: #4caf50; }
[data-type="friend"]    .cnc-rel-tree__connector-badge { background: #f3e5f5; color: #4a148c; border-color: #9c27b0; }
[data-type="rival"]     .cnc-rel-tree__connector-badge { background: #fbe9e7; color: #bf360c; border-color: #ff5722; }
[data-type="colleague"] .cnc-rel-tree__connector-badge { background: #e0f2f1; color: #004d40; border-color: #009688; }

.cnc-rel-tree__node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}

.cnc-rel-tree__node:hover {
  transform: translateY(-3px);
}

.cnc-rel-tree__node .cnc-film-frame {
  width: 80px;
}

.cnc-rel-tree__node--self .cnc-film-frame {
  width: 100px;
  border-color: #c8a415;
}

.cnc-rel-tree__node .cnc-film-frame__image {
  height: 90px;
}

.cnc-rel-tree__node--self .cnc-film-frame__image {
  height: 110px;
}

.cnc-rel-tree__node .cnc-sprocket {
  width: 8px;
  height: 6px;
}

.cnc-rel-tree__label {
  margin: 6px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  color: #222;
}

/* ── Back link ─────────────────────────────────────────────────── */

.cnc-profile__back {
  margin-top: 2rem;
  font-size: 0.9rem;
}

.cnc-profile__back a {
  color: #c8a415;
  text-decoration: none;
}

.cnc-profile__back a:hover {
  text-decoration: underline;
}

/* ── Responsive ────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
  .cnc-profile__header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cnc-cast-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
  }
  .cnc-film-frame {
    width: 100px;
  }
  .cnc-film-frame .cnc-film-frame__image {
    height: 110px;
  }
}
