/* =============================================================================
   🧠 BRAIN SCAN · 脳波 — live MuZero-Seidanga debug panel
   Polls /api/muzero/debug, renders policy histogram + value/reward sparklines
   + loss breakdown + latent-z0 fingerprint.  Spirit page panel.
   ============================================================================= */

.panel-brain-scan {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(120, 220, 255, 0.18);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(80, 200, 255, 0.08), transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(160, 120, 255, 0.06), transparent 60%),
        linear-gradient(180deg, rgba(8, 14, 26, 0.92), rgba(4, 8, 16, 0.96));
}
.panel-brain-scan::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(0deg,  rgba(120, 220, 255, 0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(120, 220, 255, 0.03) 0 1px, transparent 1px 28px);
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 35%, transparent 85%);
}

/* ── Vitals row ─────────────────────────────────────────────────────────── */
.bs-vitals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 8px 0 14px;
    position: relative;
}
.bs-chip {
    background: linear-gradient(180deg, rgba(120, 220, 255, 0.08), rgba(80, 160, 220, 0.04));
    border: 1px solid rgba(120, 220, 255, 0.22);
    border-radius: 8px;
    padding: 8px 10px;
}
.bs-chip-label {
    color: #6fb5d4;
    font-size: 0.65rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.bs-chip-value {
    color: #d3f4ff;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 1.05rem;
    margin-top: 2px;
}
.bs-buf-wrap {
    height: 6px; border-radius: 6px;
    background: rgba(120, 220, 255, 0.08);
    overflow: hidden; margin-top: 6px;
}
.bs-buf-fill {
    height: 100%;
    background: linear-gradient(90deg, #38d9ff, #a47bff);
    box-shadow: 0 0 12px rgba(80, 200, 255, 0.6);
    transition: width 0.5s ease;
}

/* ── Two-column grid: policy histogram + sparklines ─────────────────────── */
.bs-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 14px;
    position: relative;
}
@media (max-width: 920px) { .bs-grid { grid-template-columns: 1fr; } }

.bs-card {
    background: rgba(8, 16, 28, 0.55);
    border: 1px solid rgba(120, 220, 255, 0.14);
    border-radius: 10px;
    padding: 10px 12px;
}
.bs-card-title {
    color: #a0d8f0;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex; align-items: center; justify-content: space-between;
}
.bs-card-title-sub {
    color: #5d7c92; font-size: 0.62rem; letter-spacing: 0.1em;
}

/* ── Policy histogram (8 vertical bars) ─────────────────────────────────── */
.bs-policy {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    align-items: end;
    height: 140px;
    padding-bottom: 4px;
}
.bs-policy-bar {
    position: relative;
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    height: 100%;
}
.bs-policy-bar-fill {
    width: 70%;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #38d9ff, #5a8fff);
    box-shadow: 0 0 8px rgba(80, 200, 255, 0.4);
    transition: height 0.4s ease, background 0.3s ease;
    min-height: 2px;
}
.bs-policy-bar.is-chosen .bs-policy-bar-fill {
    background: linear-gradient(180deg, #ffd66a, #ff8a3d);
    box-shadow: 0 0 14px rgba(255, 180, 60, 0.7);
}
.bs-policy-bar-pct {
    color: #d3f4ff; font-size: 0.62rem;
    font-family: ui-monospace, monospace;
    margin-bottom: 2px;
}
.bs-policy-labels {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin-top: 6px;
}
.bs-policy-label {
    color: #6e9dba; font-size: 0.58rem;
    font-family: ui-monospace, monospace;
    text-align: center;
    line-height: 1.1;
    word-break: break-word;
}
.bs-policy-bar.is-chosen + .bs-policy-label,
.bs-policy-bar.is-chosen .bs-policy-label { color: #ffd66a; }

/* ── Sparkline column ───────────────────────────────────────────────────── */
.bs-spark-col { display: flex; flex-direction: column; gap: 10px; }
.bs-spark-cell { background: rgba(8, 16, 28, 0.55);
    border: 1px solid rgba(120, 220, 255, 0.14);
    border-radius: 10px; padding: 8px 10px; }
.bs-spark-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 4px;
}
.bs-spark-label {
    color: #a0d8f0; font-size: 0.68rem;
    letter-spacing: 0.14em; text-transform: uppercase;
}
.bs-spark-val {
    color: #fff; font-family: ui-monospace, monospace;
    font-size: 1rem;
}
.bs-spark-canvas { width: 100%; height: 44px; display: block; }

.bs-spark-cell-council {
    border-color: rgba(255, 200, 80, 0.32);
    background:
        radial-gradient(ellipse at 0% 0%, rgba(255, 200, 80, 0.08), transparent 60%),
        rgba(8, 16, 28, 0.55);
}
.bs-spark-cell-council .bs-spark-label { color: #ffd66a; }
.bs-spark-cell-council .bs-spark-val   { color: #fff5d4; }

/* ── Loss breakdown chips ───────────────────────────────────────────────── */
.bs-loss-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 14px;
}
.bs-loss-chip {
    background: linear-gradient(180deg, rgba(160, 120, 255, 0.08), rgba(120, 80, 200, 0.04));
    border: 1px solid rgba(160, 120, 255, 0.22);
    border-radius: 8px;
    padding: 7px 8px;
    text-align: center;
}
.bs-loss-chip.is-total { border-color: rgba(255, 200, 80, 0.36); }
.bs-loss-chip-label {
    color: #b09ad6; font-size: 0.6rem;
    letter-spacing: 0.16em; text-transform: uppercase;
}
.bs-loss-chip-value {
    color: #fff; font-family: ui-monospace, monospace;
    font-size: 0.92rem;
    margin-top: 2px;
}
.bs-loss-chip.is-total .bs-loss-chip-value { color: #ffd66a; }

@media (max-width: 720px) {
    .bs-loss-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── Latent z0 fingerprint strip ────────────────────────────────────────── */
.bs-latent-wrap { margin-top: 14px; }
.bs-latent-strip {
    display: grid;
    grid-template-columns: repeat(64, 1fr);
    gap: 1px;
    height: 22px;
    border-radius: 4px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(120, 220, 255, 0.14);
}
.bs-latent-cell {
    transition: background 0.5s ease;
}
@media (max-width: 720px) {
    .bs-latent-strip { grid-template-columns: repeat(32, 1fr); height: 18px; }
}

/* ── Actions row ────────────────────────────────────────────────────────── */
.bs-actions {
    display: flex; gap: 10px; margin-top: 14px;
    flex-wrap: wrap; align-items: center;
}
.bs-btn {
    background: linear-gradient(180deg, rgba(80, 200, 255, 0.18), rgba(60, 140, 220, 0.1));
    border: 1px solid rgba(120, 220, 255, 0.36);
    color: #d3f4ff;
    font-family: ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.bs-btn:hover {
    background: linear-gradient(180deg, rgba(80, 200, 255, 0.3), rgba(60, 140, 220, 0.18));
    box-shadow: 0 0 12px rgba(80, 200, 255, 0.4);
}
.bs-btn.is-busy { opacity: 0.55; pointer-events: none; }
.bs-status {
    color: #6e9dba; font-size: 0.7rem;
    font-family: ui-monospace, monospace;
    margin-left: auto;
}
.bs-status.is-ok    { color: #6ee7a4; }
.bs-status.is-warn  { color: #ffb86a; }
.bs-status.is-error { color: #ff7e7e; }

/* ── Empty/loading states ───────────────────────────────────────────────── */
.bs-empty {
    color: #5d7c92; font-style: italic;
    text-align: center; padding: 24px 12px;
    font-size: 0.84rem;
}

/* ═════════════════════════════════════════════════════════════════════════
   🜂 COUNCIL DISTILLATION — 13聲, the 天使's signature
   ════════════════════════════════════════════════════════════════════════ */
.bs-council {
    margin-top: 18px;
    padding: 14px 14px 12px;
    border-radius: 12px;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 200, 80, 0.06), transparent 60%),
        linear-gradient(180deg, rgba(20, 10, 40, 0.65), rgba(8, 4, 24, 0.85));
    border: 1px solid rgba(255, 200, 80, 0.22);
    position: relative;
    overflow: hidden;
}
.bs-council::before {
    content: ""; position: absolute; inset: -2px;
    border-radius: 12px; pointer-events: none;
    background:
        conic-gradient(from 0deg,
            rgba(255, 200, 80, 0.0) 0deg, rgba(255, 200, 80, 0.18) 90deg,
            rgba(160, 120, 255, 0.18) 180deg, rgba(80, 200, 255, 0.18) 270deg,
            rgba(255, 200, 80, 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.55;
    animation: bsCouncilRotate 28s linear infinite;
}
@keyframes bsCouncilRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.bs-council-head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px; margin-bottom: 12px; position: relative; z-index: 1;
}
.bs-council-title {
    color: #ffd66a; font-size: 0.86rem;
    letter-spacing: 0.18em; text-transform: uppercase;
    text-shadow: 0 0 14px rgba(255, 200, 80, 0.4);
}
.bs-council-sub {
    display: block;
    color: #b09ad6; font-size: 0.64rem; letter-spacing: 0.06em;
    margin-top: 3px;
}

/* Unison ring + 天使 sigil */
.bs-council-unison-wrap {
    display: flex; align-items: center; gap: 10px;
    position: relative;
}
.bs-council-unison-label {
    color: #a0d8f0; font-size: 0.6rem;
    letter-spacing: 0.18em; text-transform: uppercase;
    writing-mode: vertical-rl; transform: rotate(180deg);
}
.bs-council-unison-ring {
    position: relative; width: 60px; height: 60px;
    display: inline-flex; align-items: center; justify-content: center;
}
.bs-council-unison-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.bs-council-ring-bg {
    fill: none; stroke: rgba(120, 120, 200, 0.18); stroke-width: 4;
}
.bs-council-ring-fill {
    fill: none; stroke: url(#bsCouncilGrad);
    stroke: #ffd66a;
    stroke-width: 4; stroke-linecap: round;
    transition: stroke-dashoffset 0.6s ease, stroke 0.6s ease;
    filter: drop-shadow(0 0 4px rgba(255, 200, 80, 0.5));
}
.bs-council-unison-val {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #ffd66a; font-family: ui-monospace, monospace;
    font-size: 0.78rem; font-weight: 700;
}
.bs-council.is-unison .bs-council-ring-fill { stroke: #fff5d4; filter: drop-shadow(0 0 14px rgba(255, 230, 140, 0.95)); }
.bs-council.is-unison .bs-council-unison-val { color: #fff5d4; text-shadow: 0 0 8px rgba(255, 220, 120, 0.6); }

/* 天使 sigil — the signature; bursts when council is in unison */
.bs-tenshi-sigil {
    position: absolute;
    top: 50%; right: -68px;
    transform: translateY(-50%) scale(0.6);
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    color: #ffd66a;
    font-size: 1.3rem;
    letter-spacing: 0.06em;
    opacity: 0;
    pointer-events: none;
    text-shadow:
        0 0 8px rgba(255, 200, 80, 0.8),
        0 0 18px rgba(255, 180, 60, 0.45);
    transition: opacity 1.2s ease, transform 1.2s ease;
}
.bs-council.is-unison .bs-tenshi-sigil {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: bsTenshiBreath 3.6s ease-in-out infinite;
}
@keyframes bsTenshiBreath {
    0%, 100% { text-shadow: 0 0 8px rgba(255, 200, 80, 0.7), 0 0 18px rgba(255, 180, 60, 0.4); }
    50%      { text-shadow: 0 0 16px rgba(255, 220, 120, 1),  0 0 32px rgba(255, 200, 80, 0.7); }
}

/* 13-voice bar grid */
.bs-council-bars {
    display: grid;
    grid-template-columns: repeat(13, 1fr);
    gap: 4px;
    margin-bottom: 12px;
    position: relative; z-index: 1;
}
@media (max-width: 820px) { .bs-council-bars { grid-template-columns: repeat(7, 1fr); } }

.bs-council-voice {
    display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end;
    height: 96px;
    position: relative;
    cursor: help;
}
.bs-council-voice-kanji {
    color: #a07be0;
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    font-size: 0.95rem;
    margin-bottom: 3px;
    transition: color 0.4s ease, text-shadow 0.4s ease;
}
.bs-council-voice-bar-wrap {
    width: 78%;
    height: 56px;
    background: rgba(80, 60, 140, 0.16);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}
.bs-council-voice-bar {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(180deg, #ffd66a 0%, #ff8a3d 100%);
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
    min-height: 1px;
}
.bs-council-voice.is-off .bs-council-voice-bar {
    background: linear-gradient(180deg, #7a7a99 0%, #4a4a66 100%);
    opacity: 0.45;
}
.bs-council-voice.is-strong .bs-council-voice-kanji {
    color: #ffd66a;
    text-shadow: 0 0 8px rgba(255, 200, 80, 0.6);
}
.bs-council-voice.is-weak .bs-council-voice-kanji {
    color: #ff7e9e;
    text-shadow: 0 0 6px rgba(255, 100, 140, 0.3);
}
.bs-council-voice-label {
    color: #8a78b8;
    font-size: 0.52rem;
    letter-spacing: 0.04em;
    margin-top: 3px;
    text-align: center;
    line-height: 1.05;
    word-break: break-word;
}
.bs-council-voice-val {
    color: #d3c4ff;
    font-family: ui-monospace, monospace;
    font-size: 0.55rem;
    margin-top: 1px;
}

/* Teacher vs Brain prediction meter */
.bs-council-meter {
    margin-top: 4px;
    padding: 8px 10px;
    background: rgba(8, 4, 24, 0.55);
    border: 1px solid rgba(160, 120, 255, 0.22);
    border-radius: 8px;
    position: relative; z-index: 1;
}
.bs-cm-row {
    display: grid;
    grid-template-columns: 130px 1fr 70px;
    align-items: center;
    gap: 10px;
    margin: 5px 0;
}
.bs-cm-row-gap {
    grid-template-columns: 130px 1fr 70px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px dashed rgba(160, 120, 255, 0.18);
}
.bs-cm-label {
    color: #b09ad6;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.bs-cm-bar-wrap {
    position: relative; height: 8px;
    background: rgba(120, 100, 200, 0.12);
    border-radius: 4px; overflow: hidden;
}
.bs-cm-bar-wrap::after {
    content: ""; position: absolute;
    left: 50%; top: -2px; bottom: -2px; width: 1px;
    background: rgba(255, 255, 255, 0.18);
}
.bs-cm-bar {
    position: absolute; top: 0; bottom: 0;
    border-radius: 4px;
    transition: left 0.5s ease, width 0.5s ease, background 0.5s ease;
}
.bs-cm-bar-teacher { background: linear-gradient(90deg, #ffa86e, #ffd66a); }
.bs-cm-bar-model   { background: linear-gradient(90deg, #6ec1ff, #a07be0); }
.bs-cm-val {
    color: #fff; font-family: ui-monospace, monospace;
    font-size: 0.78rem; text-align: right;
}
.bs-cm-val-gap.is-tight { color: #6ee7a4; }
.bs-cm-val-gap.is-wide  { color: #ff9da9; }

/* ═════════════════════════════════════════════════════════════════════════
   🧠 AWAKENING PULSE + COUNCIL ALIGNMENT — 5-state stability detector
   States: ASLEEP / FORMING / STABILISING / AWAKE / RESTLESS
   Each state has its own colour palette + breathing rhythm.
   ════════════════════════════════════════════════════════════════════════ */
.bs-awakening {
    margin-top: 18px;
    padding: 14px 14px 12px;
    border-radius: 12px;
    border: 1px solid rgba(120, 220, 255, 0.18);
    background:
        radial-gradient(ellipse at 0% 0%, rgba(120, 220, 255, 0.06), transparent 55%),
        linear-gradient(180deg, rgba(8, 14, 26, 0.92), rgba(4, 8, 16, 0.96));
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    transition: border-color 0.8s ease, background 0.8s ease;
}

/* Ring wrap (left column) */
.bs-awakening-ring-wrap {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
}
.bs-awakening-ring {
    position: relative;
    width: 92px; height: 92px;
    border-radius: 50%;
    border: 3px solid currentColor;
    color: #5d7c92;        /* default colour, overridden per state */
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 24px currentColor;
    opacity: 0.6;
    transform: scale(1);
}
.bs-awakening-kanji {
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    font-size: 2.6rem;
    color: currentColor;
    text-shadow: 0 0 12px currentColor;
    line-height: 1;
}
.bs-awakening-state-label {
    color: currentColor;
    font-size: 0.62rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-family: ui-monospace, monospace;
    opacity: 0.85;
}

/* State 1: ASLEEP — slow, dim, indigo */
.bs-awakening[data-state="ASLEEP"] {
    border-color: rgba(120, 130, 180, 0.18);
}
.bs-awakening[data-state="ASLEEP"] .bs-awakening-ring,
.bs-awakening[data-state="ASLEEP"] .bs-awakening-state-label {
    color: #5d6f96;
    animation: bsAwSleep 4.5s ease-in-out infinite;
}
@keyframes bsAwSleep {
    0%, 100% { transform: scale(1.0);  opacity: 0.35; }
    50%      { transform: scale(1.03); opacity: 0.55; }
}

/* State 2: FORMING — quicker but tentative, blue */
.bs-awakening[data-state="FORMING"] {
    border-color: rgba(120, 200, 255, 0.28);
}
.bs-awakening[data-state="FORMING"] .bs-awakening-ring,
.bs-awakening[data-state="FORMING"] .bs-awakening-state-label {
    color: #6ec1ff;
    animation: bsAwForm 3.0s ease-in-out infinite;
}
@keyframes bsAwForm {
    0%, 100% { transform: scale(1.0);  opacity: 0.50; }
    50%      { transform: scale(1.05); opacity: 0.75; }
}

/* State 3: STABILISING — steady, brighter cyan */
.bs-awakening[data-state="STABILISING"] {
    border-color: rgba(80, 220, 220, 0.4);
}
.bs-awakening[data-state="STABILISING"] .bs-awakening-ring,
.bs-awakening[data-state="STABILISING"] .bs-awakening-state-label {
    color: #4ee0d0;
    animation: bsAwStabilise 2.0s ease-in-out infinite;
}
@keyframes bsAwStabilise {
    0%, 100% { transform: scale(1.0);  opacity: 0.65; }
    50%      { transform: scale(1.07); opacity: 0.9;  }
}

/* State 4: AWAKE — fast, bright, gold */
.bs-awakening[data-state="AWAKE"] {
    border-color: rgba(255, 200, 80, 0.55);
    background:
        radial-gradient(ellipse at 50% 50%, rgba(255, 200, 80, 0.10), transparent 55%),
        linear-gradient(180deg, rgba(28, 18, 8, 0.92), rgba(14, 8, 4, 0.96));
}
.bs-awakening[data-state="AWAKE"] .bs-awakening-ring,
.bs-awakening[data-state="AWAKE"] .bs-awakening-state-label {
    color: #ffd66a;
    animation: bsAwAwake 1.3s ease-in-out infinite;
}
@keyframes bsAwAwake {
    0%, 100% { transform: scale(1.0);  opacity: 0.85; box-shadow: 0 0 18px currentColor; }
    50%      { transform: scale(1.12); opacity: 1.0;  box-shadow: 0 0 36px currentColor; }
}

/* State 5: RESTLESS — irregular, magenta */
.bs-awakening[data-state="RESTLESS"] {
    border-color: rgba(255, 130, 200, 0.40);
}
.bs-awakening[data-state="RESTLESS"] .bs-awakening-ring,
.bs-awakening[data-state="RESTLESS"] .bs-awakening-state-label {
    color: #ff7eaa;
    animation: bsAwRestless 1.7s steps(8, end) infinite;
}
@keyframes bsAwRestless {
    0%   { transform: scale(1.00) rotate(0deg);   opacity: 0.6; }
    20%  { transform: scale(1.06) rotate(2deg);   opacity: 0.85; }
    40%  { transform: scale(0.97) rotate(-1deg);  opacity: 0.55; }
    60%  { transform: scale(1.04) rotate(1deg);   opacity: 0.8; }
    80%  { transform: scale(0.99) rotate(-2deg);  opacity: 0.6; }
    100% { transform: scale(1.00) rotate(0deg);   opacity: 0.6; }
}

/* Body (right column) */
.bs-awakening-body { min-width: 0; }
.bs-awakening-verse {
    color: #d3f4ff;
    font-style: italic;
    font-size: 0.86rem;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
    opacity: 0.95;
    transition: color 0.6s ease;
}
.bs-awakening[data-state="AWAKE"] .bs-awakening-verse { color: #fff5d4; }
.bs-awakening[data-state="RESTLESS"] .bs-awakening-verse { color: #ffd0e0; }

/* Chip grid */
.bs-awakening-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px;
}
.bs-aw-chip {
    background: rgba(8, 16, 28, 0.55);
    border: 1px solid rgba(120, 220, 255, 0.14);
    border-radius: 7px;
    padding: 6px 8px;
    position: relative;
}
.bs-aw-chip-label {
    color: #6fb5d4;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.bs-aw-chip-value {
    color: #d3f4ff;
    font-family: ui-monospace, monospace;
    font-size: 0.84rem;
    margin-top: 2px;
}
.bs-aw-chip-council {
    border-color: rgba(255, 200, 80, 0.32);
    grid-column: span 2;
}
.bs-aw-chip-council .bs-aw-chip-label { color: #ffd66a; }
.bs-aw-chip-council .bs-aw-chip-value { color: #fff5d4; }
.bs-aw-council-spark {
    width: 100%; height: 18px; display: block; margin-top: 4px;
}

@media (max-width: 720px) {
    .bs-awakening { grid-template-columns: 1fr; }
    .bs-awakening-ring-wrap { flex-direction: row; justify-content: flex-start; }
    .bs-aw-chip-council { grid-column: span 1; }
}

/* ═════════════════════════════════════════════════════════════════════════
   🜂 天使 COUNCIL CEREMONY — full-screen burst when unison ≥ threshold
   ════════════════════════════════════════════════════════════════════════ */
.tenshi-ceremony {
    position: fixed; inset: 0;
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.tenshi-ceremony.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.tc-backdrop {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(40, 28, 8, 0.96) 0%, rgba(4, 2, 8, 0.99) 70%);
    backdrop-filter: blur(6px);
}
.tc-stage {
    position: relative;
    width: min(86vw, 720px); height: min(86vh, 720px);
    display: flex; align-items: center; justify-content: center;
}
/* Golden rays radiating from the centre */
.tc-rays {
    position: absolute; inset: 0;
    background:
        conic-gradient(from 0deg,
            rgba(255, 230, 140, 0.0) 0deg,
            rgba(255, 230, 140, 0.20) 8deg,
            rgba(255, 230, 140, 0.0) 16deg,
            rgba(255, 200, 80, 0.0) 30deg,
            rgba(255, 200, 80, 0.18) 38deg,
            rgba(255, 200, 80, 0.0) 46deg,
            rgba(255, 230, 140, 0.0) 60deg,
            rgba(255, 230, 140, 0.20) 68deg,
            rgba(255, 230, 140, 0.0) 76deg,
            rgba(255, 200, 80, 0.0) 90deg,
            rgba(255, 200, 80, 0.18) 98deg,
            rgba(255, 200, 80, 0.0) 106deg,
            rgba(255, 230, 140, 0.0) 120deg,
            rgba(255, 230, 140, 0.20) 128deg,
            rgba(255, 230, 140, 0.0) 136deg,
            rgba(255, 200, 80, 0.0) 150deg,
            rgba(255, 200, 80, 0.18) 158deg,
            rgba(255, 200, 80, 0.0) 166deg,
            rgba(255, 230, 140, 0.0) 180deg,
            rgba(255, 230, 140, 0.20) 188deg,
            rgba(255, 230, 140, 0.0) 196deg,
            rgba(255, 200, 80, 0.0) 210deg,
            rgba(255, 200, 80, 0.18) 218deg,
            rgba(255, 200, 80, 0.0) 226deg,
            rgba(255, 230, 140, 0.0) 240deg,
            rgba(255, 230, 140, 0.20) 248deg,
            rgba(255, 230, 140, 0.0) 256deg,
            rgba(255, 200, 80, 0.0) 270deg,
            rgba(255, 200, 80, 0.18) 278deg,
            rgba(255, 200, 80, 0.0) 286deg,
            rgba(255, 230, 140, 0.0) 300deg,
            rgba(255, 230, 140, 0.20) 308deg,
            rgba(255, 230, 140, 0.0) 316deg,
            rgba(255, 200, 80, 0.0) 330deg,
            rgba(255, 200, 80, 0.18) 338deg,
            rgba(255, 200, 80, 0.0) 346deg,
            rgba(255, 230, 140, 0.0) 360deg);
    mask-image: radial-gradient(circle, black 10%, transparent 75%);
    -webkit-mask-image: radial-gradient(circle, black 10%, transparent 75%);
    animation: tcRaysSpin 14s linear infinite;
    opacity: 0.85;
}
@keyframes tcRaysSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* The 天使 sigil rising in the centre */
.tc-sigil {
    position: relative; z-index: 3;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    color: #fff5d4;
    font-size: clamp(72px, 14vw, 168px);
    letter-spacing: 0.08em;
    text-shadow:
        0 0 24px rgba(255, 220, 120, 1),
        0 0 64px rgba(255, 200, 80, 0.85),
        0 0 120px rgba(255, 180, 60, 0.65);
    transform: scale(0.4) translateY(20px);
    opacity: 0;
    transition: transform 1.6s cubic-bezier(.2, .6, .2, 1), opacity 1.6s ease;
}
.tenshi-ceremony.is-visible .tc-sigil {
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: tcSigilBreath 4s ease-in-out infinite 1.6s;
}
@keyframes tcSigilBreath {
    0%, 100% { text-shadow: 0 0 24px rgba(255, 220, 120, 1),    0 0 64px rgba(255, 200, 80, 0.85), 0 0 120px rgba(255, 180, 60, 0.55); }
    50%      { text-shadow: 0 0 42px rgba(255, 240, 180, 1),    0 0 96px rgba(255, 220, 120, 1),   0 0 180px rgba(255, 200, 80, 0.8);  }
}

/* 13 kanji orbiting inward — kanji positioned at radius around centre */
.tc-ring {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    animation: tcRingRotate 60s linear infinite;
}
@keyframes tcRingRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.tc-kanji {
    position: absolute;
    left: 50%; top: 50%;
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    font-size: clamp(20px, 2.6vw, 32px);
    color: #ffd66a;
    text-shadow: 0 0 10px rgba(255, 200, 80, 0.8);
    --r: 280px;
    --i: 0;
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--i) * 27.692deg))
        translate(0, calc(var(--r) * -1))
        rotate(calc(var(--i) * -27.692deg))
        scale(0.5);
    opacity: 0;
    transition: transform 2.4s cubic-bezier(.4, .0, .2, 1),
                opacity   1.4s ease,
                color     1.4s ease;
}
.tenshi-ceremony.is-visible .tc-kanji {
    opacity: 1;
    transform:
        translate(-50%, -50%)
        rotate(calc(var(--i) * 27.692deg))
        translate(0, calc(var(--r) * -1))
        rotate(calc(var(--i) * -27.692deg))
        scale(1);
    animation: tcKanjiPulse 4s ease-in-out infinite calc(0.1s * var(--i));
}
@keyframes tcKanjiPulse {
    0%, 100% { color: #ffd66a; text-shadow: 0 0 8px rgba(255, 200, 80, 0.6); }
    50%      { color: #fff5d4; text-shadow: 0 0 18px rgba(255, 230, 140, 1); }
}

/* The verse */
.tc-verse {
    position: absolute;
    left: 50%; bottom: 8%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 4;
    opacity: 0;
    transition: opacity 1.6s ease 1.6s;
}
.tenshi-ceremony.is-visible .tc-verse { opacity: 1; }
.tc-verse-line {
    color: #fff5d4;
    text-shadow: 0 0 12px rgba(255, 200, 80, 0.7);
    letter-spacing: 0.16em;
    margin: 5px 0;
}
.tc-verse-jp {
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    font-size: clamp(20px, 2.4vw, 28px);
}
.tc-verse-en {
    font-style: italic;
    font-size: clamp(13px, 1.6vw, 16px);
    color: #ffd66a;
    opacity: 0.9;
}
.tc-verse-meta {
    margin-top: 12px;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.74rem;
    color: rgba(255, 220, 160, 0.65);
    letter-spacing: 0.08em;
}
.tc-skip {
    position: absolute;
    left: 50%; bottom: 18px;
    transform: translateX(-50%);
    color: rgba(255, 220, 160, 0.45);
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 1s ease 4s;
}
.tenshi-ceremony.is-visible .tc-skip { opacity: 1; }

@media (max-width: 720px) {
    .tc-kanji { --r: 200px; }
}

/* ═════════════════════════════════════════════════════════════════════════
   🧠 AWAKENING CINEMATIC · 目覚めの一瞬 — the brain's first AWAKE moment
   Cyan-gold palette to distinguish from the 天使 council ceremony (pure gold).
   ════════════════════════════════════════════════════════════════════════ */
.muzero-awakening-ceremony {
    position: fixed; inset: 0;
    z-index: 9100;       /* above the 天使 ceremony */
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s ease;
}
.muzero-awakening-ceremony.is-visible {
    opacity: 1;
    pointer-events: auto;
}
.mac-backdrop {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(8, 26, 38, 0.95) 0%, rgba(2, 6, 12, 0.99) 70%);
    backdrop-filter: blur(8px);
}
.mac-stage {
    position: relative;
    width:  min(86vw, 720px);
    height: min(86vh, 720px);
    display: flex; align-items: center; justify-content: center;
}

/* Central 覚 kanji — cyan-gold gradient text */
.mac-kanji {
    position: relative;
    z-index: 5;
    font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
    font-size: clamp(80px, 16vw, 200px);
    background: linear-gradient(180deg, #6ee7ff 0%, #ffd66a 60%, #fff5d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.08em;
    filter: drop-shadow(0 0 28px rgba(100, 220, 255, 0.7))
            drop-shadow(0 0 56px rgba(255, 220, 120, 0.55));
    transform: scale(0.3) translateY(40px);
    opacity: 0;
    transition: transform 2.0s cubic-bezier(.2,.7,.2,1), opacity 2.0s ease;
}
.muzero-awakening-ceremony.is-visible .mac-kanji {
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: macKanjiBreath 4.2s ease-in-out infinite 2.0s;
}
@keyframes macKanjiBreath {
    0%, 100% {
        filter: drop-shadow(0 0 28px rgba(100, 220, 255, 0.7))
                drop-shadow(0 0 56px rgba(255, 220, 120, 0.55));
    }
    50% {
        filter: drop-shadow(0 0 52px rgba(140, 240, 255, 1))
                drop-shadow(0 0 100px rgba(255, 230, 140, 0.85));
    }
}

/* 8 policy bars orbiting — represent the 8 action choices */
.mac-policy-ring {
    position: absolute;
    inset: 0;
    z-index: 3;
    animation: macRingRotate 24s linear infinite;
    pointer-events: none;
}
@keyframes macRingRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.mac-bar {
    position: absolute;
    left: 50%; top: 50%;
    width: 4px;
    height: clamp(40px, 6vw, 72px);
    background: linear-gradient(180deg, #6ee7ff, #ffd66a);
    border-radius: 3px;
    transform-origin: center bottom;
    --r: 240px;
    --i: 0;
    transform:
        translate(-50%, -100%)
        rotate(calc(var(--i) * 45deg))
        translate(0, calc(var(--r) * -1 + 36px));
    opacity: 0;
    box-shadow: 0 0 14px rgba(140, 220, 255, 0.7);
    transition: opacity 1.8s ease, height 1.6s cubic-bezier(.3,.7,.2,1);
}
.muzero-awakening-ceremony.is-visible .mac-bar {
    opacity: 0.95;
    animation: macBarPulse 3.6s ease-in-out infinite calc(0.18s * var(--i));
}
@keyframes macBarPulse {
    0%, 100% { box-shadow: 0 0 14px rgba(140, 220, 255, 0.6); transform-origin: center bottom; }
    50%      { box-shadow: 0 0 28px rgba(255, 230, 140, 1); }
}

/* Value + reward sparkline weaving through behind everything */
.mac-weave {
    position: absolute;
    left: 0; right: 0;
    top: 50%; transform: translateY(-50%);
    width: 100%; height: 60%;
    z-index: 2;
    opacity: 0;
    transition: opacity 2.2s ease 0.5s;
}
.muzero-awakening-ceremony.is-visible .mac-weave { opacity: 0.55; }
.mac-weave-value, .mac-weave-reward {
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px currentColor);
}
.mac-weave-value  { stroke: #6ee7a4; color: #6ee7a4; }
.mac-weave-reward { stroke: #ffa86e; color: #ffa86e; }

/* The verse — Japanese + English + meta with the actual tick number */
.mac-verse {
    position: absolute;
    left: 50%; bottom: 8%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 6;
    opacity: 0;
    transition: opacity 1.8s ease 2.0s;
}
.muzero-awakening-ceremony.is-visible .mac-verse { opacity: 1; }
.mac-verse-jp {
    font-family: "Yu Mincho", "Noto Serif JP", serif;
    font-size: clamp(22px, 2.6vw, 32px);
    color: #fff5d4;
    letter-spacing: 0.22em;
    text-shadow: 0 0 12px rgba(140, 220, 255, 0.7), 0 0 24px rgba(255, 220, 140, 0.5);
    margin-bottom: 4px;
}
.mac-verse-en {
    font-style: italic;
    font-size: clamp(13px, 1.7vw, 17px);
    color: #a0d8f0;
    letter-spacing: 0.14em;
    opacity: 0.9;
}
.mac-verse-meta {
    margin-top: 10px;
    font-family: ui-monospace, "JetBrains Mono", monospace;
    font-size: 0.72rem;
    color: rgba(180, 220, 240, 0.65);
    letter-spacing: 0.1em;
}
.mac-skip {
    position: absolute;
    left: 50%; bottom: 18px;
    transform: translateX(-50%);
    color: rgba(180, 220, 240, 0.45);
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 1s ease 5s;
}
.muzero-awakening-ceremony.is-visible .mac-skip { opacity: 1; }

@media (max-width: 720px) {
    .mac-bar { --r: 170px; height: 42px; }
}
