@font-face {
    font-family: 'Montserrat';
    src: url(fonts/Montserrat-Regular.ttf);
}

@font-face {
    font-family: 'Comfortaa';
    src: url(fonts/Comfortaa-SemiBold.ttf);
}

:root {
    /* --bg: #111319; */
    --bg: #020f07;
    --bg-elev: #171b24;
    --bg-elev-2: #1d2330;
    --panel: rgba(20, 24, 33, 0.3);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text: #eef2ff;
    --text-muted: #aab4d0;
    --text-dim: #7f8aa8;

    --accent: #6ea8fe;
    --accent-2: #8b5cf6;
    --success: #35c98a;
    --warning: #f4b860;
    --danger: #ef6b73;

    --grid-major: rgba(255, 255, 255, 0.02);
    --grid-minor: rgba(255, 255, 255, 0.015);

    --block-action: #1f3d64;
    --block-phrase: #243c2c;
    --block-choice: #4b3c1c;
    --block-exit: #4a2222;

    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.32);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.32);
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.2);
    --shadow-sms: 0 4px 20px rgba(0, 0, 0, 0.4);
    --3dborder: 0 -3px 0 1px rgba(255, 255, 255, 0.08) inset;

    --radius-xl: 18px;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;

    --panel-w: 340px;
    --toolbar-h: 56px;
    --node-w: 320px;
    --node-min-h: 32px;
    --transition: 140ms ease;
    --font: "Montserrat", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(110, 168, 254, 0.75);
    box-shadow: 0 0 0 3px rgba(110, 168, 254, 0.16);
    background: rgba(255, 255, 255, 0.07);
}

