/* 自作・フリーフォントファイルを読み込む場合 */
@font-face {
  font-family: 'DotMincho16';
  src: url('KH-Dot-Kagurazaka-16.ttf') format('truetype');
}

/* 適用するクラスや要素 */
.dot-mincho-text {
  font-family: 'DotMincho16', serif;
  font-size: 16px; /* ドット感を活かすためジャストサイズか倍率で調整 */
}


/* --- 基本設定 & カラーパレット --- */
:root {
    --bg-color: #0b0b0b;       /* 漆黒 */
    --primary-red: #b8001c;    /* ロゴの深い赤 */
    --accent-gray: #1a1a1a;    /* コンテンツ背景用 */
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --font-pixel: 'Courier New', Courier, monospace; /* ドット感を出すフォント */
    --font-dotmincho: 'ドット明朝16', 'DotMincho16', serif; /* 本文以外用フォント */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
    scroll-behavior: smooth; /* スムーズスクロール */
}

html {
    height: 100%;
    background: var(--bg-color);
}

body {
        margin: 0;
        /* 背景は画像のみ指定（背景色は個別ページで必要なら上書きしてください） */
        background-image: url('bg.png');
        background-repeat: no-repeat;
        background-position: top center;
        background-attachment: fixed;  /* JSで位置を制御するため固定 */

        color: var(--text-light);
        line-height: 1.6;

        /* ドット絵用のくっきり設定 */
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        min-height: 100vh;
        background-color: var(--bg-color);
}

/* 固定背景用の要素（モバイルでこれを有効にする） */
.fixed-bg {
    display: none; /* デフォルトは非表示（デスクトップはbody背景を使用） */
}


/* --- ナビゲーション & ハンバーガーメニュー --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(11, 11, 11, 0.95);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    border-bottom: 2px solid var(--primary-red);
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    font-weight: bold;
    color: var(--primary-red);
    font-size: 1.5rem;
    text-decoration: none;
    font-family: var(--font-pixel);
}

/* 本文以外に使用するフォント設定（ドット明朝16、サイズ16px 指定） */
h1, h2, h3, h4, h5, h6,
.nav-logo, .nav-links a,
.info-badge, .rule-step h3, .subheading,
.item-card p, .tool-card::after, .role-card::after,
.tool-modal-head h3, .tool-modal-section h4,
.btn-cta, .btn-submit,
label, .form-group label, .footer-social a {
    font-family: var(--font-dotmincho);
    font-size: 16px;
}

.nav-logo img {
    height: 34px;
    width: auto;
    display: block;
    image-rendering: pixelated;
}

/* デスクトップ用メニュー（初期状態は非表示、スマホ優先） */
.nav-links {
    display: none;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-red);
}

/* ハンバーガーアイコン */
.hamburger {
    display: block;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 110;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    margin: 5px 0;
    transition: 0.3s;
}

/* モバイル用ドロワーメニュー */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background-color: rgba(11, 11, 11, 0.98);
    border-left: 2px solid var(--primary-red);
    padding-top: 80px;
    transition: 0.3s;
    z-index: 105;
}

/* ハンバーガーメニューのフォントをドット明朝に変更 */
.mobile-menu, .mobile-menu a, .mobile-menu .menu-link {
    font-family: var(--font-dotmincho);
    font-size: 16px;
}

/* モバイルメニューの右上に表示する閉じるボタン */
.mobile-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 120;
}

.mobile-close:hover,
.mobile-close:focus-visible {
    color: var(--primary-red);
    outline: 2px solid rgba(184,0,28,0.18);
    border-radius: 6px;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.mobile-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: bold;
}

