/* Responsive layout for the public homepage. Keep legacy desktop artwork intact. */
.playnow-button h2.play {
    height: 38px;
    margin: 7px 0 0 40px;
    font-size: 24px;
    line-height: 30px;
}

@media (max-width: 1000px) {
    #content-container,
    #navigation-container,
    #footer-container {
        box-sizing: border-box;
        width: 100%;
        padding-right: 16px;
        padding-left: 16px;
    }

    #content-main {
        box-sizing: border-box;
        max-width: 100%;
    }
}

@media (max-width: 980px) {
    html,
    body {
        min-width: 0;
        width: 100%;
        overflow-x: hidden;
    }

    #background,
    #backgroundLeft,
    #backgroundRight {
        min-height: 100vh;
        background-position: center top;
    }

    #navigation-wrapper {
        height: auto;
        min-height: 72px;
        background-size: auto 72px;
    }

    #navigation-container,
    #top-nav,
    #top-nav-menu {
        float: none;
        height: auto;
        width: 100%;
    }

    #top-nav {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 8px 0;
        box-sizing: border-box;
    }

    #top-nav-menu {
        text-align: left;
    }

    #logo {
        position: static;
        display: block;
        margin: 0 auto 6px;
        width: 160px;
        height: 70px;
    }

    #logo img.logo {
        width: 160px;
        height: 70px;
        background-size: contain;
    }

    ul#top-navigation {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        float: none;
        width: 100%;
        margin: 0;
        font-size: 13px;
    }

    ul#top-navigation li {
        float: none;
        height: auto;
    }

    ul#top-navigation li a {
        height: auto;
        min-height: 36px;
        padding: 10px 8px;
        box-sizing: border-box;
        color: #fff;
        text-shadow: 0 1px 2px #26321a;
        background-color: rgba(35, 53, 18, 0.88);
        background-image: none;
        border: 1px solid rgba(255, 255, 255, 0.45);
        border-radius: 4px;
    }

    ul#top-navigation li a:hover,
    ul#top-navigation li a:focus {
        color: #fff;
        background-color: #395d22;
    }

    #top-nav-login {
        float: none;
        width: 100%;
        height: auto;
    }

    #login {
        top: auto;
        left: auto;
        margin: 0 auto;
        width: 150px;
    }

    #content-container {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 22px;
    }

    #content-main,
    #content-menu {
        float: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    #content-main {
        order: 1;
    }

    #content-menu {
        order: 2;
    }

    #wit,
    #wit-top,
    #wit-bottom,
    #wit-content,
    #wit-content.with-button,
    #wit-content .wit-info {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }

    #wit-content,
    #wit-content.with-button {
        height: auto;
        min-height: 0;
        padding: 18px 18px 22px;
        overflow: visible;
        background-size: 100% 100%;
    }

    #wit-content .wit-info,
    #wit-content.with-button .wit-info {
        height: auto;
        overflow: visible;
        margin-top: 12px;
        text-align: left;
        line-height: 1.55;
    }

    #wit h1 {
        font-size: clamp(24px, 7vw, 34px);
        line-height: 1.15;
    }

    .playnow-button {
        width: min(100%, 400px);
        max-width: 100%;
        margin: 16px auto 0;
        box-sizing: border-box;
    }

    .playnow-button .playnow-start {
        box-sizing: border-box;
        max-width: calc(100% - 10px);
    }

    .playnow-button h2.play {
        margin: 7px 12px 0;
        font-size: 20px;
        line-height: 30px;
        height: auto;
        text-align: center;
    }

    #stage,
    #stage_space {
        display: none;
    }

    #moreabttravian,
    #find-out-more {
        box-sizing: border-box;
        width: 100%;
        height: auto;
        min-height: 100px;
    }

    #moreabttravian {
        position: relative;
        bottom: auto;
        margin: 12px 0 0;
        clear: both;
    }

    #find-out-more {
        padding: 10px;
        border-radius: 6px;
        background: rgba(46, 35, 24, 0.85);
    }

    #strip-head {
        position: static;
        width: auto;
        height: auto;
        color: #fff;
        font-weight: bold;
        text-align: left;
        line-height: 1.45;
    }

    #strip-head div {
        display: block;
        height: auto;
    }

    #strip-head br {
        display: none;
    }

    #strip {
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
    }

    ul#strips {
        position: static;
        display: flex;
        width: max-content;
        height: 58px;
        margin: 8px 0 0;
        padding: 0;
    }

    ul#strips li {
        flex: 0 0 59px;
        width: 59px;
        height: 58px;
        background-image: url("../gpack/main_default/img/strip/find_out_more_sprite-ltr.png");
    }

    ul#strips li.stip0 { background-position: 0 0; }
    ul#strips li.stip1 { background-position: 0 -100px; }
    ul#strips li.stip2 { background-position: 0 -200px; }
    ul#strips li.stip3 { background-position: 0 -300px; }
    ul#strips li.stip4 { background-position: 0 -400px; }
    ul#strips li.stip5 { background-position: 0 -500px; }

    #strip-details .details {
        box-sizing: border-box;
        width: min(410px, 100%);
        max-width: 100%;
        border-radius: 6px;
    }

    .details-top,
    .details-bottom,
    .details-l-top,
    .details-r-top,
    .details-l-bottom,
    .details-r-bottom {
        display: none;
    }

    .details-body {
        box-sizing: border-box;
        width: 100%;
        padding: 12px;
    }

    .details-body-l {
        max-width: 40%;
        background-size: contain;
    }

    .details-body-r {
        width: 55%;
        font-size: 13px;
    }

    #news,
    #fb-widget,
    #shop,
    #gameRating,
    #news-content,
    #fb-widget-content,
    #gameRatingContent,
    #news-bottom,
    #fb-widget-bottom,
    #gameRatingBottom {
        box-sizing: border-box;
        max-width: 100%;
    }

    #news,
    #fb-widget,
    #shop,
    #gameRating {
        width: 100%;
    }

    #news-content,
    #fb-widget-content,
    #gameRatingContent {
        width: 100%;
        background-size: 100% 100%;
    }

    #news-head,
    #fb-widget-head,
    #gameRatingHead,
    #news-bottom,
    #fb-widget-bottom,
    #gameRatingBottom {
        width: 100%;
    }

    #ssc-bg,
    #ss-container,
    #g-widget {
        box-sizing: border-box;
        max-width: 100%;
    }

    #ssc-bg {
        width: 100%;
        height: auto;
        min-height: 0;
        margin-top: 12px;
        padding: 12px 0;
        border-radius: 6px;
        background: rgba(46, 35, 24, 0.85);
    }

    #ss-head {
        position: static;
        left: auto;
        top: auto;
        width: 100%;
        min-width: 0;
        height: auto;
        padding: 0 14px 10px;
        box-sizing: border-box;
    }

    #ss-head-left,
    #ss-head-right {
        display: none;
    }

    #ss-head h3 {
        text-align: left;
    }

    #ss-container {
        position: relative;
        left: auto;
        width: 100%;
        height: auto;
        margin: 0;
    }

    #g-widget {
        position: relative;
        float: none;
        display: flex;
        align-items: center;
        width: 100%;
        max-width: 700px;
        margin: 0 auto;
        padding: 0 8px;
    }

    #gallery {
        position: relative;
        float: none;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: auto;
        aspect-ratio: 4.2 / 1;
        margin: 0;
        overflow: hidden;
        box-sizing: border-box;
    }

    #g-items {
        position: absolute;
        top: 50%;
        left: 0;
        display: block;
        white-space: nowrap;
        transform: translate(33px, -50%);
    }

    #g-items img {
        float: left;
        display: block;
        width: calc((100vw - 160px) / 3);
        max-width: 183px;
        height: auto;
        aspect-ratio: 183 / 136;
        margin: 0 8px 0 0 !important;
        background-size: 100% 100%;
    }

    #g-widget a.browse {
        position: static;
        display: block;
        flex: 0 0 33px;
        float: none;
        margin: 0 4px !important;
    }

    #footer-container,
    #footer {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
    }

    #footer {
        margin-top: 24px;
    }

    .footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 18px;
        padding: 12px 0;
    }

    .footer-links a {
        color: #fff;
        text-decoration: underline;
    }

    #popup {
        position: fixed !important;
        z-index: 1000;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        width: calc(100vw - 24px) !important;
        max-width: 516px;
        max-height: calc(100vh - 24px);
        overflow: auto;
        box-sizing: border-box;
    }

    #popup.serverLogin,
    #popup.serverRegister {
        width: calc(100vw - 24px) !important;
        max-width: 516px;
    }

    #popup #popup-top,
    #popup #popup-bottom,
    #popup #popup-content,
    #popup.serverLogin #popup-top,
    #popup.serverRegister #popup-top,
    #popup.serverLogin #popup-bottom,
    #popup.serverRegister #popup-bottom,
    #popup.serverLogin #popup-content,
    #popup.serverRegister #popup-content {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        background-size: 100% 100%;
    }

    #popup #t3AreaTop,
    #popup #t3AreaTop .link {
        box-sizing: border-box;
        width: 466px !important;
        max-width: none;
    }

    #popup #t3AreaTop {
        position: relative;
        left: 5px;
        transform: scale(.90);
        transform-origin: left top;
        margin-bottom: -6px;
    }

    #popup #t3AreaTop .link {
        height: 41px;
    }

    #popup div.serverbig,
    #popup div.serverbig .link,
    #popup div.serverbig .link .hover {
        box-sizing: border-box;
        width: 475px !important;
        max-width: none;
    }

    #popup div.serverbig {
        position: relative;
        left: 0;
        float: none;
        height: 89px;
        transform: scale(.90);
        transform-origin: left top;
        margin-bottom: -9px;
    }

    #popup div.serverbig .link,
    #popup div.serverbig .link .hover {
        height: 89px;
    }

    #popup #t3AreaContent {
        box-sizing: border-box;
        width: 466px;
        max-width: none;
        overflow: visible;
    }

    #overlaybg {
        position: fixed;
        inset: 0;
        z-index: 999;
    }

    img {
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.84);
    }

    #popup #t3AreaTop { margin-bottom: -10px; }
    #popup div.serverbig { margin-bottom: -14px; }
}