textarea {
    min-height: 92px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

select option {
    background-color: #272833 !important;
}

/* input:is([type="radio"], [type="checkbox"]) {
    width: auto;
    max-width: 15px;
    display: inline-block;
} */

.field-label:has(input:is([type="checkbox"])) {
    cursor: pointer;
    color: rgba(238, 242, 255, 0.22);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0px 12px 10px;
}

input:is([type="checkbox"]) {
    width: 26px !important;
    height: 20px !important;
    display: inline-block !important;
    position: relative !important;
    background: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    -moz-appearance: none !important;
    padding: 0 !important;
    margin: 3px -1px 0 0 !important;
    top: 6px;
    left: -6px;
    cursor: pointer;
}

input:is([type="checkbox"])::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background-image: url(images/ui/checkbox_off.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
}

.field-label:hover input:is([type="checkbox"]) {
    filter: brightness(1.6);
}

input:is([type="checkbox"]):checked:after {
    background-image: url(images/ui/checkbox_on.png);
}

.app {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.surface {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background:
        linear-gradient(var(--grid-major) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
        linear-gradient(var(--grid-minor) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px),
        radial-gradient(circle at 20% 20%, rgba(110, 168, 254, 0.08), transparent 40%),
        radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.06), transparent 38%),
        var(--bg);
    background-size:
        120px 120px,
        120px 120px,
        24px 24px,
        24px 24px,
        auto,
        auto,
        auto;
    cursor: grab;
}

.surface.dragging {
    cursor: grabbing;
}

.surface.connect-mode {
    cursor: crosshair;
}

.viewport {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.edges {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: auto;
}

.edge-hit-area {
    pointer-events: stroke;
    stroke: transparent;
    stroke-width: 16;
    fill: none;
    cursor: pointer;
}

.edge {
    pointer-events: none;
    fill: none;
    stroke: rgb(99, 104, 142);
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke var(--transition), filter var(--transition);
}

.is-jump .edge {
    stroke: #beb261;
}

.is-choice .edge {
    stroke: #934000;
}

.is-junction .edge {
    stroke: rgb(17, 107, 22);
}

.is-jump .edge-hit-area {
    display: none;
}

.is-conditional .edge {
    stroke-dasharray: 3 10;
}

.is-exit .edge {
    stroke: rgb(180, 0, 0);
}

.is-selected .edge {
    stroke: #fff;
}

.is-separate .edge {
    stroke-dasharray: 10 20;
    stroke: #ffffff20;
}

.edge-marker {
    fill: rgb(99, 104, 142);
}

.edge-marker-selected {
    fill: #fff;
}

.edge-marker-jump {
    fill: #beb261;
}

.edge-marker-choice {
    fill: #934000;
}

.edge-marker-junction {
    fill: rgb(17, 107, 22);
}

.edge-marker-exit {
    fill: rgb(180, 0, 0);
}

.is-selected .edge {
    marker-end: url(#edgeArrowMarkerSelected);
}

.is-jump .edge {
    marker-end: url(#edgeArrowMarkerJump);
}

.is-choice:not(.is-selected) .edge {
    marker-end: url(#edgeArrowMarkerChoice);
}

.is-junction:not(.is-selected) .edge {
    marker-end: url(#edgeArrowMarkerJunction);
}

.is-exit:not(.is-selected) .edge {
    marker-end: url(#edgeArrowMarkerExit);
}

.edge-label {
    pointer-events: none;
}

.edge-badge {
    fill: rgb(99, 104, 142);
    pointer-events: none;
}

.is-choice .edge-badge {
    fill: #934000;
}

.is-junction .edge-badge {
    fill: rgb(17, 107, 22);
}

.edge-badge.is-selected {
    fill: var(--accent);
}

.edge-badge-text {
    fill: #ffd89a;
    font-size: 13px;
    font-weight: 900;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.nodes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.node {
    position: absolute;
    max-width: var(--node-w);
    min-height: var(--node-min-h);
    user-select: none;
    pointer-events: auto;
    transition: scale var(--transition);
    cursor: pointer;
}

.preview .node:hover {
    scale: 2;
    z-index: 100;
}

.node.is-locked {
    opacity: 0.92;
}

.node.is-dragging {
    z-index: 30;
    cursor: grabbing;
}

.node-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    opacity: 0;
    transition: opacity var(--transition);
}

.node:hover:not(.is-dragging) .node-header,
.node.is-selected:not(.is-dragging) .node-header {
    opacity: 1;
}

.node-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 8px 8px 0;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.node-header-badge.is-type {
    font-family: "Comfortaa", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-transform: capitalize;
    font-size: 12px;
}

.node-body {
    padding: 9px 8px 11px;
    border-radius: var(--radius-lg);
    /* border: 1px solid rgba(59, 58, 58, 0.8); */
    box-shadow: var(--3dborder), var(--shadow-md);
    z-index: 0;
    position: relative;
    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition);
}

.node-body:hover,
.node-body:active,
.node.is-dragging>.node-body {
    filter: brightness(1.1);
}

.node.is-dragging>.node-body {
    box-shadow: var(--3dborder),
        0 16px 34px rgba(0, 0, 0, 0.6);
    transform: translateY(-4px);
}

.node.is-selected>.node-body {
    filter: brightness(1.3);
    box-shadow: var(--3dborder),
        0 16px 34px rgba(0, 0, 0, 0.6),
        0 0 100px rgba(255, 255, 255, 0.3);
    transform: translateY(-4px);
}

.node.is-playtest-active>.node-body {
    box-shadow: var(--3dborder),
        0 10px 20px rgba(0, 0, 0, 0.72),
        0 10px 100px 32px rgba(87, 125, 255, 0.86);
    outline: 4px solid #016dee;
}

.node-title {
    color: var(--text);
    margin-top: 8px;
}

.node-subtitle,
.node-snippet,
.node-meta {
    color: var(--text-muted);
    word-break: break-word;
}

.node-snippet {
    max-width: calc(var(--node-w) - 20px);
    max-height: 68px;
    width: max-content;
    margin-top: 8px;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    background: rgba(0, 0, 0, 0.21);
    border-radius: 8px;
    padding: 6px 8px;
    border: 1px solid rgba(0, 0, 0, 0.22);
}

.node-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: max-content;
}

.node-badge {
    display: inline;
    align-items: center;
    max-width: 140px;
    padding: 4px 8px 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.node-badge.is-comment {
    font-style: italic;
}

.node-badge.with-icon {
    background-repeat: no-repeat;
    background-size: 13px;
    background-position-y: center;
    background-position-x: 6px;
    padding-left: 21px;
}

.node-badge.with-icon.no-text {
    height: 24px;
    width: 24px;
    padding: 0;
    background-position: center;
}

.node-badge.with-icon.is-sticky {
    background-image: url(images/icons/icon_lightbulb.png);
}

.node-badge.with-icon.is-burner {
    background-image: url(images/icons/icon_match.png);
}

.node-badge.with-icon.is-flash {
    background-image: url(images/icons/icon_flash.png);
}

.node-badge.with-icon.is-exit {
    background-image: url(images/icons/icon_showexit.png);
}

.node-badge.with-icon.is-action {
    background-image: url(images/icons/icon_isaction.png);
}

.node-badge.with-icon.is-phrase {
    background-image: url(images/icons/icon_isphrase.png);
}

.node-badge.with-icon.is-not-phrase {
    background-image: url(images/icons/icon_isnotphrase.png);
}

.node-badge.with-icon.is-checks {
    background-image: url(images/icons/icon_dice.png);
}

.node-badge.with-icon.is-character {
    background-image: url(images/icons/icon_person.png);
}

.node-badge.with-icon.is-audio {
    background-image: url(images/icons/icon_audio.png);
}

.node-badge.is-character[data-role="hero"] {
    background-color: rgba(159, 69, 0, 1);
}

.node-badge.is-character[data-role="companion"] {
    background-color: rgba(235, 34, 115, 0.61);
}

.node-badge.is-character[data-role="narrator"] {
    background-color: rgba(0, 132, 255, 0.4);
}

.node-badge.is-character[data-role="npc"] {
    background-color: rgba(35, 156, 41, 0.39);
}

.node-badge.with-icon.is-action-type[data-type="set flag"] {
    background-image: url(images/icons/icon_flag.png);
}

.node-badge.with-icon.is-action-type[data-type="add to flag"] {
    background-image: url(images/icons/icon_flagadd.png);
}

.node-badge.with-icon.is-action-type[data-type="emit signal"] {
    background-image: url(images/icons/icon_signal.png);
}

.node-badge.with-icon.is-tag {
    background-image: url(images/icons/icon_tag.png);
}

.node-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    z-index: 10;
}

.node:hover:not(.is-dragging) .node-actions,
.node.is-selected:not(.is-dragging) .node-actions,
.node.show-actions .node-actions {
    opacity: 1;
    pointer-events: auto;
}

.node-action-btn {
    width: 28px;
    height: 28px;
    font-size: 18px;
    padding: 1px 0;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(16, 18, 25, 0.88);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-sm);
    transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.node-action-btn:hover {
    background: rgba(36, 43, 58, 0.95);
    border-color: rgba(110, 168, 254, 0.5);
    transform: translateY(-1px);
}

.node-action-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.node-check-result {
    display: none;
    position: absolute;
    top: 31px;
    left: -30px;
    background: rgba(17, 16, 16, 1);
    border-radius: 20px;
    padding: 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 50;
    width: 350px;
    box-shadow: 0 24px 40px rgba(0, 0, 0, 0.71);
    gap: 8px;
    flex-direction: column;
}

.check-result-error,
.check-result-warning {
    background: rgba(47, 47, 47, 0.4);
    border-radius: 10px;
    padding: 5px 8px 5px 30px;
    background-repeat: no-repeat;
    background-position-x: 3px;
    background-position-y: 3px;
    background-size: 20px;
    font-family: monospace;
    font-size: 13px;
}

.check-result-error {
    background-image: url(images/icons/icon_error.png);
}

.check-result-warning {
    background-image: url(images/icons/icon_warning.png);
}

.node-checks {
    position: absolute;
    left: -30px;
    top: 0px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-start;
    align-content: center;
}

.node:hover .node-check-result {
    display: flex;
}

.node-checks>div {
    width: 26px;
    height: 26px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.node-checks .is-error {
    display: none;
    background-image: url(images/icons/icon_error.png?1);
}

.node-checks .is-warning {
    display: none;
    background-image: url(images/icons/icon_warning.png?1);
}

.node.has-errors .node-checks .is-error {
    display: block;
}

.node.has-warnings .node-checks .is-warning {
    display: block;
}

.node-jump-label {
    position: absolute;
    top: 12px;
    left: 66px;
    font-weight: 700;
    font-size: 12px;
    background: rgba(255, 96, 0, 0.54);
    border-radius: 8px;
    padding: 3px 6px 2px;
    max-width: 180px;
    text-overflow: ellipsis;
    overflow: hidden;
    line-clamp: 1;
    -webkit-line-clamp: 1;
    text-wrap: nowrap;
    width: max-content;
    display: inline-block;
    text-transform: uppercase;
}

.node-jump-label.is-choice {
    background: rgba(255, 96, 0, 0.74);
}

.node-jump-label.is-phrase {
    background: rgba(6, 101, 101, 0.67);
}

.node-jump-label.is-action {
    background: rgba(47, 92, 150, 0.64);
}

.node-jump-label.is-jump {
    background: rgba(255, 198, 0, 0.67);
}

.node-jump-label.is-exit {
    background: rgba(190, 41, 41, 0.68);
}

.node-jump-label.is-junction {
    background: rgba(33, 125, 63, 0.67);
}

.node-comment {
    position: absolute;
    left: 0;
    bottom: -12px;
    pointer-events: none;
}

.node-comment>div {
    position: absolute;
    font-weight: 700;
    font-size: 12px;
    background: rgba(151, 240, 133, 0.07);
    border-radius: 8px;
    padding: 6px 10px 5px;
    max-width: 140px;
    text-overflow: ellipsis;
    overflow: hidden;
    width: max-content;
    max-height: 46px;
    color: #959595;
    backdrop-filter: blur(3px);
    border: 1px solid #393939;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    box-sizing: content-box;
}

.node:hover .node-comment,
.node.is-selected .node-comment {
    display: none;
}

.preview .node:hover .node-comment {
    display: block;
}

.preview .node:hover .node-actions {
    display: none;
}

.node[data-type="action"]>.node-body {
    background: linear-gradient(rgba(35, 75, 128, 0.96), rgba(12, 24, 42, 0.98));
}

.node[data-type="phrase"]>.node-body {
    background: linear-gradient(rgba(0, 85, 85, 0.96), rgba(0, 31, 31, 0.98));
}

.node[data-type="choice"]>.node-body,
.node[data-type="option"]>.node-body {
    background: linear-gradient(rgba(162, 68, 0, 0.96), rgba(69, 24, 1, 0.98));
}

.node[data-type="exit"]>.node-body {
    background: linear-gradient(rgba(174, 42, 42, 0.96), rgba(84, 0, 0, 0.98));
}

.node[data-type="start"]>.node-body {
    background: linear-gradient(rgba(166, 24, 83, 0.96), rgba(75, 3, 33, 0.96));
}

.node[data-type="jump"]>.node-body {
    background: linear-gradient(rgba(195, 165, 83, 1), rgba(84, 62, 9, 0.96));
}

.node[data-type="junction"]>.node-body {
    background: linear-gradient(rgba(31, 107, 56, 0.96), rgba(3, 38, 15, 0.98));
}

.node[data-type="emitter"]>.node-body {
    background: linear-gradient(rgba(67, 128, 224, 0.96), rgba(17, 51, 111, 0.96));
}

.node[data-type="flags"]>.node-body {
    background: linear-gradient(rgba(99, 139, 107, 0.96), rgba(27, 69, 44, 0.96));
}

.node[data-type="choice"],
.node[data-type="exit"],
.node[data-type="jump"],
.node[data-type="junction"],
.node[data-type="emitter"],
.node[data-type="flags"],
.node[data-type="start"] {
    width: 60px;
    height: 135px;
}

.node[data-type="choice"]>.node-body,
.node[data-type="exit"]>.node-body,
.node[data-type="jump"]>.node-body,
.node[data-type="junction"]>.node-body,
.node[data-type="emitter"]>.node-body,
.node[data-type="flags"]>.node-body,
.node[data-type="start"]>.node-body {
    height: 60px;
    width: 60px;
    padding: 5px;
}

.node[data-type="choice"] .node-header,
.node[data-type="jump"] .node-header,
.node[data-type="junction"] .node-header,
.node[data-type="emitter"] .node-header,
.node[data-type="flags"] .node-header,
.node[data-type="exit"] .node-header,
.node[data-type="start"] .node-header {
    justify-content: center;
}

.node[data-type="choice"] .node-actions,
.node[data-type="jump"] .node-actions,
.node[data-type="junction"] .node-actions,
.node[data-type="emitter"] .node-actions,
.node[data-type="flags"] .node-actions,
.node[data-type="exit"] .node-actions,
.node[data-type="start"] .node-actions {
    justify-content: center;
    position: absolute;
    width: 100px;
    left: -20px;
}

.node[data-type="choice"] .node-header-badge.is-id,
.node[data-type="jump"] .node-header-badge.is-id,
.node[data-type="junction"] .node-header-badge.is-id,
.node[data-type="emitter"] .node-header-badge.is-id,
.node[data-type="flags"] .node-header-badge.is-id,
.node[data-type="exit"] .node-header-badge.is-id,
.node[data-type="start"] .node-header-badge.is-id {
    display: none;
}

.node-choice-visual,
.node-exit-visual,
.node-start-visual,
.node-emitter-visual,
.node-flags-visual,
.node-jump-visual,
.node-junction-visual {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 38px;
    width: 50px;
    height: 50px;
    mix-blend-mode: overlay;
    filter: drop-shadow(0 3px 3px #00000030);
}

.node-choice-visual {
    background-image: url(images/icons/icon_choice.png?3);
}

.node-exit-visual {
    background-image: url(images/icons/icon_exit.png);
}

.node-start-visual {
    background-image: url(images/icons/icon_start.png);
}

.node-jump-visual {
    background-image: url(images/icons/icon_jump.png);
}

.node-junction-visual {
    background-image: url(images/icons/icon_junction.png);
}

.node-emitter-visual {
    background-image: url(images/icons/icon_emitter.png);
}

.node-flags-visual {
    background-image: url(images/icons/icon_flags.png);
}

.node[data-type="phrase"] .node-header-badge.is-type,
.node[data-type="action"] .node-header-badge.is-type,
.node[data-type="option"] .node-header-badge.is-type {
    background-repeat: no-repeat;
    background-position-x: 5px;
    background-position-y: 8px;
    background-size: 15px;
    padding-left: 25px;
}

.node[data-type="phrase"] .node-header-badge.is-type {
    background-image: url(images/icons/icon_phrase.png);
}

.node[data-type="action"] .node-header-badge.is-type {
    background-image: url(images/icons/icon_action.png);
}

.node[data-type="option"] .node-header-badge.is-type {
    background-image: url(images/icons/icon_option.png);
}

#logo {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 0px 2px 6px;
    background-color: transparent;
    font-family: "Comfortaa", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #7A829E;
    text-shadow: 0 0.6px 0 #ffffff20;
    filter: brightness(1.3) contrast(1.2);
}

#logo>img {
    width: 18px;
    height: 18px;
    margin: 0 1px 0 2px;
}

#logo>span {
    color: #015051;
}

#hidePrefs {
    position: absolute;
    top: 13px;
    right: 27px;
    height: 24px;
    padding: 5px 8px 4px 7px;
}

#hidePrefs,
#hideControlPanel {
    cursor: pointer;
}

#hidePrefs:hover,
#hideControlPanel:hover {
    filter: brightness(1.5);
}

.row.wrap:last-child {
    margin-bottom: 0;
}

a {
    color: #91d1ff !important;
}

a.wizard {
    display: flex;
    align-items: end;
    text-decoration: none !important;
    font-weight: 900;
    color: color(display-p3 0.794 0.398 0.995) !important;
    border-bottom: 2px solid rgba(56, 43, 210, 0.3);
    position: relative;
    bottom: -2px;
    margin-left: -4px;
}

a.wizard:hover {
    border-bottom: 2px solid rgba(56, 43, 210, 0.8);
}

#info-credentials>img {
    width: 38px;
    height: 38px;
    filter: brightness(1.5);
    position: relative;
    bottom: -4px;
}