/* ハンバーガーアニメーション用 */
.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* --- ヒーローセクション（ファーストビュー） --- */
.hero {
    padding: 120px 20px 60px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* ↓現在あるコード（パソコン用のサイズは260pxのまま維持） */
.hero img {
    max-width: 260px;
    width: 100%;
    image-rendering: pixelated;
    margin-bottom: 20px;
}

/* 📱 ここから下を追加：画面の横幅が768px以下のとき（スマホ）の設定 */
@media screen and (max-width: 768px) {
    .hero img {
        max-width: 160px; /* ★スマホでのロゴの最大横幅。お好みで数値を調整してください */
        margin-bottom: 15px; /* スマホ用に下の余白も少しだけ狭く調整 */
    }
}


.hero h1 {
    font-size: 1.4rem;
    color: #ffffff !important;
    margin-bottom: 15px;
    font-weight: bold;
    letter-spacing: 1px;
}

header.hero h1 {
    color: #ffffff !important;
}

.hero .intro-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* CTAボタン */
.btn-cta {
    display: inline-block;
    background-color: var(--primary-red);
    color: #fff;
    padding: 15px 40px;
    font-weight: bold;
    text-decoration: none;
    border: 3px solid #000;
    box-shadow: 4px 4px 0px #fff;
    transition: 0.2s;
    text-transform: uppercase;
}

.btn-cta:active {
    box-shadow: 0px 0px 0px #fff;
    transform: translate(4px, 4px);
}

/* countdown */
.countdown{
  display:flex;gap:clamp(10px,2.4vw,26px);justify-content:center;flex-wrap:wrap;
}
.count-block{
  background:var(--navy-panel);border:1px solid var(--navy-line);
  padding:14px clamp(14px,2.4vw,22px);min-width:76px;
}
.timer-num{display:block;font-size:clamp(1.6rem,3.6vw,2.4rem);color:var(--red-bright);}
.count-block span.label{display:block;font-size:.68rem;color:var(--ink-dim);margin-top:6px;letter-spacing:.1em;}
 
.scroll-cue{position:absolute;bottom:26px;left:50%;transform:translateX(-50%);font-size:.7rem;color:var(--blue-grey);z-index:2;}
 

/* --- 各コンテンツ共通スタイル --- */
section {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    font-size: 1.6rem;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 30px;
    font-family: var(--font-dotmincho);
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background-color: var(--primary-red);
    margin: 10px auto 0;
}

/* --- シンプルなルール概要 --- */
.info-badge-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.info-badge {
    background: var(--accent-gray);
    border: 1px solid #333;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-light);
}

.rule-step {
    background-color: var(--accent-gray);
    border-left: 4px solid var(--primary-red);
    padding: 20px;
    margin-bottom: 15px;
}

.rule-step h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--primary-red);
}

.rule-step p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* 夜フェーズの「対抗」「奇襲」を少し大きく強調 */
.rule-step p.rule-term {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--text-light);
    margin-top: 10px;
}

/* --- アイテム＆役職ギャラリー --- */
.subheading {
    color: var(--primary-red);
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 40px 0 20px;
    font-family: var(--font-dotmincho);
}

.item-grid {
    display: grid;
    /* デスクトップでは4列に固定してカード幅をtool-rowと揃える */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

/* 道具カード：上段3枚・下段4枚 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

/* 各カードをグリッドセルいっぱいに広げ、正方形に保つ */
.tool-grid .item-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
}

