/* =============================================================================
   🏛 ARENA ARBITRATION STRIP — "擁護者's Read" (Yōgosha)
   The MuZero brain's verdict on which of the 4 Arena spirits to back next.
   Sits between the countdown and the hero strip on the Arena page.
   ============================================================================= */
.arena-arbitration {
    position: relative;
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(120, 220, 255, 0.08), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(255, 200, 80, 0.06), transparent 60%),
        linear-gradient(180deg, rgba(10, 18, 32, 0.94), rgba(6, 10, 22, 0.97));
    border: 1px solid rgba(120, 220, 255, 0.22);
    overflow: hidden;
}
.arena-arbitration::before {
    content: ""; position: absolute; inset: 0;
    pointer-events: none;
    background:
        repeating-linear-gradient(45deg, rgba(120, 220, 255, 0.03) 0 2px, transparent 2px 24px);
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

/* When MuZero overrules the leaderboard #1, the whole strip warms */
.arena-arbitration[data-flip="true"] {
    border-color: rgba(255, 200, 80, 0.45);
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255, 200, 80, 0.10), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(255, 130, 60, 0.08), transparent 60%),
        linear-gradient(180deg, rgba(28, 18, 8, 0.94), rgba(14, 8, 4, 0.97));
}

.aa-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 14px;
    align-items: center;
    position: relative;
    z-index: 1;
}
@media (max-width: 820px) {
    .aa-head { grid-template-columns: 1fr; }
}

.aa-title-wrap {
    display: flex; align-items: center; gap: 12px;
    min-width: 0;
}
.aa-title-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(120, 220, 255, 0.55));
}
.aa-title-crest {
    width: 30px; height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(120, 220, 255, 0.55));
    flex-shrink: 0;
}
.aa-title {
    color: #a0d8f0;
    font-size: 0.82rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(120, 220, 255, 0.35);
}
.arena-arbitration[data-flip="true"] .aa-title {
    color: #ffd66a;
    text-shadow: 0 0 12px rgba(255, 200, 80, 0.5);
}
.aa-subtitle {
    color: #88a8c0; font-size: 0.7rem; margin-top: 2px;
    letter-spacing: 0.04em;
    min-height: 1em;
}

/* Verdict card on the right */
.aa-verdict-card {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 14px;
    background: rgba(8, 14, 26, 0.55);
    border: 1px solid rgba(120, 220, 255, 0.32);
    border-radius: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.arena-arbitration[data-flip="true"] .aa-verdict-card {
    border-color: rgba(255, 200, 80, 0.5);
    box-shadow: 0 0 16px rgba(255, 200, 80, 0.25);
}
.aa-verdict-kanji {
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    font-size: 2.4rem;
    color: #ffd66a;
    text-shadow:
        0 0 10px rgba(255, 200, 80, 0.7),
        0 0 24px rgba(255, 180, 60, 0.35);
    line-height: 1;
    transition: color 0.3s ease;
}
.aa-verdict-text { display: flex; flex-direction: column; gap: 1px; }
.aa-verdict-label {
    color: #6e9dba;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.aa-verdict-name {
    color: #fff5d4;
    font-size: 1.04rem;
    letter-spacing: 0.06em;
}
.aa-verdict-conf {
    color: #b09ad6;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.72rem;
}

/* Flip badge — appears only when brain overrules leaderboard */
.aa-flip-badge {
    align-self: center;
    padding: 6px 12px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(255, 180, 60, 0.18), rgba(255, 80, 80, 0.18));
    border: 1px solid rgba(255, 180, 60, 0.45);
    color: #ffd66a;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(255, 180, 60, 0.3);
    animation: aaFlipPulse 2.6s ease-in-out infinite;
}
@keyframes aaFlipPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 180, 60, 0.25); }
    50%      { box-shadow: 0 0 22px rgba(255, 200, 80, 0.55); }
}

