* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: auto;
    /* 縦スクロールを有効に */
    overflow-x: hidden;
    /* 横スクロールは無効 */
    height: auto;
    /* 高さを自動に */
    min-height: 100vh;
    /* 最小高さは確保 */
    width: 100% !important;
}

/* グローバルヘッダーのスタイル */
#global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: white;
    padding: 15px 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: #000000;
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-title {
    color: white;
    font-size: 28px;
    font-weight: bold;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.header-title {
    font-size: 24px;
    margin: 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.header-title:hover {
    color: #ffc107;
    transform: scale(1.05);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: auto;
    /* 高さを自動に */
    min-height: 100vh;
    /* 最小高さは確保 */
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    /* 縦スクロールを有効に */
    overflow-x: hidden;
    /* 横スクロールは無効 */
    padding-bottom: 50px;
    /* 全体の下部に余白を追加 */
    margin-top: 60px;
    padding-top: 0;
}

.global-instruction {
    background-color: white;
    border: 3px solid #333;
    border-radius: 15px;
    padding: 15px;
    margin: 15px;
    text-align: center;
    flex-shrink: 0;
    /* 固定サイズ */
    position: sticky;
    /* スクロール時も固定表示 */
    top: 75px;
    /* ヘッダーの下に配置 */
    z-index: 999;
    /* ヘッダーより下、他の要素より上 */
}

.global-instruction .user-name {
    font-weight: bold;
}

.global-instruction {
    flex: 1;
    min-width: 0;
    /* flexboxの幅制限を解除 */
}

/* .column.questioner, .column.responder, .column.sender, .column.answerer {
            overflow-y: visible;
            height: auto;
        } */

.responder {
    background-color: #eff6fd;
}

.answerer {
    background-color: #fce4ec;
}

.answerer .step-group {
    background-color: rgba(255, 224, 230, 0.7);
    border-color: #e91e63;
}

.answerer .group-title {
    background-color: #ffe0e6;
    border-color: #e91e63;
    color: #880e4f;
}

#kyoutu,
#koukai {
    padding-top: 0;
}

#kyoutu .global-instruction,
#koukai .global-instruction {
    margin-top: 20px;
}

.column-title,
.column-title1,
.column-title2 {
    color: #333;
}

.global-instruction .instruction-text {
    margin-top: 8px;
    font-size: 15px;
    color: #333;
    line-height: 1.6;
}

.container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    flex: 1;
    /* 残りの高さを使用 */
    overflow: visible;
    /* コンテナのスクロール制限を解除 */
    height: auto;
    /* 高さを自動に */
    min-height: calc(100vh - 200px);
    /* 最小高さを確保 */
    margin-bottom: 50px;
    /* 下部の余白を追加 */
    margin-top: 20px;
    /* 上部にマージンを追加 */
}

.column {
    padding: 15px 15px 80px 15px;
    /* 下部パディングを大幅に増加してスクロール範囲を拡大 */
    overflow-x: hidden;
    /* 横スクロールは無効 */
    overflow-y: visible;
    /* カラム内のスクロール制限を解除してページ全体スクロールに委ねる */
    height: auto;
    /* 高さを自動に */
    min-height: 500px;
    /* 最小高さを確保 */
    border-right: 1px solid #ddd;
    /* カラム間の境界線 */
    scroll-behavior: smooth;
    /* スムーズスクロールを追加 */
    position: relative;
    /* スクロール計算のための基準位置 */
}

/* 質問者・回答者・送信者・受信者カラムのスクロール設定 */
.column.questioner,
.column.responder,
.column.sender,
.column.answerer {
    overflow-y: auto;
    /* 確実にスクロール有効 */
    scroll-behavior: smooth;
    /* スムーズスクロール */
}

/* chatカラム専用設定 - chatカラムは独立したスクロール設定を維持 */
.column.chat {
    overflow-y: hidden;
    /* chatカラム自体のスクロールは無効 */
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    /* PCでもチャットカラムは適切な高さに */
}

.column.chat .column-title {
    flex-shrink: 0 !important;
    /* タイトルを固定サイズに */
    margin-bottom: 10px !important;
}

.column:last-child {
    border-right: none;
    /* 最後のカラムは境界線なし */
}

.column-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #575e58;
    color: white;
    border-radius: 5px;
}

.column-title1 {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f2c926;
    color: white;
    border-radius: 5px;
}

.column-title2 {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #92d2e6;
    color: white;
    border-radius: 5px;
}

.column-title3 {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #6ca0dc;
    color: white;
    border-radius: 5px;
}

.column-title5 {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e08592;
    color: white;
    border-radius: 5px;
}

/* ステップグループのスタイル */
.step-group {
    border: 2px solid #ddd;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* スクロール設定を追加 */
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* step-group専用スクロールバーのスタイル */
.step-group::-webkit-scrollbar {
    width: 8px;
}

.step-group::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

.step-group::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
}

