/* ── Fullscreen mode ── */
/* The themed page ground, as outside fullscreen and as the desktop's fullscreen keeps it. */
body.fullscreen-mode {
    padding: 0;
    margin: 0;
    overflow: hidden;
    background: var(--bg-page);
}
body.fullscreen-mode .container {
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--bg-page);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}
body.fullscreen-mode .controls-wrapper,
body.fullscreen-mode .info,
body.fullscreen-mode .drop-hint,
body.fullscreen-mode .main-content > .coordinates-panel,
body.fullscreen-mode .panel-resizer,
body.fullscreen-mode #selection-panel {
    display: none !important;
}
body.fullscreen-mode .main-content {
    display: contents; /* let children fill the container directly, no clip */
}
body.fullscreen-mode .canvas-section {
    display: contents;
}
body.fullscreen-mode .canvas-viewport {
    position: fixed !important;
    /* Beside a docked chat, so the canvas centres in what shows (chat/dock.js updateNotifyInset). */
    inset: var(--chat-inset-top, 0px) var(--chat-inset-right, 0px) var(--chat-inset-bottom, 0px) var(--chat-inset-left, 0px) !important;
    width: auto !important;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    /* No frame: below the system's menu-bar band its hairline and corners showed (desktop shell.qss [fsView]). */
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;   /* a skin's well shadow (aqua/canvas.css) is an edge too */
    background: var(--bg-page);
    overflow: auto;
    /* Centring is layout/canvas/frame.css's: a flex column, the canvas on `margin: auto` (a
       `safe center` pair centred the incognito frame as a row item beside the picture). */
    display: flex;
    z-index: 0; /* below fixed fullscreen panels (z-index 10000) */
}
body.fullscreen-mode .canvas-viewport.remote-editing { border: 1px solid var(--remote-gold) !important; }

/* Fullscreen enter/exit flight (motion/flip.js glideFrom): no scrollbars while the viewport's box
   glides between its in-flow slot and the window. */
.canvas-viewport.flip-active {
    overflow: hidden !important;
}
body:not(.fullscreen-mode) .canvas-viewport.flip-active {
    position: relative;
    z-index: 10050;                /* over the toolbars, under nothing that matters */
    background: var(--bg-page);    /* the fullscreen ground it is shrinking out of */
    border-radius: 0;
}

/* ── Fullscreen slide-in panels ── */
#fs-controls-panel,
#fs-points-panel {
    display: none;
    position: fixed;
    z-index: 10000;
    background: var(--bg-controls);
    border: 1px solid var(--border-main);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    transition: transform 0.25s ease, opacity 0.25s ease;
    pointer-events: auto;
}

/* Top slide-in: controls */
#fs-controls-panel {
    top: 0;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    opacity: 0;
    padding: 10px 14px;
    border-top: none;
    border-radius: 0 0 8px 8px;
    /* left / width follow a chat docking beside the canvas (fullscreen/panels.js syncFsTriggers). */
    transition: transform 0.25s ease, opacity 0.25s ease, left 0.25s ease, width 0.25s ease;
}
#fs-controls-panel.fs-panel-visible {
    transform: translateY(0);
    opacity: 1;
}
/* Dusted (js/ui/fullscreen/panels.js): the motes are the slide, so the panel holds its revealed
   place and only fades under them; a chat docking beside it still eases it over. */
#fs-controls-panel.dust-driven { transition: left 0.25s ease, width 0.25s ease; }
#fs-points-panel.dust-driven { transition: right 0.25s ease; }

/* Right slide-in: points list. Width follows the user's resized panel width (--coord-panel-width,
   shared with the normal-mode panel + its drag handle), clamped so it never dominates the screen. */
