* { margin: 0; padding: 0; box-sizing: border-box; }

html,
body {
    background: #000;
    color: #ff69b4;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

body {
    position: fixed;
    inset: 0;
    touch-action: none;
    overscroll-behavior: none;
}

#canvas-wrapper {
    position: fixed;
    inset: 0;
    overflow: hidden;
}

#frame-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    box-sizing: border-box;
    border: 4px solid #c0c0c0;
    border-top-color: #f0f0f0;
    border-left-color: #f0f0f0;
    border-right-color: #404040;
    border-bottom-color: #404040;
    box-shadow:
        inset 4px 4px 0 #000000,
        inset -4px -4px 0 #c0c0c0,
        12px 12px 28px rgba(0, 0, 0, 0.45);
}

#stage {
    position: absolute;
    inset: 0;
    z-index: 2;
}

#stage canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    cursor: grab;
}

#stage canvas:active { cursor: grabbing; }

/* Night falls off at the edges */
#vignette {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%);
}

/* Retro Buttons */
.retro-btn {
    position: fixed;
    z-index: 1000;
    padding: 6px 10px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 14px;
    color: lightgrey;
    background-color: #000000;
    border-top: 3px solid #ff69b4;
    border-left: 3px solid #ff69b4;
    border-right: 3px solid #8b3a62;
    border-bottom: 3px solid #8b3a62;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    text-transform: uppercase;
    outline: none;
    user-select: none;
    overflow: hidden;
    isolation: isolate;
    contain: paint;
}

.retro-btn span {
    position: relative;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg,
            #f5e6a3 0%,
            #d4af37 25%,
            #b8860b 50%,
            #d4af37 75%,
            #f5e6a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
    font-weight: bold;
}

.retro-btn .btn-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.9;
    mix-blend-mode: screen;
    filter: brightness(1.2);
    pointer-events: none;
}

.retro-btn:active,
.retro-btn.active {
    border-top: 3px solid #000000;
    border-left: 3px solid #000000;
    border-right: 3px solid #ff69b4;
    border-bottom: 3px solid #ff69b4;
    box-shadow: inset 2px 2px 0px #000000;
}

.retro-btn.active .btn-canvas {
    filter: hue-rotate(-120deg) saturate(2) brightness(0.8) contrast(1.3);
}

#retroAutoplayBtn { bottom: 20px; left: 20px; }

#fullscreenBtn { top: 20px; right: 20px; }
#sensorBtn { bottom: 20px; right: 20px; }
#instaBtn { top: 20px; left: 20px; }     /* (Instagram 4:5, main.js setInsta) */
#autoRecBtn { top: 64px; left: 20px; }     /* (edit.js) */
#previewBtn { top: 108px; left: 20px; }

/* the stage: a dark theatre round the cat */
#stage { background: #0b0909; }
/* (no dark gradient over the ordinary view, the user 2026-10-25: only Instagram 4:5 needs one - body.insta #vignette) */
#vignette {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: none;
}
#c.hovering { cursor: pointer; }
#tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; font: 11px/1 'Courier New', monospace; color: #eee; background: #000; border-left: 2px solid var(--tc, #fff); padding: 3px 5px; }
#chip { position: absolute; left: 20px; bottom: 70px; z-index: 5; max-width: min(360px, 90%); background: rgba(0,0,0,.92); border: 2px solid #ff69b4; padding: 8px 30px 8px 10px; color: #ccc; font-size: 11px; }
#chip b { display: block; font-weight: 400; color: #f5e6a3; }
#chip span { display: block; color: #999; margin-top: 2px; }
#chip .meta { color: #777; margin: 0 0 2px; }
#chip #chipHide { position: static; display: inline-block; margin-top: 6px; color: #ccc; font-size: 11px; padding: 2px 8px; border: 1px solid #ff69b4; }
#chip button { position: absolute; right: 4px; top: 4px; background: none; border: 0; color: #999; cursor: pointer; font-size: 14px; line-height: 1; padding: 4px; }
#toast { position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%); z-index: 3000; background: #000; border: 2px solid #ff69b4; color: #f5e6a3; padding: 6px 12px; font-size: 12px; }