.step-group::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.group-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* 手順間の案内メッセージ */
/* .step-transition-message {
            text-align: center;
            font-size: 14px;
            color: #666;
            font-style: italic;
            margin: 20px 0;
            padding: 10px;
            background-color: rgba(240, 248, 255, 0.7);
            border-radius: 8px;
            border: 1px dashed #b3d9ff;
        } */

        
.step-transition-message {
    text-align: center;
    margin: 20px 0;
    padding: 15px 20px;
    background-color: #e3f2fd;
    border: 2px solid #2196F3;
    border-radius: 8px;
    color: #1565c0;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.step-transition-message1 {
    text-align: center;
    margin: 20px 0;
    padding: 15px 20px;
    background-color: #f7f8c9e7;
    border: 2px solid #e9da08;
    border-radius: 8px;
    color: #e99a08;
    font-size: 16px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(242, 180, 10, 0.777);
}

.step {
    background-color: white;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.step-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

/* ステップリンクのスタイル */
.step-link {
    color: inherit;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    border-radius: 4px;
    padding: 2px 4px;
}

.step-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    text-decoration: none;
}

/* アクティブなステップのリンクスタイル */
.step.current .step-link {
    color: #333;
    cursor: default;
}

.step.current .step-link:hover {
    color: #333;
    background-color: transparent;
}

/* 無効なステップのリンクスタイル */
.step.disabled .step-link {
    color: inherit;
    cursor: not-allowed;
    opacity: 0.5;
}

.step.disabled .step-link:hover {
    color: inherit;
    background-color: transparent;
}

