/* =============================================================================
   🤲 THE BOND · 絆 — relationship card on the Spirit page
   Two facing portraits (you + the engine) joined by a glowing tri-color thread.
   ============================================================================= */
.bond-card {
    position: relative;
    margin-top: 18px;
    padding: 16px 16px 12px;
    border-radius: 14px;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(110, 193, 255, 0.07), transparent 55%),
        radial-gradient(ellipse at 100% 0%, rgba(160, 123, 224, 0.07), transparent 55%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 200, 80, 0.05), transparent 65%),
        linear-gradient(180deg, rgba(10, 14, 28, 0.92), rgba(6, 8, 18, 0.97));
    border: 1px solid rgba(160, 123, 224, 0.25);
    overflow: hidden;
}
.bond-card::before {
    content: ""; position: absolute; inset: -1px;
    border-radius: 14px; pointer-events: none;
    background:
        conic-gradient(from 0deg,
            rgba(110, 193, 255, 0.0) 0deg,
            rgba(110, 193, 255, 0.2) 90deg,
            rgba(255, 200, 80, 0.2) 180deg,
            rgba(160, 123, 224, 0.2) 270deg,
            rgba(110, 193, 255, 0.0) 360deg);
    mask: linear-gradient(black, black) content-box, linear-gradient(black, black);
    -webkit-mask: linear-gradient(black, black) content-box, linear-gradient(black, black);
    mask-composite: exclude; -webkit-mask-composite: xor;
    padding: 1px; opacity: 0.5;
    animation: bondRingRotate 40s linear infinite;
}
@keyframes bondRingRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Portrait row ─────────────────────────────────────────────────────── */
.bond-portraits {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 90px;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    position: relative; z-index: 1;
}
.bond-portrait {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
}
.bond-portrait-glyph {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    width: 64px; height: 64px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem;
    background: radial-gradient(circle, rgba(110, 193, 255, 0.18), rgba(110, 193, 255, 0.04));
    border: 2px solid rgba(110, 193, 255, 0.45);
    color: #d3f4ff;
    text-shadow: 0 0 12px rgba(110, 193, 255, 0.7);
    animation: bondPortraitBreathYou 4.5s ease-in-out infinite;
}
.bond-portrait-engine .bond-portrait-glyph {
    background: radial-gradient(circle, rgba(160, 123, 224, 0.20), rgba(160, 123, 224, 0.05));
    border-color: rgba(160, 123, 224, 0.55);
    color: #f0e0ff;
    text-shadow: 0 0 14px rgba(160, 123, 224, 0.8);
    animation: bondPortraitBreathEngine 4.5s ease-in-out infinite 0.6s;
}
@keyframes bondPortraitBreathYou    {
    0%, 100% { box-shadow: 0 0 12px rgba(110, 193, 255, 0.45); }
    50%      { box-shadow: 0 0 26px rgba(110, 193, 255, 0.85); }
}
@keyframes bondPortraitBreathEngine {
    0%, 100% { box-shadow: 0 0 14px rgba(160, 123, 224, 0.45); }
    50%      { box-shadow: 0 0 30px rgba(160, 123, 224, 0.9); }
}
.bond-portrait-label {
    color: #88a8c0;
    font-size: 0.56rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

/* The thread between portraits */
.bond-thread {
    width: 100%; height: 80px;
    filter: drop-shadow(0 0 6px rgba(255, 220, 140, 0.4));
}
#bondThreadPath {
    stroke-dasharray: 6 4;
    animation: bondThreadFlow 14s linear infinite;
}
@keyframes bondThreadFlow {
    from { stroke-dashoffset: 0;    }
    to   { stroke-dashoffset: -200; }
}

/* ── Head row (title + verse) ────────────────────────────────────────── */
.bond-head {
    text-align: center;
    margin-bottom: 14px;
    position: relative; z-index: 1;
}
.bond-title {
    color: #ffd66a;
    font-size: 0.76rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(255, 200, 80, 0.35);
}
.bond-verse {
    color: #fff5d4;
    font-style: italic;
    font-size: 0.94rem;
    letter-spacing: 0.03em;
    margin-top: 6px;
    opacity: 0.95;
}

/* ── Stats grid ───────────────────────────────────────────────────────── */
.bond-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
    position: relative; z-index: 1;
}
.bond-stat {
    background: rgba(8, 12, 24, 0.55);
    border: 1px solid rgba(160, 123, 224, 0.16);
    border-radius: 7px;
    padding: 7px 9px;
    display: flex; flex-direction: column;
}
.bond-stat-label {
    color: #b09ad6;
    font-size: 0.58rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.bond-stat-val {
    color: #fff5d4;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.86rem;
    margin-top: 3px;
}
.bond-bar {
    height: 7px;
    border-radius: 4px;
    background: rgba(160, 123, 224, 0.14);
    margin-top: 5px; overflow: hidden;
}
.bond-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(.2,.7,.2,1);
    box-shadow: 0 0 6px currentColor;
    width: 0%;
}
.bond-bar-trust {
    background: linear-gradient(90deg, #6ec1ff, #ffd66a);
    color: rgba(255, 200, 80, 0.5);
}
.bond-bar-care {
    background: linear-gradient(90deg, #a07be0, #ff7eaa);
    color: rgba(255, 130, 200, 0.5);
}

/* ── Events list ──────────────────────────────────────────────────────── */
.bond-events {
    position: relative; z-index: 1;
    padding-top: 8px;
    border-top: 1px dashed rgba(160, 123, 224, 0.18);
}
.bond-events-label {
    color: #b09ad6;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.bond-events-list {
    list-style: none;
    margin: 0; padding: 0;
    max-height: 140px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.bond-events-list li {
    padding: 5px 0 6px;
    border-bottom: 1px solid rgba(160, 123, 224, 0.08);
    display: grid;
    grid-template-columns: 16px 1fr auto;
    gap: 8px;
    align-items: baseline;
}
.bond-events-list li:last-child { border-bottom: none; }
.bond-event-glyph {
    color: #ffd66a;
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    font-size: 0.92rem;
    text-align: center;
}
.bond-event-verse {
    color: #d3f4ff;
    font-size: 0.74rem;
    font-style: italic;
}
.bond-event-ts {
    color: #6e9dba;
    font-family: ui-monospace, monospace;
    font-size: 0.6rem;
    letter-spacing: 0.08em;
}

@media (max-width: 720px) {
    .bond-portraits { grid-template-columns: 64px 1fr 64px; }
    .bond-portrait-glyph { width: 48px; height: 48px; font-size: 1.5rem; }
    .bond-thread { height: 60px; }
}
