@import url('https://fonts.googleapis.com/css2?family=Shippori+Antique+B1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100..900&display=swap');
        html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
        article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
        ol, ul { list-style: none; }
        blockquote, q { quotes: none; }
        blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; }
        table { border-collapse: collapse; border-spacing: 0; }
        body { line-height: 1.8; font-size: .875rem; color: #fff; background-color: #fff; display: flex; align-items: center; height: 100vh; font-family: "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif; }
        img { max-width: 100%; height: auto; align-self: flex-start; position: relative; }
        b { font-weight: 700; }
        .success { color: #2196f3; }
        .fail { color: #f50057; }
        .background { background-image: url(../img/background.jpg); background-size: cover; background-position: center; width: 100lvw; height: 100lvh; position: fixed; filter: blur(5px); top: 0; z-index: -1; }
        .body { background-image: url(../img/background.jpg); max-width: 640px; max-height: 480px; margin: auto; padding: 15px; box-sizing: border-box; position: relative; height: 100%; width: 100%; display: flex; align-items: flex-end; flex-direction: row; justify-content: stretch; background-size: cover; overflow: hidden; background-position: top; box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); }
        .body > *:not(:nth-child(1)):not(.top-right-controls):not(.return-button) { display: none; }
        .body > *:not(.effect-overlay):last-child:after { content: "歌にならない『パセリ、セージ、ローズマリー、タイム』 END"; animation: none; font-size: 10px; }
        .main, .system { width: 100%; position: relative; }
        .main { display: flex; text-align: justify; }
        .p, .system {
        z-index:10;
        word-break: break-all;
        background: rgba(0, 0, 0, 0.7);
        width: 100%;
        padding: 15px 20px;
        height: 170px;
        box-sizing: border-box;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.5) transparent;
        font-family: "Shippori Antique B1", sans-serif;
        font-weight: 400;
        font-style: normal;
        font-size: 17px;
        line-height: 1.6;
        }
        .chu {
            font-family: "Noto Sans TC", sans-serif;
            font-optical-sizing: auto;
            font-weight: 600;
            font-style: normal;
        }
        .system { font-weight: bold; }
        .p::-webkit-scrollbar, .system::-webkit-scrollbar { width: 6px; }
        .p::-webkit-scrollbar-track, .system::-webkit-scrollbar-track { background: transparent; }
        .p::-webkit-scrollbar-thumb, .system::-webkit-scrollbar-thumb { background-color: rgba(255,255,255,0.7); border-radius: 3px; }
        .ic { z-index:10; margin-right: 15px; line-height: 0; position: absolute; top: -105%; max-width: 160px; width: 100%; }
        .ic img { width: 100%; }
        .main:after { content: "▼"; display: block; position: absolute; right: 10px; bottom: 3px; animation: UpDown .3s infinite ease-in-out alternate; z-index:11;}
        .backlog-mode .main:after { content: none; }
        .effectlayer:after { content:none !important;z-index:1; }
        @keyframes UpDown { 0% { transform: translateY(-2px); } 100% { transform: translateY(3px); } }
        .top-right-controls { position: fixed; z-index: 1000; top: 20px; right: 20px; display: flex; gap: 10px; }
        .top-right-controls button, .return-button { background: rgba(0, 0, 0, 0.8); color: white; border: 2px solid rgba(255, 255, 255, 0.3); padding: 10px 20px; border-radius: 25px; cursor: pointer; font-size: 14px; font-weight: bold; transition: all 0.3s ease; }
        .top-right-controls button:hover, .return-button:hover { background: rgba(0, 0, 0, 0.9); border-color: rgba(255, 255, 255, 0.5); transform: scale(1.05); }
        .return-button { display: none; }
        .backlog-mode .return-button { display: block; }
        .backlog-mode .backlog-button { display: none; }
        .backlog-mode body { align-items: flex-start; height: auto; }
        .backlog-mode .body { background: rgba(0, 0, 0, 0.4) !important; background-image: none !important; max-width: 800px; margin: 20px auto; height: auto; width: auto; display: block !important; min-height: calc(100vh - 40px); padding-top: 20px; max-height: none; overflow: visible; }
        .backlog-mode .body > * { display: flex !important; margin-bottom: 15px; }
        .backlog-mode .p, .backlog-mode .system { height: auto; min-height: 60px; }
        .backlog-mode .ic { position: static; width: auto; margin-right:10px !important; }
        .backlog-mode .ic img { max-width: 60px; }
        .current-item { background: rgba(255, 255, 0, 0.2) !important; border: 2px solid rgba(255, 255, 0, 0.5); border-radius: 5px; }
        body.backlog-mode { height: auto; max-height: max-content; }
        @media screen and (max-width: 768px) {
          body { height:100dvh }
          .body { width: 100lvw; height: 100dvh; max-width: 100lvw; max-height: 100dvh; background-position: center; }
          .main, .system { bottom: 5dvh; }
          .backlog-mode .body { margin-top:0; padding-top:100px; }
        }
        .bgmhyouki { position: fixed; background: #000; border-radius: 9999px; font-size: 10px; bottom: 10px; right: 10px; padding: 3px 20px; z-index:5; }
        .backlog-mode .main, .backlog-mode .system { bottom: 0; }

    #audio-choice-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background-color: rgba(0, 0, 0, 0.6);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      color: #fff;
      text-align: center;
      font-family: "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "メイリオ", Meiryo, sans-serif;
      /* クリックイベントをキャッチ */
      pointer-events: all;
    }
    #audio-choice-box {
        background: rgba(0, 0, 0, 0.9);
        padding: 20px 30px;
        border-radius: 10px;
        box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.1);
        max-width: 480px;
        width: 86vw;
        box-sizing: border-box;
        /* ダイアログボックス内のクリックは通す */
        pointer-events: all;
    }
    #audio-choice-box p {
      margin-bottom: 10px;
      font-size: 12px;
      line-height: 1.5;
    }
    #audio-choice-box .button-container {
        display: flex;
        justify-content: center;
        gap: 20px;
    }
    #audio-choice-box button {
        color: white;
        border: 1px solid rgba(255, 255, 255, 0.5);
        padding: 10px 29px 13px;
        border-radius: 25px;
        cursor: pointer;
        font-size: 12px;
        font-weight: bold;
        transition: all 0.2s ease;
        max-width: 150px;
        width: 100%;
    }
    #audio-choice-box button#play-with-sound {
        background: rgb(63, 81, 181);
        border-color: rgb(63, 81, 181);
    }
    #audio-choice-box button#play-without-sound {
        background: rgba(255, 255, 255, 0.2);
    }
    #audio-choice-box button:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    }
    
    .name1 , .name1 + br {
        display:none;
    }

    .agata .ic {
        max-width: 220px;
        left: 0;
        right: 0;
        margin: auto;
        top: -103%;
    }

    .yunfa .ic {
        max-width: 380px;
        left: 10%;
        right: 0;
        margin: auto;
        top: -215%;
    }