@import url("https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;600;700&family=Lilita+One&display=swap");

:root {
    --mw-cream: #f1e7d2;
    --mw-cream-light: #fafafa;
    --mw-field: #eae3cf;
    --mw-brown: #3d1b0f;
    --mw-green: #4b9436;
    --mw-green-dark: #459232;
    --mw-gold: #d5c18e;
    --mw-rule: #d6c7b3;
    --mw-button-brown: #591903;
    --mw-footer-bg: rgba(37, 74, 86, 0.7);
    --mw-footer-color: #F7F3EC;
}

html,
body {
    min-height: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #63aee8 url("../img/bg.webp") center center / cover no-repeat fixed;
    color: var(--mw-brown);
    font-family: "Cabin", Arial, sans-serif;
}

body>.container-fluid,
body>.container-fluid>.row {
    min-height: 100vh;
}

.mahjongwander-page {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.mahjongwander-main {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 0 auto;
    flex-direction: column;
}

.mw-login-page {
    position: relative;
    display: flex;
    min-height: 0;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    overflow-x: hidden;
    padding: clamp(22px, 3.5vh, 35px) 0 0;
}

.mw-auth-shell {
    display: flex;
    width: 100%;
    flex: 1 0 auto;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
}

.mw-logo {
    display: block;
    width: clamp(230px, 18vw, 343px);
    height: auto;
    margin: 0 0 clamp(24px, 4vh, 43px);
}

.mw-auth-card {
    width: min(500px, 100%);
    position: relative;
    background: transparent;
}

.mw-auth-tabs {
    position: relative;
    z-index: 4;
    display: flex;
    height: 46px;
    align-items: flex-start;
    pointer-events: auto;
}

.mw-auth-tab {
    position: relative;
    z-index: 7;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 178px;
    height: 70px;
    border: 0;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, var(--mw-cream-light) 0%, var(--mw-cream) 100%);
    color: var(--mw-green);
    cursor: pointer;
    font-family: "Lilita One", Impact, sans-serif;
    font-size: 20px;
    line-height: 1.95;
    outline-offset: -4px;
    padding: 10px 0 0;
    text-align: center;
    transition: opacity 160ms ease;
}

.mw-auth-tab.is-active {
    background: linear-gradient(180deg, var(--mw-gold) 0%, var(--mw-green-dark) 100%);
    color: var(--mw-footer-color);
}

.mw-card-body {
    position: relative;
    z-index: 6;
    min-height: 680px;
    border-radius: 22px;
    background: linear-gradient(180deg, var(--mw-cream-light) 0%, var(--mw-cream) 100%);
    overflow: hidden;
    pointer-events: none;
}

.mw-card-heading {
    position: relative;
    z-index: 1;
    height: 70px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(180deg, var(--mw-gold) 0%, var(--mw-green-dark) 100%);
    color: var(--mw-footer-color);
    font-family: "Lilita One", Impact, sans-serif;
    font-size: 32px;
    line-height: 70px;
    text-align: center;
    pointer-events: none;
}

.mw-auth-form {
    display: none;
    padding: 31px 53px 28px;
    pointer-events: auto;
}

.mw-auth-form.is-active {
    display: block;
}

.mw-field {
    display: block;
    margin: 0 0 16px;
}

.mw-field span {
    display: block;
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.25;
}

