body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
}

header {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid black;
    padding: 10px 20px;
    z-index: 2000;
}

.logo-area {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-area img {
    height: 50px;
}

.site-name {
    font-size: 24px;
    font-weight: bold;
    margin-left: 10px;
    color: black;
    text-decoration: none;
}

.paw {
    font-size: 24px;
    margin-left: 5px;
}

nav a {
    margin-left: 20px;
    text-decoration: none;
    color: black;
    font-weight: bold;
}

#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.85);
    /* 半透明白 */
    z-index: 800;
    /* 最前面に */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;    
}

.loading-text {
    font-size: 28px;
    color: #555;
    font-weight: bold;
    text-align: center;
}

/* ナビゲーションバー全体 */
#navbar {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(20, 20, 20, 0.9);
    height: 80px;
    display: flex;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ナビゲーションバー内コンテンツ */
.navbar-content {
  display: flex;
  /* justify-content: space-between; */
  align-items: center;
  width: 100%;
  padding: 0 20px;  
}

.navbar-buttons {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

/* タイトル */
.navbar-title {
    font-size: clamp(25px, 3vw, 36px);
    font-weight: bold;
    color: #f0f0f0;
    letter-spacing: 1px;
}

/* 言語切り替えボタン */
.lang-button {
    font-size: 16px;
    padding: 8px 16px;
    background-color: #ffffff;
    color: #000;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.lang-button:hover {
    background-color: #dddddd;
}


.discription {
    margin: 60px auto 0;
    max-width: 1000px;
    padding: 0 3vw;
}

.discription p {
    text-align: start;
    text-indent: 1rem;
}

#main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
}

#title {
    font-size: clamp(30px, 8vw, 60px);
    font-weight: bold;
    margin-bottom: 20px;
    padding-left: 3vw;
    color: #111;
}

#sim-area {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

#canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: auto;
    border: none;
}

#canvas-container canvas {
    border: 2px solid black;
}

.distribution-type {
    margin: 10px 0;
}

#distributionSelect {
    position: relative;
    width: 100px;
    font-size: 32px;
    bottom: 5px;
}

#side-buttons {
    display: flex;
    flex-direction: column;
    gap: 1vw;
    width: 20vw;
    padding: 10px 15px;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
}

#side-buttons button {
    font-size: clamp(15px, 3vw, 30px);
    padding: 10px;
    width: auto;
    height: 80px;
    background-color: #8c8c8c;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

#side-buttons button:hover {
    background-color: #2A2A2A;
}

.tooltip-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.tooltip-box {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: start;
    text-indent: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    max-width: 80%;
}

.question-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 12px;
    line-height: 1;
    border-radius: 50%;
    background-color: #2A2A2A;
    color: white;
    font-weight: bold;
    margin-left: 5px;
}

#bottom-buttons-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* 中身：ボタンは左揃え、幅固定、折り返し */
#bottom-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5vw;
    justify-items: start;
    /* ボタン自体を左揃えに */
    width: 90vw;
}

/* ボタンの統一サイズ設定 */
#bottom-buttons button,
#bottom-buttons .dropdown {
    font-size: 24px;
    /* width: 180px; */
    width: 100%;
    height: 80px;
    /* font-size: 16px; */
    border-radius: 10px;
    background-color: #8c8c8c;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
}

#bottom-buttons button:hover,
#bottom-buttons .dropdown:hover>button {
    background-color: #2A2A2A;
}

.dropdown {
    position: relative;
}

.dropdown button {
  cursor: pointer;
}

.dropdown-menu {
    display: none;
    /* 初期状態では非表示 */
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 5px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    z-index: 10;
    min-width: 250px;
    max-width: 400px;
}

.dropdown-menu button {
    background-color: #b1b1b1 !important;
    width: auto;
    text-align: left;
    border: none;
    cursor: pointer;
}

.dropdown-menu button:hover {
    background-color: #8c8c8c !important;
}

.Language-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-60%);
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 8px;
    z-index: 10;
    min-width: 150px;
    max-height: 150px;
    /* スクロールのための高さ制限 */
    overflow-y: auto;
    /* 縦スクロールを有効にする */
    gap: 10px;
}

.Language-menu button {
    background-color: #b1b1b1 !important;
    padding: 12px 16px;
    /* ボタンを大きめに */
    font-size: 16px;
    /* 文字サイズも少し大きく */
    border: none;
    cursor: pointer;
    border-radius: 6px;
    width: 100%;
    /* メニュー幅に合わせる */
    text-align: left;
}

