@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap');
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: #101010;
  color: #FFFFFF;
  font-family: 'Montserrat', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(20px,2vw,55px)
}
h1 {
  font-size: clamp(1.2em,3vw,2.8em);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: clamp(12px,12vw,20px);
  background: linear-gradient(90deg, #666, #fff, #666);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 5s linear infinite;
}
/* Responsive adjustments for smaller viewports (≤768px) */
@media (max-width: 768px) {
  h1 {
    font-size: clamp(0.8em,3vw,2em);          /* Compact font size */
    text-align: left;        /* Left-aligned for readability */
    margin-bottom: 16px;     /* Reduced margin for tighter layout */
    letter-spacing: 1px;     /* Slightly tighter letter spacing */
  }
}
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.crew-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(12px,9vw,18px);
  width: 100%;
  max-width: 1600px;
}
/* Single breakpoint synchronization at 768px */
@media (max-width: 768px) {
  .crew-board {
    grid-template-columns: 1fr; /* Exactly one per row below 768px */
    gap: clamp(4px,1vw,12px); /* Adjusted gap for smaller screens */
  }
}

.crew-member {
  background: #1A1A1A;
  border: 2px solid #2E2E2E;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

.member-content {
  display: flex;
  flex-direction: column;
  gap: 4px 0;
}
.member-info {
  text-align: center;
}

.avatar {
  /* dynamic width: scales with viewport, between 120px and 180px */
  width: clamp(120px, 15vw, 180px);
  height: clamp(120px, 15vw, 180px);
  margin: 0 auto 5px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(
    circle at center,
    #ffffff 0%,
    #f0f0f0 30%,
    #d1d1d1 60%,
    #b3b3b3 80%,
    #999999 100%
  );
  overflow: hidden;
  border-radius: 50%;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.6);
  transition: transform 0.3s;
}
.avatar:hover img { transform: scale(1.7); }

.name { font-size: 1.4em; font-weight: 600; margin-bottom: 6px; }

.title {
    font-size: 1em;
    color: #FF8C00;
    font-variant: all-small-caps;
    font-weight:400;
}

.member-status {
  display: flex;
  flex-direction: column;
}
.status {
  background: rgba(255,255,255,0.07);
  padding: 8px 12px;
  border-radius: 8px;
  min-height: 120px;
  outline: none;
  cursor: text;
  font-size: 0.8em;
  line-height: 1.3em;
  caret-color: #FFF;
  transition: background 0.2s;
  position: relative; /* allows absolute positioning inside */
}
.status:empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 12px; /* Adjust vertically as needed */
  left: 12px; /* Adjust horizontally as needed */
  color: rgba(255,255,255,0.5);
  pointer-events: none; /* Make sure clicks pass through to editable div */
}
.status:focus { background: rgba(255,255,255,0.14); }

.save-indicator { text-align:right; margin-top: 5px; margin-right: 2px;font-size: 0.69em; color: #777; }
@keyframes pulseShimmer {
  0% { color: #777; text-shadow: none; }
  50% { color: #FFF; text-shadow: 0 0 12px rgba(255,255,255,0.7); }
  100% { color: #777; text-shadow: none; }
}

.save-indicator.pulse {
  animation: pulseShimmer 1.2s ease-in-out;
}

/* Single breakpoint: iPad and smaller (<=768px) */
@media (max-width: 768px) {
  .member-content {
    flex-direction: row;
    align-items: flex-start;
  }
  .member-info {
    flex: 0 0 auto;
    text-align: left;
    margin-right: 0;
    max-width: clamp(80px, 20vw, 120px);
    width: clamp(80px, 20vw, 120px);
  }
  .avatar {
    width: 100%; /* take full width of member-info */
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 16px 0 0 16px;
    transform: scale(1.0);
    object-fit: cover;
    margin: 0 0 1px 0;
  }

  .name, .title { display: inline; line-height: 1.2; }
  .name { font-size: clamp(0.6em,2vw,1.2em); margin-bottom: 0; text-transform: uppercase; }
  .title { font-size: clamp(0.6em,2vw,1.2em); margin: 0; font-weight: 600; }

  .member-status { flex: 1 1 auto; }
  .member-text { margin-left: 8px; white-space: nowrap; overflow: visible; }
  .status { font-size: clamp(0.7em,2.5vw,0.9em); min-height: clamp(80px,20vw,120px); border-radius: 0 8px 8px 0; }
  .save-indicator { font-size: 0.7em; }
}