.mw-field input {
    display: block;
    width: 100%;
    height: 50px;
    border: 2px solid rgba(93, 31, 6, 0.14);
    border-radius: 8px;
    background: var(--mw-field);
    color: var(--mw-brown);
    font: 18px/1.25 "Cabin", Arial, sans-serif;
    outline: none;
    padding: 10px 14px;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.mw-field input:focus,
.mw-remember input:focus {
    border-color: rgba(75, 148, 54, 0.8);
    box-shadow: 0 0 0 3px rgba(75, 148, 54, 0.18);
}

.mw-terms {
    width: min(359px, 100%);
    margin: 16px auto 24px;
    font-size: 12px;
    line-height: normal;
    text-align: center;
}

.mw-login-options a,
.mw-auth-footer a {
    color: var(--mw-green);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: opacity 160ms ease;
}

.mw-terms a {
    color: var(--mw-green);
    text-decoration: none;
    transition: opacity 160ms ease;
}

.mw-terms a:hover,
.mw-terms a:focus,
.mw-login-options a:hover,
.mw-login-options a:focus,
.mw-auth-footer a:hover,
.mw-auth-footer a:focus,
.mw-auth-tab:hover,
.mw-auth-tab:focus {
    opacity: 0.78;
}

.mw-login-options a {
    text-decoration: none;
    white-space: nowrap;
}

.mw-play-button {
    display: flex;
    width: 100%;
    height: 80px;
    align-items: center;
    justify-content: center;
    border: 2px solid #9e4607;
    border-radius: 12px;
    background: linear-gradient(0deg, #e97606 2%, #f9ad08 33%, #fee831 59%, #fff393 100%);
    color: var(--mw-button-brown);
    cursor: pointer;
    font-family: "Lilita One", Impact, sans-serif;
    font-size: 40px;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: opacity 160ms ease;
}

.mw-play-button:hover,
.mw-play-button:focus {
    color: var(--mw-button-brown);
    opacity: 0.86;
    text-decoration: none;
}

.mw-play-button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.mw-auth-message {
    min-height: 20px;
    margin: -6px 0 14px;
    color: #9e2f10;
    font-size: 15px;
    line-height: 1.25;
    text-align: center;
}

.mw-auth-message.is-success {
    color: var(--mw-green);
}

.mw-flow-card .mw-card-body {
    min-height: 0;
    pointer-events: auto;
}

.mw-flow-card .mw-auth-form {
    padding-top: 40px;
    padding-bottom: 36px;
}

.mw-flow-card .mw-auth-message {
    min-height: 0;
    margin: 2px 0 18px;
}

.mw-play-button--small-text {
    font-size: 34px;
}

.mw-secondary-link {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 34px auto 0;
    color: var(--mw-green);
    font-size: 18px;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    transition: opacity 160ms ease;
}

.mw-secondary-link:visited,
.mw-secondary-link:hover,
.mw-secondary-link:focus {
    color: var(--mw-green);
    opacity: 0.78;
    text-decoration: none;
}

.mw-social-block {
    margin-top: 26px;
    text-align: center;
}

.mw-social-block p {
    margin: 0 0 14px;
    font-size: 18px;
    line-height: 1.25;
}

.mw-social-rule {
    height: 2px;
    margin: 0 -24px 20px;
    background: var(--mw-rule);
}

.mw-social-actions {
    display: flex;
    justify-content: center;
    gap: 19px;
}

.mw-social-button {
    display: inline-flex;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    padding: 0;
    text-decoration: none;
    transition: opacity 160ms ease;
}

.mw-social-button:hover,
.mw-social-button:focus {
    opacity: 0.82;
    text-decoration: none;
}

.mw-social-button img {
    display: block;
    width: 54px;
    height: 54px;
}

.mw-login-options {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 27px 0 24px;
    gap: 13px;
    font-size: 18px;
    line-height: 1.25;
}

.mw-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    white-space: nowrap;
}

.mw-remember input {
    width: 32px;
    height: 33px;
    flex: 0 0 auto;
    appearance: none;
    border: 2px solid rgba(93, 31, 6, 0.14);
    border-radius: 8px;
    background: var(--mw-field);
    cursor: pointer;
    outline: none;
    position: relative;
}

.mw-remember input:checked::after {
    position: absolute;
    top: 5px;
    left: 8px;
    width: 10px;
    height: 16px;
    border: solid var(--mw-green);
    border-width: 0 3px 3px 0;
    content: "";
    transform: rotate(45deg);
}

.mw-login-separator {
    width: 2px;
    height: 25px;
    flex: 0 0 auto;
    background: var(--mw-rule);
}

.mw-auth-footer {
    display: flex;
    width: 100%;
    min-height: 55px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: var(--mw-footer-bg);
    color: var(--mw-footer-color);
    font-size: 18px;
    line-height: 1.2;
    padding: 12px 32px;
}

.mw-auth-footer p {
    margin: 0;
}

.mw-auth-footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0;
}