.overlay-panel {
    position: absolute;
    top: 16px;
    bottom: 16px;
    width: var(--panel-w);
    padding: 14px;
    border-radius: 20px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
    overflow: hidden;
    z-index: 50;
}

.overlay-panel.left {
    left: 16px;
}

.overlay-panel.right {
    right: 16px;
}

.panel-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding-right: 4px;
}

.panel-scroll::-webkit-scrollbar {
    width: 10px;
}

.panel-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}

.panel-section {
    position: relative;
    margin-bottom: 18px;
    padding: 14px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-section:last-child {
    margin-bottom: 0;
}

.panel-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

.panel-subtitle {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 12px;
}

.field {
    margin-bottom: 12px;
}

.field:last-child {
    margin-bottom: 0;
}

.field-label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.field-hint {
    margin-top: 5px;
    color: var(--text-dim);
    font-size: 11px;
}

.inline-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.row.wrap {
    flex-wrap: wrap;
}

.spacer {
    flex: 1 1 auto;
}

.btn {
    font-size: 13px;
    padding: 6px 9px;
    margin-top: 5px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn.primary {
    background: linear-gradient(180deg, rgba(110, 168, 254, 0.9), rgba(86, 133, 206, 0.9));
    color: #07101b;
    border-color: rgba(110, 168, 254, 0.35);
    font-weight: 700;
}

.btn.primary:hover {
    background: linear-gradient(180deg, rgba(127, 179, 255, 0.96), rgba(93, 143, 220, 0.96));
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    background: rgba(239, 107, 115, 0.12);
    border-color: rgba(239, 107, 115, 0.35);
    color: #ffc1c5;
}

.btn.small {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.btn.icon {
    width: 36px;
    min-width: 36px;
    padding: 0;
    display: grid;
    place-items: center;
}

.tag-list,
.flag-list,
.condition-list,
.param-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.list-item {
    padding: 10px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 30px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(110, 168, 254, 0.12);
    border: 1px solid rgba(110, 168, 254, 0.24);
    color: #dceaff;
    font-size: 12px;
    font-weight: 600;
}

.pill .remove {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    padding: 0;
    font-size: 11px;
}

.hidden {
    display: none !important;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 20px;
    /*180*/
    text-align: center;
    color: var(--text-muted);
    padding: 5px 10px;
    /*16*/
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
}

.selection-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.selection-title h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.selection-chip {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.top-status {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%);
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#showPrefs {
    position: absolute;
    left: 18px;
    top: 18px;
    z-index: 40;
    cursor: pointer;
    padding: 8px 12px 8px 10px;
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow-lg), 0 -2px 4px rgba(255, 255, 255, 0.07) inset;
    backdrop-filter: blur(14px);
    text-wrap: nowrap;
}

#showPrefs:hover {
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
}

#showPrefsName {
    text-wrap: nowrap;
    text-overflow: ellipsis;
    height: 12px;
    max-width: 250px;
    display: inline-block;
    overflow: hidden;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    margin-left: 5px;
    margin-bottom: -2px;
    font-size: 11px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 4px;
    border-radius: 999px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    font-family: "Comfortaa", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    ;
}

