:root {
  --bg-dark-1: #0b0f1a;
  --bg-dark-2: #1a1030;
  --bg-dark-3: #2a1245;
  --accent-purple: #7b5cf0;
  --accent-purple-light: #9d7bfa;
  --accent-green: #2ecc71;
  --accent-red: #ff4d5e;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh;
  background: #05060a;
  overflow: hidden;
  overscroll-behavior: none;
}

.simulator-wrapper {
  position: relative;
  width: 100%;
  height: 100dvh;
}

.phone-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  background: #05060a;
  padding: 0;
}

.phone-frame.is-ringing {
  animation: phone-vibrate 0.32s ease-in-out infinite;
}

@keyframes phone-vibrate {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-2px, 1px) rotate(-0.6deg); }
  40% { transform: translate(2px, -1px) rotate(0.6deg); }
  60% { transform: translate(-2px, -1px) rotate(-0.5deg); }
  80% { transform: translate(2px, 1px) rotate(0.5deg); }
}

.phone-notch {
  display: none;
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #0b0f1e;
  display: flex;
  flex-direction: column;
}

.call-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.call-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(38px) saturate(1.15) brightness(0.6);
  transform: scale(1.2);
}

.call-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 10, 0.55) 0%, rgba(5, 6, 10, 0.25) 30%, rgba(5, 6, 10, 0.55) 70%, rgba(5, 6, 10, 0.85) 100%);
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 28px 0;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 4;
}

.status-icons {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

.call-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 20px;
  padding: 20px 24px 0;
}

.incoming-glow {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(123, 92, 240, 0.45), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
  animation: pulse-glow 2.4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.9; transform: translateX(-50%) scale(1.12); }
}

.avatar-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-purple-light);
  opacity: 0.6;
  animation: ring-expand 2.2s ease-out infinite;
}

.avatar-ring--delayed {
  animation-delay: 1.1s;
}

@keyframes ring-expand {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(1.55); opacity: 0; }
}

.avatar {
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.caller-info {
  text-align: center;
  z-index: 2;
  padding-top: 24px;
}

.caller-name {
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.call-type {
  color: var(--text-secondary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.call-type-icon {
  color: var(--accent-purple-light);
}

.call-actions {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding: 0 40px calc(env(safe-area-inset-bottom, 0px) + 48px);
  z-index: 3;
}

.action-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.action-btn {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.action-btn:hover {
  transform: translateY(-3px) scale(1.05);
}

.action-btn:active {
  transform: scale(0.94);
}

.action-btn--decline {
  background: linear-gradient(145deg, #ff6a75, var(--accent-red));
  box-shadow: 0 10px 24px rgba(255, 77, 94, 0.45);
}

.action-btn--accept {
  background: linear-gradient(145deg, #3fe08a, var(--accent-green));
  box-shadow: 0 10px 24px rgba(46, 204, 113, 0.45);
}

.action-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.status-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.status-overlay.is-visible {
  opacity: 1;
}

.status-message {
  background: rgba(0, 0, 0, 0.75);
  color: var(--text-primary);
  padding: 14px 26px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
}

@media (min-width: 641px) {
  body {
    overflow: auto;
    background: radial-gradient(circle at 20% 20%, #241542, transparent 60%),
                radial-gradient(circle at 80% 0%, #1a2a52, transparent 55%),
                linear-gradient(160deg, var(--bg-dark-1), var(--bg-dark-2) 55%, var(--bg-dark-3));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .simulator-wrapper {
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .phone-frame {
    position: relative;
    inset: auto;
    width: 375px;
    height: 812px;
    border-radius: 46px;
    padding: 12px;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.06),
      0 30px 60px -20px rgba(0, 0, 0, 0.7),
      0 0 90px rgba(123, 92, 240, 0.25);
  }

  .phone-notch {
    display: block;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 26px;
    background: #05060a;
    border-radius: 0 0 18px 18px;
    z-index: 5;
  }

  .phone-screen {
    border-radius: 36px;
  }
}
