/* ── Browse Screen ─────────────────────────────────────────────────── */

/* Filter tabs */
.filter-tabs { display: flex; gap: 4px; padding: 10px 8px 6px }
.ftab {
  flex: 1; padding: 5px 0; border-radius: 7px; font-size: 11px;
  text-align: center; cursor: pointer;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted); transition: all 0.15s; font-family: var(--ff-body);
}
.ftab.active { background: var(--rose-bg); border-color: var(--rose-30); color: var(--rose) }
.ftab:hover:not(.active) { color: var(--cream) }

/* Companion list in browse panel */
.companion-list { flex: 1; overflow-y: auto; padding: 4px 8px }
.companion-list::-webkit-scrollbar { width: 3px }
.companion-list::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

.comp-list-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s; position: relative;
}
.comp-list-item:hover { background: var(--bg3) }
.comp-list-item.active { background: var(--rose-bg) }
.comp-thumb {
  width: 44px; height: 56px; border-radius: 8px; flex-shrink: 0;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-display); font-style: italic; font-size: 16px;
}
.comp-thumb img { width: 100%; height: 100%; object-fit: cover }
.comp-thumb.t1 { background: linear-gradient(160deg, var(--av-comp-dark), var(--av-comp-lighter)) }
.comp-thumb.t2 { background: linear-gradient(160deg, #0f1820, #1f3040) }
.comp-thumb.t3 { background: linear-gradient(160deg, #0f1a0f, #1f3020) }
.comp-thumb.t4 { background: linear-gradient(160deg, #1a1018, #2d2030) }
.comp-thumb.t5 { background: linear-gradient(160deg, #1a0f0f, #301a1a) }
.comp-thumb.t6 { background: linear-gradient(160deg, #181018, #28182a) }
.comp-thumb-letter { color: rgba(240, 232, 224, 0.25); font-size: 18px }
.comp-thumb-badge {
  position: absolute; top: 3px; right: 3px;
  background: linear-gradient(135deg, var(--amber), #d97706);
  border-radius: 4px; padding: 1px 4px;
  font-size: 8px; font-weight: 600; color: #fff;
  letter-spacing: 0.04em; font-family: var(--ff-body);
}
.comp-thumb-anime {
  position: absolute; bottom: 3px; left: 3px;
  background: linear-gradient(135deg, var(--purple-action), #6d28d9);
  border-radius: 4px; padding: 1px 4px;
  font-size: 8px; font-weight: 500; color: #fff; font-family: var(--ff-body);
}
.comp-thumb-status {
  position: absolute; bottom: 3px; right: 3px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,0.4);
  transition: background-color 0.4s ease;
}
.comp-thumb-status.idle { background: #f97316 }
.comp-thumb-status.busy { background: #94252a }
.cl-info { flex: 1; min-width: 0 }
.cl-name { font-size: 13px; font-weight: 400; color: var(--cream) }
.cl-meta { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.cl-match { font-size: 11px; font-weight: 500; margin-top: 3px }
.cl-match.high { color: var(--green) }
.cl-match.good { color: #a3e635 }
.cl-match.mid { color: var(--yellow) }
.cl-match.low { color: var(--rose) }

/* Browse topbar layout */
.browse-topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0 }
.browse-topbar-right { display: flex; align-items: center; gap: 8px }
.topbar-name {
  font-family: var(--ff-display); font-size: 15px; font-weight: 400;
  color: var(--cream); white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 200px;
}
.topbar-match-badge {
  font-size: 11px; font-weight: 500; padding: 2px 8px;
  border-radius: 99px; white-space: nowrap;
}
.topbar-match-badge.high { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border) }
.topbar-match-badge.mid { background: rgba(250, 204, 21, 0.1); color: var(--yellow); border: 1px solid var(--yellow-border) }
.topbar-match-badge.low { background: var(--rose-bg); color: var(--rose); border: 1px solid var(--rose-30) }

/* Sort tabs in sidebar */
.sort-tabs { display: flex; gap: 4px; padding: 0 8px 6px }
.stab {
  flex: 1; padding: 4px 0; border-radius: 6px; font-size: 10px;
  text-align: center; cursor: pointer;
  border: 1px solid var(--border2); background: transparent;
  color: var(--muted2); transition: all 0.15s; font-family: var(--ff-body);
}
.stab.active { background: var(--cream-06); border-color: var(--cream-12); color: var(--dim) }
.stab:hover:not(.active) { color: var(--muted) }

/* Likes pill */
.likes-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 12px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: 99px;
  font-size: 12px; color: var(--muted);
}
.likes-heart { color: var(--rose) }
.likes-val { color: var(--cream); font-weight: 500 }
.likes-bar { width: 48px; height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden }
.likes-fill { height: 100%; background: var(--rose); border-radius: 2px }

/* Card stack area */
.card-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 24px;
}

/* Ghost cards — dynamic: show faded preview of next companions */
.card-ghost {
  position: absolute; border-radius: 20px; overflow: hidden; border: 1px solid var(--border2);
  background-color: var(--bg3); background-size: cover; background-position: center;
  transition: opacity 0.3s, background-image 0.3s;
}
.card-ghost::after {
  content: ''; position: absolute; inset: 0;
  background: var(--black-40); pointer-events: none;
}
.card-ghost-2 { width: 340px; height: 520px; transform: rotate(4deg) translateX(60px) translateY(12px); z-index: 1; opacity: 0.5 }
.card-ghost-1 { width: 350px; height: 530px; transform: rotate(2deg) translateX(30px) translateY(6px); z-index: 2; opacity: 0.75 }
.card-ghost.promoting {
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1),
              opacity 400ms cubic-bezier(0.22, 1, 0.36, 1),
              width 400ms cubic-bezier(0.22, 1, 0.36, 1),
              height 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.card-ghost.no-transition { transition: none !important }
@keyframes cardEntrance {
  from { opacity: 0; transform: scale(0.97) translateX(12px) }
  to   { opacity: 1; transform: scale(1) translateX(0) }
}
.card-entering { animation: cardEntrance 300ms cubic-bezier(0.22, 1, 0.36, 1) both }

/* Flip card */
.card-flip-wrap { width: 360px; height: 540px; perspective: 1200px; position: relative; z-index: 10 }
.comp-card {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
  cursor: grab; box-shadow: 0 24px 48px var(--shadow-lg);
  border-radius: 20px;
}
.comp-card.flipped { transform: rotateY(180deg) }

/* Front face */
.card-front {
  position: absolute; inset: 0;
  backface-visibility: hidden; border-radius: 20px;
  overflow: hidden; background: var(--bg3); border: 1px solid var(--border2);
}
.comp-card-img { width: 100%; height: 100%; position: relative; display: flex; align-items: center; justify-content: center }
.comp-card-bg { position: absolute; inset: 0; background: linear-gradient(160deg, var(--av-comp-dark), var(--av-comp-lighter)) }
.comp-card-bg img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1 }
.comp-card-letter { font-family: var(--ff-display); font-size: 80px; font-style: italic; color: var(--rose-15); position: relative; z-index: 1; user-select: none }

/* Image dots */
.img-dots { position: absolute; top: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 4px; z-index: 20 }
.img-dot { height: 3px; border-radius: 2px; background: rgba(240, 232, 224, 0.3); transition: all 0.2s; cursor: pointer }
.img-dot.active { background: var(--cream); width: 20px }
.img-dot:not(.active) { width: 8px }

/* Badges */
.anime-badge {
  position: absolute; top: 14px; left: 14px;
  background: linear-gradient(135deg, var(--purple-action), #6d28d9);
  border-radius: 7px; padding: 4px 10px;
  font-size: 10px; font-weight: 500; color: #fff;
  z-index: 20; font-family: var(--ff-body);
}

/* Card gradient */
/* Empty state */
.browse-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; width: 100%; z-index: 10;
  padding: 40px 20px; text-align: center;
}
.browse-empty-icon { color: var(--rose-dim); opacity: 0.4; margin-bottom: 24px }
.browse-empty-title {
  font-family: var(--ff-display); font-size: 22px; font-weight: 400;
  color: var(--cream); margin-bottom: 10px;
}
.browse-empty-sub {
  font-size: 13px; color: var(--muted); line-height: 1.6;
  max-width: 320px;
}

.card-gradient {
  position: absolute; bottom: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.45) 50%, transparent 100%);
  z-index: 15; pointer-events: none;
}

.card-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 16px 20px; z-index: 20 }
.card-name-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 1px }
.card-name { font-family: var(--ff-display); font-size: 26px; font-weight: 400; color: var(--cream) }
.card-age { font-size: 15px; color: rgba(255,255,255,0.65); font-family: var(--ff-display) }
.card-job { font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 6px }
.card-bottom-row { display: flex; align-items: center; justify-content: space-between }
.card-match { font-size: 12px; font-weight: 500; color: var(--green) }
.card-fav-pct { font-size: 11px; color: var(--rose-l); opacity: 0.85 }

/* Favorite button */
.fav-btn {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 25; color: var(--cream);
  transition: transform 0.2s, color 0.2s;
}
.fav-btn svg { width: 18px; height: 18px }
.fav-btn:hover { transform: scale(1.15) }
.fav-btn.fav-active { color: var(--rose) }
.card-flip-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 99px;
  background: var(--cream-08); border: 1px solid var(--cream-15);
  color: var(--dim); font-size: 11px; cursor: pointer;
  font-family: var(--ff-body); transition: all 0.15s;
}
.card-flip-btn:hover { background: var(--cream-18); color: var(--cream) }
.card-flip-btn svg { width: 11px; height: 11px }

/* Back face */
.card-back {
  position: absolute; inset: 0;
  backface-visibility: hidden; transform: rotateY(180deg);
  border-radius: 20px; overflow: hidden;
  background: var(--bg3); border: 1px solid var(--border2);
  display: flex; flex-direction: column; padding: 22px;
}
.back-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px }
.back-name { font-family: var(--ff-display); font-size: 22px; font-weight: 400; color: var(--cream) }
.back-age { font-size: 14px; color: var(--muted); font-family: var(--ff-display) }
.back-tagline { font-size: 12px; color: var(--rose-dim); font-style: italic; margin-top: 3px; line-height: 1.5 }
.back-flip-btn {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: all 0.15s; margin-top: 2px;
}
.back-flip-btn:hover { color: var(--cream); border-color: rgba(240, 232, 224, 0.2) }
.back-flip-btn svg { width: 13px; height: 13px }
.back-job { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 14px }
.back-job svg { width: 13px; height: 13px; color: var(--rose-dim); flex-shrink: 0 }
.back-traits { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px }
.back-trait { padding: 4px 10px; border-radius: 99px; font-size: 11px; background: var(--cream-06); color: var(--dim); border: 1px solid var(--cream-08) }
.back-section-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted2); margin-bottom: 8px }
.back-bio { font-size: 12px; color: var(--muted); line-height: 1.7; flex: 1; overflow-y: auto }
.back-bio::-webkit-scrollbar { width: 3px }
.back-bio::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }
.back-match {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--green-bg);
  border: 1px solid var(--green-border); border-radius: 10px; margin-top: 14px;
}
.back-match-pct { font-size: 18px; font-weight: 500; color: var(--green); font-family: var(--ff-display) }
.back-match-text { font-size: 11px; color: var(--muted); line-height: 1.4 }

