/* ============================================================
   ESUNISHI INTERNET GARAGE - 共通スタイル（サブページ用）
   ------------------------------------------------------------
   ・各サブページ（about/works/diary...）が読み込む共通レイアウト
   ・色や幅は :root の変数を書き換えるだけで一括調整できます
   ・背景（緑ワイヤーフレーム / 虹色宇宙）は body の background で差し替え
   ============================================================ */

:root {
  /* ===== 色 ===== */
  --eig-bg:         #04061c;   /* いちばん外側の背景（濃紺〜黒） */
  --eig-bg-grid:    rgba(0, 255, 130, 0.10); /* 背景の緑ワイヤーフレーム線 */
  --eig-page-bg:    #0a1030;   /* サイト本体の背景 */
  --eig-panel-bg:   #101a45;   /* パネル内の背景 */
  --eig-frame-lite: #7fdcff;   /* 枠の明るい辺 */
  --eig-frame-dark: #00123f;   /* 枠の暗い辺 */
  --eig-ink:        #eaf2ff;   /* 本文の文字 */
  --eig-cyan:       #41e7ff;
  --eig-green:      #47ff9b;
  --eig-yellow:     #ffe23a;
  --eig-grey:       #b8c0d0;
  --eig-link:       #8fd4ff;
  --eig-link-hover: #ffe23a;
  --eig-titlebar-a: #001b62;
  --eig-titlebar-b: #1e63c8;

  /* Windows 95 color override */
  --eig-bg:         #02031e;
  --eig-page-bg:    #008080;
  --eig-panel-bg:   #c0c0c0;
  --eig-panel-body: #d4d0c8;
  --eig-frame-lite: #ffffff;
  --eig-frame-dark: #404040;
  --eig-ink:        #000000;
  --eig-cyan:       #000080;
  --eig-green:      #008080;
  --eig-grey:       #404040;
  --eig-link:       #0000ee;
  --eig-link-hover: #551a8b;
  --eig-titlebar-a: #000080;
  --eig-titlebar-b: #000080;

  /* ===== サイズ ===== */
  --eig-width:      900px;     /* サイト本体の固定幅 */
  --eig-menu-width: 124px;     /* 左メニューの幅 */
  --eig-menu-scroll-height: 500px; /* 左メニュー内のスクロール高さ */
  --eig-menu-bg-image: url("../image/menu/menu_bg.png");   /* 例: url("../image/menu/menu_bg.png") */
  --eig-menu-bg-size: 96px 96px;
  --eig-gap:        14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  padding: 18px 12px 40px;
  color: var(--eig-ink);
  font-family: "MS UI Gothic", "MS Pゴシック", Tahoma, "Hiragino Kaku Gothic ProN",
    "Yu Gothic", monospace;
  font-size: 14px;
  line-height: 1.6;

  /* 背景：濃紺 + 緑ワイヤーフレーム格子（左右にも見える）
     ※画像背景に差し替えたい時は下の background-image をコメント解除して url を指定 */
  background-color: var(--eig-bg);
  background-image: url("../image/background.png");
  background-repeat: repeat;
  background-size: auto;
  /* background-image: url("../image/xxx_background.png"); background-size: auto; */
}

a {
  color: var(--eig-link);
}

a:hover,
a:focus {
  color: var(--eig-link-hover);
}

img {
  max-width: 100%;
}

/* ===== サイト本体（中央固定幅・左右に背景が見える） ===== */
.eig-page {
  width: min(100%, var(--eig-width));
  margin: 0 auto;
  background: var(--eig-page-bg);
  border-top: 3px solid var(--eig-frame-lite);
  border-left: 3px solid var(--eig-frame-lite);
  border-right: 3px solid var(--eig-frame-dark);
  border-bottom: 3px solid var(--eig-frame-dark);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
}

/* ===== ヘッダー（見出し） ===== */
.eig-header {
  padding: 14px 16px;
  text-align: center;
  background: var(--eig-titlebar-a);
  border-bottom: 2px solid #404040;
}

