/* ========================================
   HoYoWiki風レイアウト for はてなブログ Blankテーマ
   v13 - スマホ対応 + サイドバー背景修正版
======================================== */

:root {
  --sidebar-w: 600px;
  --sidebar-indent: 300px;
  --content-gap: 80px;
  --main-width: 1000px;
}

/* =========================
   全体
========================= */

html,
body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: transparent !important;
}

#globalheader-container {
  position: static;
}

#blog-title {
  display: none !important;
}

/* =========================
   container
========================= */

#container,
#container-inner,
#content,
#content-inner {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
}

/* =========================
   横並び
========================= */

#content-inner {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  min-height: 100vh;
  background: #FAEC99 !important; /* サイドバー背景を全体に敷く */
}

/* =========================
   左サイドバー
========================= */

#box2 {
  order: -1;
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  max-width: var(--sidebar-w);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: #FAEC99;
  border-right: none;
  overflow-y: visible;
  z-index: 10;
  box-sizing: border-box;
}

#box2::before {
  content: "げーむめも";
  display: block;
  padding: 18px 16px 14px var(--sidebar-indent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #708B67;
  border-bottom: none;
}

/* =========================
   game-nav
========================= */

.game-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.game-nav a {
  display: block;
  position: relative;
  padding: 9px 24px 9px var(--sidebar-indent);
  font-size: 16px;
  line-height: 1.4;
  color: #708B67;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.game-nav a::before {
  content: "";
  position: absolute;
  left: calc(var(--sidebar-indent) - 14px);
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #FAB398;
  transform: translateY(-50%) scaleY(0);
  transition: 0.15s ease;
}

.game-nav a:hover {
  background: transparent;
  color: #FF646D;
}

.game-nav a:hover::before {
  transform: translateY(-50%) scaleY(1);
}

/* =========================
   アコーディオン
========================= */

.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-toggle {
  width: 100%;
  position: relative;
  padding: 10px 24px 10px var(--sidebar-indent);
  background: none;
  border: none;
  text-align: left;
  color: #708B67;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-toggle::before {
  content: "";
  position: absolute;
  left: calc(var(--sidebar-indent) - 14px);
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #FAB398;
  transform: translateY(-50%) scaleY(0);
  transition: 0.15s ease;
}

.nav-toggle:hover {
  background: transparent;
  color: #FF646D;
}

.nav-toggle:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.nav-toggle::after {
  content: "▼";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #FF00CD;
  font-size: 12px;
  transition: 0.2s ease;
}

.nav-group.open .nav-toggle::after {
  transform: translateY(-50%) rotate(180deg);
}

.nav-group.open .nav-toggle {
  color: #4f6a4a;
  background: rgba(111,139,102,0.08);
}

.nav-group.open .nav-toggle::before {
  transform: translateY(-50%) scaleY(1);
  background: #a998ff;
  box-shadow: 0 0 10px rgba(169,152,255,.45);
}

.nav-group.open .nav-toggle::after {
  border-color: #cbbfff;
}

/* =========================
   サブメニュー
========================= */

.nav-sub {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-group.open .nav-sub {
  max-height: 500px;
}

.nav-sub a {
  display: block;
  position: relative;
  padding: 8px 24px 8px calc(var(--sidebar-indent) + 24px);
  color: #708B67;
  text-decoration: none;
  font-size: 13px;
  transition: background 0.12s, color 0.12s;
}

.nav-sub a::before {
  left: calc(var(--sidebar-indent) + 10px);
}

.nav-sub a:hover {
  background: transparent;
  color: #FF646D;
}

/* バー色統一 */
.game-nav a::before,
.nav-toggle::before,
.nav-single::before,
.nav-sub a::before,
.nav-group.open .nav-toggle::before {
  background: #FAB398 !important;
}

/* =========================
   通常サイドバーモジュール
========================= */

#box2 .hatena-module-title {
  padding: 16px 16px 6px var(--sidebar-indent) !important;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a527a !important;
  border-top: 1px solid #2a2840;
}

