/*DB一覧表のセル幅指定*/
#db_data_list table.uk-table { margin: 0px; table-layout:fixed; }
#db_data_list div.uk-margin-bottom div:not(:first-child) { margin-top: -1px; }
#db_data_list div.uk-margin-bottom div:not(:first-child) tr:first-child{ visibility: collapse; }

#db_data_list table.uk-table tr th:nth-of-type(1) { width: 100px; }
#db_data_list table.uk-table tr th:nth-of-type(2) { width: 40px; }
#db_data_list table.uk-table tr th:nth-of-type(3) { width: 220px; }
#db_data_list table.uk-table tr th:nth-of-type(4) { width: 180px; }
#db_data_list table.uk-table tr th:nth-of-type(5) { width: 70px; }
/*
#db_data_list table.uk-table tr th:nth-of-type(6) { width: 10px; }
*/


/* ============================================================
 ↓テスト_dbの文字サイズ
 ============================================================*/
.uk-table {
  table-layout: fixed;
  width: 100%;
  font-size: 11px;
}

.uk-table td {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.uk-table img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}
/* ============================================================
 ↑テスト_dbの文字サイズ
 ============================================================*/


/*↓カード表示テスト*/
.card {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.8em;
  margin-bottom: 1em;
  background: #fff;
}
.card-header {
  border-bottom: 1px solid #eee;
  margin-bottom: 0.5em;
}
.card-title {
  font-weight: bold;
  margin: 0;
}
.card-sub {
  font-size: 0.85em;
  color: #666;
  margin: 0;
}
.card-body {
  font-size: 0.75em;
  line-height: 1.6;
}
/*↑カード表示テスト*/




/*説明用のdb表サイズ設定*/

/* ▼ DB一覧表のセル幅指定（db-list-common内だけ適用） */
.db-list-common table.uk-table {
  margin: 0px;
  table-layout: fixed;
}
/* ▼ 複数ブロックの隙間を詰める */
.db-list-common .uk-margin-bottom > div:not(:first-child) {
  margin-top: -1px;
}

/* ▼ 2つ目以降のテーブルの最初の行（ヘッダー）を非表示にする */
.db-list-common .uk-margin-bottom > div:not(:first-child) tr:first-child {
  visibility: collapse;
}
/* ▼ 列幅（1〜5列目） */
.db-list-common table.uk-table tr th:nth-of-type(1) { width: 100px; }
.db-list-common table.uk-table tr th:nth-of-type(2) { width: 40px; }
.db-list-common table.uk-table tr th:nth-of-type(3) { width: 220px; }
.db-list-common table.uk-table tr th:nth-of-type(4) { width: 180px; }
.db-list-common table.uk-table tr th:nth-of-type(5) { width: 70px; }
/* ▼ 必要があれば6列目も（コメント解除で使用可）
.db-list-common table.uk-table tr th:nth-of-type(6) { width: 10px; }
*/
/* Ndk : zukan リスト専用 列幅 */
.db-ndk-zukan table.uk-table tr th:nth-of-type(1) { width: 120px; }
.db-ndk-zukan table.uk-table tr th:nth-of-type(2) { width: 60px; }
.db-ndk-zukan table.uk-table tr th:nth-of-type(3) { width: 260px; }
.db-ndk-zukan table.uk-table tr th:nth-of-type(4) { width: 180px; }
.db-ndk-zukan table.uk-table tr th:nth-of-type(5) { width: 80px; }



/*画面の横割り分割*/
.flex-row {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 8px;
}

.flex-1 {
  flex: 2 !important;
  display: block !important;
}

.flex-2 {
  flex: 2 !important;
  display: block !important;
}
/* 3分割用 */
.flex-3 {
  flex: 1 !important;  /* 左・中央・右それぞれ1:1:1 */
  display: block !important;
}


/* ============================================================
 ↓見出し_部分編集
 ============================================================*/