.eig-logo {
  display: inline-block;
  color: #ffffff;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  text-shadow: 2px 2px 0 #000000, 0 0 8px var(--eig-cyan);
}

.eig-breadcrumb {
  margin: 8px 0 0;
  font-size: 12px;
  color: #d4d0c8;
}

.eig-breadcrumb .eig-current,
.eig-breadcrumb [data-eig-current] {
  color: var(--eig-yellow);
  font-weight: bold;
}

/* ===== 本文エリア（左メニュー + コンテンツ） ===== */
.eig-body {
  display: flex;
  gap: var(--eig-gap);
  align-items: flex-start;
  padding: var(--eig-gap);
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 5px),
    var(--eig-page-bg);
}

/* ===== 左メニュー ===== */
.eig-menu {
  flex: 0 0 var(--eig-menu-width);
  width: var(--eig-menu-width);
  overflow: hidden;
  color: #00113f;
  background: var(--eig-panel-bg);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow:
    2px 2px 0 rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px #808080;
}

.eig-menu-title {
  margin: 0;
  padding: 5px 8px 4px;
  color: #ffffff;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  background: var(--eig-titlebar-a);
  border: 0;
  border-bottom: 1px solid #000000;
  text-shadow: 1px 1px 0 #000000;
}

.eig-menu-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: var(--eig-menu-scroll-height);
  margin: 0;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  background-color: var(--eig-page-bg);
  background-image:
    var(--eig-menu-bg-image),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 4px);
  background-repeat: repeat, repeat;
  background-size: var(--eig-menu-bg-size), 4px 4px;
  scrollbar-color: var(--eig-panel-bg) var(--eig-page-bg);
  scrollbar-width: thin;
}

.eig-menu-list::-webkit-scrollbar {
  width: 12px;
}

.eig-menu-list::-webkit-scrollbar-track {
  background: var(--eig-page-bg);
  border-left: 1px solid #004040;
}

.eig-menu-list::-webkit-scrollbar-thumb {
  background: var(--eig-panel-bg);
  border: 2px solid var(--eig-page-bg);
}

.eig-menu-list li {
  margin: 0;
}

.eig-menu-item {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 76px auto;
  gap: 3px;
  min-height: 112px;
  padding: 7px 4px 6px;
  place-items: center;
  color: #ffe86a;
  text-align: center;
  text-decoration: none;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.eig-menu-item:hover,
.eig-menu-item:focus-visible {
  color: #fff7a6;
  outline: 1px dotted #ffe86a;
  outline-offset: 1px;
  transform: translateY(1px);
}

.eig-menu-item.is-current {
  color: #fff7a6;
}

.eig-menu-item.is-current .eig-menu-label::before,
.eig-menu-item.is-current .eig-menu-label::after {
  content: "★";
  color: #ff5bd8;
  font-size: 10px;
}

.eig-menu-item:hover .eig-menu-icon,
.eig-menu-item:focus-visible .eig-menu-icon {
  transform: scale(1.05);
}

.eig-menu-icon-wrap {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.65));
}

.eig-menu-icon-wrap.is-missing::before {
  content: "◆";
  color: #ffe86a;
  font-size: 30px;
  text-shadow: 1px 1px 0 #000000;
}

.eig-menu-icon {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: contrast(1.1) saturate(0.9);
  transition: transform 0.08s ease;
}

.eig-menu-label {
  display: block;
  min-height: auto;
  color: #ffe86a;
  font-family: "Times New Roman", "MS Gothic", "ＭＳ ゴシック", serif;
  font-size: 15px;
  font-weight: bold;
  line-height: 1.05;
  text-decoration: underline;
  text-shadow:
    1px 1px 0 #000000,
    0 0 4px rgba(255, 232, 106, 0.55);
}

.eig-menu-foot {
  display: none;
  margin: 10px 0 0;
  font-size: 12px;
  text-align: center;
}

/* ===== コンテンツ ===== */
.eig-content {
  flex: 1 1 auto;
  min-width: 0;
}

