/* 基本のスタイル */
body {
    background-color: #d6f5d6;
    padding: 0.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h2 {
    color: #003366;
    font-size: 2rem;
}

/* テーブルをレスポンシブにするためのスタイル */
.table-container {
    width: 100%;
    overflow-x: auto; /* 横スクロールを有効にする */
}

table, th, td {
    border: 0.1rem solid black;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    background: skyblue;
}

th, td {
    padding: 0.3rem;
}

/* ヘッダー行のスタイル */
th {
    font-size: 25pt;
    color: #000080;
    text-align: center; /* ヘッダー行を中央寄せ */
    border-bottom: 0.15rem double black; /* ヘッダーとの境を二重線に設定 */
}

/* データ行のスタイル */
td {
    font-size: 18pt;
    text-align: left; /* データ行を左寄せ */
}


/* 画像をCSSで指定 */
.top-btn {
    width: 4rem;
    height: auto;
}

#scrollToTopBtn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none; /* 初期は非表示 */
  background-color: #d0f4de;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  z-index: 1000; /* 他の要素より上に表示 */
}

#scrollToTopBtn:hover {
  background-color: #b2e2c4;
}

/* 大きなデスクトップ向けのスタイル */
@media (min-width: 1024px) {
    h2 {
        font-size: 3.5rem;
    }

    th, td {
        font-size: 1.6rem;
    }

    .top-btn {
        width: 8rem;
        height: auto;
    }

    .result-top {
        width: 4.2rem;
        height: auto;
    }
}

/* ラップトップや小さめのデスクトップ向けのスタイル */
@media (min-width: 769px) and (max-width: 1023px) {
    h2 {
        font-size: 3rem;
    }

    th, td {
        font-size: 1.5rem;
    }

    .top-btn {
        width: 7rem;
        height: auto;
    }

    .result-top {
        width: 3.2rem;
        height: auto;
    }
}

/* タブレット向けのスタイル */
@media (min-width: 481px) and (max-width: 768px) {
    h2 {
        font-size: 2.5rem;
    }

    th, td {
        font-size: 1.3rem;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -625rem;
        left: -625rem;
    }

    tr {
        margin: 0 0 1rem 0;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 30%;
        text-align: right;
    }

    td:before {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        width: 45%;
        padding-right: 0.6rem;
        white-space: nowrap;
        content: attr(data-label);
        text-align: left;
    }

    .top-btn {
        width: 6rem;
        height: auto;
    }

    .result-top {
        width: 2rem;
        height: auto;
    }
}

/* スマートフォン向けのスタイル */
@media (max-width: 480px) {
    h2 {
        font-size: 1.5rem;
    }

    th, td {
        font-size: 1rem;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -625rem;
        left: -625rem;
    }

    tr {
        margin: 0 0 1rem 0;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        position: absolute;
        top: 0.5rem;
        left: 0.5rem;
        width: 45%;
        padding-right: 0.6rem;
        white-space: nowrap;
        content: attr(data-label);
        text-align: left;
    }

    .top-btn {
        width: 4rem;
        height: auto;
    }

    .result-top {
        width: 1.5rem;
        height: auto;
    }
}