input[readonly],
textarea[readonly] {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

textarea {
    min-height: 60px;
    resize: vertical;
}

button {
    padding: 8px 16px;
    margin: 5px 5px 5px 0;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: #fff8dc;
    cursor: pointer;
    font-size: 14px;
}

button:hover:not(:disabled) {
    background-color: #ffe4b3;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kaitoubutton {
    padding: 8px 16px;
    margin: 5px 5px 5px 0;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: #80c4c6;
    cursor: pointer;
    font-size: 14px;
}

.kaitoubutton:hover:not(:disabled) {
    background-color: #a9c0cf;
}

.kaitoubutton:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kyoutu1button {
    padding: 8px 16px;
    margin: 5px 5px 5px 0;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: #cedaf8;
    cursor: pointer;
    font-size: 14px;
}

.kyoutu1button:hover:not(:disabled) {
    background-color: #dadbff;
}

.kyoutu1button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.kyoutu2button {
    padding: 8px 16px;
    margin: 5px 5px 5px 0;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: #f9b5b5;
    cursor: pointer;
    font-size: 14px;
}

.kyoutu2button:hover:not(:disabled) {
    background-color: #d4acac;
}

.kyoutu2button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button {
    padding: 8px 16px;
    margin: 5px 5px 5px 0;
    border: 1px solid #999;
    border-radius: 4px;
    background-color: #fff8dc;
    cursor: pointer;
    font-size: 14px;
}

button:hover:not(:disabled) {
    background-color: #ffe4b3;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.warning {
    color: #d9534f;
    font-size: 12px;
    margin-top: 5px;
}

.chat-messages {
    /* background: linear-gradient(to bottom, #a8d5e2 0%, #7fb3d5 100%); */
    background-color: whitesmoke;
    padding: 20px;
    border-radius: 8px;
    height: 420px !important;
    /* 固定高さを設定 */
    max-height: 420px !important;
    /* 最大高さを制限 */
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto !important;
    /* 縦スクロールを有効 */
    overflow-x: hidden !important;
    /* 横スクロールを無効 */
    flex: 1 !important;
    /* 残りスペースを使用 */
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.system {
    justify-content: center;
}

.chat-message.system .message-content {
    background-color: #f8f9fa;
    color: #6c757d;
    border-radius: 20px;
    padding: 8px 15px;
    margin: 0 auto;
    text-align: center;
    font-style: italic;
    font-size: 14px;
}

.chat-message.left {
    justify-content: flex-start;
}

.chat-message.right {
    justify-content: flex-end;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #d4a574;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

/* 質問者のメッセージ（左寄せ、黄色系） */
.chat-message.left .message-content {
    background-color: #ffc107;
    /* 黄色背景 */
    color: #856404;
    /* 濃い黄色のテキスト */
    border-radius: 18px 18px 18px 4px;
    padding: 10px 15px;
    margin-left: 10px;
    margin-right: auto;
    max-width: 80%;
    border: 1px solid #d39e00;
    /* 黄色の境界線 */
}

/* 回答者のメッセージ（右寄せ、青色系） */
.chat-message.right .message-content {
    background-color: #007bff;
    /* 青色背景 */
    color: white;
    /* 白色のテキスト */
    border-radius: 18px 18px 4px 18px;
    padding: 10px 15px;
    margin-left: auto;
    margin-right: 10px;
    max-width: 80%;
    border: 1px solid #0056b3;
    /* 濃い青の境界線 */
}

/* ホバー効果 */
.chat-message.left .message-content:hover {
    background-color: #e0a800;
    /* ホバー時の黄色 */
}

.chat-message.right .message-content:hover {
    background-color: #0056b3;
    /* ホバー時の青色 */
}

/* 共通鍵モード専用: ホバー効果 */
.kyoutu .chat-message.left .message-content:hover {
    background-color: #5fa8d3;
    /* ホバー時の濃いスカイブルー */
}

.kyoutu .chat-message.right .message-content:hover {
    background-color: #f48fb1;
    /* ホバー時の濃いピンク */
}

/* 短縮表示のスタイル */
.key-output {
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    margin-top: 10px;
    border: 1px solid #ddd;
    min-height: 30px;
    color: #555;
    word-break: break-all;
}

/* 結果ボックス内の短縮テキスト */
.result-box,
.result-box1 {
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
}

/* レスポンシブ対応での短縮表示 */

@media screen and (max-width: 1023px) {
    .global-instruction .clear-button {
        padding: 6px 12px;
        font-size: 12px;
        margin-left: 6px;
    }
}

/* @media screen and (max-width: 1023px) {
    .key-output {
        padding: 8px;
        font-size: 12px;
    }
    
    .result-box,
    .result-box1 {
        font-size: 12px;
    }
} */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 10px;
    width: 400px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.modal-title2 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

.key-option {
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.key-option:hover {
    border-color: #4CAF50;
    background-color: #f0f8f0;
}

.key-option.selected {
    border-color: #4CAF50;
    background-color: #e8f5e9;
}

.close-modal {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #000;
}

/* 役割変更モーダル用スタイル */
.role-change-modal {
    text-align: center;
    max-width: 500px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border: 3px solid #007bff;
}

.role-change-modal .modal-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #007bff;
    text-shadow: none;
}

.role-change-message {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    border-radius: 10px;
    color: #333;
    backdrop-filter: none;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.role-change-button {
    background: #007bff;
    color: white;
    border: 2px solid #0056b3;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.role-change-button:hover {
    background: #0056b3;
    border-color: #004085;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.role-change-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}


/* 共通鍵用 */

/* 役割変更モーダル用スタイル */
.role-change-modal1 {
    text-align: center;
    max-width: 500px;
    background: #ffffff;
    color: #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e91e63;
}

.role-change-modal1 .modal-title1 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #e91e63;
    text-shadow: none;
}

.role-change-message1 {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #333;
}

.modal-buttons1 {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.role-change-button1 {
    background: #e91e63;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.role-change-button1:hover {
    background: #c2185b;
}

.role-change-button1:active {
    background: #ad1457;
}



/* 質問者側の手順のハイライト（黄色系） */
.questioner .step.current {
    background-color: #fff3cd;
    /* 淡い黄色 */
    border: 2px solid #ffc107;
    /* 黄色の境界線 */
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
    position: relative;
}

/* 質問者側の完了した手順（緑色系） */
.questioner .step.completed {
    background-color: #feffdb;
    /* 淡い緑色 */
    border: 1px solid #f2c926;
    /* 緑の境界線 */
}

/* 共通鍵モード送信者側の手順のハイライト（オレンジ系） */
.sender .step.current {
    background-color: #e6f0fa;
    /* 淡いオレンジ */
    border: 2px solid #9da7be;
    /* オレンジの境界線 */
    box-shadow: 0 4px 8px rgba(157, 167, 190, 0.3);
    position: relative;
}

.sender .step-group {
    background-color: rgba(204, 231, 255, 0.6);
    border-color: #2196f3;
}

.sender .group-title {
    background-color: #cce7ff;
    border-color: #2196f3;
    color: #003d6b;
}

/* 共通鍵モード送信者側の完了した手順（薄いオレンジ系） */
.sender .step.completed {
    background-color: #e2eaff;
    /* 薄いオレンジ */
    border: 1px solid #c1c5d8;
    /* オレンジの境界線 */
}

/* 回答者側の手順のハイライト（青色系） */
.responder .step.current {
    background-color: #cce7ff;
    /* 淡い青色 */
    border: 2px solid #007bff;
    /* 青色の境界線 */
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    position: relative;
}

/* 回答者側の完了した手順（水色系） */
.responder .step.completed {
    background-color: #d1ecf1;
    /* 淡い水色 */
    border: 1px solid #17a2b8;
    /* 水色の境界線 */
}

/* 共通鍵モード受信者側の手順のハイライト（ピンク系） */
.answerer .step.current {
    background-color: #fce4ec;
    /* 淡いピンク */
    border: 2px solid #e91e63;
    /* ピンクの境界線 */
    box-shadow: 0 4px 8px rgba(233, 30, 99, 0.3);
    position: relative;
}

/* 共通鍵モード受信者側の完了した手順（薄いピンク系） */
.answerer .step.completed {
    background-color: #fdf2f8;
    /* 薄いピンク */
    border: 1px solid #e91e63;
    /* ピンクの境界線 */
}


/* 共通鍵モード送信者側のアニメーション（オレンジ系） */
.sender .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-orange 2s infinite;
}

/* 回答者側の現在の手順のアイコン（青色パルス） */
.responder .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-blue 2s infinite;
}

/* 共通鍵モード受信者側のアニメーション（ピンク系） */
.answerer .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-pink 2s infinite;
}

/* 人物アイコンの基本設定 */
.step-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    object-fit: contain;
    /* 画像の縦横比を保持 */
    z-index: 10;
    display: none;
    /* デフォルトでは非表示 */
}

/* 現在の手順のアイコンのみ表示 */
.step.current .step-icon {
    display: block;
    /* 現在の手順のみ表示 */
    opacity: 1;
}

/* 質問者側の現在の手順のアイコン（黄色パルス） */
.questioner .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-yellow 2s infinite;
}

