/* ============================================
   CUSTOM.CSS — All component styles
   Senpai WordPress Theme
   ============================================ */

/* ============================================
   MODAL FORM GRID
   Replaces inline style="display:grid; grid-template-columns:1fr 1fr"
   in page templates so it can be overridden at mobile breakpoint.
   ============================================ */

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .modal-form-grid {
    grid-template-columns: 1fr; /* stack Title + Director fields on mobile */
  }
}

/* ============================================
   TOUCH-ACTIVE — Tap-to-toggle card effects
   Mirrors every :hover card rule for touch devices.
   Class is added/removed by touch-hover.js.
   ============================================ */

/* Greatest Films + Anime Collection */
.film-card.touch-active {
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px hsl(var(--primary) / 0.20),
              0 4px 6px -4px hsl(var(--primary) / 0.15);
}

/* Directors' Favorites */
.director-card.touch-active {
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px hsl(var(--primary) / 0.20),
              0 4px 6px -4px hsl(var(--primary) / 0.15);
}

/* Film Family Tree — root card */
.page-film-family-tree .root-film-card.touch-active {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px hsl(270, 60%, 60% / 0.2);
}

/* Film Family Tree — child cards */
.page-film-family-tree .film-card.touch-active {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px hsl(var(--primary) / 0.15);
}

/* GenSee cards — no touch-active effect (hover effects removed by design) */

/* ============================================
   NAVIGATION — Sticky header with purple gradient
   ============================================ */

.senpai-nav {
  background: hsl(var(--card));
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Purple gradient underline */
.senpai-nav::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg,
    hsl(var(--secondary)),
    hsl(var(--primary)),
    hsl(var(--accent)),
    hsl(var(--primary)),
    hsl(var(--secondary))
  );
}

.senpai-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

.senpai-nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--primary));
  text-decoration: none;
  letter-spacing: -0.01em;
}

.senpai-nav-links {
  display: flex;
  align-items: center;
  gap: 40px;
}

.senpai-nav-link {
  text-decoration: none;
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
  white-space: nowrap;
  letter-spacing: 0.025em;
}

.senpai-nav-link:hover {
  color: hsl(var(--primary));
}

.senpai-nav-link.active {
  color: hsl(var(--primary));
}

/* Hamburger Menu Button */
.senpai-nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
  z-index: 110;
  /* Touch target: ensure 44×44px minimum */
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  /* Remove iOS/Safari tap highlight black square */
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  outline: none;
  border-radius: 0;
}

.senpai-nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: hsl(var(--foreground));
  transition: 0.2s ease;
  border-radius: 1px;
}

/* Hamburger animation when open */
.senpai-nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translateY(7px);
}

.senpai-nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.senpai-nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translateY(-7px);
}

/* Mobile Menu */
.senpai-nav-mobile-links {
  display: none;
  flex-direction: column;
  padding: 16px 24px 20px;
  gap: 16px;
  background: hsl(var(--card));
  border-bottom: 1px solid hsl(var(--border));
}

.senpai-nav-mobile-links.open {
  display: flex;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.senpai-page-header {
  text-align: center;
  padding: 32px 24px 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.senpai-page-header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.senpai-page-header-icon {
  width: 32px;
  height: 32px;
  color: hsl(var(--primary));
  flex-shrink: 0;
  opacity: 0.85;
}

.senpai-page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}

.senpai-page-header p {
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  max-width: 680px;
  margin: 0 auto;
  letter-spacing: 0.025em;
}

/* ============================================
   BUTTONS — Ghost & Solid variants
   ============================================ */

/* "Add Inspiration" Button (specific styling for film cards) */
.btn-inspiration {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.025em;
}

.btn-inspiration:hover {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-inspiration svg {
  width: 16px;
  height: 16px;
}

/* Ghost Button (outlined, fills on hover) */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1.5px solid hsl(var(--primary));
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--primary));
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  letter-spacing: 0.025em;
}

.btn-ghost:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* Solid Purple Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 28px;
  border: none;
  border-radius: 8px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  letter-spacing: 0.025em;
}

.btn-primary:hover {
  background: hsl(var(--accent));
}

/* Secondary Button (muted) */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  letter-spacing: 0.025em;
}

.btn-secondary:hover {
  background: hsl(var(--secondary));
  border-color: hsl(var(--primary));
}