.toolbar-section.editor {
    background: rgba(53, 201, 138, 0.1);
}

.toolbar-section.translator {
    background: rgba(244, 184, 96, 0.14);
}

.toolbar-section.playtest {
    background: rgba(0, 85, 255, 0.1);
}

.toolbar-section.check {
    background: rgba(231, 0, 0, 0.2);
}

.editor .status-badge,
.translator .status-badge,
.playtest .status-badge,
.check .status-badge {
    background-repeat: no-repeat;
    background-size: 18px;
    background-position-x: 0px;
    background-position-y: center;
    padding: 4px 0px 4px 24px;
}

.editor .status-badge {
    background-image: url(images/icons/icon_editor.png);
}

.translator .status-badge {
    background-image: url(images/icons/icon_translator.png);
}

.playtest .status-badge {
    background-image: url(images/icons/icon_run.png);
}

.check .status-badge {
    background-image: url(images/icons/icon_check.png);
}

.file-input {
    display: none;
}

.context-menu {
    position: absolute;
    z-index: 60;
    min-width: 80px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(18, 22, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-lg);
}

.context-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.context-menu button {
    width: 100%;
    text-align: left;
    padding: 6px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    background: transparent;
    color: var(--text);
}

.context-menu button:hover {
    background: rgba(255, 255, 255, 0.07);
}

