:root {
  --color-primary: #39393d;
  --color-secondary: #04a75b;
  --color-text: #afd0dd;
  --color-background: #1c1e27;
  --color-dark: #2e2e35;
}

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'メイリオ', Meiryo, 'Yu Gothic', 'YuGothic', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: white;
}

header {
  font-weight: 700;
  background-color: var(--color-primary);
  color: white;
  padding: 20px 8px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  letter-spacing: 1px;
}

header h1 {
  margin: 0 0 5px 0;
  font-size: 2.5em;
  display: inline-block;
  padding-bottom: 5px;
}

a {
  text-decoration: none !important;
  color: inherit !important;
}

a:hover {
  color: var(--color-secondary) !important;
  text-decoration: underline;
  transition: color 0.2s;
}

nav ul {
  list-style: none;
  padding: 0 20px;
  margin: 10px 0 0 0;
  display: flex;
  justify-content: center;
}

nav ul li {
  padding: 0 8px;
}

nav ul li a {
  color: var(--color-background);
  text-decoration: none;
  padding: 10px;
  transition: color 0.3s;
}

.highlight {
  background-color: var(--color-secondary);
  font-weight: bold;
  padding: 2px 0;
}

.menu-view {
  font-size: 1.5em;
  padding-bottom: 5px;
  border-bottom: 2px solid #333;
  margin-bottom: 20px;
  width: 100%;
}

.hr-orange {
  border: none;
  height: 0;
  border-top: 1px solid var(--color-primary) !important;
  margin: 20px 0 !important;
}

.icon-toc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.icon-toc li {
  margin-bottom: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.icon-toc li:last-child {
  margin-bottom: 0;
  border-bottom: none;
}

.icon-toc a {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  font-size: 1.5em;
  padding: 5px;
  transition: background-color 0.2s;
}

.icon-toc a:hover {
  background-color: var(--color-primary);
}

.toc-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-right: 15px;
  display: block;
}

.content-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
}

.sidebar {
  font-weight: 700;
  height: unset;
  min-height: unset;
  overflow: unset;
  background-color: var(--color-dark);
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.main-content-area {
  width: 55%;
  margin-right: 0;
  padding: 20px 30px;
  box-sizing: border-box;
}

.sidebar h2 {
  color: white;
  border-bottom: 3px double white;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  margin-top: 0;
  font-size: 1.2em;
  text-transform: uppercase;
}

.sidebar h2::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  margin-left: 10px;
  margin-top: 2px;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  display: block !important;
}

.sidebar ul li a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: var(--color-primary);
  border-bottom: 1px dotted var(--color-primary);
  transition: background-color 0.3s;
}

.sidebar ul li a:hover {
  background-color: var(--color-primary);
}

.main-content h2 {
  color: white;
  border-left: 5px solid var(--color-primary);
  padding-left: 10px;
  margin-top: 30px;
}

.article-header {
  border-radius: 16px;
}

.copy-word {
  cursor: pointer;
  border-bottom: 1px dotted var(--color-secondary);
  color: var(--color-secondary);
}

.wp-block-table {
  display: block;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 1px;
  margin-inline-end: 1px;
  unicode-bidi: isolate;
}

.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.wp-block-table th,
.wp-block-table td {
  border: 1px solid var(--color-background);
  padding: 6px;
  text-align: center;
  color: white;
}

.wp-block-table thead th {
  background-color: #4CAF50;
  color: white;
  font-weight: bold;
  text-transform: uppercase;
}

.wp-block-table tbody tr:nth-child(even) {
  background-color: var(--color-dark);
}

.wp-block-table tbody tr:nth-child(odd) {
  background-color: var(--color-dark);
}

.wp-block-table tbody tr:hover {
  background-color: var(--color-dark);
}

.wp-block-table {
  text-align: center !important;
}

.has-text-align-center {
  text-align: center !important;

}

.recipe-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 20px;
  margin-bottom: 20px;
}

.crafting-recipe {
  display: flex;
  align-items: center;
  gap: 15px;
  width: calc(33% - 10px);
  padding: 10px;
  background-color: #e0e0e0;
  border: 3px solid #555;
  border-radius: 8px;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
}

