.signature-art {
  position: fixed;
  top: 250px;
  right: -230px;
  width: 690px;
  height: 318px;
  background-image: url('/static/images/ui/signature.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: blur(5px);
  pointer-events: none;
  transform: rotate(-90deg);
}

.main-content {
  margin-top: 110px;
}

.original-section {
  position: relative;
  overflow: visible;
  background-image: url('/static/images/ui/Origical_background_img.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  padding: 20px 0 30px;
}

.original-section::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -120px;
  bottom: -120px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.55) 30%,
    rgba(0, 0, 0, 0.8) 75%,
    rgba(0, 0, 0, 0) 87%
  );
  z-index: 0;
  pointer-events: none;
}

.original-section > * {
  position: relative;
  z-index: 1;
}

.ranking-empty {
  padding: 40px 20px;
  text-align: center;
  color: #999;
}

/* ===== PWA 설치 ===== */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid #4a4a4f;
  border-radius: 999px;
  color: #d8d8dc;
  font-size: 12px;
  cursor: pointer;
  margin-right: 4px;
}

.pwa-install-btn svg { display: block; }

/* 설치 프롬프트 준비되면 포인트 색으로 강조 */
.pwa-install-btn.pwa-ready {
  border-color: #FFA178;
  color: #FFA178;
}

.pwa-guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pwa-guide-overlay.show { opacity: 1; pointer-events: auto; }

.pwa-guide {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(105%);
  width: 100%;
  max-width: 37.5rem;
  background: #29292c;
  border: 1px solid #3a3a3e;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  z-index: 2100;
  transition: transform 0.28s ease;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}

.pwa-guide.show { transform: translateX(-50%) translateY(0); }

.pwa-guide-handle {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #4a4a4f;
  margin: 6px auto 16px;
}

.pwa-guide-title {
  display: block;
  font-size: 17px;
  color: #f2f2f2;
  margin-bottom: 10px;
}

.pwa-guide-body {
  font-size: 14px;
  color: #d8d8dc;
  line-height: 1.7;
  margin: 0 0 18px;
}

.pwa-guide-close {
  width: 100%;
  padding: 13px;
  background: #FFA178;
  color: #1a1a1a;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}

/* ===== 햄버거 메뉴 ===== */
.nav-menu-btn {
  background: transparent;
  border: none;
  padding: 5px 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.menu-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.menu-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: max(0px, calc(50% - 18.75rem));
  width: 280px;
  max-width: 82vw;
  background: #29292c;
  border-left: 1px solid #3a3a3e;
  z-index: 1600;
  transform: translateX(105%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.menu-drawer.show {
  transform: translateX(0);
}

.menu-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.menu-drawer-title {
  font-size: 17px;
  color: #f2f2f2;
}

.menu-close-btn {
  background: transparent;
  border: none;
  color: #a8a8ad;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.menu-close-btn:hover {
  background: #333336;
  color: #f2f2f2;
}

.menu-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #333336;
  border: 1px solid #3a3a3e;
  border-radius: 4px;
  text-decoration: none;
  margin-bottom: 16px;
}

.menu-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  object-fit: cover;
  background: #222;
}

.menu-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-user-name {
  color: #f2f2f2;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-user-sub {
  color: #a8a8ad;
  font-size: 12px;
}

.menu-user-coin {
  color: #FFA178;
  font-size: 13px;
  white-space: nowrap;
}

.menu-login-btn {
  display: block;
  text-align: center;
  padding: 13px;
  background: #FFA178;
  color: #1a1a1a;
  border-radius: 4px;
  text-decoration: none;
  font-size: 15px;
  margin-bottom: 16px;
}

.menu-links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #3a3a3e;
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 4px;
  color: #d8d8dc;
  font-size: 15px;
  text-decoration: none;
  background: transparent;
  border: none;
  border-bottom: 1px solid #3a3a3e;
  cursor: pointer;
}

.menu-item:hover {
  color: #FFA178;
}

.menu-logout {
  margin-top: auto;
  border-bottom: none;
  border-top: 1px solid #3a3a3e;
  color: #e5484d;
}

/* ===== 카테고리 탭 ===== */
.category-page {
  padding: 0 0 90px;
}