.muted {
    color: var(--text-muted);
}

.dim {
    color: var(--text-dim);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.lock-overlay {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    border-radius: inherit;
    background: rgba(7, 10, 16, 0.18);
    pointer-events: none;
}

.node.is-locked .lock-overlay {
    display: grid;
}

.lock-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(18, 22, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#bottom-toolbar {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.toolbar-section {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 9px;
    border-radius: 8px;
    background: rgba(18, 22, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.top-status>.toolbar-section {
    min-height: 30px;
    padding: 3px 9px 3px 6px;
    border-radius: 6px;
}

.toolbar-section:first-child {
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
    border-top-right-radius: 9px;
    border-bottom-right-radius: 9px;
}

.toolbar-section:last-child {
    border-top-right-radius: 28px;
    border-bottom-right-radius: 28px;
    border-top-left-radius: 9px;
    border-bottom-left-radius: 9px;
}

.zoom-divider {
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 10px;
}

.zoom-controls {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 45;
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.zoom-btn {
    height: 28px;
    display: flex;
    gap: 4px;
    place-items: center;
    color: var(--text);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 28px;
    background: rgba(18, 22, 30, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-sm), 0 -2px 4px rgba(255, 255, 255, 0.07) inset;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.zoom-btn.non-click {
    cursor: default;
}

.zoom-btn>img {
    display: inline-block;
    width: 14px;
    height: 14px;
    position: relative;
}

.zoom-btn:not(.is-square)>img {
    left: -3px;
}

.zoom-btn:disabled {
    cursor: default;
    opacity: 0.5;
}

.zoom-btn.is-square {
    width: 28px;
}

.zoom-btn:not(.is-square) {
    padding: 1px 10px 0px;
}

.zoom-btn.big>img {
    width: 16px;
    height: 16px;
    left: -3px;
}

.zoom-btn.is-start>img {
    top: 0px;
    filter: sepia(1) brightness(0.5) saturate(6) hue-rotate(290deg);
}

.zoom-btn.is-emitter>img {
    top: -1px;
    filter: sepia(1) brightness(0.5) saturate(6) hue-rotate(175deg);
}

.zoom-btn.is-flags>img {
    top: -0.5px;
    filter: sepia(1) brightness(0.5) saturate(6) hue-rotate(100deg);
}

.zoom-btn:hover:not(:disabled) {
    background: rgba(36, 44, 60, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sms), 0 -2px 4px rgba(255, 255, 255, 0.07) inset;
}

.toolbar-section.signals {
    padding: 9px 6px;
}

.notice {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(244, 184, 96, 0.12);
    border: 1px solid rgba(244, 184, 96, 0.25);
    color: #ffe3b1;
    font-size: 12px;
}

.hr {
    height: 1px;
    margin: 14px 0;
    background: rgba(255, 255, 255, 0.08);
}

#message-back {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: 100;
    top: 0;
    left: 0;
    backdrop-filter: blur(4px);
    display: none;
    align-content: center;
    pointer-events: all;
}

#message {
    width: 250px;
    height: 100px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-md);
    background: linear-gradient(180deg, rgba(10, 47, 95, 0.96), rgba(11, 30, 59, 0.98));
    margin: auto;
    position: relative;
}

#message-text {
    text-align: center;
    padding: 10px;
}

#message-buttons {
    text-align: center;
    margin-top: 25px;
    position: absolute;
    bottom: 10px;
    width: 100%;
}

