/* Stable Layout CSS for Flutter Web App in Embedded Environments */

/* Reset and ensure stable base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    height: 100vh;
    background-color: #FFFFFF;
    background-size: 100% 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    -webkit-overflow-scrolling: touch;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent layout shifts and ensure stable rendering */
#flutter_target {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Ensure Flutter app container is stable */
.flutter-container {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Prevent any external interference */
.flutter-app {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Ensure canvas is stable */
canvas {
    display: block;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* Prevent viewport scaling issues */
@media screen and (max-width: 768px) {

    html,
    body {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        position: fixed;
    }
}

/* Prevent landscape orientation issues */
@media screen and (orientation: landscape) {

    html,
    body {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        position: fixed;
    }
}

/* Ensure stable rendering on high DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    html,
    body {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        position: fixed;
    }
}

/* Prevent any external CSS from affecting layout */
.flutter-app * {
    box-sizing: border-box;
}

/* Ensure stable splash screen */
#splash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background-color: #FFFFFF;
}

/* Prevent any external scrollbars */
::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