/* 回答者側の現在の手順のアイコン（青色パルス） */
.responder .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-blue 2s infinite;
}

.sender .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-orange 2s infinite;
}

/* 回答者側の現在の手順のアイコン（青色パルス） */
.answerer .step.current .step-icon {
    display: block;
    opacity: 1;
    animation: pulse-blue 2s infinite;
}

/* 完了した手順のアイコンは非表示 */
.step.completed .step-icon {
    display: none;
    /* 完了時は非表示 */
}

/* 無効化された手順のアイコンも非表示 */
.step.disabled .step-icon {
    display: none;
    /* 無効化時は非表示 */
}

/* 黄色のパルスアニメーション（質問者用） */
@keyframes pulse-yellow {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.5));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
        filter: drop-shadow(0 0 10px rgba(255, 193, 7, 0.8));
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 193, 7, 0.5));
    }
}

/* オレンジのパルスアニメーション（共通鍵モード送信者用） */
@keyframes pulse-orange {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 140, 0, 0.5));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
        filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.8));
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(255, 140, 0, 0.5));
    }
}

/* ピンクのパルスアニメーション（共通鍵モード受信者用） */
@keyframes pulse-pink {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(233, 133, 146, 0.5));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
        filter: drop-shadow(0 0 10px rgba(233, 133, 146, 0.8));
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(233, 133, 146, 0.5));
    }
}

/* 青色のパルスアニメーション（回答者用） */
@keyframes pulse-blue {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(0, 123, 255, 0.5));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
        filter: drop-shadow(0 0 10px rgba(0, 123, 255, 0.8));
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 5px rgba(0, 123, 255, 0.5));
    }
}

/* 各カラムの背景色を設定（.columnセクションの後に追加） */
/* questioner と responder カラムはスクロールなし、チャットカラムのみスクロール有効 */

/* 質問者カラムの背景色 */
.questioner {
    background-color: #fcf6de;
    /* 淡いクリーム色 */
}

/* 質問者カラムのグループスタイル */
.questioner .step-group {
    border-color: #f2c926;
    /* 黄色の境界線 */
    background-color: rgba(252, 246, 222, 0.6);
    max-height: 400px;
    /* 回答者と同じ最大高さに設定 */
    overflow-y: auto;
    /* step-group内でのスクロールを有効に戻す */
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.step-group {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 2px solid transparent;
}

/* .step-group::-webkit-scrollbar {
    width: 8px;
}
.step-group::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
} */

/* .step-group::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
}

.step-group::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
} */

/* 質問者カラム専用のスクロール設定 */
.questioner.column {
    overflow-y: auto !important;
    /* 確実にスクロール有効 */
    scroll-behavior: smooth !important;
    padding-bottom: 120px !important;
    /* 質問者カラム専用により多くの下部余白を追加 */
}

/* 共通鍵モード送信者カラムの背景色 */
.sender {
    background-color: #e2e9ef;
    /* 淡いオレンジクリーム色 */
}

/* チャットカラムの背景色 */
.chat {
    background-color: #e8e8e8;
    /* 淡いグレー */
}

/* 回答者カラムの背景色 */
.responder {
    background-color: #eff6fd;
    /* 淡い青色 */
}

/* 回答者カラムのグループスタイル */
.responder .step-group {
    border-color: #92d2e6;
    /* 青色の境界線 */
    background-color: rgba(239, 246, 253, 0.6);
}

.responder .group-title {
    background-color: #cce7ff;
    border-color: #92d2e6;
    color: #003d6b;
}



.group-section {
    margin-bottom: 20px;
}

.questioner {
    background-color: #fcf6de;
    /* 淡いクリーム色 */
}

.questioner .step-group {
    background-color: rgba(255, 243, 205, 0.7);
    border-color: #f2c926;
}

.questioner .group-title {
    background-color: #fff3cd;
    border-color: #f2c926;
    color: #856404;
}

.group-title {
    font-weight: bold;
    font-size: 16px;
    padding: 8px 12px;
    margin-bottom: 15px;
    border-radius: 5px;
    text-align: center;
    border: 2px solid transparent;
}

/* 共通鍵モード受信者カラムの背景色 */
.answerer {
    background-color: #fce4ec;
    /* 淡いピンク色 */
}


/* スクロールバーのスタイル調整 */
.column::-webkit-scrollbar {
    width: 8px;
}

.column::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.column::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.column::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* chat-messages専用スクロールバーのスタイル */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

/* ページ全体用スクロールバーのスタイル */
body::-webkit-scrollbar {
    width: 12px;
}

body::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 6px;
}

