/* WigglyPaint MargoStory chrome — does not restyle the Decker game */

.wiggly-body {
    overflow-x: hidden;
    min-height: 100dvh;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.wiggly-page {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1900px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 24px 28px;
    min-height: 0;
    box-sizing: border-box;
}

.back-home {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 16px;
    padding: 12px 24px;
    background: #FFF8F1;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    color: #7A644E;
    font-weight: 600;
    transition: 0.35s;
}

.back-home:hover {
    transform: translateY(-3px);
    color: #B48B43;
}

.wiggly-studio {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 512 / 342;
    height: auto;
    margin: 0 auto;
    background: #F7F2EA;
    border-radius: 28px;
    overflow: hidden;
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.10),
        0 5px 15px rgba(0, 0, 0, 0.05);
}

.wiggly-studio iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #F7F2EA;
    max-width: 100%;
}

.language a.active {
    color: #B48B43;
    font-weight: 600;
}

html[dir="rtl"] .wiggly-page {
    text-align: right;
}

html[dir="rtl"] .back-home {
    align-self: flex-end;
}

/* tablet */
@media (max-width: 1023px) {
    .wiggly-page {
        padding: 6px 16px 16px;
    }
}

/* iPhone / small phones — compact chrome so the 512:342 stage can fill the width */
@media (max-width: 700px) {
    .wiggly-body {
        overflow-y: hidden;
        height: 100dvh;
        max-height: 100dvh;
    }

    .wiggly-body .header {
        padding: 8px 12px;
        gap: 6px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .wiggly-body .logo img {
        width: 44px;
        height: 44px;
        border-width: 3px;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    }

    .wiggly-body .title {
        flex: 1 1 140px;
        min-width: 0;
    }

    .wiggly-body .title h1 {
        font-size: 20px;
        letter-spacing: 0.5px;
    }

    .wiggly-body .gold-line {
        width: 72px;
        height: 2px;
        margin: 4px auto;
    }

    .wiggly-body .title p {
        font-size: 12px;
        line-height: 1.3;
        margin: 0;
    }

    .wiggly-body .language {
        font-size: 13px;
        flex: 0 0 auto;
    }

    .wiggly-page {
        padding: 4px 10px 8px;
        overflow: hidden;
    }

    .wiggly-studio {
        width: 100%;
        border-radius: 16px;
        max-height: calc(100dvh - 140px);
    }

    .back-home {
        margin-bottom: 8px;
        padding: 8px 14px;
        font-size: 13px;
    }
}

@media (max-width: 700px) and (orientation: landscape) {
    .wiggly-body .header {
        padding: 4px 10px;
    }

    .wiggly-body .logo img {
        width: 32px;
        height: 32px;
    }

    .wiggly-body .title h1 {
        font-size: 16px;
    }

    .wiggly-body .title p,
    .wiggly-body .gold-line {
        display: none;
    }
}
