/* =========================================================
   genesis/web-app/styles/page-document.css
   対象: flowchart.html, manual.html, legal.html, maintenance.html
========================================================= */

/* --- flowchart.html（サイバーフローチャート専用スタイル） --- */
body.flowchart-page {
    padding: 20px;
}

.cyber-flow-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto 60px auto;
    padding-right: 50px;
    box-sizing: border-box;
    position: relative;
    /* 箱の影（ドロップシャドウ）を全体にかけることで立体感を出します */
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.8));
}

.flowchart-main-title {
    margin: 0;
    font-size: 2.8em;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-family: 'Cinzel', serif;
    text-align: center;
    transform: translateX(-0.5em);
    user-select: none;
    cursor: default;
    color: var(--tip-yellow);
}

.flowchart-subtitle {
    margin-top: 10px;
    transform: translateX(-1.75em);
}

/* 作戦A＆色の変更：ノード（各ステップの箱） */
.flow-node {
    position: relative;
    padding: 30px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    z-index: 2;
    /* ハサミ（clip-path）で角を斜めに切り落とし、サイバーな形にします */
    clip-path: polygon(20px 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%, 0 20px);
    /* 外側の枠色（ベースはシアン） */
    background: var(--title-b);
}

/* 分岐・エネルギー・ゴールなど色違いの対応 */
.flow-node.flow-branch-box {
    background: var(--accent-amber);
}

.flow-node.energy-node {
    background: var(--tip-yellow);
}

/* ガラスのようなホログラム背景（枠線を残すために1px小さく切り欠く魔法です） */
.flow-node::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.15) 0%, rgba(5, 10, 8, 0.95) 100%);
    clip-path: polygon(19px 0, 100% 0, 100% calc(100% - 19px), calc(100% - 19px) 100%, 0 100%, 0 19px);
    z-index: -2;
}

/* 分岐用のガラス背景の色味調整 */
.flow-node.flow-branch-box::before {
    background: linear-gradient(135deg, rgba(230, 171, 8, 0.15) 0%, rgba(10, 8, 5, 0.95) 100%);
}

.flow-node.energy-node::before {
    background: linear-gradient(135deg, rgba(234, 2, 255, 0.15) 0%, rgba(10, 5, 10, 0.95) 100%);
}

/* 作戦B：透かし文字（背景に大きく番号を浮かび上がらせます） */
.flow-node::after {
    content: attr(data-watermark);
    position: absolute;
    top: -12px;
    right: 15px;
    font-size: 5.5rem;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    color: rgba(255, 255, 255, 0.04);
    z-index: -1;
    pointer-events: none;
    user-select: none;
}

/* 作戦D：マウスを乗せたときのスキャン演出 */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 15px 5px var(--title-b);
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.flow-node:hover .scan-line {
    animation: scanAnimation 1.2s ease-in-out;
}