.eig-page-title {
  margin: 0 0 12px;
  padding: 4px 10px;
  font-size: 20px;
  color: #ffffff;
  background: var(--eig-titlebar-a);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  text-shadow: none;
}

/* ===== パネル（テーブル風の枠） ===== */
.eig-panel {
  margin: 0 0 16px;
  background: var(--eig-panel-bg);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid var(--eig-frame-dark);
  border-bottom: 2px solid var(--eig-frame-dark);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.32);
}

.eig-panel-title {
  padding: 4px 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  background: var(--eig-titlebar-a);
  border-bottom: 1px solid #000000;
}

.eig-panel-body {
  padding: 12px;
  color: #000000;
  background: var(--eig-panel-body);
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
}

.eig-panel-body p {
  margin: 0 0 10px;
}

.eig-panel-body p:last-child {
  margin-bottom: 0;
}

/* リスト（創作物カテゴリ・日記一覧など） */
.eig-list {
  margin: 0;
  padding-left: 1.2em;
}

.eig-list li {
  margin: 0 0 6px;
}

/* ===== 日記記事（題名＋本文。js/diary.js が生成） ===== */
.diary-entry {
  margin: 0 0 16px;
  background: var(--eig-panel-bg);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid var(--eig-frame-dark);
  border-bottom: 2px solid var(--eig-frame-dark);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.32);
  scroll-margin-top: 12px;
}

.diary-entry-title {
  margin: 0;
  padding: 8px 12px;
  font-size: 16px;
  color: #ffffff;
  background: var(--eig-titlebar-a);
  border-bottom: 1px solid #000000;
}

.diary-entry-date {
  margin-right: 8px;
  color: var(--eig-yellow);
  font-family: "MS Gothic", "Courier New", monospace;
  font-size: 13px;
}

.diary-entry-body {
  padding: 12px;
  color: #000000;
  background: var(--eig-panel-body);
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  line-height: 1.75;
}

.diary-entry-body p {
  margin: 0 0 10px;
}

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

/* トップの「view more」等で飛んできた記事を一瞬強調 */
.diary-entry--target {
  outline: 2px solid var(--eig-yellow);
  box-shadow: 0 0 12px rgba(255, 226, 58, 0.55);
}

/* ===== 追加しやすい部品：NEWアイコン / 工事中 ===== */
.eig-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: bold;
  vertical-align: middle;
  border: 1px solid currentColor;
}

.eig-badge-new {
  color: #00c000;
  background: var(--eig-yellow);
}

.eig-badge-update {
  color: #ffffff;
  background: #d0006a;
}

/* 更新の目印（NEWアニメGIF）
   更新したコンテンツの横に置くだけ:
   <img class="new-icon" src="gif/new.gif" alt="NEW"> */
.new-icon {
  height: 14px;
  width: auto;
  margin-left: 5px;
  vertical-align: middle;
  image-rendering: pixelated;
}

/* ===== サブページ用BGMミニプレイヤー ===== */
.bgm-engine {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.bgm-mini {
  position: fixed;
  top: 40px;
  left: calc(50vw - (var(--eig-width) / 2) - 70px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 66px;
  padding: 4px 4px 8px;
  text-align: center;
  font-family: "MS Gothic", "Courier New", monospace;
}

.bgm-mini-label {
  color: #9fe6ff;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow:
    1px 1px 0 #001b62,
    0 0 6px rgba(65, 231, 255, 0.6);
}

.bgm-mini-buttons {
  display: flex;
  gap: 4px;
}

.bgm-mini-buttons button {
  position: relative;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  overflow: hidden;
  color: #000000;
  background: var(--eig-panel-bg);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  font-family: "MS Gothic", "Courier New", monospace;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
}

.bgm-mini-buttons button::before {
  content: "";
  display: block;
}

#bgmPlay::before,
.bgm-play::before {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 11px solid #000000;
}

#bgmStop::before,
.bgm-stop::before {
  width: 12px;
  height: 12px;
  background: #000000;
}

.bgm-mini-buttons button:hover,
.bgm-mini-buttons button:focus-visible,
.bgm-mini-buttons button:active {
  transform: translate(1px, 1px);
  border-top-color: #242424;
  border-left-color: #242424;
  border-right-color: #ffffff;
  border-bottom-color: #ffffff;
  box-shadow: inset 2px 2px 4px rgba(0, 0, 0, 0.45);
}

.bgm-mini-vol-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 104px;
  margin-top: 4px;
  overflow: hidden;
}

.bgm-mini-vol {
  width: 100px;
  height: 18px;
  margin: 0;
  transform: rotate(-90deg);
  cursor: pointer;
  accent-color: #41e7ff;
}

/* チャット入室ボタン（別ホストの comchat を別窓で開く） */
.chat-enter-button {
  display: inline-block;
  padding: 14px 30px;
  font-size: 18px;
  font-weight: bold;
  color: #000000;
  text-decoration: none;
  background: var(--eig-panel-bg);
  border-top: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  border-right: 3px solid var(--eig-frame-dark);
  border-bottom: 3px solid var(--eig-frame-dark);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
}

.chat-enter-button:hover,
.chat-enter-button:focus {
  color: #000000;
  filter: brightness(1.06);
  transform: translate(1px, 1px);
}

.chat-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--eig-grey);
}

