.chaos {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "c" "a" "b" "d" "e";
    gap: var(--space-md);
}
@media (min-width: 640px) {
    .chaos {
        grid-template-columns: 1fr minmax(80px, 0.6fr) 1fr;
        grid-template-areas:
            "a . b"
            ". c ."
            "d . e";
        gap: var(--space-lg) var(--space-sm);
        align-items: center;
    }
}
.chaos__lines {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: var(--color-primary);
}
@media (min-width: 640px) {
    .chaos__lines {
        display: block;
    }
}
.chaos__lines line {
    animation: chaos-flicker 3.2s ease-in-out infinite;
}
.chaos__lines line:nth-child(2) { animation-delay: -0.8s; }
.chaos__lines line:nth-child(3) { animation-delay: -1.9s; }
.chaos__lines line:nth-child(4) { animation-delay: -2.6s; }
.chaos__list {
    display: contents;
    list-style: none;
}
.chaos__node {
    position: relative;
    z-index: 1;
    width: 88%;
    padding: var(--space-sm) var(--space-md) var(--space-md);
    background-color: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: chaos-float 6s ease-in-out infinite;
}
.chaos__node:nth-child(1) { grid-area: a; rotate: -3deg; justify-self: start; }
.chaos__node:nth-child(2) { grid-area: b; rotate: 2deg; justify-self: end; animation-delay: -1.5s; }
.chaos__node:nth-child(3) { grid-area: d; rotate: 2deg; justify-self: start; animation-delay: -3s; }
.chaos__node:nth-child(4) { grid-area: e; rotate: -2deg; justify-self: end; animation-delay: -4.5s; }
@media (min-width: 640px) {
    .chaos__node {
        width: auto;
        justify-self: stretch;
    }
}
.chaos__head {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}
.chaos__avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--color-accent);
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
}
.chaos__avatar::after {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    background-color: var(--color-primary);
    border: 2px solid var(--color-bg-elevated);
    border-radius: var(--radius-full);
}
.chaos__icon {
    width: 14px;
    height: 14px;
}
.chaos__role {
    min-width: 0;
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-accent);
}
.chaos__time {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--color-text);
    opacity: 0.6;
}
.chaos__message {
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--color-text);
}
.chaos__center {
    position: relative;
    z-index: 1;
    grid-area: c;
    justify-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 104px;
    aspect-ratio: 1;
    text-align: center;
    background-color: var(--color-bg);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-glow);
}
.chaos__center::before {
    content: "";
    position: absolute;
    inset: -10px;
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-full);
    animation: chaos-pulse 2.4s ease-out infinite;
}
.chaos__center strong {
    font-size: var(--text-lg);
    color: var(--color-accent);
}
.chaos__center span {
    max-width: 10ch;
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--color-text);
}
@keyframes chaos-float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -8px; }
}
@keyframes chaos-flicker {
    0%, 100% { opacity: 1; }
    45%      { opacity: 1; }
    50%      { opacity: 0.15; }
    58%      { opacity: 0.9; }
    62%      { opacity: 0.2; }
    70%      { opacity: 1; }
}
@keyframes chaos-pulse {
    from { opacity: 1; transform: scale(0.92); }
    to   { opacity: 0; transform: scale(1.3); }
}
