/* ─────────────────────────────────────────────────────────────
   CREW CARDS · the core team as three guilds, each with its own look
     commander → gold octagon, big portrait, crown
     envoy     → cyan cut-corner, side-by-side layout, seal
     guide     → rose tabbed card, compact, compass
   ───────────────────────────────────────────────────────────── */
.guild--commander { --c1: #f3c35f; --c2: #8a5a1a; --c3: #fff3c4; --cols: repeat(3, 1fr); }
.guild--envoy     { --c1: #5fd8ff; --c2: #155a86; --c3: #d6f6ff; --cols: repeat(2, 1fr); }
.guild--guide     { --c1: #ff6fb5; --c2: #8e1650; --c3: #ffe0f0; --cols: repeat(3, 1fr); }

.guild { margin-top: 56px; }
.guild__banner { display: flex; align-items: center; gap: 18px; width: fit-content; max-width: 100%; margin: 0 auto 30px; padding: 14px 40px 14px 26px;
  clip-path: polygon(22px 0, 100% 0, calc(100% - 22px) 100%, 0 100%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--c2) 70%, #120830), color-mix(in srgb, var(--c1) 35%, #24104f) 50%, color-mix(in srgb, var(--c2) 70%, #120830));
  box-shadow: inset 0 2px 0 color-mix(in srgb, var(--c1) 70%, transparent), inset 0 -2px 0 color-mix(in srgb, var(--c1) 70%, transparent); }
.guild__emblem { width: 52px; height: 52px; flex: none; display: grid; place-items: center; color: var(--c3); position: relative; }
.guild__emblem::before { content: ""; position: absolute; inset: 6px; transform: rotate(45deg); border: 2px solid var(--c1); background: rgba(17,9,38,.7); box-shadow: 0 0 16px var(--c1); }
.guild__emblem svg { width: 26px; height: 26px; position: relative; filter: drop-shadow(0 0 6px var(--c1)); }
.guild__title { margin: 0; font: 400 clamp(1.15rem, 2.4vw, 1.5rem)/1.1 var(--f-display); color: #fff; text-shadow: 0 2px 0 #1c0838, 0 0 14px var(--c1); }
.guild__group { margin: 6px 0 0; font: italic 700 .76rem/1 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--c3); opacity: .85; }
.guild__party { display: grid; grid-template-columns: var(--cols); gap: 22px; justify-content: center; }

/* shared card */
.crew { position: relative; padding: 2px; color: var(--ivory); filter: drop-shadow(0 12px 22px rgba(0,0,0,.45)); transition: transform .45s cubic-bezier(.3,1.4,.5,1), filter .4s; }
.crew__frame { position: absolute; inset: 0; z-index: -1; clip-path: var(--shape); background: linear-gradient(135deg, var(--c2), var(--c1) 30%, var(--c3) 50%, var(--c1) 70%, var(--c2)); background-size: 260% 260%; animation: qcBorder 6s linear infinite; }
.crew::before { content: ""; position: absolute; inset: 2px; z-index: 0; clip-path: var(--shape);
  background: radial-gradient(110% 60% at 50% 0%, color-mix(in srgb, var(--c1) 26%, transparent), transparent 60%), linear-gradient(180deg, #24104f, #120830 80%); }
.crew::after { content: ""; position: absolute; inset: 2px; z-index: 0; clip-path: var(--shape); opacity: .5; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.025) 3px 4px); }
.crew > :not(.crew__frame) { position: relative; z-index: 1; }
.crew:hover { transform: translateY(-8px); filter: drop-shadow(0 0 16px color-mix(in srgb, var(--c1) 60%, transparent)) drop-shadow(0 16px 26px rgba(0,0,0,.5)); }

.crew__portrait { position: relative; width: 104px; height: 104px; display: grid; place-items: center; flex: none; }
.crew__orbit { position: absolute; inset: -8px; border-radius: 50%; border: 1.5px dashed color-mix(in srgb, var(--c1) 70%, transparent); animation: spin 14s linear infinite; }
.crew__orbit::before { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--c3); box-shadow: 0 0 10px var(--c1); }
.crew__hex { --hex: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  position: relative; width: 92px; aspect-ratio: 1 / 1.1547; display: grid; place-items: center; clip-path: var(--hex); background: linear-gradient(160deg, var(--c3), var(--c1) 35%, var(--c2)); }
.crew__hex::before { content: ""; position: absolute; inset: 3px; clip-path: var(--hex); background: radial-gradient(circle at 40% 30%, color-mix(in srgb, var(--c1) 45%, #3a1a78), #160b35 75%); }
.crew__init { position: relative; font: 400 1.7rem/1 var(--f-display); color: #fff; text-shadow: 0 0 14px var(--c1), 0 2px 0 #1c0838; }
.crew__lv { position: absolute; right: -4px; bottom: 2px; font: 400 .62rem/1 var(--f-display); color: #160b33; padding: 4px 6px 3px; background: linear-gradient(180deg, var(--c3), var(--c1)); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.crew:hover .crew__orbit { animation-duration: 2.5s; }

.crew__body { display: grid; gap: 8px; min-width: 0; }
.crew__class { display: inline-flex; align-items: center; gap: 7px; justify-self: start; font: italic 800 .68rem/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--c1); }
.crew__class svg { width: 15px; height: 15px; }
.crew__name { margin: 0; font: italic 900 1.12rem/1.2 var(--f-ui); letter-spacing: .04em; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }
.crew__comm { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--c1) 40%, transparent); }
.crew__phone { display: inline-flex; align-items: center; gap: 8px; font: 600 .92rem/1 var(--f-ui); letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--ivory); }
.crew__phone svg { width: 15px; height: 15px; color: var(--c1); flex: none; }
.crew__phone span { user-select: all; }
.crew__copy { cursor: pointer; font: italic 800 .66rem/1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--c3); padding: 7px 12px; background: rgba(17,9,38,.6); border: 1px solid color-mix(in srgb, var(--c1) 60%, transparent); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); transition: background .25s, color .25s; }
.crew__copy:hover { background: var(--c1); color: #160b33; }

/* commander: tall card, centred */
.crew--commander { --shape: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px); }
.crew--commander { display: grid; justify-items: center; text-align: center; gap: 16px; padding: 34px 22px 22px; }
.crew--commander .crew__portrait { width: 120px; height: 120px; }
.crew--commander .crew__hex { width: 104px; }
.crew--commander .crew__portrait::after { content: ""; position: absolute; top: -26px; left: 50%; width: 34px; height: 24px; margin-left: -17px;
  background: linear-gradient(180deg, #fff3c4, #f3c35f 60%, #a8641a); clip-path: polygon(0 100%, 0 20%, 25% 55%, 50% 0, 75% 55%, 100% 20%, 100% 100%); filter: drop-shadow(0 0 6px #f3c35f); }
.crew--commander .crew__body { justify-items: center; width: 100%; }
.crew--commander .crew__class { justify-self: center; }
.crew--commander .crew__comm { justify-content: center; }

/* envoy: wide card, portrait on the left */
.crew--envoy { --shape: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px)); }
.crew--envoy { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 22px; padding: 26px 28px; }

/* guide: compact card with a tab on top */
.crew--guide { --shape: polygon(0 16px, 16px 0, calc(50% - 34px) 0, calc(50% - 22px) 10px, calc(50% + 22px) 10px, calc(50% + 34px) 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%); }
.crew--guide { display: grid; justify-items: center; text-align: center; gap: 14px; padding: 30px 20px 20px; border-radius: 0 0 18px 18px; }
.crew--guide .crew__portrait { width: 96px; height: 96px; }
.crew--guide .crew__hex { width: 82px; }
.crew--guide .crew__body { justify-items: center; width: 100%; }
.crew--guide .crew__class { justify-self: center; }
.crew--guide .crew__comm { justify-content: center; }

@media (max-width: 900px) {
  .guild--commander, .guild--guide { --cols: repeat(2, 1fr); }
  .guild--envoy { --cols: 1fr; }
}
@media (max-width: 560px) {
  .guild--commander, .guild--guide { --cols: 1fr; }
  .crew--envoy { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .crew--envoy .crew__body { justify-items: center; }
  .crew--envoy .crew__comm { justify-content: center; }
  .guild__banner { padding: 12px 30px 12px 20px; gap: 12px; }
}