.message-button {
    display: inline-block;
    padding: 4px 10px 5px;
    margin: 0 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.24);
    cursor: pointer;
}

#playtestPanel {
    z-index: 55;
}

.playtest-log-entry {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
    word-break: break-word;
}

.playtest-log-entry.character {
    background: rgba(255, 255, 255, 0.04);
}

.playtest-log-entry.action {
    background: rgba(110, 168, 254, 0.08);
    border-color: rgba(110, 168, 254, 0.2);
    color: #dceaff;
}

.playtest-log-entry.system {
    background: rgba(244, 184, 96, 0.1);
    border-color: rgba(244, 184, 96, 0.24);
    color: #ffe3b1;
    font-style: italic;
}

.playtest-speaker {
    display: inline-block;
    margin-right: 6px;
    font-weight: 800;
    color: var(--text);
}

.playtest-text {
    color: inherit;
}

#playtestLog {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 320px;
    max-height: 48vh;
    overflow: auto;
    padding-right: 4px;
}

#playtestLog::-webkit-scrollbar {
    width: 10px;
}

#playtestLog::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 999px;
}

.playtest-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.playtest-option-btn {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.playtest-option-btn.is-visited>span {
    color: #5d5c5c;
}

.playtest-option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(110, 168, 254, 0.4);
    transform: translateY(-1px);
}