/* タイトル見出し用 */
.title-main {
  font-size: 2.4em;
  font-weight: bold;
  color: #333;
  border-bottom: 3px solid #3399ff;
  padding-bottom: 8px;
  text-align: LEFT;
}
/* 見出しレベル1 */
h1 {
  background-color: #d6eaff;   /* 背景色 */
  color: #003366;              /* 文字色 */
  padding: 6px 12px;           /* 上下左右の余白 */
  text-indent: 12px; /* 文字の開始位置を右にずらす */
  border-radius: 4px;           /* 角丸（任意） */
  border-left: 6px solid #3399ff; /* 左側にアクセントバー */
}

/* 見出しレベル2 */
h2 {
  background-color: #ffe6e6;
  color: #990000;
  padding: 4px 10px;
  text-indent: 12px; /* 文字の開始位置を右にずらす */
  border-left: 4px solid #ff6666;
}
/* 見出しレベル3 */
h3 {
  background-color: #e0e0e0;
  color: #333333;
  padding: 3px 8px;
  text-indent: 12px; /* 文字の開始位置を右にずらす */
  border-left: 3px solid #999999;
}

/* 特定表だけ上揃え*/
.top-table table td, 
.top-table table th {
  vertical-align: top;
}

/* 親 div を行内にして高さをなくす */
.uk-text-right {
    display: inline-block; /* ブロックからインライン化 */
    margin: 0;
    padding: 0;
    height: 0;        /* 高さをなくす */
    line-height: 0;   /* 行間への影響を消す */
}

/* アイコンの元文字を消す */
.uk-text-right a {
    font-size: 0;
  	height: 0;        /* ここで高さを消す */
    line-height: 0;   /* 高さに影響する行間も消す */
    display: inline-block;
    position: relative;
}
/* 絵文字表示＆Y方向調整 */
.uk-text-right a::after {
    content: "✏️";
    font-size: 18px;
    position: absolute;  /* 絶対配置 */
    top: 50px;            /* 下方向に50pxずらす（調整可） */
    right: -32px;        /* 左端揃える */
}
/* ============================================================
 ↑見出し_部分編集
 ============================================================*/


/* ============================================================================================
 いちおう作成者ごと境界線
 ============================================================================================*/


/* ============================================================
 ↓ヘッダーに画像挿入するやつ
 ============================================================*/
div#site_header h1 {
    position: relative;
}

div#site_header h1 a {
    line-height: 40px;
    margin-left: 40px;
    padding-left: 5px;
}

div#site_header h1 a:before {
    position: absolute;
    content: "";
    width: 50px;
    height: 50px;
    background-image: url(https://img.wiki3.jp/roguelikecardbattle/%E3%83%98%E3%83%83%E3%83%80%E3%83%BC%E3%82%A2%E3%82%A4%E3%82%B3%E3%83%B3.png);
    background-size: contain;       /* ← アイコン全体を収める */
    background-repeat: no-repeat;   /* ← 繰り返し防止 */
    background-position: center;    /* ← 位置を中央に */
    display: block;
    top: 0%;
    border-radius: 15%;
}
/* ============================================================
 ↑ヘッダーに画像挿入するやつ
 ============================================================*/





/* ============================================================
 ↓右側に目次表示するやつ（PC画面用)
 ============================================================*/
#toc-target a.active-section {
    color: #ff0000 !important;
    font-weight: bold !important;
    border-left: 3px solid #ff0000;
    padding-left: 5px;
    background-color: #fff5f5;
}