/* ============================================
   FORM INPUTS
   ============================================ */

.senpai-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  letter-spacing: 0.025em;
}

.senpai-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.senpai-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.senpai-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  letter-spacing: 0.025em;
  resize: vertical;
}

.senpai-textarea::placeholder {
  color: hsl(var(--muted-foreground));
}

.senpai-textarea:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

/* ============================================
   SEARCH & SORT BAR
   ============================================ */

.controls-bar {
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.sort-and-count {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-wrapper {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  letter-spacing: 0.025em;
}

.search-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.search-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.sort-wrapper {
  position: relative;
}

.sort-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  font-size: 15px;
  font-family: inherit;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: border-color 0.2s;
  white-space: nowrap;
  letter-spacing: 0.025em;
}

.sort-button:hover,
.sort-button.active {
  border-color: hsl(var(--primary));
}

.sort-chevron {
  font-size: 12px;
  transition: transform 0.2s;
  color: hsl(var(--muted-foreground));
}

.sort-button.active .sort-chevron {
  transform: rotate(180deg);
}

.sort-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: hsl(var(--card));
  border-radius: var(--radius);
  box-shadow: 0 10px 38px -10px rgba(0, 0, 0, 0.15), 0 10px 20px -15px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  max-width: calc(100vw - 32px); /* never wider than viewport */
  overflow: hidden;
  display: none;
  z-index: 50;
  border: 1px solid hsl(var(--border));
}

.sort-dropdown.open {
  display: block;
}

.sort-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  color: hsl(var(--foreground));
  letter-spacing: 0.025em;
}

.sort-option:hover {
  background: hsl(var(--secondary));
}

.sort-option.selected {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.film-count {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* ============================================
   CARDS & LISTS
   ============================================ */

.film-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.film-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 12px 16px;
  cursor: default;
}

/* Desktop: all in one row */
@media (min-width: 768px) {
  .film-card {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr;
    gap: 20px;
    align-items: center;
  }
}

.film-rank {
  grid-row: 1 / 3; /* Span rows 1-2 (title and meta, not button) */
  grid-column: 1;
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--primary));
  min-width: 36px;
  text-align: center;
  align-self: center; /* Center vertically between title and meta */
}

@media (min-width: 768px) {
  .film-rank {
    grid-row: 1;
  }
}

.film-details {
  grid-row: 1 / 3; /* Span rows 1-2 */
  grid-column: 2;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (min-width: 768px) {
  .film-details {
    grid-row: 1;
  }
}

.film-card .add-inspiration-btn {
  grid-row: 3; /* Button in row 3 */
  grid-column: 1 / -1; /* Span all columns */
  width: 100%;
  justify-content: center;
}

@media (min-width: 768px) {
  .film-card .add-inspiration-btn {
    grid-row: 1;
    grid-column: 3;
    width: auto;
  }
}

.film-title {
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--primary));
  margin: 0 0 2px 0;
  letter-spacing: 0.025em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.film-title:hover {
  text-decoration: underline;
}

@media (min-width: 768px) {
  .film-title {
    font-size: 20px;
  }
}

.film-meta {
  font-size: 14px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.025em;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.film-meta .meta-dot {
  color: hsl(var(--muted-foreground));
  opacity: 0.5;
}

.film-meta .separator {
  margin: 0 6px;
  color: hsl(var(--border));
}

/* ============================================
   TAG BADGES (for GenSee)
   ============================================ */

.tag-badge {
  display: inline-block;
  padding: 4px 12px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  letter-spacing: 0.025em;
}

/* ============================================
   DIRECTORS' FAVORITES - 2-Column Grid
   ============================================ */

.directors-favorites-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* Tablet & Mobile: 1 column */
@media (max-width: 767px) {
  .directors-favorites-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile: 1 column with less padding */
@media (max-width: 767px) {
  .directors-favorites-grid {
    padding: 0 20px 40px;
    gap: 16px;
  }
}

.director-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.3s ease;
}

.director-card:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 15px -3px hsl(var(--primary) / 0.20),
              0 4px 6px -4px hsl(var(--primary) / 0.15);
}

@media (max-width: 767px) {
  .director-card {
    padding: 20px;
    gap: 10px;
  }
}

/* Add Inspiration Button - Top Right */
.director-add-btn {
  position: absolute;
  top: 20px;
  right: 20px;
}

