* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: "Pretendard-Regular";
  src: url("https://fastly.jsdelivr.net/gh/Project-Noonnu/noonfonts_2107@1.1/Pretendard-Regular.woff")
    format("woff");
  font-weight: 400;
  font-style: normal;
}

body {
  font-family: "Pretendard-Regular", sans-serif;
  font-weight: normal;
  background-color: #f4f4f9;
}

.container1 {
  width: 100%;
  max-width: 1100px;
  margin: 20px auto;
  margin-top: 130px;
  padding: 0 15px;
}

.filters {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.character-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 30px;
}

.character-header h1 {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 18px;
  color: #222;
  letter-spacing: 1px;
}

.character-main-info {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  align-items: center;
  margin-bottom: 20px;
}

.character-image-container {
  flex: 0 0 200px;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#character-img {
  width: 200px;
  height: 200px;
  background-color: black;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.character-stats-container {
  flex: 1;
  min-width: 300px;
  background: none;
  padding: 0;
  box-shadow: none;
}

.character-metadata {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.metadata-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  flex: 1;
}

.metadata-group.field-group {
  flex: 2;
}

.metadata-label {
  font-size: 14px;
  font-weight: bold;
  color: #4a5568;
  text-align: center;
  padding: 4px 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  white-space: nowrap;
  width: 100%;
}

.metadata-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  background-color: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  padding: 0;
  width: 100%;
}

.metadata-image img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  cursor: pointer;
  position: relative;
}

/* 이미지 확대 효과 제거 */
.metadata-image img:hover {
  transform: none;
}

/* 커스텀 툴팁 스타일 */
.custom-tooltip {
  position: absolute;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-tooltip:after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent rgba(0, 0, 0, 0.8);
}

.evolution-image {
  align-self: center;
  width: 100%;
}

.evolution-image img {
  width: 40px;
  height: 40px;
}

.field-images {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0; /* 모바일에서 줄바꿈 방지 */
}

.field-images img {
  width: 35px;
  height: 35px;
  transition: none;
  flex-shrink: 0; /* 이미지 크기 유지 */
}

.field-images img:hover {
  transform: none;
}

.stat-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
  background-color: #f8f9fa;
  border: 1px solid #e2e8f0;
}

.stat-table th,
.stat-table td {
  padding: 12px 8px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  border: none;
  background-color: white;
}

.stat-table th {
  color: #4a5568;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e2e8f0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-table tr:not(:last-child) td {
  border-bottom: 1px solid #e2e8f0;
}

.stat-table td {
  color: #2d3748;
}

.stat-table tr:hover td {
  background-color: #f8f9fa;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 32px 0 12px 0;
  letter-spacing: 0.5px;
  line-height: 1.3;
  background: none;
  border: none;
  padding: 0;
  display: block;
}

.section-title-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 0;
  margin-top: -2px;
  display: inline-block;
}

.sw-container {
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  padding: 12px 0;
  margin-bottom: 10px;
}

.sw {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  background: none;
  table-layout: fixed;
}

.sw td {
  padding: 12px 8px;
  text-align: center;
  font-size: 15px;
  border: none;
  background: none;
}

.sw tr:not(:last-child) td {
  border-bottom: 1px solid #e2e8f0;
}

.sw-icon {
  width: 10%;
  min-width: 50px;
  max-width: 90px;
  text-align: center;
  vertical-align: middle;
}