/* PC表示時（768px以上）のレイアウト最適化 */
@media (min-width: 1000px) {
  
      /* 5. 画面右側に浮く目次の設定 */
  #floating-toc {
        position: fixed !important;
        top: 120px;
        right: 5px; /* 右端からの距離 */
        width: calc(50vw - 475px - 20px); /* 画面中央からコンテナ半分を引いた余白分 */
        min-width: 80px; /* 狭くなりすぎないよう最小幅を設定 */
        max-width: 300px; /* 広くなりすぎないよう最大幅を設定 */
        max-height: 80vh;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #ddd;
        padding: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        z-index: 1000;
        border-radius: 4px;
        box-sizing: border-box;
    }
  
    /* 目次のタイトルと最小化ボタン */
    .toc-title {
        font-size: 16px;
        font-weight: bold;
        margin-bottom: 10px;
        border-bottom: 2px solid #eee;
        color: #333;
        padding-bottom: 5px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    #toc-toggle {
        font-size: 11px;
        color: #888;
        cursor: pointer;
        font-weight: normal;
    }
    #toc-toggle:hover { color: #333; }

    /* 目次内の各項目の区切り線 */
    #toc-target div {
        border-bottom: 3px solid #eee;
        padding: 4px 0;
    }
    #toc-target div:last-child { border-bottom: none; }

    /* 目次内のリンク文字（文字溢れ対策込み） */
    #toc-target a {
        font-size: 13px;
        color: #0077bb;
        text-decoration: none;
        display: block;
        line-height: 1.4;
        /* --- 文字溢れ対策 --- */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    /* 2. マウスをのせた時（ホバー時）の設定 */
    #toc-target a:hover {
      color: #005588 !important;   /* 少し濃い青色に */
      font-weight: bold !important; /* 太字にする */
      background-color: #f0f8ff;    /* ほんのり薄い水色背景 */
      text-decoration: none;        /* 下線は不要（太字で十分目立つため） */
    }
    /* 現在地ハイライトの色設定 */
    #toc-target a.active-section {
        color: #ff6600 !important; /* 目立つオレンジ */
        font-weight: bold !important;
        border-left: 2px solid #ff6600;
        padding-left: 4px;
    }
    #toc-target a:hover { background-color: #f9f9f9; }

    /* --- 字下げ設定 --- */
    .toc-page-name { padding-left: 0px !important; font-weight: bold; }
    .toc-h1 { padding-left: 8px !important; }
    .toc-h2 { padding-left: 18px !important; font-size: 0.95em !important; }
    .toc-h3 { padding-left: 28px !important; font-size: 0.9em !important; color: #666; }
  　
}
/* ============================================================
 ↑右側に目次表示するやつ（PC画面用)
 ============================================================*/



/* ============================================================
 ↓右側に目次表示するやつ（スマホ画面用)
 ============================================================*/

@media (max-width: 1000px) {
    #floating-toc {
        display: block !important;
        position: fixed !important;
        top: 0 !important;
        right: -100% !important; 
        width: 70vw !important; 
        height: 100vh !important;
        max-height: 100vh !important;
        background: #fff !important;
        z-index: 100000 !important;
        transition: right 0.3s ease-in-out !important;
        box-shadow: -5px 0 15px rgba(0,0,0,0.2) !important;
        padding: 0 !important; 
        overflow-y: auto !important;
        border: none !important;
        border-radius: 0 !important;
    }

    #floating-toc.is-open {
        right: 0 !important;
    }

    /* 目次内のヘッダー */
    .toc-title {
        background: #f8f8f8;
        padding: 20px;
        font-size: 18px !important; 
        border-bottom: 1px solid #eee;
        margin-bottom: 0 !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky !important; /* スクロールしても上部に張り付く */
        top: 0;                      /* 張り付く位置 */
        z-index: 10;                 /* 項目より上に表示 */
    }

    /* ×ボタン */
    #toc-toggle {
        font-size: 24px !important;
        color: #333 !important;
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        background: #eee;
        border-radius: 50%;
        cursor: pointer;
    }

    /* 項目全体のリスト：左右のパディングを0にしてaタグを端まで届かせる */
    #toc-target {
        padding: 10px 0 !important;
    }

    /* 項目ごとの枠：ここもパディングを0にする */
    #toc-target div {
        border-bottom: 1px solid #f0f0f0 !important;
        padding: 0 !important; 
        margin: 0 !important;
    }

    /* 【重要】当たり判定を横いっぱいに広げる設定 */
    #toc-target a {
        display: block !important;    /* 1行まるごとボタン化 */
        width: 100% !important;
        padding: 10px 20px !important; /* リンクの内側に余白を作る（タップしやすさUP） */
        font-size: 16px !important; 
        line-height: 1.4 !important;
        white-space: normal !important; 
        text-overflow: clip !important;
        overflow: visible !important;
        box-sizing: border-box !important; /* paddingを幅に含める */
        text-decoration: none !important;
        color: #0077bb;
    }

    /* タップした瞬間に背景色を変えてフィードバックを出す */
    #toc-target a:active {
        background-color: #f0f0f0 !important;
    }

    /* JSで付与されるクラスに基づいた字下げ調整 */
    #toc-target .toc-page-name a { padding-left: 20px !important; }
    #toc-target .toc-h1 a { padding-left: 20px !important; }
    #toc-target .toc-h2 a { padding-left: 35px !important; } /* 字下げをaのpaddingで制御 */
    #toc-target .toc-h3 a { padding-left: 50px !important; }

    /* 三本線ボタン */
    #sp-toc-open-btn {
        position: fixed !important;
        right: 0 !important;
        top: 50% !important;
        width: 50px !important;
        height: 60px !important;
        background: rgba(0, 0, 0, 0.7) !important;
        color: #fff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 10px 0 0 10px !important;
        z-index: 99999 !important;
        cursor: pointer !important;
        font-size: 30px !important;
    }

    #sp-toc-overlay {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background: rgba(0, 0, 0, 0.5) !important;
        display: none;
        z-index: 99999 !important;
    }
}
/* ============================================================
 ↑右側に目次表示するやつ（スマホ画面用)
 ============================================================*/