@media (max-width: 767px) {
  .director-add-btn {
    top: 16px;
    right: 16px;
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .director-add-btn svg {
    width: 14px;
    height: 14px;
  }
}

/* Director Name - Bold, Large */
.director-name {
  font-size: 22px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0 0 4px 0;
  padding-right: 140px; /* Space for button */
  line-height: 1.3;
  letter-spacing: 0.025em;
}

@media (max-width: 767px) {
  .director-name {
    font-size: 19px;
    padding-right: 120px;
  }
}

/* Film Title + Year Row */
.director-film {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.director-film-title {
  font-size: 18px;
  font-weight: 600;
  color: hsl(var(--primary));
  text-decoration: none;
  letter-spacing: 0.025em;
  transition: color 0.2s ease;
}

.director-film-title:hover {
  text-decoration: underline;
}

@media (max-width: 767px) {
  .director-film-title {
    font-size: 16px;
  }
}

.director-film-year {
  font-size: 16px;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.025em;
}

@media (max-width: 767px) {
  .director-film-year {
    font-size: 14px;
  }
}

/* Quote - Italic Body Text */
.director-quote {
  font-size: 15px;
  font-style: italic;
  color: hsl(var(--foreground));
  line-height: 1.6;
  margin: 8px 0 0 0;
  padding: 0;
  border: none;
  letter-spacing: 0.025em;
}

@media (max-width: 767px) {
  .director-quote {
    font-size: 14px;
    margin: 4px 0 0 0;
  }
}

/* Date Added - Bottom */
.director-date {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid hsl(var(--border));
  letter-spacing: 0.025em;
}

@media (max-width: 767px) {
  .director-date {
    font-size: 12px;
  }
}

/* ============================================
   MODAL (Add Inspiration)
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: hsl(var(--card));
  border-radius: var(--radius);
  padding: 24px 28px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
  line-height: 1.3;
  padding-right: 20px;
}

.modal-close {
  background: none;
  border: none;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: 4px;
  font-size: 24px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: hsl(var(--foreground));
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
  letter-spacing: 0.025em;
}

/* ============================================
   RESPONSIVE — Mobile & Tablet
   ============================================ */

/* Tablet: 768px - 1024px — switch to hamburger */
@media (max-width: 1024px) {
  .senpai-nav-hamburger {
    display: flex;
  }

  .senpai-nav-links {
    display: none;
  }
}

/* Large tablet / small desktop: 1025px - 1199px — compact nav links */
@media (min-width: 1025px) and (max-width: 1199px) {
  .senpai-nav-links {
    gap: 28px;
  }
}

/* Mobile & Tablet: Below 1024px */
@media (max-width: 1024px) {
  /* Page header adjustments */
  .senpai-page-header {
    padding: 24px 20px 20px;
  }
}

/* Mobile: Below 768px */
@media (max-width: 767px) {
  /* Page header adjustments */
  .senpai-page-header h1 {
    font-size: 28px;
  }

  .senpai-page-header-icon {
    width: 28px;
    height: 28px;
  }

  /* Controls bar adjustments */
  .controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-wrapper {
    width: 100%;
    min-width: 0;
  }

  /* Sort and count stay inline on same row */
  .sort-and-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 12px;
  }

  .sort-wrapper {
    flex: 1;
  }

  .sort-button {
    width: 100%;
    justify-content: space-between;
  }

  /* Film cards - 3 row mobile layout */
  .film-card {
    padding: 16px 18px;
    gap: 12px;
  }

  .film-content {
    gap: 16px;
  }

  .film-rank {
    min-width: 28px;
    font-size: 16px;
  }

  .film-title {
    font-size: 16px;
  }

  .film-meta {
    font-size: 13px;
  }

  /* Add Inspiration button - full width, ensure 44px touch target */
  .film-card .add-inspiration-btn {
    width: 100%;
    padding: 12px 16px;
    min-height: 44px;
  }

  /* Modal on mobile - near full screen */
  .modal-overlay {
    padding: 12px;
  }

  .modal-content {
    padding: 20px;
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal-close {
    font-size: 28px;
    padding: 6px 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Very small mobile: Below 375px */
@media (max-width: 374px) {
  .senpai-nav-inner {
    padding: 0 16px;
  }

  .senpai-page-header {
    padding: 24px 16px 20px;
  }

  .film-list {
    padding: 0 16px 32px;
  }

  /* Ensure minimum 14px body text */
  .film-meta,
  .director-date,
  .film-count {
    font-size: 14px;
  }
}/* ============================================
   FILM FAMILY TREE STYLES - SCOPED TO PAGE
   All styles prefixed with .page-film-family-tree
   ============================================ */

/* Page-specific container */
.page-film-family-tree .film-tree-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 48px;
  min-height: 400px;
}

/* Try Section (Suggestion Pills Above Welcome) */
.page-film-family-tree .try-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto 20px;
  padding: 0 24px;
}

.page-film-family-tree .try-label {
  color: hsl(var(--muted-foreground));
  font-size: 15px;
  font-weight: 500;
}

.page-film-family-tree .try-tag {
  padding: 8px 16px;
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.page-film-family-tree .try-tag:hover {
  background: hsl(var(--primary));
  color: white;
  transform: translateY(-1px);
}

/* Welcome State (Empty State) */
.page-film-family-tree .tree-welcome {
  text-align: center;
  padding: 60px 20px;
  max-width: 900px;
  margin: 0 auto;
}

.page-film-family-tree .tree-welcome-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  color: hsl(var(--muted-foreground));
  opacity: 0.3;
  stroke: currentColor;
}

.page-film-family-tree .tree-welcome h2 {
  font-size: 22px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0 0 10px 0;
  letter-spacing: -0.01em;
}

.page-film-family-tree .tree-welcome p {
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  margin: 0;
}

/* Search Suggestions Dropdown */
.page-film-family-tree .search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  max-height: 400px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

@media (max-width: 767px) {
  .page-film-family-tree .search-suggestions {
    max-height: 50vh; /* cap at half viewport on mobile so keyboard doesn't hide it */
  }
}

.page-film-family-tree .search-suggestions.show {
  display: block;
}

.page-film-family-tree .suggestion-item {
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-film-family-tree .suggestion-item:last-child {
  border-bottom: none;
}

.page-film-family-tree .suggestion-item:hover {
  background: linear-gradient(135deg, hsl(270, 60%, 98%), hsl(270, 50%, 97%));
  border-left: 3px solid hsl(var(--primary));
  padding-left: 15px;
}

.page-film-family-tree .suggestion-item strong {
  color: hsl(var(--foreground));
  font-weight: 600;
  font-size: 15px;
  display: block;
}

.page-film-family-tree .suggestion-item small {
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  display: block;
  margin-top: 2px;
}

/* Tree Container - EXACT FROM HTML */
.page-film-family-tree .tree-container {
  background: hsl(var(--card) / 0.8);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 48px 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  max-width: 1400px;
  margin: 0 auto;
}

.page-film-family-tree .tree-container.hidden { 
  display: none; 
}

/* Root Film Card - EXACT FROM HTML */
.page-film-family-tree .root-film-card {
  position: relative;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 380px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  margin: 0 auto 48px;
  background: linear-gradient(135deg, hsl(270, 60%, 96%), hsl(270, 50%, 94%));
  border: 2px solid hsl(270, 50%, 70%);
  text-align: left;
  box-shadow: 0 4px 12px hsl(270, 60%, 60% / 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-film-family-tree .root-film-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px hsl(270, 60%, 60% / 0.2);
}

/* Notes Indicator (Eye Icon) - EXACT FROM HTML */
.page-film-family-tree .notes-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsl(270, 60%, 60%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px hsl(270, 60%, 60% / 0.4);
  z-index: 10;
  /* Expand tap target without changing visual size */
  -webkit-tap-highlight-color: transparent;
}

/* Larger invisible tap area on touch devices */
@media (pointer: coarse) {
  .page-film-family-tree .notes-indicator::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
  }
}

.page-film-family-tree .notes-indicator:hover {
  transform: scale(1.1);
}

.page-film-family-tree .notes-indicator svg {
  width: 11px;
  height: 11px;
}

/* Root Film Content - EXACT FROM HTML */
.page-film-family-tree .root-film-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-grow: 1;
  padding-top: 8px;
}

.page-film-family-tree .root-film-title {
  font-size: 20px;
  font-weight: 700;
  color: hsl(270, 60%, 40%);
  line-height: 1.3;
  margin: 0 0 24px 0;
}

.page-film-family-tree .root-film-year {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  background: hsl(270, 50%, 85%);
  color: hsl(270, 60%, 30%);
  align-self: flex-start;
  margin: 0 0 16px 0;
}

.page-film-family-tree .root-film-director {
  font-size: 14px;
  font-weight: 500;
  color: hsl(270, 50%, 45%);
  margin: 0;
}

/* Connection Lines - EXACT FROM HTML */
.page-film-family-tree .connection-vertical {
  width: 2px;
  height: 40px;
  background: hsl(var(--border));
  margin: 0 auto;
}

.page-film-family-tree .connection-horizontal {
  height: 2px;
  width: 280px;
  max-width: calc(100% - 48px); /* never wider than viewport */
  background: hsl(var(--border));
  margin: 0 auto 32px;
}

/* Children Grid - EXACT FROM HTML */
.page-film-family-tree .children-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1300px;
  margin: 0 auto;
}

.page-film-family-tree .child-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-film-family-tree .child-connection {
  width: 2px;
  height: 24px;
  background: hsl(var(--border));
}

/* Film Card (Children) - EXACT FROM HTML */
.page-film-family-tree .film-card {
  position: relative;
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: linear-gradient(135deg, hsl(var(--card)), hsl(var(--card) / 0.8));
  border: 1px solid hsl(var(--border));
  transition: all 0.3s;
}

.page-film-family-tree .film-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px hsl(var(--primary) / 0.15);
}

