/* 上部タイトル */
.homehero {
  background: #17243b;
  color: #fff;
  border: 1px solid #b99b5b;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  margin: 0 0 20px;
}

/* カード一覧 */
.homequick ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 12px 0 24px;
}

/* 各カード */
.homequick li a {
  display: block;
  padding: 18px 10px;
  border: 1px solid #d5dbe5;
  border-radius: 10px;
  background: #f7f8fa;
  color: #20324d;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
}

/* マウスを乗せたとき */
.homequick li a:hover {
  background: #eaf0f8;
  border-color: #b99b5b;
}

/* スマートフォン */
@media (max-width: 600px) {
  .homequick ul {
    grid-template-columns: 1fr;
  }
}

/* Discordボタン */
.homediscord {
  text-align: center;
  margin: 0 auto 24px;
}

.homediscord a {
  display: inline-block;
  box-sizing: border-box;
  min-width: 260px;
  padding: 13px 24px;
  border: 1px solid #5865F2;
  border-radius: 10px;
  background: #5865F2;
  color: #fff;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.homediscord a:hover {
  background: #4752C4;
  border-color: #4752C4;
}

.homediscord a:focus-visible {
  outline: 2px solid #b99b5b;
  outline-offset: 3px;
}

/* 検索エリア */
.homesearch {
  margin: 24px auto 32px;
  text-align: center;
}

/* 検索入力欄 */
.homesearch input[type="text"] {
  width: 360px;
  max-width: 65%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 2px solid #aab8cc;
  border-radius: 10px;
  background: #f4f7fb;
  color: #20324d;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

/* 入力欄を選択したとき */
.homesearch input[type="text"]:focus {
  border-color: #5865f2;
  background: #ffffff;
}

/* 検索ボタン */
.homesearch input[type="submit"] {
  margin-left: 8px;
  padding: 14px 24px;
  border: 1px solid #17243b;
  border-radius: 10px;
  background: #17243b;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

/* ボタンにマウスを乗せたとき */
.homesearch input[type="submit"]:hover {
  background: #30476b;
}

/* スマートフォン */
@media (max-width: 600px) {
  .homesearch input[type="text"] {
    width: 100%;
    max-width: 100%;
  }

  .homesearch input[type="submit"] {
    margin: 10px 0 0;
  }
}

/* スマホ表示の調整 */
@media (max-width: 600px) {

  /* カテゴリボタンを2列に維持 */
  .homequick ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .homequick li a {
    padding: 16px 6px;
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  /* 検索欄とボタンを横並びにする */
  .homesearch form {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .homesearch input[type="text"] {
    flex: 1;
    width: 0;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
  }

  .homesearch input[type="submit"] {
    flex: 0 0 auto;
    margin: 0;
    padding: 10px 14px;
  }
}

/* スマホ表示：カテゴリ一覧を中央配置 */
@media (max-width: 600px) {
  .homequick ul {
    width: 100%;
    max-width: 460px;
    margin: 12px auto 24px;
    padding: 0;
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .homequick {
    width: 100%;
    box-sizing: border-box;
  }
}

/* スマホ：カテゴリボタンを画面中央に配置 */
@media screen and (max-width: 600px) {
  .homequick {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .homequick ul {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 460px !important;
    margin: 12px auto 24px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .homequick li {
    min-width: 0;
    margin: 0 !important;
    box-sizing: border-box;
  }

  .homequick li a {
    width: 100%;
    box-sizing: border-box;
  }
}