body::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 6px;
    border: 2px solid #f1f1f1;
}

body::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

/* Firefoxでのスクロールバー対応 */
html {
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 #f1f1f1;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .step-icon {
        width: 30px;
        height: 30px;
        top: 5px;
        right: 5px;
    }
}

/* スマートフォン用のレスポンシブ対応 */
@media screen and (max-width: 767px) {
    .global-instruction .clear-button {
        padding: 5px 10px;
        font-size: 11px;
        margin-left: 5px;
        margin-bottom: 5px;
    }

    .global-instruction .clear-button-container {
        margin-top: 10px;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

/* 非常に小さな画面用 */
@media screen and (max-width: 480px) {
    .global-instruction .clear-button {
        padding: 4px 8px;
        font-size: 10px;
        border-radius: 3px;
        margin-left: 3px;
        margin-bottom: 3px;
    }

    .global-instruction .clear-button-container {
        margin-top: 8px;
    }
}


/* タブレット対応（768px以上1024px未満） */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .container {
        grid-template-columns: 1fr 1fr 1fr;
        /* 3列維持 */
        gap: 10px;
    }

    .column {
        padding: 15px 15px 100px 15px;
        /* タブレット用でも下部のパディングを大きく増やす */
    }

    /* タブレット用質問者カラム専用設定 */
    .questioner.column {
        padding-bottom: 150px !important;
        /* タブレットでも十分な下部余白 */
    }

    /* 背景色を維持 */
    .questioner {
        background-color: #fcf6de;
    }

    .sender {
        background-color: #e2e9ef;
    }

    .chat {
        background-color: #e8e8e8;
    }

    .responder {
        background-color: #eff6fd;
    }

    .answerer {
        background-color: #fce4ec;
    }

    .step-icon {
        width: 35px;
        height: 35px;
        top: 8px;
        right: 8px;
    }

    .global-instruction {
        margin: 15px;
        padding: 15px;
    }
}

/* スマートフォン横画面専用（1023px未満） */
@media screen and (max-width: 1023px) {
    html {
        overflow: auto !important;
        /* 縦スクロールを有効に */
        height: auto !important;
        /* 高さを自動に */
        position: static !important;
        /* 固定を解除 */
        width: 100% !important;
    }

    body {
        height: auto !important;
        /* 高さを自動に */
        min-height: 100vh !important;
        /* 最小高さは確保 */
        overflow: auto !important;
        /* 縦スクロールを有効に */
        position: static !important;
        /* 固定を解除 */
    }

    .container {
        grid-template-columns: 1fr 1fr 1fr;
        /* 3列表示を維持 */
        gap: 5px;
        height: auto !important;
        /* 高さを自動に */
        min-height: calc(100vh - 200px);
        /* 最小高さを確保 */
        margin-bottom: 100px;
        /* 下部の余白をさらに増やす */
        margin-top: 20px;
        /* 上部にマージンを追加 */
        overflow: visible;
        /* コンテナのスクロール制限を解除 */
    }

    .column {
        padding: 10px 10px 150px 10px;
        /* 下部のパディングをさらに増やす */
        font-size: 14px;
        overflow-y: visible;
        /* カラム内のスクロール制限を解除 */
        height: auto !important;
        /* 高さを自動に */
        min-height: 400px;
        /* 最小高さを確保 */
        scroll-behavior: smooth;
        /* スムーズスクロールも維持 */
    }

    /* スマートフォン用質問者カラム専用設定 */
    .questioner.column {
        padding-bottom: 120px !important;
        /* スマートフォンでも質問者カラムの下部余白を確保 */
    }

    /* chatカラム専用設定をレスポンシブでも維持 */
    .column.chat {
        overflow-y: hidden;
        /* レスポンシブでもchatカラム自体のスクロールは無効 */
        height: auto !important;
        /* 高さを自動に */
        display: flex !important;
        /* flexレイアウトを維持 */
        flex-direction: column !important;
        /* 縦方向に配置 */
    }

    /* 背景色を維持 */
    .questioner {
        background-color: #fcf6de;
    }

    .sender {
        background-color: #e2e9ef;
    }

    .chat {
        background-color: #e8e8e8;
    }

    .responder {
        background-color: #eff6fd;
    }

    .answerer {
        background-color: #fce4ec;
    }

    .column-title,
    .column-title1,
    .column-title2 {
        font-size: 16px;
        padding: 8px;
        margin-bottom: 15px;
    }

    .step-group {
        padding: 10px;
        margin-bottom: 15px;
        border-width: 1px;
    }

    .group-title {
        font-size: 14px;
        margin-bottom: 10px;
        padding: 6px 8px;
    }

    .step {
        padding: 10px;
        margin-bottom: 10px;
    }

    .step-title {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .step-icon {
        width: 30px;
        height: 30px;
        top: 5px;
        right: 5px;
    }

    input[type="text"],
    textarea {
        padding: 6px;
        font-size: 14px;
    }

    button {
        padding: 6px 12px;
        font-size: 12px;
        margin: 3px 3px 3px 0;
    }

    /* スマートフォン用のグローバル指示を小さく */
    .global-instruction {
        margin: 5px;
        /* 20px → 5px に縮小 */
        padding: 10px;
        /* 20px → 10px に縮小 */
        border-width: 2px;
        /* 3px → 2px に縮小 */
        border-radius: 10px;
        /* 15px → 10px に縮小 */
        position: static;
        /* レスポンシブ時は固定解除 */
    }

    .global-instruction .user-name {
        font-size: 14px;
        /* 16px → 14px に縮小 */
        margin-bottom: 4px;
        /* マージンを追加 */
    }

    .global-instruction .instruction-text {
        font-size: 12px;
        /* 13px → 12px に縮小 */
        line-height: 1.4;
        /* 行間を調整 */
    }

    .chat-messages {
        padding: 15px;
        height: 400px !important;
        /* レスポンシブでも固定高さを維持 */
        max-height: 400px !important;
        /* 最大高さを制限 */
        min-height: 300px;
        /* 最小高さを確保 */
        gap: 10px;
        overflow-y: auto !important;
        /* スクロールを有効に戻す */
        overflow-x: hidden !important;
        /* 横スクロールは無効 */
    }

    .message-content {
        padding: 10px 12px;
        font-size: 13px;
        max-width: 85%;
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 20px;
    }
}

/* チャットアイコンを完全に非表示 */
.chat-message .avatar {
    display: none !important;
}

/* チャットメッセージのレイアウト調整 */
.chat-message {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.chat-message.system .message-content {
    background-color: #f8f9fa;
    color: #6c757d;
    border-radius: 20px;
    padding: 8px 15px;
    margin: 0 auto;
    text-align: center;
    font-style: italic;
    font-size: 14px;
}

/* 質問者のメッセージ（左寄せ、黄色系） */
.chat-message.left .message-content {
    background-color: #edd99c;
    /* 黄色背景 */
    color: #856404;
    /* 濃い黄色のテキスト */
    border-radius: 18px 18px 18px 4px;
    padding: 10px 15px;
    margin-left: 10px;
    margin-right: auto;
    max-width: 80%;
    border: 1px solid #d39e00;
    /* 黄色の境界線 */
}

/* 回答者のメッセージ（右寄せ、青色系） */
.chat-message.right .message-content {
    background-color: #007bff;
    /* 青色背景 */
    color: white;
    /* 白色のテキスト */
    border-radius: 18px 18px 4px 18px;
    padding: 10px 15px;
    margin-left: auto;
    margin-right: 10px;
    max-width: 80%;
    border: 1px solid #0056b3;
    /* 濃い青の境界線 */
}

/* 共通鍵モード専用: 送信者のメッセージ（左寄せ、青色系） */
.kyoutu .chat-message.left .message-content {
    background-color: #87ceeb;
    /* スカイブルー背景 */
    color: #003d6b;
    /* 濃い青のテキスト */
    border-radius: 18px 18px 18px 4px;
    padding: 10px 15px;
    margin-left: 10px;
    margin-right: auto;
    max-width: 80%;
    border: 1px solid #4682b4;
    /* 青の境界線 */
}

/* 共通鍵モード専用: 受信者のメッセージ（右寄せ、ピンク系） */
.kyoutu .chat-message.right .message-content {
    background-color: #f8bbd9;
    /* ピンク背景 */
    color: #8b1538;
    /* 濃いピンクのテキスト */
    border-radius: 18px 18px 4px 18px;
    padding: 10px 15px;
    margin-left: auto;
    margin-right: 10px;
    max-width: 80%;
    border: 1px solid #e91e63;
    /* ピンクの境界線 */
}

/* ホバー効果 */
.chat-message.left .message-content:hover {
    background-color: #e0a800;
    /* ホバー時の黄色 */
}

.chat-message.right .message-content:hover {
    background-color: #0056b3;
    /* ホバー時の青色 */
}

/* デフォルトで全てのモードdivを非表示 */
.kyoutu,
.koukai {
    display: none;
    padding-top: 80px;
}

/* 各モードが表示されている時の上部スペース確保 */
.kyoutu.active,
.koukai.active {
    padding-top: 80px;
}

/* レスポンシブ対応：モードの上部パディング */
@media screen and (max-width: 767px) {

    .kyoutu,
    .koukai {
        padding-top: 70px;
    }

    .kyoutu.active,
    .koukai.active {
        padding-top: 70px;
    }
}

@media screen and (max-width: 480px) {

    .kyoutu,
    .koukai {
        padding-top: 65px;
    }

    .kyoutu.active,
    .koukai.active {
        padding-top: 65px;
    }
}

/* メニューボタンのデザイン */
.mode-link {
    padding: 25px 45px;
    margin: 15px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 15px;
    border: 2px solid transparent;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    /* margin-top: 40px; */
    display: inline-block;
    min-width: 220px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
}

.mode-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.mode-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 共通鍵モード専用スタイル（淡い赤・マット） */
#kyoutu-link {
    background: #fde8e8;
    border: 2px solid #f5b5b5;
    color: #8b5858;
}

#kyoutu-link:hover {
    background: #f7d4d4;
    border-color: #e89999;
    color: #733d3d;
    box-shadow: 0 6px 20px rgba(245, 181, 181, 0.3);
}

/* 公開鍵モード専用スタイル（淡い緑・マット） */
#koukai-link {
    background: #e8f5e8;
    border: 2px solid #b5d6b5;
    color: #5a7a5a;
}

