div.course_table {
    overflow-x: auto;
}

table {
    min-width: 500px;
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    border-spacing: 0;
}

th, td {
    border: 1px solid #ccc;
    border-top: none;
    border-left: none;
    text-align: center;
    padding: 5px;
}
td {
    font-size:80%;
    padding: 1px 5px;
}
th:nth-of-type(1){
    width: 33%;
    min-width: 130px;
    position: sticky;
    border: none; /*ここが大事*/
    top: 0;
    left: 0;
}
th:nth-of-type(1)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-right: 1px solid #ccc;
  background: #fff;
  z-index: -1;
}
th:nth-of-type(2),
th:nth-of-type(3) {
    width: calc((100% - 33%) / 2);
}
thead th:nth-of-type(2),
thead th:nth-of-type(3) {
    background: #2980b9;
    color: #fff;
}
tbody th a {
    display: block;
    width: calc(100%-5px);
    height: 100%;
    line-height: 30px;
    text-decoration: none;
    border: 2px solid;
    border-radius: 10px;
    margin-right:5px;
    transition: 0.5s;
    &:hover{
        text-decoration: none;
    }
}

/*ボタン：スーパーキッズ*/
tbody th a.b-sk {
    border-color: hsl(5, 78%, 57%);
    color: hsl(5, 78%, 57%);
    &:hover {
        background: hsl(5, 78%, 73%);
        color: #fff;
    }
}

/*ボタン：小学生受験科*/
tbody th a.b-ps {
    border-color: hsl(145, 63%, 39%);
    color: hsl(145, 63%, 39%);
    &:hover {
        background: hsl(145, 63%, 49%);
        color: #fff;
    }
}

/*ボタン：小学生公立科*/
tbody th a.b-pk {
    border-color: hsl(36, 90%, 51%);
    color: hsl(36, 90%, 51%);
    &:hover {
        background: hsl(36, 90%, 69%);
        color: #fff;
    }
}

/*ボタン：小学英検*/
tbody th a.b-op {
    border-color: hsl(282, 43%, 47%);
    color: hsl(282, 43%, 47%);
    &:hover {
        background: hsl(282, 43%, 67%);
        color: #fff;
    }
}

/*ボタン：中学生*/
tbody th a.b-s {
    border-color: hsl(203, 63%, 44%);
    color: hsl(203, 63%, 44%);
    &:hover {
        background: hsl(203, 63%, 65%);
        color: #fff;
    }
}


/*コース紹介のタブ*/
.result-tab {
    display: flex;
    flex-wrap: wrap;
    max-width: 100%;
}

.result-tab input {
    display: none;
}

.result-tab > label {
    flex: 1 1;
    order: -1;
    position: relative;
    min-width: 70px;
    padding: 5px 0;
    border: 3px solid #f2f2f2;
    background-color: #f2f2f2;
    color: #999;
    cursor: pointer;
    display: grid; /*上下左右中央寄せ*/
    place-items: center; /*上下左右中央寄せ*/
    &:hover {
        border: 3px solid #ccc;
        background-color: #fff;
    }
    &:has(:checked) {
        border: 3px solid #4d9bc1;
        background-color: #fff;
        color: #4d9bc1;
        &::before {
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 18px;
            height: 9px;
            background-color: #4d9bc1;
            content: '';
            clip-path: polygon(0 0, 100% 0, 50% 100%);
        }
    }
}

/*タブ：スーパーキッズ*/
.result-tab > label.l-sk:has(:checked) {
    border-color: hsl(5, 78%, 57%);
    color: hsl(5, 78%, 57%);
    &::before {
        background-color: hsl(5, 78%, 57%);
    }
}

/*タブ：小学生受験科*/
.result-tab > label.l-ps:has(:checked) {
    border-color: hsl(145, 63%, 39%);
    color: hsl(145, 63%, 39%);
    &::before {
        background-color: hsl(145, 63%, 39%);
    }
}

/*タブ：小学生公立科*/
.result-tab > label.l-pk:has(:checked) {
    border-color: hsl(36, 90%, 51%);
    color: hsl(36, 90%, 51%);
    &::before {
        background-color: hsl(36, 90%, 51%);
    }
}
/*タブ：中学生*/
.result-tab > label.l-s:has(:checked) {
    border-color: hsl(203, 63%, 44%);
    color: hsl(203, 63%, 44%);
    &::before {
        background-color: hsl(203, 63%, 44%);
    }
}

.result-tab > div {
    display: none;
    width: 100%;
    padding: 10px 0 0;
    margin-top:30px;
}

.result-tab label:has(:checked) + div {
    display: block;
    
    /* animationプロパティ設定 */
    animation-name: fadeIn;
    animation-fill-mode:forwards;
    animation-duration:1s;
}

/*フェードインアニメ*/
@keyframes fadeIn{
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0px);
    }
}

