/* v14.979 - per-user Reviews page. Native phone layout is the source of truth. */
body.shelfd-reviews-page-open {
  overflow: hidden !important;
  touch-action: none;
}

.shelfd-reviews-page {
  --reviews-bg: #0d0d0d;
  --reviews-card: #181818;
  --reviews-line: rgba(255,255,255,0.10);
  --reviews-muted: rgba(255,255,255,0.68);
  --reviews-edge: 9px;
  position: fixed;
  inset: 0;
  z-index: 7100;
  display: block;
  overflow: hidden;
  background: var(--reviews-bg);
  color: #fff;
  font-family: 'Sohne', 'DM Sans', sans-serif;
  transform: translate3d(100%,0,0);
  transition: transform 300ms cubic-bezier(.22,1,.36,1);
  will-change: transform;
  backface-visibility: hidden;
  contain: layout paint style;
  overscroll-behavior: none;
}

.shelfd-reviews-page.is-open {
  transform: translate3d(0,0,0);
}

.shelfd-reviews-page-shell {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--reviews-bg);
}

.shelfd-reviews-header {
  position: relative;
  flex: 0 0 auto;
  min-height: calc(clamp(60px, 14.6vw, 66px) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(var(--reviews-edge), env(safe-area-inset-right, 0px)) 0 max(var(--reviews-edge), env(safe-area-inset-left, 0px));
  display: grid;
  grid-template-columns: clamp(70px, 19vw, 84px) 1fr clamp(70px, 19vw, 84px);
  align-items: center;
  border-bottom: 1px solid var(--reviews-line);
  background: var(--reviews-bg);
}

.shelfd-reviews-header h1 {
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: clamp(calc(19 * var(--shelfd-px, 1px)), 4.8vw, calc(21 * var(--shelfd-px, 1px)));
  line-height: 1;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-align: center;
}

.shelfd-reviews-back {
  appearance: none;
  -webkit-appearance: none;
  width: clamp(40px, 10vw, 44px);
  height: clamp(40px, 10vw, 44px);
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shelfd-reviews-back svg {
  width: clamp(24px, 6.1vw, 27px);
  height: clamp(24px, 6.1vw, 27px);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shelfd-reviews-count {
  justify-self: end;
  color: rgba(255,255,255,0.56);
  font-size: clamp(calc(11 * var(--shelfd-px, 1px)), 2.8vw, calc(12 * var(--shelfd-px, 1px)));
  font-weight: 500;
  white-space: nowrap;
}

.shelfd-reviews-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(14px, 4vw, 20px) max(var(--reviews-edge), env(safe-area-inset-right, 0px)) calc(clamp(28px, 7vw, 36px) + env(safe-area-inset-bottom, 0px)) max(var(--reviews-edge), env(safe-area-inset-left, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: none;
}

.shelfd-reviews-content::-webkit-scrollbar,
.shelfd-reviews-tabs::-webkit-scrollbar {
  display: none;
}

.shelfd-reviews-owner {
  min-width: 0;
  margin: 0 0 clamp(14px, 3.7vw, 17px);
  display: flex;
  align-items: center;
  gap: clamp(9px, 2.4vw, 11px);
}

.shelfd-reviews-owner img {
  width: clamp(36px, 9.3vw, 42px);
  height: clamp(36px, 9.3vw, 42px);
  flex: 0 0 clamp(36px, 9.3vw, 42px);
  border-radius: 50%;
  object-fit: cover;
  background: #181818;
}

.shelfd-reviews-owner > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shelfd-reviews-owner strong {
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font-size: clamp(calc(14 * var(--shelfd-px, 1px)), 3.65vw, calc(16 * var(--shelfd-px, 1px)));
  line-height: 1.25;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shelfd-reviews-owner small {
  max-width: 100%;
  overflow: hidden;
  color: rgba(255,255,255,0.68);
  font-size: clamp(calc(11 * var(--shelfd-px, 1px)), 2.85vw, calc(13 * var(--shelfd-px, 1px)));
  line-height: 1.2;
  font-weight: 450;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shelfd-reviews-search {
  width: 100%;
  height: clamp(44px, 11.3vw, 50px);
  padding: 0 clamp(12px, 3.2vw, 15px);
  display: flex;
  align-items: center;
  gap: clamp(9px, 2.5vw, 12px);
  border: 1px solid #30293f;
  border-radius: clamp(22px, 5.8vw, 25px);
  background: #171717;
  color: #fff;
}

.shelfd-reviews-search > svg {
  width: clamp(18px, 4.5vw, 20px);
  height: clamp(18px, 4.5vw, 20px);
  flex: 0 0 clamp(18px, 4.5vw, 20px);
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shelfd-reviews-search input {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  caret-color: #fff;
  font-family: inherit;
  font-size: clamp(calc(14 * var(--shelfd-px, 1px)), 3.65vw, calc(16 * var(--shelfd-px, 1px)));
  font-weight: 500;
}

.shelfd-reviews-search input::placeholder {
  color: rgba(255,255,255,0.60);
  opacity: 1;
}

.shelfd-reviews-search input::-webkit-search-cancel-button {
  display: none;
}

.shelfd-reviews-search button {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-family: inherit;
  font-size: calc(20 * var(--shelfd-px, 1px));
  line-height: 1;
}

.shelfd-reviews-search button[hidden] {
  display: none;
}

.shelfd-reviews-tabs {
  width: 100%;
  margin: clamp(13px, 3.5vw, 16px) 0 clamp(14px, 3.7vw, 17px);
  padding: 0 0 2px;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.8vw, 8px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.shelfd-reviews-tab {
  appearance: none;
  -webkit-appearance: none;
  min-width: max-content;
  height: clamp(32px, 8.2vw, 36px);
  padding: 0 clamp(11px, 2.9vw, 14px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.35vw, 6px);
  scroll-snap-align: start;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 999px;
  background: #181818;
  color: rgba(255,255,255,0.68);
  font-family: inherit;
  font-size: clamp(calc(12 * var(--shelfd-px, 1px)), 3.05vw, calc(13 * var(--shelfd-px, 1px)));
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.shelfd-reviews-tab span {
  color: inherit;
  font-size: clamp(calc(9 * var(--shelfd-px, 1px)), 2.3vw, calc(10 * var(--shelfd-px, 1px)));
  opacity: .72;
}

.shelfd-reviews-tab.is-active {
  border-color: #9d6cff;
  background: #241b34;
  color: #fff;
}

.shelfd-reviews-results {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: clamp(10px, 2.7vw, 13px);
}

.shelfd-reviews-card {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: clamp(140px, 35vw, 156px);
  padding: clamp(10px, 2.7vw, 12px) clamp(32px, 8.6vw, 38px) clamp(10px, 2.7vw, 12px) clamp(10px, 2.7vw, 12px);
  display: grid;
  grid-template-columns: clamp(80px, 20.8vw, 96px) minmax(0,1fr);
  align-items: stretch;
  gap: clamp(11px, 2.9vw, 14px);
  overflow: hidden;
  border: 0;
  border-radius: clamp(15px, 3.9vw, 18px);
  background: var(--reviews-card);
  color: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.shelfd-reviews-card:active {
  background: #202020;
  transform: scale(.995);
}

.shelfd-reviews-card-cover {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  width: 100%;
  min-height: clamp(120px, 29vw, 132px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: clamp(9px, 2.3vw, 11px);
  background-color: #242127;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: rgba(255,255,255,0.46);
  font-size: clamp(calc(27 * var(--shelfd-px, 1px)), 7vw, calc(32 * var(--shelfd-px, 1px)));
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Media profiles normally sit below the Reviews/Full Review overlays. Raise
   only profiles launched while either review surface is active so Back returns
   to the exact review context underneath. */
body:is(.shelfd-reviews-page-open, .mylist-media-review-open) .discover-media-profile-overlay,
body:is(.shelfd-reviews-page-open, .mylist-media-review-open) .game-media-profile-overlay,
body:is(.shelfd-reviews-page-open, .mylist-media-review-open) .music-album-profile-page {
  z-index: 7600 !important;
}

/* v14.982: album artwork keeps its native square silhouette. Movie, TV and
   anime artwork remains poster-shaped; all four requested media types use the
   same exact four-corner radius. Game covers retain their existing treatment. */
.shelfd-reviews-card[data-review-section="music"] .shelfd-reviews-card-cover {
  aspect-ratio: 1 / 1;
  min-height: 0;
  align-self: start;
  border-radius: 3.6px;
}

.shelfd-reviews-card:is(
  [data-review-section="movies"],
  [data-review-section="shows"],
  [data-review-section="anime"]
) .shelfd-reviews-card-cover {
  border-radius: 3.6px;
}

.shelfd-reviews-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.shelfd-reviews-card-topline {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.6vw, 8px);
}

.shelfd-reviews-card-topline strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(calc(15 * var(--shelfd-px, 1px)), 3.8vw, calc(17 * var(--shelfd-px, 1px)));
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -.012em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shelfd-reviews-private-pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #2a2135;
  color: #e2acf1;
  font-size: calc(9 * var(--shelfd-px, 1px));
  line-height: 1;
  font-weight: 600;
}

.shelfd-reviews-card-artist {
  width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: rgba(255,255,255,0.74);
  font-size: clamp(calc(11 * var(--shelfd-px, 1px)), 2.8vw, calc(12 * var(--shelfd-px, 1px)));
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shelfd-reviews-card-meta {
  width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: rgba(255,255,255,0.56);
  font-size: clamp(calc(10 * var(--shelfd-px, 1px)), 2.55vw, calc(11 * var(--shelfd-px, 1px)));
  line-height: 1.25;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shelfd-reviews-card-copy {
  width: 100%;
  margin-top: 8px;
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255,255,255,0.84);
  font-size: clamp(calc(12 * var(--shelfd-px, 1px)), 3.05vw, calc(14 * var(--shelfd-px, 1px)));
  line-height: 1.35;
  font-weight: 500;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.shelfd-reviews-card-tags {
  width: 100%;
  margin-top: 8px;
  display: flex;
  gap: 5px;
  overflow: hidden;
}

.shelfd-reviews-card-tags span {
  max-width: 96px;
  padding: 3px 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.62);
  font-size: calc(9 * var(--shelfd-px, 1px));
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.shelfd-reviews-card-rating {
  margin-top: auto;
  padding-top: 9px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: clamp(calc(11 * var(--shelfd-px, 1px)), 2.8vw, calc(13 * var(--shelfd-px, 1px)));
  line-height: 1;
  font-weight: 600;
}

.shelfd-reviews-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}

.shelfd-reviews-rating-star {
  position: relative;
  display: inline-block;
  color: #f3cf66;
  font-size: 1em;
  line-height: 1;
}

.shelfd-reviews-rating-star.is-half {
  color: rgba(255,255,255,0.20);
}

.shelfd-reviews-rating-star.is-half::before {
  content: "★";
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  overflow: hidden;
  color: #f3cf66;
}

.shelfd-reviews-rating-label {
  color: #fff;
}

.shelfd-reviews-card-chevron {
  position: absolute;
  top: 50%;
  right: clamp(10px, 2.7vw, 13px);
  width: clamp(16px, 4.1vw, 18px);
  height: clamp(16px, 4.1vw, 18px);
  transform: translateY(-50%);
  fill: none;
  stroke: rgba(255,255,255,0.38);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shelfd-reviews-status {
  min-height: 270px;
  padding: 38px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,0.62);
  text-align: center;
}

.shelfd-reviews-status strong {
  color: #e2acf1;
  font-size: calc(16 * var(--shelfd-px, 1px));
  font-weight: 600;
}

.shelfd-reviews-status > span:not(.shelfd-reviews-spinner):not(.shelfd-reviews-empty-icon) {
  max-width: 300px;
  color: rgba(255,255,255,0.70);
  font-size: calc(14 * var(--shelfd-px, 1px));
  line-height: 1.4;
}

.shelfd-reviews-spinner {
  width: 23px;
  height: 23px;
  margin-bottom: 4px;
  border: 2px solid rgba(255,255,255,0.16);
  border-top-color: #e2acf1;
  border-radius: 50%;
  animation: shelfd-reviews-spin .72s linear infinite;
}

.shelfd-reviews-empty-icon {
  margin-bottom: 2px;
  color: rgba(226,172,241,.78);
  font-size: calc(32 * var(--shelfd-px, 1px));
  line-height: 1;
}

@keyframes shelfd-reviews-spin { to { transform: rotate(360deg); } }

/* Shelf action-row entry points. */
body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-reviews-btn {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 0 18px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.16) !important;
  background: rgba(255,255,255,0.08) !important;
  color: #fff !important;
  box-shadow: none !important;
  font-family: 'Sohne','DM Sans',sans-serif !important;
  font-size: calc(13 * var(--shelfd-px, 1px)) !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-reviews-btn:disabled {
  opacity: .48 !important;
  cursor: default !important;
}

body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions.is-search-open .friend-list-reviews-btn {
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  flex-basis: 0 !important;
  padding: 0 !important;
  border-width: 0 !important;
  overflow: hidden !important;
}

@media (max-width: 440px) {
  body.main-tab-mylist #mylist-view .shelf-profile-actions {
    gap: 5px;
  }

  body.main-tab-mylist #mylist-view .shelf-action-pill {
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    font-size: calc(12 * var(--shelfd-px, 1px));
  }

  body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-sort-btn,
  body.main-tab-mylist:not(.viewing-other-user) #mylist-profile-controls .shelf-profile-actions #shelf-profile-search-btn {
    width: 34px !important;
    min-width: 34px !important;
    height: 32px !important;
    min-height: 32px !important;
  }

  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions {
    gap: 4px !important;
  }

  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-reviews-btn {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: calc(12 * var(--shelfd-px, 1px)) !important;
  }

  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-sort-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-search-btn {
    width: 34px !important;
    min-width: 34px !important;
    flex-basis: 34px !important;
    height: 32px !important;
    min-height: 32px !important;
  }
}

@media (max-width: 380px) {
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .viewing-banner-actions .friend-list-follow-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-viewprofile-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-dm-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-list-reviews-btn {
    padding-right: 8px !important;
    padding-left: 8px !important;
    font-size: calc(11 * var(--shelfd-px, 1px)) !important;
  }

  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-sort-btn,
  body.viewing-other-user #viewing-banner-area .friend-list-viewing-banner .friend-shelf-search-btn {
    width: 32px !important;
    min-width: 32px !important;
    flex-basis: 32px !important;
  }
}

@media (min-width: 760px) {
  .shelfd-reviews-header {
    padding-left: max(calc((100vw - 760px)/2 + var(--reviews-edge)), var(--reviews-edge));
    padding-right: max(calc((100vw - 760px)/2 + var(--reviews-edge)), var(--reviews-edge));
  }

  .shelfd-reviews-content {
    padding-top: 22px;
    padding-left: var(--reviews-edge);
    padding-right: var(--reviews-edge);
  }
}

@media (prefers-reduced-motion: reduce) {
  .shelfd-reviews-page {
    transition-duration: 1ms;
  }
  .shelfd-reviews-spinner {
    animation-duration: 1.5s;
  }
}