/* The 4 affinity bars */
.aa-bars {
    margin-top: 12px;
    display: grid;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.aa-bar {
    display: grid;
    grid-template-columns: 32px minmax(110px, max-content) 1fr 56px;
    align-items: center;
    gap: 10px;
}
.aa-bar-kanji {
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    color: #a07be0;
    font-size: 1.1rem;
    text-align: center;
    transition: color 0.4s ease, text-shadow 0.4s ease;
}
.aa-bar-name {
    color: #88a8c0;
    font-size: 0.74rem;
    letter-spacing: 0.08em;
}
.aa-bar-wrap {
    position: relative;
    height: 8px;
    background: rgba(80, 100, 140, 0.18);
    border-radius: 4px;
    overflow: hidden;
}
.aa-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a8fff, #38d9ff);
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(.2,.7,.2,1), background 0.4s ease;
    box-shadow: 0 0 6px rgba(80, 200, 255, 0.35);
}
.aa-bar-val {
    color: #d3e8f4;
    font-family: ui-monospace, monospace;
    font-size: 0.74rem;
    text-align: right;
}
/* The chosen-verdict bar burns gold */
.aa-bar.is-verdict .aa-bar-fill {
    background: linear-gradient(90deg, #ffd66a, #ff8a3d);
    box-shadow: 0 0 14px rgba(255, 200, 80, 0.55);
}
.aa-bar.is-verdict .aa-bar-kanji {
    color: #ffd66a;
    text-shadow: 0 0 8px rgba(255, 200, 80, 0.7);
}
.aa-bar.is-verdict .aa-bar-name {
    color: #fff5d4;
}
.aa-bar.is-verdict .aa-bar-val {
    color: #fff5d4;
}

@media (max-width: 720px) {
    .aa-bar { grid-template-columns: 28px 88px 1fr 48px; gap: 8px; }
    .aa-verdict-card { padding: 6px 10px; }
    .aa-verdict-kanji { font-size: 1.8rem; }
}

/* ═════════════════════════════════════════════════════════════════════════
   🜂 DUAL PIPELINE — A vs B side-by-side with FSI ring in the middle
   ════════════════════════════════════════════════════════════════════════ */
.arena-dualpipe {
    position: relative;
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(120, 220, 255, 0.07), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(255, 200, 80, 0.05), transparent 60%),
        linear-gradient(180deg, rgba(10, 18, 32, 0.94), rgba(6, 10, 22, 0.97));
    border: 1px solid rgba(120, 220, 255, 0.22);
    overflow: hidden;
}
.arena-dualpipe::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        repeating-linear-gradient(135deg, rgba(120, 220, 255, 0.025) 0 2px, transparent 2px 28px);
    mask-image: radial-gradient(ellipse at center, black 28%, transparent 80%);
}

/* When the brain and house diverge sharply, the panel warms */
.arena-dualpipe[data-divergence="strong"] {
    border-color: rgba(255, 130, 130, 0.45);
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255, 100, 100, 0.07), transparent 55%),
        linear-gradient(180deg, rgba(28, 12, 12, 0.94), rgba(14, 6, 6, 0.97));
}
.arena-dualpipe[data-divergence="mild"] {
    border-color: rgba(255, 200, 80, 0.36);
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255, 200, 80, 0.06), transparent 55%),
        linear-gradient(180deg, rgba(20, 16, 8, 0.94), rgba(12, 8, 4, 0.97));
}