.item-card {
    background-image: url('Dot_card_bg.png');
    border: 2px solid var(--primary-red);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-card:hover {
    transform: translateY(-4px);
}

.item-card img {
    width: 100%;
    height: auto;
    max-height: 70%;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin: 0 auto 8px;
}

.item-card p {
    font-size: 0.8rem;
    font-weight: bold;
    color: #111;
    margin: 6px 0 0;
}



/* --- 道具カード詳細モーダル --- */
.tool-card {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    cursor: pointer;

    /* 添付カード画像から切り出した背景テクスチャを使用 */
    background-color: #efd09a;
    background-image: url('Dot_card_bg.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* 道具カード・役職カードの絵は背景テクスチャの上にそのまま表示 */
.tool-card img,
.role-card img {
    background: transparent;
}

/* 令状の画像は上に寄って見えるため、少し下げる（数値を大きくするとさらに下がる） */
.tool-card[data-tool="warrant"] img {
    transform: translateY(10%);
}

/* 拳銃の画像は大きく見えるため、少し小さくする（1 より小さいほど小さくなる） */
.tool-card[data-tool="gun"] img {
    transform: scale(0.85);
}

/* 拳銃カードの画像：スマホ幅で右にずれるのを防ぐ */
@media (max-width: 767px) {
    .tool-card[data-tool="gun"] img {
        width: 100%;
        height: 68%;
        max-height: 68%;
        object-fit: contain;
        object-position: center;
        margin: 0 auto;
    }
}

/* 役職カードにも道具カードと同じ紙背景を使用 */
.role-card {
    background-color: #efd09a;
    background-image: url('Dot_card_bg.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.tool-card:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.role-card:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.tool-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.tool-modal.active {
    opacity: 1;
    visibility: visible;
}

.tool-modal-panel {
    position: relative;
    width: min(620px, 100%);
    max-height: min(82vh, 760px);
    overflow-y: auto;
    background: #111;
    border: 2px solid var(--primary-red);
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
    padding: 28px 22px 24px;
    transform: translateY(18px) scale(0.98);
    transition: transform 0.22s ease;
}

.tool-modal.active .tool-modal-panel {
    transform: translateY(0) scale(1);
}

.tool-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 38px;
    height: 38px;
    border: 1px solid #555;
    border-radius: 50%;
    background: #1d1d1d;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.tool-modal-close:hover,
.tool-modal-close:focus-visible {
    border-color: var(--primary-red);
    background: var(--primary-red);
    outline: none;
}

.tool-modal-head {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 20px;
    align-items: center;
    padding-right: 38px;
    margin-bottom: 22px;
}

.tool-modal-head img {
    width: 112px;
    height: auto;
    background: #fff;
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    padding: 8px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.tool-modal-head h3 {
    margin: 0 0 4px;
    color: var(--primary-red);
    font-size: 1.7rem;
    font-family: var(--font-pixel);
}

.tool-modal-count {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.tool-modal-value {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.tool-modal-value strong {
    margin-left: 4px;
    color: var(--primary-red);
    font-family: var(--font-pixel);
    font-size: 1.7rem;
    line-height: 1;
}

.tool-modal-section {
    background: var(--accent-gray);
    border-left: 4px solid var(--primary-red);
    border-radius: 6px;
    padding: 18px;
    margin-top: 14px;
}

.tool-modal-section h4 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 1rem;
    font-family: var(--font-pixel);
}

.tool-modal-section p,
.tool-modal-section li {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.tool-modal-section ul {
    padding-left: 20px;
}

.tool-modal-section li + li {
    margin-top: 7px;
}

.tool-modal-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 18px;
}

body.modal-open {
    overflow: hidden;
}


@media (max-width: 767px) {
    body {
        background-attachment: scroll !important;
        background-image: none !important;
        background-size: cover !important;
        background-position: top center !important;
        background-color: var(--bg-color);
    }
    .fixed-bg {
        display: block;
        position: fixed;
        inset: 0;
        z-index: -1;
        background-image: url('bg.png');
        background-size: cover;
        background-color: var(--bg-color);
        background-position: top center;
        background-repeat: no-repeat;
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        pointer-events: none;
        -webkit-backface-visibility: hidden;
        -webkit-transform: translateZ(0);
    }
    .hero {
        padding: 88px 1rem 20px;
    }
}

    .tool-row {
        gap: 8px;
        width: 100%;
    }

    .tool-row .item-card {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px;
        aspect-ratio: 1 / 1; /* モバイルでも正方形を維持 */
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }

    .tool-row .item-card img {
        width: 100%;
        height: auto;
    }

    .tool-row .item-card p {
        font-size: 0.68rem;
        margin-top: 2px;
    }

    /* 役職カード：モバイルでも横4列に収めてスクロール不要にする */
    .item-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        padding: 6px 6px;
        width: 100%;
    }

    /* カードをグリッドセルいっぱいに広げ、ボーダーやパディングを含めて収まるようにする */
    .item-grid .item-card {
        width: 100%;
        box-sizing: border-box;
        aspect-ratio: 1 / 1;
        padding: 6px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
    }

    .item-grid .item-card img {
        width: 100%;
        height: auto;
        max-height: 70%;
        object-fit: contain;
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        margin-bottom: 8px;
    }

    /* 背景がカードからはみ出して見えないようにする */
    .item-card {
        overflow: hidden;
    }
}

@media (max-width: 520px) {
    .tool-modal-panel {
        padding: 24px 16px 20px;
    }

    .tool-modal-head {
        grid-template-columns: 84px 1fr;
        gap: 14px;
    }

    .tool-modal-head img {
        width: 84px;
    }

    .tool-modal-head h3 {
        font-size: 1.35rem;
    }
}

/* --- 取置き予約フォーム --- */
.reserve-box {
    background-color: var(--accent-gray);
    border: 2px solid var(--primary-red);
    padding: 30px 20px;
    border-radius: 4px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    background-color: #0b0b0b;
    border: 1px solid #444;
    color: #fff;
    font-size: 1rem;
    border-radius: 4px;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary-red);
}

.btn-submit {
    width: 100%;
    background-color: var(--primary-red);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background-color: #8a0014;
}

/* --- フッター --- */
footer {
    text-align: center;
    padding: 40px 20px;
    font-size: 0.8rem;
    color: #555;
    border-top: 1px solid #222;
    background-color: var(--bg-color);
}

.footer-social {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-social a {
    color: var(--primary-red);
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-social a:hover {
    opacity: 0.8;
}


@media (max-width: 767px) {
    /* モバイルでは body の背景を無効化して、固定レイヤーを使う */
    body {
        /* bodyの背景は無効化して固定レイヤー `.fixed-bg` を使う（ただしbodyは高さ基準の固定挙動を維持） */
        background-image: none !important;
        background-attachment: fixed !important;
        background-size: auto 100% !important;
    }

    .fixed-bg {
        display: block;
        position: fixed;
        inset: 0;
        z-index: -1;
        background-image: url('bg.png');
        /* 元画像の縦横比を保ちながら高さをビューポートに合わせる */
        background-size: auto 100%;
        background-color: var(--bg-color);
        background-position: top center;
        background-repeat: no-repeat;
        image-rendering: pixelated;
        image-rendering: crisp-edges;
        pointer-events: none;
        -webkit-backface-visibility: hidden;
        -webkit-transform: translateZ(0);
    }

    /* モバイルではカード内のテキストを非表示にして画像を中央に配置 */
    .item-card p {
        display: none;
    }

    .item-card {
        justify-content: center; /* 画像を縦中央に */
        padding: 6px;
    }


    /* ===== rules.html specific styles (migrated) =====
       These styles were previously embedded in rules.html. Keeping them here
       ensures rules page uses the same stylesheet. If duplicates exist, later
       rules override earlier ones. */

    /* Page-specific hero sizing */
    .page-hero { padding: 120px 20px 40px; text-align:center; max-width:800px; margin:0 auto; }
    .page-hero h1 { font-size:1.6rem; color:var(--primary-red); margin-bottom:10px; font-family:var(--font-dotmincho); letter-spacing:1px; }
    .page-hero p { font-size:0.95rem; color:var(--text-muted); }

    /* Table of contents (rules page) */
    .toc { max-width:800px; margin: 20px auto; padding: 0 20px; }
    .toc-title { color: var(--text-light); font-family: var(--font-dotmincho); margin-bottom:8px; }
    .toc ul { list-style: none; display:flex; gap:10px; flex-wrap:wrap; }
    .toc a { color: var(--text-muted); text-decoration:none; font-size:0.95rem; padding:6px 10px; border-radius:6px; }
    .toc a:hover { background: rgba(184,0,28,0.08); color: var(--primary-red); }

    /* Effect grid defaults used by rules.html (already present but ensure parity) */
    .effect-grid { display:grid; grid-template-columns:1fr; gap:14px; }
    .effect-card { display:flex; gap:14px; align-items:flex-start; background-color:var(--accent-gray); border-left:4px solid var(--primary-red); border-radius:4px; padding:14px; }
    .effect-card img { width:56px; height:56px; object-fit:contain; background:#fff; border-radius:4px; padding:4px; flex-shrink:0; }
    .effect-card .effect-name { font-weight:bold; color:var(--primary-red); margin-bottom:4px; font-size:0.95rem; }

    /* Smaller table tweaks for rules page */
    .rule-table th, .rule-table td { border:1px solid #333; padding:8px 10px; text-align:center; color:var(--text-muted); }

    /* end migrated rules.html styles */

    /* --- rules-page specific size overrides to restore previous layout --- */
    .rules-page section {
        padding: 40px 20px; /* smaller vertical padding like original */
        max-width: 800px;
    }
    .rules-page .page-hero {
        padding: 120px 20px 40px; /* restore original hero spacing */
    }
    .rules-page h2 {
        font-size: 1.4rem; /* match previous size */
    }
    .rules-page .rule-box p, .rules-page .rule-box li {
        font-size: 0.92rem; /* ensure readable but not oversized */
    }
    .rules-page .effect-card img { width:56px; height:56px; }
    .rules-page .item-card img { max-height: 70%; }

    .item-card img {
        width: auto;
        height: 68%;
        max-height: 68%;
        object-fit: contain;
        margin: 0 auto;
        display: block;
    }
}

/* --- メディアクエリ（PC向け調整） --- */
@media (min-width: 768px) {
    .nav-links { display: flex; }
    .hamburger { display: none; }
    .mobile-menu { display: none; }
    .hero h1 { font-size: 2rem; }
    /* デスクトップでは役職カードを横4列に固定し、カードを正方形に揃える */
    .item-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 15px;
    }

    .item-grid .item-card {
        aspect-ratio: 1 / 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        padding: 8px;
    }
}
/* =========================================================
   rules.html 用スタイル（グローバル / 全画面幅で有効）
   ※以前このブロックはスマホ用メディアクエリ内に誤って
     入っていたため、PC幅で無効化されていました。
     こちらで正式にグローバルスコープに追加します。
   ========================================================= */

.rules-page .page-hero,
.page-hero {
    padding: 120px 20px 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.page-hero h1 {
    font-size: 1.6rem;
    color: var(--primary-red);
    margin-bottom: 10px;
    font-family: var(--font-dotmincho);
    letter-spacing: 1px;
}

.page-hero p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid var(--primary-red);
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.back-link:hover {
    background-color: var(--primary-red);
}

/* 目次（Table of Contents） */
.toc {
    max-width: 800px;
    margin: 20px auto;
    padding: 0 20px;
}

.toc-title {
    color: var(--text-light);
    font-family: var(--font-dotmincho);
    margin-bottom: 8px;
}

.toc ul {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #333;
}

.toc a:hover {
    background: rgba(184, 0, 28, 0.12);
    color: var(--primary-red);
    border-color: var(--primary-red);
}

/* テキストルール用ボックス */
.rule-box {
    background-color: var(--accent-gray);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 18px 20px;
    margin-bottom: 18px;
}

.rule-box p, .rule-box li {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.rule-box ul {
    padding-left: 20px;
}

.story-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.9;
}

h3.sub {
    font-size: 1.05rem;
    color: var(--primary-red);
    margin: 22px 0 10px;
    font-family: var(--font-dotmincho);
}

/* =========================================================
   背景：最初は画面いっぱい → スクロールに合わせてふわっと透明になる
   ---------------------------------------------------------
   ・背景画像(bg.png)を PC・スマホとも画面いっぱい(cover)に表示します。
   ・スクロール量に応じて不透明度を 1 → 0 に変化させます
     （CSSのスクロール連動アニメーション。JavaScript不要）。
   ・index.html 内のスクリプトが body に背景を直接書き込むため、
     body 自体の背景は消し、画像は ::before に移しています（HTML/JSは未変更）。
   ・ファイル内で後ろに置くことで、上にあるメディアクエリの指定にも勝ちます。
   ========================================================= */
:root {
    --bg-fade-distance: 80vh;   /* この距離をスクロールし終えると背景が完全に消える（小さいほど早く消える） */
}

body {
    background: none !important;
    background-color: transparent !important;   /* 黒地は html 側の背景色が担当 */
}

/* 共通：背景画像 */
body::before {
    content: '';
    z-index: -1;
    pointer-events: none;
    background-image: url('bg.png');
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    image-rendering: pixelated;
    image-rendering: crisp-edges;

    /* スクロール連動に未対応のブラウザ用：ページと一緒に流れ、下端をふわっと消す */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    -webkit-mask-image: linear-gradient(to bottom,
        rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%,
        rgba(0,0,0,0.6) 70%, rgba(0,0,0,0.2) 90%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to bottom,
        rgba(0,0,0,1) 0%, rgba(0,0,0,1) 45%,
        rgba(0,0,0,0.6) 70%, rgba(0,0,0,0.2) 90%, rgba(0,0,0,0) 100%);
}

/* スクロール連動アニメーションに対応しているブラウザ */
@supports (animation-timeline: scroll()) {
    body::before {
        position: fixed;
        inset: 0;
        width: auto;
        height: auto;
        -webkit-mask-image: none;
        mask-image: none;

        animation: dot-bg-fade linear both;
        animation-timeline: scroll(root block);
        animation-range: 0 var(--bg-fade-distance);
    }

    @keyframes dot-bg-fade {
        from { opacity: 1; }
        to   { opacity: 0; }
    }
}

/* 動きを減らす設定の人には、フェードせず背景を固定表示のままにする */
@media (prefers-reduced-motion: reduce) {
    @supports (animation-timeline: scroll()) {
        body::before {
            animation: none;
        }
    }
}

/* スマホ用の固定背景レイヤーは不要になるので非表示 */
.fixed-bg {
    display: none !important;
}

/* ブース情報ページ：販売物の画像（広い画面では横並び、狭い画面では縦並び） */
.package-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    align-items: center;
    margin: 12px 0;
}

.package-images img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ルールブックページ：PDF埋め込み表示 */
.rulebook-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 1100px;
    margin: 0 auto;
}

.rulebook-page h3 {
    margin-bottom: 10px;
}

.rulebook-pdf {
    display: block;
    width: 100%;
    aspect-ratio: 997.8 / 703;   /* PDFのページ比率に合わせる */
    min-height: 320px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #fff;
}

.rulebook-open {
    margin-top: 8px;
    text-align: center;
    font-size: 0.9rem;
}

.rulebook-open a {
    color: var(--primary-red);
    text-decoration: underline;
}

/* イベント情報ページ：イベントごとの枠（イベントを増やすときは .event を1つ足す） */
.event {
    width: calc(100% - 40px);
    max-width: 800px;
    margin: 30px auto 50px;
    border: 1px solid #333;
    border-left: 4px solid var(--primary-red);
    background-color: rgba(0, 0, 0, 0.45);
}

.event-title {
    margin: 0;
    padding: 14px 20px;
    text-align: left;
    font-size: 1.3rem;
    color: var(--text-light);
    background-color: var(--primary-red);
}

.event-title::after {
    display: none;   /* 通常の見出しの赤い下線は枠のタイトルでは不要 */
}

.event-body {
    padding: 24px 20px 10px;
}

.event-body .rule-box {
    margin-bottom: 14px;
}

/* 重要なブース情報（強調表示） */
.event-key {
    margin-bottom: 24px;
    padding: 16px 16px 14px;
    border: 2px solid var(--primary-red);
    border-radius: 6px;
    background-color: rgba(184, 0, 28, 0.14);
}

.event-key-title {
    margin-bottom: 12px;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--text-light);
}

.event-key-list {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 10px;
    margin: 0;
}

.event-key-item {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.55);
}

.event-key-item dt {
    margin-bottom: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.event-key-item dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--text-light);
}

/* ブース番号はさらに目立たせる */
.event-key-booth {
    border-color: var(--primary-red);
    background-color: var(--primary-red);
}

.event-key-booth dt {
    color: rgba(255, 255, 255, 0.85);
}

.event-key-booth dd {
    font-family: var(--font-dotmincho);
    font-size: 2rem;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

.event-key-note {
    margin: 12px 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* 枠の中の項目（見出し付き） */
.event-block + .event-block {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #333;
}

.event-block h3 {
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--primary-red);
}

@media (max-width: 600px) {
    .event-key-list {
        grid-template-columns: 1fr;
    }
}
/* 小さな通販セクション用スタイル（ページ固有） */
        

/* ルールブックページ：サマリーカード */
.summary-lead {
    margin-bottom: 24px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: bold;
    color: var(--text-light);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 860px;
    margin: 0 auto;
}

.summary-card {
    margin: 0;
    text-align: center;
}

.summary-card a {
    display: block;
    border: 2px solid var(--primary-red);
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
    background-color: #111;
    transition: transform 0.2s;
}

.summary-card a:hover {
    transform: translateY(-4px);
}

.summary-card img {
    display: block;
    width: 100%;
    height: auto;
}

.summary-card figcaption {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--text-light);
}

.summary-card figcaption span {
    margin-left: 6px;
    font-size: 0.75rem;
    font-weight: normal;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .summary-cards {
        grid-template-columns: 1fr;
        max-width: 420px;
    }
}

.shop-card {
    background-color: rgba(0, 0, 0, 0.45);
    border: 1px solid #333;
    border-left: 4px solid var(--primary-red);
}

.shop-title {
    color: var(--text-light);
}
.shop-price {
    color: var(--text-light);
}

.shop-desc {
    color: var(--text-muted);
}
/* 通販ページ */
.shop-section {
    max-width: 1000px;
    margin: 2.5rem auto;
    padding: 1rem;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.shop-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.45);
    border: 1px solid #333;
    border-left: 4px solid var(--primary-red);
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.shop-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #111;
}

.shop-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
}

.shop-title,
.shop-price {
    color: var(--text-light);
}

.shop-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.shop-desc {
    flex-grow: 1;
    margin: 0.25rem 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.shop-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.shop-price {
    font-size: 1.05rem;
    font-weight: 800;
}

.shop-cta {
    display: inline-block;
    padding: 0.6rem 0.9rem;
    color: #fff;
    background: linear-gradient(90deg, #b8001c, #e33a4e);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 600px) {
    .shop-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .shop-meta > div:last-child,
    .shop-cta {
        width: 100%;
    }

    .shop-cta {
        box-sizing: border-box;
        text-align: center;
    }
}