/* Action buttons */
.card-actions-wrap { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px }
.action-btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; transition: all 0.15s;
}
.action-btn svg { width: 22px; height: 22px }
.action-pass { background: var(--cream-06); border: 1px solid var(--cream-12); color: var(--muted) }
.action-pass:hover { background: var(--cream-08); color: var(--cream) }
.action-like { background: var(--rose); color: #fff; width: 60px; height: 60px }
.action-like:hover { background: var(--rose-hover); transform: scale(1.05) }
.action-super { background: rgba(250, 204, 21, 0.12); border: 1px solid var(--yellow-border); color: var(--yellow) }
.action-super:hover { background: var(--yellow-border) }
.action-back { background: rgba(96, 165, 250, 0.1); border: 1px solid var(--blue-bg); color: var(--blue); width: 38px; height: 38px }
.action-back:disabled { opacity: 0.3; cursor: default; pointer-events: none }
.action-back svg { width: 14px; height: 14px }

/* NOPE/LIKE overlays */
.nope-overlay {
  position: absolute; top: 24px; left: 24px; z-index: 30;
  border: 2px solid var(--red); border-radius: 8px;
  padding: 4px 12px; font-size: 16px; font-weight: 500;
  color: var(--red); letter-spacing: 0.1em; opacity: 0;
  pointer-events: none; transform: rotate(-15deg);
  transition: opacity 0.2s;
}
.like-overlay {
  position: absolute; top: 24px; right: 24px; z-index: 30;
  border: 2px solid var(--green); border-radius: 8px;
  padding: 4px 12px; font-size: 16px; font-weight: 500;
  color: var(--green); letter-spacing: 0.1em; opacity: 0;
  pointer-events: none; transform: rotate(15deg);
  transition: opacity 0.2s;
}

/* Detail panel (right) */
.detail-panel {
  width: 280px; flex-shrink: 0;
  background: var(--panel); border-left: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.detail-panel::-webkit-scrollbar { width: 3px }
.detail-panel::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

/* Profile header card (always visible) */
.detail-profile-header { padding: 16px 14px 14px }
.detail-profile-top { display: flex; align-items: baseline; justify-content: space-between }
.detail-profile-name { font-family: var(--ff-display); font-size: 17px; font-weight: 400; color: var(--cream) }
.detail-profile-age { font-size: 13px; color: var(--muted); font-family: var(--ff-display); margin-left: 6px }
.detail-profile-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-left: 8px }
.detail-profile-status.online { background: var(--green) }
.detail-profile-status.idle { background: #f97316 }
.detail-profile-status.busy { background: #94252a }
.detail-profile-occ { font-size: 12px; color: var(--muted); margin-top: 2px }
.detail-profile-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--muted2); margin-top: 6px;
}
.detail-profile-meta svg { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.7 }
.detail-profile-meta-item { display: flex; align-items: center; gap: 3px }
.detail-profile-tagline {
  font-size: 12px; color: var(--rose-dim); font-style: italic;
  margin-top: 8px; line-height: 1.5;
}

/* Accordion system */
.detail-accordion {
  margin: 0 10px 6px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: 10px;
}
.detail-acc-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer; user-select: none;
  transition: color 0.15s;
}
.detail-acc-header:hover { color: var(--rose) }
.detail-acc-title {
  font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted2); font-weight: 500;
}
.detail-acc-chevron {
  width: 14px; height: 14px; flex-shrink: 0;
  color: var(--muted); transition: transform 0.25s ease;
}
.detail-accordion.open .detail-acc-chevron { transform: rotate(180deg) }
.detail-acc-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 14px;
}
.detail-accordion.open .detail-acc-body {
  max-height: 1200px; padding: 0 14px 14px;
}

