/* =========================================================
   CINEMIND — THE VAULT (ARCHIVE STYLES)
   ========================================================= */

.vault-screen {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.vault-top-bar {
  padding-top: 32px;
  display: flex;
  justify-content: flex-start;
  margin-bottom: 24px;
}

.vault-stats-centered {
  font-family: 'Courier Prime', monospace;
  font-size: 0.85rem;
  color: var(--paper-dim);
  margin: 32px auto 24px auto;
  padding: 16px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
  max-width: 480px;
  letter-spacing: 1px;
}

.stat-highlight {
  color: var(--amber);
  font-weight: 700;
}

.stat-divider {
  margin: 0 16px;
  color: var(--line);
}

.case-room-btn {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--amber);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Courier Prime', monospace;
}

.case-room-btn:hover {
  background: var(--line);
  color: var(--paper);
}

.archive-stat {
  font-family: "Courier Prime", monospace;
  font-size: 0.75rem;
  color: var(--paper-dim);
  letter-spacing: 1px;
}

/* Vault Header Typography */
.vault-screen header h1 {
  font-family: 'Special Elite', cursive;
  font-size: 34px;
  letter-spacing: 4px;
  color: var(--paper);
  margin: 0 0 6px 0;
}

.vault-toggle-wrap {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

/* 35mm Contact Sheet Roll Container */
.contact-sheet {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Individual Film / Broadcast Frame Unit */
.film-strip-unit {
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  background-color: var(--bg); /* Darker film base */
  border-radius: 4px;
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, filter 0.15s ease;
  position: relative;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.film-strip-unit:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  border-color: var(--amber);
}

/* Transparent Film Sprockets punching through to --bg-raised */
.sprocket-rail {
  width: 24px;
  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 8px,
    var(--bg-raised) 8px,
    var(--bg-raised) 16px
  );
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* TV Broadcast Tape Rails */
.sprocket-rail.tv-rail {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 12px,
    var(--bg-raised) 12px,
    var(--bg-raised) 16px
  );
}

.frame-center {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.frame-poster-thumb {
  width: 52px;
  height: 76px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  border: 1px solid var(--line);
}

.sealed-negative-thumb {
  width: 52px;
  height: 76px;
  border-radius: 2px;
  background: repeating-linear-gradient(45deg, var(--bg), var(--bg) 4px, var(--bg-raised) 4px, var(--bg-raised) 8px);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  opacity: 0.8;
  flex-shrink: 0;
}

.frame-info {
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.edge-code {
  font-family: "Courier Prime", monospace;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--amber); 
  letter-spacing: 1.5px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.edge-code.tv-code {
  color: #38bdf8; /* Keep slight cyan distinction for TV timecodes if desired, or change to --paper-dim */
}

.frame-title {
  font-family: "Courier Prime", monospace;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paper);
  margin: 2px 0 6px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-sub {
  font-size: 0.72rem;
  color: var(--paper-dim);
  font-family: 'Courier Prime', monospace;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.wax-stamp {
  display: inline-block !important;
  width: fit-content !important; 
  align-self: flex-start !important; 
  background: transparent !important; 
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 2px solid;
  border-radius: 3px 8px 4px 6px / 5px 3px 7px 4px; 
  opacity: 0.85;
  
  /* Buffer margins to prevent the rotated corners from being clipped */
  margin-top: 8px !important; 
  margin-bottom: 4px !important; 
}

.wax-stamp.solved {
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.wax-stamp.failed {
  color: var(--stamp-red);
  border: 1px solid rgba(178, 58, 50, 0.3);
  background: rgba(178, 58, 50, 0.08);
}

.wax-stamp.sealed {
  color: var(--paper-dim);
  border: 1px solid var(--line);
  background: var(--bg-raised);
}

.vault-brief {
  font-family: 'Courier Prime', monospace;
  font-size: 0.85rem;
  color: var(--paper-dim);
  line-height: 1.6;
  max-width: 380px;
  margin: 16px auto 0;
  opacity: 0.85;
}

/* =========================================================
   VAULT PROMO LINK (END GAME CARD)
   ========================================================= */
.vault-promo-link,
.vault-promo-link:visited {
  display: block;
  text-align: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: 1px;
  transition: color 0.2s ease;
}

.vault-promo-link:hover,
.vault-promo-link:active {
  color: var(--paper);
  text-decoration: none;
}

/* =========================================================
   MOBILE & TABLET OPTIMIZATION (VAULT)
   ========================================================= */
@media (max-width: 600px) {
  /* Tighten container padding to match the main app */
  .container {
    padding: 16px 12px;
  }

  /* Scale down the headers so they don't break onto awkward lines */
  header h1 {
    font-size: 2rem;
  }
  
  .date-header {
    font-size: 0.75rem;
  }

  .vault-brief {
    font-size: 0.8rem;
    padding: 0 10px;
  }

  /* Stack the Film/TV tabs vertically so they remain large and tappable */
  .vault-toggle-wrap {
    flex-direction: column;
    gap: 12px;
  }
  
  .vault-toggle-wrap .tab-btn {
    max-width: 100%;
    width: 100%;
  }

  /* If your archived cases are in a grid, this forces them into a single, neat column */
  .archive-grid,
  .vault-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* =========================================================
   TEXT OVERFLOW & WRAPPING FIXES
   ========================================================= */

.frame-info {
  /* Crucial flexbox fix: prevents child text from pushing the container wider than the screen */
  min-width: 0; 
  flex: 1;
}

.frame-title {
  /* Allow text to wrap naturally */
  white-space: normal;
  overflow-wrap: break-word;
  
  /* Restrict to a maximum of 2 lines to maintain uniform card heights */
display: -webkit-box;
-webkit-box-orient: vertical;
overflow: hidden;

/* Provide both standard and prefixed line-clamp to clear the warning */
-webkit-line-clamp: 2;
line-clamp: 2;

line-height: 1.2;
padding-right: 12px;
}

/* Ensure the top metadata row doesn't get pushed off-screen either */
.edge-code {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.edge-code span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* =========================================================
   VAULT COHESION & STAMP UNIFICATION
   ========================================================= */

/* 1. Remove the Cyan TV Code */
.edge-code.tv-code,
.edge-code.tv-code span {
  color: var(--paper-dim) !important; /* Mutes the U-MATIC and Timecode to match the vintage palette */
}

/* 2. Convert Status Tags into Outlined Rubber Stamps */
.wax-stamp {
  display: inline-block !important;
  background: transparent !important; /* Strips out the solid generic fill */
  font-family: 'Courier Prime', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border: 2px solid;
  border-radius: 3px 8px 4px 6px / 5px 3px 7px 4px; /* Asymmetrical hand-stamped shape */
  opacity: 0.85;
}

/* Assign specific ink colors and subtle physical rotations */
.wax-stamp.solved {
  color: #4ade80 !important; /* Victory green */
  border-color: #4ade80 !important;
  transform: rotate(-1.5deg);
}

.wax-stamp.failed {
  color: var(--stamp-red) !important;
  border-color: var(--stamp-red) !important;
  transform: rotate(1deg);
}

.wax-stamp.sealed {
  color: var(--paper-dim) !important;
  border-color: var(--line) !important;
  transform: rotate(-1deg);
}