/* Fortune Tiger embed host — portrait 9:16 game in 16:9 stage (PG-style) */

:root {
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body.ft-embed-host {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #000;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #fff;
    --ft-subbar-h: 52px;
    --ft-page-pad-y: 8px;
    --ft-page-pad-x: 12px;
    --ft-stage-max-w: 1500px;
    --ft-viewport-h: 100vh;
}

@supports (height: 100dvh) {
    body.ft-embed-host {
        --ft-viewport-h: 100dvh;
    }
}

.ft-embed-subbar {
    position: sticky;
    top: 0;
    z-index: 100000;
    height: var(--ft-subbar-h);
    overflow: visible;
    background: #1b1c1d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--ft-page-pad-x);
}

.ft-embed-subbar-inner {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.ft-embed-subbar-left {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 0 1 auto;
}

.ft-embed-subbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin-left: auto;
    min-width: 0;
}

.ft-embed-widget {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    background: #2c2d30;
    border-radius: 16px;
    padding: 2px;
    flex: 0 0 auto;
    min-width: 0;
}

.ft-embed-btn {
    height: 32px;
    border-radius: 18px;
    border: 0;
    background: transparent;
    color: #a3a3a3;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    padding: 0 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
    flex: 0 0 auto;
}

.ft-embed-btn:hover {
    color: #fff;
}

.ft-embed-btn-support {
    color: #6bc988;
}

.ft-embed-btn-support:hover {
    color: #8ed9a5;
}

.ft-embed-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    opacity: 0.95;
    transition: opacity 0.15s ease;
}

.ft-embed-logo:hover {
    opacity: 1;
}

.ft-embed-logo-img {
    display: block;
    height: 52px;
    width: auto;
    max-width: min(300px, 64vw);
    object-fit: contain;
    object-position: left center;
}

.ft-embed-mode-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #d4d7de;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 0 auto;
    cursor: pointer;
    user-select: none;
}

.ft-embed-mode-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ft-embed-mode-slider {
    width: 48px;
    height: 28px;
    background: #2b2e35;
    border-radius: 999px;
    position: relative;
    transition: background-color 0.2s ease;
    cursor: pointer;
    flex: 0 0 auto;
}

.ft-embed-mode-slider::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    left: 4px;
    top: 4px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s ease;
}

.ft-embed-mode-switch input:checked + .ft-embed-mode-slider {
    background: #2f9f39;
}

.ft-embed-mode-switch input:checked + .ft-embed-mode-slider::before {
    transform: translateX(20px);
}

.ft-embed-btn-activate {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    min-width: 132px;
    padding: 0 14px;
    border: 1px solid rgba(96, 165, 250, 0.62);
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 58%, #2563eb 100%);
    color: #fff !important;
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow:
        0 6px 18px rgba(59, 130, 246, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.ft-embed-btn-activate span {
    position: relative;
    z-index: 2;
}

.ft-embed-btn-activate:hover {
    color: #fff !important;
    filter: brightness(1.06);
}

.ft-embed-btn-activate[hidden],
.ft-embed-btn[hidden] {
    display: none !important;
}

.ft-embed-wager-badge {
    height: 32px;
    padding: 0 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: #121212;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    flex: 0 0 auto;
    user-select: none;
    pointer-events: none;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}

.ft-embed-wager-badge.is-visible {
    display: inline-flex;
    pointer-events: auto;
    cursor: pointer;
}

.ft-embed-wager-badge[hidden] {
    display: none !important;
}

.ft-embed-page {
    position: relative;
    min-height: calc(var(--ft-viewport-h) - var(--ft-subbar-h));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ft-page-pad-y) var(--ft-page-pad-x);
    background: #000;
}

.ft-embed-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    flex: 0 1 auto;
}

.ft-embed-stage-bg {
    display: none;
}

.ft-embed-shell {
    position: relative;
    z-index: 1;
    width: min(100%, calc((var(--ft-viewport-h) - var(--ft-subbar-h) - 2 * var(--ft-page-pad-y)) * 9 / 16));
    aspect-ratio: 9 / 16;
    max-height: calc(var(--ft-viewport-h) - var(--ft-subbar-h) - 2 * var(--ft-page-pad-y));
    border-radius: 16px;
    overflow: hidden;
    background: #0a0605;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

.ft-embed-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.ft-embed-error {
    position: absolute;
    inset: 0;
    z-index: 6;
    margin: 0;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.75);
    background: #000;
}

.ft-embed-error[hidden] {
    display: none !important;
}

/* Desktop / tablet landscape: 16:9 stage with bg wings */
@media (min-width: 521px) {
    body.ft-embed-host {
        --ft-stage-w: min(
            100%,
            calc((var(--ft-viewport-h) - var(--ft-subbar-h) - 2 * var(--ft-page-pad-y)) * 16 / 9),
            var(--ft-stage-max-w)
        );
    }

    .ft-embed-subbar-inner,
    .ft-embed-stage {
        width: var(--ft-stage-w);
    }

    .ft-embed-stage {
        aspect-ratio: 16 / 9;
        max-height: calc(var(--ft-viewport-h) - var(--ft-subbar-h) - 2 * var(--ft-page-pad-y));
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    }

    .ft-embed-stage-bg {
        display: block;
        position: absolute;
        inset: 0;
        z-index: 0;
        background-color: #1a0806;
        background-image: var(--ft-stage-bg-image, none);
        background-position: center;
        background-size: cover;
        background-repeat: no-repeat;
        pointer-events: none;
    }

    .ft-embed-shell {
        width: auto;
        height: 100%;
        max-height: none;
        max-width: none;
        aspect-ratio: 9 / 16;
        border-radius: 0;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.16);
        transition: width 0.4s ease, height 0.4s ease, max-width 0.4s ease, border-radius 0.4s ease;
    }

    /* Boot / PG splash: iframe fills entire stage, decorative bg hidden */
    .ft-embed-stage.is-loading .ft-embed-stage-bg {
        opacity: 0;
        visibility: hidden;
    }

    .ft-embed-stage.is-loading .ft-embed-shell {
        width: 100%;
        height: 100%;
        max-height: none;
        max-width: none;
        aspect-ratio: unset;
        background: #000;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.16);
    }

    .ft-embed-stage-bg {
        transition: opacity 0.45s ease, visibility 0.45s ease;
    }
}