.page-film-family-tree .film-card .notes-indicator {
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
}

.page-film-family-tree .film-card .notes-indicator svg {
  width: 12px;
  height: 12px;
}

/* Film Card Content - EXACT FROM HTML */
.page-film-family-tree .film-card-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-grow: 1;
  align-items: flex-start;
  padding-top: 4px;
}

.page-film-family-tree .film-card .film-title {
  font-size: 15px;
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1.3;
  padding-right: 36px;
  text-align: left;
  width: 100%;
  margin: 0 0 20px 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 38px;
}

.page-film-family-tree .film-card .film-year {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 16px;
  background: hsl(var(--secondary));
  align-self: flex-start;
  margin: 0 0 14px 0;
}

.page-film-family-tree .film-card .film-director {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
  text-align: left;
  width: 100%;
  margin: 0;
}

/* Film Notes Popup - EXACT FROM HTML */
.page-film-family-tree .film-notes-popup {
  position: fixed;
  width: 416px;
  max-width: 90vw;
  background: white;
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 999999;
  display: none;
}

.page-film-family-tree .film-notes-popup.active { 
  display: block; 
}

.page-film-family-tree .notes-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid hsl(var(--border));
}

.page-film-family-tree .notes-popup-header svg {
  width: 14px;
  height: 14px;
  color: hsl(var(--primary));
}