@media (min-width: 521px) and (max-width: 980px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(1);
    }

    #popup #t3AreaTop,
    #popup div.serverbig {
        margin-bottom: 0;
    }
}

@media (max-width: 460px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.77);
    }

    #popup #t3AreaTop { margin-bottom: -14px; }
    #popup div.serverbig { margin-bottom: -20px; }
}

@media (max-width: 420px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.70);
    }

    #popup #t3AreaTop { margin-bottom: -18px; }
    #popup div.serverbig { margin-bottom: -27px; }
}

@media (max-width: 380px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.66);
    }

    #popup #t3AreaTop { margin-bottom: -20px; }
    #popup div.serverbig { margin-bottom: -30px; }
}

@media (max-width: 360px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.60);
    }

    #popup #t3AreaTop { margin-bottom: -24px; }
    #popup div.serverbig { margin-bottom: -36px; }
}

@media (max-width: 340px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.55);
    }

    #popup #t3AreaTop { margin-bottom: -27px; }
    #popup div.serverbig { margin-bottom: -40px; }
}

@media (max-width: 320px) {
    #popup #t3AreaTop,
    #popup div.serverbig {
        transform: scale(.50);
    }

    #popup #t3AreaTop { margin-bottom: -30px; }
    #popup div.serverbig { margin-bottom: -45px; }
}

#footer .footer-links a,
#footer .footer-links a:visited,
#footer .footer-links a:hover,
#footer .footer-links a:focus {
    color: #fff !important;
}

#footer .language-switcher {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
    margin: 8px auto;
    padding: 8px 12px;
}

#footer .language-switcher a,
#footer .language-switcher a:visited,
#footer .language-switcher a:hover,
#footer .language-switcher a:focus {
    color: #fff !important;
    text-decoration: underline;
}

#footer .language-switcher a[aria-current="page"] {
    font-weight: bold;
    text-decoration: none;
}
