/* Fracture Studio: the page's arrangement only. Every control's look (buttons, fields, switches, menus, dialogs, toasts)
   and every colour comes from Myth Engine's editor kit (vendor/myth-ui/myth-ui.css) and its theme tokens, as Myth's UI
   standards ask (Myth/docs/UI-STANDARDS.md, "Local CSS may"). */

.fracture-host { flex: 1 1 auto; min-height: 0; display: flex; }
.fracture-host > .myth-editor-layout { flex: 1 1 auto; min-width: 0; }
/* Whatever the page hides (a setting that does not apply to the prop on show) stays hidden, whatever its arrangement. */
.fracture-host [hidden] { display: none !important; }

/* The Preview Area: its toolbar, the view, the break's timeline, the status line. */
.fracture-preview { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.fracture-preview > .myth-preview-viewport { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; }
/* The bar's right end: Settings, and Export at its full width. (The kit spaces the bar's groups and buttons.) */
.fracture-toolbar-end { flex: none; overflow: visible; }
.fracture-toolbar-end > #export { flex: none; white-space: nowrap; }
.fracture-viewport { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; }

/* The view: the prop (2D) or the model (3D) on a quiet ground with a faint grid, the same in every theme so the prop's
   own colours read true. The canvas is laid over its stage, so its drawing size never sets the stage's size. */
.fracture-stage { position: relative; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden;
  background-color: #23272b;
  background-image: linear-gradient(#8f9aa514 1px, transparent 1px), linear-gradient(90deg, #8f9aa514 1px, transparent 1px), radial-gradient(ellipse at 50% 42%, #343b41, transparent 76%);
  background-size: 24px 24px, 24px 24px, 100% 100%; }
.fracture-stage > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -2px; }
.fracture-stage-2d > canvas { cursor: crosshair; }
.fracture-stage-3d > canvas { cursor: grab; }
.fracture-stage-3d > canvas:active { cursor: grabbing; }
.fracture-stage-3d > canvas.impact { cursor: crosshair; }
/* A cut being swiped: a glowing line from where the swipe began. */
.swipe-line { position: absolute; pointer-events: none; transform-origin: 0 50%; height: 3px; border-radius: 3px; background: #fff4d8; box-shadow: 0 0 5px #ff9b60, 0 0 13px #ff855c; }
/* Making the break: in the middle of the view. */
.fracture-busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 14px; background: var(--myth-ui-surface-raised, var(--panel)); border: 1px solid var(--myth-ui-border, var(--border)); }
.fracture-busy > .myth-ui-progress { width: 90px; }
/* The navigation, floating in the view's corner: zoom, Home, framing and the view's display toggles. */
.fracture-navigation { position: absolute; right: 12px; bottom: 12px; z-index: 2; }

/* The break's timeline under the view: play, scrub, the frame and the time; for a sprite, six frames at a glance. */
.fracture-timeline { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 12px; }
.fracture-transport { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fracture-transport > #play, .fracture-transport > #modelPlay { min-width: 86px; justify-content: center; }
.fracture-transport > .myth-ui-range-number { flex: 1 1 auto; min-width: 0; }
.fracture-count, .fracture-clock { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fracture-clock { min-width: 62px; text-align: right; }
.fracture-reel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.fracture-frame { position: relative; height: 48px; min-width: 0; padding: 0; overflow: hidden; border-radius: 4px; cursor: pointer;
  background: var(--myth-ui-surface-muted, #1e1f22); border: 1px solid var(--myth-ui-border-soft, var(--border)); color: inherit; }
.fracture-frame:hover { border-color: var(--myth-ui-border, var(--border)); }
.fracture-frame[aria-current="true"] { border: 2px solid var(--myth-ui-accent, var(--accent)); }
.fracture-frame > canvas { display: block; width: 100%; height: 100%; }
.fracture-frame > small { position: absolute; left: 4px; bottom: 1px; font-size: 10px; color: var(--myth-ui-text-muted, var(--text-muted)); font-variant-numeric: tabular-nums; }

/* The status strip (the kit's myth-editor-statusbar): the prop's name and size, and what just happened. */
.fracture-status-group { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex: 1 1 auto; }
.fracture-title { white-space: nowrap; }
.fracture-meta { white-space: nowrap; color: var(--myth-ui-text-muted, var(--text-muted)); font-variant-numeric: tabular-nums; }
.fracture-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--myth-ui-text-muted, var(--text-muted)); }
.fracture-note.error { color: var(--myth-ui-danger, #e5534b); }

/* Settings, behind the bar's menu button: the theme, the side panels, the keys. */
.fracture-settings { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.fracture-buttons { display: flex; flex-wrap: wrap; gap: 6px; }

/* The Library drawer: find, filter, and the props or models as cards. */
.fracture-library { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; }
.fracture-library-count { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fracture-library-group > h3 { margin: 10px 0 6px; font-size: 13px; font-weight: 600; }
.fracture-library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.fracture-prop { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; height: auto; padding: 6px 4px; white-space: normal; text-align: center; }
.fracture-prop > img { display: block; width: 100%; height: 72px; object-fit: contain; }
.fracture-prop > .myth-ui-choice-card-title { font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.fracture-prop > small { font-size: 10.5px; line-height: 1.25; color: var(--myth-ui-text-muted, var(--text-muted)); overflow-wrap: anywhere; }
.fracture-readout { display: block; color: var(--myth-ui-text-muted, var(--text-muted)); font-size: 12px; line-height: 1.5; }

/* The properties. Reset to Defaults sits beside the filter box at the top; the filter takes the rest of the row. */
.fracture-host .myth-ui-property-inspector-toolbar { display: flex; align-items: center; gap: 6px; }
.fracture-host .myth-ui-property-inspector-toolbar > .myth-ui-property-inspector-search { flex: 1 1 auto; min-width: 0; }
.fracture-host .myth-ui-property-inspector-toolbar > #resetDefaults { flex: none; white-space: nowrap; }
.fracture-rows { display: contents; }
.fracture-switch-row { display: flex; }

/* Export's dialog. */
.fracture-export { width: min(500px, 94vw); }
.fracture-export .myth-ui-dialog-body { display: flex; flex-direction: column; gap: 12px; }
.fracture-export-about { margin: 0; }

/* In a narrow window Myth's editor layout stacks its columns (the kit's own query: the editor 980 px wide or less). The
   prop then comes first and fills the screen but for the top of the drawers' row, which shows below it so it is plain
   there is more (the library, the properties and the clip, on the drawers' rail) as the editor scrolls. */
@container (max-width: 980px) {
  .fracture-host .myth-editor-layout-main { order: -1 !important; height: calc(100svh - 56px) !important; }
  .fracture-host .myth-editor-layout-main > .fracture-preview { height: 100%; }
}
/* A phone: the frames at a glance give way to the view, and the timeline's slider takes a row of its own. */
@media (max-width: 700px) {
  .fracture-navigation { right: 6px; bottom: 6px; }
  .fracture-reel { display: none; }
  .fracture-transport { flex-wrap: wrap; }
  .fracture-transport > .myth-ui-range-number { order: 1; flex: 1 1 100%; }
  .fracture-clock { margin-left: auto; }
}
