body {
            margin: 0;
            padding: 0;
            background-color: #fff;
            font-family: sans-serif;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
      background-image: url("img/stripe3.png");
  background-repeat: repeat;     /* ← タイル状に並べる */
  background-position: top left; /* ← 左上から開始 */
    font-family: "nos", sans-serif;
      touch-action: manipulation; 
        }
@font-face { 
  font-family: "nos"; 
  src: url("../font/Saitamaar.ttf") format("truetype"); 
}


        /* 全体を囲む外枠（ラフ画の外側の線） */
/* --- 全体の位置調整 --- */
.outer-frame {
    margin: 10px auto 0; /* 上に50pxの余白を追加、左右は中央寄せ */
    border: 3px double #000;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    background-color: #fff; /* 背景色を白に固定 */
}

/* --- 上段エリア --- */
.top-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    border-bottom: 2px solid #000;
    position: relative;
    overflow: hidden;
    z-index: 1;

    /* --- 背景画像の設定 --- */
    background-image: url("img/anim.gif"); /* 画像のパスを指定 */
    background-size: cover;      /* 枠に合わせて隙間なく敷き詰める（はみ出た分は切る） */
    background-position: center; /* 画像の中央を基準にする */
    background-repeat: no-repeat; /* 1枚だけ表示 */

    /* 前回の可変設定 */
    height: 40vh; 
    min-height: 250px;
    padding-bottom: 30px;
}

@media screen and (max-width: 480px) {
    .top-section {
        padding-bottom: 40px;
    }
}
/* 拍手ボタンの重なり順（コメントより上にする） */

/* --- スマホ用の調整 --- */
@media screen and (max-width: 480px) {
    .outer-frame {
        /* スマホでは少し上に寄せる（画面の高さの 3%） */
        margin-top: 3vh; 
    }



    .btn-clap {
        /* ボタンが画面に対して大きすぎないよう調整 */
        width: 180px;
        height: 90px;
    }
}
    /* 修正：ボタン単体のスタイル */
/* --- 拍手ボタンのデザイン刷新 --- */
.btn-clap {
    background-color: #ff4747; /* 少し鮮やかな赤 */
    color: #fff;
    border: 2px solid #000;    /* 外枠をはっきり */
    width: 180px;
    height: 90px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 12px;       /* 少し角を丸くしてポップに */
    
    /* 3D的な影（押し込まれる前の厚み） */
    box-shadow: 0 8px 0 #b30000, 0 8px 10px rgba(0,0,0,0.3);
    
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.05s;     /* 反応を速く */
    z-index: 10;
    
    /* スマホでのタップハイライトを消す */
    -webkit-tap-highlight-color: transparent;
}

/* --- スマホでタッチした時（またはクリック中）の動き --- */
.btn-clap:active {
    /* 影を小さくして、その分ボタンを下へ移動させる（押し込み演出） */
    box-shadow: 0 2px 0 #b30000, 0 2px 5px rgba(0,0,0,0.3);
    transform: translateY(6px);
}

/* 拍手回数の数字 */
#clap-count {
    display: block;
    font-size: 0.9rem;
    background: rgba(0,0,0,0.15);
    padding: 2px 10px;
    border-radius: 20px;
    margin-top: 5px;
}

        /* 右側：チュートリアルテキスト枠 */
        .tutorial-box {
            border: 2px solid #000; /* 黒い太枠 */
            flex-grow: 1;
            height: 120px;
            padding: 10px;
            overflow-y: auto;
            font-size: 0.9rem;
            color: #000;
            background-color: #fff;
        }

        /* --- 下段エリア --- */
        .bottom-section {
            padding: 15px;
            display: flex;
            gap: 15px;
            align-items: flex-start;
        }

        /* 左側：メッセージ入力欄（テキストボックス） */
        .message-form {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }
        textarea {
            width: 100%;
            height: 60px;
            border: 1px solid #000;
            padding: 5px;
            resize: none;
            box-sizing: border-box;
        }
        .form-options {
            font-size: 0.8rem;
            display: flex;
            align-items: center;
        }

        /* 右側：送信ボタン */
