body {
    margin: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#codex-container {
    width: 100vw;
    height: 100vh;
    cursor: grab;
}

#codex-container.dragging {
    cursor: grabbing;
}

.node circle {
    stroke: #fff;
    stroke-width: 2px;
}

circle {
    cursor: default;
}

.link {
    fill: none;
    stroke: #999;
    stroke-width: 1.5px;
}

.arrow {
    stroke: #999;
    fill: #999;
    stroke-width: 1.5px;
}

/* Popup styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.popup-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
    width: 80%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
}

.popup-title {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.popup-description {
    color: #666;
    line-height: 1.5;
}

.node-label {
    font-size: 12px;
    fill: #333;
    text-anchor: middle;
    pointer-events: none;
}

/* Звёздочка "*" внутри кружка */
.node-asterisk {
    font-size: 18px;
    font-weight: bold;
    fill: red;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.level-circle {
    pointer-events: none;
}

.rings-group path {
    pointer-events: none;
}

/* Стили для кругового текста */
.circular-text {
    dominant-baseline: middle;
    letter-spacing: 0.5px;
}

.circular-text text {
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: font-size 0.2s ease; /* Анимация для лучшей читаемости */
}

/* Для очень маленьких узлов */
.node[data-small="true"] .circular-text text {
    font-size: 8px !important;
}

.circular-text {
    dominant-baseline: middle;
}

.circular-text textPath {
    dominant-baseline: middle;
    letter-spacing: normal;
}