.section-equipage {
  padding-top: 2rem;
  position: relative;
  overflow: hidden;
}

.section-equipage::before,
.section-equipage::after {
  content: '';
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
}

.section-equipage::before {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(0, 245, 212, 0.16), transparent 45%),
    radial-gradient(ellipse at 80% 70%, rgba(56, 189, 248, 0.1), transparent 40%);
  animation: crewAuroraMove 16s ease-in-out infinite alternate;
}

.section-equipage::after {
  background-image:
    linear-gradient(rgba(0, 245, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 212, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 18%, transparent 72%);
  opacity: 0.5;
}

.container-equipage {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.section-equipage .section-title,
.section-equipage .section-intro {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  max-width: 36rem;
}

.section-equipage .crew-layout {
  margin-left: auto;
  margin-right: auto;
}

#crew-create-join {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

#crew-panel {
  display: grid;
  gap: 1rem;
}

.crew-status {
  min-height: 1.5rem;
  margin: 0.4rem auto 1rem;
  text-align: center;
  color: #c7d2fe;
  font-weight: 500;
}

.crew-layout {
  display: grid;
  gap: 1rem;
}

.crew-block {
  display: grid;
  gap: 1rem;
}

.crew-card {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 245, 212, 0.26);
  background: linear-gradient(155deg, rgba(14, 16, 28, 0.96), rgba(9, 11, 20, 0.95));
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 34px rgba(0, 0, 0, 0.32),
    0 0 28px rgba(0, 245, 212, 0.08);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.crew-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 42px rgba(0, 0, 0, 0.36),
    0 0 36px rgba(0, 245, 212, 0.13);
}

.crew-card h2,
.crew-card h3 {
  margin: 0 0 0.8rem;
}

.crew-form {
  display: grid;
  gap: 0.55rem;
}

.crew-form input,
.crew-form select,
.crew-invite-row input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  padding: 0.7rem 0.8rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.crew-form input:focus,
.crew-form select:focus,
.crew-invite-row input:focus {
  outline: none;
  border-color: rgba(0, 245, 212, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
}

.crew-card-main {
  border-color: rgba(0, 245, 212, 0.36);
  position: relative;
  overflow: hidden;
}

.crew-card-main::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.16), transparent 65%);
  pointer-events: none;
}

.crew-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.crew-head h2 {
  margin: 0.15rem 0 0.2rem;
}

.crew-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.68rem;
  color: var(--turquoise);
}

.crew-meta {
  margin: 0;
  color: var(--gris);
  font-size: 0.92rem;
}

.crew-role-chip {
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 212, 0.45);
  color: var(--turquoise);
  background: rgba(0, 245, 212, 0.1);
  padding: 0.35rem 0.65rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.crew-invite-box {
  display: grid;
  gap: 0.45rem;
}

.crew-invite-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.crew-code-view {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--gris);
}

.crew-workspace {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

.crew-sidebar {
  position: sticky;
  top: 5.5rem;
  align-self: start;
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(0, 245, 212, 0.24);
  background: linear-gradient(165deg, rgba(12, 18, 28, 0.95), rgba(8, 10, 18, 0.92));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.crew-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crew-sidebar-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.crew-sidebar-count {
  min-width: 1.6rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  color: var(--turquoise);
  border: 1px solid rgba(0, 245, 212, 0.35);
  background: rgba(0, 245, 212, 0.1);
}

.crew-roster {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.15rem;
}

.crew-roster-empty {
  margin: 0.5rem 0;
  font-size: 0.82rem;
  color: var(--gris);
  text-align: center;
}

.crew-roster-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0.45rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.crew-roster-item:hover {
  border-color: rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.06);
}

.crew-roster-item--me {
  border-color: rgba(254, 228, 64, 0.35);
  background: rgba(254, 228, 64, 0.08);
}

.crew-roster-item--captain {
  border-color: rgba(0, 245, 212, 0.4);
}

.crew-roster-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid rgba(0, 245, 212, 0.28);
  background-color: rgba(0, 0, 0, 0.35);
  image-rendering: pixelated;
  overflow: hidden;
}

