
/* === Project XENO Skill Viewer Styles (auto-fit 240px タイル化 + padding 0 + descスリム化) === */

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans";
  margin: 20px;
  background: #f7f7f8;
  color: #111;
  overflow-x: hidden;
}

h1 { font-size: 20px; margin: 0 0 10px; }

/* === Controls === */
.controls {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px;
}
input[type="text"] {
  padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; min-width: 320px;
}
select {
  padding: 6px 10px; border: 1px solid #ccc; border-radius: 8px;
}

/* === Character Filter === */
#charFilters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 10px 0;
}

.char-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0a0a0a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  height: 36px;
  padding: 0px 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  transition: all .15s;
  cursor: pointer;
}

.char-button:hover {
  border-color: rgba(0,170,255,0.4);
  background: #111;
  box-shadow: 0 0 4px rgba(0,170,255,0.25);
}

.char-button img {
  width: 32px;
  height: 32px;
}

.char-button p {
  color: white;
  font-size: 13px;
  font-weight: bold;
  margin: 0;
  white-space: nowrap;
}

.char-button.selected{
  border-color: rgba(255,255,255,0.18);
  background: linear-gradient(180deg, #2f7dff 0%, #1a5ef5 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 0 0 1px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.char-button.selected p{ color:#fff; }

/* === Grid & Cards === */
#skillGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 240px);
  gap: 6px;
  justify-content: center;
}

.card {
  background: #fff;
  border: 1px solid #e6e6e7;
  border-radius: 12px;
  padding: 8px;   /* ✅ 上下左右に余裕を追加 */
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  min-height: 320px;
}


.card img.icon {
  width: 240px;
  height: 240px;
  object-fit: contain;
}

/* === Text (Option2 + A案) === */
b {
  color: #111;
  text-align: center;
  margin-top: 2px;
  font-size: 1.05rem;
  display: block;
}

.desc {
  font-size: 13px;
  color: #333;
  white-space: pre-wrap;
  line-height: 1.35;

  /* ✅ 説明文だけ細くする */
  max-width: 220px;
  text-align: left;
  margin-left: 0;
  margin-right: 0;
  padding: 8px;
}

/* === ★ Adjust Color === */
.adjust-buff { color: #ff3b3b !important; }    /* 強化：赤 */
.adjust-neutral { color: #13b113 !important; } /* 調整：緑 */
.adjust-nerf { color: #3b6cff !important; }     /* 弱化：青 */


/* === Modal === */
dialog#detailDlg::backdrop { background: #000 !important; opacity: 1 !important; }
dialog#detailDlg {
  margin: 0; padding: 0; border: none; outline: none;
  max-width: 100vw; max-height: 100vh;
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}

#dlgImg {
  display: block;
  max-width: 70vw;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}

dialog#detailDlg:not([open]) {
  display: none !important;
}

  .skill-name {
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    width: 100%;
    margin-top: 4px;
  }

@media (max-width: 480px) {

  #skillGrid {
    grid-template-columns: 1fr !important;   /* ✅ 1列だけ */
    justify-items: center !important;         /* ✅ カードを中央寄せ */
  }

  .card {
    width: auto !important;                  /* ✅ カード本体は画像幅に合わせる */
    max-width: 280px;                        /* ✅ 「少し余白」を作る最適値 */
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .card img.icon {
    width: 240px !important;                 /* ✅ 画像は拡大しない */
    height: 240px !important;
  }

  .desc {
    max-width: 90% !important;               /* ✅ 説明文だけ横広にして読みやすく */
    text-align: left;                        /* ✅ スマホで読みやすい左寄せ（好みで） */
  }
}

@media (max-width: 768px) {

  .card {
    display: grid !important;
    grid-template-columns: 110px 1fr;
    gap: 6px 0px;
    width: 100%;
    max-width: 360px;
    padding: 6px 0px !important;
    margin: 0 auto;
    text-align: left;
    min-height: auto;
    align-items: flex-start;
  }

  .card .cell-left {
    align-self: center;
  }

  .cell-left {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 110px;
  }

  .cell-left img.icon {
    width: 100px !important;
    height: 100px !important;
    object-fit: contain;
  }

  .desc {
    font-size: 13px !important;
    line-height: 1.3;             /* 行間をさらにスッキリ */
    white-space: pre-wrap;
    margin: 0;                    /* 不要な余白をゼロに */
  }
}

/* added mini-btn and change modal */
.mini-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: #4a80ff;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#changeDlg::backdrop {
  background: rgba(0,0,0,0.85);
}

#changeDlg {
  border: none;
  padding: 0;
  background: none;
}

#changeDlg img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 8px;
}

/* スマホ横向き限定（668px以上 900px以下） */
@media (orientation: landscape) and (max-width: 900px) {
  #skillGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