.Language-menu button:hover {
    background-color: #8c8c8c !important;
}

label {
    font-size: 16px;
    margin-left: 10px;
    color: #333;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 350px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    font-size: clamp(25px, 5vw, 34px);
}

.modal-content p {
    font-size: clamp(15px, 2vw, 20px);
}

.modal-content h4 {
    font-size: clamp(18px, 3vw, 22px);
    margin-bottom: 0px;
}

.modal-content input[type="number"] {
    width: 100%;
    padding: 5px;
    margin-bottom: 10px;
}

.close-button {
    all: unset;
    /* 一旦すべてリセット（強力） */
    font-size: 20px;
    width: 45%;
    margin: 5px;
    height: 60px;
    color: white;
    font-weight: bold;
    background-color: #8c8c8c;
    border-radius: 8px;
    text-align: center;
    display: inline-block;
    cursor: pointer;
    user-select: none;
}

.close-button:hover {
    background-color: #2A2A2A;
}

.zero-velocity-button {
    width: 100%;
    height: 25px;
    font-size: 16px;
    text-align: center;
    background-color: white;
    color: black;
    border: 1px solid #848484;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 2px;
}

.zero-velocity-button:hover {
    color: white;
    background-color: #848484;
}

/* モーダル内の1行分 */
.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: 0px;
    gap: 10px;
}

/* ラベルの固定幅 */
.setting-row label {
    width: auto;
    font-size: clamp(15px, 3vw, 20px);
    color: #333;
    text-align: right;
}

/* 入力欄 */
.setting-row input[type="number"],
.setting-row input[type="text"],
.setting-row select {
    flex: 1;
    padding: 5px;
    font-size: 16px;
}

@media (max-width: 1150px) {
    #sim-area {
        flex-direction: column;
        /* side-buttons を下に移動 */
        align-items: center;
    }

    #side-buttons {
        flex-direction: row;
        /* 横並びにする */
        flex-wrap: wrap;
        /* 画面が狭いとき折り返す */
        justify-content: center;
        margin-top: 20px;
        width: 100%;
    }

    #side-buttons button {
        width: 16vw;
        height: 80px;
        flex: 1 1 auto;
        margin: 5px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    height: 70vh;
    max-width: 80vw;
}

#gif-slideshow {
    position: relative;
    width: 90%;
    margin: 0 auto;
    margin-top: 60px;
    overflow: hidden;
    transition: height 0.5s ease-in-out;
}

/* 全スライドをレイアウト上に常に表示させておく */
#gif-slideshow .slide {
    position: absolute;
    /* 全部重ねる */
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    /* 非表示のスライドはクリック不可に */
    transition: opacity 1.2s ease-in-out;
    z-index: 0;
}

/* アクティブなスライド */
#gif-slideshow .slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

/* GIF画像スタイル */
#gif-slideshow .slide img {
    height: auto;
    border-radius: 10px;
    width: 70vw;
}

/* 説明文スタイル */
#gif-slideshow .slide p {
    text-align: start;
    margin-top: 10px;
    font-size: 16px;
    height: 20vw;
    overflow-y: auto;
    color: #333;
    width: 70vw;
}

/* ✅ ウィンドウ幅が600px以上のときは横並び */
@media screen and (min-width: 900px) {
    #gif-slideshow {
        width: 80vw;
        max-width: 1000px;
    }

    #gif-slideshow .slide {
        flex-direction: row;
        width: 100%;
    }

    #gif-slideshow .slide img {
        margin-right: 20px;
        width: 50%;
    }

    #gif-slideshow .slide p {
        width: 50%;
    }
}

#footer {
    margin-top: 30px;
    height: 60px;
    font-size: clamp(8px, 3vw, 24px);
    background-color: #2A2A2A;
    color: #fff;
    text-align: flex-start;
    padding: 20px 10px;
    font-weight: bold;
}

#footer a {
    color: #fff;
    text-decoration: underline;
}

#contact-form-section {
    margin: 40px auto;
    max-width: 1500px;
    padding: 20px;
    border-top: 1px solid #ccc;
}

#contact-form .form-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

#contact-form label {
    width: 140px;
    font-weight: bold;
    margin-top: 6px;
}

#contact-form input,
#contact-form textarea {
    flex: 1;
    padding: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

#contact-form textarea {
    height: 200px;
    resize: vertical;
}

#contact-form .close-button {
    margin-top: 10px;
    padding: 8px 16px;
    max-width: 400px;
}