.playtest-option-btn:disabled,
.playtest-option-btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playtest-option-main {
    display: block;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.playtest-option-meta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-word;
}

.playtest-empty {
    display: grid;
    place-items: center;
    min-height: 80px;
    text-align: center;
    color: var(--text-muted);
    padding: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.02);
}

#playtestOptions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#marqueeSelection {
    position: absolute;
    z-index: 70;
    outline: 2px dashed rgba(110, 168, 254, 0.9);
    background: rgba(110, 168, 254, 0.16);
    box-shadow: 0 0 0 1px rgba(110, 168, 254, 0.14);
    pointer-events: none;
    border-radius: 10px;
}

#controlScheme .key {
    background: rgba(96, 92, 92, 0.57);
    border-radius: 5px;
    padding: 2px 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    margin-right: 8px;
}

#controlScheme .key:not(.modifier) {
    background: rgba(255, 95, 0, 0.35);
}

#controlScheme .key.mouse {
    background: rgba(71, 90, 233, 0.35);
}

#controlScheme .entry-description {
    display: block;
    margin-top: 10px;
}

#controlScheme .playtest-log-entry {
    padding-top: 15px;
}

.node.is-multi-selected .node-body {
    outline: 3px dashed rgba(110, 168, 254, 0.9);
}