/* ============================================================
   ↓表示切り替えシステム（クリーン版・特定ページのみ表示対応）
   ============================================================ */

/* 1. ボタン：機能に特化 */
#content-toggler {
    display: none; /* 初期は非表示（JSで生成・制御） */
    position: fixed;
    right: 20px;
    bottom: 50px;
    z-index: 1001;
    background: #ff0000;
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 25px;
    border: none !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
}

/* JSによって生成された場合に表示を許可 */
body #content-toggler {
    display: block;
}

#content-toggler.is-active {
    background: #444;
}

/* 2. コンテンツ制御：Wikiの自動整形による余白を「相殺」する */
.toggle-wrapper {
    display: block !important;
    /* Wikiの空行を相殺するための補正 */
    margin-top: -1em !important;
    margin-bottom: -1.6em !important;
}

/* 内部のゴミ（自動改行）を掃除 */
.toggle-wrapper br, 
.toggle-wrapper p:empty {
    display: none !important;
}

/* 切り替え対象の共通設定 */
.content-a, .content-b {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. 切り替えロジック：もっとも標準的な書き方 */
.content-b { display: none !important; }

/* 補足：フェードイン（JS）と喧嘩しないよう、body:hasによる消去は予備として保持 */
body:has(#content-toggler.is-active) .content-a { display: none !important; }
body:has(#content-toggler.is-active) .content-b { display: block !important; }


/* ============================================================
  ↑ 表示切り替えシステム（クリーン版・特定ページのみ表示対応）
   ============================================================ */





/* =========================================
   ↓呪文（<div id="layout-spell-wide">）と、末尾</div>があるページのみ適用
   ========================================= */

/* PC・タブレットサイズ以上で適用 */
@media (min-width: 600px) {

    /* 1. サイト全体の枠の制限を解除し、左寄せにする */
    body.custom-wide-mode div.uk-container.uk-container-center {
        max-width: none !important;
        width: 100% !important;      /* 画面いっぱいを使う */
        margin-left: 0 !important;   /* ★左寄せ設定 */
        margin-right: auto !important;
        padding-left: 10px !important; 
    }

    /* 2. グリッドを強制的に左詰めの横並びにする */
    body.custom-wide-mode .uk-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
    }

    /* 3. 左メニュー（px指定で固定） */
    body.custom-wide-mode #wiki_menu {
        width: 220px !important;       /* ★メニュー幅 */
        min-width: 220px !important;
        flex: 0 0 220px !important;    
    }

    /* 4. メインコンテンツ（残りの余白に対する割合） */
    body.custom-wide-mode .main_content {
        /* 計算式： ( 全体100% - メニュー300px ) × 割合(0.8) */
        width: calc((100% - 220px) * 0.79) !important; 
        
        flex: 0 0 auto !important; 
    }
}
/* =========================================
   ↑呪文（<div id="layout-spell-wide">）があるページのみ適用
   ========================================= */
