@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");
@font-face {
    font-family: 'SchoolSafeLocker';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2402_keris@1.0/TTHakgyoansimSamulhamR.woff2') format('woff2');
    font-weight: normal;
    font-display: swap;
}

/* ------------------------------------ */
/*  공통 스타일                         */
/* ------------------------------------ */

h1,
.subtitle {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body {
  font-family: "Pretendard", sans-serif;
  background: #000;
  color: #fff;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ------------------------------------ */
/*  헤더 및 레이아웃 구조               */
/* ------------------------------------ */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  grid-template-rows: 80px auto;
  grid-template-areas:
    "header header header"
    "sidebar-left content sidebar-right";
  width: 100%;
  height: 100vh;
  background: #0e0e0e;
  overflow: hidden;
}

/* Header */
.header {
  grid-area: header;
  height: 80px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 2px solid #222;
  box-sizing: border-box;
}
.header-logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
  display:inline-block;
  vertical-align: middle;
  
}
.header-title {
  font-family: 'SchoolSafeLocker', sans-serif;
  font-size: 1.5rem;
  color: #fff;
  margin-left: 12px;
  display: inline-block;
  vertical-align: middle;
}

/* Sidebar */
.sidebar-left,
.sidebar-right {
  position: fixed;
  top: 80px;
  bottom: 0;
  width: 280px;
  overflow-y: auto;
  box-sizing: border-box;
}
.sidebar-left {
  left: 0;
  border-right: 2px solid #222;
}
.sidebar-right {
  right: 0;
  border-left: 2px solid #222;
}

/* Content */
.content {
  grid-area: content;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: scroll;
  scrollbar-width: none;
  -ms-overflow-style: none;
  height: 100%;
}
.content::-webkit-scrollbar { display: none; }

/* ------------------------------------ */
/*  로딩 상태                           */
/* ------------------------------------ */
.loading-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2000;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loading-text {
  font-weight: 600;
  font-size: 18px;
  color: #fff;
  text-align: center;
}

/* ------------------------------------ */
/*  인덱스 (영웅 리스트)                */
/* ------------------------------------ */
#heroes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(16px, 3vw, 48px);
  justify-content: stretch;
  align-content: start;
  width: 100%;
  padding: clamp(24px, 4vw, 56px);
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  background: transparent;
  transition: transform 0.15s ease;
}
.hero-card:hover {
  transform: scale(1.05);
}

.hero-portrait-wrap {
  position: relative;
  line-height: 0;
  width: 100%;
}
.hero-portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #c1b494;
}
.hero-type-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  z-index: 2;
}
.hero-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  text-align: center;
  margin-top: 8px;
}

