/* nodecluster.css — colony hex alphabet + node orb views */

/* ── Hex alphabet field ── */
.hex-field {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 2vw;
    width: 100%;
}

.hex-letter {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(255,255,255,0.78);
    text-decoration: none;
    flex-shrink: 0;
    animation: hexFloat var(--hdur) ease-in-out infinite;
    animation-delay: var(--hdelay);
    transition: filter 0.3s ease, background 0.3s ease;
}

.hex-letter::before {
    content: '';
    position: absolute;
    inset: 3px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, rgba(0,127,255,0.06), rgba(0,200,255,0.1));
}

.hex-letter.has-nodes {
    background: rgba(220,238,255,0.88);
    cursor: crosshair;
}

.hex-letter.has-nodes::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: radial-gradient(circle at 50% 40%, rgba(0,180,255,0.18) 0%, transparent 70%);
    animation: coreFlicker var(--cdur) ease-in-out infinite;
    animation-delay: var(--hdelay);
}

.hex-letter.has-nodes:hover {
    filter: drop-shadow(0 0 12px rgba(0,127,255,0.5));
    background: rgba(200,230,255,0.95);
    z-index: 10;
}

.hex-letter.empty {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.hex-glyph {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: #1a2a4a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
    pointer-events: none;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,127,255,0.15);
}

.hex-letter.empty .hex-glyph {
    color: rgba(30,60,120,0.35);
}

.hex-count {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.38rem;
    color: rgba(0,127,255,0.6);
    letter-spacing: 0.1em;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
}

/* ── Node orb field ── */
.node-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 2vw;
    overflow-y: auto;
}

.node-field-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

.node-back {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: rgba(0,127,255,0.7);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    cursor: crosshair;
    text-decoration: none;
}

.node-back:hover { color: #2a7fff; }

.node-field-letter {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 5rem);
    color: #1a2a4a;
    letter-spacing: 0.15em;
    line-height: 1;
    text-shadow: 0 2px 20px rgba(0,127,255,0.15);
}

.node-orbs {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex: 1;
}

.node-orb {
    position: relative;
    border-radius: 50%;
    background: rgba(220,238,255,0.88);
    border: 1px solid rgba(80,160,255,0.45);
    box-shadow:
        0 0 18px rgba(80,160,255,0.22),
        0 4px 14px rgba(0,0,0,0.07),
        inset 0 1px 0 rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
    text-decoration: none;
    flex-shrink: 0;
    animation: orbFloat var(--odur) ease-in-out infinite;
    animation-delay: var(--odelay);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.node-orb::before {
    content: '';
    position: absolute;
    inset: 25%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,180,255,0.25) 0%, transparent 100%);
    animation: coreFlicker var(--ocdur) ease-in-out infinite;
    animation-delay: var(--odelay);
}

.node-orb:hover {
    border-color: rgba(0,127,255,0.8);
    box-shadow:
        0 0 30px rgba(0,127,255,0.4),
        0 6px 20px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.95);
    z-index: 10;
}

.node-orb-label {
    font-family: 'Share Tech Mono', monospace;
    color: #1a2a4a;
    text-align: center;
    padding: 0 8px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
    pointer-events: none;
    word-break: break-word;
    max-width: 90%;
}

/* ── Pagination ── */
.node-pages {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
}

.node-pages a {
    color: rgba(0,127,255,0.7);
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border: 1px solid rgba(0,127,255,0.15);
    transition: all 0.2s ease;
    cursor: crosshair;
}

.node-pages a:hover {
    background: rgba(0,127,255,0.07);
    border-color: rgba(0,127,255,0.4);
    color: #2a7fff;
}

.node-pages .pg-active {
    color: #1a2a4a;
    border-color: rgba(0,127,255,0.4);
    border-bottom-color: #2a7fff;
}

.colony-error {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: rgba(0,127,255,0.5);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    padding: 2rem;
}

/* ── Animations ── */
@keyframes hexFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    25%     { transform: translate(var(--hfx1), var(--hfy1)) scale(1.02); }
    60%     { transform: translate(var(--hfx2), var(--hfy2)) scale(0.98); }
}

@keyframes orbFloat {
    0%,100% { transform: translate(0,0) scale(1); }
    30%     { transform: translate(var(--ofx1), var(--ofy1)) scale(1.03); }
    65%     { transform: translate(var(--ofx2), var(--ofy2)) scale(0.97); }
}

@keyframes coreFlicker {
    0%,100% { opacity: 0.4; }
    50%     { opacity: 1; }
}