/* Responsive */
@media screen and (max-width: 500px) {
    .container{
        width: 100%;
    }
    .head-column{
        /*flex-wrap: wrap;*/
        justify-content: space-between;
        gap: 5px;
    }
    .input-box {
        height: 66px;
        width: 100%;
        margin: 0 8px;
    }
    .input-box svg {
        left: 12px;
        font-size: 25px;
    }
    .input-box input {
        padding: 10px;
    }
    .input-box .button {
        right: 12px;
        font-size: 14px;
        padding: 8px 18px;
        display: none;
    }
    .head-category{
        flex-direction: column;
        align-items: stretch;
        margin-left: 10px;
        margin-right: 10px;
    }
    .list-cate{
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 4px;
        flex-wrap: nowrap;
    }
    .list-cate .mobile-hide{
        display: none;
    }
    .cate-ql-desktop{
        display: none !important;
    }
    .list-cate .mobile-keep{
        height: 40px;
        padding: 10px 8px;
        gap: 6px;
    }
    .list-cate .mobile-keep span{
        font-size: 13px;
    }
    .cate-ql-item{
        font-size: 12px;
        padding: 0 7px;
        gap: 4px;
    }
    .cate-ql-item svg{
        width: 15px;
        height: 15px;
    }

    /* Dark mode dropdown on mobile */
    .setting-head{
        position: relative;
    }
    .box-setting-head{
        top: calc(100% + 8px);
        right: 0;
        width: min(92vw, 320px);
        padding: 14px;
        gap: 12px;
        border-radius: 12px;
    }
    .span-dark-mode{
        font-size: 13px;
        line-height: 18px;
    }
    .theme-switch{
        width: 56px;
        height: 32px;
    }
    .slider:before{
        width: 24px;
        height: 24px;
        bottom: 4px;
        left: 4px;
    }
    input:checked + .slider:before{
        transform: translateX(24px);
    }

    /* Bar dropdown on mobile */
    .box-bar{
        width: min(92vw, 320px);
        right: 0;
    }

    /* Live / index: table odds owns horizontal scroll so headers and rows stay aligned */
    .box-table-center{
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
    }
    .box-table-center .match-table-shell{
        width: 100%;
        max-width: 100%;
        overflow: visible;
    }
    .box-table-center .match-table-head-scroll,
    .box-table-center .match-table-body-scroll{
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
    .box-table-center .match-table-head-scroll{
        position: sticky;
        top: 0;
        z-index: 20;
        scrollbar-width: none;
    }
    .box-table-center .match-table-head-scroll::-webkit-scrollbar{
        display: none;
    }
    .box-table-center .box-list-content:hover{
        background: #131313;
    }
    .box-table-center .box-list-content.active,
    .box-table-center .box-list-content.active:hover{
        background: #3c3c3c;
    }
    .login-container .onboarding{
        display: none;
    }
    .login-container .login-form{
        width: 100%;
    }
    .login-container .login-register{
        width: 100%;
    }
    .login-out{
        padding: 20px 16px;
    }
    .footer-column{
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    #footer .container{
        padding: 30px 10px;
    }
    .responsible-gaming-bar{
        gap: 14px;
        padding: 16px 0 18px;
    }
    .responsible-gaming-note{
        align-items: flex-start;
        gap: 8px;
    }
    .responsible-gaming-divider{
        display: none;
    }
    .responsible-gaming-disclaimer{
        flex-basis: 100%;
    }
    .responsible-gaming-links{
        align-items: stretch;
        display: grid;
        gap: 8px;
        grid-template-columns: 1fr;
    }
    .responsible-gaming-link{
        justify-content: flex-start;
        min-height: 34px;
        width: 100%;
    }
    .trust-box-section{
        padding: 20px 10px 26px;
    }
    .trust-box{
        padding: 22px 14px 18px;
    }
    .trust-box-head h2{
        font-size: 22px;
        line-height: 28px;
    }
    .trust-box-head p{
        font-size: 14px;
        line-height: 22px;
        margin-top: 12px;
    }
    .trust-metrics{
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 20px;
    }
    .trust-metric{
        min-height: 160px;
        padding: 18px 14px;
    }
    .trust-metric i{
        font-size: 30px;
        margin-bottom: 10px;
    }
    .trust-metric strong{
        font-size: 30px;
        line-height: 36px;
    }
    .trust-features{
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 16px;
        padding: 16px 18px;
    }
    .trust-feature{
        align-items: flex-start;
    }
    .trust-tags{
        gap: 8px;
    }
    .trust-tags span{
        font-size: 11px;
        padding: 5px 12px;
    }

    .svg-note, .flex-sign-up, .svg-setting {
        height: 30px;
        padding: 5px;
        font-size: 10px !important;
    }

    .flex-language {
        padding: 0 12px;
        height: 30px;
    }

    .flex-sign-up span {
        font-size: 10px !important;
    }
}

.mobile-search-toggle,
.mobile-header-search{
    display: none;
}

@media screen and (max-width: 767px) {
    .mobile-search-toggle{
        align-items: center;
        background: #131313;
        border-radius: 6px;
        cursor: pointer;
        display: flex !important;
        height: 30px;
        justify-content: center;
        padding: 0;
        width: 34px;
    }
    .mobile-search-toggle[aria-expanded="true"]{
        border-color: #F86A0B;
        box-shadow: 0 0 0 1px #F86A0B inset;
    }
    .mobile-header-search{
        box-sizing: border-box;
        display: block !important;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 10px;
        pointer-events: none;
        transform: translateY(-6px);
        transition: max-height 0.22s ease, opacity 0.18s ease, padding 0.22s ease, transform 0.22s ease;
        width: 100%;
    }
    .mobile-header-search.is-open{
        max-height: 54px;
        opacity: 1;
        padding: 8px 10px 0;
        pointer-events: auto;
        transform: translateY(0);
    }
    .mobile-header-search-inner{
        align-items: center;
        background: #131313;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 6px;
        box-sizing: border-box;
        display: flex;
        gap: 8px;
        height: 38px;
        padding: 0 8px 0 10px;
        width: 100%;
    }
    .mobile-header-search-inner input{
        background: transparent;
        border: 0;
        color: #fff;
        flex: 1 1 auto;
        font-size: 13px;
        height: 100%;
        min-width: 0;
        outline: none;
    }
    .mobile-header-search-inner input::placeholder{
        color: rgba(255, 255, 255, 0.52);
    }
    .mobile-header-search-inner button{
        background: #F86A0B;
        border: 0;
        border-radius: 5px;
        color: #fff;
        cursor: pointer;
        flex: 0 0 auto;
        font-size: 12px;
        font-weight: 700;
        height: 28px;
        padding: 0 12px;
    }
}

@media screen and (min-width: 768px) {
    .trust-metrics{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .trust-features{
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 18px 28px;
    }
    .login-container .onboarding {
        display: flex;
    }
    .flex-sign-up.mobile {
        display: none ;
    }
}

@media screen and (min-width: 1200px) {
    .trust-metrics,
    .trust-features{
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .trust-features{
        padding: 18px 28px;
    }
}

@media screen and (max-width: 767px) {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    #content .container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: clip;
    }

    .hamburger-menu-btn {
        display: none;
    }

    body.has-prediction-sidebar .hamburger-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 10px;
        border: 0;
        background: transparent;
        cursor: pointer;
        box-sizing: border-box;
    }

    .nav-drawer-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.45);
    }

    body.has-prediction-sidebar.sidebar-nav-open .nav-drawer-backdrop {
        display: block;
    }

    body.has-prediction-sidebar.sidebar-nav-open {
        overflow: hidden;
    }

    body.has-prediction-sidebar .box-content .js-prediction-sidebar {
        position: fixed;
        top: var(--prediction-sidebar-top, 0px);
        left: 0;
        z-index: 1001;
        display: flex;
        flex-direction: column;
        gap: 15px;
        width: min(100vw, 300px);
        max-width: 90vw;
        height: calc(100dvh - var(--prediction-sidebar-top, 0px));
        max-height: calc(100dvh - var(--prediction-sidebar-top, 0px));
        padding: 12px 10px 20px;
        box-sizing: border-box;
        margin: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        background: #fff;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    html[data-theme="dark"] body.has-prediction-sidebar .box-content .js-prediction-sidebar {
        background: #131313;
    }

    body.has-prediction-sidebar.sidebar-nav-open .box-content .js-prediction-sidebar {
        transform: translateX(0);
    }

    .login-container {
        height: 100vh;
    }
    body.has-prediction-sidebar .box-content {
        box-sizing: border-box !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
        overflow-x: clip !important;
    }

    body.has-prediction-sidebar .table-right {
        display: none !important;
    }

    /* Prediction show page: full width, let child pred-scroll containers handle their own scroll */
    body.has-prediction-sidebar .table-center {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    .mobile-back-to-top{
        align-items: center;
        background: #F86A0B;
        border: 1px solid rgba(255, 255, 255, 0.84);
        border-radius: 999px;
        bottom: 18px;
        box-shadow: 0 8px 22px rgba(248, 106, 11, 0.34), 0 4px 14px rgba(0, 0, 0, 0.22);
        color: #fff;
        cursor: pointer;
        display: flex;
        height: 42px;
        justify-content: center;
        opacity: 0;
        pointer-events: none;
        position: fixed;
        right: 16px;
        transform: translateY(12px);
        transition: opacity 0.2s ease, transform 0.2s ease, background 0.18s ease, box-shadow 0.18s ease;
        width: 42px;
        z-index: 950;
    }
    .mobile-back-to-top.is-visible{
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
    .mobile-back-to-top:active{
        background: #d95400;
        box-shadow: 0 4px 16px rgba(248, 106, 11, 0.28), 0 3px 10px rgba(0, 0, 0, 0.2);
        transform: translateY(1px);
    }
    .mobile-back-to-top i{
        font-size: 16px;
        line-height: 1;
    }

    .flex-sign-up.pc {
        display: none ;
    }

    /*.flex-sign-up.mobile {*/
    /*    display: none ;*/
    /*}*/
}

@media screen and (width: 768px) {
    .login-container .onboarding {
        order: 0;
    }
    .login-container .login-form {
        order: 1;
    }
    .login-container .login-register {
        order: 1;
    }
    .login-container {
        height: 100vh;
    }
}

@media screen and (max-width: 420px) {
    .login-container .login-form {
        padding: 20px;
    }
    .login-container .login-register {
        padding: 20px;
    }
    .login-container .login-form-group {
        margin-bottom: 16px;
    }
    .login-container {
        margin: 0;
    }
}

@media screen and (max-width: 768px) {
    .box-derby {
        width: 100%;
        margin: 0 4px;
    }
    .box-derby-match {
        padding: 12px;
    }
}