#fs-points-panel {
    top: 0;
    bottom: 0;
    /* --fs-dock-right (fullscreen/panels.js syncFsTriggers): the width of a chat docked on the right,
       so the list and its handle stop at the canvas's edge, as the desktop's points dock does. */
    right: var(--fs-dock-right, 0px);
    width: clamp(240px, var(--coord-panel-width, var(--coord-panel-default)), 86vw);
    transform: translateX(100%);
    opacity: 0;
    padding: 12px;
    border-right: none;
    border-radius: 8px 0 0 8px;
    overflow-y: auto;
    transition: transform 0.25s ease, opacity 0.25s ease, right 0.25s ease;
}
#fs-points-panel.fs-panel-visible {
    transform: translateX(0);
    opacity: 1;
}
/* The drag handle at the panel's left edge: dragging writes --coord-panel-width, which moves
   panel and handle together. */
#fs-panel-resizer {
    display: none;
    position: fixed;
    top: 0;
    bottom: 0;
    right: calc(clamp(240px, var(--coord-panel-width, var(--coord-panel-default)), 86vw) + var(--fs-dock-right, 0px));
    width: 10px;
    z-index: 10001;
    cursor: col-resize;
    /* Slides in with the points panel (same distance, same ease); hidden off to the right and
       non-interactive so it never blocks the right-edge hover trigger. */
    transform: translateX(clamp(240px, var(--coord-panel-width, var(--coord-panel-default)), 86vw));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, right 0.25s ease;
}
body.fullscreen-mode #fs-panel-resizer { display: block; }
body.fullscreen-mode #fs-points-panel.fs-panel-visible ~ #fs-panel-resizer {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}
/* The handle is part of the dusted panel: it forms and goes with the motes, never on a slide of
   its own. 460ms is POINTS_DUST_IN_MS (fullscreenPanels.js). */
body.fullscreen-mode #fs-points-panel.dust-driven ~ #fs-panel-resizer { transition: right 0.25s ease; }
/* A pouring panel stays hit-testable, though unseen (overlays.css clips a genie box away): the pointer
   crossing onto it holds it, rather than leaving both band and panel and pouring it again. */
:is(#fs-controls-panel, #fs-points-panel).genie-driven { clip-path: none !important; }
/* Sliding pours the list's picture without its handle: the handle shows as the list lands. */
body.fullscreen-mode #fs-points-panel.genie-driven ~ #fs-panel-resizer { opacity: 0; pointer-events: none; }
body.fullscreen-mode #fs-points-panel.surface-forming ~ #fs-panel-resizer { animation: surfaceForm 460ms linear both; }
body.fullscreen-mode #fs-points-panel.surface-leaving ~ #fs-panel-resizer { opacity: 0; pointer-events: none; }
#fs-panel-resizer::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3px;
    height: 44px;
    border-radius: 2px;
    background: var(--border-main);
    transition: background 0.15s, height 0.15s;
}
#fs-panel-resizer:hover::before, #fs-panel-resizer.dragging::before { background: var(--accent); height: 68px; }

/* Trigger zones — invisible hover strips */
#fs-top-trigger,
#fs-right-trigger {
    display: none;
    position: fixed;
    z-index: 9999;
    pointer-events: auto;
}
/* 28px, the desktop's reveal band (FullscreenController PANEL_REVEAL_PX); fullscreenPanels.js
   shrinks a revealed panel's band into its padding so no control sits under it. */
#fs-top-trigger {
    top: 0; left: 0; right: 0;
    height: 28px;
    z-index: 10002;
}
#fs-right-trigger {
    top: 0; bottom: 0; right: 0;
    width: 28px;
    z-index: 10002;
}
body.fullscreen-mode #fs-top-trigger,
body.fullscreen-mode #fs-right-trigger {
    display: block;
}
body.fullscreen-mode #fs-controls-panel,
body.fullscreen-mode #fs-points-panel {
    display: block;
}

#fs-controls-panel .controls {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
}

/* Fullscreen selection panel overlay */
#fs-selection-panel {
    background: var(--bg-sel-panel);
    border-bottom: 2px solid var(--border-sel);
    padding: 8px 14px;
    animation: fadeIn 0.15s ease;
    transition: top 0.25s ease, left 0.25s ease, width 0.25s ease;
}
#fs-selection-panel .selection-panel-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
