/* ============ RESET & VARS ============ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

/* DARK THEME (default) */
body[data-theme="dark"] {
  --bg: #0d0d18;
  --bg-elev: #16162a;
  --bg-elev-2: #1e1e36;
  --primary: #7b2fff;
  --primary-soft: rgba(123, 47, 255, 0.15);
  --text: #f0f0f8;
  --text-mute: #8a8aa3;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ff4d6d;
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
  background: var(--bg);
  color: var(--text);
}

/* LIGHT THEME */
body[data-theme="light"] {
  --bg: #f0f0f8;
  --bg-elev: #ffffff;
  --bg-elev-2: #ffffff;
  --primary: #7b72ff;
  --primary-soft: rgba(123, 114, 255, 0.15);
  --text: #1a1a2e;
  --text-mute: #6c6c80;
  --border: rgba(0, 0, 0, 0.08);
  --danger: #ff4d6d;
  --shadow: 0 6px 20px rgba(123, 114, 255, 0.12);
  background: var(--bg);
  color: var(--text);
}

/* ============ APP SHELL ============ */
#app {
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 10;
}
.topbar-title { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.topbar-action.hidden { display: none; }

.content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.tab-panel { display: none; padding: 16px; min-height: 100%; }
.tab-panel.active { display: block; }

#tab-explorar.active,
#tab-adicionar.active { display: flex; flex-direction: column; padding: 16px; }

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 64px;
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-mute);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  font-size: 11px;
  padding: 6px 0;
  transition: color .2s;
}
.nav-btn.active { color: var(--primary); }
.nav-btn.add-tab { position: relative; }
.add-circle {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 6px 16px var(--primary-soft);
  margin-top: -16px;
}

/* ============ EXPLORAR â CARD STACK ============ */
.card-stack {
  position: relative;
  flex: 1;
  min-height: 460px;
  margin-bottom: 16px;
}
.book-card {
  position: absolute;
  inset: 0;
  background: var(--bg-elev);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  user-select: none;
  cursor: grab;
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, opacity .3s ease;
}
.book-card.dragging { transition: none; cursor: grabbing; }
.book-card.swipe-left { transform: translateX(-150%) rotate(-20deg) !important; opacity: 0; }
.book-card.swipe-right { transform: translateX(150%) rotate(20deg) !important; opacity: 0; }

.card-cover {
  flex: 1;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-elev-2);
  position: relative;
  min-height: 300px;
}
.card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
}
.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px;
  color: #fff;
  z-index: 2;
}
.card-info h3 { font-size: 22px; margin-bottom: 4px; }
.card-info .author { font-size: 14px; opacity: 0.9; margin-bottom: 10px; }
.card-info .user-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.card-info .user-row .dot { opacity: 0.6; }
.card-info .user-row svg { opacity: 0.9; }

.card-stamp {
  position: absolute;
  top: 30px;
  font-size: 32px;
  font-weight: 900;
  padding: 6px 16px;
  border: 4px solid;
  border-radius: 8px;
  letter-spacing: 1px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 3;
}
.card-stamp.plot { right: 24px; border-color: var(--primary); color: var(--primary); transform: rotate(15deg); }
.card-stamp.nope { left: 24px; border-color: var(--danger); color: var(--danger); transform: rotate(-15deg); }

.explore-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding-bottom: 8px;
}
.action-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
  border: 1px solid var(--border);
}
.action-btn:active { transform: scale(0.92); }
.action-btn.dislike { color: var(--danger); }
.action-btn.like { color: var(--primary); }

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-mute);
}
.empty-state.hidden { display: none; }
.empty-state p { margin-bottom: 20px; }