/* --- 送信ボタンのデザイン修正 --- */
/* --- 送信ボタンの基本スタイル --- */
.btn-send {
    background-color: #ff4747;
    color: #fff;
    border: 2px solid #000;
    width: 75px;
    height: 60px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    /* 立体感のある影 */
    box-shadow: 0 4px 0 #b30000, 0 4px 6px rgba(0,0,0,0.2);
    flex-shrink: 0;
    transition: all 0.05s;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 押した時の動き（活性時のみ適用） */
.btn-send:active:not(:disabled) {
    box-shadow: 0 1px 0 #b30000, 0 1px 3px rgba(0,0,0,0.2);
    transform: translateY(3px);
}

/* ★ 文字入力がない時（disabled）のスタイル ★ */
/* 優先順位を上げるために!importantを使用し、完全に無効な見た目にします */
.btn-send:disabled {
    background-color: #cccccc !important; 
    color: #888888 !important;
    border-color: #999999 !important;
    box-shadow: none !important; /* 影を消して平坦にする */
    transform: none !important;  /* 押しても動かないようにする */
    cursor: not-allowed !important;
    opacity: 0.8;
}

        /* 演出用コンテナ */
        #effect-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            pointer-events: none;
            z-index: 9999;
        }

.main-wrapper {
    display: flex;
    flex-direction: column; /* 縦に並べる */
    justify-content: center; /* 垂直方向の中央 */
    align-items: center;    /* 水平方向の中央 */
    min-height: 100vh;      /* 画面の高さ分を確保 */
    text-align: center;     /* 中のテキストも中央に */
}

/* 拍手セクション内のレイアウト調整 */
/* top-sectionに基準を置く */
.top-section {
    position: relative; /* 子要素の基準になる */
    overflow: hidden;    /* 枠からはみ出したコメントを隠す */
    z-index: 1;
}

/* 拍手ボタンの重なり順を上げる */
.btn-clap {
    position: relative;
    z-index: 10; /* コメント(1)より上に表示 */
    /* 他のスタイルはそのまま */
}

/* ニコ動風コメントのスタイル修正 */
/* ニコ動風コメントのアニメーション修正 */
@keyframes niconico-flow {
    from {
        /* 枠の右端（開始位置） */
        transform: translateX(0);
        left: 100%;
    }
    to {
        /* 枠の左端を越えて、自分の幅分だけ左へ（終了位置） */
        transform: translateX(-100%);
        left: 0;
    }
}

.niconico-comment {
    position: absolute;
    z-index: 1;
    white-space: nowrap;
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
    pointer-events: none;
    /* initial-leftを100%に固定し、translateXで制御 */
    left: 100%; 
    animation: niconico-flow linear forwards;
}
    /* 紙吹雪用のキャンバス */
    #confetti-canvas {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 9999; /* 最前面 */
        pointer-events: none;
    }
    .btn-clap {
    position: relative;
    z-index: 10;
    width: 180px;
    height: 90px;
}
/* 送信ボタンが非活性（disabled）の時のスタイル */
.btn-send:disabled {
    background-color: #ccc !important; /* 灰色 */
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* 自分が送ったメッセージ用の特別なスタイル */
.niconico-comment.my-message {
    color: #ffffff; /* 文字色：黄色 */
    border: 2px solid #ffff00; /* 黄色のボーダー */
    padding: 2px 8px;
    border-radius: 4px;
}
/* 通知メッセージのスタイル */
/* 画面中央に出る通知（これならアニメーションが止まりません） */
.toast-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 30px;
    border: 2px solid #ffff00;
    border-radius: 8px;
    z-index: 20000;
    font-weight: bold;
    pointer-events: none;
    animation: fade-in-out 2s forwards;
}

@keyframes fade-in-out {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    20% { opacity: 1; transform: translate(-50%, -50%); }
    80% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -60%); }
}
