.trezor-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

#trezor-canvas-container {
    width: 100%;
    height: calc(100vh - 150px); /* Adjust based on header and padding */
    position: relative;
    background: var(--color-bg-primary);
    touch-action: none; /* Prevent scroll interference on mobile */
}

#trezor-canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Desktop */
@media (min-width: 901px) {
    #trezor-canvas-container {
        height: calc(100vh - 150px);
    }
}

/* Tablet & mobile */
@media (max-width: 900px) {
    #trezor-view {
        padding: 4px;
    }

    .trezor-wrapper {
        border-radius: var(--radius-md);
    }

    #trezor-canvas-container {
        height: calc(100vh - 140px); /* header + bottom nav */
        min-height: 400px;
    }

    /* Trezor bonus shop panel - override the inline 440px width */
    #trezor-bonusshop-panel {
        width: 90% !important;
        max-width: 400px !important;
        max-height: 80vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    #trezor-canvas-container {
        height: calc(100vh - 130px);
        min-height: 350px;
    }

    #trezor-bonusshop-panel {
        width: 95% !important;
        max-width: none !important;
    }

    /* Smaller bonus shop cards on tiny screens */
    #trezor-bonusshop-panel .bait-card {
        flex-direction: column !important;
        text-align: center;
    }

    #trezor-bonusshop-panel .bait-card-img {
        width: 55px !important;
        height: 55px !important;
        margin: 0 auto;
    }

    #trezor-bonusshop-panel .bait-buy-btn {
        width: 100%;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    #trezor-canvas-container {
        height: calc(100vh - 60px);
        min-height: auto;
    }

    #trezor-bonusshop-panel {
        max-height: 90vh;
    }
}