#koukai-link:hover {
    background: #d4ead4;
    border-color: #99c299;
    color: #3d5c3d;
    box-shadow: 0 6px 20px rgba(181, 214, 181, 0.3);
}

/* ボタン内要素のスタイル */
.button-icon {
    display: block;
    font-size: 36px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.button-text {
    display: block;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 6px;
    line-height: 1.2;
}

.button-subtitle {
    /* display: block;
    font-size: 13px;
    opacity: 0.7;
    font-weight: normal;
    line-height: 1.2;
    letter-spacing: 0.3px; */
    font-size: 13px;
    font-weight: normal;
    line-height: 1.2;
    color: inherit;
    opacity: 0.8;
}

/* レスポンシブ対応：メニューボタン */
@media screen and (max-width: 767px) {
    #menu {
        padding-top: 50px;
        /* モバイル用の上部パディング */
        margin-top: 30px;
    }

    .mode-link {
        padding: 20px 35px;
        font-size: 17px;
        min-width: 190px;
        border-radius: 12px;
        margin: 12px;
        margin-top: 25px;
    }

    .flex {
        gap: 15px;
        flex-direction: column;
    }

    .button-icon {
        font-size: 30px;
    }

    .button-text {
        font-size: 17px;
    }
}

@media screen and (max-width: 480px) {
    #menu {
        padding-top: 45px;
        /* 小画面用の上部パディング */
        margin-top: 25px;
    }

    .mode-link {
        padding: 18px 30px;
        font-size: 16px;
        min-width: 170px;
        margin: 10px;
        margin-top: 20px;
        border-radius: 12px;
    }

    .flex {
        gap: 12px;
    }

    .button-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .button-text {
        font-size: 16px;
    }

    .button-subtitle {
        font-size: 12px;
    }
}