.sw-icon-container {
  background-size: cover;
  background-position: center;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.sw-icon-container img {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

.sw-description {
  font-size: 16px;
  font-weight: bold;
  vertical-align: middle;
  width: 10%;
  min-width: 50px;
  max-width: 120px;
  word-break: keep-all;
}

.sw-description-detail {
  width: 80%;
  min-width: 120px;
  max-width: 1200px;
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 14px !important;
  color: #3f3f3f;
  margin-left: 0;
  display: table-cell;
  vertical-align: middle;
  box-shadow: none;
  border: none;
  text-align: left !important;
}

.highlight {
  color: rgb(0, 150, 0);
}

.skill-container {
  width: 100%;
  overflow-x: auto;
}

.skill-table {
  width: 70%;
  border-collapse: collapse;
}

.skill-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0.1px solid grey;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  margin-right: 5px;
}

.skill-name-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.skill-name {
  font-size: 16px;
  font-weight: bold;
}

.skill-attribute {
  width: 22px;
  background-image: url('https://media.dsrwiki.com/dsrwiki/background.webp');
  background-size: 120%;
  background-position: center;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.skill-tag {
  color: white;
  border-radius: 5px;
  padding: 2px 2px;
  font-size: 13px;
  text-align: center;
  font-weight: bold;
}

.tag-range {
  background-color: #D32F2F;
}

.tag-range.long-range {
  background-color: green;
}

.tag-target {
  background-color: #D32F2F;
}

.tag-hit {
  background-color: green;
}

.tag-effect {
  background-color: #D32F2F;
}

.tag-cast {
  background-color: grey;
}

.level-table-container {
  background: none;
  padding: 0;
  box-shadow: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 10px;
  width: 100%;
  overflow-x: auto;
}

.level-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: none;
  table-layout: fixed;
  box-sizing: border-box;
}

.level-table th,
.level-table td {
  padding: 12px 8px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
  border: none;
  background-color: white;
  width: 10%;
}

.level-table th {
  color: #4a5568;
  background-color: #f8f9fa;
  border-bottom: 2px solid #e2e8f0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.level-table tr:not(:last-child) td {
  border-bottom: 1px solid #e2e8f0;
}

.level-table td {
  color: #2d3748;
}

.level-table tr:hover td {
  background-color: #f8f9fa;
}

.skill-header-table {
  width: 100%;
}

.skill-icon-cell {
  width: 50px;
  padding-right: 10px;
}

.skill-name-cell, .skill-tags-cell {
  vertical-align: middle;
  padding: 2px 0;
}

.character-name-label {
  display: block;
  margin-top: 0;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  padding: 2px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  width: 100%;
  max-width: 200px;
  min-width: 200px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .container1 {
    margin-top: 100px;
  }
  
  .character-main-info {
    flex-direction: column;
  }
  
  .character-image-container {
    flex: 0 0 140px;
    min-width: 120px;
  }
  
  .character-stats-container {
    padding: 15px;
  }
  
  .character-metadata {
    gap: 15px;
    padding-bottom: 15px;
  }
  
  .metadata-group {
    flex: 1;
  }
  
  .metadata-label {
    font-size: 12px;
  }
  
  .metadata-image {
    min-height: 50px;
    padding: 6px;
  }
  
  .metadata-image img {
    width: 30px;
    height: 30px;
  }
  
  .evolution-image img {
    width: 30px;
    height: 30px;
  }
  
  .field-images {
    gap: 6px;
  }
  
  .field-images img {
    width: 28px;
    height: 28px;
  }
  
  .stat-table {
    font-size: 13px;
  }
  
  .stat-table th, 
  .stat-table td {
    padding: 10px 6px;
    font-size: 12px;
  }
  
  .stat-table th {
    font-size: 11px;
  }
  
  .sw-description {
    font-size: 14px;
  }
  
  .sw-description-detail {
    font-size: 12px;
  }
  
  .level-table-container {
    width: 100%;
    overflow-x: auto;
    padding: 0;
    margin: 0;
  }

  .level-table {
    width: 650px;
    min-width: 650px;
    table-layout: fixed;
    display: table;
  }
  
  .level-table th, 
  .level-table td {
    font-size: 12px;
    padding: 5px;
    width: 10%;
    box-sizing: border-box;
    white-space: nowrap;
  }

  .skill-table {
    width: 100%;
  }

  .stat-table {
    width: 100%;
  }

  .custom-tooltip {
    font-size: 11px;
    padding: 3px 6px;
  }

  .character-header h1 {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .character-name-label {
    font-size: 14px;
    max-width: 200px;
    min-width: 200px;
    padding: 1px 0;
  }

  .section-title {
    font-size: 16px;
    margin: 24px 0 10px 0;
  }
}

@media (max-width: 480px) {
  .container1 {
    margin-top: 80px;
  }
  
  .character-header h1 {
    font-size: 24px; /* 글씨 크기 키우기 */
    text-align: center; /* 디지몬 이름 중앙 정렬 */
    margin-bottom: 15px; /* 여백 약간 조정 */
  }
  
  .character-stats-container {
    padding: 12px;
  }
  
  .character-metadata {
    gap: 10px;
    padding-bottom: 12px;
  }
  
  .metadata-group {
    flex: 1;
  }
  
  .field-images {
    gap: 4px;
  }
  
  .sw-description-detail {
    margin-left: 0; /* 모바일에서는 마진 제거 */
  }
  
  .skill-header-table {
    width: 100%;
  }
  
  .skill-icon-cell {
    width: 50px;
    padding-right: 0px; /* 모바일에서도 적당한 간격 유지 */
  }
  
  .skill-tags {
    flex-wrap: wrap;
  }

  .skill-table {
    width: 100%;
    border-collapse: collapse;
  }

  .stat-table {
    width: 100%;
  }

  .custom-tooltip {
    font-size: 10px;
    padding: 2px 4px;
  }

  .digicore-container {
    overflow-x: auto;
  }
  .digicore-items {
    min-width: 340px;
    width: max-content;
  }
}

@media (max-width: 600px) {
  .sw {
    table-layout: auto;
  }
  .sw-icon {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }
  .sw-icon-container {
    width: 35px !important;
    height: 35px !important;
  }
  .sw-icon img {
    width: 30px !important;
    height: 30px !important;
  }
  .sw-description {
    width: 60px !important;
    min-width: 50px !important;
    max-width: 80px !important;
    font-size: 12px !important;
    word-break: keep-all;
  }
  .sw-description-detail {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    font-size: 12px !important;
    word-break: break-all;
  }
  .sw td {
    font-size: 12px !important;
    padding: 6px 4px !important;
  }
}

/* 덱 섹션 스타일 */
.deck-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  height: fit-content;
  min-height: auto;
}

.deck-card {
  background-color: #ffffff;
  color: #333333;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 15px 20px 20px 20px;
  display: flex;
  flex-direction: column;
}

.deck-title {
  font-size: 1.5rem;
  color: #333333;
  margin-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  padding-bottom: 10px;
}

.deck-description {
  color: #6b7280;
  margin-bottom: 15px;
}

.deck-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.digimon-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.digimon-avatar {
  width: 60px;
  height: 60px;
  background-color: #000;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.digimon-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.digimon-avatar:hover img {
  transform: scale(1.1);
}

.digimon-tooltip {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  opacity: 0;
}

.digimon-tooltip:after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 0 5px 5px;
  border-style: solid;
  border-color: transparent transparent rgba(0, 0, 0, 0.8);
}

