/* ==============================
   トップページ：タイトル
============================== */
.homehero {
  background: #17243b;
  color: #fff;
  border: 1px solid #b99b5b;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  margin: 0 0 20px;
}


/* ==============================
   トップページ：カテゴリ一覧
============================== */
.homequick {
  width: 100%;
  box-sizing: border-box;
}

.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 {
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.homequick li a {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 18px 10px;
  border: 1px solid #d5dbe5;
  border-radius: 10px;
  background: #f7f8fa;
  color: #20324d;
  text-align: center;
  font-weight: bold;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.homequick li a:hover {
  background: #eaf0f8;
  border-color: #b99b5b;
}


/* ==============================
   Discordボタン
============================== */
.homediscord {
  text-align: center;
  margin: 0 auto 24px;
}

.homediscord a {
  display: inline-block;
  box-sizing: border-box;
  min-width: 260px;
  max-width: 100%;
  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: #fff;
}

.homesearch input[type="submit"] {
  margin-left: 8px;
  padding: 14px 24px;
  border: 1px solid #17243b;
  border-radius: 10px;
  background: #17243b;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.homesearch input[type="submit"]:hover {
  background: #30476b;
}


/* ==============================
   初心者向けリンクカード
============================== */
#wikibody .beginner-card {
  margin: 16px 0 24px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  line-height: 1.8;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#wikibody .beginner-card a {
  display: block;
  position: relative;
  padding-right: 24px;
  margin-bottom: 4px;
  color: #2469a6;
  font-size: 1.08em;
  font-weight: 700;
  text-decoration: none;
}

#wikibody .beginner-card a::after {
  content: "›";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  color: #9298a1;
  font-size: 1.5em;
  font-weight: 400;
}

#wikibody .beginner-card:hover {
  border-color: #e6ad65;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

#wikibody .beginner-card a:hover {
  color: #b96b12;
  text-decoration: none;
}


/* ==============================
   共通リンクボタン
============================== */
#wikibody .link-button {
  margin: 20px 0;
  text-align: center;
}

#wikibody .link-button a {
  display: block;
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid #2878c8;
  border-radius: 3px;
  background: #fff;
  color: #2878c8;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

#wikibody .link-button a:hover {
  background: #2878c8;
  color: #fff;
}


/* ==============================
   画像付きリンク一覧
============================== */
#wikibody .guide-grid {
  width: 100%;
  max-width: 100%;
  margin: 16px 0 28px;
  box-sizing: border-box;
}

#wikibody .guide-grid table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 8px;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

#wikibody .guide-grid td {
  padding: 0;
  border: 1px solid #e0e5eb;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  text-align: center;
  vertical-align: top;
}

#wikibody .guide-grid td img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: contain;
  margin: 0;
  padding: 0;
}

#wikibody .guide-grid a {
  display: block;
  padding: 4px 6px;
  margin: 0;
  color: #2675b8;
  font-weight: bold;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#wikibody .guide-grid td:hover {
  border-color: #2675b8;
  background: #f4f9ff;
}

#wikibody .guide-grid a:hover {
  color: #16558c;
  text-decoration: underline;
}


/* ==============================
   スマートフォン表示
============================== */
@media screen and (max-width: 600px) {

  /* カテゴリ一覧：2列 */
  .homequick {
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .homequick ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 460px;
    margin: 12px auto 24px;
    padding: 0;
    box-sizing: border-box;
  }

  .homequick li a {
    padding: 16px 6px;
    font-size: 14px;
  }

  /* 検索欄とボタン：横並び */
  .homesearch form {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
  }

  .homesearch input[type="text"] {
    flex: 1 1 0;
    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;
  }

  /* Discordボタン */
  .homediscord a {
    min-width: 0;
    max-width: 100%;
  }
}


/* スマートフォン：画像付きリンク一覧 */
@media screen and (max-width: 600px) {
  #wikibody .guide-grid {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 16px 0 24px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  #wikibody .guide-grid table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    table-layout: fixed !important;
    border-spacing: 3px !important;
    box-sizing: border-box !important;
  }

  #wikibody .guide-grid tr {
    width: 100% !important;
  }

  #wikibody .guide-grid td {
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #wikibody .guide-grid td img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 65px !important;
    object-fit: contain !important;
    box-sizing: border-box !important;
  }

  #wikibody .guide-grid a {
    display: block !important;
    max-width: 100% !important;
    padding: 4px 2px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    box-sizing: border-box !important;
  }
}




/* homequick：中央配置 */
#wikibody .homequick {
  width: 100% !important;
  max-width: 460px !important;
  margin: 12px auto 24px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

#wikibody .homequick ul {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  list-style: none !important;
  box-sizing: border-box !important;
}

#wikibody .homequick li {
  min-width: 0 !important;
  margin: 0 !important;
  text-align: center !important;
}

#wikibody .homequick li a {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

/* スマホ版 homequick の中央配置 */
@media screen and (max-width: 600px) {
  #wikibody .homequick {
    display: block !important;
    width: 100% !important;
    max-width: 460px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
  }

  #wikibody .homequick ul {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  #wikibody .homequick li {
    min-width: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  #wikibody .homequick li a {
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }
}