.chat-frame-stack {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.chat-frame-window {
  overflow: hidden;
  background: var(--eig-panel-bg);
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #404040;
  border-bottom: 2px solid #404040;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.32);
}

.chat-frame-title {
  padding: 3px 7px;
  color: #ffffff;
  background: var(--eig-titlebar-a);
  border-bottom: 1px solid #000000;
  font-family: "MS Gothic", "Courier New", monospace;
  font-size: 12px;
  font-weight: bold;
}

.chat-frame {
  display: block;
  width: 100%;
  background: #ffffff;
  border: 0;
  border-top: 1px solid #808080;
}

.chat-frame-main {
  height: min(68vh, 720px);
  min-height: 480px;
}

.chat-frame-form {
  height: min(36vh, 360px);
  min-height: 240px;
}

.chat-frame-links {
  margin: 10px 0 0;
  font-size: 12px;
}

.eig-construction {
  margin: 16px 0 0;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  color: #201500;
  background: repeating-linear-gradient(45deg, #ffd21f 0 14px, #1a1200 14px 28px);
  border: 3px ridge #ffe680;
}

.eig-construction span {
  display: inline-block;
  padding: 2px 8px;
  background: #ffe23a;
}

/* ===== フッター ===== */
.eig-footer {
  padding: 10px 16px 14px;
  text-align: center;
  font-size: 12px;
  color: #000000;
  background: var(--eig-panel-bg);
  border-top: 2px solid #ffffff;
}

.eig-footer a {
  color: var(--eig-link);
}

.eig-copyright {
  margin: 6px 0 0;
}

@media (max-width: 1059px) {
  .bgm-mini {
    top: auto;
    bottom: 12px;
    left: 10px;
  }
}

/* ===== レスポンシブ：狭い画面はメニューを上に ===== */
@media (max-width: 640px) {
  body {
    padding: 8px 6px 30px;
  }

  .eig-body {
    flex-direction: column;
  }

  .eig-menu {
    flex-basis: auto;
    width: 100%;
    overflow: visible;
  }

  .eig-menu-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    max-height: none;
    overflow-y: visible;
  }

  .eig-menu-list li {
    margin: 0;
  }

  .eig-menu-item {
    grid-template-rows: 64px auto;
    min-height: 104px;
    padding: 8px 4px;
  }

  .eig-menu-icon-wrap {
    width: 60px;
    height: 60px;
  }

  .eig-menu-icon {
    width: 56px;
    height: 56px;
  }

  .eig-menu-label {
    font-size: 12px;
  }

}

@media (max-width: 420px) {
  .eig-menu-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eig-menu-item {
    grid-template-rows: 66px auto;
  }

  .eig-menu-icon-wrap {
    width: 66px;
    height: 66px;
  }

  .eig-menu-icon {
    width: 62px;
    height: 62px;
  }

  .eig-menu-label {
    font-size: 13px;
  }

}
