@import url('https://fonts.googleapis.com/css2?family=Lekton:wght@400;700&display=swap');

/* 全体コンテナ */
.sozai-main-container {
  width: 100%;
  max-width: 480px;
  transition: max-width 0.2s ease;
}

.sozai-header-area {
  width: 100%;
}

/* 1列レイアウト（スマホ: 幅560px未満） */
.sozai-layout-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

/* 2列レイアウト（幅560px〜779px: 贈物・中間202px、素材300px） */
@media (min-width: 560px) and (max-width: 779px) {
  .sozai-main-container {
    max-width: 520px;
  }
  .sozai-layout-grid {
    display: grid;
    grid-template-columns: 202px 300px;
    gap: 18px;
    justify-content: center;
    align-items: start;
  }
  .grid-card-gifts {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0 !important;
  }
  .grid-card-intermediate {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0 !important;
  }
  .grid-card-raw {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-bottom: 0 !important;
  }
}

/* 3列レイアウト（PC・広幅タブレット等: 幅780px以上） */
@media (min-width: 780px) {
  .sozai-main-container {
    max-width: 740px;
  }
  .sozai-layout-grid {
    display: grid;
    grid-template-columns: 202px 202px 300px;
    gap: 18px;
    justify-content: center;
    align-items: start;
  }
  .grid-card-gifts {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0 !important;
  }
  .grid-card-intermediate {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0 !important;
  }
  .grid-card-raw {
    grid-column: 3;
    grid-row: 1;
    margin-bottom: 0 !important;
  }
}

/* 素材カードはPopoverの配置基準 */
.grid-card-raw {
  position: relative;
}

/* リスト項目のコンパクト化・行タップ無効化（チェックボックスのみで操作） */
.compact-item-row {
  padding: 4px 8px !important;
  font-size: 0.82rem;
  line-height: 1.35;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

/* チェックボックスのスタイル */
.custom-checkbox {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* チェック時の背景グレーアウト */
.checked-item-row {
  background-color: #f1f3f5 !important;
  color: #adb5bd !important;
  opacity: 0.65;
}
.checked-item-row a,
.checked-item-row .material-popover-btn {
  color: #adb5bd !important;
}

/* 刀種フィルタータグボタン */
.sword-type-btn {
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: 12px;
  line-height: 1.4;
  border: 1px solid #ced4da;
  background-color: #f8f9fa;
  color: #495057;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease-in-out;
}
.sword-type-btn:hover {
  background-color: #e9ecef;
}
.sword-type-btn.active {
  background-color: #0d6efd !important;
  color: #ffffff !important;
  border-color: #0d6efd !important;
  font-weight: 700;
}

/* 刀剣男士選択モーダル内のボタンスタイル */
.sword-modal-btn-active {
  color: #000000 !important;
  border: 1px solid #000000 !important;
  background-color: #ffffff !important;
  transition: background-color 0.15s ease;
}
.sword-modal-btn-active:hover {
  background-color: #f0f0f0 !important;
  color: #000000 !important;
  border-color: #000000 !important;
}
.sword-modal-btn-disabled {
  background-color: #e9ecef !important;
  border: 1px solid #dee2e6 !important;
  color: #6c757d !important;
  cursor: not-allowed !important;
}

/* Popover スタイル（rawCard右端揃え・幅130px・矢印なし） */
.custom-popover {
  position: absolute;
  right: 0;
  width: 130px !important;
  max-width: 130px !important;
  border: 1.5px solid #0d6efd !important;
  border-radius: 0.375rem;
  background-color: #ffffff;
  z-index: 1050;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}
.custom-popover .popover-header {
  background-color: #0d6efd;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 3px 6px;
  border-bottom: 1.5px solid #0d6efd;
  border-top-left-radius: calc(0.375rem - 1.5px);
  border-top-right-radius: calc(0.375rem - 1.5px);
}
.custom-popover .popover-body {
  padding: 3px 6px;
  color: #212529;
}

/* ポップオーバー内の点線区切り */
.popover-item-row {
  border-bottom: 1px dashed #dee2e6;
}
.popover-item-row:last-child {
  border-bottom: none;
}

/* Popoverの数字フォント（Google Font: Lekton） */
.popover-num {
  font-family: 'Lekton', monospace, sans-serif;
  letter-spacing: -0.2px;
}