body {
    font-family: 'Orbitron', 'Noto Sans JP', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #111827;
    /* gray-900 */
    color: white;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.panel-section {
    border: 1px solid #374151;
    background-color: #1f2937;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.panel-header {
    background-color: #374151;
    padding: 0.75rem 1rem;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.scene-card {
    background-color: #111827;
    border: 1px solid #4b5563;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-card:hover {
    border-color: #3b82f6;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    padding: 0.5rem;
    color: white;
    font-size: 0.875rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

/* Switch Toggle */
.toggle-checkbox:checked {
    right: 0;
    border-color: #3b82f6;
}

.toggle-checkbox:checked+.toggle-label {
    background-color: #3b82f6;
}

#gent {
    margin: 1rem 1rem 1rem 0%;
}

.toggle-checkbox:checked~.toggle-label {
    transform: translateX(26px);
}

.toggle-checkbox:checked~.toggle-track {
    background-color: orange;
}

#tutorialWindow {
    position: fixed;
    width: 450px;
    padding: 10px;
    background-color: #00000046;
    text-shadow: 2px 2px 2px black;
    white-space: pre-wrap;
    border: solid 1px #ff0077;
    color: white;
    border-radius: 5px;
    pointer-events: none;
    display: none;
    z-index: 500;
}

#scene-modal {
    z-index: 45;
}

.novel {
    /* position: fixed; */
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #00cece;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.novel:hover {
    background-color: #00a4a4;
}

.novel1 {
    /* position: fixed; */
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #ff0077;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.novel1:hover {
    background-color: #b40054;
}

.novel2 {
    /* position: fixed; */
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #ffd500;
    color: rgb(0, 0, 0);
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.novel2:hover {
    background-color: #b79900;
    color: rgb(0, 0, 0);
}

#tutorialButton,
#importHtmlButton,
.tutorialButton {
    /* position: fixed; */
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#importHtmlButton {
    right: 225px;
    /* チュートリアルボタンの横に配置 */
}

#tutorialButton:hover,
#importHtmlButton:hover,
.tutorialButton:hover {
    background-color: #0056b3;
}

/* タイピングアニメーション用のスタイル */
.typing {
    display: inline-block;
    white-space: pre-wrap;
    overflow: hidden;
    border-right: 2px solid rgba(255, 255, 255, 0);
    /* カーソル風の点滅 */
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}

/* メニューボタンのスタイル */
.menu-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    z-index: 1000;
}

.menu-btn:hover {
    background-color: #0056b3;
}

/* メニューのスタイル */
.nav-menu {
    position: fixed;
    top: 0;
    right: -30%;
    /* 初期状態では画面外に隠れている */
    width: 30%;
    height: 100%;
    background-color: #222;
    color: white;
    transition: right 0.3s ease-in-out;
    overflow-y: scroll;
    /* スライドアニメーション */
    z-index: 999;
    padding-bottom: 100px;
}

/* メニューが表示された時の状態 */
.nav-menu.active {
    right: 0;
}

/* メニュー項目のスタイル */
.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 90px 0 0 0;
}

.nav-menu li {
    padding: 15px 20px;
    border-bottom: 1px solid #444;
}

.nav-menu li a {
    /* color: white; */
    text-decoration: none;
    font-size: 18px;
}

.nav-menu li a:hover {
    color: #ddd;
}

/* オーバーレイ（メニュー表示時の背景） */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    z-index: 998;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

#context-menu {
    position: absolute;
    background-color: #374151;
    border: 1px solid #4b5563;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
}

#context-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    text-align: left;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
}

#context-menu button:hover {
    background-color: #4b5563;
}

.panel-content {
    padding: 1rem;
    /* height: 210px; */
    overflow: scroll;
    transition: max-height 0.3s ease-out;
}

#vars-panel {
    overflow: scroll;
    max-height: 210px;
    padding-bottom: 20px;
}

#variable-list {
    overflow: scroll;
    max-height: 100px;
    padding-bottom: 20px;
}

#scene-list {
    overflow: scroll;
    /* max-height: 450px; */
    max-height: 620px;
}

@media screen and (max-width: 800px) {

    /* 画面の横幅が max-widthに書き込んだ数値以下になったらここに書き込まれたCSSに切り替える */
    body {
        height: 1000px;
        overflow-y: scroll;
    }

    #favavv {
        display: inline-block;
    }

    main {
        /* height: 1000px; */
        overflow: scroll !important;
    }

    #wer {
        display: none;
    }

    .menu-btn {
        top: auto;
        background-color: #9fc700;
        bottom: 0%;
        border-radius: 10px 10px 0px 0px;
        left: 0%;
        right: 0;
    }

    .menu-btn:hover {
        background-color: #c19d00;
    }

    .novel2 {
        display: none;
    }

    /* メニューのスタイル */
    .nav-menu {
        right: -95%;
        width: 95%;
    }

    .nav-menu ul {
        margin-top: 10%;
    }

    #lag a {
        margin: 2px;
        display: inline-block;
    }

    #dlbt {
        /* font-size: 80%; */
        display: none;
    }

    #dlbt01 {
        /* font-size: 80%; */
        display: inline-block;
    }

    #rert {
        flex-wrap: nowrap !important;
    }

    #bunki {
        top: 0%;
        width: 100%;
    }

    #tyekku {
        right: 0%;
        padding-left: 5px;
        /* width: 100%; */
    }

    #ertwww {
        display: none;
    }

    #verttt {
        min-height: 50px;
    }

    #scene-list {
        min-height: 50px;
    }

    #eventtttt {
        min-height: 100vh;
    }

    #gent {
        width: 90.5%;
        margin-top: 0%;
        margin-left: 5%;
        min-height: 500px;
    }

    #tyi {
        display: none;
    }

    #tutorialWindow {
        width: 97%;
    }
}