/* Standard laptops / desktops */
@media (min-width: 1025px) {
    body.ft-embed-host {
        --ft-page-pad-y: 6px;
        --ft-page-pad-x: 10px;
        --ft-stage-max-w: 1400px;
    }
}

/* Large screens */
@media (min-width: 1440px) {
    body.ft-embed-host {
        --ft-page-pad-y: 4px;
        --ft-page-pad-x: 8px;
        --ft-stage-max-w: 1500px;
    }
}

/* Narrow tablets / small laptops */
@media (max-width: 1024px) and (min-width: 521px) {
    body.ft-embed-host {
        --ft-subbar-h: 44px;
        --ft-page-pad-y: 4px;
        --ft-page-pad-x: 6px;
        --ft-stage-max-w: 100%;
    }

    .ft-embed-subbar {
        padding: 0 var(--ft-page-pad-x);
    }

    .ft-embed-wager-badge {
        height: 28px;
        font-size: 12px;
        padding: 0 10px;
    }

    .ft-embed-btn {
        height: 28px;
        font-size: 12px;
        padding: 0 9px;
    }

    .ft-embed-logo-img {
        height: 44px;
        max-width: min(260px, 58vw);
    }

    body.is-guest .ft-embed-logo-img {
        height: 36px;
        max-width: min(150px, 34vw);
    }

    .ft-embed-mode-switch {
        gap: 8px;
        font-size: 13px;
    }

    .ft-embed-mode-slider {
        width: 42px;
        height: 24px;
    }

    .ft-embed-mode-slider::before {
        width: 16px;
        height: 16px;
    }

    .ft-embed-mode-switch input:checked + .ft-embed-mode-slider::before {
        transform: translateX(18px);
    }

    .ft-embed-btn-activate {
        min-width: 0;
        max-width: 112px;
        padding: 0 10px;
        font-size: 11px;
    }

    .ft-embed-btn-activate span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Mobile portrait */
@media (max-width: 520px) {
    body.ft-embed-host {
        --ft-subbar-h: 44px;
        --ft-page-pad-y: 0px;
        --ft-page-pad-x: 0px;
    }

    .ft-embed-page {
        align-items: stretch;
        padding: 0;
    }

    .ft-embed-subbar {
        padding: 0 8px;
    }

    .ft-embed-wager-badge {
        height: 28px;
        font-size: 12px;
        padding: 0 10px;
    }

    .ft-embed-btn {
        height: 28px;
        font-size: 12px;
        padding: 0 9px;
    }

    .ft-embed-logo-img {
        height: 40px;
        max-width: min(240px, 62vw);
    }

    body.is-guest .ft-embed-logo-img {
        height: 32px;
        max-width: min(108px, 26vw);
    }

    .ft-embed-mode-switch {
        gap: 6px;
        font-size: 12px;
    }

    .ft-embed-mode-slider {
        width: 40px;
        height: 22px;
    }

    .ft-embed-mode-slider::before {
        width: 14px;
        height: 14px;
        top: 4px;
        left: 4px;
    }

    .ft-embed-mode-switch input:checked + .ft-embed-mode-slider::before {
        transform: translateX(18px);
    }

    .ft-embed-btn-activate {
        min-width: 0;
        max-width: 112px;
        padding: 0 8px;
        font-size: 10px;
    }

    .ft-embed-btn-activate span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ft-embed-stage {
        width: 100%;
        flex: 1 1 auto;
        min-height: calc(var(--ft-viewport-h) - var(--ft-subbar-h));
        aspect-ratio: unset;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .ft-embed-shell {
        width: 100%;
        max-width: 100%;
        height: calc(var(--ft-viewport-h) - var(--ft-subbar-h));
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }
}

body.is-partner-embed {
    --ft-subbar-h: 0px;
}

.ft-embed-shell > .partner-embed-splash {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: linear-gradient(
        180deg,
        rgba(5, 7, 12, 0.12) 0%,
        rgba(5, 7, 12, 0.28) 48%,
        rgba(5, 7, 12, 0.82) 100%
    );
}

.partner-embed-splash[hidden] {
    display: none !important;
}

.partner-embed-splash-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(100% - 32px, 360px);
    margin: 0 auto;
    padding: 0 0 max(28px, env(safe-area-inset-bottom));
}

.partner-embed-btn {
    min-height: 52px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.partner-embed-btn-money {
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 58%, #2563eb 100%);
    box-shadow: 0 10px 28px rgba(37, 99, 235, 0.38);
}

.partner-embed-btn-demo {
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: rgba(12, 16, 24, 0.55);
}

.partner-embed-btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}
