* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #ffffff;
    color: #fff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

@media (min-aspect-ratio: 1/1) {
    .container {
        flex-direction: row;
    }
    
    #threejs-container {
        flex: 0 0 70%;
        width: 70%;
        height: 100%;
    }
    
    #html-container {
        flex: 0 0 30%;
        width: 30%;
        height: 100%;
    }
}

@media (max-aspect-ratio: 1/1) {
    .container {
        flex-direction: column;
    }
    
    #threejs-container {
        flex: 0 0 70%;
        width: 100%;
        height: 70%;
    }
    
    #html-container {
        flex: 0 0 30%;
        width: 100%;
        height: 30%;
    }
}

#threejs-container {
    background: linear-gradient(135deg, #ffffff, #efecec);
    position: relative;
    overflow: hidden;
}

@keyframes rotate {
    from { transform: rotateX(0) rotateY(0) rotateZ(0); }
    to { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

#html-container {
    background: linear-gradient(135deg, #f1f6cf, #fae6c0);
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.control-section {
    margin-bottom: 10px;
    padding-top: 20px;
}

.section-label {
    font-size: 1.4rem;
    color: #525252;
    margin-bottom: 5px;
    padding-bottom: 5px;
    display: inline-block;
    font-weight: 600;
}

.button-scroll-container {
    overflow-x: auto;
    padding-bottom: 0px;
    margin-bottom: 0px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4a8bfc #16213e;
}

.button-scroll-container-fillin {
    overflow-x: auto;
    padding-left: 50px;
    padding-right: 50px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #4a8bfc #16213e;
}

.button-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.button-scroll-container::-webkit-scrollbar-track {
    background: #16213e;
    border-radius: 4px;
}

.button-scroll-container::-webkit-scrollbar-thumb {
    background: #4cc9f0;
    border-radius: 4px;
}

.button-row {
    display: flex;
    gap: 10px;
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
    justify-content: space-between;
}

.btn {
    padding: 6px 6px;
    font-size: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
    color: white;
    flex-shrink: 0;
}

.btn-x {
    background: linear-gradient(145deg, #ffafaf, #ff3923);
    color: white;
}

.btn-y {
    background: linear-gradient(145deg, #a1ffc6, #26ff80);
    color: white;
}

.btn-z {
    background: linear-gradient(145deg, #9dd8ff, #2cabff);
    color: white;
}

.btn-on {
    background: linear-gradient(145deg, #ffffff, #ede9e9);
    color: black;
    width: 32px;
    height: 32px;
}

.btn-highlight {
    background: linear-gradient(145deg, #e8aeff, #c131ff);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 15px;
}

.btn-hon {
    background: linear-gradient(145deg, #ffffff, #ede9e9);
    color: black;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 15px;
}

.btn-reset {
    background: linear-gradient(145deg, #f88f72, #fc5228);
    width: 100px;
    width: 120px;
    height: 40px;
    border-radius: 20px;
}

.btn-verify {
    background: linear-gradient(145deg, #efc640, #b76c2b);
    width: 100px;
    width: 120px;
    height: 40px;
    border-radius: 20px;
}

.btn:hover {
    transform: scale(1.07);
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
    filter: brightness(1.1);
}

.btn:active {
    transform: scale(1);
    color: black;
    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
}

.action-buttons {
    display: grid;
    gap: 50px;
    padding-top: 40px;
    grid-auto-flow: column;
    place-items: center; 
}

.selector-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
    padding: 4px;
    gap: 15px;
}

.selector-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #add5ff;
    background: linear-gradient(145deg, #f9ffab, #bdc954);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.selector-btn:hover {
    background: linear-gradient(145deg, hsl(43, 77%, 60%), #ff7d3c);
    color: white;
    transform: scale(1.1);
}

.selector-btn:active {
    transform: scale(1);
}

.selector-left {
    order: 1;
}

.selector-label {
    order: 2;
    width: 70%;
    height: 40px;
    text-align: center;
    padding: 12px 20px;
    background-color: white;
    border: 2px solid #383838;
    border-radius: 20px;
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
    justify-content: center;
}

.red-text {
    color: #ff3860;
    font-weight: 700;
    margin-right: 5px;
}

.normal-text {
    color: #495057;
    font-weight: 500;
}

.selector-right {
    order: 3;
}

.arrow {
    font-size: 20px;
    line-height: 1;
}

.tips-label {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c1c1c1;
    font-size: 10px;
    margin-left: 10%;
    width: 80%;
}

.sponsor-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    margin: 20px 0;
}

.sponsor-btn-leaderboard {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #252525;
    background: linear-gradient(45deg, #5ccbf7, #78ecc5);
    border: none;
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 12px 30px rgba(142, 45, 226, 0.35);
    z-index: 1;
    margin: 15px;
    width: 160px;
    height: 50px;
}

.sponsor-btn-support {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: #252525;
    background: linear-gradient(45deg, #ff94e2, #b16d6e);
    border: none;
    border-radius: 25px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 12px 30px rgba(142, 45, 226, 0.35);
    z-index: 1;
    margin: 15px;
    width: 160px;
    height: 50px;
}

.sponsor-btn-leaderboard:hover {
    transform: scale(1.05);
    box-shadow: 0 18px 40px rgba(248, 87, 166, 0.45);
    letter-spacing: 1.2px;
}

.sponsor-btn-leaderboard:active {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(248, 87, 166, 0.4);
    color: #474747;
}

.sponsor-btn-support:hover {
    transform: scale(1.05);
    box-shadow: 0 18px 40px rgba(248, 87, 166, 0.45);
    letter-spacing: 1.2px;
}

.sponsor-btn-support:active {
    transform: scale(1);
    box-shadow: 0 8px 20px rgba(248, 87, 166, 0.4);
    color: #474747;
}

@media (max-width: 768px) {
    .button-row {
        display: flex;
        gap: 10px;
    }

    .btn {
        padding: 6px 6px;
        font-size: 13px;
        width: 32px;
        height: 32px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
        box-shadow: 0 2px 2px rgba(0, 0, 0, 0.5);
        color: white;
        flex-shrink: 0;
    }
    
    .btn-highlight {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 16px;
    }

    .btn-x {
        background: linear-gradient(145deg, #ffafaf, #ff3923);
        color: white;
    }

    .btn-y {
        background: linear-gradient(145deg, #a1ffc6, #26ff80);
        color: white;
    }

    .btn-z {
        background: linear-gradient(145deg, #9dd8ff, #2cabff);
        color: white;
    }

    .btn-on {
        background: linear-gradient(145deg, #ffffff, #ede9e9);
        color: black;
    }

    .btn-highlight {
        background: linear-gradient(145deg, #e8aeff, #c131ff);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 15px;
    }

    .btn-hon {
        background: linear-gradient(145deg, #ffffff, #ede9e9);
        color: black;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 15px;
    }

    .btn-reset {
        background: linear-gradient(145deg, #f88f72, #fc5228);
        width: 100px;
        width: 120px;
        height: 40px;
        border-radius: 20px;
    }

    .btn-verify {
        background: linear-gradient(145deg, #efc640, #b76c2b);
        width: 100px;
        width: 120px;
        height: 40px;
        border-radius: 20px;
    }

    .selector-container {
        gap: 10px;
    }
    
    .selector-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .selector-label {
        min-width: 100px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .button-row {
        gap: 5px;
    }
    
    .btn {
        padding: 6px 6px;
        font-size: 13px;
        width: 32px;
        height: 32px;
    }

    .btn-x {
        background: linear-gradient(145deg, #ffafaf, #ff3923);
        color: white;
    }

    .btn-y {
        background: linear-gradient(145deg, #a1ffc6, #26ff80);
        color: white;
    }

    .btn-z {
        background: linear-gradient(145deg, #9dd8ff, #2cabff);
        color: white;
    }

    .btn-on {
        background: linear-gradient(145deg, #ffffff, #ede9e9);
        color: black;
        width: 32px;
        height: 32px;
    }

    .btn-highlight {
        background: linear-gradient(145deg, #e8aeff, #c131ff);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 15px;
    }

    .btn-hon {
        background: linear-gradient(145deg, #ffffff, #ede9e9);
        color: black;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 15px;
    }

    .btn-reset {
        background: linear-gradient(145deg, #f88f72, #fc5228);
        width: 100px;
        width: 120px;
        height: 40px;
        border-radius: 20px;
    }

    .btn-verify {
        background: linear-gradient(145deg, #efc640, #b76c2b);
        width: 100px;
        width: 120px;
        height: 40px;
        border-radius: 20px;
    }
    
    .section-label {
        font-size: 1.1rem;
    }

    .selector-container {
        gap: 10px;
    }
    
    .selector-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .selector-label {
        min-width: 100px;
        padding: 10px 15px;
        font-size: 14px;
    }
}


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

.popup-window {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 400px;
    padding: 30px;
    position: relative;
    animation: popup 0.3s ease-out;
}

@keyframes popup {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.popup-label-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: #232323;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.popup-label-p {
    text-align: center;
    font-size: 1.2rem;
    color: #555555;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.input-group {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    align-items: center;
}

.input-container {
    flex: 1;
    margin: 0 10px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-size: 1.2rem;
    font-weight: 500;
    font-weight: bold;
}

.underline-input {
    width: 100%;
    border: none;
    color: #9d9d9d;
    border-bottom: 2px solid #ddd;
    padding: 10px 0;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: transparent;
    max-height: 150px;
    overflow-y: auto;
}

.underline-input:focus {
    border-bottom-color: #667eea;
    background-color: #f8f9ff;
}

.button-group {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.popup-btn {
    flex: 1;
    margin: 0 10px;
    padding: 12px 0;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-upload {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%, #2dd3e5 100%);
    color: white;
}

.btn-exit {
    background: linear-gradient(135deg, #b309c6 0%, #637bd4 100%, #7bc729 100%);
    color: white;
}

.popup-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.popup-btn:active {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    color: #8e8e8e;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}