.crew-roster-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #e5e7eb;
  background: linear-gradient(145deg, rgba(0, 245, 212, 0.22), rgba(56, 189, 248, 0.18));
}

.crew-roster-body {
  min-width: 0;
  flex: 1;
}

.crew-roster-top {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.crew-roster-name {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  color: #f3f4f6;
  word-break: break-word;
}

.crew-roster-you {
  font-style: normal;
  font-weight: 500;
  font-size: 0.72rem;
  color: #fde047;
}

.crew-roster-role {
  display: inline-block;
  width: fit-content;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--turquoise);
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 212, 0.3);
  background: rgba(0, 245, 212, 0.08);
}

.crew-roster-item--captain .crew-roster-role {
  color: #fde047;
  border-color: rgba(254, 228, 64, 0.45);
  background: rgba(254, 228, 64, 0.12);
}

.crew-roster-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.crew-roster-link {
  font-size: 0.7rem;
  color: var(--turquoise);
  text-decoration: none;
}

.crew-roster-link:hover {
  text-decoration: underline;
}

.crew-roster-assign {
  flex: 1;
  min-width: 0;
}

.crew-role-select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 212, 0.3);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  padding: 0.28rem 0.4rem;
  font-size: 0.72rem;
  font-family: inherit;
}

.crew-chat-main {
  min-width: 0;
}

.crew-chat-main .crew-card-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.crew-chat-main .crew-chat-list {
  flex: 1;
}

.crew-card-chat {
  padding-bottom: 0.85rem;
}

.crew-chat-hint {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.8rem;
  color: var(--gris);
}

.crew-chat-form {
  margin-top: 0.65rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.crew-chat-list {
  max-height: min(52vh, 420px);
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.65rem 0.45rem 0.65rem 0.2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
}

.crew-chat-empty {
  margin: auto 0;
  text-align: center;
  color: var(--gris);
  font-size: 0.85rem;
  padding: 1rem 0.5rem;
}

.crew-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 92%;
}

.crew-chat-row--other {
  align-self: flex-start;
}

.crew-chat-row--me {
  align-self: flex-end;
  flex-direction: row-reverse;
  margin-left: auto;
}

.crew-chat-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 2px solid rgba(0, 245, 212, 0.32);
  background-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.1);
  image-rendering: pixelated;
  overflow: hidden;
}

.crew-chat-row--me .crew-chat-avatar {
  border-color: rgba(254, 228, 64, 0.45);
}

.crew-chat-avatar--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e5e7eb;
  background: linear-gradient(145deg, rgba(0, 245, 212, 0.25), rgba(56, 189, 248, 0.2));
}

.crew-chat-bubble {
  min-width: 0;
  flex: 1;
  border-radius: 14px 14px 14px 4px;
  padding: 0.45rem 0.65rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.crew-chat-row--me .crew-chat-bubble {
  border-radius: 14px 14px 4px 14px;
  border-color: rgba(0, 245, 212, 0.35);
  background: linear-gradient(155deg, rgba(0, 245, 212, 0.14), rgba(0, 245, 212, 0.06));
}

.crew-chat-bubble-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.45rem;
  margin-bottom: 0.2rem;
}

.crew-chat-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f9fafb;
}

.crew-chat-row--other .crew-chat-author {
  color: var(--turquoise);
}

.crew-chat-row--me .crew-chat-author {
  color: #fde047;
}

.crew-chat-role {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

.crew-chat-time {
  margin-left: auto;
  font-size: 0.68rem;
  color: #6b7280;
  font-style: normal;
}

.crew-chat-row--me .crew-chat-bubble-head {
  flex-direction: row-reverse;
}

.crew-chat-row--me .crew-chat-time {
  margin-left: 0;
  margin-right: auto;
}

.crew-chat-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #f3f4f6;
  word-break: break-word;
}

.crew-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.crew-action {
  width: fit-content;
}

@media (max-width: 760px) {
  .crew-workspace {
    grid-template-columns: 1fr;
  }

  .crew-sidebar {
    position: static;
    max-height: none;
  }

  .crew-roster {
    max-height: 220px;
  }
}

@keyframes crewAuroraMove {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -1%, 0) scale(1.04); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.02); }
}