/* G panel insides (the build simulator's controls, restyled) */
#controls-panel { width: 380px; max-height: calc(100% - 40px); }
#controls-panel .tabs { display: flex; gap: 0; margin-bottom: 12px; border: 1px solid #444; }
#controls-panel .tabs button { flex: 1; background: #111; border: 0; border-right: 1px solid #444; color: #888; font: 11px 'Courier New', monospace; text-transform: uppercase; padding: 6px 4px; cursor: pointer; }
#controls-panel .tabs button:last-child { border-right: 0; }
#controls-panel .tabs button[aria-selected="true"] { background: #ff69b4; color: #000; }
#controls-panel h2 { margin: 12px 0 6px; font: 11px 'Courier New', monospace; color: #888; text-transform: uppercase; }
.row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.btn { background: #1a1a1a; border: 1px solid #555; color: #d4af37; font: 10px 'Courier New', monospace; text-transform: uppercase; padding: 5px 8px; cursor: pointer; }
.btn:hover { background: #2a2a2a; }
.btn[aria-pressed="true"] { border-color: #ff69b4; color: #000; background: #ff69b4; }
.btn[hidden] { display: none; }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.preset { text-align: left; background: #1a1a1a; border: 1px solid #555; color: #ccc; font: 11px 'Courier New', monospace; padding: 6px 8px; cursor: pointer; }
.preset:hover { background: #2a2a2a; }
.preset[aria-pressed="true"] { background: #ff69b4; border-color: #ff69b4; color: #000; }
.preset b { font-weight: 400; }
.pose { display: flex; align-items: stretch; margin-bottom: 6px; }
.pose code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 10px/1 'Courier New', monospace; border: 1px solid #444; padding: 7px 6px; color: #f5e6a3; user-select: all; scrollbar-width: none; }
.note { color: #888; margin: 4px 0 8px; font-size: 10px; }
#songNow { color: #f5e6a3; min-height: 1.2em; }
.ch { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid #2a2a2a; }
.ch label { display: flex; align-items: center; gap: 7px; grid-column: 1/3; color: #ccc; }
.ch .dot { width: 7px; height: 7px; background: var(--dc); flex: none; }
.ch .num { font: 10px/1 'Courier New', monospace; color: #777; width: 28px; }
.ch output { font: 10px/1 'Courier New', monospace; text-align: right; color: #f5e6a3; }
.ch .srv { grid-column: 1/4; display: flex; align-items: center; gap: 10px; }
.ch .srv input { flex: 1; min-width: 0; }
.ch .srv small { font: 10px/1 'Courier New', monospace; color: #777; width: 70px; text-align: right; }
input[type=range] { accent-color: #ff69b4; }
.lk { display: grid; grid-template-columns: 112px minmax(0,1fr) 44px; column-gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid #2a2a2a; }
.lk label { color: #aaa; }
.lk input { width: 100%; min-width: 0; margin: 0; }
.lk input[type=color] { height: 20px; background: none; border: 1px solid #555; padding: 0; cursor: pointer; }
.lk output { font: 10px/1 'Courier New', monospace; text-align: right; color: #f5e6a3; }
#lkMat { display: block; width: 100%; font: 11px 'Courier New', monospace; color: #f5e6a3; background: #000; border: 1px solid #555; padding: 5px; margin-bottom: 4px; }

/* Loading Screen */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out;
    /* (solid: the piece draws its first frames before the saved parts are on - the old eyes and lids showed round the
       loading window for a moment; the user, 2026-10-25) */
    background: #0b0909;
}

.loader-marble {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.9;
    mix-blend-mode: screen;
    pointer-events: none;
}

.retro-window {
    background-color: #000000;
    border-top: 3px solid #ff69b4;
    border-left: 3px solid #ff69b4;
    border-right: 3px solid #8b3a62;
    border-bottom: 3px solid #8b3a62;
    padding: 8px;
    width: 600px;
    box-sizing: border-box;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 600px) {
    .retro-window { width: 85%; }
}

.retro-header {
    font-weight: bold;
    margin-bottom: 6px;
    text-align: left;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg,
            #f5e6a3 0%,
            #d4af37 25%,
            #b8860b 50%,
            #d4af37 75%,
            #f5e6a3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
}

.retro-bar-container {
    height: 20px;
    background-color: #000000;
    border: 2px solid #ff69b4;
    padding: 2px;
    text-align: left;
    position: relative;
    z-index: 2;
}

.retro-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(180deg, #ff69b4 0%, #ff1493 50%, #ff69b4 100%);
    transition: width 0.1s linear;
}

/* Controls Panel */
#controls-panel {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(0,0,0,0.96);
    border: 2px solid #ff69b4;
    padding: 12px;
    width: 360px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.6);
    font-size: 11px;
    color: #ccc;
}

#controls-panel h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    text-transform: uppercase;
    color: #f5e6a3;
    border-bottom: 1px solid #444;
    padding-bottom: 6px;
}

.panel-section { margin-bottom: 14px; }
.panel-section-title {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.slider-row { margin-bottom: 10px; }
.slider-row label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: #ccc;
    margin-bottom: 4px;
}
.slider-row input[type=range] { width: 100%; cursor: pointer; }

.two { display: flex; gap: 6px; }
.two button {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #555;
    color: #d4af37;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    text-transform: uppercase;
    padding: 4px 8px;
    cursor: pointer;
}
.two button:hover { background: #2a2a2a; }
.panel-hint { font-size: 10px; color: #777; margin-top: 4px; }
.two button.active { border-color: #ff69b4; color: #ff69b4; }


@media (hover: none) and (pointer: coarse) {
    .retro-btn { padding: 8px 11px; font-size: 12px; }
    #retroAutoplayBtn { bottom: 14px; left: 14px; }
    #fullscreenBtn { top: 14px; right: 14px; }
    #sensorBtn { bottom: 14px; right: 14px; }
    #instaBtn { top: 14px; left: 14px; }
    #autoRecBtn { top: 52px; left: 14px; }
    #previewBtn { top: 90px; left: 14px; }
    #frame-overlay {
        border-width: 3px;
        box-shadow:
            inset 3px 3px 0 #000000,
            inset -3px -3px 0 #c0c0c0,
            8px 8px 18px rgba(0, 0, 0, 0.38);
    }
}


/* (after the panel block above) */
#controls-panel { left: auto; right: 20px; top: 64px; width: 380px; max-width: calc(100% - 40px); max-height: calc(100% - 84px); }   /* (right: the site's nav runs down the left) */

/* Parts tab */
.pt-select { width: 100%; background: #1a1a1a; border: 1px solid #555; color: #f5e6a3; font: 12px 'Courier New', monospace; padding: 5px 6px; margin-bottom: 8px; }
.slider-row input.pt-num { width: 74px; background: #111; border: 1px solid #444; color: #f5e6a3; font: 11px 'Courier New', monospace; padding: 1px 4px; text-align: right; }
.pt-drop::after { content: 'Drop the part here'; position: absolute; inset: 12px; border: 2px dashed #d4af37; color: #f5e6a3; display: flex; align-items: center; justify-content: center; font: 16px 'Courier New', monospace; background: rgba(0,0,0,.45); pointer-events: none; z-index: 50; }
.btn:disabled { opacity: .35; cursor: default; }

/* ---- the sensor film (takes.js): infernal-harvest's player (crop-demons/breath.js + style.css, from Neanderthal Palette) ---- */
#sensorWidget { position: fixed; right: 20px; top: 50%; transform: translateY(-50%); width: 360px; max-width: 46vw; z-index: 900; background: #000;
    border-top: 3px solid #ff69b4; border-left: 3px solid #ff69b4; border-right: 3px solid #8b3a62; border-bottom: 3px solid #8b3a62;
    box-shadow: 2px 2px 4px rgba(0,0,0,.5), 0 6px 24px rgba(0,0,0,.6); }
#sensorWidget[hidden] { display: none; }
#sensorWidget .sw-frame { position: relative; width: 100%; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
#sensorWidget video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; background: #000; }
#sensorWidget .sw-ro { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px 6px; background: #000;
    border-top: 2px solid #ff6a1f; font: 12px/1.35 'Courier New', monospace; letter-spacing: .5px; color: #e8e8e8; white-space: nowrap; }
#sensorWidget .sw-sing { color: #ff6a1f; font-weight: bold; font-size: 15px; }
#sensorWidget .sw-meter { width: 110px; height: 5px; margin-top: 3px; margin-left: auto; background: #1a1a1a; position: relative; }
#sensorWidget .sw-meter div { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #ff6a1f; }
.video-scrub { -webkit-appearance: none; appearance: none; position: absolute; left: 0; right: 0; bottom: 5px; width: 100%; height: 18px; margin: 0;
    display: block; background: transparent; cursor: pointer; z-index: 2; }
.video-scrub::-webkit-slider-runnable-track { height: 8px; background: rgba(0,0,0,.32); border-top: 2px solid #8b3a62; border-left: 2px solid #8b3a62;
    border-right: 2px solid #ff69b4; border-bottom: 2px solid #ff69b4; }
.video-scrub::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 18px; margin-top: -8px;
    background: linear-gradient(180deg, #f5e6a3 0%, #d4af37 50%, #b8860b 100%); border-top: 2px solid #ff69b4; border-left: 2px solid #ff69b4;
    border-right: 2px solid #8b3a62; border-bottom: 2px solid #8b3a62; box-shadow: 1px 1px 2px rgba(0,0,0,.6); }
.video-scrub::-moz-range-track { height: 8px; background: rgba(0,0,0,.32); border-top: 2px solid #8b3a62; border-left: 2px solid #8b3a62;
    border-right: 2px solid #ff69b4; border-bottom: 2px solid #ff69b4; }
.video-scrub::-moz-range-thumb { width: 12px; height: 18px; border-radius: 0; background: linear-gradient(180deg, #f5e6a3 0%, #d4af37 50%, #b8860b 100%);
    border-top: 2px solid #ff69b4; border-left: 2px solid #ff69b4; border-right: 2px solid #8b3a62; border-bottom: 2px solid #8b3a62; }
.replay-led { position: absolute; left: 6px; bottom: 26px; z-index: 4; pointer-events: none; padding: 2px 6px; background: #000;
    font-family: 'Courier New', monospace; font-weight: bold; font-size: 14px; line-height: 1; text-transform: uppercase; }
.replay-led-ghost, .replay-led-live { display: block; text-align: right; white-space: pre; }
.replay-led-ghost { position: relative; color: rgba(150,20,0,.2); }
.replay-led-live { position: absolute; top: 2px; left: 6px; right: 6px;
    background: linear-gradient(180deg, #ff6b5a 0%, #e01e00 25%, #a00d00 50%, #e01e00 75%, #ff6b5a 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,.9)) drop-shadow(1px 1px 2px rgba(0,0,0,.7)); }
#sensorWidget .sw-grip, #glassWidget .sw-grip { position: absolute; left: 0; top: 0; width: 26px; height: 26px; z-index: 5; cursor: nwse-resize; touch-action: none;
    background: #000; border-right: 2px solid #ff69b4; border-bottom: 2px solid #ff69b4; color: #d4af37;
    font: bold 17px/24px 'Courier New', monospace; text-align: center; box-shadow: 1px 1px 3px rgba(0,0,0,.7); }
#sensorWidget .sw-grip::before, #glassWidget .sw-grip::before { content: '\2921'; }
#sensorWidget .sw-grip:hover, #glassWidget .sw-grip:hover { color: #f5e6a3; background: #1a0d14; }

/* ---- the wine glass film under the sensor film, and the cable between them (takes.js GL) ---- */
#filmStack { position: fixed; right: 20px; top: 54px; bottom: 54px; z-index: 900; display: flex; flex-direction: column;
    justify-content: center; align-items: flex-end; gap: 46px; pointer-events: none; }
/* (centred between F and SENSOR - the user, 2026-10-23. Safe now that no panel changes height: the glass readout is a
   fixed 45px and never wraps - that wrap was what made them bob) */
#filmStack > * { pointer-events: auto; }
#filmStack #sensorWidget { position: relative; right: auto; top: auto; transform: none; }
#glassWidget { position: relative; width: 260px; background: #000;
    border-top: 3px solid #ff69b4; border-left: 3px solid #ff69b4; border-right: 3px solid #8b3a62; border-bottom: 3px solid #8b3a62;
    box-shadow: 2px 2px 4px rgba(0,0,0,.5), 0 6px 24px rgba(0,0,0,.6); }
#glassWidget[hidden] { display: none; }
#glassWidget .gw-pair { display: flex; }
#glassWidget .gw-pair > .sw-frame, #glassWidget .gw-3dpane { flex: 1 1 0; min-width: 0; }
#glassWidget .gw-3dpane { position: relative; overflow: hidden; aspect-ratio: 9 / 16; border-left: 2px solid #ff69b4;
    background: radial-gradient(ellipse at 50% 55%, #2a1034 0%, #12060f 70%, #000 100%); }
#glassWidget .gw-3dpane[hidden] { display: none; }
#glassWidget .gw-3d { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#glassWidget .gw-3dlab { position: absolute; left: 6px; bottom: 6px; color: #d4af37; font: bold 10px 'Courier New', monospace; letter-spacing: .5px;
    background: #000; padding: 2px 5px; pointer-events: none; }
#glassWidget .sw-frame { position: relative; width: 100%; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
#glassWidget video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; background: #000; }
#glassWidget .sw-ro { display: flex; flex-wrap: nowrap; height: 45px; box-sizing: border-box; overflow: hidden; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px 6px; background: #000;
    border-top: 2px solid #ff6a1f; font: 12px/1.35 'Courier New', monospace; letter-spacing: .5px; color: #e8e8e8; white-space: nowrap; }
#glassWidget .gw-name { color: #d4af37; }
#glassWidget .gw-swirl { color: #ff6a1f; font-weight: bold; font-size: 14px; }
#glassWidget .sw-meter { width: 90px; height: 5px; margin-top: 3px; margin-left: auto; background: #1a1a1a; position: relative; }
#glassWidget .sw-meter div { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #ff6a1f; }
/* NODE DISCONNECTED over the glass film while its cable is out (takes.js glassReadout); NODE CONNECTED a moment as it goes back */
#glassWidget .gw-node { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.92); z-index: 5; pointer-events: none; opacity: 0;
    display: flex; align-items: center; gap: .55em; padding: .45em .8em; white-space: nowrap; background: rgba(8,4,6,.82); border: 2px solid #ff3b2f; border-radius: 0;
    font: bold clamp(9px, 5.2cqw, 17px)/1 'Courier New', monospace; letter-spacing: 1.5px; color: #ff5a4a; box-shadow: 0 0 18px rgba(255,59,47,.35);
    transition: opacity .25s, transform .25s, border-color .25s, color .25s; }
#glassWidget .sw-frame { container-type: inline-size; }
#glassWidget .gw-node.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#glassWidget .gw-node-dot { width: .6em; height: .6em; border-radius: 50%; background: #ff3b2f; box-shadow: 0 0 8px #ff3b2f; animation: gwBlink 1s steps(2, start) infinite; }
#glassWidget .gw-node.back { border-color: #ff9a2f; color: #ffb35a; box-shadow: 0 0 18px rgba(255,154,47,.35); }
#glassWidget .gw-node.back .gw-node-dot { background: #6aff6a; box-shadow: 0 0 8px #6aff6a; animation: none; }
#glassWidget .sw-frame video { transition: filter .4s; }
/* (no dimming of the glass film while unplugged: the user, 2026-10-25) */
@keyframes gwBlink { to { visibility: hidden; } }
/* the ports: brass sockets on the films' left edges */
.gw-port { position: absolute; left: -15px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; z-index: 6; cursor: pointer;
    background: radial-gradient(circle at 40% 35%, #f5e6a3 0%, #d4af37 45%, #6b4a10 100%); border: 2px solid #8b3a62;
    box-shadow: inset 0 0 0 5px rgba(0,0,0,.0), 0 0 0 2px #000, 1px 2px 4px rgba(0,0,0,.7); touch-action: none; }
.gw-port::after { content: ''; position: absolute; left: 6px; top: 6px; width: 6px; height: 6px; border-radius: 50%; background: #000; }
.gw-port.on { border-color: #ff6a1f; box-shadow: 0 0 0 2px #000, 0 0 10px #ff6a1f; }
.gw-port[hidden] { display: none; }
#glassCable { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 902; pointer-events: none; overflow: visible; }
#glassWire { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 901; pointer-events: none; }     /* the wire (takes.js glassCable) */
#glassCable .gc-wire { fill: none; stroke: #2a1020; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(2px 3px 2px rgba(0,0,0,.6)); }
#glassCable.on .gc-wire { stroke: #4a1a30; }
#glassCable .gc-flow { fill: none; stroke: #ff6a1f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 14; opacity: 0; }
#glassCable .gc-plug { fill: transparent; stroke: none; pointer-events: all; cursor: grab; }     /* (an invisible grip on the wire's copper end) */
#glassCable.on .gc-plug { fill: transparent; }

/* ---- phones held UPRIGHT: small films so the cat stays in view (the user, 2026-10-24: "the videos are too big"). Phones and
   iPads held sideways get the desktop column scaled to fit instead (takes.js stackFit; the user, 2026-10-25) ---- */
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    #filmStack { right: 10px; top: 48px; bottom: 48px; gap: 18px; }
    #sensorWidget { width: 34vw; max-width: none; border-width: 2px; }
    #glassWidget { border-width: 2px; }
    #sensorWidget .sw-ro, #glassWidget .sw-ro { padding: 2px 4px 3px; gap: 4px; font-size: 8px; letter-spacing: 0; border-top-width: 1px; }
    #glassWidget .sw-ro { height: 30px; }
    #sensorWidget .sw-sing, #glassWidget .gw-swirl { font-size: 10px; }
    #sensorWidget .sw-meter, #glassWidget .sw-meter { width: 40px; height: 3px; }
    .replay-led { font-size: 9px; bottom: 18px; left: 3px; padding: 1px 3px; }
    .video-scrub { height: 14px; bottom: 2px; }
    #sensorWidget .sw-grip, #glassWidget .sw-grip { width: 20px; height: 20px; font-size: 13px; line-height: 18px; }
    .gw-port { width: 16px; height: 16px; margin-top: -8px; left: -11px; }
    .gw-port::after { left: 3px; top: 3px; }
}
@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
    #filmStack { right: 12px; }
}
body.insta #filmStack { transform: none !important; }

/* Instagram 4:5 (main.js setInsta, the user 2026-10-24): a centred 1080 x 1350 frame (as big as fits below that), the
   head above, the knob film and the glass film side by side along the bottom, the corner buttons hidden */
body.insta { --iw: min(1080px, 80vh, 100vw); --ih: calc(var(--iw) * 1.25); --il: calc(50vw - var(--iw) / 2); --it: calc(50vh - var(--ih) / 2); background: #000; }
/* iPhone 16:9 (main.js FMT.phone): the same frame, landscape - 1920 x 1080 where the window is big enough, else as big as fits */
body.insta.phone { --iw: min(2348px, 96vw, calc(90vh * 2348 / 1080)); --ih: calc(var(--iw) * 1080 / 2348); }     /* (iPhone 18 Pro: 2622 x 1206 = 2.174:1) */
body.insta #stage, body.insta #frame-overlay, body.insta #vignette { position: fixed; inset: auto; left: var(--il); top: var(--it); width: var(--iw); height: var(--ih); }
/* 4:5: the scene's floor (the base's foot, the forest's) ends in a straight edge when the camera is near level - the
   bottom of the frame fades it into the dark (behind the films) instead of a hard 'crop' line (the user, 2026-10-24) */
body.insta #vignette { background: linear-gradient(to bottom, rgba(0,0,0,0) 74%, rgba(0,0,0,.75) 88%, #000 97%),
    radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.55) 100%); }
body.insta #retroAutoplayBtn, body.insta #fullscreenBtn, body.insta #sensorBtn, body.insta #instaBtn, body.insta #autoRecBtn, body.insta #previewBtn { display: none; }
/* the films placed freely in the frame (main.js INSTA.sw / gw -> --swx/--swy/--sww, --gwx/--gwy/--gww) */
body.insta #filmStack { left: var(--il); top: var(--it); width: var(--iw); height: var(--ih); right: auto; bottom: auto; display: block; pointer-events: none; }

/* (size = the film's full width; crop left / right trims it from the sides, the picture staying where it was) */
body.insta { --swk: calc(1 - var(--swcl, 0) - var(--swcr, 0)); --gwk: calc(1 - var(--gwcl, 0) - var(--gwcr, 0)); --gwv: calc(1 - var(--gwct, 0) - var(--gwcb, 0)); }
body.insta #filmStack #sensorWidget { position: absolute; left: calc(var(--iw) * (var(--swx, .04) + var(--sww, .58) * var(--swcl, 0))); top: calc(var(--ih) * var(--swy, .668));
  width: calc(var(--iw) * var(--sww, .58) * var(--swk)) !important; max-width: none; transform: none; }
body.insta #glassWidget { position: absolute; left: calc(var(--iw) * (var(--gwx, .7) + var(--gww, .26) * var(--gwcl, 0)));
  top: calc(var(--ih) * var(--gwy, .56) + var(--iw) * var(--gww, .26) * var(--gwct, 0) / var(--gar, .563));     /* (crop top: the picture stays put) */
  width: calc(var(--iw) * var(--gww, .26) * var(--gwk)) !important; }
body.insta #sensorWidget .sw-frame { aspect-ratio: calc(var(--sar, 1.778) * var(--swk)) !important; }
body.insta #glassWidget .sw-frame { aspect-ratio: calc(var(--gar, .563) * var(--gwk) / var(--gwv)) !important; }
body.insta #sensorWidget video { width: calc(100% / var(--swk)); left: calc(-100% * var(--swcl, 0) / var(--swk)); }
body.insta #glassWidget video { width: calc(100% / var(--gwk)); left: calc(-100% * var(--gwcl, 0) / var(--gwk)); height: calc(100% / var(--gwv)); top: calc(-100% * var(--gwct, 0) / var(--gwv)); }
/* the glass film's socket on its top middle in 4:5 (the user, 2026-10-24: 'so the node line can be a nice arching curve') */
body.insta #glassWidget .gw-out { left: 10px; top: -11px; margin: 0; }     /* (top left: the user, 2026-10-25 "a perfect slope from the top left of the glass to the middle right of the button video") */
body.insta .sw-grip { display: none; }
body.insta .gw-in { left: auto; right: -15px; }     /* (the knob film's IN port faces the glass film beside it: the cable hops the gap) */
body.insta #toast:not(.keep) { display: none; }     /* (toasts would land in the recording; the entry message shows) */

/* the films' readouts laid over the bottom of the picture, not in a black bar under it (the user, 2026-10-24: "to save
   space"): a dark fade under the text; the scrub bar and the time LED lifted above it */
#sensorWidget .sw-ro, #glassWidget .sw-ro { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 44px; box-sizing: border-box;
    background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.75) 50%); border-top: none; text-shadow: 0 1px 2px #000; }
#sensorWidget .video-scrub, #glassWidget .video-scrub { bottom: 44px; }
#sensorWidget .replay-led, #glassWidget .replay-led { bottom: 64px; }
@media (hover: none) and (pointer: coarse) and (orientation: portrait) {
    #sensorWidget .sw-ro, #glassWidget .sw-ro { height: 30px; }
    #sensorWidget .video-scrub, #glassWidget .video-scrub { bottom: 30px; }
    #sensorWidget .replay-led, #glassWidget .replay-led { bottom: 48px; }
}

/* the Auto record edit's opening: the glass film (its cable and the knob film's IN socket) comes in later (edit.js intro) */
/* it slides in from beyond the frame's right edge (no fade); the films are clipped to the frame while the edit runs */
body.ed-run.insta #filmStack { overflow: hidden; }
/* the glass film's ratchet in (takes.js GLASS_IN: --gin 0 away beyond the right edge .. 1 home, stepped there by the film's
   clock), its cable and ports only once it is home */
#glassWidget { translate: calc((1 - var(--gin, 1)) * (100% + 60px)) 0; }
body.gw-away #glassWire, body.gw-away #glassCable, body.gw-away .gw-port { visibility: hidden; }
body.gw-nocable #glassWire, body.gw-nocable #glassCable { visibility: hidden; }
/* (away, it is not shown at all; and in 4:5 the films are cut at the frame, so it never shows parked on the margin - the
   user, 2026-10-25: the glass film showed before its time) */
body.gw-gone #glassWidget { visibility: hidden; }
/* the camera node (takes.js CAM): a pink-framed tile between the two films - the grapes' camera looking straight, turning up
   as the view looks up at the hurricane; the glass film's cable plugs into its IN port */
#camNode { position: relative; width: 150px; background: #000; z-index: 2;
    border-top: 3px solid #ff69b4; border-left: 3px solid #ff69b4; border-right: 3px solid #8b3a62; border-bottom: 3px solid #8b3a62;
    box-shadow: 2px 2px 4px rgba(0,0,0,.5), 0 6px 24px rgba(0,0,0,.6); }
#camNode .cn-frame { position: relative; width: 100%; aspect-ratio: 800 / 705; overflow: hidden; }
#camNode img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; }
#camNode .cn-lab { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font: 10px/1.2 'Courier New', monospace; letter-spacing: 1px;
    color: #e8e8e8; background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.8) 45%); text-align: center; }
body.gw-away #camNode { visibility: hidden; }
body.insta #filmStack #camNode { position: absolute; }
#camNode .gw-port { display: none; }      /* (a button now, no socket: the user, 2026-10-25) */
#camNode { transition: transform .06s, box-shadow .06s; cursor: pointer; }
#camNode.pressed { transform: translateY(3px) scale(.965); border-top-color: #8b3a62; border-left-color: #8b3a62; border-right-color: #ff69b4; border-bottom-color: #ff69b4;
    box-shadow: inset 2px 2px 6px rgba(0,0,0,.8), 0 1px 3px rgba(0,0,0,.5); }
#camNode.pressed .cn-frame { filter: brightness(.82); }
body.insta #filmStack { overflow: hidden; }     /* (till it connects: takes.js GLASS_LINK) */
body.ed-noglass #glassWire, body.ed-noglass #glassCable, body.ed-noglass .gw-in { visibility: hidden; }
body.ed-nocable #glassWire, body.ed-nocable #glassCable, body.ed-nocable .gw-port { visibility: hidden; }     /* (until it plugs in: edit.js) */
/* the Auto record edit's 'focus' films (edit.js focus): the picture pushes in towards the middle of what shows of it,
   the frame's border glows (--swg / --gwg 0..1.6), a tag names the action coming */
body.ed-focus.insta #sensorWidget video { transform: scale(var(--swz, 1)); transform-origin: calc(100% * (var(--swcl, 0) + (1 - var(--swcl, 0) - var(--swcr, 0)) / 2)) 50%; }
body.ed-focus.insta #glassWidget video { transform: scale(var(--gwz, 1)); transform-origin: calc(100% * (var(--gwcl, 0) + (1 - var(--gwcl, 0) - var(--gwcr, 0)) / 2)) 50%; }
body.ed-focus.insta #sensorWidget { box-shadow: 0 0 0 calc(var(--swg, 0) * 2px) #ff6a1f, 0 0 calc(var(--swg, 0) * 26px) rgba(255,106,31,calc(var(--swg, 0) * .6)); }
body.ed-focus.insta #glassWidget { box-shadow: 0 0 0 calc(var(--gwg, 0) * 2px) #ff6a1f, 0 0 calc(var(--gwg, 0) * 26px) rgba(255,106,31,calc(var(--gwg, 0) * .6)); }
.ed-cue { position: absolute; right: 8px; top: 8px; z-index: 5; pointer-events: none; padding: 4px 8px; background: rgba(0,0,0,.78); border: 1px solid #ff6a1f; border-radius: 0;      /* (square, as the NODE label: the user, 2026-10-25) */
   
    font: bold 13px/1 'Courier New', monospace; letter-spacing: 1.5px; color: #ffb35a; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
.ed-cue.show { opacity: 1; transform: none; }

/* the label over the hurricane as the camera looks up (main.js noseLed, NOSE_LED.label): the films' NODE label's look */
#hurrLabel { position: fixed; left: 50%; top: 20%; transform: translate(-50%, -50%) scale(.92); z-index: 950; pointer-events: none; opacity: 0;
    display: flex; align-items: center; gap: .55em; padding: .45em .8em; white-space: nowrap; background: rgba(8,4,6,.82); border: 2px solid #ff3b2f; border-radius: 0;
    font: bold 15px/1 'Courier New', monospace; letter-spacing: 1.5px; color: #ff5a4a; box-shadow: 0 0 18px rgba(255,59,47,.35);
    transition: opacity .25s, transform .25s; }
#hurrLabel.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#hurrLabel .gw-node-dot { width: .6em; height: .6em; border-radius: 50%; background: #ff3b2f; box-shadow: 0 0 8px #ff3b2f; animation: gwBlink 1s steps(2, start) infinite; }

/* the 4:5 / AUTO RECORD / PREVIEW corner buttons: only while the G panel is open (the user, 2026-10-25) */
body:not(.panel-open) #instaBtn, body:not(.panel-open) #autoRecBtn, body:not(.panel-open) #previewBtn { display: none; }

/* iPhone: the rendered film fills the screen instead of the real-time piece (index.html phoneFilm) - letterboxed in black,
   only AUTOPLAY (play / pause) on top; a tap on the picture turns the sound on */
#phoneFilmWrap { position: fixed; inset: 0; background: #000; z-index: 5; cursor: pointer; }
#phoneFilmWrap[hidden] { display: none; }
#phoneFilm { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }     /* (cover: the film is the iPhone's own shape - fills it edge to edge, Safari's bars only trim a sliver) */
#phoneFilmTap { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); padding: 4px 10px; font: 10px/1.2 'Courier New', monospace;
    letter-spacing: 2px; color: #ffb3d9; background: rgba(0,0,0,.6); border: 1px solid #ff69b4; pointer-events: none; animation: pfBlink 1.6s steps(2) infinite; }
#phoneFilmTap[hidden] { display: none; }
@keyframes pfBlink { 50% { opacity: .35; } }
body.phone-film #canvas-wrapper, body.phone-film #fullscreenBtn, body.phone-film #instaBtn, body.phone-film #autoRecBtn,
body.phone-film #previewBtn, body.phone-film #sensorBtn, body.phone-film #filmStack { display: none !important; }
/* (the bevel stays: drawn over the film here, as the other artworks do - the iPhone render leaves it out, export-insta.mjs) */
body.phone-film #frame-overlay { display: block; }

/* iPhone 18 Pro layout: the phone's own furniture, scaled to the frame (k = frame width / the phone's 874 pt), measured on
   an emulated 18 Pro in landscape (874 x 402): AUTOPLAY 14 pt in from the left and the bottom, 85.6 x 36 pt, 12 px type;
   the bevel 3 pt + 3 pt inset shade - so the films can be laid out round what will cover them (the user, 2026-10-25) */
#phoneGuide { display: none; }
body.insta.phone #phoneGuide { --k: calc(var(--iw) / 874); display: flex; align-items: center; justify-content: center; position: fixed; z-index: 1001; pointer-events: none;
    left: calc(var(--il) + 14 * var(--k)); top: calc(var(--it) + var(--ih) - 50 * var(--k)); width: calc(85.6 * var(--k)); height: calc(36 * var(--k)); box-sizing: border-box;
    background: #000; border-top: calc(3 * var(--k)) solid #ff69b4; border-left: calc(3 * var(--k)) solid #ff69b4; border-right: calc(3 * var(--k)) solid #8b3a62; border-bottom: calc(3 * var(--k)) solid #8b3a62;
    font: bold calc(12 * var(--k)) 'Courier New', monospace; color: lightgrey; opacity: .9; }
body.insta.phone #frame-overlay { --k: calc(var(--iw) / 874); z-index: 1001; border-width: calc(3 * var(--k));      /* (over the films, as on the phone) */
    box-shadow: inset calc(3 * var(--k)) calc(3 * var(--k)) 0 #000, inset calc(-3 * var(--k)) calc(-3 * var(--k)) 0 #c0c0c0; }

/* desktop interface at 80 % (takes.js UI.k, body.ui-scaled; the user set the piece up at Chrome's 80 % zoom): the corner
   buttons and the bevel as they are there - the film column is scaled in takes.js stackFit */
body.ui-scaled .retro-btn, body.ui-scaled #frame-overlay { zoom: var(--ui, 1); }