.page-film-family-tree .notes-popup-title {
  font-size: 14px;
  font-weight: 600;
  color: hsl(var(--primary));
}

.page-film-family-tree .notes-popup-content {
  padding: 0;
  max-height: 400px;
  overflow-y: scroll;
  scrollbar-width: thin;
  scrollbar-color: hsl(270, 40%, 70%) hsl(0, 0%, 95%);
}

.page-film-family-tree .notes-popup-content::-webkit-scrollbar {
  width: 10px;
  -webkit-appearance: none;
}

.page-film-family-tree .notes-popup-content::-webkit-scrollbar-track {
  background: hsl(0, 0%, 95%);
  border-radius: 5px;
}

.page-film-family-tree .notes-popup-content::-webkit-scrollbar-thumb {
  background: hsl(270, 40%, 70%);
  border-radius: 5px;
  border: 2px solid hsl(0, 0%, 95%);
}

.page-film-family-tree .notes-popup-content::-webkit-scrollbar-thumb:hover {
  background: hsl(270, 50%, 60%);
}

/* Note Item - EXACT FROM HTML */
.page-film-family-tree .note-item {
  padding: 16px 20px;
  background: hsl(0, 0%, 96%);
  border-left: 3px solid hsl(270, 60%, 60%);
  margin: 12px 16px;
  border-radius: 4px;
}

.page-film-family-tree .note-item:first-child {
  margin-top: 16px;
}

.page-film-family-tree .note-item:last-child {
  margin-bottom: 16px;
}