#ogre-root {
    width: 265px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin: 8px 0 8px 0;
}

.ogre-hand {
    background-image: url(images/ogre/hand_2.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 70px;
    height: 60px;
    display: inline-block;
}

#left-hand.ogre-hand {
    scale: -1 1;
    animation: float_hand 5s ease-in-out infinite;
}

#right-hand.ogre-hand {
    animation: float_hand 4.5s ease-in-out infinite;
}

#ogre-mouth {
    width: 70px;
    height: 54px;
    position: relative;
}

#ogre-mouth>div {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    width: 70px;
    height: 35px;
    position: absolute;
    left: 0;
    filter: drop-shadow(0 6px 5px rgba(0, 0, 0, 0.6));
}

#ogre-mouth>#mouth-top {
    background-image: url(images/ogre/mouth_top.png);
    top: 0;
    position: absolute;
    animation: float_mouth_top 3s ease-in-out infinite;
}

#ogre-mouth>#mouth-bottom {
    background-image: url(images/ogre/mouth_bottom.png);
    bottom: 0;
    position: absolute;
    animation: float_mouth_bottom 3s ease-in-out infinite;
}

#ogre-title {
    background-image: url(images/ogre/title.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 180px;
    height: 47px;
    filter: drop-shadow(0 6px 5px rgba(0,0,0,0.8)) brightness(1.1);
    margin: 0 0 -12px 24px;
}

#ogre-description {
    font-family: "Comfortaa", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    font-size: 14px;
    color: #b0bae2;
    margin: 0px auto 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(176, 186, 226, 0.05);
}

.green {
    color: #119d90;
}

#ogre-version {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    text-align: center;
    padding: 10px 0 13px;
    display: block;
    position: absolute;
    top: 6px;
    left: 222px;
}

#info-credentials {
    justify-content: center;
    align-items: end;
    gap: 5px;
}

.toolbar-section.square {
    padding: 3px 3px;
}

#cursor-preview {
    width: 22px;
    height: 22px;
    background-image: url(images/ui/cursors/cursor_arrow.png);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
    margin-right: -6px;
}

#cursor-preview.select {
    background-image: url(images/ui/cursors/cursor_select.png);
    background-size: 22px;
}

#cursor-preview.zoom {
    background-image: url(images/ui/cursors/cursor_zoom.png);
    background-size: 20px;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes float_hand {
    0% {
        transform: translateY(10px) rotate(5deg);
    }

    50% {
        transform: translateY(-10px) rotate(-5deg);
    }

    100% {
        transform: translateY(10px) rotate(5deg);
    }
}

@keyframes float_mouth_top {
    0% {
        transform: translateY(3px);
    }

    50% {
        transform: translateY(0px);
    }

    100% {
        transform: translateY(3px);
    }
}

@keyframes float_mouth_bottom {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(3px);
    }

    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 1280px) {
    :root {
        --panel-w: 300px;
        --node-w: 220px;
    }
}

@media (max-width: 960px) {
    .overlay-panel {
        top: auto;
        bottom: 12px;
        width: calc(50% - 18px);
        max-height: 52vh;
    }

    .overlay-panel.left {
        left: 12px;
    }

    .overlay-panel.right {
        right: 12px;
    }

    .top-status {
        top: 10px;
        max-width: calc(100% - 24px);
    }
}

@media (max-width: 720px) {
    .overlay-panel {
        width: calc(100% - 24px);
        max-height: 38vh;
    }

    .overlay-panel.left,
    .overlay-panel.right {
        left: 12px;
        right: 12px;
    }

    .overlay-panel.left {
        bottom: calc(38vh + 24px);
    }

    .overlay-panel.right {
        bottom: 12px;
    }

    .inline-fields {
        grid-template-columns: 1fr;
    }

    .node {
        width: min(240px, calc(100vw - 40px));
    }
}