/* Accordion preview (shown when collapsed) */
.detail-acc-preview {
  padding: 0 14px 10px; font-size: 11px; color: var(--muted);
  line-height: 1.5; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.detail-accordion.open .detail-acc-preview { display: none }

/* Match section */
.detail-match-big { text-align: center; padding: 6px 0 14px }
.match-circle {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--green-border); background: var(--green-bg);
}
.match-pct { font-family: var(--ff-display); font-size: 22px; font-weight: 300; color: var(--green) }
.match-label { font-size: 11px; color: var(--muted) }
.match-factors { display: flex; flex-direction: column; gap: 6px; margin-top: 10px }
.match-factor { display: flex; align-items: center; gap: 8px }
.mf-label { font-size: 11px; color: var(--muted); width: 80px; flex-shrink: 0 }
.mf-bar { flex: 1; height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden }
.mf-fill { height: 100%; border-radius: 2px }
.mf-fill.high { background: var(--green) }
.mf-fill.mid { background: var(--yellow) }
.mf-fill.rose { background: var(--rose) }
.mf-val { font-size: 10px; color: var(--muted2); width: 24px; text-align: right; flex-shrink: 0 }

/* Traits & tags */
.trait-cloud { display: flex; flex-wrap: wrap; gap: 5px }
.trait-pill {
  padding: 4px 9px; border-radius: 99px; font-size: 11px;
  background: var(--bg3); color: var(--muted); border: 1px solid var(--border2);
}
.tag-group-label {
  font-size: 10px; color: var(--muted2); text-transform: uppercase;
  letter-spacing: 0.06em; margin-top: 10px; margin-bottom: 4px;
}
.tag-group-label:first-child { margin-top: 0 }

