/* Colorful ball talker voice guide */
.rcx-voice-guide {
    position: fixed;
    inset: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(88px + env(safe-area-inset-bottom, 0px));
    animation: rcxVoiceFadeIn 0.45s ease;
}

.rcx-voice-guide__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(56, 189, 248, 0.18), transparent 42%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.16), transparent 40%),
        radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.12), transparent 45%),
        rgba(2, 6, 23, 0.62);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.rcx-voice-guide__grid {
    position: relative;
    z-index: 1;
    width: min(540px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.rcx-voice-guide__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.35);
    background: rgba(76, 29, 149, 0.35);
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.2);
}

/* ── Ball talker ── */
.rcx-ball-talker {
    position: relative;
    width: 148px;
    height: 148px;
    display: grid;
    place-items: center;
}

.rcx-ball-talker--sm {
    width: 58px;
    height: 58px;
}

.rcx-ball-talker__orbit {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    animation: rcxBallOrbit 4s linear infinite;
}

.rcx-ball-talker__orbit--a {
    inset: 0;
    border-top-color: rgba(34, 211, 238, 0.75);
    border-right-color: rgba(168, 85, 247, 0.45);
}

.rcx-ball-talker__orbit--b {
    inset: 10%;
    border-bottom-color: rgba(236, 72, 153, 0.65);
    border-left-color: rgba(52, 211, 153, 0.45);
    animation-duration: 3.2s;
    animation-direction: reverse;
}

.rcx-ball-talker__orbit--c {
    inset: 20%;
    border-top-color: rgba(251, 191, 36, 0.55);
    animation-duration: 2.6s;
}

.rcx-ball-talker--sm .rcx-ball-talker__orbit--b { inset: 8%; }
.rcx-ball-talker--sm .rcx-ball-talker__orbit--c { inset: 16%; }

.rcx-ball-talker__sphere {
    position: relative;
    width: 72%;
    height: 72%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 38%),
        radial-gradient(circle at 70% 75%, rgba(15, 23, 42, 0.45), transparent 42%),
        linear-gradient(145deg, #22d3ee 0%, #6366f1 38%, #ec4899 72%, #f59e0b 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 18px 50px rgba(99, 102, 241, 0.35),
        0 0 40px rgba(34, 211, 238, 0.25);
    display: grid;
    place-items: center;
    animation: rcxBallFloat 3.5s ease-in-out infinite;
}

.rcx-ball-talker--talking .rcx-ball-talker__sphere {
    animation: rcxBallFloat 3.5s ease-in-out infinite, rcxBallPulse 0.55s ease-in-out infinite alternate;
}

.rcx-ball-talker--talking .rcx-ball-talker__mouth {
    animation: rcxBallTalk 0.24s ease-in-out infinite alternate;
}

.rcx-ball-talker__shine {
    position: absolute;
    top: 14%;
    left: 20%;
    width: 28%;
    height: 18%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    filter: blur(1px);
}

.rcx-ball-talker__face {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rcx-ball-talker__eyes {
    display: flex;
    gap: 14px;
}

.rcx-ball-talker--sm .rcx-ball-talker__eyes { gap: 8px; }

.rcx-ball-talker__eye {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
    animation: rcxBallBlink 4s infinite;
}

.rcx-ball-talker--sm .rcx-ball-talker__eye {
    width: 6px;
    height: 6px;
}

.rcx-ball-talker__mouth {
    width: 22px;
    height: 10px;
    border-radius: 0 0 999px 999px;
    background: rgba(15, 23, 42, 0.85);
    transform-origin: center top;
}

.rcx-ball-talker--sm .rcx-ball-talker__mouth {
    width: 14px;
    height: 6px;
}

/* Wave bars */
.rcx-ball-wave {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    height: 32px;
}

.rcx-ball-wave span {
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #22d3ee, #a855f7, #f472b6);
    animation: rcxBallWave 0.85s ease-in-out infinite;
}

.rcx-ball-wave span:nth-child(2) { animation-delay: 0.1s; }
.rcx-ball-wave span:nth-child(3) { animation-delay: 0.2s; }
.rcx-ball-wave span:nth-child(4) { animation-delay: 0.3s; }
.rcx-ball-wave span:nth-child(5) { animation-delay: 0.4s; }
.rcx-ball-wave span:nth-child(6) { animation-delay: 0.5s; }

.rcx-ball-wave--idle span {
    animation: none;
    height: 5px;
    opacity: 0.35;
}

.rcx-voice-guide__title {
    margin: 0;
    font-size: clamp(1.35rem, 5vw, 1.85rem);
    font-weight: 900;
    letter-spacing: 0.03em;
    background: linear-gradient(105deg, #fff 0%, #c4b5fd 30%, #22d3ee 60%, #f472b6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.rcx-voice-guide__caption {
    min-height: 4.5em;
    margin: 0;
    padding: 16px 18px;
    border-radius: 18px;
    font-size: 0.96rem;
    line-height: 1.65;
    color: #e2e8f0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(49, 46, 129, 0.35));
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.rcx-voice-guide__start {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.55), rgba(236, 72, 153, 0.45));
    color: #fff;
    font-size: 0.94rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 36px rgba(99, 102, 241, 0.28);
}

.rcx-voice-guide__start:active { transform: scale(0.98); }

.rcx-voice-guide__ball-btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    line-height: 0;
}

.rcx-voice-guide__ball-btn:active {
    transform: scale(0.97);
}

.rcx-voice-guide__skip {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 100101;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(18px) saturate(160%);
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.rcx-voice-guide__skip:active { transform: translateX(-50%) scale(0.98); }

/* Inline talk note (disclaimer bar) */
.rcx-talk-note {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(34, 211, 238, 0.08)),
        rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(129, 140, 248, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rcx-talk-note__ball-btn {
    position: relative;
    flex-shrink: 0;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
}

.rcx-talk-note__play {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.55rem;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    border: 2px solid rgba(15, 23, 42, 0.9);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.rcx-talk-note__body {
    flex: 1;
    min-width: 0;
}

.rcx-talk-note__label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a5b4fc;
    margin-bottom: 4px;
}

.rcx-talk-note__text {
    margin: 0 0 8px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #cbd5e1;
}

.rcx-talk-note .rcx-ball-wave {
    height: 18px;
    justify-content: flex-start;
}

.rcx-talk-note .rcx-ball-wave span {
    width: 3px;
}

@keyframes rcxVoiceFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes rcxBallOrbit {
    to { transform: rotate(360deg); }
}

@keyframes rcxBallFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes rcxBallPulse {
    from { box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset, 0 18px 50px rgba(99,102,241,0.35), 0 0 30px rgba(34,211,238,0.2); }
    to { box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset, 0 22px 60px rgba(236,72,153,0.35), 0 0 50px rgba(34,211,238,0.45); }
}

@keyframes rcxBallTalk {
    from { transform: scaleY(0.5); }
    to { transform: scaleY(1.2); }
}

@keyframes rcxBallBlink {
    0%, 92%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes rcxBallWave {
    0%, 100% { height: 5px; opacity: 0.4; }
    50% { height: 26px; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .rcx-ball-talker__orbit,
    .rcx-ball-talker__sphere,
    .rcx-ball-talker--talking .rcx-ball-talker__sphere,
    .rcx-ball-talker__eye,
    .rcx-ball-wave span {
        animation: none !important;
    }
}