/* 카테고리 배너 (사진처럼 칩 버튼을 배너 안에 포함) */
.category-banner {
  position: relative;
  width: 100%;
  color: #ffffff;
  font-size: 34px;
  padding: 10px 20px 18px;
  white-space: nowrap;
  overflow: hidden;
}

.category-banner-rect {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #B24A4780 0%, #FFA17880 45%, #99614820 100%);
}

.category-banner-rect::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/static/images/ui/Banner_signature_shadow.svg");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: auto 100%;
  pointer-events: none;
}

.category-banner-title {
  position: relative;
  z-index: 1;
}

.category-banner .tr {
  position: relative;
  display: inline-block;
}

.category-banner .rect {
  background: #ffffff;
  width: 100%;
  height: 4px;
  position: absolute;
  left: 0;
  top: 44%;
}

/* 칩 필터: 배너 안, 가로 스크롤 행 */
.category-chip-rows {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  margin-right: -20px; /* 배너 오른쪽 패딩만큼 상쇄해 화면 끝까지 스크롤되도록 */
  font-size: 0;
}

.category-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-chip-row::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  padding: 7px 15px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.category-chip:hover {
  border-color: rgba(255, 255, 255, 0.9);
}

.category-chip.is-active {
  background: #ffffff;
  border-color: #ffffff;
  color: #1a1a1a;
  font-weight: 700;
}

.category-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 14px;
}

.category-count {
  font-size: 13px;
  color: #a8a8ad;
}

.category-toolbar-controls {
  display: flex;
  gap: 8px;
}

.category-select {
  appearance: none;
  background: #ececf0 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid #d5d5da;
  border-radius: 8px;
  color: #222222;
  font-size: 13px;
  padding: 7px 28px 7px 12px;
  cursor: pointer;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 12px;
  padding: 8px 16px 0;
}

/* 카테고리 카드는 '사진' 기준 (랭킹 카드 스타일 아님):
   정사각형에 가까운 둥근 모서리 이미지 + 그 아래로 제목/소개/태그 */
#category-grid .ranking-card {
  aspect-ratio: auto;
  overflow: visible;
}

#category-grid .ranking-card > img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
}

#category-grid .ranking-card h3 {
  font-family: 'Pretendard-Regular', sans-serif;
  font-size: 15px;
  color: #f2f2f2;
  padding-bottom: 4px;
}

#category-grid .ranking-card h4 {
  font-size: 12px;
  line-height: 1.4;
  max-height: 2.8em;
}

#category-grid .ranking-card .tags {
  margin-top: 6px;
}

.category-card {
  position: relative;
  background: #2b2b2e;
  border: 1px solid #3a3a3e;
  border-radius: 4px;
  overflow: hidden;
}

.category-card:hover {
  border-color: #4a4a4f;
}

.category-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.category-card-thumb {
  position: relative;
}

.category-card-thumb img:first-child {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: #333336;
}

.category-card-like {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  padding: 5px;
  display: flex;
}

.category-card-like .like-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.category-card-body {
  padding: 10px 12px 12px;
}

.category-card-name {
  margin: 0 0 4px;
  font-size: 14px;
  color: #f2f2f2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card-info {
  margin: 0 0 8px;
  font-size: 12px;
  color: #a8a8ad;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.category-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.category-card-tag {
  font-size: 11px;
  color: #77777c;
  white-space: nowrap;
}

.category-empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: #77777c;
  font-size: 14px;
}

/* ===== NEW 뱃지 (created_at 7일 이내) ===== */
.new-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  background: #FFA178;
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  letter-spacing: 0.3px;
  pointer-events: none;
}

/* ===== 카테고리 스켈레톤 (무한 스크롤 로딩) ===== */
.category-sentinel {
  grid-column: 1 / -1;
  height: 1px;
}

.category-skeleton .cs-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #2b2b2e;
  margin-bottom: 10px;
}

.category-skeleton .cs-line {
  height: 12px;
  border-radius: 4px;
  background: #2b2b2e;
  margin-top: 8px;
}

.category-skeleton .cs-line.short {
  width: 60%;
}

.category-skeleton .cs-thumb,
.category-skeleton .cs-line {
  animation: cs-pulse 1.2s ease-in-out infinite;
}

@keyframes cs-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

