body {
    margin: 0;
    font-family: "Roboto", serif;
}

/* header */
header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: start;
    padding: 5px 3% 30px;
    height: 150px;
    overflow: hidden;
}

.site-logo__wrap {
    height: 100%;
}

.site-title {
    font-weight: bold;
    font-size: 32px;
    margin: 0;
    width: 283px;
    height: 100%;
}

.site-title img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    position: absolute;
    top: 26px;
    right: 20px;
    width: 80px;
    height: 80px;
    background: #92bbf5;
    border-radius: 100%;
}

.hamburger.fixed {
    position: fixed;
}

.hamburger span {
    display: block;
    width: 30px;
    height: 2px;
    background: #FFF;
    border-radius: 2px;
    transition: 0.3s ease;
}

.hamburger p {
    margin: 0;
    font-size: 16px;
    color: #FFF;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media screen and (max-width:768px) {
    header {
        height: 70px;
        padding: 0px 1% 30px;
    }

    .site-title {
        font-size: 24px;
        width: 120px;
        height: 70px;
    }

    .hamburger {
        top: -15px;
        right: -15px;
        padding: 15px 10px 0 0;
    }

    .hamburger p {
        font-size: 11px;
        font-weight: bold;
    }
}

/*
.hamburger.active span{
    background: #FFF;
}

.hamburger.active p{
    color: #FFF;
}
*/

.site-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100%;
    background: #FFF;
    display: flex;
    flex-direction: column;
    z-index: 999;
    transform: translateX(100%);
    transition: 0.3s ease;
    overflow-y: scroll;
}

.menu__list {
    margin: 150px 30px 50px;
    list-style: none;
    padding: 0;
}

.menu__item {
    position: relative;
    padding-bottom: 10px;
}

.menu__item > a{
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 24px;
    font-weight: bold;
    border-bottom: 1px solid #d1a606;
}

.menu__button {
    display: flex;
    align-items: center;
    width: 100%;
    cursor: pointer;
    text-align: left;
    font-size: 22px;
}

.menu__icon {
    width: 20px;
    height: 20px;
    margin: 0 10px 3px 0;
    object-fit: contain;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 998;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.site-nav.active {
    transform: translateX(0);
}

.sub-menu__list {
    max-height: 0;
    overflow: hidden;
    list-style: none;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 0 0 1em;
    font-size: 22px;
}

.menu__item.has-sub.open > .sub-menu__list {
    max-height: 500px;
    padding: 5px 0 0 1em;
}

.menu__item.has-sub::after {
    content: '';
    position: absolute;
    top: 12px;
    right: 20px;
    transform: rotate(135deg);
    transition: 0.5s ease;
    width: 15px;
    height: 15px;
    border-top: 2px solid #555;
    border-right: 2px solid #555;
    z-index: -1;
}

.menu__item.has-sub.open::after {
    transform: rotate(135deg) scale(-1,-1);
    top: 20px;
}

.sub-menu__item {
    padding: 10px 0;
}

.item--indent {
    padding-left: 1em;
}

.sub-menu__item > a {
    display: flex;
    align-items: center;
}

.icon__list {
    display: flex;
    gap: 20px;
}

.icon__list .menu__icon {
    width: 30px;
    height: 30px;
    margin: 0;
}

@media screen and (max-width:768px) {
    .site-nav {
        max-width: 90%;
    }

    .menu__item > a {
        font-size: 18px;
    }

    .menu__list {
        margin: 100px 5% 0;
    }

    .sub-menu__list {
        font-size: 16px;
    }

    .menu__button {
        font-size: 16px;
    }

}

@media screen and (max-width:425px) {
    .site-nav {
        width: 100%;
    }
}

.option__wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.option-toggle__btn {
    display: flex;
    align-items: center;
    position: relative;
    width: 100px;
    height: 50px;
    border-radius: 50px;
    box-sizing: content-box;
    background-color: #c7c7c733;
    cursor: pointer;
    transition: background-color .4s;
    margin: 0 10px 0 auto;
}

.option-toggle__btn:has(:checked) {
    background-color: #92bbf533;
}

.option-toggle__btn::before {
    position: absolute;
    left: 5px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #c7c7c7;
    content: '';
    transition: left .4s;
}

.option-toggle__btn:has(:checked)::before {
    left: 54px;
    background-color: #92bbf5;
}

.option-toggle__btn::after {
    position: absolute;
    left: 26px;
    transform: translateX(-50%);
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    content: 'OFF';
    transition: left .4s;
}

.option-toggle__btn:has(:checked)::after {
    left: 75px;
    content: 'ON';
}

.option-toggle__btn input {
    display: none;
}

@media screen and (max-width:768px) {
    .option-toggle__btn {
        flex: 0 1 50px;
        height: 25px;
        margin-right: 0;
    }

    .option-toggle__btn::before {
        left: 2px;
        width: 21px;
        height: 21px;
    }

    .option-toggle__btn::after {
        left: 12px;
        font-size: 10px;
    }

    .option-toggle__btn:has(:checked)::before{
        left: 27px;
    }

    .option-toggle__btn:has(:checked)::after {
        left: 37px;
    }
}

.version__wrap {
    margin: auto 30px 20px 0;
    text-align: right;
}

.version__wrap p{
    margin: 0;
}


/* 描画範囲 */
#sceneview {
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: -1;
}