/* ============ PLOT TAB ============ */
.segmented {
  display: flex;
  background: var(--bg-elev);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.seg-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  border-radius: 9px;
  color: var(--text-mute);
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.seg-btn.active { background: var(--primary); color: #fff; }
.badge {
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
.seg-btn.active .badge { background: rgba(255,255,255,0.25); }

.seg-content { display: none; }
.seg-content.active { display: block; }

.matches-list { display: flex; flex-direction: column; gap: 12px; }
.match-item {
  display: flex;
  background: var(--bg-elev);
  border-radius: 14px;
  padding: 12px;
  gap: 12px;
  border: 1px solid var(--border);
  align-items: center;
}
.match-covers {
  display: flex;
  position: relative;
  width: 70px;
  height: 70px;
  flex-shrink: 0;
}
.match-covers .mini-cover {
  width: 50px; height: 70px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  position: absolute;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.match-covers .mini-cover:first-child { left: 0; transform: rotate(-8deg); }
.match-covers .mini-cover:last-child { right: 0; transform: rotate(8deg); }
.match-text { flex: 1; min-width: 0; }
.match-text h4 { font-size: 15px; margin-bottom: 4px; }
.match-text p { font-size: 13px; color: var(--text-mute); }

.likes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.like-card {
  background: var(--bg-elev);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}
.like-card .like-cover {
  width: 100%;
  aspect-ratio: 3/4;
  background-size: cover;
  background-position: center;
  filter: blur(6px);
}
.like-card .like-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent 60%);
  display: flex; align-items: flex-end; padding: 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.like-card .lock-icon {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  opacity: 0.9;
}
.empty-list {
  text-align: center; padding: 40px 20px; color: var(--text-mute);
}

/* ============ ADICIONAR TAB ============ */
.scanner-view {
  background: #000;
  border-radius: 16px;
  aspect-ratio: 3/4;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 16px;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(123,47,255,0.15), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(123,47,255,0.08), transparent 50%),
    linear-gradient(135deg, #0a0a14, #1a1a2e);
}
.scanner-frame {
  position: relative;
  width: 75%;
  height: 35%;
  border-radius: 8px;
}
.scanner-corner {
  position: absolute;
  width: 28px; height: 28px;
  border: 3px solid var(--primary);
}
.scanner-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.scanner-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.scanner-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.scanner-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.scanner-laser {
  position: absolute;
  left: 8%; right: 8%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 12px var(--primary);
  top: 50%;
  animation: scan 2.2s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { top: 10%; }
  50% { top: 90%; }
}
.scanner-hint {
  color: #fff;
  margin-top: 24px;
  font-size: 13px;
  opacity: 0.8;
}
.btn-simulate {
  margin-top: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 22px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}

.add-options {
  display: flex; flex-direction: column; gap: 10px;
}

/* ---- CÃ¢mera para foto da capa ---- */
.cover-cam-view {
  aspect-ratio: 3/4;
  justify-content: flex-start;
  padding: 16px;
}
.cover-cam-view .cover-frame {
  position: relative;
  width: 60%;
  aspect-ratio: 2/3;
  margin: auto;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35) inset;
}
.cover-cam-view .scanner-hint {
  margin-top: 12px;
  margin-bottom: 14px;
}
.cam-back {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 3;
}
.cam-shutter {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid #fff;
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .12s ease;
}
.cam-shutter:active { transform: scale(0.92); }
.cam-shutter-inner {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: #fff;
}
.cover-cam-fallback {
  margin-top: 0;
  background: rgba(255,255,255,0.12);
}
.hidden { display: none !important; }

/* ============ COMUNIDADE ============ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  color: var(--text-mute);
}
.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
}

.genre-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.genre-chips::-webkit-scrollbar { display: none; }
.chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.write-review {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
  width: 100%;
  justify-content: center;
}

.reviews-list { display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.review-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.review-top {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px;
}
.review-book h4 { font-size: 15px; }
.review-book .ra { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.review-stars { color: #ffb84d; font-size: 14px; letter-spacing: 1px; }
.review-stars .empty { color: var(--text-mute); opacity: 0.4; }
.review-user {
  font-size: 12px; color: var(--text-mute); margin-bottom: 8px;
}
.review-text { font-size: 14px; line-height: 1.5; margin-bottom: 10px; }
.review-actions {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-mute);
  font-size: 13px;
}
.like-pen {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mute);
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}
.like-pen.liked { color: var(--primary); }
.like-pen.liked svg { fill: var(--primary-soft); }
.review-genre {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 8px;
  font-weight: 600;
}

/* ============ PERFIL ============ */
.profile-header {
  display: flex;
  gap: 16px;
  background: var(--bg-elev);
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #4a1aa0);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.profile-name-row h2 { font-size: 18px; }
.profile-location {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-mute);
  margin-bottom: 12px;
}
.profile-stats { display: flex; gap: 24px; }
.profile-stats > div { display: flex; flex-direction: column; }
.profile-stats strong { font-size: 18px; font-weight: 700; }
.profile-stats span { font-size: 12px; color: var(--text-mute); }

.section-title { font-size: 16px; margin-bottom: 12px; }

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding-bottom: 20px;
}
.shelf-item {
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative;
  cursor: pointer;
}
.shelf-item .shelf-name {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent 50%);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  padding: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.shelf-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: var(--text-mute);
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ============ BUTTONS ============ */
.icon-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--bg-elev-2); }
.icon-btn.small { padding: 4px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary.full { width: 100%; margin-top: 8px; }

.btn-secondary {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal.active { display: flex; animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--bg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 20px 20px 0 0;
  padding: 18px;
  overflow-y: auto;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 { font-size: 18px; }

#bookForm label,
#reviewForm label,
#editProfileForm label {
  display: block;
  font-size: 13px;
  color: var(--text-mute);
  margin: 12px 0 6px;
  font-weight: 600;
}
#bookForm input,
#bookForm textarea,
#bookForm select,
#reviewForm input,
#reviewForm textarea,
#reviewForm select,
#editProfileForm input {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
#bookForm textarea, #reviewForm textarea { resize: vertical; }

.cover-upload { margin-bottom: 8px; }
.cover-preview {
  aspect-ratio: 3/4;
  max-width: 160px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-mute);
  font-size: 12px;
  cursor: pointer;
  background-size: cover;
  background-position: center;
}
.cover-preview.has-img { border: none; }
.cover-preview.has-img svg, .cover-preview.has-img span { display: none; }

.star-input { display: flex; gap: 6px; font-size: 32px; color: var(--text-mute); }
.star-input span { cursor: pointer; transition: color .15s; }
.star-input span.active { color: #ffb84d; }

/* MATCH MODAL */
.match-content {
  background: linear-gradient(135deg, var(--primary), #4a1aa0);
  color: #fff;
  width: 90%;
  max-width: 360px;
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  margin: auto;
  animation: pop .35s cubic-bezier(.18,1.18,.5,1);
}
.modal.active .match-content { animation: pop .35s cubic-bezier(.18,1.18,.5,1); }
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.match-title { font-size: 32px; margin-bottom: 8px; font-weight: 800; }
.match-sub { opacity: 0.9; margin-bottom: 20px; font-size: 14px; }
.match-books { display: flex; justify-content: center; gap: 14px; margin-bottom: 24px; }
.match-books .mb {
  width: 80px; height: 115px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.match-content .btn-primary { background: #fff; color: var(--primary); }

/* MODAL DE MATCH PRECISA CENTRALIZAR */
#matchModal.active { align-items: center; }

/* SETTINGS */
.settings-section { margin-bottom: 24px; }
.settings-section h4 { font-size: 14px; color: var(--text-mute); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.theme-toggle { display: flex; gap: 10px; }
.theme-opt {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px;
}
.theme-opt.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.about-text { font-size: 14px; line-height: 1.5; color: var(--text-mute); margin-bottom: 8px; }
.about-meta { font-size: 12px; color: var(--text-mute); opacity: 0.7; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== MODAL: PERFIL DO CURTIDOR ===== */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.user-profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-profile-info h4 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--text);
}
.user-profile-info p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.user-profile-note {
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}
.user-profile-shelf {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.shelf-book-card {
  background: var(--surface-2);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  border: 2px solid transparent;
}
.shelf-book-card:hover,
.shelf-book-card:active {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(123, 47, 255, 0.25);
}
.shelf-book-card .sb-cover {
  width: 100%;
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
}
.shelf-book-card .sb-info {
  padding: 8px 10px 10px;
}
.shelf-book-card .sb-info h6 {
  margin: 0 0 2px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shelf-book-card .sb-info p {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== MODAL: DETALHES DO LIVRO ===== */
.book-detail-content { max-height: 88vh; }
.book-detail-head {
  display: flex;
  gap: 14px;
  margin-bottom: 16px;
}
.book-detail-cover {
  width: 110px;
  height: 165px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}
.book-detail-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.book-detail-meta h4 {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}
.book-detail-genre {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 10px;
  width: fit-content;
}
.book-detail-owner {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.book-detail-section-title {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.book-detail-synopsis {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.book-detail-reviews {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bd-review {
  background: var(--surface-2);
  padding: 12px;
  border-radius: 10px;
}
.bd-review-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.bd-review-user {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}
.bd-review-stars {
  color: #f5b50a;
  font-size: 13px;
}
.bd-review-text {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}
.bd-review-likes {
  font-size: 11px;
  color: var(--text-muted);
}
.bd-no-reviews {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 16px;
}

/* Aprimoramentos no card de curtida da aba Plot */
.like-card {
  cursor: pointer;
}
.like-user-info {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  padding: 6px 8px;
  border-radius: 8px;
  z-index: 2;
}
.like-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.like-user-text {
  flex: 1;
  min-width: 0;
}
.like-user-text .lu-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.like-user-text .lu-dist {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,0.75);
}
/* Sobrescreve: agora o card de curtida revela o usuÃ¡rio, sem lock */
.like-card .lock-icon { display: none; }
.like-card .like-overlay {
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

/* Card de explorar: indicar que Ã© clicÃ¡vel */
.book-card .card-info { cursor: pointer; }