/* About body */
.detail-about-text { font-size: 12px; color: var(--muted); line-height: 1.7 }

/* Match no-quiz hint */
.match-no-quiz {
  text-align: center; padding: 10px 0;
  font-size: 12px; color: var(--muted); line-height: 1.5;
}

/* Lifestyle rows */
.detail-lifestyle-item { padding: 6px 0 }
.detail-lifestyle-item + .detail-lifestyle-item { border-top: 1px solid var(--border2) }
.detail-lifestyle-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--dim); margin-bottom: 4px;
}
.detail-lifestyle-text { font-size: 12px; color: var(--muted); line-height: 1.6 }

/* Conversation starters */
.detail-hooks-list { display: flex; flex-direction: column; gap: 6px }
.detail-hook-item {
  font-size: 12px; color: var(--cream); line-height: 1.5;
  padding: 6px 10px; background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px;
}
.detail-quirks { margin-top: 10px }
.detail-quirks-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--dim); margin-bottom: 6px;
}

/* Popularity grid (2x2) */
.detail-pop-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.detail-pop-cell {
  padding: 8px 6px; text-align: center;
}
.detail-pop-cell:nth-child(odd) { border-right: 1px solid var(--border2) }
.detail-pop-cell:nth-child(-n+2) { border-bottom: 1px solid var(--border2) }
.detail-pop-val { font-size: 15px; font-weight: 500; color: var(--cream); font-family: var(--ff-display) }
.detail-pop-label { font-size: 9px; color: var(--muted); margin-top: 2px }

/* Extras section */
.detail-extras-list { display: flex; flex-direction: column; gap: 6px }
.detail-extras-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px;
}
.detail-extras-key { color: var(--muted) }
.detail-extras-val { color: var(--cream) }
.detail-extras-val.purple { color: var(--purple-action) }
.detail-extras-val.green { color: var(--green) }
.detail-extras-val.amber { color: var(--amber) }