.page-film-family-tree .note-label {
  font-size: 13px;
  font-weight: 600;
  color: hsl(270, 60%, 55%);
  margin-bottom: 8px;
  line-height: 1.4;
}

.page-film-family-tree .note-text {
  font-size: 14px;
  color: hsl(var(--foreground));
  line-height: 1.6;
}

/* Responsive Grid - EXACT FROM HTML */
@media (max-width: 1200px) {
  .page-film-family-tree .children-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .page-film-family-tree .children-grid { grid-template-columns: repeat(2, 1fr); }
  .page-film-family-tree .film-tree-container { padding: 0 20px 40px; }
  .page-film-family-tree .try-section { gap: 10px; }
  .page-film-family-tree .tree-container { padding: 32px 20px; }
}

@media (max-width: 600px) {
  .page-film-family-tree .children-grid { grid-template-columns: 1fr; }
  .page-film-family-tree .film-tree-container { padding: 0 16px 40px; }
  .page-film-family-tree .try-section { padding: 0 16px; gap: 8px; }
  .page-film-family-tree .try-tag { font-size: 13px; padding: 7px 13px; }
  .page-film-family-tree .tree-container { padding: 24px 16px; }
  .page-film-family-tree .root-film-card { max-width: 100%; padding: 20px 18px; }
  .page-film-family-tree .root-film-title { font-size: 17px; }

  /* Mobile popup - centered */
  .page-film-family-tree .film-notes-popup {
    position: fixed !important;
    width: calc(100vw - 32px) !important;
    max-width: 416px !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-height: 80vh;
  }
  
  .page-film-family-tree .notes-popup-content {
    max-height: calc(80vh - 60px);
  }
}
/* CACHE BUSTER - Child card alignment fix */

/* ============================================
   GENSEE — Community Recommendations
   Added: 2026-02-25
   EVERY rule below is scoped to .page-gensee
   Zero impact on Greatest Films, Anime,
   Directors' Favorites, or Film Family Tree.
   ============================================ */

/* ── Toast notification (only rendered on gensee page) ── */
.page-gensee .senpai-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: hsl(var(--foreground));
  color: white;
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.025em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 500;
  pointer-events: none;
}
.page-gensee .senpai-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Required label (purple asterisk labels) ── */
.page-gensee .form-label.required {
  color: hsl(var(--primary));
}

/* ── Select dropdown ── */
.page-gensee .senpai-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground)); /* grey by default (placeholder state) */
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  letter-spacing: 0.025em;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}
/* Once a real value is chosen, switch to full foreground colour */
.page-gensee .senpai-select.has-value {
  color: hsl(var(--foreground));
}
.page-gensee .senpai-select:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

/* ── Container ── */
.page-gensee .gensee-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ── Add button row ── */
.page-gensee .gensee-action-row {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

/* ── Inline form panel ── */
.page-gensee .gensee-form-panel {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 28px 32px 24px;
  margin-bottom: 28px;
  display: none;
}
.page-gensee .gensee-form-panel.open {
  display: block;
}
.page-gensee .gensee-form-title {
  font-size: 18px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.page-gensee .gensee-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}
.page-gensee .gensee-adj-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.page-gensee .gensee-form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

/* ── Card grid ── */
.page-gensee .gensee-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Individual card ── */
.page-gensee .gensee-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  position: relative;
  display: flex;
  flex-direction: column;
}
/* GenSee cards — no hover glow or scale (card content is interactive, keep it static) */
.page-gensee .gensee-card:hover {
  /* intentionally no transform or box-shadow */
}
.page-gensee .gensee-card::before {
  display: none; /* remove left purple stripe entirely */
}
.page-gensee .gensee-card:hover::before {
  width: 0;
}

/* Video embed — 16:9 aspect ratio (YouTube, Vimeo, Bilibili) */
.page-gensee .gensee-card-video {
  aspect-ratio: 16 / 9;
  background: hsl(270 10% 12%);
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--radius) var(--radius) 0 0; /* round top corners only */
}
.page-gensee .gensee-card-video iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}

/* Audio embed — fixed height (Spotify, SoundCloud) */
.page-gensee .gensee-card-audio {
  height: 152px;
  background: hsl(270 10% 12%);
  overflow: hidden;
  flex-shrink: 0;
  border-radius: var(--radius) var(--radius) 0 0; /* round top corners only */
}
.page-gensee .gensee-card-audio iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}