@media screen and (max-width: 360px) {
    #menu {
        padding-top: 40px;
        /* 最小画面用の上部パディング */
        margin-top: 20px;
    }

    .mode-link {
        padding: 16px 25px;
        font-size: 15px;
        min-width: 150px;
        margin: 8px;
        margin-top: 15px;
        border-radius: 10px;
    }

    .button-icon {
        font-size: 26px;
        margin-bottom: 6px;
    }

    .button-text {
        font-size: 15px;
    }

    .button-subtitle {
        font-size: 11px;
    }
}

/* メニューのレイアウト */
#menu {
    padding: 20px 0 40px 0;
    min-height: calc(100vh - 60px);
    overflow-y: auto;
    /* padding: 15px; */
    padding-top: 30px;
    /* ヘッダー分の上部パディングを追加 */
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    margin-top: 20px;
    /* 上部マージンを追加 */
}

.flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* #menuPic {
    margin-left: auto;
    height: 200px;
} */

#menu {
    display: block;
    text-align: center;
}

#menuPic {
    width: 600px;
    height: auto;
    max-width: 98%;
    display: block;
    margin: 30px auto;
    /* max-width: 100%; */
    /* height: auto;  */
    /* display: block; */
    /* margin: 0 auto; */
}

#menu-buttons {
    /* display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem; */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.modal {
    display: none;
    /* 最初は非表示 */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background: #fff;
    margin: 20% auto;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    border-radius: 10px;
    text-align: center;
}