/* 희귀도 색상 */
.rarity-legendary-plus { background: radial-gradient(circle at center, #ffefb8, #eba22a); }
.rarity-legendary { background: radial-gradient(circle at center, #f3e0a8, #b68700); }
.rarity-rare { background: radial-gradient(circle at center, #a693ff, #5a3ebd); }
.rarity-uncommon { background: radial-gradient(circle at center, #b5ffb0, #2e7b2e); }

/* ------------------------------------ */
/*  hero.html (영웅 상세 페이지)        */
/* ------------------------------------ */
.hero-detail-page {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  background: #000;
  min-height: 100vh;
}

/* Adjust container widths for desktop */
.hero-detail-container {
  flex: 3;
  max-width: 75%;
}

.hero-comments {
  flex: 1;
  max-width: 25%;
}

/* Responsive fallback for mobile (under 1024px) */
@media (max-width: 1023px) {
  .hero-detail-page {
    flex-direction: column;
  }
  .hero-detail-container,
  .hero-comments {
    max-width: 100%;
  }
}
.hero-header {
  width: 100%;
  height: 80px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 2px solid #222;
  box-sizing: border-box;
}
.back-button {
  background: transparent;
  color: #fff;
  border: none;
  font-size: 1rem;
  font-weight:500;
  cursor: pointer;
  transition: color 0.2s ease;
}
.back-button:hover {
  color: #f0c674;
}
.back-button i {
  font-size:16px;
}

.hero-detail-container {
  flex: 3;
  max-width: 75%;
  margin: 0;
  text-align: left;
  padding: 48px;
  box-sizing: border-box;
}
.hero-detail-portrait {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #c1b494;
  margin: 0 auto 24px;
}
#hero-name {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
#hero-type {
  font-size: 1rem;
  color: #aee6ff;
  margin-bottom: 24px;
}
#hero-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #ccc;
  margin-bottom: 32px;
  white-space: pre-line;
}
#hero-skills {
  list-style: none;
  padding: 0;
  margin: 0;
}
#hero-skills li {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 12px;
  color: #eee;
  text-align: left;
}

/* ------------------------------------ */
/*  전설+ 및 체크박스 효과 다이아몬드 (업데이트 버전) */
/* ------------------------------------ */
/* .rarity-diamond-effect styles referencing old diamondPulse animation removed */

/* Red-Gold Gradient for SVG fill */
svg defs {
  /* Define the gradient once */
}
@supports (--css: variables) {
  /* For browsers supporting CSS variables, define the gradient */
  :root {
    --red-gold-gradient-start: #ffefb8;
    --red-gold-gradient-mid: #ffb07a;
    --red-gold-gradient-end: #ff6a5a;
    --red-gold-gradient-pink: #ff7f90;
  }
}

/* Inline SVG gradient definition */
.rarity-diamond-effect svg defs {
  /* This is just a placeholder; the actual gradient should be defined in the SVG element */
}

/* ------------------------------------ */
/*  전설+ 황금 스파크 효과 (Red-Gold Spark) */
/* ------------------------------------ */
/* ==== Spark star positioning & animation (SVG) ==== */
.hero-portrait-wrap { position: relative; }

.rarity-diamond-effect{
  position: absolute;
  top: 0px;
  right: 0px;
  width: clamp(24px, 2vw, 48px);
  height: clamp(24px, 2vw, 48px);
  z-index: 5;
  pointer-events: none;
}

/* Ensure UA rule doesn't clip the SVG effects */

/* (구)세븐나이츠 제외 일반 영웅 스파크 */
.hero-card:not([data-group="(구)세븐나이츠"]) .rarity-diamond-effect svg,
.related-hero-card:not([data-group="(구)세븐나이츠"]) .rarity-diamond-effect svg {
  overflow: visible;
  filter: drop-shadow(0 0 6px #ffcc80)
        drop-shadow(0 0 12px #f37225)
        drop-shadow(0 0 20px rgba(255, 180, 60, 0.6));
}

/* (구)세븐나이츠 전용 보랏빛 황금 스파크 */
.hero-card[data-group="(구)세븐나이츠"] .rarity-diamond-effect svg,
.related-hero-card[data-group="(구)세븐나이츠"] .rarity-diamond-effect svg {
  filter: drop-shadow(0 0 6px #d5a6ff)
          drop-shadow(0 0 12px #b57aff)
          drop-shadow(0 0 20px rgba(170, 90, 255, 0.6));
}

/* (구)세븐나이츠 제외 일반 영웅 스파크 (상세 페이지) */
.hero-detail-page:not([data-group="(구)세븐나이츠"]) .rarity-diamond-effect svg {
  overflow: visible;
  filter: drop-shadow(0 0 6px #ffcc80)
        drop-shadow(0 0 12px #f37225)
        drop-shadow(0 0 20px rgba(255, 180, 60, 0.6));
}

/* (구)세븐나이츠 전용 보랏빛 황금 스파크 (상세 페이지) */
.hero-detail-page[data-group="(구)세븐나이츠"] .rarity-diamond-effect svg {
  filter: drop-shadow(0 0 6px #d5a6ff)
          drop-shadow(0 0 12px #b57aff)
          drop-shadow(0 0 20px rgba(170, 90, 255, 0.6));
}


/* Removed outdated box-shadow keyframe animations: diamondPulse, starPulse, starSparkEnhanced */

.hero-portrait.has-effect {
  position: relative;
  border: 3px solid rgb(255 187 61);
  background-clip: padding-box;
  box-shadow:
    0 0 10px rgba(255, 210, 130, 0.7),
    0 0 20px rgba(255, 170, 70, 0.5),
    0 0 30px rgba(255, 140, 40, 0.3);
}

/* ------------------------------------ */
/*  hero.html 댓글 섹션                 */
/* ------------------------------------ */
.hero-comments {
  width: 100%;
  max-width: 720px;
  margin: 48px auto;
  background: #111;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 24px;
  box-sizing: border-box;
}
.hero-comments h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffd56a;
  margin-bottom: 16px;
}
#comment-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
#comment-form input,
#comment-form textarea {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: "Pretendard", sans-serif;
  font-size: 0.95rem;
}
#comment-form input::placeholder,
#comment-form textarea::placeholder {
  color: #666;
}
#comment-form button {
  align-self: flex-end;
  background: #f0c674;
  color: #000;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
#comment-form button:hover {
  background: #ffd56a;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment-list li {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 12px 16px;
}
.comment-list li strong {
  color: #ffd56a;
  display: block;
  margin-bottom: 4px;
}
.comment-list li p {
  color: #ddd;
  margin: 0 0 4px 0;
  font-size: 0.95rem;
}
.comment-list li span {
  color: #777;
  font-size: 0.8rem;
}

.filter-container {
  padding: 24px;
  color: #fff;
  font-size: 0.9rem;
}
.filter-container h3 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 12px;
  color: #ffd56a;
}
.filter-group {
  margin-bottom: 20px;
}
.filter-title {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-buttons label {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  user-select: none;
}
.filter-buttons label:hover {
  background: #2c2c2c;
}
.filter-buttons input {
  display: none;
}
.filter-buttons input:checked + label,
.filter-buttons label:has(input:checked) {
  background: #ffd56a;
  color: #000;
  border-color: #ffd56a;
}
.sort-buttons label {
  display: block;
  margin-bottom: 6px;
  cursor: pointer;
}
.sort-buttons input {
  margin-right: 6px;
}
/* ------------------------------------ */
/*  반응형 레이아웃 (1023 이하: 모바일, 1024 이상: 데스크탑 4단계) */
/* ------------------------------------ */

/* 모바일 (1023px 이하) */
@media (max-width: 1023px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "content";
  }

  .sidebar-left,
  .sidebar-right {
    display: none;
  }

  #heroes {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 24px;
  }

  .hero-name {
    font-size: 0.85rem;
  }
}

/* 데스크탑 S (1024~1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
  #heroes {
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    padding: 32px;
  }
}

/* 데스크탑 M (1280~1599px) */
@media (min-width: 1280px) and (max-width: 1599px) {
  #heroes {
    grid-template-columns: repeat(5, 1fr);
    gap: 40px;
    padding: 40px;
  }
}

/* 데스크탑 L (1600~1919px) */
@media (min-width: 1600px) and (max-width: 1919px) {
  #heroes {
    grid-template-columns: repeat(6, 1fr);
    gap: 48px;
    padding: 48px;
  }
}

/* 데스크탑 XL (1920px 이상) */
@media (min-width: 1920px) {
  #heroes {
    grid-template-columns: repeat(7, 1fr);
    gap: 56px;
    padding: 56px;
  }
}

/* ------------------------------------ */
/*  hero.html Skeleton UI                */
/* ------------------------------------ */
.skeleton-container {
  display: none;
  width: 100%;
  max-width: 720px;
  margin: 48px auto;
  padding: 24px;
  box-sizing: border-box;
}

.skeleton {
  background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite linear;
  border-radius: 8px;
  margin-bottom: 16px;
}

.hero-portrait-skeleton {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  margin: 0 auto 24px;
}

.hero-name-skeleton {
  width: 60%;
  height: 24px;
  margin: 0 auto 12px;
}

.hero-meta-skeleton {
  width: 40%;
  height: 20px;
  margin: 0 auto 24px;
}

.skill-skeleton {
  width: 100%;
  height: 60px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}