/* Card body */
.page-gensee .gensee-card-body {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Title — 2-line clamp */
.page-gensee .gensee-card-title {
  font-size: 15px;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.4;
  margin-bottom: 8px;
  letter-spacing: 0.025em;
  min-height: calc(1.4em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Tag pills */
.page-gensee .gensee-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.page-gensee .gensee-tag {
  padding: 3px 10px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  letter-spacing: 0.025em;
  line-height: 1.6;
}

/* Adjectives — flex spacer pushes footer to bottom */
.page-gensee .gensee-card-adj {
  font-size: 13.5px;
  font-style: italic;
  color: hsl(var(--primary));
  line-height: 1.55;
  padding-bottom: 12px;
  flex: 1;
}

/* Card footer with divider */
.page-gensee .gensee-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid hsl(var(--border));
  padding-top: 10px;
  margin-top: 0;
  position: relative;
}
.page-gensee .gensee-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.page-gensee .gensee-ext-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.025em;
}
.page-gensee .gensee-ext-link:hover {
  color: hsl(var(--primary));
}
.page-gensee .gensee-by {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.025em;
}

/* Power level name colours */
.page-gensee .name-general { color: hsl(var(--foreground));  font-weight: 500; }
.page-gensee .name-higher  { color: hsl(142 60% 38%);        font-weight: 600; }
.page-gensee .name-highest { color: hsl(var(--primary));     font-weight: 600; }

/* ── Tooltip (ⓘ on elevated curators) ── */
.page-gensee .gensee-tooltip-wrap {
  position: static;
  display: inline-flex;
  align-items: center;
}
.page-gensee .gensee-help-icon {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  cursor: help;
  margin-left: 3px;
  transition: color 0.15s;
  line-height: 1;
}
.page-gensee .gensee-help-icon:hover {
  color: hsl(var(--primary));
}
.page-gensee .gensee-tooltip-wrap .gensee-tooltip {
  /* Position is set entirely by JS (positionTooltip in gensee.js).
     CSS only handles appearance and default hidden state. */
  position: fixed; /* JS will set top/left */
  background: hsl(270 20% 20%);
  color: white;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
  opacity: 0;
  display: none; /* hidden by default; JS sets display:block + opacity */
  z-index: 9999;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
  max-width: 260px;
}
.page-gensee .gensee-tooltip-wrap .gensee-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 24px);
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: hsl(270 20% 20%);
}
/* Tooltip visibility is controlled entirely by JS — no CSS :hover rule needed */

/* ── Vote button ── */
.page-gensee .gensee-vote-wrap {
  position: relative;
}
.page-gensee .gensee-vote-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 8px;
  background: hsl(var(--card));
  font-size: 12px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: 0.025em;
  min-height: 36px; /* closer to 44px for touch */
}
.page-gensee .gensee-vote-btn:hover,
.page-gensee .gensee-vote-btn.voted {
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
  background: hsl(270 70% 60% / 0.06);
}

