body {
  padding-bottom:50px;
}

.container {
  display: flex;
  gap: 40px;            /* 左右の間隔 */
  align-items: flex-start;
  margin: 0 auto;
  justify-content: center;
}

.check {
  display: inline-flex;     /* 横並び */
  align-items: center;      /* 縦中央 */
  gap: 0px;                 /* 距離（小さく） */
  font-size: 14px;
  margin-top: 6px;   
}
.check input {
  margin: 0;
}
.check2 {
  display: inline-flex;     /* 横並び */
  align-items: center;      /* 縦中央 */
  gap: 0px;                 /* 距離（小さく） */
  font-size: 14px;
  margin-top: 6px;   
}
.check2 input {
  margin: 0;
  }
.check3 {
  display: inline-flex;     /* 横並び */
  align-items: center;      /* 縦中央 */
  gap: 0px;                 /* 距離（小さく） */
  font-size: 14px;
  margin-top: 6px;   
}
.check3 input {
  margin: 0;
  }
.check4 {
  display: inline-flex;     /* 横並び */
  align-items: center;      /* 縦中央 */
  gap: 0px;                 /* 距離（小さく） */
  font-size: 14px;
  margin-top: 6px;   
}
.check4 input {
  margin: 0;
  }
.check5 {
  display: inline-flex;     /* 横並び */
  align-items: center;      /* 縦中央 */
  gap: 0px;                 /* 距離（小さく） */
  font-size: 14px;
  margin-top: 6px;   
}
.check5 input {
  margin: 0;
  }
.radio1 {
  display: inline-flex;     /* 横並び */
  align-items: center;      /* 縦中央 */
  gap: 0px;                 /* 距離（小さく） */
  font-size: 14px;
  margin-top: 6px;   
}
.radio1 input {
  margin: 0;
  }
.calculator {
  width: 400px;
}
input[type="text"] {
  width: 320px;
  font-size: 16px;
}

table {
  margin: 0 auto;
}

#imagePreview{
  width: 900px;
  background: white;
}

.description {
  max-width: 300px;
  font-size: 14px;
  color: #555;
  background: #f8f8f8;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
  margin-left: 0;
}
.preview{
  white-space: pre-wrap;        /* 折り返す */
}

.dresult {
  text-align: left;
}

@media (max-width: 600px) {
  .container {
    flex-direction: column;   /* 縦並び */
  }

  .calculator {
    width: 100%;              /* 画面いっぱい */
  }

  input {
    width: 100%;
  }

  button {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
}

.max-damage {
color: red;
font-weight: bold;
}
.second-damage {
  color: blue;
  font-weight: bold;
}


/* キャラ検索＋決定 */
.chara-select {
  display: flex;
  align-items: center;
  gap: 8px;                 /* 入力とボタンの間隔 */
  margin-bottom: 12px;
}

/* キャラ入力 */
#characterInput {
  width: 200px;
  font-size: 14px;
}

/* 決定ボタン */
#loadCharBtn {
  padding: 0px 8px;
  font-size: 14px;
  cursor: pointer;
}

/* スマホ対応 */
@media (max-width: 600px) {
  .char-select {
    flex-direction: column;
    align-items: stretch;
  }

  #characterInput,
  #loadCharBtn {
    width: 100%;
  }
}
  .selected-char {
  width: 49px;
  height: 75px;
  border: 2px solid #4f7cff;
  border-radius: 6px;
  background-color: #eef2f8;

  background-repeat: no-repeat;
}
.character-panel {
  display: grid;
  grid-template-columns: repeat(10, 45px);
  gap: 2px;

  justify-content: center;
  padding: 10px;
}
.char-btn:active {
  filter: brightness(0.7);
  transform: scale(0.97);
}
.char-btn {
  width: 45px;
  height: 129px;

  background-image: url("gbvsr.png");
  background-repeat: no-repeat;

  border: 1px solid #d3d8e2;
  border-radius: 1px;
  background-color: #eef2f8;

  cursor: pointer;
}
.character-panel .char-btn:nth-child(n+31) {
  margin-left: 22.5px;
}
/* checkbox本体は隠す */
.ex-checkbox {
  display: none;
}

/* 表示される見た目 */
.ex-label {
  display: inline-block;
  width: 39px;   /* ← 画像1枚分の横幅 */
  height: 23px;  /* ← 画像の高さ */

  background-image: url("EX.png"); /* ← その画像 */
  background-repeat: no-repeat;
background-size: 78px 23px;
  background-position: -39px 0;        /* OFF */
  cursor: pointer;
}

.ex{
  position: relative;
    width: 50px;
  height: 40px;

  display: flex;
  justify-content: center;
  align-items: center;

  border: 1px solid #3f8cff;
  border-radius: 10px;
  background-color: #a8d2ff;
  left :50%;
}

.ex:active {
  filter: brightness(0.7);
  transform: scale(0.97);
}

/* チェックON時 */
.ex-checkbox:checked + .ex-label {
  background-position: 0 0;    /* ON側 */
}
    .hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.modal-content {
  position: relative;
  margin: 1vh auto;
  width: 80%;
  max-width: 900px;
  background: #f3f6fb;
  border-radius: 12px;
  padding: 5px;
  padding-bottom: 20px;
}
.modal-content2 {
  position: relative;
  margin: 20vh auto;
  width: 80%;
  max-width: 600px;
  background: #f3f6fb;
  border-radius: 12px;
  padding: 20px;
  padding-bottom: 20px;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}

.char-grid img {
  width: 100%;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}

.char-grid img:hover {
  transform: scale(1.05);
}

.char-btn.disabled {
  filter: brightness(0.4);
  pointer-events: none;
  opacity: 0.6;
}