@keyframes scanAnimation {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.flow-node.flow-branch-box .scan-line {
    box-shadow: 0 0 15px 5px var(--accent-amber);
}

.flow-node.energy-node .scan-line {
    box-shadow: 0 0 15px 5px var(--tip-yellow);
}


/* テキスト装飾 */
.flow-title {
    color: var(--title-purple);
    font-size: 1.2rem;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

body.lang-ja .flow-title {
    font-family: 'Noto Serif JP', serif;
}

.text-cyan {
    color: var(--primary-cyan) !important;
}

.text-amber {
    color: var(--accent-amber) !important;
}

.text-magenta {
    color: var(--banner-color) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-yellow {
    color: var(--title-cyberyellow) !important;
}

.flow-step-badge {
    display: inline-block;
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent-amber);
    border: 1px solid var(--accent-amber);
    padding: 4px 12px;
    border-radius: var(--radius);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.badge-magenta {
    background: rgba(234, 2, 255, 0.15);
    color: var(--danger);
    border-color: var(--danger);
}

body.lang-ja .flow-step-badge {
    font-family: 'Noto Serif JP', serif;
}

.flow-desc {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 15px;
    font-family: 'Noto Serif JP', serif;
    text-align: left;
}

.flow-desc-start {
    font-size: 1.25rem;
    text-align: center;

}

/* 作戦C：ノード同士をつなぐ直線と流れる光の粒 */
.flow-line {
    width: 5px;
    height: 40px;
    background: rgba(0, 229, 255, 0.2);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.flow-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: var(--title-a);
    box-shadow: 0 0 10px 15px var(--title-a);
    animation: lineShoot 1.5s infinite linear;
}

@keyframes lineShoot {
    0% {
        top: -20px;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* 分岐の選択肢（Yes/No） */
.branch-options {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    justify-content: center;
}

.branch-option {
    flex: 1;
    background: rgba(0, 0, 0, 0.6);
    border: 1px dashed #666;
    border-radius: var(--radius);
    padding: 20px 10px 15px 10px;
    position: relative;
    transition: all 0.3s ease;
}

.branch-option:hover {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.branch-label {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: var(--accent-amber);
    padding: 2px 12px;
    font-weight: bold;
    font-family: monospace;
    border: 1px solid var(--accent-amber);
    border-radius: 12px;
    font-size: 0.85rem;
}

.branch-result {
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: bold;
    font-family: 'Noto Serif JP', serif;
}

/*
.branch-result:hover {
    color: var(--bg-color);
}
*/

/* ==========================================
   ワープトンネル（ループ線）の設定
========================================== */
.loop-wrapper {
    position: relative;
    width: 100%;
}

.warp-tunnel {
    position: absolute;
    top: 60px;
    bottom: 60px;
    right: -40px;
    width: 40px;
    border-top: 3px dashed var(--tip-yellow);
    border-right: 3px dashed var(--tip-yellow);
    border-bottom: 3px dashed var(--tip-yellow);
    border-radius: 0 20px 20px 0;
    z-index: 1;
    animation: tunnelPulse 2s infinite;
}

@keyframes tunnelPulse {

    0%,
    100% {
        box-shadow: 5px 0 10px rgba(204, 255, 0, 0.2), inset 5px 0 10px rgba(204, 255, 0, 0.2);
    }

    50% {
        box-shadow: 5px 0 25px rgba(204, 255, 0, 0.7), inset 5px 0 25px rgba(204, 255, 0, 0.7);
    }
}

/* 下から上へ駆け上がるワープ光（突き抜け防止修正済み） */
.warp-particle {
    position: absolute;
    bottom: 0;
    right: -5px;
    width: 7px;
    height: 40px;
    background: #fff;
    box-shadow: 0 0 15px 5px #fff, 0 0 30px 10px var(--tip-yellow);
    border-radius: 10px;
    /* 修正点：突き抜けないように到達点を100% - 40pxに計算します */
    animation: warpShoot 1.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

@keyframes warpShoot {
    0% {
        bottom: 0;
        opacity: 0;
        height: 10px;
    }

    10% {
        opacity: 1;
        height: 40px;
    }

    90% {
        opacity: 1;
        height: 40px;
    }

    100% {
        bottom: calc(100% - 40px);
        opacity: 0;
        height: 10px;
    }
}

/* スマホ表示時の調整 */
@media (max-width: 600px) {
    .cyber-flow-container {
        padding-right: 30px;
    }

    .warp-tunnel {
        right: -25px;
        width: 25px;
    }

    .branch-options {
        flex-direction: column;
        gap: 25px;
    }

    .flow-node::after {
        font-size: 4rem;
        /* スマホでは透かし文字を少し小さくします */
    }
}

/* --- manual.html（ビギナーズガイド専用スタイル） --- */

/* 1. ページ全体とお部屋の広さの設定 */
body.manual-page {
    padding: 40px 20px;
}

/* お部屋の横幅を広げ、大きな写真や動画がゆったり収まるようにしています */
.manual-page .container {
    max-width: 1150px;
    position: relative;
}

/* 2. ページ上部の見出し部分 */
.manual-page .header {
    text-align: center;
    margin-bottom: 40px;
}

.manual-page .header h1 {
    color: var(--primary-cyan);
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: 800;
    font-family: 'Cinzel', serif;
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--primary-glow);
    text-transform: uppercase;
}

.manual-page .header p {
    color: var(--accent-amber);
    margin: 0;
    font-size: 1.1em;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 1px;
}

/* 3. 各項目のカード枠とタイトル */
.manual-page .step-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 4px 10px rgba(0, 0, 0, 0.5);
    position: relative;
}

.manual-page .step-title {
    color: var(--primary-cyan);
    font-size: 1.4em;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-dark);
    padding-bottom: 10px;
    font-weight: bold;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

/* 本文ブロックの余白と文字フォント設定 */
div.lang-en,
div.lang-ja {
    margin-bottom: 20px;
}

.manual-page .lang-ja {
    font-family: 'Noto Serif JP', serif;
}

/* 4. 注意書き・警告枠・リンクの装飾 */
.manual-page .note-box {
    background: rgba(230, 171, 8, 0.05);
    border-left: 4px solid var(--accent-amber);
    padding: 15px;
    margin-top: 20px;
    border-radius: var(--radius);
    font-size: 0.9em;
    color: var(--text-main);
    box-shadow: inset 0 0 10px rgba(230, 171, 8, 0.1);
}

.manual-page .note-box-title {
    color: var(--accent-amber);
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
}

.manual-page .warning-box {
    background: rgba(255, 68, 68, 0.05);
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: inset 0 0 15px rgba(255, 68, 68, 0.1);
}

.manual-page .warning-title {
    color: var(--danger);
    font-size: 1.3em;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--danger-glow);
}

.manual-page .migration-link {
    color: var(--primary-cyan);
    font-weight: bold;
    text-decoration: underline;
    transition: 0.3s;
    display: inline-block;
    margin-top: 10px;
}

.manual-page .migration-link:hover {
    color: #fff;
    text-shadow: 0 0 10px var(--primary-glow);
}

/* =========================================================
   ビギナーズガイド：ヒント画像の2枚横並び枠（ルール38準拠）
========================================================= */
.tips-image-row {
    display: flex;
    gap: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
}

.tips-image-row img {
    width: calc(50% - 10px);
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    display: block;
    transition: all 0.3s ease;
}

.tips-image-row img:hover {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* スマートフォンなどの狭い画面では縦並びに切り替えます */
@media (max-width: 768px) {
    .tips-image-row {
        flex-direction: column;
    }

    .tips-image-row img {
        width: 100%;
    }
}

/* 5. 2段組みレイアウト（左側に画像、右側に説明文） */
.manual-flex-row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 15px;
}

/* スクリーンショットを約1.5倍に広げる設定です */
.manual-col-media {
    flex: 0 0 65%;
    max-width: 65%;
}

.manual-col-media img.screenshot {
    width: 100%;
    height: auto;
    margin: 0;
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    filter: brightness(0.9);
    transition: all 0.3s ease;
}

.manual-col-media img.screenshot:hover {
    filter: brightness(1.05);
    border-color: var(--primary-cyan);
}

/* 右側の説明文エリア */
.manual-col-content {
    flex: 1;
    min-width: 0;
    color: var(--text-main);
    line-height: 1.8;
}

.manual-col-content ol,
.manual-col-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.manual-col-content li {
    margin-bottom: 8px;
}

/* 6. 公式動画ガイド（YouTubeファサード方式） */
.video-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.video-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.video-card-title {
    color: var(--accent-amber);
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 12px;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 0.5px;
}

.video-facade {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 の画面比率を保ちます */
    background-color: #000000;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-dark);
    transition: border-color 0.3s ease;
}

.video-facade:hover {
    border-color: var(--primary-cyan);
}

.video-facade-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.85);
    transition: filter 0.3s ease;
}

.video-facade:hover .video-facade-thumb {
    filter: brightness(1);
}

.video-facade-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 48px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    transition: background 0.3s ease, transform 0.3s ease;
}

.video-facade:hover .video-facade-play-btn {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-facade-play-btn::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 18px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 4px;
}

.video-facade iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 7. スマートフォンなどの画面が小さいときの設定 */
@media (max-width: 768px) {
    .manual-flex-row {
        flex-direction: column;
    }

    .manual-col-media {
        max-width: 100%;
        width: 100%;
    }
}

/* --- legal.html --- */
body.legal-page {
    background: radial-gradient(circle at 50% 50%, #1a1b26 0%, #050505 100%);
    padding: 40px 20px;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(20, 25, 30, 0.9) 0%, rgba(5, 5, 10, 0.98) 100%);
    padding: 40px;
    border: 1px solid #333;
    border-top: 2px solid #00C851;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.legal-container h1 {
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    letter-spacing: 4px;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
    margin-bottom: 30px;
    font-size: 2rem;
}

.legal-container h2 {
    font-family: 'Cinzel', serif;
    color: #00C851;
    border-bottom: 1px solid rgba(0, 200, 81, 0.3);
    padding-bottom: 8px;
    margin-top: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 1.4rem;
}

.legal-container h3 {
    font-family: 'Cinzel', serif;
    color: #FFD700;
    margin-top: 30px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 1.1rem;
    border-left: 3px solid #FFD700;
    padding-left: 10px;
}

.legal-container p {
    color: #d0d0d0;
    font-size: 0.95rem;
    margin: 10px 0;
    line-height: 1.8;
}

/* 日本語フォントの適用 */
.legal-container .lang-ja,
.legal-container p.lang-ja,
.legal-container div.lang-ja {
    font-family: 'Noto Serif JP', serif;
    color: #e0e0e0;
}

.legal-container .critical-box {
    background: rgba(255, 68, 68, 0.07);
    border: 1px dashed #ff4444;
    border-left: 4px solid #ff4444;
    padding: 15px 20px;
    margin: 25px 0;
    border-radius: 4px;
}

.legal-container .critical-box p {
    color: #ffaaaa;
    margin: 0;
}

.legal-container ul {
    padding-left: 20px;
    margin: 10px 0;
}

.legal-container li {
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.6;
}

.legal-container a {
    color: #FFD700;
    text-decoration: none;
    transition: 0.3s;
}

.legal-container a:hover {
    text-shadow: 0 0 8px #FFD700;
    text-decoration: underline;
}

.legal-container .footer-nav {
    text-align: center;
    margin-top: 50px;
}

.legal-container .btn-return {
    background: #111;
    color: #00C851;
    padding: 12px 30px;
    border: 1px solid #00C851;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    letter-spacing: 2px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.4s;
    cursor: pointer;
    border-radius: 4px;
}

.legal-container .btn-return:hover {
    background: #003311;
    box-shadow: 0 0 20px rgba(0, 200, 81, 0.4);
    color: #fff;
}

/* legal.html内でstyle直書きだった要素をクラス化 */
.legal-operator-info {
    margin-top: 20px;
    font-size: 1rem;
}

.legal-last-updated {
    margin-top: 30px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.legal-btn-container {
    text-align: center;
}

/* --- maintenance.html --- */
body.maintenance-page {
    justify-content: center;
    padding: 20px;
}

.maintenance-page .main-title {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--danger);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 0 20px var(--danger-glow);
    font-family: 'Cinzel', serif;
    text-align: center;
    user-select: none;
    cursor: default;
}

.maintenance-page .main-title .lang-ja,
.maintenance-page .subtitle .lang-ja,
.maintenance-page .card h2 .lang-ja {
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 2px;
}

.maintenance-page .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    letter-spacing: 3px;
    margin-top: 10px;
    margin-bottom: 40px;
    text-transform: uppercase;
    text-align: center;
    font-weight: bold;
}

.maintenance-page .card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 68, 68, 0.3);
    border-radius: var(--radius);
    box-shadow: inset 0 0 30px rgba(255, 68, 68, 0.05), 0 10px 30px rgba(0, 0, 0, 0.8);
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    max-width: 600px;
    width: 100%;
    box-sizing: border-box;
}

.maintenance-page .card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--danger);
    box-shadow: 0 0 15px var(--danger);
    animation: pulseDanger 2s infinite;
}

@keyframes pulseDanger {
    0% {
        opacity: 0.5;
        box-shadow: 0 0 5px var(--danger);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 20px var(--danger);
    }

    100% {
        opacity: 0.5;
        box-shadow: 0 0 5px var(--danger);
    }
}

.maintenance-page .card h2 {
    margin: 0 0 20px 0;
    color: #fff;
    font-size: 1.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.maintenance-page .card p {
    color: var(--text-main);
    line-height: 1.8;
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 35px;
}

.maintenance-page .card p.lang-ja {
    font-family: 'Noto Serif JP', serif;
}