#box2 .hatena-module ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 4px 0 !important;
}

#box2 .hatena-module ul li a {
  display: block;
  position: relative;
  padding: 7px 24px 7px var(--sidebar-indent) !important;
  font-size: 12px;
  color: #a89cc8 !important;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

#box2 .hatena-module ul li a::before {
  content: "";
  position: absolute;
  left: calc(var(--sidebar-indent) - 14px);
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #8f7cff;
  transform: translateY(-50%) scaleY(0);
  transition: 0.15s ease;
}

#box2 .hatena-module ul li a:hover {
  background: #1e1b38;
  color: #e0d8ff !important;
}

#box2 .hatena-module ul li a:hover::before {
  transform: translateY(-50%) scaleY(1);
}

#box2 .hatena-module-body p {
  padding: 8px 24px 8px var(--sidebar-indent) !important;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #5a527a;
}

#box2 .profile-icon {
  display: block !important;
  width: 48px !important;
  height: 48px !important;
  margin: 8px auto 8px var(--sidebar-indent) !important;
  border-radius: 50%;
}

.hatena-module-category {
  display: none !important;
}

/* =========================
   カウントダウン
========================= */

.nav-countdown {
  padding: 12px 24px 12px var(--sidebar-indent);
  border-bottom: none;
  background: #A1B995;
  text-align: left;
  box-sizing: border-box;
}

.cd-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 6px;
}

.cd-time {
  font-size: 40px;
  font-weight: 900;
  color: #FFB23F;
  letter-spacing: 0.05em;
  text-shadow:
    0 0 2px #fff,
    0 0 3px #fff,
    1px 1px 3px #fff,
    -1px 1px 3px #fff,
    1px -1px 3px #fff,
    -1px -1px 3px #fff;
}

.cd-sub {
  margin-top: 4px;
  font-size: 14px;
  color: #ffffff;
}

.cd-line {
  margin-top: 4px;
  font-size: 10px;
  color: #ffffff;
}

.cd-line strong {
  color: #d7ccff;
  font-weight: 600;
}

/* =========================
   単体リンク
========================= */

.nav-single {
  display: block;
  position: relative;
  padding: 10px 24px 10px var(--sidebar-indent);
  font-size: 16px;
  font-weight: 600;
  color: #cfc4ef;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-single::before {
  content: "";
  position: absolute;
  left: calc(var(--sidebar-indent) - 14px);
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: #8f7cff;
  transform: translateY(-50%) scaleY(0);
  transition: 0.15s ease;
}

.nav-single:hover {
  background: #1e1b38;
  color: #ffffff;
}

.nav-single:hover::before {
  transform: translateY(-50%) scaleY(1);
}

.menu-text {
  padding-left: var(--sidebar-indent);
  padding-right: 24px;
  color: #708B67;
  font-size: 12px;
  line-height: 1.6;
}

/* =========================
   メイン領域
========================= */

#wrapper {
  flex: 1;
  display: flex;
  justify-content: flex-start;
  margin: 0;
  padding: 0;
  background-color: #FAF1D3;
  background-image: url("https://cdn-ak.f.st-hatena.com/images/fotolife/i/iris_ssl/20260510/20260510175205.png");
  background-repeat: repeat;
  background-size: 256px;
  box-sizing: border-box;
}

#main {
  width: 100%;
  max-width: var(--main-width);
  margin-left: var(--content-gap);
  margin-right: auto;
  padding: 36px 40px;
  box-sizing: border-box;
}

#box1 {
  display: none !important;
}

/* =========================
   記事
========================= */

.entry {
  border: none;
  background: transparent;
  margin-bottom: 30px;
}

.entry:last-child {
  margin-bottom: 0;
}

.entry-inner {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  position: relative;
}