.slot {
  width: 40px;
  height: 40px;
  background-color: #555;
  border: 2px solid #222;
  border-radius: 4px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.output-slot .slot {
  width: 50px;
  height: 50px;
  border-color: #222;
}

.arrow {
  font-size: 30px;
  font-weight: bold;
  color: #222;
  margin: 0 5px;
}

.slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

.interface {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #C6C6C6;
  border: 2px solid;
  border-color: #FFF #555 #555 #FFF;
  outline: 2px solid #000;
  padding: 8px;
  margin-block: 20px;
  image-rendering: pixelated;
  position: relative;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

#copy-feedback-message {
  position: fixed;
  background-color: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  font-size: 0.9em;
  z-index: 1000;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.sprite-icon {
  display: inline-block;
  width: 35px;
  height: 35px;
  background-image: url('/recipe-icon.png');
  background-repeat: no-repeat;
  vertical-align: middle;
  background-size: 105px 70px;
}

.crafting_table {
  background-position: 0 0;
}

.brewing_stand {
  background-position: -35px 0;
}

.furnace {
  background-position: -70px 0;
}

.campfirepot {
  background-position: 0 -35px;
}

.stonecutter {
  background-position: -35px -35px;
}

.smithing_table {
  background-position: -70px -35px;
}

article {
  background-color: var(--color-dark);
  color: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
  text-decoration: none;
}

article p,
li {
  color: var(--color-text)
}

footer {
  background-color: var(--color-dark);
  color: var(--color-secondary);
  text-align: center;
  padding: 15px;
  width: 100%;
}

.promo-box {
  width: 15%;
  padding: 20px 10px;
  box-sizing: border-box;
  background-color: #f0f0f0;
  border-left: 1px dashed #ccc;
  display: block;
}

amazon-banner {
  display: flex;
  border: 1px solid #ccc;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
  padding: 10px;
  max-width: 600px;
  margin: 15px auto;
}

.amazon-banner a {
  text-decoration: none;
  color: #333;
}

.banner-image {
  object-fit: contain;
  margin-right: 15px;
}

.product-title {
  font-weight: bold;
  margin: 0 0 5px 0;
}

.action-button {
  background-color: #FF9900;
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  text-align: center;
  margin-top: 10px;
  font-size: 0.9em;
}

.action-button:hover {
  background-color: #f7b243;
}

.amazon-banner-vertical {
  width: 250px;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin: 20px auto;
  border-radius: 5px;
  overflow: hidden;
}

.amazon-banner-vertical a {
  text-decoration: none;
  color: #333;
  display: block;
  padding-bottom: 10px;
}

.banner-image-vertical {
  width: 100%;
  height: auto;
  display: block;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  object-fit: cover;
}

.banner-info-vertical {
  padding: 10px 15px;
  text-align: center;
}

.product-title-vertical {
  font-weight: bold;
  font-size: 1.1em;
  height: 3.3em;
  overflow: hidden;
  margin-bottom: 10px;
  line-height: 1.1;
}

.price-text {
  color: #555;
  font-size: 0.9em;
}

.action-button-vertical {
  background-color: #FF9900;
  color: white;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
  font-size: 1em;
  font-weight: bold;
  transition: background-color 0.3s;
  cursor: pointer;
}

.amazon-banner-vertical a:hover .action-button-vertical {
  background-color: #f7b243;
}

#sticky-footer-amazon-pr {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: #232f3e;
  color: #fff;
  padding: 10px 20px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
}

.amazon-pr-content-wrapper {
  display: flex;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
}

.amazon-pr-image-area {
  flex-shrink: 0;
  margin-right: 15px;
}

.amazon-pr-image-area img {
  width: 60px !important;
  height: 60px !important;
  object-fit: contain;
  border: 1px solid #ccc;
  background-color: #fff;
}

.amazon-pr-text-area {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-name {
  font-size: 15px;
  font-weight: bold;
  margin: 0;
  line-height: 1.4;
  max-width: 60%;
}

.amazon-button {
  background-color: #ff9900;
  color: white;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  white-space: nowrap;
}

.amazon-button:hover {
  background-color: #f7b243;
}

#close-amazon-pr-button {
  position: absolute;
  top: -15px;
  right: 10px;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  line-height: 25px;
  text-align: center;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* ========================================
   改善されたスマホメニューバー
   ======================================== */

#menu-toggle {
  display: none;
  /* デフォルトは非表示（PC） */
}

@media (min-width: 769px) {
  .promo-box {
    display: block !important;
  }
}

@media (max-width: 768px) {

  /* スマホ表示時のbodyに上部マージンを追加（固定メニュー分） */
  body {
    padding-top: 55px;
  }

  .content-wrapper {
    flex-direction: column;
    margin-top: 0;
  }

  /* メニューボタン：画面最上部、横いっぱい、スクロールでついてくる */
  #menu-toggle {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 101;
    padding: 16px 20px;
    background-color: var(--color-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 600;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
  }

  /* ハンバーガーアイコン */
  #menu-toggle::before {
    content: '☰';
    font-size: 1.3em;
    margin-right: 12px;
    transition: transform 0.3s ease;
  }

  /* メニューが開いている時の×アイコン */
  #menu-toggle[aria-expanded="true"]::before {
    content: '✕';
    transform: rotate(90deg);
  }

  /* メニューが開いている時の背景色変更 */
  #menu-toggle[aria-expanded="true"] {
    background-color: #CC3333;
  }

  /* サイドバー */
  .sidebar {
    width: 85%;
    max-width: 400px;
    height: 100%;
    position: fixed;
    top: 0;
    left: -100%;
    overflow-y: auto;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
    transition: left 0.3s ease-in-out;
    margin: 0;
    border-radius: 0;
    padding-top: 70px;
    /* メニューボタンの高さ分確保 */
    padding-bottom: 30px;
    z-index: 100;
  }

  .sidebar.is-open {
    left: 0;
  }

  /* オーバーレイ（メニューが開いている時の背景暗転） */
  .sidebar.is-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  .main-content-area {
    width: 100%;
    padding: 15px;
  }

  .promo-box {
    width: 100%;
    display: block !important;
    padding: 15px 10px;
    box-sizing: border-box;
    order: 3;
    background-color: #fff8e1;
    border-left: none;
    margin-bottom: 20px;
  }

  /* ヘッダーも調整 */
  header {
    margin-top: 0;
    padding-top: 10px;
  }
}

@media (max-width: 1000px) {
  .crafting-recipe {
    width: calc(50% - 10px);
  }
}

@media (max-width: 600px) {
  .crafting-recipe {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

video {
  max-width: 100%;
  height: auto;
  display: block;
}

h4 {
  display: block;
  margin-block-start: 0.33em;
  margin-block-end: 0em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  font-weight: bold;
  unicode-bidi: isolate;
}