.digimon-avatar.highlight {
  box-shadow: 0 0 8px var(--highlight-color);
}

.effects-container {
  padding: 10px;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.4;
}

.effect-item {
  display: inline;
}

.effect-item:not(:last-child)::after {
  content: " / ";
  color: #999;
}

.effect-value {
  color: #e74c3c;
  font-weight: bold;
}

.no-deck-message, .error-message {
  color: #666;
  text-align: center;
  width: 100%;
  padding: 20px;
}

.error-message {
  color: #d32f2f;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4f90ff;
}

/* 디지코어화 섹션 스타일 */
.digicore-container {
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  margin-bottom: 20px;
}

.digicore-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.digicore-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  background-color: #ffffff;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.digicore-item-main {
  display: flex;
  align-items: center;
  gap: 15px;
}

.digicore-item-image {
  width: 50px;
  height: 50px;
  background-color: #212536;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.digicore-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.digicore-item-info {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 20px;
}

.digicore-item-name {
  font-size: 15px;
  font-weight: bold;
  color: #333;
  white-space: nowrap;
}

.digicore-item-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.digicore-item-probability {
  font-size: 12px;
  color: #ffffff;
  padding: 3px 6px;
  border-radius: 4px;
}

.digicore-item-probability.probability {
  background-color: #22c55e;
}

.digicore-item-probability.guaranteed {
  background-color: #ef4444;
}

.digicore-item-tradeable {
  font-size: 12px;
  color: #ffffff;
  padding: 3px 6px;
  border-radius: 4px;
}

.digicore-item-tradeable.tradeable {
  background-color: #3b82f6;
}

.digicore-item-tradeable.untradeable {
  background-color: #6b7280;
}

.digicore-item-expanded {
  background-color: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 12px;
  margin-top: 5px;
}

.digicore-item-expanded .digicore-item-expanded {
  margin-top: 8px;
  background-color: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 10px;
}

.digicore-item-description {
  color: #666;
  font-size: 13px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.possible-items-title {
  font-size: 13px;
  color: #4b5563;
  margin-bottom: 8px;
  font-weight: bold;
}

.possible-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.possible-items-list .possible-items-list {
  margin-top: 8px;
  padding-left: 0;
}

.possible-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.possible-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.possible-item-image {
  width: 30px;
  height: 30px;
  background-color: #212536;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.possible-item-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.possible-item-info {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 15px;
}

.possible-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.possible-item-probability {
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
}

.possible-item-probability.probability {
  background-color: #22c55e;
  color: white;
}

.possible-item-probability.guaranteed {
  background-color: #ef4444;
  color: white;
}

@media (max-width: 768px) {
  .digicore-item {
    padding: 12px;
  }

  .digicore-item-main {
    gap: 10px;
  }

  .digicore-item-image {
    width: 40px;
    height: 40px;
  }

  .digicore-item-info {
    gap: 15px;
  }

  .digicore-item-name {
    font-size: 14px;
  }

  .possible-item {
    padding: 6px;
  }

  .possible-item-image {
    width: 25px;
    height: 25px;
  }

  .possible-item-info {
    gap: 10px;
  }

  .possible-item-name {
    font-size: 13px;
  }

  .digicore-item-probability {
    font-size: 13px;
  }

  .digicore-item-badges {
    gap: 6px;
  }

  .digicore-item-tradeable {
    font-size: 13px;
    padding: 3px 6px;
  }
}

@media (max-width: 480px) {
  .digicore-item {
    padding: 10px;
  }

  .digicore-item-main {
    gap: 8px;
  }

  .digicore-item-image {
    width: 35px;
    height: 35px;
  }

  .digicore-item-name {
    font-size: 12px;
  }

  .digicore-item-probability {
    font-size: 11px;
    padding: 3px 6px;
  }

  .possible-item {
    padding: 5px;
  }

  .possible-item-image {
    width: 22px;
    height: 22px;
  }

  .possible-item-info {
    gap: 10px;
  }

  .possible-item-name {
    font-size: 12px;
  }

  .digicore-item-badges {
    gap: 4px;
  }

  .digicore-item-tradeable {
    font-size: 11px;
    padding: 3px 6px;
  }
}

.item-count {
  color: #888;
  font-size: 12px;
  margin-left: 2px;
}