.dp-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    position: relative; z-index: 1;
}
.dp-icon {
    font-size: 1.4rem;
    filter: drop-shadow(0 0 8px rgba(120, 220, 255, 0.5));
}
.dp-title {
    color: #a0d8f0;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(120, 220, 255, 0.35);
}
.dp-subtitle {
    color: #88a8c0;
    font-size: 0.7rem;
    margin-top: 2px;
    font-style: italic;
    min-height: 1em;
}
.dp-cycle-pill {
    padding: 4px 12px;
    border-radius: 12px;
    background: rgba(120, 220, 255, 0.1);
    border: 1px solid rgba(120, 220, 255, 0.28);
    display: flex; align-items: baseline; gap: 6px;
}
.dp-cycle-label {
    color: #6e9dba;
    font-size: 0.58rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.dp-cycle-num {
    color: #fff5d4;
    font-family: ui-monospace, monospace;
    font-size: 0.86rem;
}

/* Three-column grid: A | FSI | B */
.dp-grid {
    display: grid;
    grid-template-columns: 1fr 200px 1fr;
    gap: 14px;
    align-items: stretch;
    position: relative; z-index: 1;
}
@media (max-width: 900px) {
    .dp-grid { grid-template-columns: 1fr; }
    .dp-fsi { order: -1; }
}

.dp-side {
    background: rgba(8, 14, 26, 0.55);
    border: 1px solid rgba(120, 220, 255, 0.18);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex; flex-direction: column;
    transition: border-color 0.4s ease, background 0.4s ease;
}
.dp-side-a { border-color: rgba(110, 193, 255, 0.32); }
.dp-side-b { border-color: rgba(255, 200, 80, 0.32); }
.arena-dualpipe[data-divergence="strong"] .dp-side-b {
    border-color: rgba(255, 100, 100, 0.45);
}

.dp-side-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 4px;
}
.dp-side-tag {
    color: #88a8c0;
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.dp-side-b .dp-side-tag { color: #ffd66a; }
.dp-side-spirit { display: flex; align-items: baseline; gap: 6px; }
.dp-spirit-kanji {
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    color: #6ec1ff;
    font-size: 1.4rem;
    text-shadow: 0 0 8px rgba(120, 220, 255, 0.5);
}
.dp-side-b .dp-spirit-kanji {
    color: #ffd66a;
    text-shadow: 0 0 10px rgba(255, 200, 80, 0.6);
}
.dp-spirit-name {
    color: #d3f4ff;
    font-size: 0.84rem;
    letter-spacing: 0.04em;
}
.dp-side-b .dp-spirit-name { color: #fff5d4; }
.dp-side-sub {
    color: #5d7c92;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    font-style: italic;
}

/* Ball chips */
.dp-balls {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: auto;
}
.dp-ball {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #d3f4ff;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(120, 220, 255, 0.1);
    border: 1px solid rgba(120, 220, 255, 0.32);
    transition: all 0.4s ease;
}
.dp-side-b .dp-ball {
    background: rgba(255, 200, 80, 0.1);
    border-color: rgba(255, 200, 80, 0.32);
    color: #fff5d4;
}
/* Balls that appear in BOTH pipelines glow gold */
.dp-ball.is-shared {
    background: linear-gradient(135deg, rgba(110, 193, 255, 0.25), rgba(255, 200, 80, 0.25));
    border-color: rgba(255, 220, 140, 0.7);
    color: #fff5d4;
    box-shadow: 0 0 10px rgba(255, 200, 80, 0.4);
}
/* Balls unique to that side stay tinted to that side's colour */
.dp-side-a .dp-ball.is-unique { background: rgba(110, 193, 255, 0.16); }
.dp-side-b .dp-ball.is-unique { background: rgba(255, 130, 130, 0.16); border-color: rgba(255, 130, 130, 0.45); }

/* FSI middle column */
.dp-fsi {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(8, 14, 26, 0.45);
    border: 1px solid rgba(255, 220, 140, 0.22);
    border-radius: 10px;
}
.dp-fsi-ring-wrap {
    position: relative;
    width: 110px; height: 110px;
    display: inline-flex; align-items: center; justify-content: center;
}
.dp-fsi-ring {
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}
.dp-fsi-ring-bg {
    fill: none; stroke: rgba(120, 220, 255, 0.16); stroke-width: 5;
}
.dp-fsi-ring-fill {
    fill: none; stroke: #ffd66a; stroke-width: 5; stroke-linecap: round;
    transition: stroke-dashoffset 0.7s ease, stroke 0.7s ease;
    filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.55));
}
.dp-fsi-ring-text {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.dp-fsi-ring-val {
    color: #fff5d4;
    font-family: ui-monospace, monospace;
    font-size: 1.15rem;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 200, 80, 0.5);
}
.dp-fsi-ring-label {
    color: #b09ad6;
    font-size: 0.56rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: -2px;
}
.dp-fsi-metrics {
    display: flex; gap: 10px;
    width: 100%; justify-content: space-around;
}
.dp-fsi-metric {
    display: flex; flex-direction: column;
    align-items: center;
}
.dp-fsi-metric-label {
    color: #6e9dba;
    font-size: 0.56rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.dp-fsi-metric-val {
    color: #d3f4ff;
    font-family: ui-monospace, monospace;
    font-size: 0.84rem;
    margin-top: 2px;
}
.dp-divergence-badge {
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: rgba(110, 231, 164, 0.12);
    border: 1px solid rgba(110, 231, 164, 0.3);
    color: #6ee7a4;
}
.arena-dualpipe[data-divergence="mild"] .dp-divergence-badge {
    background: rgba(255, 200, 80, 0.14);
    border-color: rgba(255, 200, 80, 0.4);
    color: #ffd66a;
}
.arena-dualpipe[data-divergence="strong"] .dp-divergence-badge {
    background: rgba(255, 130, 130, 0.16);
    border-color: rgba(255, 130, 130, 0.4);
    color: #ff9a9a;
    animation: dpDivergencePulse 2.2s ease-in-out infinite;
}
@keyframes dpDivergencePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 130, 130, 0.3); }
    50%      { box-shadow: 0 0 18px rgba(255, 130, 130, 0.7); }
}