.close-modal {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

/* ナビゲーションボタンのスタイル */
.navigation-buttons {
    display: flex;
    justify-content: center;
    /* gap: 15px; */
    margin: 15px;
    flex-wrap: wrap;
    position: sticky;
    /* スクロール時も固定表示 */
    top: 170px;
    /* global-instructionの下に配置（少し下げる） */
    z-index: 998;
    /* global-instructionより下 */
    background-color: rgba(255, 255, 255, 0.95);
    /* 半透明の背景 */
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navigation-buttons {
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    /* ボタンが縮小されないようにする */
    align-items: flex-end;
    margin-top: 5px;
}

/* .nav-button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    white-space: nowrap;
} */

.nav-button {
    background-color: #ff4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
    white-space: nowrap;
    min-width: 150px;
}

.nav-button.prev-button {
    background-color: #2196F3;
}

.nav-button.prev-button:hover {
    background-color: #1976D2;
}

.nav-button.restart-button {
    background-color: #FF9800;
}

.nav-button.restart-button:hover {
    background-color: #F57C00;
}

.nav-button.clear-button:hover {
    background-color: #e03030;
}

.nav-button.clear-button:active {
    background-color: #cc2222;
    transform: translateY(1px);
}

.nav-button:hover {
    background-color: #0056b3;
}

.prev-button {
    background-color: #6c757d;
}

.prev-button:hover {
    background-color: #545b62;
}

.restart-button {
    background-color: #28a745;
}

.restart-button:hover {
    background-color: #218838;
}

/* .clear-button {
    background-color: #dc3545;
}

.clear-button:hover {
    background-color: #c82333;
} */

/* レスポンシブ対応：ナビゲーションボタン */
@media screen and (max-width: 767px) {
    .navigation-buttons {
        gap: 10px;
        margin: 10px;
        position: static;
        /* レスポンシブ時は固定解除 */
        background-color: transparent;
        /* 背景を透明に */
        box-shadow: none;
        /* シャドウを無効 */
        padding: 8px;
    }

    .nav-button {
        font-size: 13px;
        padding: 10px 15px;
    }
}

@media screen and (max-width: 480px) {
    .navigation-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin: 5px;
        position: static;
        /* 小画面でも固定解除 */
        background-color: transparent;
        /* 背景を透明に */
        box-shadow: none;
        /* シャドウを無効 */
        padding: 5px;
    }

    .nav-button {
        width: 100%;
        max-width: 300px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 20px;
    gap: 20px;
}

/* レスポンシブ対応：メニュー画像 */
@media screen and (max-width: 1023px) {
    #menuPic {
        width: 480px;
        max-width: 90%;
        margin: 25px auto;
    }
}

@media screen and (max-width: 767px) {
    #menu {
        min-height: calc(100vh - 50px);
        padding: 15px 0 80px 0;
    }

    #menuPic {
        width: 380px;
        max-width: 85%;
        margin: 20px auto 80px auto;
    }

    /* ボタンのレスポンシブ対応 */
    .mode-link {
        padding: 20px 35px;
        font-size: 17px;
        min-width: 190px;
        border-radius: 12px;
        margin: 12px;
    }

    #menu-buttons {
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }

    .button-text {
        font-size: 17px;
    }

    .button-subtitle {
        font-size: 12px;
    }
}

@media screen and (max-width: 480px) {
    #menu {
        min-height: calc(100vh - 45px);
        padding: 10px 0 100px 0;
    }

    #menuPic {
        width: 300px;
        max-width: 80%;
        margin: 15px auto 100px auto;
    }

    .mode-link {
        padding: 18px 30px;
        font-size: 16px;
        min-width: 170px;
        margin: 10px;
        border-radius: 12px;
    }

    #menu-buttons {
        gap: 12px;
    }

    .button-text {
        font-size: 16px;
    }

    .button-subtitle {
        font-size: 11px;
    }
}

@media screen and (max-width: 360px) {
    #menu {
        min-height: calc(100vh - 45px);
        padding: 5px 0 120px 0;
    }

    #menuPic {
        width: 220px;
        max-width: 75%;
        margin: 10px auto 120px auto;
    }

    .mode-link {
        padding: 16px 25px;
        font-size: 15px;
        min-width: 150px;
        margin: 8px;
        border-radius: 10px;
    }

    .button-text {
        font-size: 15px;
    }

    .button-subtitle {
        font-size: 10px;
    }
}

/* レスポンシブ対応：小さい画面でのヘッダー */
@media screen and (max-width: 767px) {
    .global-header {
        height: 50px;
        padding: 0 15px;
    }

    .header-title {
        font-size: 24px;
        letter-spacing: 1px;
    }

    body {
        margin-top: 50px;
    }
}

@media screen and (max-width: 480px) {
    .global-header {
        height: 45px;
        padding: 0 10px;
    }

    .header-title {
        font-size: 20px;
        letter-spacing: 0.5px;
    }

    body {
        margin-top: 45px;
    }
}

/* 共通鍵モード用役割変更モーダルのスタイル（ピンク系・シンプル） */
/* .role-change-modal1 {
    text-align: center;
    max-width: 500px;
    background: #ffffff !important;
    color: #333 !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e91e63 !important;
}

.role-change-modal1 .modal-title1 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #e91e63 !important;
    text-shadow: none;
}

.role-change-message1 {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f9f9f9 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px;
    color: #333 !important;
}

.modal-buttons1 {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.role-change-button1 {
    background: #e91e63 !important;
    color: white !important;
    border: none !important;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.role-change-button1:hover {
    background: #c2185b !important;
}

.role-change-button1:active {
    background: #ad1457 !important;
} */

.header-right {
    font-size: 14px;
    margin-left: auto;
    color: white;
}