/* The incoming-call screen an invite link opens (invite.js adds .ringing).
   Shaped like the iPhone's own: who's calling at the top, Answer at the
   bottom. Colors are the app's: brand #8E25C9, bright #C56BFF. */

.ring { display: none; }

html.ringing,
html.ringing body {
    height: 100%;
    background: #0d0612;
}

html.ringing #bg-canvas,
html.ringing .contact-link { display: none; }

html.ringing .ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100%;
    padding: max(64px, env(safe-area-inset-top)) 16px max(48px, env(safe-area-inset-bottom));
    background: radial-gradient(120% 70% at 50% 0%, #3a1257 0%, #160a22 55%, #0d0612 100%);
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    text-align: center;
}

.ring-caller {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.ring-label {
    font-size: 17px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

.ring-title {
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.15;
}

.ring-icon {
    position: relative;
    width: 112px;
    height: 112px;
    margin-bottom: 18px;
}

.ring-icon img {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 26px;
    z-index: 1;
}

/* Two rings pulsing out from the icon, offset by half a beat. */
.ring-icon::before,
.ring-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    border: 2px solid #c56bff;
    animation: ring-pulse 2s ease-out infinite;
}
.ring-icon::after { animation-delay: 1s; }

@keyframes ring-pulse {
    from { transform: scale(1); opacity: 0.7; }
    to   { transform: scale(1.7); opacity: 0; }
}

.ring-answer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    font-size: 15px;
}

.ring-answer-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: #30d158;
    box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.6);
    animation: answer-glow 1.6s ease-out infinite;
}

.ring-answer-button svg {
    width: 34px;
    height: 34px;
    fill: #ffffff;
}

@keyframes answer-glow {
    from { box-shadow: 0 0 0 0 rgba(48, 209, 88, 0.55); }
    to   { box-shadow: 0 0 0 22px rgba(48, 209, 88, 0); }
}

.ring-note {
    margin-top: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
}

@media (prefers-reduced-motion: reduce) {
    .ring-icon::before, .ring-icon::after, .ring-answer-button { animation: none; }
}