/* ── Vote popup ── */
.page-gensee .gensee-vote-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: hsl(var(--card));
  background-color: white; /* explicit fallback in case HSL variable fails */
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow:
    0 10px 38px -10px rgba(0,0,0,0.18),
    0 10px 20px -15px rgba(0,0,0,0.12);
  width: 230px;
  max-width: calc(100vw - 32px);
  padding: 14px;
  display: none;
  z-index: 200; /* raised so it sits above card content */
  animation: gsPopIn 0.18s ease;
}
.page-gensee .gensee-vote-popup.open {
  display: block;
}
@keyframes gsPopIn {
  from { opacity: 0; transform: scale(0.95) translateY(4px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);   }
}
.page-gensee .gensee-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin-bottom: 10px;
  letter-spacing: 0.025em;
}
.page-gensee .gensee-popup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.page-gensee .gensee-gen-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.025em;
}
.page-gensee .gensee-gen-btn:hover {
  background: hsl(var(--secondary));
  color: hsl(var(--primary));
}
.page-gensee .gensee-gen-btn.voted {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.page-gensee .gensee-gen-btn .check { display: none; font-size: 10px; }
.page-gensee .gensee-gen-btn.voted .check { display: inline; }

.page-gensee .gensee-vote-count {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: hsl(var(--muted));
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.page-gensee .gensee-vote-count.has-votes {
  background: hsl(270 70% 60% / 0.12);
  color: hsl(var(--primary));
}

/* ── Empty state ── */
.page-gensee .gensee-empty {
  text-align: center;
  padding: 64px 20px;
  color: hsl(var(--muted-foreground));
  grid-column: 1 / -1;
}
.page-gensee .gensee-empty-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: hsl(var(--muted));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

/* ============================================
   GENSEE RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .page-gensee .gensee-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 767px) {
  .page-gensee .gensee-grid         { grid-template-columns: 1fr; }
  .page-gensee .gensee-wrap         { padding: 0 20px 48px; }
  .page-gensee .gensee-grid-2       { grid-template-columns: 1fr; }
  .page-gensee .gensee-adj-row      { grid-template-columns: 1fr; }
  .page-gensee .gensee-form-panel   { padding: 20px; }
  .page-gensee .gensee-form-footer  { flex-direction: column-reverse; }
  .page-gensee .gensee-form-footer .btn-primary,
  .page-gensee .gensee-form-footer .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  .page-gensee .gensee-action-row .btn-primary {
    width: 100%;
    justify-content: center;
  }
  /* vote popup position is now handled by JS (positionVotePopup) */
}
@media (max-width: 374px) {
  .page-gensee .gensee-wrap { padding: 0 16px 40px; }
}

/* ================================================================
   GENSEE — PASSWORD GATE MODAL
   ================================================================ */

.page-gensee .gensee-gate-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: hsla(270 15% 8% / 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.page-gensee .gensee-gate-overlay.open {
  display: flex;
}

.page-gensee .gensee-gate-modal {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  padding: 36px 32px 28px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;       /* never taller than viewport */
  overflow-y: auto;       /* scroll if content overflows on short screens */
  box-shadow: 0 24px 60px hsla(270 30% 5% / 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: gensee-gate-in 0.2s ease;
}

@keyframes gensee-gate-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.page-gensee .gensee-gate-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: hsl(var(--primary) / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  margin-bottom: 4px;
}

.page-gensee .gensee-gate-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: hsl(var(--foreground));
  margin: 0;
  text-align: center;
}

.page-gensee .gensee-gate-desc {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.page-gensee .gensee-gate-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.page-gensee .gensee-gate-error {
  font-size: 0.8rem;
  color: hsl(0 72% 51%);
  min-height: 18px;
  margin: 0;
  text-align: center;
}

.page-gensee .gensee-gate-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
.page-gensee .gensee-gate-actions .btn-secondary,
.page-gensee .gensee-gate-actions .btn-primary {
  flex: 1;
}

@media (max-width: 440px) {
  .page-gensee .gensee-gate-modal {
    padding: 28px 20px 22px;
  }
}

/* ============================================
   SITE-WIDE PASSWORD GATE
   Full-screen overlay — same design language
   as the GenSee community gate.
   ============================================ */

.senpai-site-gate {
  position: fixed;
  inset: 0;
  background: hsl(270 15% 96%);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.3s ease;
}

.senpai-site-gate-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: 16px;
  padding: 44px 36px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 60px hsla(270 30% 5% / 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: senpai-gate-in 0.35s ease;
}

@keyframes senpai-gate-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.senpai-site-gate-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: hsl(var(--primary) / 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
  margin-bottom: 4px;
}

.senpai-site-gate-title {
  font-size: 24px;
  font-weight: 700;
  color: hsl(var(--primary));
  margin: 0;
  text-align: center;
  letter-spacing: -0.01em;
}

.senpai-site-gate-desc {
  font-size: 15px;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin: 0;
  line-height: 1.5;
}

.senpai-site-gate-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.senpai-site-gate-field .senpai-input {
  text-align: center;
  font-size: 16px;
  padding: 12px 16px;
}

.senpai-site-gate-error {
  font-size: 13px;
  color: hsl(0 72% 51%);
  min-height: 18px;
  margin: 0;
  text-align: center;
}

.senpai-site-gate-btn {
  width: 100%;
  padding: 12px 28px;
  font-size: 15px;
  margin-top: 4px;
}

@media (max-width: 440px) {
  .senpai-site-gate-card {
    padding: 32px 22px 26px;
  }
  .senpai-site-gate-title {
    font-size: 22px;
  }
}