.home-scratch-panel {
    position: relative;
    min-width: 0;
    padding: 14px 12px 18px 15px;
    overflow: visible;
    box-sizing: border-box;
}

.home-scratch-panel,
.home-scratch-panel * {
    -webkit-user-select: none;
    user-select: none;
}

.home-scratch-panel img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

.home-scratch-frame {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    isolation: isolate;
}

.home-scratch-decorations {
    position: absolute;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
}

.home-scratch-decoration-chromatic,
.home-scratch-decoration-cyan {
    vector-effect: non-scaling-stroke;
    stroke-linejoin: miter;
}

.home-scratch-decoration-chromatic {
    fill: #ef32dd;
    stroke: #26153e;
    stroke-width: 3;
}

.home-scratch-decoration-cyan {
    fill: #1be0d6;
    stroke: #132a4b;
    stroke-width: 3;
    filter: drop-shadow(1px 2px 0 rgba(255, 211, 251, 0.45));
}

.home-scratch-window {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 5px;
    box-sizing: border-box;
    overflow: hidden;
    border: 3px solid #15102f;
    background: #b648bd;
    box-shadow:
        inset 0 0 0 2px #fa73e7,
        inset 0 0 0 5px #24ddd4,
        4px 5px 0 #17112f;
}

.home-scratch-titlebar {
    position: relative;
    z-index: 3;
    min-height: 28px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 2px 3px 2px 5px;
    box-sizing: border-box;
    border: 2px solid #14102e;
    background: linear-gradient(90deg, #9b28b8 0%, #7040bd 38%, #10b6cb 74%, #1edbd0 100%);
    box-shadow: inset 1px 1px 0 rgba(255, 158, 242, 0.75), inset -1px -1px 0 #087a9c;
    color: #fff;
    text-shadow: 1px 1px 0 #42175f;
}

.home-scratch-app-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    box-sizing: border-box;
    border: 2px solid #22417c;
    background:
        linear-gradient(90deg, transparent 42%, rgba(19, 51, 98, 0.85) 42% 58%, transparent 58%),
        linear-gradient(transparent 42%, rgba(19, 51, 98, 0.85) 42% 58%, transparent 58%),
        #27d0bb;
    box-shadow: inset 1px 1px 0 #76ffe7, inset -1px -1px 0 #0b7585;
}

.home-scratch-title {
    min-width: 0;
    flex: 1;
    margin: 0;
    overflow: hidden;
    color: inherit;
    font-family: 'PixelOperatorMono', 'PixeloidSans', monospace;
    font-size: 15px;
    line-height: 1;
    font-weight: normal;
    letter-spacing: 0.2px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.home-scratch-window-buttons {
    display: flex;
    gap: 2px;
    flex: 0 0 auto;
}

.home-scratch-window-buttons span {
    width: 22px;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 2px solid;
    border-color: #9ffff1 #10385d #10385d #9ffff1;
    background: #1bc7c6;
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.45);
}

.home-scratch-window-buttons img {
    width: 14px;
    height: 12px;
    object-fit: contain;
    flex: 0 0 auto;
    image-rendering: pixelated;
}

.home-scratch-background {
    position: relative;
    container-type: inline-size;
    flex: 1;
    min-height: 0;
    margin: 5px 4px 4px;
    overflow: hidden;
    border: 3px solid #161131;
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 94, 230, 0.28), transparent 31%),
        radial-gradient(circle at 84% 76%, rgba(42, 221, 224, 0.3), transparent 34%),
        linear-gradient(125deg, #9d39ab 0%, #7938aa 27%, #6754b9 51%, #3f8bc8 76%, #72aee2 100%);
    background-size: 160% 160%, 170% 170%, 260% 260%;
    box-shadow:
        0 0 0 3px #20d9d0,
        0 0 0 6px #66216f,
        inset 0 0 48px rgba(55, 18, 88, 0.38);
    animation: homeScratchGradient 12s ease-in-out infinite alternate;
}

.home-scratch-background::before,
.home-scratch-background::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.home-scratch-background::before {
    z-index: 1;
    opacity: 0.22;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(31, 18, 83, 0.35) 3px 4px);
    mix-blend-mode: soft-light;
}

.home-scratch-background::after {
    z-index: 2;
    box-shadow: inset 0 0 0 2px rgba(255, 159, 237, 0.42), inset 0 0 70px rgba(22, 24, 89, 0.2);
}

.home-scratch-particles {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.home-scratch-particle {
    position: absolute;
    left: var(--particle-x, 50%);
    top: var(--particle-y, 50%);
    width: var(--particle-size, 36px);
    height: auto;
    object-fit: contain;
    opacity: var(--particle-opacity, 0.65);
    filter: saturate(1.08) drop-shadow(0 0 4px rgba(255, 245, 190, 0.34));
    transform: translate(-50%, -50%);
}

.home-scratch-particle.is-fire {
    mix-blend-mode: screen;
}