/* footer */
#footer {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2%;
    box-sizing: border-box;
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18pt;
    user-select: none;
}

@media screen and (max-width:425px) {
    #footer {
        font-size: 16px;
    }
}

/* speed bar */
.speed-bar__wrap {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    user-select: none;
}

.slider {
    position: relative;
    height: 6px;
    background: #ccc;
    border-radius: 3px;
    flex: 1;
}

.handle {
    position: absolute;
    top: -7px;
    left: 0;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: grab;
}

.turtle--icon,
.rabbit--icon {
    width: 30px;
    position: relative;
}

.rabbit--icon::after{
    content: '1x';
    position: absolute;
    top: -3px;
    right: -3px;
    color: rgb(75, 75, 75);
    font-size: 14px;
    font-weight: bold;
}

@media screen and (max-width:425px) {
    .turtle--icon,
    .rabbit--icon {
        width: 20px;
    }

    .rabbit--icon::after{
        font-size: 10px;
    }
}

/* preset */
.preset__wrap {
    padding-bottom: 10px;
    box-sizing: border-box;
}

.siteswaps__select {
    font-size: 18px;
    color: #000;
    width: 100%;
    position: relative;
    padding: 5px 2px;
    border: 1px solid #ccc;
    background: white;
    border-radius: 5px;
}

.siteswaps__select::after {
    content: '▲';
    position: absolute;
    top: 0;
    right: 0;
}

/* siteswap input */
input {
    font-size: 18pt;
}

.inputwrap {
    display: flex;
    width: 100%;
    padding-bottom: 10px;
    box-sizing: border-box;
    gap: 1%;
}

.siteswapinputwrap {
    flex: 0 1 50%;
    position: relative;
    border: 1px solid #ccc;
    white-space: nowrap;
    background: white;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    background-color: transparent;
    color: #000;
    border-radius: 0;
    border: none;
    padding: 0;
    box-sizing: border-box;
    font-size: 18px;
    font-family: "Roboto", serif;
}

.play__btn {
    flex: 1 1 25%;
    background-color: #f78a38;
    border-radius: 999px;
    border: none;
    padding: 5px;
    color: #FFF;
    font-weight: bold;
}

.play__btn::before{
    content: '▲';
    display: inline-block;
    color: #FFF;
    transform: rotate(90deg);
    margin-right: 3px;
}

.high-low__btn {
    display: flex;
    flex: 0 1 25%;
}

.high__btn {
    background-color: #ddd;
    color: #FFF;
    font-weight: bold;
    display: flex;
    align-items: center;
    flex: 1 1 18%;
    max-width: 120px;
    border-radius: 100px 0 0 100px;
    clip-path: polygon(
        0 0,
        100% 0,
        66% 100%,
        0 100%
    );
    box-sizing: border-box;
    margin-right: -30px;
    padding-left: 15px;
    height: 30px;
    transform: translateY(-3px);
}

.high__btn::before {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 3px;
    background-image: url(./images/up.png);
    background-size: contain;
    background-repeat: no-repeat;
}

.low__btn {
    background-color: #ddd;
    color: #FFF;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: end;
    flex: 1 1 18%;
    max-width: 120px;
    border-radius: 0 100px 100px 0;
    clip-path: polygon(
        33% 0,
        100% 0,
        100% 100%,
        0 100%
        );
    box-sizing: border-box;
    margin-left: -30px;
    padding-right: 15px;
    height: 30px;
    transform: translateY(3px);
}

.low__btn::after {
    content: '';
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-left: 3px;
    background-image: url(./images/down.png);
    background-size: contain;
    background-repeat: no-repeat;
}

.high__btn.active,
.low__btn.active {
    background-color: #92bbf5;
    color: #FFF;
    z-index: 2;
    border: none;
}

#siteswapinput {
    position: absolute;
    margin: 0;
    padding: 0 5px;
    box-sizing: border-box;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
    caret-color: black;
    width: 100%;
    height: 100%;
    white-space: nowrap;
    font-size: 18px;
    font-family: "Roboto", serif;
}

.highlighter {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 5px 5px 0 5px;
    box-sizing: border-box;
    font-size: 18px;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    color: black;
    overflow-x: scroll;
    scrollbar-width: none; /* for Firefox */
    -ms-overflow-style: none; /* for IE */
    text-decoration: none;
}

.highlighter::-webkit-scrollbar {
    display: none; /* for Chrome, Safari */
}

.error {
    color: red;
    background-color: #fcc;
}

@media screen and (max-width:768px) {
    .high__btn {
        padding-left: 10px;
    }

    .low__btn {
        padding-right: 10px;
    }
}

@media screen and (max-width:425px) {
    .siteswaps__select {
        font-size: 16px;
    }

    button {
        font-size: 16px;
    }

    #siteswapinput {
        font-size: 16px;
    }

    #highlighter {
        font-size: 16px;
    }

    .high__btn {
        padding-left: 7%;
    }

    .high__btn::before {
        width: 10px;
        height: 10px;
        margin-right: 2px;
    }

    .low__btn {
        padding-right: 7%;
    }

    .low__btn::after {
        width: 10px;
        height: 10px;
        margin-left: 2px;
    }
}