.entry-inner::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 3px dashed #E6764F;
  border-radius: 8px;
  pointer-events: none;
}

.entry-header {
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e8e3dc;
}

.entry-title,
.entry-title a {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  color: #1a1a2e;
  text-decoration: none;
}

.entry-content {
  font-size: 14px;
  line-height: 1.9;
  color: #3a3530;
}

.entry-content h2 {
  margin: 28px 0 12px;
  padding: 8px 14px;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a2e;
  background: #FAF1D3;
  border-left: none;
}

/* =========================
   見出し
========================= */

.entry-content h3 {
  color: white;
  position: relative;
  background-color: #FFB23F;
  border-radius: 10px;
  padding: 1em;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.03em;
  border: none;
}

.entry-content h3:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 20px;
  border: 10px solid transparent;
  border-top: 10px solid #FFB23F;
}

.entry-content h4 {
  background-image: linear-gradient(
    45deg,
    rgba(112,139,103,0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(112,139,103,0.25) 50%,
    rgba(112,139,103,0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
  padding: 0.5em;
  font-size: 20px;
  font-weight: 700;
}

.entry-content h5 {
  border-left: 4px solid #FF646D;
  background-color: #ffe4e1;
  padding: 0.5em;
  font-size: 16px;
  font-weight: 600;
}

/* =========================
   目次
========================= */

.entry-content .table-of-contents {
  position: relative;
  display: inline-block;
  font-size: 14px;
  border: 1px dashed #fac;
  color: #999;
  background-color: #fff !important;
  padding-left: 30px;
  padding-right: 30px;
}

.table-of-contents:before {
  content: "[ contents ]";
  background-color: #f5f5f5;
  position: relative;
  display: inline-block;
  margin: 0 0 1rem 0;
  padding: 0.2rem 1rem;
  font-weight: bold;
}

.table-of-contents li a,
.table-of-contents li a:visited {
  color: #999 !important;
  text-decoration: none;
  border-bottom: 1px dotted #fac;
  font-weight: 400;
}

.table-of-contents li a:hover {
  color: #bac;
  border-bottom: 2px solid #fac;
  font-weight: 700;
}

.table-of-contents li {
  list-style-type: none;
}

ul.table-of-contents li:before {
  font-family: "blogicon";
  content: "\f048";
  position: relative;
  left: -0.5rem;
  font-size: 0.5rem;
  color: #fac;
}

/* =========================
   コピーボックス
========================= */

.copy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 420px;
  padding: 12px 14px;
  margin: 16px 0;
  background: #ffffff;
  border: 2px solid #FFB23F;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  font-family: sans-serif;
}

.copy-text {
  font-weight: 600;
  color: #333;
  letter-spacing: 0.05em;
}

.copy-btn {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: #FFB23F;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.15s ease;
}

.copy-btn:hover {
  background: #ff9f1c;
  transform: translateY(-1px);
}

.copy-btn:active {
  transform: translateY(0);
}

/* =========================
   日付・カテゴリ
========================= */

.date,
.entry-date,
.entry-header-time {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  color: #8a8a8a;
  background: rgba(250,236,153,0.65);
  border: 1px solid #e6d14f;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.date a,
.entry-date a,
.entry-header-time a {
  color: inherit;
  text-decoration: none;
  pointer-events: none;
}

.entry-categories a,
.categories a,
.entry-category a {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  color: #FFB23F;
  background: rgba(250,236,153,0.65);
  border: 1px solid #e6d14f;
  padding: 4px 8px;
  border-radius: 999px;
  margin-right: 6px;
  text-decoration: none;
  letter-spacing: 0.05em;
}

.entry-categories a:hover,
.categories a:hover,
.entry-category a:hover {
  background: rgba(250,236,153,0.9);
  color: #6f8b66;
}

/* =========================
   コメント
========================= */

.comment {
  background: #ffffff;
  border: 1px solid #e6d14f;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  line-height: 1.7;
  color: #3a3530;
}

.comment-header {
  font-size: 12px;
  font-weight: 600;
  color: #6f8b66;
  margin-bottom: 6px;
}

.comment-content {
  font-size: 13px;
}

.comment-date {
  font-size: 11px;
  color: #8a8a8a;
  margin-top: 6px;
}

.comment ul,
.comment ol {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.comment li {
  list-style: none;
}

/* =========================
   フッター・ページャー
========================= */

#footer,
.hatena-footer {
  font-size: 10px;
  color: #b8b8b8;
  text-align: center;
  padding: 10px 0;
}

.pager-prev,
.pager-next,
.pager,
.page-navigation {
  display: none !important;
}

/* =========================
   非表示要素
========================= */

.hatena-star,
.hatena-star-container,
.hatena-star-comment-container,
.hatena-star-add-button,
.hatena-star-comment,
.hatena-star-comment-toggle,
.hatena-star-metadata,
.entry-tags,
.entry-tag,
.categories,
.category,
.hatena-category,
.hatena-tag {
  display: none !important;
}

/* =========================
   カテゴリ一覧・グリッド
========================= */

.archive-entries {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-auto-rows: min-content;
  gap: 14px;
  align-items: start;
}

/* =========================
   カード本体
========================= */

.archive-entries .archive-entry {
  display: block;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6d14f;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: 0.2s ease;
}

.archive-entries .archive-entry:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

/* =========================
   サムネイル
========================= */

.archive-entries .entry-thumb {
  width: 100%;
  padding-top: 0;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center top !important;
  background-color: #ffffff;
}

/* =========================
   タイトル
========================= */

.archive-entries .entry-title {
  display: block;
  padding: 10px 12px;
  margin: 0;
}

.archive-entries .entry-title a {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a2e;
  text-decoration: none;
  line-height: 1.4;
  display: block;
}

.archive-entries .entry-title a:hover {
  color: #FF646D;
}

/* =========================
   メタ情報
========================= */

.archive-entries .date,
.archive-entries .entry-date,
.archive-entries .categories {
  font-size: 11px;
  color: #6f6f6f;
  margin-top: 6px;
}

.archive-entries .categories a {
  display: inline-block;
  font-size: 10px;
  color: #6f6f6f;
  background: rgba(250,236,153,0.6);
  border: 1px solid #e6d14f;
  padding: 2px 6px;
  border-radius: 999px;
  margin-right: 4px;
  text-decoration: none;
}

/* =========================
   本文・余計な要素削除
========================= */

.archive-entries p,
.archive-entries .entry-summary,
.archive-entries .entry-description {
  display: none !important;
}

.archive-entries *[class*="tag"],
.archive-entries *[class*="star"] {
  display: none !important;
}

.color {
  color: #f3981d !important;
  font-weight: 700;
}
.top {
  color: #000000 !important;
  font-weight: 700;
}

/* =========================
   ギャラリー基本レイアウト
========================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  overflow: visible;
}

.g-item {
  display: block;
  position: relative;
  transition: transform .25s ease, filter .25s ease, box-shadow .25s ease;
}

.g-item img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  display: block;
}

.g-item:hover {
  transform: scale(1.03) rotate(-1deg);
  z-index: 2;
}

.g-item:hover img {
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}

.gallery:hover .g-item {
  filter: brightness(.75);
}

.gallery:hover .g-item:hover {
  filter: brightness(1);
}

/* =========================
   ライトボックス
========================= */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 999999 !important;
  padding: 5vh 5vw;
}

.lightbox:target {
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.entry:has(.gallery) .entry-footer {
  display: none;
}

/* =========================
   背景パターン
========================= */

html {
  position: relative;
}

html::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("https://cdn-ak.f.st-hatena.com/images/fotolife/i/iris_ssl/20260510/20260510175205.png");
  background-repeat: repeat;
  background-size: 256px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

body {
  background: transparent;
}

/* =========================
   画像リンク（サイドバー）
========================= */

.nav-image-link {
  padding: 12px 24px 12px 310px;
  box-sizing: border-box;
}

.nav-image-link img {
  width: 280px;
  height: auto;
  border-radius: 8px;
  display: block;
}

/* ========================================
   スマホ対応
======================================== */

/* ===== タブレット (901px以下) ===== */
@media (max-width: 900px) {

  #box2 {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
  }

  #box2::before,
  .game-nav a,
  .nav-toggle,
  .nav-single,
  .nav-countdown,
  .menu-text,
  #box2 .hatena-module-title,
  #box2 .hatena-module ul li a,
  #box2 .hatena-module-body p {
    padding-left: 16px !important;
  }

  .nav-sub a {
    padding-left: 32px !important;
  }

  .game-nav a::before,
  .nav-toggle::before,
  .nav-single::before {
    left: 4px !important;
  }

  .nav-sub a::before {
    left: 20px !important;
  }

  #main {
    margin-left: 0 !important;
    padding: 24px 20px !important;
  }

  .cd-time {
    font-size: 26px !important;
  }

  /* タブレット：画像リンクのインデントを調整 */
  .nav-image-link {
    padding-left: 16px !important;
  }

  .nav-image-link img {
    width: 160px;
  }
}

/* ===== スマートフォン (640px以下) ===== */
@media (max-width: 640px) {

  #content-inner {
    flex-direction: column !important;
    align-items: stretch !important;
    background: #FAEC99 !important;
  }

  #box2 {
    position: static !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: unset !important;
    order: -1 !important;
    overflow: hidden;
  }

  #box2 .game-nav,
  #box2 .hatena-module,
  .nav-countdown,
  .menu-text {
    display: none !important;
  }

  #box2.sp-open .game-nav,
  #box2.sp-open .hatena-module,
  #box2.sp-open .nav-countdown,
  #box2.sp-open .menu-text {
    display: block !important;
  }

  #box2.sp-open .game-nav {
    display: flex !important;
  }

  #box2::before {
    padding-left: 16px !important;
    cursor: pointer;
    background: #708B67 !important;
    color: #fff !important;
    font-size: 14px !important;
    display: flex !important;
    align-items: center;
  }

  .game-nav a,
  .nav-toggle,
  .nav-single {
    padding-left: 20px !important;
    font-size: 14px !important;
  }

  .game-nav a::before,
  .nav-toggle::before,
  .nav-single::before {
    left: 6px !important;
  }

  .nav-sub a {
    padding-left: 36px !important;
    font-size: 12px !important;
  }

  .nav-sub a::before {
    left: 22px !important;
  }

  #wrapper {
    width: 100% !important;
    background: #FAF1D3 !important;
  }

  #main {
    margin: 0 !important;
    padding: 14px 12px !important;
    max-width: 100% !important;
  }

  .entry-inner {
    padding: 14px 12px !important;
    border-radius: 8px !important;
  }

  .entry-inner::before {
    inset: 5px !important;
  }

  .entry-title,
  .entry-title a {
    font-size: 18px !important;
  }

  .entry-content h3 {
    font-size: 18px !important;
    padding: 0.7em !important;
  }

  .entry-content h4 {
    font-size: 16px !important;
  }

  .entry-content h5 {
    font-size: 13px !important;
  }

  .archive-entries {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .cd-time {
    font-size: 24px !important;
  }

  .copy-box {
    max-width: 100% !important;
  }

  /* スマホ：画像リンクのインデントとサイズを調整 */
  .nav-image-link {
    padding-left: 20px !important;
  }

  .nav-image-link img {
    width: 100%;
    max-width: 280px;
  }
}

/* ===== リンク色 ===== */
.entry-content a {
  color: #e29399;
}
.entry-content a:visited {
  color: #b0778c;
}
.entry-content a:hover {
  color: #FF646D;
}