.mw-auth-footer a {
    color: var(--mw-footer-color);
    text-decoration: none;
    font-size: 17px;
    font-weight: 400;
}

.mw-auth-footer a+a::before {
    color: var(--mw-footer-color);
    content: "|";
    padding: 0 8px;
}

.mahjongwander-page--gameplay {
    position: relative;
    background: linear-gradient(0deg, #f7f3ec 0%, #f7f3ec 1%, rgba(247, 243, 236, 0) 52%);
    justify-content: center;
    padding: clamp(24px, 4vh, 52px) clamp(16px, 4vw, 64px);
}

.mahjongwander-page--gameplay .mahjongwander-main {
    flex: 0 0 auto;
}

.mahjongwander-page--how-to-use {
    justify-content: flex-start;
    overflow-x: hidden;
    padding-top: 80px;
    padding-bottom: 56px;
}

.mahjongwander-page--how-to-use::before {
    position: fixed;
    z-index: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 56vh;
    background: linear-gradient(0deg, #f7f3ec 0%, rgba(247, 243, 236, 0.92) 24%, rgba(247, 243, 236, 0) 100%);
    content: "";
    pointer-events: none;
}

.mahjongwander-page--how-to-use .mahjongwander-main,
.mahjongwander-page--how-to-use .mw-auth-footer--gameplay {
    position: relative;
    z-index: 1;
}

.mw-game-page {
    display: flex;
    width: 100%;
    min-height: 0;
    align-items: center;
    justify-content: center;
}

.mw-game-shell {
    --mw-game-border: 9px;
    --mw-game-border-size: 18px;
    position: relative;
    display: flex;
    width: min(calc(var(--mw-game-width) + var(--mw-game-border-size)), 100%, calc(140vh + var(--mw-game-border-size)));
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f2e8d5;
    overflow: hidden;
    padding: var(--mw-game-border);
}

.mw-game-shell:fullscreen,
.mw-game-shell.is-fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background: #000;
    padding: 0;
}

.mw-game-frame {
    width: 100%;
    aspect-ratio: var(--mw-game-ratio);
    background: #f7f3ec;
    overflow: hidden;
}

.mw-game-shell:fullscreen .mw-game-frame,
.mw-game-shell.is-fullscreen .mw-game-frame {
    height: 100%;
    aspect-ratio: auto;
}

.mw-game-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.mahjongwander-page--embed.mahjongwander-page--gameplay {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background: #000;
    overflow: hidden;
    padding: 0;
}

.mahjongwander-page--embed.mahjongwander-page--gameplay .mahjongwander-main,
.mahjongwander-page--embed.mahjongwander-page--gameplay .mw-game-page,
.mahjongwander-page--embed.mahjongwander-page--gameplay .mw-game-shell,
.mahjongwander-page--embed.mahjongwander-page--gameplay .mw-game-frame {
    width: 100%;
    height: 100%;
    flex: 1 1 auto;
    min-height: 0;
}

.mahjongwander-page--embed.mahjongwander-page--gameplay .mw-game-shell {
    max-width: none;
    border-radius: 0;
    background: #000;
    padding: 0;
}

.mahjongwander-page--embed.mahjongwander-page--gameplay .mw-game-frame {
    aspect-ratio: auto;
    background: #000;
}

.mw-fullscreen-hint {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 3;
    max-width: calc(100% - 32px);
    border-radius: 999px;
    background: rgba(61, 27, 15, 0.88);
    color: #f7f3ec;
    font: 16px/1.25 "Cabin", Arial, sans-serif;
    opacity: 0;
    padding: 10px 18px;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, -8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.mw-game-shell.is-fullscreen-hint-visible .mw-fullscreen-hint {
    opacity: 1;
    transform: translate(-50%, 0);
}

.mw-game-unavailable {
    margin: 0;
    color: #fff;
    font-size: 18px;
    line-height: 1.3;
    padding: 24px;
    text-align: center;
}

.mw-auth-footer--gameplay {
    width: min(1080px, 100%);
    min-height: 0;
    align-self: center;
    justify-content: center;
    gap: 18px;
    background: transparent;
    color: var(--mw-brown);
    font-size: 16px;
    line-height: 1.2;
    margin-top: 14px;
    padding: 0;
    text-align: center;
    text-shadow: none;
}

.mw-auth-footer--gameplay nav {
    justify-content: center;
}

.mw-auth-footer--gameplay a {
    color: var(--mw-brown);
}

.mw-auth-footer--gameplay a+a::before {
    color: var(--mw-brown);
}

.mw-fullscreen-button {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    transition: opacity 160ms ease;
}

.mw-fullscreen-button:hover,
.mw-fullscreen-button:focus {
    opacity: 0.78;
}

.mw-fullscreen-button img {
    display: block;
    width: 20px;
    height: 20px;
}

.mw-htu-page {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 70px;
}

.mw-htu-card {
    width: min(1233px, 100%);
    border-radius: 20px;
    background: linear-gradient(180deg, #fafafa 0%, #f1e7d2 100%);
    color: var(--mw-brown);
    overflow: hidden;
    padding: 50px clamp(24px, 6vw, 80px) 98px;
    text-align: center;
}

.mw-htu-title {
    margin: 0 0 8px;
    color: var(--mw-brown);
    font-family: "Lilita One", Impact, sans-serif;
    font-size: 48px;
    line-height: 1.15;
}

.mw-htu-intro {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
}

.mw-htu-intro em {
    font-style: italic;
    font-weight: 700;
}

.mw-htu-steps {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 64px;
    margin-top: 34px;
}

.mw-htu-step {
    width: min(650px, 100%);
    border: 2px solid rgba(107, 73, 38, 0.18);
    border-radius: 6px;
    background: rgba(234, 227, 207, 0.62);
    padding: 24px 22px 29px;
}

.mw-htu-step h2 {
    margin: 0 0 22px;
    color: var(--mw-brown);
    font-family: "Lilita One", Impact, sans-serif;
    font-size: 20px;
    line-height: 1.2;
}

.mw-htu-step img {
    display: block;
    height: auto;
    margin: 0 auto;
    max-width: 100%;
}

.mw-htu-step--pin img {
    width: min(478px, 100%);
}

.mw-htu-step--play img {
    width: min(449px, 100%);
}

.mw-htu-step p {
    margin: 24px 0 0;
    color: #000;
    font-size: 14px;
    line-height: 1.3;
}

.mahjongwander-page--how-to-use .mw-auth-footer--gameplay {
    margin-top: 34px;
}

.mw-static-page {
    display: flex;
    width: 100%;
    flex: 1 0 auto;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(28px, 5vw, 64px) 16px;
}

.mw-static-content {
    max-width: 960px;
    border-radius: 8px;
    background: rgba(247, 243, 236, 0.94);
    box-shadow: 0 18px 42px rgba(61, 27, 15, 0.16);
    color: var(--mw-brown);
    font-family: "Cabin", Arial, sans-serif;
}

.mw-static-content h1 {
    margin: 0 0 22px;
    color: var(--mw-brown);
    font-family: "Lilita One", Impact, sans-serif;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.05;
}

.mw-static-content a {
    color: var(--mw-green);
    transition: opacity 160ms ease;
}

.mw-static-content a:hover,
.mw-static-content a:focus {
    opacity: 0.78;
}

.ob-customize-cookie-banner {
    width: 65% !important;
    background-color: #f5f5f5eb !important;
}

.ob-cookie-banner-button-accept-selected {
    background: linear-gradient(0deg, #e97606 2%, #f9ad08 33%, #fee831 59%, #fff393 100%);
}

.ob-cookie-banner-title,
.ob-cookie-banner-category-label,
.ob-cookie-banner-text a {
    color: #459232 !important;
}

.fdbc-img-holder {
    background: var(--mw-brown) !important;
}

@media (max-height: 860px) and (min-width: 768px) {
    .mw-login-page {
        padding-top: 20px;
    }

    .mw-logo {
        width: 255px;
        margin-bottom: 18px;
    }

    .mw-card-body {
        min-height: 0;
    }

    .mw-auth-form {
        padding-bottom: 22px;
    }
}

@media (max-width: 640px) {
    body {
        background-attachment: scroll;
    }

    .mw-login-page {
        justify-content: flex-start;
        padding: 18px 0 0;
    }

    .mw-logo {
        width: min(250px, 74vw);
        margin-bottom: 20px;
    }

    .mw-auth-card {
        border-radius: 18px;
    }

    .mw-auth-tabs {
        height: 44px;
    }

    .mw-auth-tab {
        width: 50%;
        height: 64px;
        border-radius: 18px 18px 0 0;
        font-size: 18px;
        padding-top: 9px;
    }

    .mw-card-body,
    .mw-card-heading {
        border-radius: 18px 18px 0 0;
    }

    .mw-card-body {
        min-height: 0;
    }

    .mw-card-heading {
        height: 62px;
        font-size: 29px;
        line-height: 62px;
    }

    .mw-auth-form {
        padding: 26px clamp(18px, 8vw, 32px) 24px;
    }

    .mw-field span,
    .mw-field input,
    .mw-social-block p,
    .mw-login-options {
        font-size: 16px;
    }

    .mw-play-button {
        height: 68px;
        font-size: 34px;
    }

    .mw-social-rule {
        margin-right: -6px;
        margin-left: -6px;
    }

    .mw-login-options {
        justify-content: center;
        gap: 9px;
        margin-top: 22px;
    }

    .mw-auth-footer {
        align-items: center;
        flex-direction: column;
        gap: 8px;
        font-size: 14px;
        text-align: center;
    }

    .mw-auth-footer nav {
        justify-content: center;
    }

    .mahjongwander-page--gameplay {
        padding: 18px 12px;
    }

    .mahjongwander-page--how-to-use {
        padding-top: 34px;
        padding-bottom: 38px;
    }

    .mahjongwander-page--how-to-use::before {
        height: 48vh;
    }

    .mw-game-shell {
        width: min(100%, calc(130vh + var(--mw-game-border-size)));
    }

    .mw-auth-footer--gameplay {
        margin-top: 10px;
    }

    .mahjongwander-page--how-to-use .mw-auth-footer--gameplay {
        margin-top: 28px;
    }

    .mw-htu-card {
        border-radius: 16px;
        padding: 30px clamp(14px, 5vw, 24px) 42px;
    }

    .mw-htu-title {
        font-size: 28px;
    }

    .mw-htu-intro {
        font-size: 10px;
    }

    .mw-htu-steps {
        gap: 28px;
        margin-top: 24px;
    }

    .mw-htu-step {
        padding: 18px 14px 22px;
    }

    .mw-htu-step h2 {
        margin-bottom: 16px;
        font-size: 12px;
    }

    .mw-htu-step p {
        margin-top: 18px;
        font-size: 9px;
    }
}

@media (max-width: 380px) {
    .mw-auth-form {
        padding-right: 14px;
        padding-left: 14px;
    }

    .mw-auth-footer a {
        display: inline-block;
        margin-bottom: 4px;
    }
}
